summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--x11-libs/fltk/ChangeLog8
-rw-r--r--x11-libs/fltk/Manifest29
-rw-r--r--x11-libs/fltk/files/digest-fltk-1.1.7-r33
-rw-r--r--x11-libs/fltk/files/fltk-1.1.7-xft-and-misc.patch535
-rw-r--r--x11-libs/fltk/fltk-1.1.7-r3.ebuild110
5 files changed, 670 insertions, 15 deletions
diff --git a/x11-libs/fltk/ChangeLog b/x11-libs/fltk/ChangeLog
index 7c1dbc50e314..16ff8fb0a6d6 100644
--- a/x11-libs/fltk/ChangeLog
+++ b/x11-libs/fltk/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for x11-libs/fltk
# Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/x11-libs/fltk/ChangeLog,v 1.94 2007/12/06 08:55:41 nelchael Exp $
+# $Header: /var/cvsroot/gentoo-x86/x11-libs/fltk/ChangeLog,v 1.95 2007/12/15 21:12:22 coldwind Exp $
+
+*fltk-1.1.7-r3 (15 Dec 2007)
+
+ 15 Dec 2007; Santiago M. Mola <coldwind@gentoo.org>
+ +files/fltk-1.1.7-xft-and-misc.patch, +fltk-1.1.7-r3.ebuild:
+ Fix xft support, see #99993 (Thanks to Aaron M. Ucko).
06 Dec 2007; Krzysiek Pawlik <nelchael@gentoo.org> fltk-1.1.7.ebuild,
-fltk-1.1.7-r1.ebuild, fltk-1.1.7-r2.ebuild:
diff --git a/x11-libs/fltk/Manifest b/x11-libs/fltk/Manifest
index 2e804a4c6a1e..9b1a348daa1a 100644
--- a/x11-libs/fltk/Manifest
+++ b/x11-libs/fltk/Manifest
@@ -1,6 +1,3 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
AUX FLTKConfig.cmake 1217 RMD160 5dd0903afe144b63c17dfb50b318b9d994787697 SHA1 2b09f60de6ae8ba1c1d625240e734b0413e643ca SHA256 cefffd18b6320c83aa546c953790b3dab9e4b99c0f43633b6994bdb7db69877e
MD5 8a94e00bc66035bbd574a197b107a950 files/FLTKConfig.cmake 1217
RMD160 5dd0903afe144b63c17dfb50b318b9d994787697 files/FLTKConfig.cmake 1217
@@ -21,6 +18,10 @@ AUX fltk-1.1.7-maxmin-typo.patch 731 RMD160 09a221c93a71e383a7a980d8682d7326a2c8
MD5 de4d1d3c54270f1be1f12091199ee39b files/fltk-1.1.7-maxmin-typo.patch 731
RMD160 09a221c93a71e383a7a980d8682d7326a2c82e8d files/fltk-1.1.7-maxmin-typo.patch 731
SHA256 6783fc5cbc7570a4cdae1424cdc76a6aefb67fed35e8fff1c0dd6db12f8a49fd files/fltk-1.1.7-maxmin-typo.patch 731
+AUX fltk-1.1.7-xft-and-misc.patch 14785 RMD160 2a301b3e644656952559828b75f5c23db73d08b3 SHA1 31616aa00e024ff86a48029dfe6ceff50a184f13 SHA256 4ca222886271bb54ba9e7a76ed887d04170e9dbbf7c5e3c0fe20d9531a70c623
+MD5 284406ad64278faf51060954dbc9f8ec files/fltk-1.1.7-xft-and-misc.patch 14785
+RMD160 2a301b3e644656952559828b75f5c23db73d08b3 files/fltk-1.1.7-xft-and-misc.patch 14785
+SHA256 4ca222886271bb54ba9e7a76ed887d04170e9dbbf7c5e3c0fe20d9531a70c623 files/fltk-1.1.7-xft-and-misc.patch 14785
AUX libs-1.7.diff 960 RMD160 3874beff965b46c4a60e99ba5bb90c563b3501f7 SHA1 136301dbfa9b9a3dc5cad303b53b79c019c942c8 SHA256 bd95ae19749cdeb04701ff91cc97e5c6c4b7bad5c9d07a80af02d98f01d88330
MD5 29c93504c8cba00eee5622ecbf61f134 files/libs-1.7.diff 960
RMD160 3874beff965b46c4a60e99ba5bb90c563b3501f7 files/libs-1.7.diff 960
@@ -30,14 +31,18 @@ EBUILD fltk-1.1.7-r2.ebuild 2890 RMD160 7d5c1d2fce93eed2d48d06e640dacc3a4a0fa647
MD5 0dd3fa92416e7dc4cea5296e8c3c08b1 fltk-1.1.7-r2.ebuild 2890
RMD160 7d5c1d2fce93eed2d48d06e640dacc3a4a0fa647 fltk-1.1.7-r2.ebuild 2890
SHA256 9e9e5674fc2a6969aa4a8a9a57660417cf235576f662561d9c809d370591daea fltk-1.1.7-r2.ebuild 2890
+EBUILD fltk-1.1.7-r3.ebuild 2944 RMD160 62be64f9615d6c43183e697d7af59c47a4517df2 SHA1 376de943a1ce44b0165a8784e88eb9fd5bf12fb1 SHA256 fd1d7f4241a7aee0b26363122cfca7cf8ceb0b0337fdc8d89e5ff51f6624ad43
+MD5 37cff0efdfec071fc5da78510c07913f fltk-1.1.7-r3.ebuild 2944
+RMD160 62be64f9615d6c43183e697d7af59c47a4517df2 fltk-1.1.7-r3.ebuild 2944
+SHA256 fd1d7f4241a7aee0b26363122cfca7cf8ceb0b0337fdc8d89e5ff51f6624ad43 fltk-1.1.7-r3.ebuild 2944
EBUILD fltk-1.1.7.ebuild 2579 RMD160 f561932ed46dd190000ef36f1047ca5d0c4b69c4 SHA1 a5b97ba3f582def4a185dbdfcdb0b4748ebafcbf SHA256 ab83703411a4a50574de3c0c410f88b6abf1ba4f0bff1dae8bc05e24586e177e
MD5 b4e1d27d090acbbc989bb4f80ed9ac7b fltk-1.1.7.ebuild 2579
RMD160 f561932ed46dd190000ef36f1047ca5d0c4b69c4 fltk-1.1.7.ebuild 2579
SHA256 ab83703411a4a50574de3c0c410f88b6abf1ba4f0bff1dae8bc05e24586e177e fltk-1.1.7.ebuild 2579
-MISC ChangeLog 12566 RMD160 d4d10e3b5e23f96ff86a8015fbd808b458988eec SHA1 8a628f3310e03d120b54086e913bf70157374188 SHA256 2864a80fbd4baa7bcc33791fbcbb4866cbb312456960f07a595fa7eb1366c39b
-MD5 1822e1c048dea7605ef41f0a2b94672f ChangeLog 12566
-RMD160 d4d10e3b5e23f96ff86a8015fbd808b458988eec ChangeLog 12566
-SHA256 2864a80fbd4baa7bcc33791fbcbb4866cbb312456960f07a595fa7eb1366c39b ChangeLog 12566
+MISC ChangeLog 12771 RMD160 98685431ff14152bdfca8a26a4b844e82ad183eb SHA1 9a614962d41a2ec57d830bd30ca01d7f4631c6c7 SHA256 59ef573ff436cf9e4819323c678489ebed316e8a6f3602db319d669eb7bfa902
+MD5 d1361ca2dc3e980d9ce23221c8eef06b ChangeLog 12771
+RMD160 98685431ff14152bdfca8a26a4b844e82ad183eb ChangeLog 12771
+SHA256 59ef573ff436cf9e4819323c678489ebed316e8a6f3602db319d669eb7bfa902 ChangeLog 12771
MISC metadata.xml 314 RMD160 24115a7758bbd2c07da47a2ffe4b79bc31cefa59 SHA1 1a4ff85c48bc39f8fac4fafc8ae06c34a290bab2 SHA256 91972db8a2f941249874f23c38338b0c7aa06cc29802074571a3582fb5269516
MD5 aeb16984ffc07732d37c5974c14f28de metadata.xml 314
RMD160 24115a7758bbd2c07da47a2ffe4b79bc31cefa59 metadata.xml 314
@@ -48,10 +53,6 @@ SHA256 613c60277ccfb5adef1c1a6e37c073066872fcf368b663f2ee04193ee1821276 files/di
MD5 b91980ec72860ef3acc1a9256d24aa96 files/digest-fltk-1.1.7-r2 259
RMD160 d7c0cd6b9f600e0c120baae3f417368b27eb7e09 files/digest-fltk-1.1.7-r2 259
SHA256 613c60277ccfb5adef1c1a6e37c073066872fcf368b663f2ee04193ee1821276 files/digest-fltk-1.1.7-r2 259
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.7 (GNU/Linux)
-
-iD8DBQFHV7kSgo/w9rxVVVERAogUAKCCqTmuxEupJtRXXOjVnAVsW1TWXwCeI1yN
-kMteMx6YAcXdfyDQ4JWgY5U=
-=wJyG
------END PGP SIGNATURE-----
+MD5 b91980ec72860ef3acc1a9256d24aa96 files/digest-fltk-1.1.7-r3 259
+RMD160 d7c0cd6b9f600e0c120baae3f417368b27eb7e09 files/digest-fltk-1.1.7-r3 259
+SHA256 613c60277ccfb5adef1c1a6e37c073066872fcf368b663f2ee04193ee1821276 files/digest-fltk-1.1.7-r3 259
diff --git a/x11-libs/fltk/files/digest-fltk-1.1.7-r3 b/x11-libs/fltk/files/digest-fltk-1.1.7-r3
new file mode 100644
index 000000000000..f20ba91db664
--- /dev/null
+++ b/x11-libs/fltk/files/digest-fltk-1.1.7-r3
@@ -0,0 +1,3 @@
+MD5 2e29319119adc9d63b2f26b72cae0a88 fltk-1.1.7-source.tar.bz2 2060757
+RMD160 a539a1c6bb3363e54bc82c7995037c5d8ede9dd7 fltk-1.1.7-source.tar.bz2 2060757
+SHA256 855a97e35da823f205253b865758715872cd2c7720e4dcf134a3b6dc18bfb96a fltk-1.1.7-source.tar.bz2 2060757
diff --git a/x11-libs/fltk/files/fltk-1.1.7-xft-and-misc.patch b/x11-libs/fltk/files/fltk-1.1.7-xft-and-misc.patch
new file mode 100644
index 000000000000..6f695b46b646
--- /dev/null
+++ b/x11-libs/fltk/files/fltk-1.1.7-xft-and-misc.patch
@@ -0,0 +1,535 @@
+--- FL/x.H
++++ FL/x.H
+@@ -65,10 +65,30 @@
+ extern FL_EXPORT XVisualInfo *fl_visual;
+ extern FL_EXPORT Colormap fl_colormap;
+
++// access to core fonts
++FL_EXPORT XFontStruct* fl_xxfont();
++class Fl_XFont_On_Demand
++{
++public:
++ Fl_XFont_On_Demand(XFontStruct* p = NULL) : ptr(p) { }
++ Fl_XFont_On_Demand& operator=(const Fl_XFont_On_Demand& x)
++ { ptr = x.ptr; return *this; }
++ Fl_XFont_On_Demand& operator=(XFontStruct* p)
++ { ptr = p; return *this; }
++ XFontStruct* value() { if (!ptr) { ptr = fl_xxfont(); } return ptr; }
++ operator XFontStruct*() { return value(); }
++ XFontStruct& operator*() { return *value(); }
++ XFontStruct* operator->() { return value(); }
++ bool operator==(const Fl_XFont_On_Demand& x) { return ptr == x.ptr; }
++ bool operator!=(const Fl_XFont_On_Demand& x) { return ptr != x.ptr; }
++private:
++ XFontStruct* ptr;
++};
++extern FL_EXPORT Fl_XFont_On_Demand fl_xfont;
++
+ // drawing functions:
+ extern FL_EXPORT GC fl_gc;
+ extern FL_EXPORT Window fl_window;
+-extern FL_EXPORT XFontStruct* fl_xfont;
+ FL_EXPORT ulong fl_xpixel(Fl_Color i);
+ FL_EXPORT ulong fl_xpixel(uchar r, uchar g, uchar b);
+ FL_EXPORT void fl_clip_region(Fl_Region);
+--- FL/Fl_Browser_.H
++++ FL/Fl_Browser_.H
+@@ -88,6 +88,7 @@
+ void new_list(); // completely clobber all data, as though list replaced
+ void deleting(void *a); // get rid of any pointers to a
+ void replacing(void *a,void *b); // change a pointers to b
++ void swapping(void *a,void *b); // exchange pointers a and b
+ void inserting(void *a,void *b); // insert b near a
+ int displayed(void *) const ; // true if this line is visible
+ void redraw_line(void *); // minimal update, no change in size
+--- FL/Fl_File_Chooser.H
++++ FL/Fl_File_Chooser.H
+@@ -145,6 +145,7 @@
+ void preview(int e);
+ int preview() const { return previewButton->value(); };
+ void rescan();
++ void rescan_keep_filename();
+ void show();
+ int shown();
+ void textcolor(Fl_Color c);
+--- src/Fl_File_Chooser.cxx
++++ src/Fl_File_Chooser.cxx
+@@ -375,7 +375,7 @@
+ window->show();
+ Fl::flush();
+ fl_cursor(FL_CURSOR_WAIT);
+-rescan();
++rescan_keep_filename();
+ fl_cursor(FL_CURSOR_DEFAULT);
+ fileName->take_focus();
+ }
+--- src/Fl_Browser.cxx
++++ src/Fl_Browser.cxx
+@@ -503,6 +503,7 @@
+ void Fl_Browser::swap(FL_BLINE *a, FL_BLINE *b) {
+
+ if ( a == b || !a || !b) return; // nothing to do
++ swapping(a, b);
+ FL_BLINE *aprev = a->prev;
+ FL_BLINE *anext = a->next;
+ FL_BLINE *bprev = b->prev;
+@@ -535,8 +536,6 @@
+ }
+ // Disable cache -- we played around with positions
+ cacheline = 0;
+- // Redraw modified lines
+- redraw_lines();
+ }
+
+ void Fl_Browser::swap(int ai, int bi) {
+--- src/Fl_Window.cxx
++++ src/Fl_Window.cxx
+@@ -36,7 +36,7 @@
+ #include "flstring.h"
+
+ #ifdef __APPLE_QUARTZ__
+-#include <FL/fl_draw.h>
++#include <FL/fl_draw.H>
+ #endif
+
+ void Fl_Window::_Fl_Window() {
+--- src/Fl_Font.H
++++ src/Fl_Font.H
+@@ -40,9 +40,9 @@
+
+ #include <config.h>
+
+-# if USE_XFT
++# if USE_XFT && !SUPPRESS_XFT
+ typedef struct _XftFont XftFont;
+-# endif // USE_XFT
++# endif // USE_XFT && !SUPPRESS_XFT
+
+ class Fl_FontSize {
+ public:
+@@ -63,7 +63,7 @@
+ char *q_name;
+ int size;
+ short ascent, descent, q_width;
+-# elif USE_XFT
++# elif USE_XFT && !SUPPRESS_XFT
+ XftFont* font;
+ const char* encoding;
+ int size;
+--- src/Fl_mac.cxx
++++ src/Fl_mac.cxx
+@@ -121,7 +121,7 @@
+ static unsigned short macKeyLookUp[128] =
+ {
+ 'a', 's', 'd', 'f', 'h', 'g', 'z', 'x',
+- 'c', 'v', 0/*ISO extra ('#' on German keyboard)*/, 'b', 'q', 'w', 'e', 'r',
++ 'c', 'v', '^', 'b', 'q', 'w', 'e', 'r',
+
+ 'y', 't', '1', '2', '3', '4', '6', '5',
+ '=', '9', '7', '-', '8', '0', ']', 'o',
+@@ -2159,14 +2159,15 @@
+ Size len = 0;
+ if (GetCurrentScrap(&scrap) == noErr && scrap != myScrap &&
+ GetScrapFlavorSize(scrap, kScrapFlavorTypeText, &len) == noErr) {
+- if ( len > fl_selection_buffer_length[1] ) {
++ if ( len >= fl_selection_buffer_length[1] ) {
+ fl_selection_buffer_length[1] = len + 32;
+ delete[] fl_selection_buffer[1];
+- fl_selection_buffer[1] = new char[len];
++ fl_selection_buffer[1] = new char[len + 32];
+ }
++ fl_selection_length[1] = len; len++;
+ GetScrapFlavorData( scrap, kScrapFlavorTypeText, &len,
+ fl_selection_buffer[1] );
+- fl_selection_length[1] = len;
++ fl_selection_buffer[1][fl_selection_length[1]] = 0;
+ // turn all \r characters into \n:
+ for (int x = 0; x < len; x++) {
+ if (fl_selection_buffer[1][x] == '\r')
+--- src/Fl_File_Chooser.fl
++++ src/Fl_File_Chooser.fl
+@@ -61,7 +61,7 @@
+ fileList->deselect();
+ Fl::remove_timeout((Fl_Timeout_Handler)previewCB, this);
+ window->hide();}
+- private xywh {387 242 490 380} type Double resizable
++ private xywh {368 285 490 380} type Double resizable
+ code0 {if (title) window->label(title);}
+ code1 {\#include <stdio.h>}
+ code2 {\#include <stdlib.h>}
+@@ -138,7 +138,7 @@
+ if (callback_)
+ (*callback_)(this, data_);
+
+-window->hide();} selected
++window->hide();}
+ private xywh {313 345 85 25}
+ code0 {\#include <FL/fl_ask.H>}
+ code1 {okButton->label(fl_ok);}
+@@ -160,7 +160,7 @@
+ }
+ Fl_Window favWindow {
+ label {Manage Favorites}
+- private xywh {437 187 355 150} type Double resizable
++ private xywh {421 56 355 150} type Double resizable
+ code0 {favWindow->label(manage_favorites_label);} modal size_range {181 150 0 0} visible
+ } {
+ Fl_File_Browser favList {
+@@ -299,15 +299,18 @@
+ }
+ decl {void rescan();} {public
+ }
+- Function {show()} {return_type void
++ decl {void rescan_keep_filename();} {public
++ }
++ Function {show()} {open return_type void
+ } {
+ code {window->hotspot(fileList);
+ window->show();
+ Fl::flush();
+ fl_cursor(FL_CURSOR_WAIT);
+-rescan();
++rescan_keep_filename();
+ fl_cursor(FL_CURSOR_DEFAULT);
+-fileName->take_focus();} {}
++fileName->take_focus();} {selected
++ }
+ }
+ Function {shown()} {return_type int
+ } {
+--- src/Fl_Shared_Image.cxx
++++ src/Fl_Shared_Image.cxx
+@@ -227,7 +227,7 @@
+ fread(header, 1, sizeof(header), fp);
+ fclose(fp);
+ } else {
+- memset(header, 0, sizeof(header));
++ return;
+ }
+
+ // Load the image as appropriate...
+--- src/Fl_File_Chooser2.cxx
++++ src/Fl_File_Chooser2.cxx
+@@ -854,6 +854,57 @@
+ update_preview();
+ }
+
++//
++// 'Fl_File_Chooser::rescan_keep_filename()' - Rescan the current directory
++// without clearing the filename, then select the file if it is in the list
++//
++
++void
++Fl_File_Chooser::rescan_keep_filename()
++{
++ // if no filename was set, this is likely a diretory browser
++ const char *fn = fileName->value();
++ if (!fn || !*fn || fn[strlen(fn) - 1]=='/') {
++ rescan();
++ return;
++ }
++
++ int i;
++ char pathname[1024]; // New pathname for filename field
++ strlcpy(pathname, fn, sizeof(pathname));
++
++ // Build the file list...
++ fileList->load(directory_, sort);
++
++ // Update the preview box...
++ update_preview();
++
++ // and select the chosen file
++ char found = 0;
++ char *slash = strrchr(pathname, '/');
++ if (slash)
++ slash++;
++ else
++ slash = pathname;
++ for (i = 1; i <= fileList->size(); i ++)
++#if defined(WIN32) || defined(__EMX__)
++ if (strcasecmp(fileList->text(i), slash) == 0) {
++#else
++ if (strcmp(fileList->text(i), slash) == 0) {
++#endif // WIN32 || __EMX__
++ fileList->topline(i);
++ fileList->select(i);
++ found = 1;
++ break;
++ }
++
++ // update OK button activity
++ if (found || type_ & CREATE)
++ okButton->activate();
++ else
++ okButton->deactivate();
++}
++
+
+ //
+ // 'Fl_File_Chooser::showChoiceCB()' - Handle show selections.
+@@ -889,7 +940,7 @@
+
+ if (shown()) {
+ // Rescan the directory...
+- rescan();
++ rescan_keep_filename();
+ }
+ }
+
+--- src/fl_scroll_area.cxx
++++ src/fl_scroll_area.cxx
+@@ -32,6 +32,7 @@
+ #include <config.h>
+ #include <FL/Fl.H>
+ #include <FL/x.H>
++#include <FL/fl_draw.H>
+
+ // scroll a rectangle and redraw the newly exposed portions:
+ void fl_scroll(int X, int Y, int W, int H, int dx, int dy,
+--- src/Fl_Menu.cxx
++++ src/Fl_Menu.cxx
+@@ -107,6 +107,7 @@
+ int titlex(int);
+ void autoscroll(int);
+ void position(int x, int y);
++ int is_inside(int x, int y);
+ };
+
+ #define LEADING 4 // extra vertical leading
+@@ -458,6 +459,15 @@
+ return xx;
+ }
+
++// return 1, if the given root coordinates are inside the window
++int menuwindow::is_inside(int mx, int my) {
++ if ( mx < x_root() || mx >= x_root() + w() ||
++ my < y_root() || my >= y_root() + h()) {
++ return 0;
++ }
++ return 1;
++}
++
+ ////////////////////////////////////////////////////////////////
+ // Fl_Menu_Item::popup(...)
+
+@@ -488,9 +498,20 @@
+ int nummenus;
+ int menubar; // if true p[0] is a menubar
+ int state;
++ int is_inside(int mx, int my);
+ };
+ static menustate* p;
+
++// return 1 if the coordinates are inside any of the menuwindows
++int menustate::is_inside(int mx, int my) {
++ int i;
++ for (i=nummenus-1; i>=0; i--) {
++ if (p[i]->is_inside(mx, my))
++ return 1;
++ }
++ return 0;
++}
++
+ static inline void setitem(const Fl_Menu_Item* i, int m, int n) {
+ p->current_item = i;
+ p->menu_number = m;
+@@ -595,14 +616,11 @@
+ int mx = Fl::event_x_root();
+ int my = Fl::event_y_root();
+ int item=0; int mymenu = pp.nummenus-1;
+- if (e == FL_PUSH && (!pp.menubar || mymenu) &&
+- (mx < pp.p[mymenu]->x_root() ||
+- mx >= (pp.p[mymenu]->x_root() + pp.p[mymenu]->w()) ||
+- my < pp.p[mymenu]->y_root() ||
+- my >= (pp.p[mymenu]->y_root() + pp.p[mymenu]->h()))) {
+- // Clicking outside menu cancels it...
++ // Clicking or dragging outside menu cancels it...
++ if ((!pp.menubar || mymenu) && !pp.is_inside(mx, my)) {
+ setitem(0, -1, 0);
+- pp.state = DONE_STATE;
++ if (e==FL_PUSH)
++ pp.state = DONE_STATE;
+ return 1;
+ }
+ for (mymenu = pp.nummenus-1; ; mymenu--) {
+--- src/Fl_Browser_.cxx
++++ src/Fl_Browser_.cxx
+@@ -470,6 +470,15 @@
+ if (a == max_width_item) {max_width_item = 0; max_width = 0;}
+ }
+
++void Fl_Browser_::swapping(void* a, void* b) {
++ redraw_line(a);
++ redraw_line(b);
++ if (a == selection_) selection_ = b;
++ else if (b == selection_) selection_ = a;
++ if (a == top_) top_ = b;
++ else if (b == top_) top_ = a;
++}
++
+ void Fl_Browser_::inserting(void* a, void* b) {
+ if (displayed(a)) redraw_lines();
+ if (a == top_) top_ = b;
+--- src/Fl_File_Browser.cxx
++++ src/Fl_File_Browser.cxx
+@@ -467,7 +467,7 @@
+ {
+ sprintf(filename, "%c:/", i);
+
+- if (i < 'C')
++ if (i < 'C') // see also: GetDriveType and GetVolumeInformation in WIN32
+ add(filename, icon);
+ else
+ add(filename, icon);
+--- src/fl_font_xft.cxx
++++ src/fl_font_xft.cxx
+@@ -62,6 +62,52 @@
+ // are several web pages of information on how to do this.
+ //
+
++// kludge to pull in the Xlib code as a fallback
++#define Fl_FontSize Fl_Fontsize_xlib
++#define fl_fontsize fl_fontsize_xlib
++#define Fl_Fontdesc Fl_Fontdesc_xlib
++#define fl_fonts fl_fonts_xlib
++#define built_in_table built_in_table_xlib
++#define fl_font_word fl_font_word_xlib
++#define fl_find_fontsize fl_find_fontsize_xlib
++#define fl_encoding fl_encoding_xlib
++#define fl_correct_encoding fl_correct_encoding_xlib
++#define find find_xlib
++#define fl_font_ fl_font__xlib
++#define fl_size_ fl_size__xlib
++#define fl_xfont fl_xfont_xlib
++#define font_gc font_gc_xlib
++#define fl_font fl_font_xlib
++#define fl_height fl_height_xlib
++#define fl_descent fl_descent_xlib
++#define fl_width fl_width_xlib
++#define fl_draw fl_draw_xlib
++#define SUPPRESS_XFT 1
++#undef FL_FONT_
++#include "Fl_Font.H"
++#include "fl_font_x.cxx"
++#undef SUPPRESS_XFT
++#undef Fl_FontSize
++#undef fl_fontsize
++#undef Fl_Fontdesc
++#undef fl_fonts
++#undef built_in_table
++#undef fl_font_word
++#undef fl_find_fontsize
++#undef fl_encoding
++#undef fl_correct_encoding
++#undef find
++#undef fl_font_
++#undef fl_size_
++#undef fl_xfont
++#undef font_gc
++#undef fl_font
++#undef fl_height
++#undef fl_descent
++#undef fl_width
++#undef fl_draw
++
++
+ #include <X11/Xft/Xft.h>
+
+ // The predefined fonts that FLTK has:
+@@ -90,9 +136,10 @@
+
+ int fl_font_ = 0;
+ int fl_size_ = 0;
+-XFontStruct* fl_xfont = 0;
++Fl_XFont_On_Demand fl_xfont;
+ const char* fl_encoding_ = "iso8859-1";
+ Fl_FontSize* fl_fontsize = 0;
++XFontStruct* fl_xxfont();
+
+ void fl_font(int fnum, int size) {
+ if (fnum == fl_font_ && size == fl_size_ &&
+@@ -112,7 +159,9 @@
+ font->first = f;
+ }
+ fl_fontsize = f;
+-#if XFT_MAJOR < 2
++#if defined(XFT_MAJOR) && XFT_MAJOR >= 2
++ fl_xfont = fl_xxfont();
++#else
+ fl_xfont = f->font->u.core.font;
+ #endif // XFT_MAJOR < 2
+ }
+@@ -176,7 +225,6 @@
+ return fl_width((const char *)(&c), 1);
+ }
+
+-#if HAVE_GL
+ // This call is used by opengl to get a bitmapped font.
+ XFontStruct* fl_xxfont() {
+ # if XFT_MAJOR > 1
+@@ -192,7 +240,6 @@
+ return xftfont->u.core.font;
+ # endif // XFT_MAJOR > 1
+ }
+-#endif // HAVE_GL
+
+ #if USE_OVERLAY
+ // Currently Xft does not work with colormapped visuals, so this probably
+@@ -223,6 +270,15 @@
+ }
+
+ void fl_draw(const char *str, int n, int x, int y) {
++ if ( !current_font ) {
++ int saved_font = fl_font_, saved_size = fl_size_;
++ fl_font(FL_HELVETICA, 14);
++ if ( !current_font ) {
++ fl_font_xlib(saved_font, saved_size ? saved_size : fl_size_);
++ fl_draw_xlib(str, n, x, y);
++ return;
++ }
++ }
+ #if USE_OVERLAY
+ XftDraw*& draw = fl_overlay ? draw_overlay : ::draw;
+ if (fl_overlay) {
+--- test/preferences.fl
++++ test/preferences.fl
+@@ -69,7 +69,7 @@
+ }
+ }
+ Fl_Choice wWear {
+- label {Wear:} open
++ label {Wear:} open selected
+ xywh {25 100 105 20} down_box BORDER_BOX align 5
+ } {
+ MenuItem {} {
+@@ -93,15 +93,15 @@
+ xywh {35 120 98 60}
+ } {
+ Fl_Round_Button wLeft {
+- label {left side} selected
++ label {left side}
+ xywh {35 120 95 25} type Radio down_box ROUND_DOWN_BOX
+ }
+ Fl_Round_Button wRight {
+- label {right side} selected
++ label {right side}
+ xywh {35 140 95 25} type Radio down_box ROUND_DOWN_BOX
+ }
+ Fl_Box {} {
+- label {of the bed} selected
++ label {of the bed}
+ xywh {38 160 95 20}
+ }
+ }
+--- test/sudoku.cxx
++++ test/sudoku.cxx
+@@ -547,7 +547,7 @@
+ break;
+
+ case FL_PUSH :
+- if (Fl::event_inside(this)) {
++ if (!readonly() && Fl::event_inside(this)) {
+ if (Fl::event_clicks()) {
+ // 2+ clicks increments/sets value
+ if (value()) {
diff --git a/x11-libs/fltk/fltk-1.1.7-r3.ebuild b/x11-libs/fltk/fltk-1.1.7-r3.ebuild
new file mode 100644
index 000000000000..776ab7c33baf
--- /dev/null
+++ b/x11-libs/fltk/fltk-1.1.7-r3.ebuild
@@ -0,0 +1,110 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/x11-libs/fltk/fltk-1.1.7-r3.ebuild,v 1.1 2007/12/15 21:12:22 coldwind Exp $
+
+inherit eutils toolchain-funcs multilib
+
+DESCRIPTION="C++ user interface toolkit for X and OpenGL."
+HOMEPAGE="http://www.fltk.org"
+SRC_URI="http://ftp.easysw.com/pub/${PN}/${PV}/${P}-source.tar.bz2"
+
+KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd"
+LICENSE="FLTK LGPL-2"
+
+PV_MAJOR=${PV/.*/}
+PV_MINOR=${PV#${PV_MAJOR}.}
+PV_MINOR=${PV_MINOR/.*}
+SLOT="${PV_MAJOR}.${PV_MINOR}"
+
+INCDIR=/usr/include/fltk-${SLOT}
+LIBDIR=/usr/$(get_libdir)/fltk-${SLOT}
+
+IUSE="noxft opengl debug"
+
+DEPEND="
+ x11-libs/libXext
+ x11-libs/libICE
+ x11-libs/libSM
+ x11-libs/libXt
+ x11-proto/xextproto
+ !noxft? ( virtual/xft )
+ media-libs/libpng
+ media-libs/jpeg
+ opengl? ( virtual/opengl )"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}/libs-1.7.diff"
+ epatch "${FILESDIR}/${P}-amd64.patch"
+ epatch "${FILESDIR}/${P}-as-needed.patch"
+ epatch "${FILESDIR}/${P}-dieonerrors.patch"
+ epatch "${FILESDIR}/${P}-maxmin-typo.patch"
+ epatch "${FILESDIR}/${P}-xft-and-misc.patch"
+
+ sed -i -e '/C\(XX\)\?FLAGS=/s:@C\(XX\)\?FLAGS@::' \
+ "${S}/fltk-config.in" || die "unable to sed out compile flags"
+}
+
+src_compile() {
+ local myconf
+ myconf="--enable-shared --enable-xdbe --enable-static --enable-threads"
+
+ if ! use noxft; then
+ myconf="${myconf} --enable-xft"
+ else
+ myconf="${myconf} --disable-xft"
+ fi
+
+ use debug && myconf="${myconf} --enable-debug"
+
+ use opengl || myconf="${myconf} --disable-gl"
+
+ # needed for glibc-2.3.1 (as far as i can test)
+ # otherwise libstdc++ won't be linked. #17894 and #15572
+ # doesn't happen for glibc-2.3.2 - <liquidx@gentoo.org>
+ export CXX=$(tc-getCXX)
+ export CC=$(tc-getCC)
+
+ # bug #19894
+ export C_INCLUDE_PATH="${C_INCLUDE_PATH}:/usr/include/freetype2"
+ export CPLUS_INCLUDE_PATH="${CPLUS_INCLUDE_PATH}:/usr/include/freetype2"
+
+ econf \
+ --includedir=${INCDIR}\
+ --libdir=${LIBDIR} \
+ ${myconf} || die "Configuration Failed"
+
+ emake || die "Parallel Make Failed"
+}
+
+src_install() {
+ einstall \
+ includedir="${D}${INCDIR}" \
+ libdir="${D}${LIBDIR}" || die "Installation Failed"
+
+ ranlib "${D}${LIBDIR}"/*.a
+
+ insinto /usr/share/cmake/Modules
+ doins "${FILESDIR}"/FLTKConfig.cmake CMake/FLTKUse.cmake
+
+ dodoc CHANGES README
+
+ echo "LDPATH=${LIBDIR}" > 99fltk-${SLOT}
+ echo "FLTK_DOCDIR=/usr/share/doc/${PF}/html" >> 99fltk-${SLOT}
+
+ doenvd 99fltk-${SLOT}
+
+ dohtml -A xbm,xpm,h,cxx,fl,menu -r "${D}"/usr/share/doc/fltk/*
+ rm -rf "${D}"/usr/share/doc/fltk
+ rm -rf "${D}"/usr/share/man/cat{1,3}
+
+ sed -i -e 's,^LDFLAGS=.*$,LDFLAGS="",g' "${D}/usr/bin/fltk-config" || \
+ die "sed of fltk-config failed"
+
+}
+
+pkg_postinst() {
+ ewarn "the xft USE flag has been changed to noxft. this was because most"
+ ewarn "users want xft, but if you do not, be sure to change the flag"
+}