1 |
omp 08/05/04 08:44:21 |
2 |
|
3 |
Added: fvwm-2.5.23-translucent-menus.diff |
4 |
Log: |
5 |
Version bump; copied from my subversion repository. (bug #191638) |
6 |
(Portage version: 2.1.5_rc6) |
7 |
|
8 |
Revision Changes Path |
9 |
1.1 x11-wm/fvwm/files/fvwm-2.5.23-translucent-menus.diff |
10 |
|
11 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-wm/fvwm/files/fvwm-2.5.23-translucent-menus.diff?rev=1.1&view=markup |
12 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-wm/fvwm/files/fvwm-2.5.23-translucent-menus.diff?rev=1.1&content-type=text/plain |
13 |
|
14 |
Index: fvwm-2.5.23-translucent-menus.diff |
15 |
=================================================================== |
16 |
Index: fvwm/colorset.c |
17 |
=================================================================== |
18 |
RCS file: /home/cvs/fvwm/fvwm/fvwm/colorset.c,v |
19 |
retrieving revision 1.52 |
20 |
diff -u -r1.52 colorset.c |
21 |
--- fvwm/colorset.c 27 Jan 2007 11:33:15 -0000 1.52 |
22 |
+++ fvwm/colorset.c 5 Feb 2007 19:15:51 -0000 |
23 |
@@ -164,6 +164,8 @@ |
24 |
"NoIconTint", |
25 |
"IconAlpha", |
26 |
|
27 |
+ "Translucent", |
28 |
+ "NoTranslucent", |
29 |
NULL |
30 |
}; |
31 |
|
32 |
@@ -625,6 +627,7 @@ |
33 |
char *fg_tint = NULL; |
34 |
char *bg_tint = NULL; |
35 |
char *icon_tint = NULL; |
36 |
+ char *translucent_tint = NULL; |
37 |
Bool have_pixels_changed = False; |
38 |
Bool has_icon_pixels_changed = False; |
39 |
Bool has_fg_changed = False; |
40 |
@@ -637,6 +640,7 @@ |
41 |
Bool has_fg_tint_changed = False; |
42 |
Bool has_bg_tint_changed = False; |
43 |
Bool has_icon_tint_changed = False; |
44 |
+ Bool has_translucent_tint_changed = False; |
45 |
Bool has_pixmap_changed = False; |
46 |
Bool has_shape_changed = False; |
47 |
Bool has_image_alpha_changed = False; |
48 |
@@ -763,6 +767,10 @@ |
49 |
case 21: /* Plain */ |
50 |
has_pixmap_changed = True; |
51 |
free_colorset_background(cs, True); |
52 |
+ cs->is_translucent = False; |
53 |
+ cs->translucent_tint_percent = 0; |
54 |
+ cs->color_flags &= ~TRANSLUCENT_TINT_SUPPLIED; |
55 |
+ has_translucent_tint_changed = True; |
56 |
break; |
57 |
case 22: /* NoShape */ |
58 |
has_shape_changed = True; |
59 |
@@ -929,6 +937,24 @@ |
60 |
cs->icon_alpha_percent = tmp; |
61 |
} |
62 |
break; |
63 |
+ case 42: /* Translucent */ |
64 |
+ cs->is_translucent = True; |
65 |
+ parse_simple_tint( |
66 |
+ cs, args, &translucent_tint, |
67 |
+ TRANSLUCENT_TINT_SUPPLIED, |
68 |
+ &has_translucent_tint_changed, &percent, |
69 |
+ "Translucent"); |
70 |
+ if (has_translucent_tint_changed) |
71 |
+ { |
72 |
+ cs->translucent_tint_percent = percent; |
73 |
+ } |
74 |
+ break; |
75 |
+ case 43: /* NoTranslucent */ |
76 |
+ cs->is_translucent = False; |
77 |
+ cs->translucent_tint_percent = 0; |
78 |
+ cs->color_flags &= ~TRANSLUCENT_TINT_SUPPLIED; |
79 |
+ has_translucent_tint_changed = True; |
80 |
+ break; |
81 |
default: |
82 |
/* test for ?Gradient */ |
83 |
if (option[0] && StrEquals(&option[1], "Gradient")) |
84 |
@@ -1615,6 +1641,27 @@ |
85 |
} |
86 |
|
87 |
/* |
88 |
+ * ---------- change the translucent tint colour ---------- |
89 |
+ */ |
90 |
+ if (has_translucent_tint_changed) |
91 |
+ { |
92 |
+ /* user specified colour */ |
93 |
+ if (translucent_tint != NULL) |
94 |
+ { |
95 |
+ PictureFreeColors( |
96 |
+ dpy, Pcmap, &cs->translucent_tint, 1, 0, True); |
97 |
+ cs->translucent_tint = GetColor(translucent_tint); |
98 |
+ } |
99 |
+ else |
100 |
+ { |
101 |
+ /* default */ |
102 |
+ PictureFreeColors( |
103 |
+ dpy, Pcmap, &cs->translucent_tint, 1, 0, True); |
104 |
+ cs->translucent_tint = GetColor(black); |
105 |
+ } |
106 |
+ } |
107 |
+ |
108 |
+ /* |
109 |
* ---------- send new colorset to fvwm and clean up ---------- |
110 |
*/ |
111 |
/* make sure the server has this to avoid races */ |
112 |
@@ -1710,6 +1757,7 @@ |
113 |
ncs->fgsh = GetColor(white); |
114 |
ncs->tint = GetColor(black); |
115 |
ncs->icon_tint = GetColor(black); |
116 |
+ ncs->translucent_tint = GetColor(black); |
117 |
ncs->pixmap = XCreatePixmapFromBitmapData( |
118 |
dpy, Scr.NoFocusWin, |
119 |
&g_bits[4 * (nColorsets % 3)], 4, 4, |
120 |
@@ -1727,6 +1775,7 @@ |
121 |
ncs->fgsh = GetForeShadow(ncs->fg, ncs->bg); |
122 |
ncs->tint = GetColor(black); |
123 |
ncs->icon_tint = GetColor(black); |
124 |
+ ncs->translucent_tint = GetColor(black); |
125 |
} |
126 |
ncs->fg_tint = ncs->bg_tint = GetColor(black); |
127 |
/* set flags for fg contrast, bg average */ |
128 |
@@ -1738,6 +1787,7 @@ |
129 |
ncs->icon_alpha_percent = 100; |
130 |
ncs->tint_percent = 0; |
131 |
ncs->icon_tint_percent = 0; |
132 |
+ ncs->translucent_tint_percent = 0; |
133 |
ncs->fg_tint_percent = ncs->bg_tint_percent = 0; |
134 |
ncs->dither = (PictureDitherByDefault())? True:False; |
135 |
nColorsets++; |
136 |
Index: fvwm/menuroot.h |
137 |
=================================================================== |
138 |
RCS file: /home/cvs/fvwm/fvwm/fvwm/menuroot.h,v |
139 |
retrieving revision 1.3 |
140 |
diff -u -r1.3 menuroot.h |
141 |
--- fvwm/menuroot.h 13 Jan 2007 15:07:14 -0000 1.3 |
142 |
+++ fvwm/menuroot.h 5 Feb 2007 19:17:37 -0000 |
143 |
@@ -146,6 +146,9 @@ |
144 |
int d_npixels; |
145 |
} stored_pixels; |
146 |
/* alloc pixels when dithering is used for gradients */ |
147 |
+ /* x,y XMapRaise */ |
148 |
+ int x; |
149 |
+ int y; |
150 |
} MenuRootDynamic; |
151 |
|
152 |
/* access macros to dynamic menu members */ |
153 |
Index: fvwm/menus.c |
154 |
=================================================================== |
155 |
RCS file: /home/cvs/fvwm/fvwm/fvwm/menus.c,v |
156 |
retrieving revision 1.409 |
157 |
diff -u -r1.409 menus.c |
158 |
--- fvwm/menus.c 27 Jan 2007 11:51:15 -0000 1.409 |
159 |
+++ fvwm/menus.c 5 Feb 2007 19:17:50 -0000 |
160 |
@@ -75,6 +75,19 @@ |
161 |
|
162 |
/* ---------------------------- local macros ------------------------------- */ |
163 |
|
164 |
+#define MENU_IS_TRANSLUCENT(mr,cs) \ |
165 |
+ (!MR_IS_TEAR_OFF_MENU(mr) && CSET_IS_TRANSLUCENT(cs)) |
166 |
+#define MENU_IS_TRANSPARENT(mr,cs) \ |
167 |
+ (MENU_IS_TRANSLUCENT(mr,cs) || CSET_IS_TRANSPARENT(cs)) |
168 |
+#define MR_IS_TRANSLUCENT_MENU(mr) \ |
169 |
+ (!MR_IS_TEAR_OFF_MENU(mr) && MR_STYLE(mr) && \ |
170 |
+ ST_HAS_MENU_CSET(MR_STYLE(mr)) && CSET_IS_TRANSLUCENT( \ |
171 |
+ ST_CSET_MENU(MR_STYLE(mr)))) |
172 |
+#define MR_IS_TRANSPARENT_MENU(mr) \ |
173 |
+ (MR_IS_TRANSLUCENT_MENU(mr) || (MR_STYLE(mr) && \ |
174 |
+ ST_HAS_MENU_CSET(MR_STYLE(mr)) && CSET_IS_TRANSPARENT( \ |
175 |
+ ST_CSET_MENU(MR_STYLE(mr))))) |
176 |
+ |
177 |
/* ---------------------------- imports ------------------------------------ */ |
178 |
|
179 |
/* This external is safe. It's written only during startup. */ |
180 |
@@ -188,6 +201,8 @@ |
181 |
} mloop_static_info_t; |
182 |
|
183 |
/* ---------------------------- forward declarations ----------------------- */ |
184 |
+static MenuRoot *seek_submenu_instance( |
185 |
+ MenuRoot *parent_menu, MenuItem *parent_item); |
186 |
|
187 |
/* ---------------------------- local variables ---------------------------- */ |
188 |
|
189 |
@@ -353,12 +368,22 @@ |
190 |
Bool transparent_bg = False; |
191 |
|
192 |
/* move it back */ |
193 |
- if (ST_HAS_MENU_CSET(MR_STYLE(mr)) && |
194 |
- CSET_IS_TRANSPARENT(ST_CSET_MENU(MR_STYLE(mr)))) |
195 |
+ if (MR_IS_TRANSPARENT_MENU(mr)) |
196 |
{ |
197 |
transparent_bg = True; |
198 |
get_menu_repaint_transparent_parameters( |
199 |
&mrtp, mr, fw); |
200 |
+ if (MR_IS_TRANSLUCENT_MENU(mr) && MR_SUBMENU_ITEM(mr)) |
201 |
+ { |
202 |
+ MenuRoot *smr; |
203 |
+ smr = seek_submenu_instance( |
204 |
+ mr, MR_SUBMENU_ITEM(mr)); |
205 |
+ if (smr) |
206 |
+ { |
207 |
+ /* just unmap it here, popdown later */ |
208 |
+ XUnmapWindow(dpy, MR_WINDOW(smr)); |
209 |
+ } |
210 |
+ } |
211 |
} |
212 |
AnimatedMoveOfWindow( |
213 |
MR_WINDOW(mr), act_x, act_y, act_x - MR_XANIMATION(mr), |
214 |
@@ -1779,6 +1804,7 @@ |
215 |
/* Doh. Use the standard display instead. */ |
216 |
MR_CREATE_DPY(mr) = dpy; |
217 |
} |
218 |
+ MR_IS_TEAR_OFF_MENU(mr) = 1; |
219 |
} |
220 |
else |
221 |
{ |
222 |
@@ -2594,7 +2620,37 @@ |
223 |
} |
224 |
MR_IS_PAINTED(mr) = 1; |
225 |
/* paint the menu background */ |
226 |
- if (ms && ST_HAS_MENU_CSET(ms)) |
227 |
+ if (MR_IS_TRANSLUCENT_MENU(mr)) |
228 |
+ { |
229 |
+ Pixmap trans = None; |
230 |
+ FvwmRenderAttributes fra; |
231 |
+ colorset_t *colorset = &Colorset[ST_CSET_MENU(ms)]; |
232 |
+ |
233 |
+ fra.mask = 0; |
234 |
+ if (colorset->translucent_tint_percent > 0) |
235 |
+ { |
236 |
+ fra.mask = FRAM_HAVE_TINT; |
237 |
+ fra.tint = colorset->translucent_tint; |
238 |
+ fra.tint_percent = colorset->translucent_tint_percent; |
239 |
+ } |
240 |
+ if (MR_IS_BACKGROUND_SET(mr) == False) |
241 |
+ { |
242 |
+ trans = PGraphicsCreateTranslucent( |
243 |
+ dpy, MR_WINDOW(mr), &fra, |
244 |
+ BACK_GC(ST_MENU_INACTIVE_GCS(ms)), |
245 |
+ MR_X(mr), MR_Y(mr), MR_WIDTH(mr), MR_HEIGHT(mr)); |
246 |
+ XMapRaised(dpy, MR_WINDOW(mr)); |
247 |
+ if (trans != None) |
248 |
+ { |
249 |
+ XSetWindowBackgroundPixmap( |
250 |
+ dpy, MR_WINDOW(mr), trans); |
251 |
+ MR_IS_BACKGROUND_SET(mr) = True; |
252 |
+ clear_expose_menu_area(MR_WINDOW(mr), pevent); |
253 |
+ XFreePixmap(dpy, trans); |
254 |
+ } |
255 |
+ } |
256 |
+ } |
257 |
+ else if (ms && ST_HAS_MENU_CSET(ms)) |
258 |
{ |
259 |
if (MR_IS_BACKGROUND_SET(mr) == False) |
260 |
{ |
261 |
@@ -3401,10 +3457,7 @@ |
262 |
MR_HAS_POPPED_UP_RIGHT(mr) = 0; |
263 |
} |
264 |
MR_XANIMATION(parent_menu) += end_x - prev_x; |
265 |
- if (ST_HAS_MENU_CSET(MR_STYLE(parent_menu)) && |
266 |
- CSET_IS_TRANSPARENT( |
267 |
- ST_CSET_MENU( |
268 |
- MR_STYLE(parent_menu)))) |
269 |
+ if (MR_IS_TRANSPARENT_MENU(parent_menu)) |
270 |
{ |
271 |
transparent_bg = True; |
272 |
get_menu_repaint_transparent_parameters( |
273 |
@@ -3583,10 +3636,21 @@ |
274 |
*/ |
275 |
|
276 |
XMoveWindow(dpy, MR_WINDOW(mr), x, y); |
277 |
+ MR_X(mr) = x; |
278 |
+ MR_Y(mr) = y; |
279 |
XSelectInput(dpy, MR_WINDOW(mr), event_mask); |
280 |
- XMapRaised(dpy, MR_WINDOW(mr)); |
281 |
- if (popdown_window) |
282 |
- XUnmapWindow(dpy, popdown_window); |
283 |
+ if (MR_IS_TRANSLUCENT_MENU(mr)) |
284 |
+ { |
285 |
+ if (popdown_window) |
286 |
+ XUnmapWindow(dpy, popdown_window); |
287 |
+ paint_menu(mr, NULL, fw); |
288 |
+ } |
289 |
+ else |
290 |
+ { |
291 |
+ XMapRaised(dpy, MR_WINDOW(mr)); |
292 |
+ if (popdown_window) |
293 |
+ XUnmapWindow(dpy, popdown_window); |
294 |
+ } |
295 |
XFlush(dpy); |
296 |
MR_MAPPED_COPIES(mr)++; |
297 |
MST_USAGE_COUNT(mr)++; |
298 |
@@ -6123,16 +6187,122 @@ |
299 |
{ |
300 |
last = True; |
301 |
} |
302 |
- if (!last && CSET_IS_TRANSPARENT_PR_TINT(ST_CSET_MENU(ms))) |
303 |
+ if (!last && |
304 |
+ (CSET_IS_TRANSPARENT_PR_TINT(ST_CSET_MENU(ms)) || |
305 |
+ MR_IS_TRANSLUCENT_MENU(mr))) |
306 |
{ |
307 |
/* too slow ... */ |
308 |
return; |
309 |
} |
310 |
- SetWindowBackgroundWithOffset( |
311 |
- dpy, MR_WINDOW(mr), step_x - current_x, step_y - current_y, |
312 |
- MR_WIDTH(mr), MR_HEIGHT(mr), |
313 |
- &Colorset[ST_CSET_MENU(ms)], Pdepth, |
314 |
- FORE_GC(MST_MENU_INACTIVE_GCS(mr)), False); |
315 |
+ if (MR_IS_TRANSLUCENT_MENU(mr)) |
316 |
+ { |
317 |
+ Pixmap trans, tmp; |
318 |
+ FvwmRenderAttributes fra; |
319 |
+ colorset_t *colorset = &Colorset[ST_CSET_MENU(ms)]; |
320 |
+ |
321 |
+ fra.mask = 0; |
322 |
+ if (colorset->translucent_tint_percent > 0) |
323 |
+ { |
324 |
+ fra.mask = FRAM_HAVE_TINT; |
325 |
+ fra.tint = colorset->translucent_tint; |
326 |
+ fra.tint_percent = colorset->translucent_tint_percent; |
327 |
+ } |
328 |
+ if (current_x == step_x) |
329 |
+ { |
330 |
+ /* Reuse the old pixmap for the part of the menu |
331 |
+ * that has not moved. (This can be extended to get |
332 |
+ * two new rectangles, one in each direction) |
333 |
+ * |
334 |
+ * It saves the unmapping of the window and makes |
335 |
+ * Things less flickering. |
336 |
+ */ |
337 |
+ GC my_gc; |
338 |
+ unsigned long valuemask = GCSubwindowMode; |
339 |
+ XGCValues values; |
340 |
+ int out_y=0; |
341 |
+ values.subwindow_mode = IncludeInferiors; |
342 |
+ if (step_y < 0) |
343 |
+ { |
344 |
+ out_y = -step_y; |
345 |
+ } |
346 |
+ trans = XCreatePixmap(dpy, MR_WINDOW(mr), MR_WIDTH(mr), |
347 |
+ MR_HEIGHT(mr), Pdepth); |
348 |
+ my_gc = fvwmlib_XCreateGC(dpy, MR_WINDOW(mr), 0, NULL); |
349 |
+ XChangeGC(dpy, my_gc, valuemask, &values); |
350 |
+ |
351 |
+ XClearWindow(dpy, MR_WINDOW(mr)); |
352 |
+ |
353 |
+ if (current_y < step_y) |
354 |
+ { |
355 |
+ XCopyArea(dpy, MR_WINDOW(mr), trans, my_gc, 0, |
356 |
+ step_y-current_y, MR_WIDTH(mr), |
357 |
+ MR_HEIGHT(mr)-(step_y-current_y), |
358 |
+ 0,0); |
359 |
+ tmp = PGraphicsCreateTranslucent( |
360 |
+ dpy, MR_WINDOW(mr), &fra, |
361 |
+ BACK_GC(ST_MENU_INACTIVE_GCS(ms)), |
362 |
+ current_x, current_y+MR_HEIGHT(mr), |
363 |
+ MR_WIDTH(mr), step_y-current_y); |
364 |
+ |
365 |
+ XCopyArea(dpy, tmp, trans, my_gc, 0, 0, |
366 |
+ MR_WIDTH(mr), step_y-current_y,0, |
367 |
+ MR_HEIGHT(mr)-(step_y-current_y)); |
368 |
+ } |
369 |
+ else |
370 |
+ { |
371 |
+ XCopyArea(dpy, MR_WINDOW(mr), trans, my_gc, 0, |
372 |
+ 0, MR_WIDTH(mr), |
373 |
+ MR_HEIGHT(mr)-(current_y-step_y), 0, |
374 |
+ current_y-step_y); |
375 |
+ tmp = PGraphicsCreateTranslucent( |
376 |
+ dpy, MR_WINDOW(mr), &fra, |
377 |
+ BACK_GC(ST_MENU_INACTIVE_GCS(ms)), |
378 |
+ current_x,step_y, MR_WIDTH(mr), |
379 |
+ current_y-step_y); |
380 |
+ XCopyArea(dpy, tmp, trans, my_gc, 0, 0, |
381 |
+ MR_WIDTH(mr), current_y-step_y,0, |
382 |
+ out_y); |
383 |
+ } |
384 |
+ MR_X(mr) = step_x; |
385 |
+ MR_Y(mr) = step_y; |
386 |
+ XFreePixmap(dpy, tmp); |
387 |
+ XFreeGC(dpy,my_gc); |
388 |
+ } |
389 |
+ else |
390 |
+ { |
391 |
+ XUnmapWindow(dpy, MR_WINDOW(mr)); |
392 |
+ MR_X(mr) = step_x; |
393 |
+ MR_Y(mr) = step_y; |
394 |
+ trans = PGraphicsCreateTranslucent( |
395 |
+ dpy, MR_WINDOW(mr), &fra, |
396 |
+ BACK_GC(ST_MENU_INACTIVE_GCS(ms)), |
397 |
+ step_x, step_y, MR_WIDTH(mr), |
398 |
+ MR_HEIGHT(mr)); |
399 |
+ XMapRaised(dpy, MR_WINDOW(mr)); |
400 |
+ } |
401 |
+ XSetWindowBackgroundPixmap( |
402 |
+ dpy, MR_WINDOW(mr), trans); |
403 |
+ XFreePixmap(dpy, trans); |
404 |
+ if (current_x == step_x) |
405 |
+ { |
406 |
+ /* Redraw the border */ |
407 |
+ RelieveRectangle( |
408 |
+ dpy, MR_WINDOW(mr), 0, 0, MR_WIDTH(mr) - 1, |
409 |
+ MR_HEIGHT(mr) - 1, (Pdepth < 2) ? |
410 |
+ SHADOW_GC(MST_MENU_INACTIVE_GCS(mr)) : |
411 |
+ HILIGHT_GC(MST_MENU_INACTIVE_GCS(mr)), |
412 |
+ SHADOW_GC(MST_MENU_INACTIVE_GCS(mr)), |
413 |
+ MST_BORDER_WIDTH(mr)); |
414 |
+ } |
415 |
+ } |
416 |
+ else |
417 |
+ { |
418 |
+ SetWindowBackgroundWithOffset( |
419 |
+ dpy, MR_WINDOW(mr), step_x - current_x, |
420 |
+ step_y - current_y, MR_WIDTH(mr), MR_HEIGHT(mr), |
421 |
+ &Colorset[ST_CSET_MENU(ms)], Pdepth, |
422 |
+ FORE_GC(MST_MENU_INACTIVE_GCS(mr)), False); |
423 |
+ } |
424 |
} |
425 |
|
426 |
|
427 |
@@ -6173,10 +6343,7 @@ |
428 |
} |
429 |
if (!is_bg_set) |
430 |
{ |
431 |
- SetWindowBackground( |
432 |
- dpy, MR_WINDOW(mr), MR_WIDTH(mr), MR_HEIGHT(mr), |
433 |
- &Colorset[ST_CSET_MENU(ms)], Pdepth, |
434 |
- FORE_GC(MST_MENU_INACTIVE_GCS(mr)), False); |
435 |
+ update_transparent_menu_bg(prtm, x, y, x, y, end_x, end_y); |
436 |
} |
437 |
/* redraw the background of non active item */ |
438 |
for (mi = MR_FIRST_ITEM(mr); mi != NULL; mi = MI_NEXT_ITEM(mi)) |
439 |
@@ -6813,10 +6980,12 @@ |
440 |
SetWindowBackground( |
441 |
dpy, MR_WINDOW(mr), MR_WIDTH(mr), |
442 |
MR_HEIGHT(mr), |
443 |
- &Colorset[ST_CSET_MENU(ms)], |
444 |
- Pdepth, |
445 |
+ &Colorset[ST_CSET_MENU(ms)], Pdepth, |
446 |
FORE_GC(MST_MENU_INACTIVE_GCS(mr)), |
447 |
- True); |
448 |
+ False); |
449 |
+ XClearArea( |
450 |
+ dpy, MR_WINDOW(mr), 0, 0, MR_WIDTH(mr), |
451 |
+ MR_HEIGHT(mr), True); |
452 |
} |
453 |
else if ((ST_HAS_ACTIVE_CSET(ms) && |
454 |
ST_CSET_ACTIVE(ms) == cset) || |
455 |
Index: fvwm/menus.h |
456 |
=================================================================== |
457 |
RCS file: /home/cvs/fvwm/fvwm/fvwm/menus.h,v |
458 |
retrieving revision 1.111 |
459 |
diff -u -r1.111 menus.h |
460 |
--- fvwm/menus.h 27 Jan 2007 11:51:15 -0000 1.111 |
461 |
+++ fvwm/menus.h 5 Feb 2007 19:17:50 -0000 |
462 |
@@ -15,6 +15,9 @@ |
463 |
#define IS_MENU_RETURN(x) \ |
464 |
((x)==MENU_DONE || (x)==MENU_ABORTED || (x)==MENU_SUBMENU_TORN_OFF) |
465 |
|
466 |
+#define MR_X(m) ((m)->d->x) |
467 |
+#define MR_Y(m) ((m)->d->y) |
468 |
+ |
469 |
struct MenuRoot; |
470 |
struct MenuStyle; |
471 |
struct MenuReturn; |
472 |
Index: libs/Colorset.h |
473 |
=================================================================== |
474 |
RCS file: /home/cvs/fvwm/fvwm/libs/Colorset.h,v |
475 |
retrieving revision 1.38 |
476 |
diff -u -r1.38 Colorset.h |
477 |
--- libs/Colorset.h 10 Jan 2007 00:34:27 -0000 1.38 |
478 |
+++ libs/Colorset.h 5 Feb 2007 19:19:00 -0000 |
479 |
@@ -51,6 +51,10 @@ |
480 |
Bool dither; |
481 |
Bool allows_buffered_transparency; |
482 |
Bool is_maybe_root_transparent; |
483 |
+ /* only use by fvwm menu (non tear-off) */ |
484 |
+ Bool is_translucent; |
485 |
+ Pixel translucent_tint; |
486 |
+ unsigned int translucent_tint_percent : 7; |
487 |
#endif |
488 |
} colorset_t; |
489 |
|
490 |
@@ -78,6 +82,7 @@ |
491 |
#define FG_TINT_SUPPLIED 0x100 |
492 |
#define BG_TINT_SUPPLIED 0x200 |
493 |
#define ICON_TINT_SUPPLIED 0x400 |
494 |
+#define TRANSLUCENT_TINT_SUPPLIED 0x800 |
495 |
#endif |
496 |
|
497 |
/* colorsets are stored as an array of structs to permit fast dereferencing */ |
498 |
@@ -153,6 +158,11 @@ |
499 |
(cset != NULL && cset->pixmap == ParentRelative && \ |
500 |
cset->tint_percent > 0) |
501 |
|
502 |
+#define CSET_IS_TRANSLUCENT(cset) \ |
503 |
+ (cset >= 0 && Colorset[cset].is_translucent) |
504 |
+#define CSETS_IS_TRANSLUCENT(cset) \ |
505 |
+ (cset && cset->is_translucent) |
506 |
+ |
507 |
#ifndef FVWM_COLORSET_PRIVATE |
508 |
/* Create n new colorsets, fvwm/colorset.c does its own thing (different size) |
509 |
*/ |
510 |
Index: libs/PictureGraphics.c |
511 |
=================================================================== |
512 |
RCS file: /home/cvs/fvwm/fvwm/libs/PictureGraphics.c,v |
513 |
retrieving revision 1.29 |
514 |
diff -u -r1.29 PictureGraphics.c |
515 |
--- libs/PictureGraphics.c 27 Jan 2007 11:33:16 -0000 1.29 |
516 |
+++ libs/PictureGraphics.c 5 Feb 2007 19:19:49 -0000 |
517 |
@@ -1340,7 +1340,7 @@ |
518 |
} |
519 |
} |
520 |
|
521 |
-#if 0 /* humm... maybe useful one day with menus */ |
522 |
+#if 1 /* humm... maybe useful one day with menus */ |
523 |
Pixmap PGraphicsCreateTranslucent( |
524 |
Display *dpy, Window win, FvwmRenderAttributes *fra, GC gc, |
525 |
int x, int y, int width, int height) |
526 |
Index: libs/PictureGraphics.h |
527 |
=================================================================== |
528 |
RCS file: /home/cvs/fvwm/fvwm/libs/PictureGraphics.h,v |
529 |
retrieving revision 1.13 |
530 |
diff -u -r1.13 PictureGraphics.h |
531 |
--- libs/PictureGraphics.h 9 May 2006 20:46:29 -0000 1.13 |
532 |
+++ libs/PictureGraphics.h 5 Feb 2007 19:19:49 -0000 |
533 |
@@ -122,7 +122,9 @@ |
534 |
Display *dpy, Window win, Pixel tint, int tint_percent, |
535 |
Drawable dest, Bool dest_is_a_window, GC gc, GC mono_gc, GC alpha_gc, |
536 |
int dest_x, int dest_y, int dest_w, int dest_h); |
537 |
- |
538 |
+Pixmap PGraphicsCreateTranslucent( |
539 |
+ Display *dpy, Window win, FvwmRenderAttributes *fra, GC gc, |
540 |
+ int x, int y, int width, int height); |
541 |
/* never used ! */ |
542 |
Pixmap PGraphicsCreateDitherPixmap( |
543 |
Display *dpy, Window win, Drawable src, Pixmap mask, int depth, GC gc, |
544 |
|
545 |
|
546 |
|
547 |
-- |
548 |
gentoo-commits@l.g.o mailing list |