1 Submitted By: Oliver Brakmann <obrakmann AT gmx DOT net>
3 Initial Package version: Windowmaker 0.91.0
4 Origin: http://vlaadworld.net/
5 Description: Adds translucency to Windowmaker menus. To set the level of
6 translucency, start WPrefs.app and select 'Apperance
7 Preferences -> Options -> Transparency'
9 diff -Naur WindowMaker-0.91.0-orig/WPrefs.app/Appearance.c WindowMaker-0.91.0/WPrefs.app/Appearance.c
10 --- WindowMaker-0.91.0-orig/WPrefs.app/Appearance.c 2004-10-26 18:34:28.000000000 +0200
11 +++ WindowMaker-0.91.0/WPrefs.app/Appearance.c 2004-10-26 18:40:51.000000000 +0200
24 @@ -1714,6 +1719,23 @@
29 +tranceCallback(WMWidget *self, void *data)
31 + _Panel *panel = (_Panel*)data;
35 + i = WMGetSliderValue(panel->tranceSl);
39 + WMSetLabelText(panel->tranceL, "OFF");
41 + sprintf(buffer, "%i%%", i);
42 + WMSetLabelText(panel->tranceL, buffer);
51 panel->taliF = WMCreateFrame(panel->optF);
52 - WMResizeWidget(panel->taliF, 110, 80);
53 + WMResizeWidget(panel->taliF, 105, 80);
54 WMMoveWidget(panel->taliF, 15, 100);
55 WMSetFrameTitle(panel->taliF, _("Title Alignment"));
58 WMSetButtonText(panel->taliB[i], _("Right"));
61 - WMResizeWidget(panel->taliB[i], 90, 18);
62 + WMResizeWidget(panel->taliB[i], 85, 18);
63 WMMoveWidget(panel->taliB[i], 10, 15 + 20*i);
65 WMGroupButtons(panel->taliB[0], panel->taliB[1]);
66 @@ -2031,6 +2053,36 @@
68 WMMapSubwidgets(panel->taliF);
70 + panel->tranceF = WMCreateFrame(panel->optF);
71 + WMResizeWidget(panel->tranceF, 105,80);
72 + WMMoveWidget(panel->tranceF, 125, 100);
73 + WMSetFrameTitle(panel->tranceF,_("Transparency"));
75 + WMSetBalloonTextForView(_("<yermom> i love windowmaker\n"
76 + "<tarzeau> get some fresh sand-wich-es\n"
78 + "<flip-> transparency\n"
80 + "<flip-> :P\n"), WMWidgetView(panel->tranceF));
82 + panel->tranceB = WMCreateSwitchButton(panel->tranceF);
83 + WMSetButtonText(panel->tranceB, _("Menu"));
84 + WMResizeWidget(panel->tranceB,85,18);
85 + WMMoveWidget(panel->tranceB, 10, 15);
87 + panel->tranceSl = WMCreateSlider(panel->tranceF);
88 + WMResizeWidget(panel->tranceSl, 70, 18);
89 + WMMoveWidget(panel->tranceSl, 17, 15 + 20*2);
90 + WMSetSliderMinValue(panel->tranceSl, 0);
91 + WMSetSliderMaxValue(panel->tranceSl, 10);
92 + WMSetSliderAction(panel->tranceSl, tranceCallback, panel);
94 + panel->tranceL = WMCreateLabel(panel->tranceF);
95 + WMResizeWidget(panel->tranceL, 27, 18);
96 + WMMoveWidget(panel->tranceL, 40, 35);
98 + WMMapSubwidgets(panel->tranceF);
100 WMMapSubwidgets(panel->optF);
103 @@ -2089,6 +2141,7 @@
105 showData(_Panel *panel)
111 @@ -2134,6 +2187,13 @@
113 WMSetButtonSelected(panel->mstyB[panel->menuStyle], True);
114 WMSetButtonSelected(panel->taliB[panel->titleAlignment], True);
117 + WMSetButtonSelected(panel->tranceB, GetBoolForKey("MenuTrance"));
119 + x = GetIntegerForKey("TranceAmount");
120 + WMSetSliderValue(panel->tranceSl, x);
121 + tranceCallback(NULL, panel);
125 @@ -2185,6 +2245,9 @@
126 SetStringForKey("center", "TitleJustify");
130 + SetBoolForKey(WMGetButtonSelected(panel->tranceB), "MenuTrance");
131 + SetIntegerForKey(WMGetSliderValue(panel->tranceSl), "TranceAmount");
135 diff -Naur WindowMaker-0.91.0-orig/src/WindowMaker.h WindowMaker-0.91.0/src/WindowMaker.h
136 --- WindowMaker-0.91.0-orig/src/WindowMaker.h 2004-10-26 18:34:28.000000000 +0200
137 +++ WindowMaker-0.91.0/src/WindowMaker.h 2004-10-26 18:40:51.000000000 +0200
139 char opaque_move; /* update window position during */
142 + char menu_trance; /* whether menu should be translucent */
143 + int trance_amount; /* percentage of translucency */
144 char wrap_menus; /* wrap menus at edge of screen */
145 char scrollable_menus; /* let them be scrolled */
146 char align_menus; /* align menu with their parents */
147 diff -Naur WindowMaker-0.91.0-orig/src/defaults.c WindowMaker-0.91.0/src/defaults.c
148 --- WindowMaker-0.91.0-orig/src/defaults.c 2004-10-26 18:34:28.000000000 +0200
149 +++ WindowMaker-0.91.0/src/defaults.c 2004-10-26 18:40:51.000000000 +0200
151 {"UseSaveUnders", "NO", NULL,
152 &wPreferences.use_saveunders, getBool, NULL
154 + {"MenuTrance", "NO", NULL,
155 + &wPreferences.menu_trance, getBool, NULL
157 + {"TranceAmount", "30", NULL,
158 + &wPreferences.trance_amount, getInt, NULL
160 {"OpaqueMove", "NO", NULL,
161 &wPreferences.opaque_move, getBool, NULL
163 diff -Naur WindowMaker-0.91.0-orig/src/menu.c WindowMaker-0.91.0/src/menu.c
164 --- WindowMaker-0.91.0-orig/src/menu.c 2004-10-26 18:34:28.000000000 +0200
165 +++ WindowMaker-0.91.0/src/menu.c 2004-10-26 18:40:51.000000000 +0200
167 static void menuCloseClick(WCoreWindow *sender, void *data, XEvent *event);
169 static void updateTexture(WMenu *menu);
170 +static void clipDimensionsToScreen(WMenu *menu, int *x, int *y, int *width, int *height);
173 static int saveMenuRecurs(WMPropList *menus, WScreen *scr, WMenu *menu);
174 @@ -498,6 +499,120 @@
178 +clipDimensionsToScreen(WMenu *menu, int *x, int *y, int *width, int *height)
183 + sw = menu->menu->screen_ptr->scr_width;
184 + sh = menu->menu->screen_ptr->scr_height;
189 + /* CLAMP everything */
190 + if (*x > sw) { *x = sw; } else if (*x < 0) { *x = 0; }
191 + if (*y > sh) { *y = sh; } else if (*y < 0) { *y = 0; }
192 + if (fx > sw) { fx = sw; } else if (fx < 0) { fx = 0; }
193 + if (fy > sh) { fy = sh; } else if (fy < 0) { fy = 0; }
195 + /* Make sure that height and width are positive */
196 + if (fx < *x) { *width = 0; } else { *width = fx - *x; }
197 + if (fy < *y) { *height = 0; } else { *height = fy - *y; }
201 +tranceMenu(WMenu *menu)
203 + WScreen *scr = menu->menu->screen_ptr;
205 + XImage *back, *front;
206 + RImage *trance, *menu_image, *msnormal;
207 + Pixmap original, result;
209 + int mw, mh, dx, dy; /* these correspond to the menu proper */
210 + int gx, gy, gw, gh; /* these correspond to what we grab from the root window */
212 + unsigned long red_mask, green_mask, blue_mask;
214 + unsigned int w, h, bar;
218 + mw = gw = menu->menu->width;
219 + mh = gh = menu->menu->height;
220 + dx = gx = menu->frame_x + 1;
221 + dy = gy = menu->frame_y + menu->frame->top_width + 1;
223 + tamount = wPreferences.trance_amount;
224 + clipDimensionsToScreen(menu, &gx, &gy, &gw, &gh);
225 + back = XGetImage(dpy, scr->root_win, gx, gy, gw, gh,
226 + AllPlanes, ZPixmap);
228 + wwarning(_("error capturing \"back\" image"),RMessageForError(RErrorCode));
231 + red_mask = back->red_mask;
232 + green_mask = back->green_mask;
233 + blue_mask = back->blue_mask;
235 + trance = RCreateImageFromXImage(scr->rcontext, back, NULL);
236 + XDestroyImage(back);
238 + wwarning(_("error rendering \"trance\" image"),
239 + RMessageForError(RErrorCode));
242 + /************************************************************/
243 + original = renderTexture(menu);
245 + XGetGeometry(dpy, original, &baz, &foo,
246 + &foo, &w, &h, &bar, &bar);
247 + front = XGetImage(dpy, original, 0, 0, w, h,
248 + AllPlanes, ZPixmap);
250 + wwarning(_("error capturing \"front\" image"),
251 + RMessageForError(RErrorCode));
254 + front->red_mask = red_mask;
255 + front->green_mask = green_mask;
256 + front->blue_mask = blue_mask;
258 + menu_image=RCreateImageFromXImage(scr->rcontext,front,NULL);
260 + XDestroyImage(front);
261 + /************************************************************/
263 + FREE_PIXMAP(original);
266 + wwarning(_("error rendering \"menu_image\""),
267 + RMessageForError(RErrorCode));
270 + if (wPreferences.menu_style == MS_NORMAL) {
271 + msnormal = RMakeTiledImage(menu_image, mw, mh);
272 + RCombineAreaWithOpaqueness(trance, msnormal,0,0,gw,gh,
273 + gx - dx,gy - dy,256*tamount/10);
274 + RReleaseImage(menu_image);
275 + RReleaseImage(msnormal);
277 + RCombineAreaWithOpaqueness(trance, menu_image,0,0,gw,gh,
278 + gx - dx,gy - dy,256*tamount/10);
279 + RReleaseImage(menu_image);
281 + RConvertImage(scr->rcontext, trance,
284 + RReleaseImage(trance);
292 updateTexture(WMenu *menu)
294 WScreen *scr = menu->menu->screen_ptr;
296 if (!menu->flags.brother) {
297 FREE_PIXMAP(menu->menu_texture_data);
299 - menu->menu_texture_data = renderTexture(menu);
300 + if (wPreferences.menu_trance) {
301 + menu->menu_texture_data = tranceMenu(menu);
303 + menu->menu_texture_data = renderTexture(menu);
306 XSetWindowBackgroundPixmap(dpy, menu->menu->window,
307 menu->menu_texture_data);
308 @@ -1163,6 +1282,11 @@
309 XMoveWindow(dpy, menu->frame->core->window, x, y);
312 + /* FIXME: needs an if */
313 + if (wPreferences.menu_trance) {
314 + updateTexture(menu);
317 XMapWindow(dpy, menu->frame->core->window);
318 wRaiseFrame(menu->frame->core);
319 menu->flags.mapped = 1;
320 @@ -1187,6 +1311,11 @@
321 menu->frame_y = menu->frame->screen_ptr->app_menu_y;
322 XMoveWindow(dpy, menu->frame->core->window, menu->frame_x, menu->frame_y);
324 + /* FIXME: needs an if */
325 + if (wPreferences.menu_trance) {
326 + updateTexture(menu);
329 XMapWindow(dpy, menu->frame->core->window);
330 wRaiseFrame(menu->frame->core);
331 menu->flags.mapped = 1;
332 --- WindowMaker-0.92.0/WPrefs.app/po/pl.po.orig 2006-02-02 23:44:37.461334000 +0100
333 +++ WindowMaker-0.92.0/WPrefs.app/po/pl.po 2006-02-02 23:48:23.431456750 +0100
335 "Content-Type: text/plain; charset=UTF-8\n"
336 "Content-Transfer-Encoding: 8bit\n"
338 -#: ../../WPrefs.app/Appearance.c:1154
339 +#: ../../WPrefs.app/Appearance.c:1159
343 -#: ../../WPrefs.app/Appearance.c:1555
344 +#: ../../WPrefs.app/Appearance.c:1560
345 msgid "Focused Window"
346 msgstr "Okno aktywne"
348 -#: ../../WPrefs.app/Appearance.c:1560
349 +#: ../../WPrefs.app/Appearance.c:1565
350 msgid "Unfocused Window"
351 msgstr "Okno nieaktywne"
353 -#: ../../WPrefs.app/Appearance.c:1565
354 +#: ../../WPrefs.app/Appearance.c:1570
355 msgid "Owner of Focused Window"
356 msgstr "Właściciel okna aktywnego"
358 -#: ../../WPrefs.app/Appearance.c:1570 ../../WPrefs.app/Appearance.c:1893
359 +#: ../../WPrefs.app/Appearance.c:1575 ../../WPrefs.app/Appearance.c:1915
360 #: ../../WPrefs.app/FontSimple.c:108
364 -#: ../../WPrefs.app/Appearance.c:1575 ../../WPrefs.app/Appearance.c:1578
365 +#: ../../WPrefs.app/Appearance.c:1580 ../../WPrefs.app/Appearance.c:1583
369 -#: ../../WPrefs.app/Appearance.c:1583
370 +#: ../../WPrefs.app/Appearance.c:1588
371 msgid "Disabled Item"
374 -#: ../../WPrefs.app/Appearance.c:1595
375 +#: ../../WPrefs.app/Appearance.c:1600
377 msgstr "Podświetlony"
379 -#: ../../WPrefs.app/Appearance.c:1786
380 +#: ../../WPrefs.app/Appearance.c:1808
384 -#: ../../WPrefs.app/Appearance.c:1794
385 +#: ../../WPrefs.app/Appearance.c:1816
386 msgid "Titlebar of Focused Window"
387 msgstr "Pasek tytułowy okna aktywnego"
389 -#: ../../WPrefs.app/Appearance.c:1795
390 +#: ../../WPrefs.app/Appearance.c:1817
391 msgid "Titlebar of Unfocused Windows"
392 msgstr "Pasek tytułowy okna nieaktywnego"
394 -#: ../../WPrefs.app/Appearance.c:1796
395 +#: ../../WPrefs.app/Appearance.c:1818
396 msgid "Titlebar of Focused Window's Owner"
397 msgstr "Pasek tytułowy właściciela aktywnego"
399 -#: ../../WPrefs.app/Appearance.c:1797
400 +#: ../../WPrefs.app/Appearance.c:1819
401 msgid "Window Resizebar"
402 msgstr "Pasek zmiany rozmiaru okna"
404 -#: ../../WPrefs.app/Appearance.c:1798
405 +#: ../../WPrefs.app/Appearance.c:1820
406 msgid "Titlebar of Menus"
407 msgstr "Pasek tytułowy menu"
409 -#: ../../WPrefs.app/Appearance.c:1799
410 +#: ../../WPrefs.app/Appearance.c:1821
412 msgstr "Elementy menu"
414 -#: ../../WPrefs.app/Appearance.c:1800
415 +#: ../../WPrefs.app/Appearance.c:1822
416 msgid "Icon Background"
419 -#: ../../WPrefs.app/Appearance.c:1815
420 +#: ../../WPrefs.app/Appearance.c:1837
422 "Double click in the texture you want to use\n"
423 "for the selected item."
425 "Proszę kliknąć na teksturze, która ma być\n"
426 "używana dla wybranego elementu."
428 -#: ../../WPrefs.app/Appearance.c:1829
429 +#: ../../WPrefs.app/Appearance.c:1851
433 -#: ../../WPrefs.app/Appearance.c:1833
434 +#: ../../WPrefs.app/Appearance.c:1855
435 msgid "Create a new texture."
436 msgstr "Utworzenie nowej tekstury."
438 -#: ../../WPrefs.app/Appearance.c:1841
439 +#: ../../WPrefs.app/Appearance.c:1863
441 msgstr "Wyciągnij..."
443 -#: ../../WPrefs.app/Appearance.c:1845
444 +#: ../../WPrefs.app/Appearance.c:1867
445 msgid "Extract texture(s) from a theme or a style file."
446 msgstr "Wyciągnięcie tekstur(y) z pliku motywu lub stylu."
448 -#: ../../WPrefs.app/Appearance.c:1855
449 +#: ../../WPrefs.app/Appearance.c:1877
453 -#: ../../WPrefs.app/Appearance.c:1858
454 +#: ../../WPrefs.app/Appearance.c:1880
455 msgid "Edit the highlighted texture."
456 msgstr "Edycja podświetlonej tekstury."
458 -#: ../../WPrefs.app/Appearance.c:1866 ../../WPrefs.app/TexturePanel.c:1318
459 +#: ../../WPrefs.app/Appearance.c:1888 ../../WPrefs.app/TexturePanel.c:1318
463 -#: ../../WPrefs.app/Appearance.c:1870
464 +#: ../../WPrefs.app/Appearance.c:1892
465 msgid "Delete the highlighted texture."
466 msgstr "Usunięcie podświetlonej tekstury."
468 -#: ../../WPrefs.app/Appearance.c:1883
469 +#: ../../WPrefs.app/Appearance.c:1905
473 -#: ../../WPrefs.app/Appearance.c:1890
474 +#: ../../WPrefs.app/Appearance.c:1912
475 msgid "Focused Window Title"
476 msgstr "Tytuł okna aktywnego"
478 -#: ../../WPrefs.app/Appearance.c:1891
479 +#: ../../WPrefs.app/Appearance.c:1913
480 msgid "Unfocused Window Title"
481 msgstr "Tytuł okna nieaktywnego"
483 -#: ../../WPrefs.app/Appearance.c:1892
484 +#: ../../WPrefs.app/Appearance.c:1914
485 msgid "Owner of Focused Window Title"
486 msgstr "Tytuł właściciela okna aktywnego"
488 -#: ../../WPrefs.app/Appearance.c:1894
489 +#: ../../WPrefs.app/Appearance.c:1916
490 msgid "Menu Item Text"
491 msgstr "Tekst elementu menu"
493 -#: ../../WPrefs.app/Appearance.c:1895
494 +#: ../../WPrefs.app/Appearance.c:1917
495 msgid "Disabled Menu Item Text"
496 msgstr "Tekst wyłączonego elementu menu"
498 -#: ../../WPrefs.app/Appearance.c:1896
499 +#: ../../WPrefs.app/Appearance.c:1918
500 msgid "Menu Highlight Color"
501 msgstr "Kolor podświetlenia menu"
503 -#: ../../WPrefs.app/Appearance.c:1897
504 +#: ../../WPrefs.app/Appearance.c:1919
505 msgid "Highlighted Menu Text Color"
506 msgstr "Kolor podświetlonego tekstu menu"
508 -#: ../../WPrefs.app/Appearance.c:1936
509 +#: ../../WPrefs.app/Appearance.c:1958
513 -#: ../../WPrefs.app/Appearance.c:1948 ../../WPrefs.app/TexturePanel.c:1504
514 +#: ../../WPrefs.app/Appearance.c:1970 ../../WPrefs.app/TexturePanel.c:1504
516 msgstr "Przeglądaj..."
518 -#: ../../WPrefs.app/Appearance.c:1961
519 +#: ../../WPrefs.app/Appearance.c:1983
523 -#: ../../WPrefs.app/Appearance.c:1968
524 +#: ../../WPrefs.app/Appearance.c:1990
528 -#: ../../WPrefs.app/Appearance.c:1996 ../../WPrefs.app/Configurations.c:241
529 +#: ../../WPrefs.app/Appearance.c:2018 ../../WPrefs.app/Configurations.c:241
530 #: ../../WPrefs.app/Configurations.c:253 ../../WPrefs.app/Focus.c:288
531 #: ../../WPrefs.app/Focus.c:299 ../../WPrefs.app/MenuPreferences.c:134
532 #: ../../WPrefs.app/MenuPreferences.c:145
533 @@ -181,28 +181,52 @@
534 msgid "could not load icon file %s"
535 msgstr "nie można załadować pliku ikony %s"
537 -#: ../../WPrefs.app/Appearance.c:2010
538 +#: ../../WPrefs.app/Appearance.c:2032
539 msgid "Title Alignment"
540 msgstr "Wyrównanie tytułu"
542 -#: ../../WPrefs.app/Appearance.c:2017
543 +#: ../../WPrefs.app/Appearance.c:2039
547 -#: ../../WPrefs.app/Appearance.c:2020 ../../WPrefs.app/TexturePanel.c:1518
548 +#: ../../WPrefs.app/Appearance.c:2042 ../../WPrefs.app/TexturePanel.c:1518
549 #: ../../WPrefs.app/Workspace.c:270
553 -#: ../../WPrefs.app/Appearance.c:2023
554 +#: ../../WPrefs.app/Appearance.c:2045
558 -#: ../../WPrefs.app/Appearance.c:2247
559 +#: ../../WPrefs.app/Appearance.c:2059
560 +msgid "Transparency"
561 +msgstr "Przezroczystość"
563 +#: ../../WPrefs.app/Appearance.c:2061
565 +"<yermom> i love windowmaker\n"
566 +"<tarzeau> get some fresh sand-wich-es\n"
568 +"<flip-> transparency\n"
572 +"<yermom> uwielbiam windowmakera\n"
573 +"<tarzeau> weź sobie świeże kanapki\n"
575 +"<flip-> przezroczystość\n"
579 +#: ../../WPrefs.app/Appearance.c:2069
583 +#: ../../WPrefs.app/Appearance.c:2310
584 msgid "Appearance Preferences"
585 msgstr "Ustawienia wyglądu"
587 -#: ../../WPrefs.app/Appearance.c:2249
588 +#: ../../WPrefs.app/Appearance.c:2312
590 "Background texture configuration for windows,\n"
592 @@ -210,19 +234,19 @@
593 "Ustawienia tekstury w tle dla okien, menu\n"
596 -#: ../../WPrefs.app/Appearance.c:2294
597 +#: ../../WPrefs.app/Appearance.c:2357
598 msgid "Extract Texture"
599 msgstr "Wyciągnij teksturę"
601 -#: ../../WPrefs.app/Appearance.c:2314
602 +#: ../../WPrefs.app/Appearance.c:2377
606 -#: ../../WPrefs.app/Appearance.c:2325 ../../WPrefs.app/WPrefs.c:301
607 +#: ../../WPrefs.app/Appearance.c:2388 ../../WPrefs.app/WPrefs.c:301
611 -#: ../../WPrefs.app/Appearance.c:2330
612 +#: ../../WPrefs.app/Appearance.c:2393