1 |
coldwind 07/12/18 13:41:36 |
2 |
|
3 |
Modified: fltk-1.1.7-xft-and-misc.patch |
4 |
Log: |
5 |
Fix xft patch when xft is disabled, see #202625 |
6 |
(Portage version: 2.1.3.19) |
7 |
|
8 |
Revision Changes Path |
9 |
1.2 x11-libs/fltk/files/fltk-1.1.7-xft-and-misc.patch |
10 |
|
11 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-libs/fltk/files/fltk-1.1.7-xft-and-misc.patch?rev=1.2&view=markup |
12 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-libs/fltk/files/fltk-1.1.7-xft-and-misc.patch?rev=1.2&content-type=text/plain |
13 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-libs/fltk/files/fltk-1.1.7-xft-and-misc.patch?r1=1.1&r2=1.2 |
14 |
|
15 |
Index: fltk-1.1.7-xft-and-misc.patch |
16 |
=================================================================== |
17 |
RCS file: /var/cvsroot/gentoo-x86/x11-libs/fltk/files/fltk-1.1.7-xft-and-misc.patch,v |
18 |
retrieving revision 1.1 |
19 |
retrieving revision 1.2 |
20 |
diff -u -r1.1 -r1.2 |
21 |
--- fltk-1.1.7-xft-and-misc.patch 15 Dec 2007 21:12:22 -0000 1.1 |
22 |
+++ fltk-1.1.7-xft-and-misc.patch 18 Dec 2007 13:41:35 -0000 1.2 |
23 |
@@ -1,9 +1,33 @@ |
24 |
---- FL/x.H |
25 |
-+++ FL/x.H |
26 |
-@@ -65,10 +65,30 @@ |
27 |
+diff -ur fltk-1.1.7/FL/Fl_Browser_.H fltk-1.1.7.new/FL/Fl_Browser_.H |
28 |
+--- fltk-1.1.7/FL/Fl_Browser_.H 2005-04-16 02:13:17.000000000 +0200 |
29 |
++++ fltk-1.1.7.new/FL/Fl_Browser_.H 2007-12-18 14:13:41.000000000 +0100 |
30 |
+@@ -88,6 +88,7 @@ |
31 |
+ void new_list(); // completely clobber all data, as though list replaced |
32 |
+ void deleting(void *a); // get rid of any pointers to a |
33 |
+ void replacing(void *a,void *b); // change a pointers to b |
34 |
++ void swapping(void *a,void *b); // exchange pointers a and b |
35 |
+ void inserting(void *a,void *b); // insert b near a |
36 |
+ int displayed(void *) const ; // true if this line is visible |
37 |
+ void redraw_line(void *); // minimal update, no change in size |
38 |
+diff -ur fltk-1.1.7/FL/Fl_File_Chooser.H fltk-1.1.7.new/FL/Fl_File_Chooser.H |
39 |
+--- fltk-1.1.7/FL/Fl_File_Chooser.H 2005-08-08 02:50:02.000000000 +0200 |
40 |
++++ fltk-1.1.7.new/FL/Fl_File_Chooser.H 2007-12-18 14:13:41.000000000 +0100 |
41 |
+@@ -145,6 +145,7 @@ |
42 |
+ void preview(int e); |
43 |
+ int preview() const { return previewButton->value(); }; |
44 |
+ void rescan(); |
45 |
++ void rescan_keep_filename(); |
46 |
+ void show(); |
47 |
+ int shown(); |
48 |
+ void textcolor(Fl_Color c); |
49 |
+diff -ur fltk-1.1.7/FL/x.H fltk-1.1.7.new/FL/x.H |
50 |
+--- fltk-1.1.7/FL/x.H 2005-04-16 02:13:17.000000000 +0200 |
51 |
++++ fltk-1.1.7.new/FL/x.H 2007-12-18 14:25:47.000000000 +0100 |
52 |
+@@ -65,10 +65,34 @@ |
53 |
extern FL_EXPORT XVisualInfo *fl_visual; |
54 |
extern FL_EXPORT Colormap fl_colormap; |
55 |
|
56 |
++#if USE_XFT |
57 |
+// access to core fonts |
58 |
+FL_EXPORT XFontStruct* fl_xxfont(); |
59 |
+class Fl_XFont_On_Demand |
60 |
@@ -24,6 +48,9 @@ |
61 |
+ XFontStruct* ptr; |
62 |
+}; |
63 |
+extern FL_EXPORT Fl_XFont_On_Demand fl_xfont; |
64 |
++#else |
65 |
++extern FL_EXPORT XFontStruct* fl_xfont; |
66 |
++#endif |
67 |
+ |
68 |
// drawing functions: |
69 |
extern FL_EXPORT GC fl_gc; |
70 |
@@ -32,39 +59,28 @@ |
71 |
FL_EXPORT ulong fl_xpixel(Fl_Color i); |
72 |
FL_EXPORT ulong fl_xpixel(uchar r, uchar g, uchar b); |
73 |
FL_EXPORT void fl_clip_region(Fl_Region); |
74 |
---- FL/Fl_Browser_.H |
75 |
-+++ FL/Fl_Browser_.H |
76 |
-@@ -88,6 +88,7 @@ |
77 |
- void new_list(); // completely clobber all data, as though list replaced |
78 |
- void deleting(void *a); // get rid of any pointers to a |
79 |
- void replacing(void *a,void *b); // change a pointers to b |
80 |
-+ void swapping(void *a,void *b); // exchange pointers a and b |
81 |
- void inserting(void *a,void *b); // insert b near a |
82 |
- int displayed(void *) const ; // true if this line is visible |
83 |
- void redraw_line(void *); // minimal update, no change in size |
84 |
---- FL/Fl_File_Chooser.H |
85 |
-+++ FL/Fl_File_Chooser.H |
86 |
-@@ -145,6 +145,7 @@ |
87 |
- void preview(int e); |
88 |
- int preview() const { return previewButton->value(); }; |
89 |
- void rescan(); |
90 |
-+ void rescan_keep_filename(); |
91 |
- void show(); |
92 |
- int shown(); |
93 |
- void textcolor(Fl_Color c); |
94 |
---- src/Fl_File_Chooser.cxx |
95 |
-+++ src/Fl_File_Chooser.cxx |
96 |
-@@ -375,7 +375,7 @@ |
97 |
- window->show(); |
98 |
- Fl::flush(); |
99 |
- fl_cursor(FL_CURSOR_WAIT); |
100 |
--rescan(); |
101 |
-+rescan_keep_filename(); |
102 |
- fl_cursor(FL_CURSOR_DEFAULT); |
103 |
- fileName->take_focus(); |
104 |
+diff -ur fltk-1.1.7/src/Fl_Browser_.cxx fltk-1.1.7.new/src/Fl_Browser_.cxx |
105 |
+--- fltk-1.1.7/src/Fl_Browser_.cxx 2005-12-31 19:26:01.000000000 +0100 |
106 |
++++ fltk-1.1.7.new/src/Fl_Browser_.cxx 2007-12-18 14:13:41.000000000 +0100 |
107 |
+@@ -470,6 +470,15 @@ |
108 |
+ if (a == max_width_item) {max_width_item = 0; max_width = 0;} |
109 |
} |
110 |
---- src/Fl_Browser.cxx |
111 |
-+++ src/Fl_Browser.cxx |
112 |
+ |
113 |
++void Fl_Browser_::swapping(void* a, void* b) { |
114 |
++ redraw_line(a); |
115 |
++ redraw_line(b); |
116 |
++ if (a == selection_) selection_ = b; |
117 |
++ else if (b == selection_) selection_ = a; |
118 |
++ if (a == top_) top_ = b; |
119 |
++ else if (b == top_) top_ = a; |
120 |
++} |
121 |
++ |
122 |
+ void Fl_Browser_::inserting(void* a, void* b) { |
123 |
+ if (displayed(a)) redraw_lines(); |
124 |
+ if (a == top_) top_ = b; |
125 |
+diff -ur fltk-1.1.7/src/Fl_Browser.cxx fltk-1.1.7.new/src/Fl_Browser.cxx |
126 |
+--- fltk-1.1.7/src/Fl_Browser.cxx 2005-04-16 02:13:17.000000000 +0200 |
127 |
++++ fltk-1.1.7.new/src/Fl_Browser.cxx 2007-12-18 14:13:41.000000000 +0100 |
128 |
@@ -503,6 +503,7 @@ |
129 |
void Fl_Browser::swap(FL_BLINE *a, FL_BLINE *b) { |
130 |
|
131 |
@@ -82,134 +98,21 @@ |
132 |
} |
133 |
|
134 |
void Fl_Browser::swap(int ai, int bi) { |
135 |
---- src/Fl_Window.cxx |
136 |
-+++ src/Fl_Window.cxx |
137 |
-@@ -36,7 +36,7 @@ |
138 |
- #include "flstring.h" |
139 |
- |
140 |
- #ifdef __APPLE_QUARTZ__ |
141 |
--#include <FL/fl_draw.h> |
142 |
-+#include <FL/fl_draw.H> |
143 |
- #endif |
144 |
- |
145 |
- void Fl_Window::_Fl_Window() { |
146 |
---- src/Fl_Font.H |
147 |
-+++ src/Fl_Font.H |
148 |
-@@ -40,9 +40,9 @@ |
149 |
- |
150 |
- #include <config.h> |
151 |
- |
152 |
--# if USE_XFT |
153 |
-+# if USE_XFT && !SUPPRESS_XFT |
154 |
- typedef struct _XftFont XftFont; |
155 |
--# endif // USE_XFT |
156 |
-+# endif // USE_XFT && !SUPPRESS_XFT |
157 |
- |
158 |
- class Fl_FontSize { |
159 |
- public: |
160 |
-@@ -63,7 +63,7 @@ |
161 |
- char *q_name; |
162 |
- int size; |
163 |
- short ascent, descent, q_width; |
164 |
--# elif USE_XFT |
165 |
-+# elif USE_XFT && !SUPPRESS_XFT |
166 |
- XftFont* font; |
167 |
- const char* encoding; |
168 |
- int size; |
169 |
---- src/Fl_mac.cxx |
170 |
-+++ src/Fl_mac.cxx |
171 |
-@@ -121,7 +121,7 @@ |
172 |
- static unsigned short macKeyLookUp[128] = |
173 |
- { |
174 |
- 'a', 's', 'd', 'f', 'h', 'g', 'z', 'x', |
175 |
-- 'c', 'v', 0/*ISO extra ('#' on German keyboard)*/, 'b', 'q', 'w', 'e', 'r', |
176 |
-+ 'c', 'v', '^', 'b', 'q', 'w', 'e', 'r', |
177 |
- |
178 |
- 'y', 't', '1', '2', '3', '4', '6', '5', |
179 |
- '=', '9', '7', '-', '8', '0', ']', 'o', |
180 |
-@@ -2159,14 +2159,15 @@ |
181 |
- Size len = 0; |
182 |
- if (GetCurrentScrap(&scrap) == noErr && scrap != myScrap && |
183 |
- GetScrapFlavorSize(scrap, kScrapFlavorTypeText, &len) == noErr) { |
184 |
-- if ( len > fl_selection_buffer_length[1] ) { |
185 |
-+ if ( len >= fl_selection_buffer_length[1] ) { |
186 |
- fl_selection_buffer_length[1] = len + 32; |
187 |
- delete[] fl_selection_buffer[1]; |
188 |
-- fl_selection_buffer[1] = new char[len]; |
189 |
-+ fl_selection_buffer[1] = new char[len + 32]; |
190 |
- } |
191 |
-+ fl_selection_length[1] = len; len++; |
192 |
- GetScrapFlavorData( scrap, kScrapFlavorTypeText, &len, |
193 |
- fl_selection_buffer[1] ); |
194 |
-- fl_selection_length[1] = len; |
195 |
-+ fl_selection_buffer[1][fl_selection_length[1]] = 0; |
196 |
- // turn all \r characters into \n: |
197 |
- for (int x = 0; x < len; x++) { |
198 |
- if (fl_selection_buffer[1][x] == '\r') |
199 |
---- src/Fl_File_Chooser.fl |
200 |
-+++ src/Fl_File_Chooser.fl |
201 |
-@@ -61,7 +61,7 @@ |
202 |
- fileList->deselect(); |
203 |
- Fl::remove_timeout((Fl_Timeout_Handler)previewCB, this); |
204 |
- window->hide();} |
205 |
-- private xywh {387 242 490 380} type Double resizable |
206 |
-+ private xywh {368 285 490 380} type Double resizable |
207 |
- code0 {if (title) window->label(title);} |
208 |
- code1 {\#include <stdio.h>} |
209 |
- code2 {\#include <stdlib.h>} |
210 |
-@@ -138,7 +138,7 @@ |
211 |
- if (callback_) |
212 |
- (*callback_)(this, data_); |
213 |
- |
214 |
--window->hide();} selected |
215 |
-+window->hide();} |
216 |
- private xywh {313 345 85 25} |
217 |
- code0 {\#include <FL/fl_ask.H>} |
218 |
- code1 {okButton->label(fl_ok);} |
219 |
-@@ -160,7 +160,7 @@ |
220 |
- } |
221 |
- Fl_Window favWindow { |
222 |
- label {Manage Favorites} |
223 |
-- private xywh {437 187 355 150} type Double resizable |
224 |
-+ private xywh {421 56 355 150} type Double resizable |
225 |
- code0 {favWindow->label(manage_favorites_label);} modal size_range {181 150 0 0} visible |
226 |
- } { |
227 |
- Fl_File_Browser favList { |
228 |
-@@ -299,15 +299,18 @@ |
229 |
- } |
230 |
- decl {void rescan();} {public |
231 |
- } |
232 |
-- Function {show()} {return_type void |
233 |
-+ decl {void rescan_keep_filename();} {public |
234 |
-+ } |
235 |
-+ Function {show()} {open return_type void |
236 |
- } { |
237 |
- code {window->hotspot(fileList); |
238 |
- window->show(); |
239 |
- Fl::flush(); |
240 |
- fl_cursor(FL_CURSOR_WAIT); |
241 |
--rescan(); |
242 |
-+rescan_keep_filename(); |
243 |
- fl_cursor(FL_CURSOR_DEFAULT); |
244 |
--fileName->take_focus();} {} |
245 |
-+fileName->take_focus();} {selected |
246 |
-+ } |
247 |
- } |
248 |
- Function {shown()} {return_type int |
249 |
- } { |
250 |
---- src/Fl_Shared_Image.cxx |
251 |
-+++ src/Fl_Shared_Image.cxx |
252 |
-@@ -227,7 +227,7 @@ |
253 |
- fread(header, 1, sizeof(header), fp); |
254 |
- fclose(fp); |
255 |
- } else { |
256 |
-- memset(header, 0, sizeof(header)); |
257 |
-+ return; |
258 |
- } |
259 |
+diff -ur fltk-1.1.7/src/Fl_File_Browser.cxx fltk-1.1.7.new/src/Fl_File_Browser.cxx |
260 |
+--- fltk-1.1.7/src/Fl_File_Browser.cxx 2005-08-18 16:08:17.000000000 +0200 |
261 |
++++ fltk-1.1.7.new/src/Fl_File_Browser.cxx 2007-12-18 14:13:41.000000000 +0100 |
262 |
+@@ -467,7 +467,7 @@ |
263 |
+ { |
264 |
+ sprintf(filename, "%c:/", i); |
265 |
|
266 |
- // Load the image as appropriate... |
267 |
---- src/Fl_File_Chooser2.cxx |
268 |
-+++ src/Fl_File_Chooser2.cxx |
269 |
+- if (i < 'C') |
270 |
++ if (i < 'C') // see also: GetDriveType and GetVolumeInformation in WIN32 |
271 |
+ add(filename, icon); |
272 |
+ else |
273 |
+ add(filename, icon); |
274 |
+diff -ur fltk-1.1.7/src/Fl_File_Chooser2.cxx fltk-1.1.7.new/src/Fl_File_Chooser2.cxx |
275 |
+--- fltk-1.1.7/src/Fl_File_Chooser2.cxx 2005-11-27 15:45:48.000000000 +0100 |
276 |
++++ fltk-1.1.7.new/src/Fl_File_Chooser2.cxx 2007-12-18 14:13:41.000000000 +0100 |
277 |
@@ -854,6 +854,57 @@ |
278 |
update_preview(); |
279 |
} |
280 |
@@ -277,113 +180,97 @@ |
281 |
} |
282 |
} |
283 |
|
284 |
---- src/fl_scroll_area.cxx |
285 |
-+++ src/fl_scroll_area.cxx |
286 |
-@@ -32,6 +32,7 @@ |
287 |
- #include <config.h> |
288 |
- #include <FL/Fl.H> |
289 |
- #include <FL/x.H> |
290 |
-+#include <FL/fl_draw.H> |
291 |
- |
292 |
- // scroll a rectangle and redraw the newly exposed portions: |
293 |
- void fl_scroll(int X, int Y, int W, int H, int dx, int dy, |
294 |
---- src/Fl_Menu.cxx |
295 |
-+++ src/Fl_Menu.cxx |
296 |
-@@ -107,6 +107,7 @@ |
297 |
- int titlex(int); |
298 |
- void autoscroll(int); |
299 |
- void position(int x, int y); |
300 |
-+ int is_inside(int x, int y); |
301 |
- }; |
302 |
- |
303 |
- #define LEADING 4 // extra vertical leading |
304 |
-@@ -458,6 +459,15 @@ |
305 |
- return xx; |
306 |
+diff -ur fltk-1.1.7/src/Fl_File_Chooser.cxx fltk-1.1.7.new/src/Fl_File_Chooser.cxx |
307 |
+--- fltk-1.1.7/src/Fl_File_Chooser.cxx 2005-12-30 11:13:17.000000000 +0100 |
308 |
++++ fltk-1.1.7.new/src/Fl_File_Chooser.cxx 2007-12-18 14:13:41.000000000 +0100 |
309 |
+@@ -375,7 +375,7 @@ |
310 |
+ window->show(); |
311 |
+ Fl::flush(); |
312 |
+ fl_cursor(FL_CURSOR_WAIT); |
313 |
+-rescan(); |
314 |
++rescan_keep_filename(); |
315 |
+ fl_cursor(FL_CURSOR_DEFAULT); |
316 |
+ fileName->take_focus(); |
317 |
} |
318 |
+diff -ur fltk-1.1.7/src/Fl_File_Chooser.fl fltk-1.1.7.new/src/Fl_File_Chooser.fl |
319 |
+--- fltk-1.1.7/src/Fl_File_Chooser.fl 2005-12-30 11:13:17.000000000 +0100 |
320 |
++++ fltk-1.1.7.new/src/Fl_File_Chooser.fl 2007-12-18 14:13:41.000000000 +0100 |
321 |
+@@ -61,7 +61,7 @@ |
322 |
+ fileList->deselect(); |
323 |
+ Fl::remove_timeout((Fl_Timeout_Handler)previewCB, this); |
324 |
+ window->hide();} |
325 |
+- private xywh {387 242 490 380} type Double resizable |
326 |
++ private xywh {368 285 490 380} type Double resizable |
327 |
+ code0 {if (title) window->label(title);} |
328 |
+ code1 {\#include <stdio.h>} |
329 |
+ code2 {\#include <stdlib.h>} |
330 |
+@@ -138,7 +138,7 @@ |
331 |
+ if (callback_) |
332 |
+ (*callback_)(this, data_); |
333 |
|
334 |
-+// return 1, if the given root coordinates are inside the window |
335 |
-+int menuwindow::is_inside(int mx, int my) { |
336 |
-+ if ( mx < x_root() || mx >= x_root() + w() || |
337 |
-+ my < y_root() || my >= y_root() + h()) { |
338 |
-+ return 0; |
339 |
+-window->hide();} selected |
340 |
++window->hide();} |
341 |
+ private xywh {313 345 85 25} |
342 |
+ code0 {\#include <FL/fl_ask.H>} |
343 |
+ code1 {okButton->label(fl_ok);} |
344 |
+@@ -160,7 +160,7 @@ |
345 |
+ } |
346 |
+ Fl_Window favWindow { |
347 |
+ label {Manage Favorites} |
348 |
+- private xywh {437 187 355 150} type Double resizable |
349 |
++ private xywh {421 56 355 150} type Double resizable |
350 |
+ code0 {favWindow->label(manage_favorites_label);} modal size_range {181 150 0 0} visible |
351 |
+ } { |
352 |
+ Fl_File_Browser favList { |
353 |
+@@ -299,15 +299,18 @@ |
354 |
+ } |
355 |
+ decl {void rescan();} {public |
356 |
+ } |
357 |
+- Function {show()} {return_type void |
358 |
++ decl {void rescan_keep_filename();} {public |
359 |
+ } |
360 |
-+ return 1; |
361 |
-+} |
362 |
-+ |
363 |
- //////////////////////////////////////////////////////////////// |
364 |
- // Fl_Menu_Item::popup(...) |
365 |
- |
366 |
-@@ -488,9 +498,20 @@ |
367 |
- int nummenus; |
368 |
- int menubar; // if true p[0] is a menubar |
369 |
- int state; |
370 |
-+ int is_inside(int mx, int my); |
371 |
- }; |
372 |
- static menustate* p; |
373 |
++ Function {show()} {open return_type void |
374 |
+ } { |
375 |
+ code {window->hotspot(fileList); |
376 |
+ window->show(); |
377 |
+ Fl::flush(); |
378 |
+ fl_cursor(FL_CURSOR_WAIT); |
379 |
+-rescan(); |
380 |
++rescan_keep_filename(); |
381 |
+ fl_cursor(FL_CURSOR_DEFAULT); |
382 |
+-fileName->take_focus();} {} |
383 |
++fileName->take_focus();} {selected |
384 |
++ } |
385 |
+ } |
386 |
+ Function {shown()} {return_type int |
387 |
+ } { |
388 |
+diff -ur fltk-1.1.7/src/Fl_Font.H fltk-1.1.7.new/src/Fl_Font.H |
389 |
+--- fltk-1.1.7/src/Fl_Font.H 2005-04-16 02:13:17.000000000 +0200 |
390 |
++++ fltk-1.1.7.new/src/Fl_Font.H 2007-12-18 14:13:41.000000000 +0100 |
391 |
+@@ -40,9 +40,9 @@ |
392 |
|
393 |
-+// return 1 if the coordinates are inside any of the menuwindows |
394 |
-+int menustate::is_inside(int mx, int my) { |
395 |
-+ int i; |
396 |
-+ for (i=nummenus-1; i>=0; i--) { |
397 |
-+ if (p[i]->is_inside(mx, my)) |
398 |
-+ return 1; |
399 |
-+ } |
400 |
-+ return 0; |
401 |
-+} |
402 |
-+ |
403 |
- static inline void setitem(const Fl_Menu_Item* i, int m, int n) { |
404 |
- p->current_item = i; |
405 |
- p->menu_number = m; |
406 |
-@@ -595,14 +616,11 @@ |
407 |
- int mx = Fl::event_x_root(); |
408 |
- int my = Fl::event_y_root(); |
409 |
- int item=0; int mymenu = pp.nummenus-1; |
410 |
-- if (e == FL_PUSH && (!pp.menubar || mymenu) && |
411 |
-- (mx < pp.p[mymenu]->x_root() || |
412 |
-- mx >= (pp.p[mymenu]->x_root() + pp.p[mymenu]->w()) || |
413 |
-- my < pp.p[mymenu]->y_root() || |
414 |
-- my >= (pp.p[mymenu]->y_root() + pp.p[mymenu]->h()))) { |
415 |
-- // Clicking outside menu cancels it... |
416 |
-+ // Clicking or dragging outside menu cancels it... |
417 |
-+ if ((!pp.menubar || mymenu) && !pp.is_inside(mx, my)) { |
418 |
- setitem(0, -1, 0); |
419 |
-- pp.state = DONE_STATE; |
420 |
-+ if (e==FL_PUSH) |
421 |
-+ pp.state = DONE_STATE; |
422 |
- return 1; |
423 |
- } |
424 |
- for (mymenu = pp.nummenus-1; ; mymenu--) { |
425 |
---- src/Fl_Browser_.cxx |
426 |
-+++ src/Fl_Browser_.cxx |
427 |
-@@ -470,6 +470,15 @@ |
428 |
- if (a == max_width_item) {max_width_item = 0; max_width = 0;} |
429 |
- } |
430 |
+ #include <config.h> |
431 |
|
432 |
-+void Fl_Browser_::swapping(void* a, void* b) { |
433 |
-+ redraw_line(a); |
434 |
-+ redraw_line(b); |
435 |
-+ if (a == selection_) selection_ = b; |
436 |
-+ else if (b == selection_) selection_ = a; |
437 |
-+ if (a == top_) top_ = b; |
438 |
-+ else if (b == top_) top_ = a; |
439 |
-+} |
440 |
-+ |
441 |
- void Fl_Browser_::inserting(void* a, void* b) { |
442 |
- if (displayed(a)) redraw_lines(); |
443 |
- if (a == top_) top_ = b; |
444 |
---- src/Fl_File_Browser.cxx |
445 |
-+++ src/Fl_File_Browser.cxx |
446 |
-@@ -467,7 +467,7 @@ |
447 |
- { |
448 |
- sprintf(filename, "%c:/", i); |
449 |
+-# if USE_XFT |
450 |
++# if USE_XFT && !SUPPRESS_XFT |
451 |
+ typedef struct _XftFont XftFont; |
452 |
+-# endif // USE_XFT |
453 |
++# endif // USE_XFT && !SUPPRESS_XFT |
454 |
|
455 |
-- if (i < 'C') |
456 |
-+ if (i < 'C') // see also: GetDriveType and GetVolumeInformation in WIN32 |
457 |
- add(filename, icon); |
458 |
- else |
459 |
- add(filename, icon); |
460 |
---- src/fl_font_xft.cxx |
461 |
-+++ src/fl_font_xft.cxx |
462 |
+ class Fl_FontSize { |
463 |
+ public: |
464 |
+@@ -63,7 +63,7 @@ |
465 |
+ char *q_name; |
466 |
+ int size; |
467 |
+ short ascent, descent, q_width; |
468 |
+-# elif USE_XFT |
469 |
++# elif USE_XFT && !SUPPRESS_XFT |
470 |
+ XftFont* font; |
471 |
+ const char* encoding; |
472 |
+ int size; |
473 |
+diff -ur fltk-1.1.7/src/fl_font_xft.cxx fltk-1.1.7.new/src/fl_font_xft.cxx |
474 |
+--- fltk-1.1.7/src/fl_font_xft.cxx 2005-04-16 02:13:17.000000000 +0200 |
475 |
++++ fltk-1.1.7.new/src/fl_font_xft.cxx 2007-12-18 14:29:56.000000000 +0100 |
476 |
@@ -62,6 +62,52 @@ |
477 |
// are several web pages of information on how to do this. |
478 |
// |
479 |
@@ -437,19 +324,20 @@ |
480 |
#include <X11/Xft/Xft.h> |
481 |
|
482 |
// The predefined fonts that FLTK has: |
483 |
-@@ -90,9 +136,10 @@ |
484 |
+@@ -90,7 +136,12 @@ |
485 |
|
486 |
int fl_font_ = 0; |
487 |
int fl_size_ = 0; |
488 |
--XFontStruct* fl_xfont = 0; |
489 |
++#if USE_XFT |
490 |
+Fl_XFont_On_Demand fl_xfont; |
491 |
++XFontStruct* fl_xxfont(); |
492 |
++#else |
493 |
+ XFontStruct* fl_xfont = 0; |
494 |
++#endif |
495 |
const char* fl_encoding_ = "iso8859-1"; |
496 |
Fl_FontSize* fl_fontsize = 0; |
497 |
-+XFontStruct* fl_xxfont(); |
498 |
|
499 |
- void fl_font(int fnum, int size) { |
500 |
- if (fnum == fl_font_ && size == fl_size_ && |
501 |
-@@ -112,7 +159,9 @@ |
502 |
+@@ -112,7 +163,9 @@ |
503 |
font->first = f; |
504 |
} |
505 |
fl_fontsize = f; |
506 |
@@ -460,7 +348,7 @@ |
507 |
fl_xfont = f->font->u.core.font; |
508 |
#endif // XFT_MAJOR < 2 |
509 |
} |
510 |
-@@ -176,7 +225,6 @@ |
511 |
+@@ -176,7 +229,6 @@ |
512 |
return fl_width((const char *)(&c), 1); |
513 |
} |
514 |
|
515 |
@@ -468,7 +356,7 @@ |
516 |
// This call is used by opengl to get a bitmapped font. |
517 |
XFontStruct* fl_xxfont() { |
518 |
# if XFT_MAJOR > 1 |
519 |
-@@ -192,7 +240,6 @@ |
520 |
+@@ -192,7 +244,6 @@ |
521 |
return xftfont->u.core.font; |
522 |
# endif // XFT_MAJOR > 1 |
523 |
} |
524 |
@@ -476,7 +364,7 @@ |
525 |
|
526 |
#if USE_OVERLAY |
527 |
// Currently Xft does not work with colormapped visuals, so this probably |
528 |
-@@ -223,6 +270,15 @@ |
529 |
+@@ -223,6 +274,15 @@ |
530 |
} |
531 |
|
532 |
void fl_draw(const char *str, int n, int x, int y) { |
533 |
@@ -492,8 +380,142 @@ |
534 |
#if USE_OVERLAY |
535 |
XftDraw*& draw = fl_overlay ? draw_overlay : ::draw; |
536 |
if (fl_overlay) { |
537 |
---- test/preferences.fl |
538 |
-+++ test/preferences.fl |
539 |
+diff -ur fltk-1.1.7/src/Fl_mac.cxx fltk-1.1.7.new/src/Fl_mac.cxx |
540 |
+--- fltk-1.1.7/src/Fl_mac.cxx 2006-01-15 03:26:54.000000000 +0100 |
541 |
++++ fltk-1.1.7.new/src/Fl_mac.cxx 2007-12-18 14:13:41.000000000 +0100 |
542 |
+@@ -121,7 +121,7 @@ |
543 |
+ static unsigned short macKeyLookUp[128] = |
544 |
+ { |
545 |
+ 'a', 's', 'd', 'f', 'h', 'g', 'z', 'x', |
546 |
+- 'c', 'v', 0/*ISO extra ('#' on German keyboard)*/, 'b', 'q', 'w', 'e', 'r', |
547 |
++ 'c', 'v', '^', 'b', 'q', 'w', 'e', 'r', |
548 |
+ |
549 |
+ 'y', 't', '1', '2', '3', '4', '6', '5', |
550 |
+ '=', '9', '7', '-', '8', '0', ']', 'o', |
551 |
+@@ -2159,14 +2159,15 @@ |
552 |
+ Size len = 0; |
553 |
+ if (GetCurrentScrap(&scrap) == noErr && scrap != myScrap && |
554 |
+ GetScrapFlavorSize(scrap, kScrapFlavorTypeText, &len) == noErr) { |
555 |
+- if ( len > fl_selection_buffer_length[1] ) { |
556 |
++ if ( len >= fl_selection_buffer_length[1] ) { |
557 |
+ fl_selection_buffer_length[1] = len + 32; |
558 |
+ delete[] fl_selection_buffer[1]; |
559 |
+- fl_selection_buffer[1] = new char[len]; |
560 |
++ fl_selection_buffer[1] = new char[len + 32]; |
561 |
+ } |
562 |
++ fl_selection_length[1] = len; len++; |
563 |
+ GetScrapFlavorData( scrap, kScrapFlavorTypeText, &len, |
564 |
+ fl_selection_buffer[1] ); |
565 |
+- fl_selection_length[1] = len; |
566 |
++ fl_selection_buffer[1][fl_selection_length[1]] = 0; |
567 |
+ // turn all \r characters into \n: |
568 |
+ for (int x = 0; x < len; x++) { |
569 |
+ if (fl_selection_buffer[1][x] == '\r') |
570 |
+diff -ur fltk-1.1.7/src/Fl_Menu.cxx fltk-1.1.7.new/src/Fl_Menu.cxx |
571 |
+--- fltk-1.1.7/src/Fl_Menu.cxx 2006-01-17 22:04:55.000000000 +0100 |
572 |
++++ fltk-1.1.7.new/src/Fl_Menu.cxx 2007-12-18 14:13:41.000000000 +0100 |
573 |
+@@ -107,6 +107,7 @@ |
574 |
+ int titlex(int); |
575 |
+ void autoscroll(int); |
576 |
+ void position(int x, int y); |
577 |
++ int is_inside(int x, int y); |
578 |
+ }; |
579 |
+ |
580 |
+ #define LEADING 4 // extra vertical leading |
581 |
+@@ -458,6 +459,15 @@ |
582 |
+ return xx; |
583 |
+ } |
584 |
+ |
585 |
++// return 1, if the given root coordinates are inside the window |
586 |
++int menuwindow::is_inside(int mx, int my) { |
587 |
++ if ( mx < x_root() || mx >= x_root() + w() || |
588 |
++ my < y_root() || my >= y_root() + h()) { |
589 |
++ return 0; |
590 |
++ } |
591 |
++ return 1; |
592 |
++} |
593 |
++ |
594 |
+ //////////////////////////////////////////////////////////////// |
595 |
+ // Fl_Menu_Item::popup(...) |
596 |
+ |
597 |
+@@ -488,9 +498,20 @@ |
598 |
+ int nummenus; |
599 |
+ int menubar; // if true p[0] is a menubar |
600 |
+ int state; |
601 |
++ int is_inside(int mx, int my); |
602 |
+ }; |
603 |
+ static menustate* p; |
604 |
+ |
605 |
++// return 1 if the coordinates are inside any of the menuwindows |
606 |
++int menustate::is_inside(int mx, int my) { |
607 |
++ int i; |
608 |
++ for (i=nummenus-1; i>=0; i--) { |
609 |
++ if (p[i]->is_inside(mx, my)) |
610 |
++ return 1; |
611 |
++ } |
612 |
++ return 0; |
613 |
++} |
614 |
++ |
615 |
+ static inline void setitem(const Fl_Menu_Item* i, int m, int n) { |
616 |
+ p->current_item = i; |
617 |
+ p->menu_number = m; |
618 |
+@@ -595,14 +616,11 @@ |
619 |
+ int mx = Fl::event_x_root(); |
620 |
+ int my = Fl::event_y_root(); |
621 |
+ int item=0; int mymenu = pp.nummenus-1; |
622 |
+- if (e == FL_PUSH && (!pp.menubar || mymenu) && |
623 |
+- (mx < pp.p[mymenu]->x_root() || |
624 |
+- mx >= (pp.p[mymenu]->x_root() + pp.p[mymenu]->w()) || |
625 |
+- my < pp.p[mymenu]->y_root() || |
626 |
+- my >= (pp.p[mymenu]->y_root() + pp.p[mymenu]->h()))) { |
627 |
+- // Clicking outside menu cancels it... |
628 |
++ // Clicking or dragging outside menu cancels it... |
629 |
++ if ((!pp.menubar || mymenu) && !pp.is_inside(mx, my)) { |
630 |
+ setitem(0, -1, 0); |
631 |
+- pp.state = DONE_STATE; |
632 |
++ if (e==FL_PUSH) |
633 |
++ pp.state = DONE_STATE; |
634 |
+ return 1; |
635 |
+ } |
636 |
+ for (mymenu = pp.nummenus-1; ; mymenu--) { |
637 |
+diff -ur fltk-1.1.7/src/fl_scroll_area.cxx fltk-1.1.7.new/src/fl_scroll_area.cxx |
638 |
+--- fltk-1.1.7/src/fl_scroll_area.cxx 2005-04-16 02:13:17.000000000 +0200 |
639 |
++++ fltk-1.1.7.new/src/fl_scroll_area.cxx 2007-12-18 14:13:41.000000000 +0100 |
640 |
+@@ -32,6 +32,7 @@ |
641 |
+ #include <config.h> |
642 |
+ #include <FL/Fl.H> |
643 |
+ #include <FL/x.H> |
644 |
++#include <FL/fl_draw.H> |
645 |
+ |
646 |
+ // scroll a rectangle and redraw the newly exposed portions: |
647 |
+ void fl_scroll(int X, int Y, int W, int H, int dx, int dy, |
648 |
+diff -ur fltk-1.1.7/src/Fl_Shared_Image.cxx fltk-1.1.7.new/src/Fl_Shared_Image.cxx |
649 |
+--- fltk-1.1.7/src/Fl_Shared_Image.cxx 2005-04-16 02:13:17.000000000 +0200 |
650 |
++++ fltk-1.1.7.new/src/Fl_Shared_Image.cxx 2007-12-18 14:13:41.000000000 +0100 |
651 |
+@@ -227,7 +227,7 @@ |
652 |
+ fread(header, 1, sizeof(header), fp); |
653 |
+ fclose(fp); |
654 |
+ } else { |
655 |
+- memset(header, 0, sizeof(header)); |
656 |
++ return; |
657 |
+ } |
658 |
+ |
659 |
+ // Load the image as appropriate... |
660 |
+diff -ur fltk-1.1.7/src/Fl_Window.cxx fltk-1.1.7.new/src/Fl_Window.cxx |
661 |
+--- fltk-1.1.7/src/Fl_Window.cxx 2005-12-14 14:51:51.000000000 +0100 |
662 |
++++ fltk-1.1.7.new/src/Fl_Window.cxx 2007-12-18 14:13:41.000000000 +0100 |
663 |
+@@ -36,7 +36,7 @@ |
664 |
+ #include "flstring.h" |
665 |
+ |
666 |
+ #ifdef __APPLE_QUARTZ__ |
667 |
+-#include <FL/fl_draw.h> |
668 |
++#include <FL/fl_draw.H> |
669 |
+ #endif |
670 |
+ |
671 |
+ void Fl_Window::_Fl_Window() { |
672 |
+diff -ur fltk-1.1.7/test/preferences.fl fltk-1.1.7.new/test/preferences.fl |
673 |
+--- fltk-1.1.7/test/preferences.fl 2005-04-08 20:18:26.000000000 +0200 |
674 |
++++ fltk-1.1.7.new/test/preferences.fl 2007-12-18 14:13:41.000000000 +0100 |
675 |
@@ -69,7 +69,7 @@ |
676 |
} |
677 |
} |
678 |
@@ -522,8 +544,9 @@ |
679 |
xywh {38 160 95 20} |
680 |
} |
681 |
} |
682 |
---- test/sudoku.cxx |
683 |
-+++ test/sudoku.cxx |
684 |
+diff -ur fltk-1.1.7/test/sudoku.cxx fltk-1.1.7.new/test/sudoku.cxx |
685 |
+--- fltk-1.1.7/test/sudoku.cxx 2006-01-13 23:46:30.000000000 +0100 |
686 |
++++ fltk-1.1.7.new/test/sudoku.cxx 2007-12-18 14:13:41.000000000 +0100 |
687 |
@@ -547,7 +547,7 @@ |
688 |
break; |
689 |
|
690 |
|
691 |
|
692 |
|
693 |
-- |
694 |
gentoo-commits@g.o mailing list |