From: Jaron O. <ja...@so...> - 2004-05-25 08:11:27
|
Hi everybody! Here's a patch I have been working on for the past week, and that I think other E users might appreciate. It's against E 16.7-0.60 (pre2). What it does is allow you to keep parts of the GUI opaque when using translucency (thanks imlib2). I thought it looked better if the border stayed opaque while the contents were translucent, or menu highlights are opaque with a sometimes difficult to see text. I've tried many themes and they look good, or better depending on your preference, with this patch. Also, the root menus give more a transparent illusion, showing GUI components underneath and terminal text etc. Selective Transparency settings are at the bottom of the Background settings. They are as follows: "Enable Selective Transparency" "Keep Borders Opaque" [GUI/Window borders stay opaque] Keep Widgets Opaque [E widgets, such as in Settings, stay opaque] Keep Buttons Opaque [OK/Apply/Close buttons] Keep Menu Highlights Opaque [Root menu selected item images] Jaron Omega http://www.sock-stream.net ===========================CUT HERE============================ diff -urN enlightenment-0.16.7/src/E.h enlightenment-0.16.7-0.60/src/E.h --- enlightenment-0.16.7/src/E.h 2004-05-11 17:11:50.000000000 -0700 +++ enlightenment-0.16.7-0.60/src/E.h 2004-05-24 23:23:43.000000000 -0700 @@ -66,6 +66,13 @@ #define ENABLE_TRANSPARENCY 1 #define ENABLE_THEME_TRANSPARENCY 1 +#define IC_TRANSPARENCY 1 +#define IC_FOCUSTRANSPARENCY 2 +#define IC_UNFOCUSTRANSPARENCY 4 +#define IC_ETERMTRANSPARENCY 8 +#define IC_AQUATRANSPARENCY 16 +#define IC_TINTEDTRANSPARENCY 32 + #else #include <Imlib.h> @@ -659,6 +666,7 @@ char *real_file; char unloadable; char transparent; + unsigned long flags; Imlib_Image *im; Imlib_Border *border; int pixmapfillstyle; @@ -684,6 +692,7 @@ ImageStateArray norm, active, sticky, sticky_active; Imlib_Border padding; ColorModifierClass *colmod; + unsigned long flags; unsigned int ref_count; } ImageClass; @@ -830,12 +839,12 @@ typedef struct _ewinbit { Window win; - int x, y, w, h; - int cx, cy, cw, ch; - int state; char expose; char no_expose; char left; + int x, y, w, h; + int cx, cy, cw, ch; + int state; } EWinBit; @@ -1196,6 +1205,19 @@ } theme; struct { + int enabled; + int focused; + int unfocused; + int eterm; + int aqua; + int tinted; + int widgets; + int buttons; + int borders; + int hilighted; + } sel_transparency; + struct + { char enable; char showroottooltip; float delay; @@ -2505,6 +2527,7 @@ void SettingsDefaultGroupControl(void); void RemoveRememberedWindow(EWin * ewin); void SettingsRemember(void); +void SettingsTransparency(void); void SettingsMiscellaneous(void); void BGSettingsGoTo(Background * bg); diff -urN enlightenment-0.16.7/src/borders.c enlightenment-0.16.7-0.60/src/borders.c --- enlightenment-0.16.7/src/borders.c 2004-05-11 17:11:50.000000000 -0700 +++ enlightenment-0.16.7-0.60/src/borders.c 2004-05-24 23:18:48.000000000 -0700 @@ -734,6 +734,24 @@ static void EwinWinpartITclassApply(EWin * ewin, int i) { + /* turn on border transparency + ewin->border->part[i].iclass->flags |= 1; + turn off border transparency + ewin->border->part[i].iclass->flags |= 0; + */ + + if(Conf.sel_transparency.enabled != 0) { + if(Conf.sel_transparency.borders != 0) { + if(ewin->border->part[i].iclass->flags & IC_TRANSPARENCY) { + ewin->border->part[i].iclass->flags ^= IC_TRANSPARENCY; + } + } else { + if(!(ewin->border->part[i].iclass->flags & IC_TRANSPARENCY)) { + ewin->border->part[i].iclass->flags |= IC_TRANSPARENCY; + } + } + } + IclassApply(ewin->border->part[i].iclass, ewin->bits[i].win, ewin->bits[i].w, ewin->bits[i].h, ewin->active, ewin->sticky, ewin->bits[i].state, ewin->bits[i].expose); diff -urN enlightenment-0.16.7/src/buttons.c enlightenment-0.16.7-0.60/src/buttons.c --- enlightenment-0.16.7/src/buttons.c 2004-05-11 17:11:50.000000000 -0700 +++ enlightenment-0.16.7-0.60/src/buttons.c 2004-05-24 22:04:50.000000000 -0700 @@ -303,6 +303,18 @@ { EDBUG(3, "ButtonDraw"); + if(Conf.sel_transparency.enabled) { + if(Conf.sel_transparency.borders) { + if(b->iclass->flags & IC_TRANSPARENCY) { + b->iclass->flags ^= IC_TRANSPARENCY; + } + } else { + if(!(b->iclass->flags & IC_TRANSPARENCY)) { + b->iclass->flags |= IC_TRANSPARENCY; + } + } + } + IclassApply(b->iclass, b->win, b->w, b->h, 0, 0, b->state, 0); if (b->label) diff -urN enlightenment-0.16.7/src/conf.h enlightenment-0.16.7-0.60/src/conf.h --- enlightenment-0.16.7/src/conf.h 2004-05-11 17:11:50.000000000 -0700 +++ enlightenment-0.16.7-0.60/src/conf.h 2004-05-24 23:28:02.000000000 -0700 @@ -141,7 +141,18 @@ #define CONTROL_DOCKAPP_SUPPORT 1370 #define CONTROL_GEOMINFOMODE 1371 #define CONTROL_GROUP_SWAPMOVE 1372 + #define CONTROL_THEME_TRANSPARENCY 1373 +#define CONTROL_SEL_TRANSPARENCY 1374 +#define CONTROL_SEL_FOCUS_TRANSPARENCY 1375 +#define CONTROL_SEL_UNFOCUS_TRANSPARENCY 1376 +#define CONTROL_SEL_ETERM_TRANSPARENCY 1377 +#define CONTROL_SEL_AQUA_TRANSPARENCY 1378 +#define CONTROL_SEL_TINTED_TRANSPARENCY 1379 +#define CONTROL_SEL_TRANSPARENCY_WIDGETS 1380 +#define CONTROL_SEL_TRANSPARENCY_BUTTONS 1381 +#define CONTROL_SEL_TRANSPARENCY_BORDERS 1382 +#define CONTROL_SEL_TRANSPARENCY_HILIGHTED 1383 #define ICLASS_NAME 350 #define ICLASS_NORMAL 351 diff -urN enlightenment-0.16.7/src/config.c enlightenment-0.16.7-0.60/src/config.c --- enlightenment-0.16.7/src/config.c 2004-05-11 17:11:50.000000000 -0700 +++ enlightenment-0.16.7-0.60/src/config.c 2004-05-24 23:28:00.000000000 -0700 @@ -905,6 +905,36 @@ case CONTROL_THEME_TRANSPARENCY: Conf.theme.transparency = i2; break; + case CONTROL_SEL_TRANSPARENCY: + Conf.sel_transparency.enabled = i2; + break; + case CONTROL_SEL_FOCUS_TRANSPARENCY: + Conf.sel_transparency.focused = i2; + break; + case CONTROL_SEL_UNFOCUS_TRANSPARENCY: + Conf.sel_transparency.unfocused = i2; + break; + case CONTROL_SEL_ETERM_TRANSPARENCY: + Conf.sel_transparency.eterm = i2; + break; + case CONTROL_SEL_AQUA_TRANSPARENCY: + Conf.sel_transparency.aqua = i2; + break; + case CONTROL_SEL_TINTED_TRANSPARENCY: + Conf.sel_transparency.tinted = i2; + break; + case CONTROL_SEL_TRANSPARENCY_WIDGETS: + Conf.sel_transparency.widgets = i2; + break; + case CONTROL_SEL_TRANSPARENCY_BUTTONS: + Conf.sel_transparency.buttons = i2; + break; + case CONTROL_SEL_TRANSPARENCY_BORDERS: + Conf.sel_transparency.borders = i2; + break; + case CONTROL_SEL_TRANSPARENCY_HILIGHTED: + Conf.sel_transparency.hilighted = i2; + break; case CONTROL_DOCKSTARTPOS: sscanf(s, "%*s %d %d ", &Conf.dock.startx, &Conf.dock.starty); break; @@ -3899,6 +3929,16 @@ fprintf(autosavefile, "1369 %i %i %i\n", (int)Conf.pagers.sel_button, (int)Conf.pagers.win_button, (int)Conf.pagers.menu_button); fprintf(autosavefile, "1373 %i\n", (int)Conf.theme.transparency); + fprintf(autosavefile, "1374 %i\n", (int)Conf.sel_transparency.enabled); + fprintf(autosavefile, "1375 %i\n", (int)Conf.sel_transparency.focused); + fprintf(autosavefile, "1376 %i\n", (int)Conf.sel_transparency.unfocused); + fprintf(autosavefile, "1377 %i\n", (int)Conf.sel_transparency.eterm); + fprintf(autosavefile, "1378 %i\n", (int)Conf.sel_transparency.aqua); + fprintf(autosavefile, "1379 %i\n", (int)Conf.sel_transparency.tinted); + fprintf(autosavefile, "1380 %i\n", (int)Conf.sel_transparency.widgets); + fprintf(autosavefile, "1381 %i\n", (int)Conf.sel_transparency.buttons); + fprintf(autosavefile, "1382 %i\n", (int)Conf.sel_transparency.borders); + fprintf(autosavefile, "1383 %i\n", (int)Conf.sel_transparency.hilighted); #ifdef HAS_XINERAMA fprintf(autosavefile, "2013 %i\n", (int)Conf.extra_head); #endif diff -urN enlightenment-0.16.7/src/desktops.c enlightenment-0.16.7-0.60/src/desktops.c --- enlightenment-0.16.7/src/desktops.c 2004-05-11 17:11:50.000000000 -0700 +++ enlightenment-0.16.7-0.60/src/desktops.c 2004-05-24 14:35:18.000000000 -0700 @@ -585,6 +585,7 @@ if (refresh) BackgroundPixmapFree(desks.desk[desk].bg); + if (desks.desk[desk].bg != bg) { if (desks.desk[desk].bg) diff -urN enlightenment-0.16.7/src/dialog.c enlightenment-0.16.7-0.60/src/dialog.c --- enlightenment-0.16.7/src/dialog.c 2004-05-11 17:11:50.000000000 -0700 +++ enlightenment-0.16.7-0.60/src/dialog.c 2004-05-25 00:18:02.000000000 -0700 @@ -480,6 +480,19 @@ { state = STATE_CLICKED; } + + if(Conf.theme.transparency) { + if(Conf.sel_transparency.buttons && Conf.sel_transparency.enabled) { + if(d->button[bnum]->iclass->flags & IC_TRANSPARENCY) { + d->button[bnum]->iclass->flags ^= IC_TRANSPARENCY; + } + } else { + if(!(d->button[bnum]->iclass->flags & IC_TRANSPARENCY)) { + d->button[bnum]->iclass->flags |= IC_TRANSPARENCY; + } + } + } + IclassApply(d->button[bnum]->iclass, d->button[bnum]->win, d->button[bnum]->w, d->button[bnum]->h, 0, 0, state, 0); TclassApply(d->button[bnum]->iclass, d->button[bnum]->win, @@ -557,6 +570,13 @@ if ((!d->tclass) || (!d->iclass)) return; + /* JARON */ + + if(Conf.sel_transparency.enabled) { + if(!(d->iclass->flags & IC_TRANSPARENCY)) { + d->iclass->flags |= IC_TRANSPARENCY; + } + } IclassApply(d->iclass, d->win, d->w, d->h, 0, 0, STATE_NORMAL, 0); for (i = 0; i < d->num_buttons; i++) @@ -1647,6 +1667,7 @@ AddItem(dq, "DRAW", 0, LIST_TYPE_DRAW); EDBUG_RETURN_; } + if (di->type == DITEM_TABLE) { int i; @@ -1694,15 +1715,31 @@ di->y + di->item.slider.knob_y, di->item.slider.knob_w, di->item.slider.knob_h); - if (di->item.slider.base_win) + if (di->item.slider.base_win) { + if(Conf.sel_transparency.enabled) { + if(Conf.sel_transparency.widgets) { + di->item.slider.ic_base->flags &= ~IC_TRANSPARENCY; + } else { + di->item.slider.ic_base->flags |= IC_TRANSPARENCY; + } + } IclassApply(di->item.slider.ic_base, di->item.slider.base_win, di->item.slider.base_w, di->item.slider.base_h, 0, 0, STATE_NORMAL, 0); - if (di->item.slider.border_win) + } + if (di->item.slider.border_win) { + if(Conf.sel_transparency.enabled) { + if(Conf.sel_transparency.widgets) { + di->item.slider.ic_border->flags &= ~IC_TRANSPARENCY; + } else { + di->item.slider.ic_border->flags |= IC_TRANSPARENCY; + } + } IclassApply(di->item.slider.ic_border, di->item.slider.border_win, di->item.slider.border_w, di->item.slider.border_h, 0, 0, STATE_NORMAL, 0); + } state = STATE_NORMAL; if ((di->hilited) && (di->clicked)) state = STATE_CLICKED; @@ -1710,10 +1747,18 @@ state = STATE_HILITED; else if (!(di->hilited) && (di->clicked)) state = STATE_CLICKED; - if (di->item.slider.knob_win) + if (di->item.slider.knob_win) { + if(Conf.sel_transparency.enabled) { + if(Conf.sel_transparency.widgets) { + di->item.slider.ic_knob->flags &= ~IC_TRANSPARENCY; + } else { + di->item.slider.ic_knob->flags |= IC_TRANSPARENCY; + } + } IclassApply(di->item.slider.ic_knob, di->item.slider.knob_win, di->item.slider.knob_w, di->item.slider.knob_h, 0, 0, state, 0); + } break; case DITEM_BUTTON: state = STATE_NORMAL; @@ -1723,9 +1768,16 @@ state = STATE_HILITED; else if (!(di->hilited) && (di->clicked)) state = STATE_CLICKED; - IclassApply(di->iclass, di->win, di->w, di->h, 0, 0, state, 0); + if(Conf.sel_transparency.enabled) { + if(Conf.sel_transparency.widgets) { + di->iclass->flags &= ~IC_TRANSPARENCY; + } else { + di->iclass->flags |= IC_TRANSPARENCY; + } + } + IclassApply(di->iclass, di->win, di->w, di->h, 0, 0, state, 0); TclassApply(di->iclass, di->win, di->w, di->h, 0, 0, state, 1, - di->tclass, di->item.button.text); + di->tclass, di->item.button.text); break; case DITEM_AREA: IclassApply(di->iclass, di->win, di->w, di->h, 0, 0, @@ -1739,14 +1791,29 @@ state = STATE_HILITED; else if (!(di->hilited) && (di->clicked)) state = STATE_CLICKED; - if (di->item.check_button.onoff) + if (di->item.check_button.onoff) { + if(Conf.sel_transparency.enabled) { + if(Conf.sel_transparency.widgets) { + if(di->iclass->flags & IC_TRANSPARENCY) { + di->iclass->flags ^= IC_TRANSPARENCY; + } + } + } IclassApply(di->iclass, di->item.check_button.check_win, di->item.check_button.check_orig_w, di->item.check_button.check_orig_h, 1, 0, state, 0); - else + } else { + if(Conf.sel_transparency.enabled) { + if(Conf.sel_transparency.widgets) { + di->iclass->flags &= ~IC_TRANSPARENCY; + } else { + di->iclass->flags |= IC_TRANSPARENCY; + } + } IclassApply(di->iclass, di->item.check_button.check_win, di->item.check_button.check_orig_w, di->item.check_button.check_orig_h, 0, 0, state, 0); + } XClearArea(disp, d->win, di->x, di->y, di->w, di->h, False); TextDraw(di->tclass, d->win, 0, 0, STATE_NORMAL, di->item.check_button.text, @@ -1765,12 +1832,27 @@ case DITEM_IMAGE: break; case DITEM_SEPARATOR: - if (di->item.separator.horizontal) + if (di->item.separator.horizontal) { + if(Conf.sel_transparency.enabled) { + if(Conf.sel_transparency.widgets) { + di->iclass->flags &= ~IC_TRANSPARENCY; + } else { + di->iclass->flags |= IC_TRANSPARENCY; + } + } IclassApply(di->iclass, di->win, di->w, di->h, 0, 0, STATE_NORMAL, 0); - else + } else { + if(Conf.sel_transparency.enabled) { + if(Conf.sel_transparency.widgets) { + di->iclass->flags &= ~IC_TRANSPARENCY; + } else { + di->iclass->flags |= IC_TRANSPARENCY; + } + } IclassApply(di->iclass, di->win, di->w, di->h, 0, 0, STATE_CLICKED, 0); + } break; case DITEM_RADIOBUTTON: state = STATE_NORMAL; @@ -1780,14 +1862,29 @@ state = STATE_HILITED; else if (!(di->hilited) && (di->clicked)) state = STATE_CLICKED; - if (di->item.radio_button.onoff) + if (di->item.radio_button.onoff) { + if(Conf.sel_transparency.enabled) { + if(Conf.sel_transparency.widgets) { + di->iclass->flags &= ~IC_TRANSPARENCY; + } else { + di->iclass->flags |= IC_TRANSPARENCY; + } + } IclassApply(di->iclass, di->item.radio_button.radio_win, di->item.radio_button.radio_orig_w, di->item.radio_button.radio_orig_h, 1, 0, state, 0); - else + } else { + if(Conf.sel_transparency.enabled) { + if(Conf.sel_transparency.widgets) { + di->iclass->flags &= ~IC_TRANSPARENCY; + } else { + di->iclass->flags |= IC_TRANSPARENCY; + } + } IclassApply(di->iclass, di->item.radio_button.radio_win, di->item.radio_button.radio_orig_w, di->item.radio_button.radio_orig_w, 0, 0, state, 0); + } XClearArea(disp, d->win, di->x, di->y, di->w, di->h, False); TextDraw(di->tclass, d->win, 0, 0, STATE_NORMAL, di->item.radio_button.text, diff -urN enlightenment-0.16.7/src/iclass.c enlightenment-0.16.7-0.60/src/iclass.c --- enlightenment-0.16.7/src/iclass.c 2004-05-11 17:11:50.000000000 -0700 +++ enlightenment-0.16.7-0.60/src/iclass.c 2004-05-25 00:25:59.000000000 -0700 @@ -414,7 +414,7 @@ imlib_context_set_drawable(win); imlib_context_set_image(is->im); - if (is->border) + if (is->border && (is->im != NULL)) imlib_image_set_border(is->border); ww = imlib_image_get_width(); @@ -428,7 +428,7 @@ imlib_image_has_alpha())); #ifdef ENABLE_TRANSPARENCY - if (trans) + if (trans || (is->flags & IC_TRANSPARENCY)) { Window cr; Pixmap bg; @@ -440,8 +440,11 @@ { /* Create the background base image */ bg = BackgroundGetPixmap(desks.desk[desks.current].bg); - if ((is->transparent & 0x02) != 0 || bg == None) + if ((is->flags & IC_AQUATRANSPARENCY) || bg == None) { bg = VRoot.win; + } else if((is->transparent & 0x02) != 0 || bg == None) { + bg = VRoot.win; + } imlib_context_set_drawable(bg); ii = imlib_create_image_from_drawable(0, xx, yy, w, h, 1); imlib_context_set_image(ii); @@ -461,13 +464,17 @@ { imlib_context_set_blend(1); #ifdef ENABLE_THEME_TRANSPARENCY - imlib_context_set_color_modifier(icm); + if((is->flags & IC_TRANSPARENCY) > 0) { + imlib_context_set_color_modifier(icm); + } #endif imlib_context_set_operation(IMLIB_OP_COPY); imlib_blend_image_onto_image(is->im, 0, 0, 0, ww, hh, 0, 0, w, h); imlib_context_set_blend(0); #ifdef ENABLE_THEME_TRANSPARENCY - imlib_context_set_color_modifier(NULL); + if((is->flags & IC_TRANSPARENCY) > 0) { + imlib_context_set_color_modifier(NULL); + } #if 0 /* Do we ever need to free it? */ imlib_free_color_modifier(); #endif @@ -765,6 +772,12 @@ EDBUG_RETURN_; is = IclassGetImageState2(iclass, state, active, sticky); + + is->flags = is->flags | iclass->flags; + if(Conf.theme.transparency && !Conf.sel_transparency.enabled) { + is->flags |= IC_TRANSPARENCY; + } + if (!is) EDBUG_RETURN_; @@ -827,6 +840,12 @@ EDBUG_RETURN_; is = IclassGetImageState2(iclass, state, active, sticky); + + is->flags = is->flags | iclass->flags; + if(Conf.theme.transparency && !Conf.sel_transparency.enabled) { + is->flags |= IC_TRANSPARENCY; + } + if (!is) EDBUG_RETURN_; @@ -892,7 +911,7 @@ ("ImageStateRealize: Hmmm... is->im is NULL (im_file=%s real_file=%s\n", is->im_file, is->real_file); - if (is->border) + if (is->border && (is->im != NULL)) imlib_image_set_border(is->border); #if !USE_IMLIB2 diff -urN enlightenment-0.16.7/src/menus.c enlightenment-0.16.7-0.60/src/menus.c --- enlightenment-0.16.7/src/menus.c 2004-05-11 17:11:50.000000000 -0700 +++ enlightenment-0.16.7-0.60/src/menus.c 2004-05-24 23:44:57.000000000 -0700 @@ -853,6 +853,17 @@ { GetWinWH(m->win, &w, &h); FreePmapMask(&m->pmm); +/* JARON */ + + if(Conf.sel_transparency.enabled != 0) { + if(!(m->style->bg_iclass->flags & IC_TRANSPARENCY)) { + m->style->bg_iclass->flags ^= IC_TRANSPARENCY; + } + if(!(m->style->bg_iclass->flags & IC_AQUATRANSPARENCY)) { + m->style->bg_iclass->flags ^= IC_AQUATRANSPARENCY; + } + } + IclassApplyCopy(m->style->bg_iclass, m->win, w, h, 0, 0, STATE_NORMAL, &m->pmm, 1); ESetWindowBackgroundPixmap(disp, m->win, m->pmm.pmap); @@ -908,12 +919,41 @@ { PmapMask pmm; - if (mi->child) + if (mi->child) { + if(Conf.sel_transparency.enabled != 0) { + if(Conf.sel_transparency.hilighted != 0) { + if(m->style->sub_iclass->flags & IC_TRANSPARENCY) { + m->style->sub_iclass->flags ^= IC_TRANSPARENCY; + } + } else { + if(!(m->style->sub_iclass->flags & IC_TRANSPARENCY)) { + m->style->sub_iclass->flags ^= IC_TRANSPARENCY; + } + if(!(m->style->sub_iclass->flags & IC_AQUATRANSPARENCY)) { + m->style->sub_iclass->flags ^= IC_AQUATRANSPARENCY; + } + } + } IclassApplyCopy(m->style->sub_iclass, mi->win, w, h, 0, 0, mi->state, &pmm, 1); - else + } else { + if(Conf.sel_transparency.enabled != 0) { + if(Conf.sel_transparency.hilighted != 0) { + if(m->style->item_iclass->flags & IC_TRANSPARENCY) { + m->style->item_iclass->flags ^= IC_TRANSPARENCY; + } + } else { + if(!(m->style->item_iclass->flags & IC_TRANSPARENCY)) { + m->style->item_iclass->flags ^= IC_TRANSPARENCY; + } + if(!(m->style->item_iclass->flags & IC_AQUATRANSPARENCY)) { + m->style->item_iclass->flags ^= IC_AQUATRANSPARENCY; + } + } + } IclassApplyCopy(m->style->item_iclass, mi->win, w, h, 0, 0, mi->state, &pmm, 1); + } if (pmm.mask) { XSetClipMask(disp, gc, pmm.mask); @@ -927,12 +967,23 @@ } else { - if (mi->child) + if (mi->child) { + if(Conf.sel_transparency.enabled != 0) { + if(!(m->style->sub_iclass->flags & IC_TRANSPARENCY)) { + m->style->sub_iclass->flags ^= IC_TRANSPARENCY; + } + } IclassApplyCopy(m->style->sub_iclass, mi->win, w, h, 0, 0, mi->state, mi_pmm, 1); - else + } else { + if(Conf.sel_transparency.enabled != 0) { + if(!(m->style->item_iclass->flags & IC_TRANSPARENCY)) { + m->style->item_iclass->flags ^= IC_TRANSPARENCY; + } + } IclassApplyCopy(m->style->item_iclass, mi->win, w, h, 0, 0, mi->state, mi_pmm, 1); + } } } } diff -urN enlightenment-0.16.7/src/set.txt enlightenment-0.16.7-0.60/src/set.txt --- enlightenment-0.16.7/src/set.txt 1969-12-31 16:00:00.000000000 -0800 +++ enlightenment-0.16.7-0.60/src/set.txt 2004-05-24 14:59:52.000000000 -0700 @@ -0,0 +1,4765 @@ +/* + * Copyright (C) 2000-2004 Carsten Haitzler, Geoff Harrison and various contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies of the Software, its documentation and marketing & publicity + * materials, and acknowledgment shall be given in the documentation, materials + * and software packages that this Software was used. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +#define DECLARE_STRUCT_BACKGROUND +#define DECLARE_STRUCT_ICONBOX +#include "E.h" +#include <time.h> + +typedef struct _remwinlist +{ + EWin *ewin; + char remember; +} +RememberWinList; + +static void +CB_SettingsEscape(int val, void *data) +{ + DialogClose((Dialog *) data); + val = 0; +} + +/* Pager settings */ +static char tmp_show_pagers; +static char tmp_pager_hiq; +static char tmp_pager_snap; +static char tmp_pager_zoom; +static char tmp_pager_title; +static char tmp_pager_do_scan; +static int tmp_pager_scan_speed; +static int tmp_pager_sel_button; +static int tmp_pager_win_button; +static int tmp_pager_menu_button; +static DItem *pager_scan_speed_label = NULL; +static Dialog *pager_settings_dialog = NULL; + +static void +CB_ConfigurePager(int val, void *data) +{ + if (val < 2) + { + if ((!Conf.pagers.enable) && (tmp_show_pagers)) + EnableAllPagers(); + else if ((Conf.pagers.enable) && (!tmp_show_pagers)) + DisableAllPagers(); + if (Conf.pagers.hiq != tmp_pager_hiq) + PagerSetHiQ(tmp_pager_hiq); + Conf.pagers.zoom = tmp_pager_zoom; + Conf.pagers.title = tmp_pager_title; + Conf.pagers.sel_button = tmp_pager_sel_button; + Conf.pagers.win_button = tmp_pager_win_button; + Conf.pagers.menu_button = tmp_pager_menu_button; + if ((Conf.pagers.scanspeed != tmp_pager_scan_speed) + || ((!tmp_pager_do_scan) && (Conf.pagers.scanspeed > 0)) + || ((tmp_pager_do_scan) && (Conf.pagers.scanspeed == 0))) + { + if (tmp_pager_do_scan) + Conf.pagers.scanspeed = tmp_pager_scan_speed; + else + Conf.pagers.scanspeed = 0; + PagerSetSnap(tmp_pager_snap); + } + if (Conf.pagers.snap != tmp_pager_snap) + PagerSetSnap(tmp_pager_snap); + } + autosave(); + data = NULL; +} + +static void +CB_PagerScanSlide(int val, void *data) +{ + char s[256]; + + Esnprintf(s, sizeof(s), "%s %03i %s", _("Pager scanning speed:"), + tmp_pager_scan_speed, _("lines per second")); + DialogItemTextSetText(pager_scan_speed_label, s); + DialogDrawItems(pager_settings_dialog, pager_scan_speed_label, 0, 0, 99999, + 99999); + val = 0; + data = NULL; +} + +void +SettingsPager(void) +{ + Dialog *d; + DItem *table, *di, *radio; + char s[256]; + + if ((d = FindItem("CONFIGURE_PAGER", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG))) + { + SoundPlay("SOUND_SETTINGS_ACTIVE"); + ShowDialog(d); + return; + } + SoundPlay("SOUND_SETTINGS_PAGER"); + + tmp_show_pagers = Conf.pagers.enable; + tmp_pager_hiq = Conf.pagers.hiq; + tmp_pager_snap = Conf.pagers.snap; + tmp_pager_zoom = Conf.pagers.zoom; + tmp_pager_title = Conf.pagers.title; + tmp_pager_sel_button = Conf.pagers.sel_button; + tmp_pager_win_button = Conf.pagers.win_button; + tmp_pager_menu_button = Conf.pagers.menu_button; + if (Conf.pagers.scanspeed == 0) + tmp_pager_do_scan = 0; + else + tmp_pager_do_scan = 1; + tmp_pager_scan_speed = Conf.pagers.scanspeed; + + d = pager_settings_dialog = DialogCreate("CONFIGURE_PAGER"); + DialogSetTitle(d, _("Pager Settings")); + + table = DialogInitItem(d); + DialogItemTableSetOptions(table, 2, 0, 0, 0); + + if (Conf.dialogs.headers) + { + di = DialogAddItem(table, DITEM_IMAGE); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemImageSetFile(di, "pix/pager.png"); + + di = DialogAddItem(table, DITEM_TEXT); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemTextSetText(di, + _("Enlightenment Desktop & Area\n" + "Pager Settings Dialog\n")); + + di = DialogAddItem(table, DITEM_SEPARATOR); + DialogItemSetColSpan(di, 2); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSeparatorSetOrientation(di, 0); + } + + di = DialogAddItem(table, DITEM_CHECKBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSetColSpan(di, 2); + DialogItemCheckButtonSetText(di, _("Enable pager display")); + DialogItemCheckButtonSetState(di, tmp_show_pagers); + DialogItemCheckButtonSetPtr(di, &tmp_show_pagers); + + di = DialogAddItem(table, DITEM_CHECKBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSetColSpan(di, 2); + DialogItemCheckButtonSetText(di, + _("Make miniature snapshots of the screen")); + DialogItemCheckButtonSetState(di, tmp_pager_snap); + DialogItemCheckButtonSetPtr(di, &tmp_pager_snap); + + di = DialogAddItem(table, DITEM_CHECKBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSetColSpan(di, 2); + DialogItemCheckButtonSetText(di, + _ + ("Smooth high quality snapshots in snapshot mode")); + DialogItemCheckButtonSetState(di, tmp_pager_hiq); + DialogItemCheckButtonSetPtr(di, &tmp_pager_hiq); + + di = DialogAddItem(table, DITEM_CHECKBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSetColSpan(di, 2); + DialogItemCheckButtonSetText(di, + _ + ("Zoom in on pager windows when mouse is over them")); + DialogItemCheckButtonSetState(di, tmp_pager_zoom); + DialogItemCheckButtonSetPtr(di, &tmp_pager_zoom); + + di = DialogAddItem(table, DITEM_CHECKBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSetColSpan(di, 2); + DialogItemCheckButtonSetText(di, + _ + ("Pop up window title when mouse is over the window")); + DialogItemCheckButtonSetState(di, tmp_pager_title); + DialogItemCheckButtonSetPtr(di, &tmp_pager_title); + + di = DialogAddItem(table, DITEM_CHECKBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSetColSpan(di, 2); + DialogItemCheckButtonSetText(di, + _("Continuously scan screen to update pager")); + DialogItemCheckButtonSetState(di, tmp_pager_do_scan); + DialogItemCheckButtonSetPtr(di, &tmp_pager_do_scan); + + di = pager_scan_speed_label = DialogAddItem(table, DITEM_TEXT); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 0, 0); + DialogItemSetColSpan(di, 2); + DialogItemSetAlign(di, 0, 512); + Esnprintf(s, sizeof(s), "%s %03i %s", _("Pager scanning speed:"), + tmp_pager_scan_speed, _("lines per second")); + DialogItemTextSetText(di, s); + + di = DialogAddItem(table, DITEM_SLIDER); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSliderSetBounds(di, 1, 256); + DialogItemSliderSetUnits(di, 1); + DialogItemSliderSetJump(di, 1); + DialogItemSetColSpan(di, 2); + DialogItemSliderSetVal(di, tmp_pager_scan_speed); + DialogItemSliderSetValPtr(di, &tmp_pager_scan_speed); + DialogItemSetCallback(di, CB_PagerScanSlide, 0, NULL); + + di = DialogAddItem(table, DITEM_TEXT); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 0, 0); + DialogItemSetColSpan(di, 2); + DialogItemSetAlign(di, 0, 0); + DialogItemTextSetText(di, _("Mouse button to select and drag windows:")); + + radio = di = DialogAddItem(table, DITEM_RADIOBUTTON); + DialogItemSetColSpan(di, 2); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemRadioButtonSetText(di, _("Left")); + DialogItemRadioButtonSetFirst(di, radio); + DialogItemRadioButtonGroupSetVal(di, 1); + + di = DialogAddItem(table, DITEM_RADIOBUTTON); + DialogItemSetColSpan(di, 2); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemRadioButtonSetText(di, _("Middle")); + DialogItemRadioButtonSetFirst(di, radio); + DialogItemRadioButtonGroupSetVal(di, 2); + + di = DialogAddItem(table, DITEM_RADIOBUTTON); + DialogItemSetColSpan(di, 2); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemRadioButtonSetText(di, _("Right")); + DialogItemRadioButtonSetFirst(di, radio); + DialogItemRadioButtonGroupSetVal(di, 3); + DialogItemRadioButtonGroupSetValPtr(radio, &tmp_pager_win_button); + + di = DialogAddItem(table, DITEM_TEXT); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 0, 0); + DialogItemSetColSpan(di, 2); + DialogItemSetAlign(di, 0, 0); + DialogItemTextSetText(di, _("Mouse button to select desktops:")); + + radio = di = DialogAddItem(table, DITEM_RADIOBUTTON); + DialogItemSetColSpan(di, 2); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemRadioButtonSetText(di, _("Left")); + DialogItemRadioButtonSetFirst(di, radio); + DialogItemRadioButtonGroupSetVal(di, 1); + + di = DialogAddItem(table, DITEM_RADIOBUTTON); + DialogItemSetColSpan(di, 2); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemRadioButtonSetText(di, _("Middle")); + DialogItemRadioButtonSetFirst(di, radio); + DialogItemRadioButtonGroupSetVal(di, 2); + + di = DialogAddItem(table, DITEM_RADIOBUTTON); + DialogItemSetColSpan(di, 2); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemRadioButtonSetText(di, _("Right")); + DialogItemRadioButtonSetFirst(di, radio); + DialogItemRadioButtonGroupSetVal(di, 3); + DialogItemRadioButtonGroupSetValPtr(radio, &tmp_pager_sel_button); + + di = DialogAddItem(table, DITEM_TEXT); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 0, 0); + DialogItemSetColSpan(di, 2); + DialogItemSetAlign(di, 0, 0); + DialogItemTextSetText(di, _("Mouse button to display pager menu:")); + + radio = di = DialogAddItem(table, DITEM_RADIOBUTTON); + DialogItemSetColSpan(di, 2); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemRadioButtonSetText(di, _("Left")); + DialogItemRadioButtonSetFirst(di, radio); + DialogItemRadioButtonGroupSetVal(di, 1); + + di = DialogAddItem(table, DITEM_RADIOBUTTON); + DialogItemSetColSpan(di, 2); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemRadioButtonSetText(di, _("Middle")); + DialogItemRadioButtonSetFirst(di, radio); + DialogItemRadioButtonGroupSetVal(di, 2); + + di = DialogAddItem(table, DITEM_RADIOBUTTON); + DialogItemSetColSpan(di, 2); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemRadioButtonSetText(di, _("Right")); + DialogItemRadioButtonSetFirst(di, radio); + DialogItemRadioButtonGroupSetVal(di, 3); + DialogItemRadioButtonGroupSetValPtr(radio, &tmp_pager_menu_button); + + di = DialogAddItem(table, DITEM_SEPARATOR); + DialogItemSetColSpan(di, 2); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSeparatorSetOrientation(di, 0); + + DialogAddButton(d, _("OK"), CB_ConfigurePager, 1); + DialogAddButton(d, _("Apply"), CB_ConfigurePager, 0); + DialogAddButton(d, _("Close"), CB_ConfigurePager, 1); + DialogSetExitFunction(d, CB_ConfigurePager, 2, d); + DialogBindKey(d, "Escape", CB_SettingsEscape, 0, d); + DialogBindKey(d, "Return", CB_ConfigurePager, 0, d); + ShowDialog(d); +} + +static int tmp_focus; +static char tmp_new_focus; +static char tmp_popup_focus; +static char tmp_owner_popup_focus; +static char tmp_raise_focus; +static char tmp_warp_focus; + +#ifdef WITH_TARTY_WARP +static char tmp_warp_after_focus; +static char tmp_raise_after_focus; +static char tmp_display_warp; +static char tmp_warpsticky; +static char tmp_warpshaded; +static char tmp_warpiconified; +static char tmp_warpfocused; +#endif +static char tmp_clickalways; + +static void +CB_ConfigureFocus(int val, void *data) +{ + if (val < 2) + { + Conf.focus.mode = tmp_focus; + Conf.focus.all_new_windows_get_focus = tmp_new_focus; + Conf.focus.new_transients_get_focus = tmp_popup_focus; + Conf.focus.new_transients_get_focus_if_group_focused = + tmp_owner_popup_focus; + Conf.focus.raise_on_next_focus = tmp_raise_focus; + Conf.focus.warp_on_next_focus = tmp_warp_focus; +#ifdef WITH_TARTY_WARP + Conf.focus.warp_after_next_focus = tmp_warp_after_focus; + Conf.focus.raise_after_next_focus = tmp_raise_after_focus; + Conf.warplist.enable = tmp_display_warp; + Conf.warplist.warpsticky = tmp_warpsticky; + Conf.warplist.warpshaded = tmp_warpshaded; + Conf.warplist.warpiconified = tmp_warpiconified; + Conf.warplist.warpfocused = tmp_warpfocused; +#endif /* WITH_TARTY_WARP */ + Conf.focus.clickraises = tmp_clickalways; + FocusFix(); + } + autosave(); + data = NULL; +} + +void +SettingsFocus(void) +{ + Dialog *d; + DItem *table, *di, *radio; + + if ((d = FindItem("CONFIGURE_FOCUS", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG))) + { + SoundPlay("SOUND_SETTINGS_ACTIVE"); + ShowDialog(d); + return; + } + SoundPlay("SOUND_SETTINGS_FOCUS"); + + tmp_focus = Conf.focus.mode; + tmp_new_focus = Conf.focus.all_new_windows_get_focus; + tmp_popup_focus = Conf.focus.new_transients_get_focus; + tmp_owner_popup_focus = Conf.focus.new_transients_get_focus_if_group_focused; + tmp_raise_focus = Conf.focus.raise_on_next_focus; + tmp_warp_focus = Conf.focus.warp_on_next_focus; +#ifdef WITH_TARTY_WARP + tmp_raise_after_focus = Conf.focus.raise_after_next_focus; + tmp_warp_after_focus = Conf.focus.warp_after_next_focus; + tmp_display_warp = Conf.warplist.enable; + tmp_warpsticky = Conf.warplist.warpsticky; + tmp_warpshaded = Conf.warplist.warpshaded; + tmp_warpiconified = Conf.warplist.warpiconified; + tmp_warpfocused = Conf.warplist.warpfocused; +#endif /* WITH_TARTY_WARP */ + tmp_clickalways = Conf.focus.clickraises; + + d = DialogCreate("CONFIGURE_FOCUS"); + DialogSetTitle(d, _("Focus Settings")); + + table = DialogInitItem(d); + DialogItemTableSetOptions(table, 2, 0, 0, 0); + + if (Conf.dialogs.headers) + { + di = DialogAddItem(table, DITEM_IMAGE); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemImageSetFile(di, "pix/focus.png"); + + di = DialogAddItem(table, DITEM_TEXT); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemTextSetText(di, + _("Enlightenment Focus\n" "Settings Dialog\n")); + + di = DialogAddItem(table, DITEM_SEPARATOR); + DialogItemSetColSpan(di, 2); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSeparatorSetOrientation(di, 0); + } + + radio = di = DialogAddItem(table, DITEM_RADIOBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSetColSpan(di, 2); + DialogItemRadioButtonSetText(di, _("Focus follows pointer")); + DialogItemRadioButtonSetFirst(di, radio); + DialogItemRadioButtonGroupSetVal(di, 0); + + di = DialogAddItem(table, DITEM_RADIOBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSetColSpan(di, 2); + DialogItemRadioButtonSetText(di, _("Focus follows pointer sloppily")); + DialogItemRadioButtonSetFirst(di, radio); + DialogItemRadioButtonGroupSetVal(di, 1); + + di = DialogAddItem(table, DITEM_RADIOBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSetColSpan(di, 2); + DialogItemRadioButtonSetText(di, _("Focus follows mouse clicks")); + DialogItemRadioButtonSetFirst(di, radio); + DialogItemRadioButtonGroupSetVal(di, 2); + DialogItemRadioButtonGroupSetValPtr(radio, &tmp_focus); + + di = DialogAddItem(table, DITEM_SEPARATOR); + DialogItemSetColSpan(di, 2); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSeparatorSetOrientation(di, 0); + + di = DialogAddItem(table, DITEM_CHECKBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSetColSpan(di, 2); + DialogItemCheckButtonSetText(di, _("Clicking in a window always raises it")); + DialogItemCheckButtonSetState(di, tmp_clickalways); + DialogItemCheckButtonSetPtr(di, &tmp_clickalways); + + di = DialogAddItem(table, DITEM_SEPARATOR); + DialogItemSetColSpan(di, 2); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSeparatorSetOrientation(di, 0); + + di = DialogAddItem(table, DITEM_CHECKBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSetColSpan(di, 2); + DialogItemCheckButtonSetText(di, _("All new windows first get the focus")); + DialogItemCheckButtonSetState(di, tmp_new_focus); + DialogItemCheckButtonSetPtr(di, &tmp_new_focus); + + di = DialogAddItem(table, DITEM_CHECKBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSetColSpan(di, 2); + DialogItemCheckButtonSetText(di, _("Only new dialog windows get the focus")); + DialogItemCheckButtonSetState(di, tmp_popup_focus); + DialogItemCheckButtonSetPtr(di, &tmp_popup_focus); + + di = DialogAddItem(table, DITEM_CHECKBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSetColSpan(di, 2); + DialogItemCheckButtonSetText(di, + _ + ("Only new dialogs whose owner is focused get the focus")); + DialogItemCheckButtonSetState(di, tmp_owner_popup_focus); + DialogItemCheckButtonSetPtr(di, &tmp_owner_popup_focus); + + di = DialogAddItem(table, DITEM_CHECKBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSetColSpan(di, 2); + DialogItemCheckButtonSetText(di, _("Raise windows on focus switch")); + DialogItemCheckButtonSetState(di, tmp_raise_focus); + DialogItemCheckButtonSetPtr(di, &tmp_raise_focus); + + di = DialogAddItem(table, DITEM_CHECKBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSetColSpan(di, 2); + DialogItemCheckButtonSetText(di, + _ + ("Send mouse pointer to window on focus switch")); + DialogItemCheckButtonSetState(di, tmp_warp_focus); + DialogItemCheckButtonSetPtr(di, &tmp_warp_focus); + +#ifdef WITH_TARTY_WARP + di = DialogAddItem(table, DITEM_SEPARATOR); + DialogItemSetColSpan(di, 2); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSeparatorSetOrientation(di, 0); + + di = DialogAddItem(table, DITEM_CHECKBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSetColSpan(di, 2); + DialogItemCheckButtonSetText(di, _("Display and use focus list")); + DialogItemCheckButtonSetState(di, tmp_display_warp); + DialogItemCheckButtonSetPtr(di, &tmp_display_warp); + + di = DialogAddItem(table, DITEM_CHECKBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSetColSpan(di, 2); + DialogItemCheckButtonSetText(di, _("Include sticky windows in focus list")); + DialogItemCheckButtonSetState(di, tmp_warpsticky); + DialogItemCheckButtonSetPtr(di, &tmp_warpsticky); + + di = DialogAddItem(table, DITEM_CHECKBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSetColSpan(di, 2); + DialogItemCheckButtonSetText(di, _("Include shaded windows in focus list")); + DialogItemCheckButtonSetState(di, tmp_warpshaded); + DialogItemCheckButtonSetPtr(di, &tmp_warpshaded); + + di = DialogAddItem(table, DITEM_CHECKBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSetColSpan(di, 2); + DialogItemCheckButtonSetText(di, + _("Include iconified windows in focus list")); + DialogItemCheckButtonSetState(di, tmp_warpiconified); + DialogItemCheckButtonSetPtr(di, &tmp_warpiconified); + + di = DialogAddItem(table, DITEM_CHECKBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSetColSpan(di, 2); + DialogItemCheckButtonSetText(di, _("Focus windows while switching")); + DialogItemCheckButtonSetState(di, tmp_warpfocused); + DialogItemCheckButtonSetPtr(di, &tmp_warpfocused); + + di = DialogAddItem(table, DITEM_CHECKBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSetColSpan(di, 2); + DialogItemCheckButtonSetText(di, _("Raise windows after focus switch")); + DialogItemCheckButtonSetState(di, tmp_raise_after_focus); + DialogItemCheckButtonSetPtr(di, &tmp_raise_after_focus); + + di = DialogAddItem(table, DITEM_CHECKBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSetColSpan(di, 2); + DialogItemCheckButtonSetText(di, + _ + ("Send mouse pointer to window after focus switch")); + DialogItemCheckButtonSetState(di, tmp_warp_after_focus); + DialogItemCheckButtonSetPtr(di, &tmp_warp_after_focus); +#endif /* WITH_TARTY_WARP */ + + di = DialogAddItem(table, DITEM_SEPARATOR); + DialogItemSetColSpan(di, 2); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSeparatorSetOrientation(di, 0); + + DialogAddButton(d, _("OK"), CB_ConfigureFocus, 1); + DialogAddButton(d, _("Apply"), CB_ConfigureFocus, 0); + DialogAddButton(d, _("Close"), CB_ConfigureFocus, 1); + DialogSetExitFunction(d, CB_ConfigureFocus, 2, d); + DialogBindKey(d, "Escape", CB_SettingsEscape, 0, d); + DialogBindKey(d, "Return", CB_ConfigureFocus, 0, d); + ShowDialog(d); +} + +static int tmp_move; +static int tmp_resize; +static int tmp_geominfo = 1; + +/* +static void je_move(int, void *); +static void je_moveend(int, void *); +static void je_movectrl(int, void *); +static void je_resizectrl(int, void *); + +float je_angle = 0.0, je_radius = 0.0; +int je_prevx, je_prevy; +int je_prevmode = -1; +*/ + +static void +CB_ConfigureMoveResize(int val, void *data) +{ + Dialog *d; + + if (val < 2) + { + Conf.movemode = tmp_move; + Conf.resizemode = tmp_resize; + Conf.geominfomode = tmp_geominfo; + } + if (val) + if ((d = + FindItem("CONFIGURE_MOVERESIZE_EXAMPLE", 0, LIST_FINDBY_NAME, + LIST_TYPE_DIALOG))) + { + DialogClose(d); + /* je_moveend(je_prevmode, (void *)1); */ + } + autosave(); + data = NULL; +} + +/* I'm commenting this out for now. --cK. + +#define JE_BASE_X 100 +#define JE_BASE_Y 100 +#define JE_DELAY 0.02 + +static void +je_move(int movemode, void *foo) +{ + Dialog *d; + EWin *ew; + int je_x, je_y; + + d = + FindItem("CONFIGURE_MOVERESIZE_EXAMPLE", 0, LIST_FINDBY_NAME, + LIST_TYPE_DIALOG); + if (!d) + return; + + ew = FindEwinByDialog(d); + if (!ew) + return; + + Mode.ewin = ew; + if (je_prevmode != movemode) + DrawEwinShape(ew, je_prevmode, je_prevx, je_prevy, ew->client.w, + ew->client.h, 2); + + je_x = JE_BASE_X - (cos(je_angle * (M_PI / 180.0)) * je_radius); + je_y = JE_BASE_Y - (sin(je_angle * (M_PI / 180.0)) * je_radius); + DrawEwinShape(ew, movemode, je_x, je_y, ew->client.w, ew->client.h, + je_prevmode == movemode); + + je_prevx = je_x; + je_prevy = je_y; + je_prevmode = movemode; + + je_angle += (180.0 * 0.02); + if (je_angle > 360.0) + je_angle -= 360.0; + + if (je_radius < 50.0) + je_radius += 0.5; + + DoIn("JE_MOVE", JE_DELAY, je_move, movemode, NULL); + return; + foo = NULL; +} + +static void +je_moveend(int movemode, void *foo) +{ + Dialog *d; + EWin *ew; + int je_x, je_y; + + d = + FindItem("CONFIGURE_MOVERESIZE_EXAMPLE", 0, LIST_FINDBY_NAME, + LIST_TYPE_DIALOG); + if (!d) + return; + + ew = FindEwinByDialog(d); + if (!ew) + return; + + Mode.ewin = ew; + if (je_prevmode != movemode) + DrawEwinShape(ew, je_prevmode, je_prevx, je_prevy, ew->client.w, + ew->client.h, 2); + + if (je_radius <= 0.0 || foo) + { + je_radius = 0.0; + DrawEwinShape(ew, movemode, JE_BASE_X, JE_BASE_Y, ew->client.w, + ew->client.h, 2); + je_prevmode = -1; + return; + } + + je_x = JE_BASE_X - (cos(je_angle * (M_PI / 180.0)) * je_radius); + je_y = JE_BASE_Y - (sin(je_angle * (M_PI / 180.0)) * je_radius); + DrawEwinShape(ew, movemode, je_x, je_y, ew->client.w, ew->client.h, + je_prevmode == movemode); + + je_prevx = je_x; + je_prevy = je_y; + je_prevmode = movemode; + + je_angle += (180.0 * 0.02); + if (je_angle > 360.0) + je_angle -= 360.0; + + je_radius -= 0.5; + DoIn("JE_MOVE", JE_DELAY, je_moveend, movemode, NULL); + return; + foo = NULL; +} + +static void +je_movectrl(int val, void *ptr) +{ + if (!ptr) + { + RemoveTimerEvent("JE_MOVE"); + DoIn("JE_MOVE", JE_DELAY, je_moveend, val, NULL); + } + else + { + RemoveTimerEvent("JE_MOVE"); + je_move(val, (void *)1); + DoIn("JE_MOVE", JE_DELAY, je_move, val, NULL); + } +} + +static void +je_resizectrl(int val, void *ptr) +{ + if (!ptr) + printf("leave resize\n"); + else + printf("enter resize\n"); + return; + val = 0; +} + +*/ + +void +SettingsMoveResize(void) +{ + Dialog *d; + + /* Dialog *dexp; */ + DItem *table, *di, *radio1, *radio2, *radio3; + + if ((d = + FindItem("CONFIGURE_MOVERESIZE", 0, LIST_FINDBY_NAME, + LIST_TYPE_DIALOG))) + { + SoundPlay("SOUND_SETTINGS_ACTIVE"); + ShowDialog(d); + return; + } + SoundPlay("SOUND_SETTINGS_MOVERESIZE"); + + tmp_move = Conf.movemode; + tmp_resize = Conf.resizemode; + tmp_geominfo = Conf.geominfomode; + + d = DialogCreate("CONFIGURE_MOVERESIZE"); + DialogSetTitle(d, _("Move & Resize Settings")); + + table = DialogInitItem(d); + DialogItemTableSetOptions(table, 2, 0, 0, 0); + + if (Conf.dialogs.headers) + { + di = DialogAddItem(table, DITEM_IMAGE); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemImageSetFile(di, "pix/moveres.png"); + + di = DialogAddItem(table, DITEM_TEXT); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemTextSetText(di, + _("Enlightenment Move & Resize\n" + "Method Settings Dialog\n")); + + di = DialogAddItem(table, DITEM_SEPARATOR); + DialogItemSetColSpan(di, 2); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSeparatorSetOrientation(di, 0); + } + + di = DialogAddItem(table, DITEM_TEXT); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 0, 0); + DialogItemSetAlign(di, 0, 512); + DialogItemTextSetText(di, _("Move Methods:")); + + di = DialogAddItem(table, DITEM_TEXT); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 0, 0); + DialogItemSetAlign(di, 0, 512); + DialogItemTextSetText(di, _("Resize Methods:")); + + radio1 = di = DialogAddItem(table, DITEM_RADIOBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemRadioButtonSetText(di, _("Opaque")); + DialogItemRadioButtonSetFirst(di, radio1); + DialogItemRadioButtonGroupSetVal(di, 0); + /* DialogItemRadioButtonSetEventFunc(di, je_movectrl); */ + + radio2 = di = DialogAddItem(table, DITEM_RADIOBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemRadioButtonSetText(di, _("Opaque")); + DialogItemRadioButtonSetFirst(di, radio2); + DialogItemRadioButtonGroupSetVal(di, 0); + /* DialogItemRadioButtonSetEventFunc(di, je_resizectrl); */ + + di = DialogAddItem(table, DITEM_RADIOBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemRadioButtonSetText(di, _("Technical")); + DialogItemRadioButtonSetFirst(di, radio1); + DialogItemRadioButtonGroupSetVal(di, 1); + /* DialogItemRadioButtonSetEventFunc(di, je_movectrl); */ + + di = DialogAddItem(table, DITEM_RADIOBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemRadioButtonSetText(di, _("Technical")); + DialogItemRadioButtonSetFirst(di, radio2); + DialogItemRadioButtonGroupSetVal(di, 1); + /* DialogItemRadioButtonSetEventFunc(di, je_resizectrl); */ + + di = DialogAddItem(table, DITEM_RADIOBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemRadioButtonSetText(di, _("Box")); + DialogItemRadioButtonSetFirst(di, radio1); + DialogItemRadioButtonGroupSetVal(di, 2); + /* DialogItemRadioButtonSetEventFunc(di, je_movectrl); */ + + di = DialogAddItem(table, DITEM_RADIOBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemRadioButtonSetText(di, _("Box")); + DialogItemRadioButtonSetFirst(di, radio2); + DialogItemRadioButtonGroupSetVal(di, 2); + /* DialogItemRadioButtonSetEventFunc(di, je_resizectrl); */ + + di = DialogAddItem(table, DITEM_RADIOBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemRadioButtonSetText(di, _("Shaded")); + DialogItemRadioButtonSetFirst(di, radio1); + DialogItemRadioButtonGroupSetVal(di, 3); + /* DialogItemRadioButtonSetEventFunc(di, je_movectrl); */ + + di = DialogAddItem(table, DITEM_RADIOBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemRadioButtonSetText(di, _("Shaded")); + DialogItemRadioButtonSetFirst(di, radio2); + DialogItemRadioButtonGroupSetVal(di, 3); + /* DialogItemRadioButtonSetEventFunc(di, je_resizectrl); */ + + di = DialogAddItem(table, DITEM_RADIOBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemRadioButtonSetText(di, _("Semi-Solid")); + DialogItemRadioButtonSetFirst(di, radio1); + DialogItemRadioButtonGroupSetVal(di, 4); + /* DialogItemRadioButtonSetEventFunc(di, je_movectrl); */ + + di = DialogAddItem(table, DITEM_RADIOBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemRadioButtonSetText(di, _("Semi-Solid")); + DialogItemRadioButtonSetFirst(di, radio2); + DialogItemRadioButtonGroupSetVal(di, 4); + DialogItemRadioButtonGroupSetValPtr(radio2, &tmp_resize); + /* DialogItemRadioButtonSetEventFunc(di, je_resizectrl); */ + + di = DialogAddItem(table, DITEM_RADIOBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemRadioButtonSetText(di, _("Translucent")); + DialogItemRadioButtonSetFirst(di, radio1); + DialogItemRadioButtonGroupSetVal(di, 5); + DialogItemRadioButtonGroupSetValPtr(radio1, &tmp_move); + /* DialogItemRadioButtonSetEventFunc(di, je_movectrl); */ + + di = DialogAddItem(table, DITEM_NONE); + + di = DialogAddItem(table, DITEM_SEPARATOR); + DialogItemSetColSpan(di, 2); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSeparatorSetOrientation(di, 0); + + di = DialogAddItem(table, DITEM_TEXT); + DialogItemSetColSpan(di, 2); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 0, 0); + DialogItemSetAlign(di, 0, 512); + DialogItemTextSetText(di, _("Move/Resize Geometry Info Postion:")); + + radio3 = di = DialogAddItem(table, DITEM_RADIOBUTTON); + DialogItemSetColSpan(di, 2); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemRadioButtonSetText(di, _("Window Center (O/T/B Methods)")); + DialogItemRadioButtonSetFirst(di, radio3); + DialogItemRadioButtonGroupSetVal(di, 1); + + di = DialogAddItem(table, DITEM_RADIOBUTTON); + DialogItemSetColSpan(di, 2); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemRadioButtonSetText(di, _("Always Screen corner")); + DialogItemRadioButtonSetFirst(di, radio3); + DialogItemRadioButtonGroupSetVal(di, 2); + + di = DialogAddItem(table, DITEM_RADIOBUTTON); + DialogItemSetColSpan(di, 2); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemRadioButtonSetText(di, _("Don't show")); + DialogItemRadioButtonSetFirst(di, radio3); + DialogItemRadioButtonGroupSetVal(di, 0); + DialogItemRadioButtonGroupSetValPtr(radio3, &tmp_geominfo); + + di = DialogAddItem(table, DITEM_SEPARATOR); + DialogItemSetColSpan(di, 2); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSeparatorSetOrientation(di, 0); + + DialogAddButton(d, _("OK"), CB_ConfigureMoveResize, 1); + DialogAddButton(d, _("Apply"), CB_ConfigureMoveResize, 0); + DialogAddButton(d, _("Close"), CB_ConfigureMoveResize, 1); + DialogSetExitFunction(d, CB_ConfigureMoveResize, 2, d); + DialogBindKey(d, "Escape", CB_SettingsEscape, 0, d); + DialogBindKey(d, "Return", CB_ConfigureMoveResize, 0, d); + ShowDialog(d); + + /* + * dexp = DialogCreate("CONFIGURE_MOVERESIZE_EXAMPLE"); + * DialogSetTitle(dexp, _("Move & Resize Settings Example")); + */ + + /* Example dialog + * table = DialogInitItem(dexp); + * DialogItemTableSetOptions(table, 1, 0, 0, 0); + * + * di = DialogAddItem(table, DITEM_TEXT); + * DialogItemSetPadding(di, 2, 2, 2, 2); + * DialogItemSetFill(di, 0, 0); + * DialogItemSetAlign(di, 0, 512); + * DialogItemTextSetText(di, _("Example")); + * + * di = DialogAddItem(table, DITEM_SEPARATOR); + * DialogItemSetColSpan(di, 1); + * DialogItemSetPadding(di, 2, 2, 2, 2); + * DialogItemSetFill(di, 1, 0); + * DialogItemSeparatorSetOrientation(di, 0); + */ + +/* + * DialogAddButton(dexp, _("OK"), CB_ConfigureMoveResize, 1); + */ + + /* ShowDialog(dexp); */ +} + +static int tmp_desktops; +static DItem *tmp_desk_text; +static Dialog *tmp_desk_dialog; +static char tmp_desktop_wraparound; + +static void +CB_ConfigureDesktops(int val, void *data) +{ + if (val < 2) + { + ChangeNumberOfDesktops(tmp_desktops); + Conf.desks.wraparound = tmp_desktop_wraparound; + } + autosave(); + data = NULL; +} + +static void +CB_DesktopDisplayRedraw(int val, void *data) +{ + static char called = 0; + DItem *di; + static Window win, wins[ENLIGHTENMENT_CONF_NUM_DESKTOPS]; + int i; + int w, h; + static int prev_desktops = -1; + char s[64]; + + if (val == 1) + called = 0; + + if ((val != 1) && (prev_desktops == tmp_desktops)) + return; + prev_desktops = tmp_desktops; + di = (DItem *) data; + win = DialogItemAreaGetWindow(di); + DialogItemAreaGetSize(di, &w, &h); + if (!called) + { + ImageClass *ic; + + ic = FindItem("SETTINGS_DESKTOP_AREA", 0, LIST_FINDBY_NAME, + LIST_TYPE_ICLASS); + if (ic) { + IclassApply(ic, win, w, h, 0, 0, STATE_NORMAL, 0); + } + for (i = 0; i < ENLIGHTENMENT_CONF_NUM_DESKTOPS; i++) + wins[i] = 0; + called = 1; + } + for (i = 0; i < tmp_desktops; i++) + { + if (!wins[i]) + { + wins[i] = ECreateWindow(win, 0, 0, 64, 48, 0); + XSetWindowBorderWidth(disp, wins[i], 1); + if (desks.desk[i].bg) + { + Pixmap pmap; + + pmap = ECreatePixmap(disp, wins[i], 64, 48, VRoot.depth); + ESetWindowBackgroundPixmap(disp, wins[i], pmap); + BackgroundApply(desks.desk[i].bg, pmap, 0); + EFreePixmap(disp, pmap); + } + } + } + for (i = (tmp_desktops - 1); i >= 0; i--) +... [truncated message content] |
From: Kim W. <ki...@wo...> - 2004-05-25 22:22:04
|
Jaron Omega wrote: > Hi everybody! > > Here's a patch I have been working on for the past week, and that > I think other E users might appreciate. It's against E 16.7-0.60 > (pre2). What it does is allow you to keep parts of the GUI opaque > when using translucency (thanks imlib2). > > I thought it looked better if the border stayed opaque while the > contents were translucent, or menu highlights are opaque with a > sometimes difficult to see text. I've tried many themes and they > look good, or better depending on your preference, with this patch. > > Also, the root menus give more a transparent illusion, showing > GUI components underneath and terminal text etc. > > Selective Transparency settings are at the bottom of the Background > settings. They are as follows: > > "Enable Selective Transparency" > "Keep Borders Opaque" [GUI/Window borders stay opaque] > Keep Widgets Opaque [E widgets, such as in Settings, stay opaque] > Keep Buttons Opaque [OK/Apply/Close buttons] > Keep Menu Highlights Opaque [Root menu selected item images] > Thanks! I'd like this included. However, in particular one change is required: You adjust the applied ImageClass opacity using a flags field in the ImageClass struct. As you have probably discovered the ImageClass'es are referenced from many different objects and therefore you have to set and clear these flags all the time. The big problem with this is that sometimes the "application" of the ImageClass is deferred (and may even be dropped) via the draw queue mechanism. The flags field may therefore not have the desired value by the time the ImageClass gets applied to the object. This causes visible "glitches". You will have to propagate the flags via an additional parameter to IclassApply() and IclassApplyCopy(), also propagated through the draw queue. You will find that this significantly simplifies the code too :) This should make the introduced "flags" struct items unused. Making the menus "aqua" transparent should be optional. Actually, it might be nice if the menu and tooltip transparency type could be selected between off, background, and "aqua"(?). And then the boring complaints: - Opaque menu item highlighting doesn't seem to work in the winter theme. - Remove obsolete commented out stuff added by the patch. - Don't include "non-changes" like the ones in EWinBit and the added but unused SettingsTransparency() prototype. - Please remove stuff that hasn't been finished like Conf.sel_transparency.focused/unfocused/hilighted/tinted/eterm. Maybe it can be added if implemented. - It would help if you could make the patch based on current CVS. - Watch out with diff's -N flag, I don't think "set.txt" should have been included :) /Kim |
From: Jaron O. <ja...@so...> - 2004-05-26 04:35:47
|
On Wed, May 26, 2004 at 12:21:57AM +0200, Kim Woelders wrote: > Jaron Omega wrote: > >Hi everybody! > > > > Here's a patch I have been working on for the past week, and that > >I think other E users might appreciate. It's against E 16.7-0.60 > >(pre2). What it does is allow you to keep parts of the GUI opaque > >when using translucency (thanks imlib2). > Thanks! > I'd like this included. However, in particular one change is required: > You adjust the applied ImageClass opacity using a flags field in the > ImageClass struct. As you have probably discovered the ImageClass'es are > referenced from many different objects and therefore you have to set and > clear these flags all the time. > The big problem with this is that sometimes the "application" of the > ImageClass is deferred (and may even be dropped) via the draw queue > mechanism. The flags field may therefore not have the desired value by > the time the ImageClass gets applied to the object. This causes visible > "glitches". I will work on this. I think this might take care of some problems I have seen with modifying settings on the fly. > You will have to propagate the flags via an additional parameter to > IclassApply() and IclassApplyCopy(), also propagated through the draw > queue. In my first attempt, my method was similar to your suggestion. But, I didn't mind the draw queue. I think this isn't too bad and maybe soon I'll have this implemented unless someone else does first. > You will find that this significantly simplifies the code too :) > This should make the introduced "flags" struct items unused. I'm sure. Just quickly looking at your suggestion, the propogated flags (perhaps a flags struct) can contain all the data needed about type of image, and just have one routine to query config settings accordingly. > Making the menus "aqua" transparent should be optional. > Actually, it might be nice if the menu and tooltip transparency type > could be selected between off, background, and "aqua"(?). Actually, menus being "aqua" is a hidden option, I had a problem in settings.c getting the radiobuttons to work and decided to comment out that part. Option's there already. The ToolTip transparency I implemented, just now, on my laptop; looks good. > And then the boring complaints: > - Opaque menu item highlighting doesn't seem to work in the winter > theme. I'm thinking I can take care of this when I redo my approach. > - Remove obsolete commented out stuff added by the patch. > - Don't include "non-changes" like the ones in EWinBit and the added but > unused SettingsTransparency() prototype. > - Please remove stuff that hasn't been finished like > Conf.sel_transparency.focused/unfocused/hilighted/tinted/eterm. > Maybe it can be added if implemented. I had the transparency settings in their own dialog box initially, I may return to that approach depending on how many features we can come up with. Nonetheless, I'll make sure unused code is not in my patches. > - It would help if you could make the patch based on current CVS. > - Watch out with diff's -N flag, I don't think "set.txt" should > have been included :) Oh yes, I'm embarrassed about the 'set.txt' ending up in the patch. I hope to have a new patch soon. And thanks for looking at my patch. Jaron Omega |
From: Jaron O. <ja...@so...> - 2004-06-01 08:09:57
|
On Wed, May 26, 2004 at 12:21:57AM +0200, Kim Woelders wrote: > Thanks! > I'd like this included. However, in particular one change is required: > You adjust the applied ImageClass opacity using a flags field in the > ImageClass struct. As you have probably discovered the ImageClass'es are > referenced from many different objects and therefore you have to set and > clear these flags all the time. This patch propogates the image_type flags through IclassApply{,Copy} and through the DrawQueue. > Making the menus "aqua" transparent should be optional. > Actually, it might be nice if the menu and tooltip transparency type > could be selected between off, background, and "aqua"(?). They are now. If you do not choose Aqua, and do not choose to have the item opaque, it's transparency will resemble that of Eterm's behaviour. > And then the boring complaints: > - Opaque menu item highlighting doesn't seem to work in the winter > theme. I have walked through menus.c. I might need some help here. Winter's menu images are opaque, if you open them up in Gimp and make their backgrounds transparent then all will be fine. The problem now is that when you rollover a menu directory (sub_iclass), the image doesn't get flushed as it does in with item_class. So, each time you roll over the image, it gets darker as it stacks the images (bug?). Anyway, I just spent about three hours trying to hunt this down, and haven't been able to do so reliably. Note: Most other themes do not display this issue. But there are a few that do [Ecdysis-v2 for example]. I modified the menu images in Ecdysis-v2, and I must say this patch looks really good with it, it has multishaded menu images so they add to the eye-candy effect. > - Please remove stuff that hasn't been finished like > Conf.sel_transparency.focused/unfocused/hilighted/tinted/eterm. I have kept residue hints of the tint features in this patch. I feel that it will be trivial to implement at the moment. The biggest problem is settings presentation. Right now, the Backgrounds setting dialog is getting large. > Maybe it can be added if implemented. > - It would help if you could make the patch based on current CVS. This patch is based off of a CVS pull the day pre3 was announced. Jaron Omega ================================CUT HERE=============================== diff -ur e.orig/src/E.h e/src/E.h --- e.orig/src/E.h 2004-05-30 20:18:20.000000000 -0700 +++ e/src/E.h 2004-06-01 00:26:32.000000000 -0700 @@ -66,6 +66,23 @@ #define ENABLE_TRANSPARENCY 1 #define ENABLE_THEME_TRANSPARENCY 1 +#define ST_UNKNWN 0 +#define ST_BORDER 1 +#define ST_WIDGET 2 +#define ST_ICON 3 +#define ST_MENU 4 +#define ST_MENU_ITEM 5 +#define ST_TOOLTIP 6 +#define ST_DIALOG 7 +#define ST_HILIGHT 8 +#define ST_PAGER 9 +#define ST_WARP 10 + +#define BMASK_ENABLED 0x0001 +#define BMASK_AQUA 0x0002 +#define BMASK_TINTED 0x0004 +#define BMASK_ISOPAQUE 0x0008 + #else #include <Imlib.h> @@ -1211,6 +1228,19 @@ char warpiconified; char warpfocused; } warplist; + struct + { + int border; + int widget; + int tooltip; + int menu; + int menu_item; + int hilight; + int dialog; + int pager; + int warp; + int icon; + } st_transparency; int deskmode; int movemode; int resizemode; @@ -1567,6 +1597,7 @@ Dialog *d; DItem *di; int x, y; + int image_type; } DrawQueue; @@ -2302,10 +2333,10 @@ void IclassPopulate(ImageClass * iclass); int IclassIsTransparent(ImageClass * iclass); void IclassApply(ImageClass * iclass, Window win, int w, int h, - int active, int sticky, int state, char expose); + int active, int sticky, int state, char expose, int image_type); void IclassApplyCopy(ImageClass * iclass, Window win, int w, int h, int active, int sticky, int state, - PmapMask * pmm, int make_mask); + PmapMask * pmm, int make_mask, int image_type); void FreePmapMask(PmapMask * pmm); /* iconify.c */ diff -ur e.orig/src/borders.c e/src/borders.c --- e.orig/src/borders.c 2004-05-30 20:18:20.000000000 -0700 +++ e/src/borders.c 2004-06-01 00:29:11.000000000 -0700 @@ -741,7 +741,7 @@ IclassApply(ewin->border->part[i].iclass, ewin->bits[i].win, ewin->bits[i].w, ewin->bits[i].h, ewin->active, - ewin->sticky, ewin->bits[i].state, ewin->bits[i].expose); + ewin->sticky, ewin->bits[i].state, ewin->bits[i].expose, ST_BORDER); if (ewin->border->part[i].flags == FLAG_TITLE) { diff -ur e.orig/src/buttons.c e/src/buttons.c --- e.orig/src/buttons.c 2004-05-30 20:18:20.000000000 -0700 +++ e/src/buttons.c 2004-06-01 00:29:22.000000000 -0700 @@ -303,7 +303,7 @@ { EDBUG(3, "ButtonDraw"); - IclassApply(b->iclass, b->win, b->w, b->h, 0, 0, b->state, 0); + IclassApply(b->iclass, b->win, b->w, b->h, 0, 0, b->state, 0, ST_BORDER); if (b->label) TclassApply(b->iclass, b->win, b->w, b->h, 0, 0, b->state, 0, b->tclass, diff -ur e.orig/src/conf.h e/src/conf.h --- e.orig/src/conf.h 2004-05-30 20:18:20.000000000 -0700 +++ e/src/conf.h 2004-05-30 21:26:24.000000000 -0700 @@ -143,6 +143,17 @@ #define CONTROL_GROUP_SWAPMOVE 1372 #define CONTROL_THEME_TRANSPARENCY 1373 +#define CONTROL_ST_BORDER 1375 +#define CONTROL_ST_WIDGET 1376 +#define CONTROL_ST_ICON 1377 +#define CONTROL_ST_MENU 1378 +#define CONTROL_ST_MENU_ITEM 1379 +#define CONTROL_ST_TOOLTIP 1380 +#define CONTROL_ST_DIALOG 1381 +#define CONTROL_ST_HILIGHT 1382 +#define CONTROL_ST_PAGER 1383 +#define CONTROL_ST_WARP 1384 + #define ICLASS_NAME 350 #define ICLASS_NORMAL 351 #define ICLASS_CLICKED 352 diff -ur e.orig/src/config.c e/src/config.c --- e.orig/src/config.c 2004-05-30 20:18:20.000000000 -0700 +++ e/src/config.c 2004-05-31 03:32:59.000000000 -0700 @@ -783,6 +783,36 @@ sscanf(s, "%*i %f", &f1); Conf.autoraise.delay = f1; break; + case CONTROL_ST_BORDER: + Conf.st_transparency.border = i2; + break; + case CONTROL_ST_WIDGET: + Conf.st_transparency.widget = i2; + break; + case CONTROL_ST_ICON: + Conf.st_transparency.icon = i2; + break; + case CONTROL_ST_MENU: + Conf.st_transparency.menu = i2; + break; + case CONTROL_ST_MENU_ITEM: + Conf.st_transparency.menu_item = i2; + break; + case CONTROL_ST_TOOLTIP: + Conf.st_transparency.tooltip = i2; + break; + case CONTROL_ST_DIALOG: + Conf.st_transparency.dialog = i2; + break; + case CONTROL_ST_HILIGHT: + Conf.st_transparency.hilight = i2; + break; + case CONTROL_ST_PAGER: + Conf.st_transparency.pager = i2; + break; + case CONTROL_ST_WARP: + Conf.st_transparency.warp = i2; + break; case CONTROL_GROUP_BORDER: Conf.group_config.set_border = i2; break; @@ -3896,6 +3926,16 @@ fprintf(autosavefile, "1372 %i\n", (int)Conf.group_swapmove); fprintf(autosavefile, "1367 %i\n", (int)Conf.focus.clickraises); fprintf(autosavefile, "1368 %i\n", (int)Conf.tooltips.showroottooltip); + fprintf(autosavefile, "1375 %i\n", (int)Conf.st_transparency.border); + fprintf(autosavefile, "1376 %i\n", (int)Conf.st_transparency.widget); + fprintf(autosavefile, "1377 %i\n", (int)Conf.st_transparency.icon); + fprintf(autosavefile, "1378 %i\n", (int)Conf.st_transparency.menu); + fprintf(autosavefile, "1379 %i\n", (int)Conf.st_transparency.menu_item); + fprintf(autosavefile, "1380 %i\n", (int)Conf.st_transparency.tooltip); + fprintf(autosavefile, "1381 %i\n", (int)Conf.st_transparency.dialog); + fprintf(autosavefile, "1382 %i\n", (int)Conf.st_transparency.hilight); + fprintf(autosavefile, "1383 %i\n", (int)Conf.st_transparency.pager); + fprintf(autosavefile, "1384 %i\n", (int)Conf.st_transparency.warp); fprintf(autosavefile, "1369 %i %i %i\n", (int)Conf.pagers.sel_button, (int)Conf.pagers.win_button, (int)Conf.pagers.menu_button); fprintf(autosavefile, "1373 %i\n", (int)Conf.theme.transparency); diff -ur e.orig/src/coords.c e/src/coords.c --- e.orig/src/coords.c 2004-05-30 20:18:20.000000000 -0700 +++ e/src/coords.c 2004-06-01 00:29:37.000000000 -0700 @@ -99,7 +99,7 @@ EMoveResizeWindow(disp, c_win, cx, cy, cw, ch); pq = Mode.queue_up; Mode.queue_up = 0; - IclassApply(ic, c_win, cw, ch, 1, 0, STATE_NORMAL, 0); + IclassApply(ic, c_win, cw, ch, 1, 0, STATE_NORMAL, 0, ST_UNKNWN); TclassApply(ic, c_win, cw, ch, 0, 0, STATE_NORMAL, 0, tc, s); Mode.queue_up = pq; XFlush(disp); diff -ur e.orig/src/dialog.c e/src/dialog.c --- e.orig/src/dialog.c 2004-05-30 20:18:20.000000000 -0700 +++ e/src/dialog.c 2004-06-01 00:34:12.000000000 -0700 @@ -481,7 +481,7 @@ state = STATE_CLICKED; } IclassApply(d->button[bnum]->iclass, d->button[bnum]->win, - d->button[bnum]->w, d->button[bnum]->h, 0, 0, state, 0); + d->button[bnum]->w, d->button[bnum]->h, 0, 0, state, 0, ST_WIDGET); TclassApply(d->button[bnum]->iclass, d->button[bnum]->win, d->button[bnum]->w, d->button[bnum]->h, 0, 0, state, 1, d->button[bnum]->tclass, d->button[bnum]->text); @@ -557,7 +557,7 @@ if ((!d->tclass) || (!d->iclass)) return; - IclassApply(d->iclass, d->win, d->w, d->h, 0, 0, STATE_NORMAL, 0); + IclassApply(d->iclass, d->win, d->w, d->h, 0, 0, STATE_NORMAL, 0, ST_DIALOG); for (i = 0; i < d->num_buttons; i++) DialogDrawButton(d, i); @@ -1634,6 +1634,7 @@ dq->di = di; dq->x = x; dq->y = y; + dq->image_type = ST_DIALOG; AddItem(dq, "DRAW", 0, LIST_TYPE_DRAW); EDBUG_RETURN_; } @@ -1684,15 +1685,17 @@ di->y + di->item.slider.knob_y, di->item.slider.knob_w, di->item.slider.knob_h); - if (di->item.slider.base_win) + if (di->item.slider.base_win) { IclassApply(di->item.slider.ic_base, di->item.slider.base_win, di->item.slider.base_w, di->item.slider.base_h, 0, - 0, STATE_NORMAL, 0); - if (di->item.slider.border_win) + 0, STATE_NORMAL, 0, ST_WIDGET); + } + if (di->item.slider.border_win) { IclassApply(di->item.slider.ic_border, di->item.slider.border_win, di->item.slider.border_w, - di->item.slider.border_h, 0, 0, STATE_NORMAL, 0); + di->item.slider.border_h, 0, 0, STATE_NORMAL, 0, ST_WIDGET); + } state = STATE_NORMAL; if ((di->hilited) && (di->clicked)) state = STATE_CLICKED; @@ -1700,10 +1703,11 @@ state = STATE_HILITED; else if (!(di->hilited) && (di->clicked)) state = STATE_CLICKED; - if (di->item.slider.knob_win) + if (di->item.slider.knob_win) { IclassApply(di->item.slider.ic_knob, di->item.slider.knob_win, di->item.slider.knob_w, di->item.slider.knob_h, 0, - 0, state, 0); + 0, state, 0, ST_WIDGET); + } break; case DITEM_BUTTON: state = STATE_NORMAL; @@ -1713,16 +1717,18 @@ state = STATE_HILITED; else if (!(di->hilited) && (di->clicked)) state = STATE_CLICKED; - IclassApply(di->iclass, di->win, di->w, di->h, 0, 0, state, 0); + + IclassApply(di->iclass, di->win, di->w, di->h, 0, 0, state, 0, ST_WIDGET); TclassApply(di->iclass, di->win, di->w, di->h, 0, 0, state, 1, di->tclass, di->item.button.text); break; case DITEM_AREA: IclassApply(di->iclass, di->win, di->w, di->h, 0, 0, - STATE_NORMAL, 0); + STATE_NORMAL, 0, ST_DIALOG); break; case DITEM_CHECKBUTTON: state = STATE_NORMAL; + if ((di->hilited) && (di->clicked)) state = STATE_CLICKED; else if ((di->hilited) && (!di->clicked)) @@ -1732,11 +1738,11 @@ if (di->item.check_button.onoff) IclassApply(di->iclass, di->item.check_button.check_win, di->item.check_button.check_orig_w, - di->item.check_button.check_orig_h, 1, 0, state, 0); + di->item.check_button.check_orig_h, 1, 0, state, 0, ST_WIDGET); else IclassApply(di->iclass, di->item.check_button.check_win, di->item.check_button.check_orig_w, - di->item.check_button.check_orig_h, 0, 0, state, 0); + di->item.check_button.check_orig_h, 0, 0, state, 0, ST_WIDGET); XClearArea(disp, d->win, di->x, di->y, di->w, di->h, False); TextDraw(di->tclass, d->win, 0, 0, STATE_NORMAL, di->item.check_button.text, @@ -1757,10 +1763,10 @@ case DITEM_SEPARATOR: if (di->item.separator.horizontal) IclassApply(di->iclass, di->win, di->w, di->h, 0, 0, - STATE_NORMAL, 0); + STATE_NORMAL, 0, ST_WIDGET); else IclassApply(di->iclass, di->win, di->w, di->h, 0, 0, - STATE_CLICKED, 0); + STATE_CLICKED, 0, ST_WIDGET); break; case DITEM_RADIOBUTTON: state = STATE_NORMAL; @@ -1773,11 +1779,11 @@ if (di->item.radio_button.onoff) IclassApply(di->iclass, di->item.radio_button.radio_win, di->item.radio_button.radio_orig_w, - di->item.radio_button.radio_orig_h, 1, 0, state, 0); + di->item.radio_button.radio_orig_h, 1, 0, state, 0, ST_WIDGET); else IclassApply(di->iclass, di->item.radio_button.radio_win, di->item.radio_button.radio_orig_w, - di->item.radio_button.radio_orig_w, 0, 0, state, 0); + di->item.radio_button.radio_orig_w, 0, 0, state, 0, ST_WIDGET); XClearArea(disp, d->win, di->x, di->y, di->w, di->h, False); TextDraw(di->tclass, d->win, 0, 0, STATE_NORMAL, di->item.radio_button.text, diff -ur e.orig/src/draw.c e/src/draw.c --- e.orig/src/draw.c 2004-05-30 20:18:20.000000000 -0700 +++ e/src/draw.c 2004-06-01 00:28:00.000000000 -0700 @@ -219,7 +219,7 @@ /* printf("I %x\n", dq->win); */ if (WinExists(dq->win)) IclassApply(dq->iclass, dq->win, dq->w, dq->h, dq->active, - dq->sticky, dq->state, 0); + dq->sticky, dq->state, 0, dq->image_type); } else if (dq->pager) { diff -ur e.orig/src/iclass.c e/src/iclass.c --- e.orig/src/iclass.c 2004-05-30 20:18:20.000000000 -0700 +++ e/src/iclass.c 2004-06-01 00:39:42.000000000 -0700 @@ -390,15 +390,55 @@ static void ImageStateMakePmapMask(ImageState * is, Drawable win, PmapMask * pmm, - int make_mask, int w, int h) + int make_mask, int w, int h, int image_type) { int apply, trans; int ww, hh; + int flags; PmapMask pmml; #ifdef ENABLE_TRANSPARENCY Imlib_Image *ii = NULL; + switch(image_type) { + case ST_UNKNWN: + flags=0; + break; + case ST_BORDER: + flags = Conf.st_transparency.border; + break; + case ST_WIDGET: + flags = Conf.st_transparency.widget; + break; + case ST_ICON: + flags = Conf.st_transparency.icon; + break; + case ST_MENU: + flags = Conf.st_transparency.menu; + break; + case ST_MENU_ITEM: + flags = Conf.st_transparency.menu_item; + break; + case ST_TOOLTIP: + flags = Conf.st_transparency.tooltip; + break; + case ST_DIALOG: + flags = Conf.st_transparency.dialog; + break; + case ST_HILIGHT: + flags = Conf.st_transparency.hilight; + break; + case ST_PAGER: + flags = Conf.st_transparency.pager; + break; + case ST_WARP: + flags = Conf.st_transparency.warp; + break; + default: + flags=0; + break; + } + /* * is->transparent flags: * 0x01: Use desktop background pixmap as base @@ -428,7 +468,7 @@ imlib_image_has_alpha())); #ifdef ENABLE_TRANSPARENCY - if (trans) + if (!(flags & BMASK_ISOPAQUE)) { Window cr; Pixmap bg; @@ -440,8 +480,13 @@ { /* Create the background base image */ bg = BackgroundGetPixmap(desks.desk[desks.current].bg); - if ((is->transparent & 0x02) != 0 || bg == None) + + if(flags & BMASK_AQUA) { + bg = VRoot.win; + } else if (bg == None) { bg = VRoot.win; + } + imlib_context_set_drawable(bg); ii = imlib_create_image_from_drawable(0, xx, yy, w, h, 1); imlib_context_set_image(ii); @@ -461,13 +506,17 @@ { imlib_context_set_blend(1); #ifdef ENABLE_THEME_TRANSPARENCY - imlib_context_set_color_modifier(icm); + if(!(flags & BMASK_ISOPAQUE)) { + imlib_context_set_color_modifier(icm); + } #endif imlib_context_set_operation(IMLIB_OP_COPY); imlib_blend_image_onto_image(is->im, 0, 0, 0, ww, hh, 0, 0, w, h); imlib_context_set_blend(0); #ifdef ENABLE_THEME_TRANSPARENCY - imlib_context_set_color_modifier(NULL); + if(!(flags & BMASK_ISOPAQUE)) { + imlib_context_set_color_modifier(NULL); + } #if 0 /* Do we ever need to free it? */ imlib_free_color_modifier(); #endif @@ -719,7 +768,7 @@ void IclassApply(ImageClass * iclass, Window win, int w, int h, int active, - int sticky, int state, char expose) + int sticky, int state, char expose, int image_type) { ImageState *is; @@ -757,6 +806,7 @@ dq->di = NULL; dq->x = 0; dq->y = 0; + dq->image_type = image_type; AddItem(dq, "DRAW", dq->win, LIST_TYPE_DRAW); EDBUG_RETURN_; } @@ -775,7 +825,7 @@ if (is->im) { - ImageStateMakePmapMask(is, win, NULL, 1, w, h); + ImageStateMakePmapMask(is, win, NULL, 1, w, h, image_type); if ((is->unloadable) || (Conf.memory_paranoia)) { @@ -806,7 +856,7 @@ void IclassApplyCopy(ImageClass * iclass, Window win, int w, int h, int active, - int sticky, int state, PmapMask * pmm, int make_mask) + int sticky, int state, PmapMask * pmm, int make_mask, int image_type) { ImageState *is; XGCValues gcv; @@ -827,23 +877,25 @@ EDBUG_RETURN_; is = IclassGetImageState2(iclass, state, active, sticky); + if (!is) EDBUG_RETURN_; if (is->im == NULL && is->im_file) - ImageStateRealize(is); + ImageStateRealize(is); if (is->im) { - ImageStateMakePmapMask(is, win, pmm, make_mask, w, h); + ImageStateMakePmapMask(is, win, pmm, make_mask, w, h, image_type); - if ((is->unloadable) || (Conf.memory_paranoia)) + if ((is->unloadable) || (Conf.memory_paranoia)) { imlib_context_set_image(is->im); imlib_free_image(); is->im = NULL; } + EDBUG_RETURN_; } diff -ur e.orig/src/iconify.c e/src/iconify.c --- e.orig/src/iconify.c 2004-05-30 20:18:20.000000000 -0700 +++ e/src/iconify.c 2004-06-01 00:35:29.000000000 -0700 @@ -824,7 +824,7 @@ if (!ic) return; - IclassApplyCopy(ic, d, w, h, 0, 0, STATE_NORMAL, &pmm, 1); + IclassApplyCopy(ic, d, w, h, 0, 0, STATE_NORMAL, &pmm, 1, ST_ICON); PastePixmap(disp, d, pmm.pmap, pmm.mask, x, y); FreePmapMask(&pmm); } @@ -839,8 +839,7 @@ ic = FindItem("DEFAULT_ICON_BUTTON", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); if (!ic) return; - - IclassApplyCopy(ic, d, w, h, 0, 0, STATE_NORMAL, &pmm, 1); + IclassApplyCopy(ic, d, w, h, 0, 0, STATE_NORMAL, &pmm, 1, ST_ICON); PasteMask(disp, d, pmm.mask, x, y, w, h); FreePmapMask(&pmm); } @@ -1622,8 +1621,9 @@ ic = FindItem("ICONBOX_SCROLLBAR_BASE_VERTICAL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); - if (ic) - IclassApply(ic, ib->scroll_win, -1, -1, 0, 0, STATE_NORMAL, 0); + if (ic) { + IclassApply(ic, ib->scroll_win, -1, -1, 0, 0, STATE_NORMAL, 0, ST_ICON); + } ic = FindItem("ICONBOX_SCROLLBAR_KNOB_VERTICAL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); if (ic) @@ -1634,7 +1634,7 @@ state = STATE_HILITED; if (ib->scrollbar_clicked) state = STATE_CLICKED; - IclassApply(ic, ib->scrollbar_win, -1, -1, 0, 0, state, 0); + IclassApply(ic, ib->scrollbar_win, -1, -1, 0, 0, state, 0, ST_ICON); } ic = FindItem("ICONBOX_SCROLLKNOB_VERTICAL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); @@ -1646,7 +1646,7 @@ state = STATE_HILITED; if (ib->scrollbar_clicked) state = STATE_CLICKED; - IclassApply(ic, ib->scrollbarknob_win, -1, -1, 0, 0, state, 0); + IclassApply(ic, ib->scrollbarknob_win, -1, -1, 0, 0, state, 0, ST_ICON); } ic = FindItem("ICONBOX_ARROW_UP", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); @@ -1658,7 +1658,7 @@ state = STATE_HILITED; if (ib->arrow1_clicked) state = STATE_CLICKED; - IclassApply(ic, ib->arrow1_win, -1, -1, 0, 0, state, 0); + IclassApply(ic, ib->arrow1_win, -1, -1, 0, 0, state, 0, ST_ICON); } ic = FindItem("ICONBOX_ARROW_DOWN", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); @@ -1670,7 +1670,7 @@ state = STATE_HILITED; if (ib->arrow2_clicked) state = STATE_CLICKED; - IclassApply(ic, ib->arrow2_win, -1, -1, 0, 0, state, 0); + IclassApply(ic, ib->arrow2_win, -1, -1, 0, 0, state, 0, ST_ICON); } /* remove this coment when fixed */ } @@ -1864,8 +1864,9 @@ ic = FindItem("ICONBOX_SCROLLBAR_BASE_HORIZONTAL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); - if (ic) - IclassApply(ic, ib->scroll_win, -1, -1, 0, 0, STATE_NORMAL, 0); + if (ic) { + IclassApply(ic, ib->scroll_win, -1, -1, 0, 0, STATE_NORMAL, 0, ST_ICON); + } ic = FindItem("ICONBOX_SCROLLBAR_KNOB_HORIZONTAL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); if (ic) @@ -1876,7 +1877,7 @@ state = STATE_HILITED; if (ib->scrollbar_clicked) state = STATE_CLICKED; - IclassApply(ic, ib->scrollbar_win, -1, -1, 0, 0, state, 0); + IclassApply(ic, ib->scrollbar_win, -1, -1, 0, 0, state, 0, ST_ICON); } ic = FindItem("ICONBOX_SCROLLKNOB_HORIZONTAL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); @@ -1888,7 +1889,7 @@ state = STATE_HILITED; if (ib->scrollbar_clicked) state = STATE_CLICKED; - IclassApply(ic, ib->scrollbarknob_win, -1, -1, 0, 0, state, 0); + IclassApply(ic, ib->scrollbarknob_win, -1, -1, 0, 0, state, 0, ST_ICON); } ic = FindItem("ICONBOX_ARROW_LEFT", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); @@ -1900,7 +1901,7 @@ state = STATE_HILITED; if (ib->arrow1_clicked) state = STATE_CLICKED; - IclassApply(ic, ib->arrow1_win, -1, -1, 0, 0, state, 0); + IclassApply(ic, ib->arrow1_win, -1, -1, 0, 0, state, 0, ST_ICON); } ic = FindItem("ICONBOX_ARROW_RIGHT", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); @@ -1912,7 +1913,7 @@ state = STATE_HILITED; if (ib->arrow2_clicked) state = STATE_CLICKED; - IclassApply(ic, ib->arrow2_win, -1, -1, 0, 0, state, 0); + IclassApply(ic, ib->arrow2_win, -1, -1, 0, 0, state, 0, ST_ICON); } } PropagateShapes(ib->win); @@ -2103,7 +2104,7 @@ { EMoveResizeWindow(disp, ib->cover_win, ib_xlt, ib_ylt, ib_ww, ib_hh); EMapWindow(disp, ib->cover_win); - IclassApply(ib_ic_cover, ib->cover_win, -1, -1, 0, 0, STATE_NORMAL, 0); + IclassApply(ib_ic_cover, ib->cover_win, -1, -1, 0, 0, STATE_NORMAL, 0, ST_ICON); } else { @@ -2119,7 +2120,7 @@ GetWinWH(ib->icon_win, (unsigned int *)&w, (unsigned int *)&h); IclassApplyCopy(ib_ic_box, ib->icon_win, w, h, 0, 0, STATE_NORMAL, - &pmm, 1); + &pmm, 1, ST_ICON); EShapeCombineMask(disp, ib->icon_win, ShapeBounding, 0, 0, pmm.mask, ShapeSet); PastePixmap(disp, ib->pmap, pmm.pmap, pmm.mask, 0, 0); diff -ur e.orig/src/ipc.c e/src/ipc.c --- e.orig/src/ipc.c 2004-05-30 20:18:20.000000000 -0700 +++ e/src/ipc.c 2004-06-01 00:36:14.000000000 -0700 @@ -1295,7 +1295,7 @@ } pq = Mode.queue_up; Mode.queue_up = 0; - IclassApply(iclass, win, w, h, 0, 0, st, 0); + IclassApply(iclass, win, w, h, 0, 0, st, 0, ST_UNKNWN); Mode.queue_up = pq; } } @@ -1337,7 +1337,7 @@ pq = Mode.queue_up; Mode.queue_up = 0; IclassApplyCopy(iclass, win, w, h, 0, 0, st, &pmm, - 1); + 1, ST_UNKNWN); Mode.queue_up = pq; Esnprintf(buf, sizeof(buf), "0x%08x 0x%08x", (unsigned)pmm.pmap, (unsigned)pmm.mask); diff -ur e.orig/src/menus.c e/src/menus.c --- e.orig/src/menus.c 2004-05-30 20:18:20.000000000 -0700 +++ e/src/menus.c 2004-06-01 00:36:52.000000000 -0700 @@ -770,7 +770,7 @@ ih = 0; GetWinWH(m->items[i]->icon_win, &iw, &ih); IclassApply(m->items[i]->icon_iclass, m->items[i]->icon_win, iw, - ih, 0, 0, STATE_NORMAL, 0); + ih, 0, 0, STATE_NORMAL, 0, ST_MENU_ITEM); } if (x + maxw > mmw) mmw = x + maxw; @@ -828,7 +828,7 @@ GetWinWH(m->win, &w, &h); FreePmapMask(&m->pmm); IclassApplyCopy(m->style->bg_iclass, m->win, w, h, 0, 0, - STATE_NORMAL, &m->pmm, 1); + STATE_NORMAL, &m->pmm, 1, ST_MENU); ESetWindowBackgroundPixmap(disp, m->win, m->pmm.pmap); EShapeCombineMask(disp, m->win, ShapeBounding, 0, 0, m->pmm.mask, ShapeSet); @@ -882,12 +882,13 @@ { PmapMask pmm; - if (mi->child) + if (mi->child) { IclassApplyCopy(m->style->sub_iclass, mi->win, w, h, - 0, 0, mi->state, &pmm, 1); - else + 0, 0, mi->state, &pmm, 1, ST_MENU_ITEM); + } else { IclassApplyCopy(m->style->item_iclass, mi->win, w, h, - 0, 0, mi->state, &pmm, 1); + 0, 0, mi->state, &pmm, 1, ST_MENU_ITEM); + } if (pmm.mask) { XSetClipMask(disp, gc, pmm.mask); @@ -901,12 +902,13 @@ } else { - if (mi->child) + if (mi->child) { IclassApplyCopy(m->style->sub_iclass, mi->win, w, h, 0, 0, - mi->state, mi_pmm, 1); - else + mi->state, mi_pmm, 1, ST_MENU_ITEM); + } else { IclassApplyCopy(m->style->item_iclass, mi->win, w, h, 0, 0, - mi->state, mi_pmm, 1); + mi->state, mi_pmm, 1, ST_MENU_ITEM); + } } } } @@ -931,11 +933,10 @@ GetWinXY(mi->win, &x, &y); if (!m->style->use_item_bg) { - if ((mi->state != STATE_NORMAL) || (mi->child)) + if ((mi->state != STATE_NORMAL) || (mi->child)) { IclassApply(m->style->item_iclass, mi->win, w, h, 0, 0, - mi->state, 0); - else - { + mi->state, 0, ST_MENU); + } else { ESetWindowBackgroundPixmap(disp, mi->win, ParentRelative); EShapeCombineMask(disp, mi->win, ShapeBounding, 0, 0, None, ShapeSet); @@ -944,12 +945,13 @@ } else { - if (mi->child) + if (mi->child) { IclassApply(m->style->sub_iclass, mi->win, w, h, 0, 0, - mi->state, 0); - else + mi->state, 0, ST_MENU); + } else { IclassApply(m->style->item_iclass, mi->win, w, h, 0, 0, - mi->state, 0); + mi->state, 0, ST_MENU); + } } } diff -ur e.orig/src/pager.c e/src/pager.c --- e.orig/src/pager.c 2004-05-30 20:18:20.000000000 -0700 +++ e/src/pager.c 2004-06-01 00:37:22.000000000 -0700 @@ -212,8 +212,9 @@ pq = Mode.queue_up; Mode.queue_up = 0; ic = FindItem("PAGER_SEL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); - if (ic) - IclassApply(ic, p->sel_win, p->w / ax, p->h / ay, 0, 0, STATE_NORMAL, 0); + if (ic) { + IclassApply(ic, p->sel_win, p->w / ax, p->h / ay, 0, 0, STATE_NORMAL, 0, ST_PAGER); + } Mode.queue_up = pq; return p; } @@ -269,7 +270,7 @@ cy = desks.desk[p->desktop].current_area_y; EMoveResizeWindow(disp, p->sel_win, cx * p->dw, cy * p->dh, p->dw, p->dh); - IclassApply(ic, p->sel_win, p->dw, p->dh, 0, 0, STATE_NORMAL, 0); + IclassApply(ic, p->sel_win, p->dw, p->dh, 0, 0, STATE_NORMAL, 0, ST_PAGER); } Mode.queue_up = pq; @@ -530,9 +531,10 @@ ImageClass *ic = NULL; ic = FindItem("PAGER_WIN", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); - if (ic) + if (ic) { IclassApplyCopy(ic, ewin->win, w, h, 0, 0, STATE_NORMAL, - &ewin->mini_pmm, 1); + &ewin->mini_pmm, 1, ST_PAGER); + } } else { @@ -624,6 +626,7 @@ dq->di = NULL; dq->x = 0; dq->y = 0; + dq->image_type = ST_PAGER; AddItem(dq, "DRAW", dq->win, LIST_TYPE_DRAW); return; } @@ -645,9 +648,10 @@ ic = FindItem("PAGER_BACKGROUND", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); - if (ic) + if (ic) { IclassApplyCopy(ic, p->win, p->w / ax, p->h / ay, 0, 0, - STATE_NORMAL, &p->bgpmap, 0); + STATE_NORMAL, &p->bgpmap, 0, ST_PAGER); + } } else { @@ -1048,9 +1052,10 @@ EMapWindow(disp, p->sel_win); ic = FindItem("PAGER_SEL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); - if (ic) + if (ic) { IclassApply(ic, p->sel_win, p->dw, p->dh, 0, 0, - STATE_NORMAL, 0); + STATE_NORMAL, 0, ST_PAGER); + } } } Efree(pl); @@ -1215,7 +1220,7 @@ hh = (i * h) / w; xx = x + ((w - ww) / 2); yy = y + ((h - hh) / 2); - IclassApply(ic, p->hi_win, ww, hh, 0, 0, STATE_NORMAL, 0); + IclassApply(ic, p->hi_win, ww, hh, 0, 0, STATE_NORMAL, 0, ST_PAGER); EMoveResizeWindow(disp, p->hi_win, xx, yy, ww, hh); XClearWindow(disp, p->hi_win); { @@ -1239,7 +1244,7 @@ hh = i; xx = x + ((w - ww) / 2); yy = y + ((h - hh) / 2); - IclassApply(ic, p->hi_win, ww, hh, 0, 0, STATE_NORMAL, 0); + IclassApply(ic, p->hi_win, ww, hh, 0, 0, STATE_NORMAL, 0, ST_PAGER); EMoveResizeWindow(disp, p->hi_win, xx, yy, ww, hh); XClearWindow(disp, p->hi_win); { diff -ur e.orig/src/progress.c e/src/progress.c --- e.orig/src/progress.c 2004-05-30 20:18:20.000000000 -0700 +++ e/src/progress.c 2004-05-30 20:45:09.000000000 -0700 @@ -97,7 +97,7 @@ Mode.queue_up = 0; TclassApply(p->inc, p->n_win, p->h * 5, p->h, 0, 0, STATE_CLICKED, 0, p->tnc, s); - IclassApply(p->inc, p->p_win, w, p->h, 1, 0, STATE_NORMAL, 0); + IclassApply(p->inc, p->p_win, w, p->h, 1, 0, STATE_NORMAL, 0, ST_UNKNWN); EResizeWindow(disp, p->p_win, w, p->h); Mode.queue_up = pq; XFlush(disp); @@ -119,9 +119,9 @@ w = p->w; pq = Mode.queue_up; Mode.queue_up = 0; - IclassApply(p->ic, p->win, p->w - (p->h * 5), p->h, 0, 0, STATE_NORMAL, 0); - IclassApply(p->inc, p->n_win, (p->h * 5), p->h, 0, 0, STATE_CLICKED, 0); - IclassApply(p->ipc, p->p_win, w, p->h, 1, 0, STATE_NORMAL, 0); + IclassApply(p->ic, p->win, p->w - (p->h * 5), p->h, 0, 0, STATE_NORMAL, 0, ST_UNKNWN); + IclassApply(p->inc, p->n_win, (p->h * 5), p->h, 0, 0, STATE_CLICKED, 0, ST_UNKNWN); + IclassApply(p->ipc, p->p_win, w, p->h, 1, 0, STATE_NORMAL, 0, ST_UNKNWN); EMapRaised(disp, p->win); EMapRaised(disp, p->n_win); EMapRaised(disp, p->p_win); diff -ur e.orig/src/settings.c e/src/settings.c --- e.orig/src/settings.c 2004-05-30 20:18:20.000000000 -0700 +++ e/src/settings.c 2004-06-01 00:16:00.000000000 -0700 @@ -1058,7 +1058,7 @@ ic = FindItem("SETTINGS_DESKTOP_AREA", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); if (ic) - IclassApply(ic, win, w, h, 0, 0, STATE_NORMAL, 0); + IclassApply(ic, win, w, h, 0, 0, STATE_NORMAL, 0, ST_UNKNWN); for (i = 0; i < ENLIGHTENMENT_CONF_NUM_DESKTOPS; i++) wins[i] = 0; called = 1; @@ -1268,13 +1268,13 @@ ic = FindItem("SETTINGS_AREA_AREA", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); if (ic) - IclassApply(ic, win, w, h, 0, 0, STATE_NORMAL, 0); + IclassApply(ic, win, w, h, 0, 0, STATE_NORMAL, 0, ST_UNKNWN); awin = ECreateWindow(win, 0, 0, 18, 14, 0); ic = FindItem("SETTINGS_AREADESK_AREA", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); if (ic) { - IclassApplyCopy(ic, awin, 18, 14, 0, 0, STATE_NORMAL, &pmm, 0); + IclassApplyCopy(ic, awin, 18, 14, 0, 0, STATE_NORMAL, &pmm, 0, ST_UNKNWN); ESetWindowBackgroundPixmap(disp, awin, pmm.pmap); FreePmapMask(&pmm); } @@ -2442,6 +2442,25 @@ static char tmp_userbg; static int tmp_bg_timeout; static int tmp_theme_transparency; +static char tmp_st_enabled; +static char tmp_st_border_isopaque; +static char tmp_st_widget_isopaque; +static char tmp_st_tooltip_isopaque; +static char tmp_st_tooltip_isaqua; +static char tmp_st_menu_isopaque; +static char tmp_st_menu_isaqua; +static char tmp_st_menu_item_isopaque; +static char tmp_st_menu_item_isaqua; +static char tmp_st_hilight_isopaque; +static char tmp_st_hilight_isaqua; +static char tmp_st_dialog_isopaque; +static char tmp_st_dialog_aqua; +static char tmp_st_pager_isopaque; +static char tmp_st_pager_aqua; +static char tmp_st_warp_isopaque; +static char tmp_st_warp_isaqua; +static char tmp_st_icon_isopaque; +static char tmp_st_icon_isaqua; static void BG_RedrawView(char nuke_old); @@ -2456,6 +2475,62 @@ Conf.backgrounds.hiquality = tmp_hiq; Conf.backgrounds.user = tmp_userbg; #ifdef ENABLE_THEME_TRANSPARENCY + + if(tmp_st_border_isopaque == 1) { + Conf.st_transparency.border |= BMASK_ISOPAQUE; + } else { + Conf.st_transparency.border &= ~BMASK_ISOPAQUE; + } + if(tmp_st_dialog_isopaque == 1) { + Conf.st_transparency.dialog |= BMASK_ISOPAQUE; + } else { + Conf.st_transparency.dialog &= ~BMASK_ISOPAQUE; + } + if(tmp_st_widget_isopaque == 1) { + Conf.st_transparency.widget |= BMASK_ISOPAQUE; + } else { + Conf.st_transparency.widget &= ~BMASK_ISOPAQUE; + } + if(tmp_st_menu_isopaque == 1) { + Conf.st_transparency.menu |= BMASK_ISOPAQUE; + Conf.st_transparency.menu &= ~BMASK_AQUA; + } else if(tmp_st_menu_isaqua == 1) { + Conf.st_transparency.menu &= ~BMASK_ISOPAQUE; + Conf.st_transparency.menu |= BMASK_AQUA; + } else { + Conf.st_transparency.menu &= ~BMASK_ISOPAQUE; + Conf.st_transparency.menu &= ~BMASK_AQUA; + } + if(tmp_st_menu_item_isopaque == 1) { + Conf.st_transparency.menu_item &= ~BMASK_AQUA; + Conf.st_transparency.menu_item |= BMASK_ISOPAQUE; + } else if(tmp_st_menu_item_isaqua == 1) { + Conf.st_transparency.menu_item &= ~BMASK_ISOPAQUE; + Conf.st_transparency.menu_item |= BMASK_AQUA; + } else { + Conf.st_transparency.menu_item &= ~BMASK_ISOPAQUE; + Conf.st_transparency.menu_item &= ~BMASK_AQUA; + } + if(tmp_st_tooltip_isopaque == 1) { + Conf.st_transparency.tooltip &= ~BMASK_AQUA; + Conf.st_transparency.tooltip |= BMASK_ISOPAQUE; + } else if(tmp_st_tooltip_isaqua == 1) { + Conf.st_transparency.tooltip &= ~BMASK_ISOPAQUE; + Conf.st_transparency.tooltip |= BMASK_AQUA; + } else { + Conf.st_transparency.tooltip &= ~BMASK_AQUA; + Conf.st_transparency.tooltip &= ~BMASK_ISOPAQUE; + } + if(tmp_st_icon_isopaque == 1) { + Conf.st_transparency.icon &= ~BMASK_AQUA; + Conf.st_transparency.icon |= BMASK_ISOPAQUE; + } else if(tmp_st_icon_isaqua == 1) { + Conf.st_transparency.icon &= ~BMASK_ISOPAQUE; + Conf.st_transparency.icon |= BMASK_AQUA; + } else { + Conf.st_transparency.icon &= ~BMASK_AQUA; + Conf.st_transparency.icon &= ~BMASK_ISOPAQUE; + } TransparencySet(tmp_theme_transparency); #endif ESetColor(&(tmp_bg->bg_solid), tmp_bg_r, tmp_bg_g, tmp_bg_b); @@ -2498,6 +2573,7 @@ { BackgroundImagesKeep(tmp_bg, 0); } + HandleDrawQueue(); autosave(); data = NULL; @@ -2772,10 +2848,10 @@ if (i == tmp_bg_selected) IclassApplyCopy(ic, pmap, 64 + 8, 48 + 8, 0, 0, - STATE_CLICKED, &pmm, 0); + STATE_CLICKED, &pmm, 0, ST_UNKNWN); else IclassApplyCopy(ic, pmap, 64 + 8, 48 + 8, 0, 0, - STATE_NORMAL, &pmm, 0); + STATE_NORMAL, &pmm, 0, ST_UNKNWN); XCopyArea(disp, pmm.pmap, pmap, gc, 0, 0, 64 + 8, 48 + 8, x, 0); FreePmapMask(&pmm); @@ -3180,6 +3256,36 @@ tmp_bg_timeout = Conf.backgrounds.timeout; tmp_theme_transparency = Conf.theme.transparency; + if(Conf.st_transparency.border & BMASK_ISOPAQUE) { + tmp_st_border_isopaque = 1; + } + if(Conf.st_transparency.widget & BMASK_ISOPAQUE) { + tmp_st_widget_isopaque = 1; + } + if(Conf.st_transparency.dialog & BMASK_ISOPAQUE) { + tmp_st_dialog_isopaque = 1; + } + if(Conf.st_transparency.tooltip & BMASK_ISOPAQUE) { + tmp_st_tooltip_isopaque = 1; + } else if(Conf.st_transparency.tooltip & BMASK_AQUA) { + tmp_st_tooltip_isaqua = 1; + } + if(Conf.st_transparency.icon & BMASK_ISOPAQUE) { + tmp_st_icon_isopaque = 1; + } else if(Conf.st_transparency.icon & BMASK_AQUA) { + tmp_st_icon_isaqua = 1; + } + if(Conf.st_transparency.menu & BMASK_ISOPAQUE) { + tmp_st_menu_isopaque = 1; + } else if(Conf.st_transparency.menu & BMASK_AQUA) { + tmp_st_menu_isaqua = 1; + } + if(Conf.st_transparency.menu_item & BMASK_ISOPAQUE) { + tmp_st_menu_item_isopaque = 1; + } else if(Conf.st_transparency.menu_item & BMASK_AQUA) { + tmp_st_menu_item_isaqua = 1; + } + d = bg_sel_dialog = DialogCreate("CONFIGURE_BG"); DialogSetTitle(d, _("Desktop Background Settings")); @@ -3570,6 +3676,108 @@ DialogItemSetPadding(di, 2, 2, 2, 2); DialogItemSetFill(di, 1, 0); DialogItemSeparatorSetOrientation(di, 0); + + di = DialogAddItem(table, DITEM_TEXT); + DialogItemSetColSpan(di, 3); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 0, 0); + DialogItemSetAlign(di, 0, 512); + DialogItemTextSetText(di, _("Selective Transparency (Changes might require restart):")); + + di = DialogAddItem(table, DITEM_CHECKBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSetColSpan(di, 3); + DialogItemCheckButtonSetText(di, _("Keep Borders Opaque")); + DialogItemCheckButtonSetState(di, tmp_st_border_isopaque); + DialogItemCheckButtonSetPtr(di, &tmp_st_border_isopaque); + + di = DialogAddItem(table, DITEM_CHECKBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSetColSpan(di, 1); + DialogItemCheckButtonSetText(di, _("Keep Tooltips Opaque")); + DialogItemCheckButtonSetState(di, tmp_st_tooltip_isopaque); + DialogItemCheckButtonSetPtr(di, &tmp_st_tooltip_isopaque); + + di = DialogAddItem(table, DITEM_CHECKBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSetColSpan(di, 2); + DialogItemCheckButtonSetText(di, _("Enable Aqua Transparency [Tooltips]")); + DialogItemCheckButtonSetState(di, tmp_st_tooltip_isaqua); + DialogItemCheckButtonSetPtr(di, &tmp_st_tooltip_isaqua); + + di = DialogAddItem(table, DITEM_CHECKBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSetColSpan(di, 3); + DialogItemCheckButtonSetText(di, _("Keep Dialog Contents Opaque")); + DialogItemCheckButtonSetState(di, tmp_st_dialog_isopaque); + DialogItemCheckButtonSetPtr(di, &tmp_st_dialog_isopaque); + + di = DialogAddItem(table, DITEM_CHECKBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSetColSpan(di, 3); + DialogItemCheckButtonSetText(di, _("Keep Dialog Widgets Opaque")); + DialogItemCheckButtonSetState(di, tmp_st_widget_isopaque); + DialogItemCheckButtonSetPtr(di, &tmp_st_widget_isopaque); + + di = DialogAddItem(table, DITEM_CHECKBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSetColSpan(di, 1); + DialogItemCheckButtonSetText(di, _("Keep Menus Opaque")); + DialogItemCheckButtonSetState(di, tmp_st_menu_isopaque); + DialogItemCheckButtonSetPtr(di, &tmp_st_menu_isopaque); + + di = DialogAddItem(table, DITEM_CHECKBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSetColSpan(di, 2); + DialogItemCheckButtonSetText(di, _("Enable Aqua Transparency [Menus]")); + DialogItemCheckButtonSetState(di, tmp_st_menu_isaqua); + DialogItemCheckButtonSetPtr(di, &tmp_st_menu_isaqua); + + di = DialogAddItem(table, DITEM_CHECKBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSetColSpan(di, 1); + DialogItemCheckButtonSetText(di, _("Keep Menu Items Opaque")); + DialogItemCheckButtonSetState(di, tmp_st_menu_item_isopaque); + DialogItemCheckButtonSetPtr(di, &tmp_st_menu_item_isopaque); + + di = DialogAddItem(table, DITEM_CHECKBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSetColSpan(di, 2); + DialogItemCheckButtonSetText(di, _("Enable Aqua Transparency [Menu Items]")); + DialogItemCheckButtonSetState(di, tmp_st_menu_item_isaqua); + DialogItemCheckButtonSetPtr(di, &tmp_st_menu_item_isaqua); + + di = DialogAddItem(table, DITEM_CHECKBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSetColSpan(di, 1); + DialogItemCheckButtonSetText(di, _("Keep Icons Opaque")); + DialogItemCheckButtonSetState(di, tmp_st_icon_isopaque); + DialogItemCheckButtonSetPtr(di, &tmp_st_icon_isopaque); + + di = DialogAddItem(table, DITEM_CHECKBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSetColSpan(di, 2); + DialogItemCheckButtonSetText(di, _("Enable Aqua Transparency [Icons]")); + DialogItemCheckButtonSetState(di, tmp_st_icon_isaqua); + DialogItemCheckButtonSetPtr(di, &tmp_st_icon_isaqua); + + di = DialogAddItem(table, DITEM_SEPARATOR); + DialogItemSetColSpan(di, 3); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSeparatorSetOrientation(di, 0); + #endif /* ENABLE_THEME_TRANSPARENCY */ DialogAddButton(d, _("OK"), CB_ConfigureBG, 1); diff -ur e.orig/src/setup.c e/src/setup.c --- e.orig/src/setup.c 2004-05-30 20:18:20.000000000 -0700 +++ e/src/setup.c 2004-06-01 00:05:01.000000000 -0700 @@ -436,6 +436,12 @@ Conf.warpmenus = 1; Conf.manual_placement = 0; Conf.edge_flip_resistance = 15; + Conf.st_transparency.menu |= BMASK_AQUA; + Conf.st_transparency.menu_item |= BMASK_ISOPAQUE; + Conf.st_transparency.tooltip |= BMASK_AQUA; + Conf.st_transparency.widget |= BMASK_ISOPAQUE; + Conf.st_transparency.border |= BMASK_ISOPAQUE; + Conf.st_transparency.icon |= BMASK_ISOPAQUE; ScreenInit(); diff -ur e.orig/src/startup.c e/src/startup.c --- e.orig/src/startup.c 2004-05-30 20:18:20.000000000 -0700 +++ e/src/startup.c 2004-05-30 20:46:06.000000000 -0700 @@ -219,8 +219,8 @@ pq = Mode.queue_up; Mode.queue_up = 0; - IclassApply(ic, b1, VRoot.w, Conf.desks.dragbar_width, 0, 0, 0, 0); - IclassApply(ic, b2, VRoot.w, Conf.desks.dragbar_width, 0, 0, 0, 0); + IclassApply(ic, b1, VRoot.w, Conf.desks.dragbar_width, 0, 0, 0, 0, ST_UNKNWN); + IclassApply(ic, b2, VRoot.w, Conf.desks.dragbar_width, 0, 0, 0, 0, ST_UNKNWN); Mode.queue_up = pq; BackgroundApply(bg, win1, 1); BackgroundApply(bg, win2, 1); diff -ur e.orig/src/tooltips.c e/src/tooltips.c --- e.orig/src/tooltips.c 2004-05-30 20:18:20.000000000 -0700 +++ e/src/tooltips.c 2004-06-01 00:37:51.000000000 -0700 @@ -272,7 +272,7 @@ iy = (h - ih) / 2; EMoveResizeWindow(disp, tt->iwin, ix, iy, iw, ih); EMapWindow(disp, tt->iwin); - IclassApply(tt->tooltippic, tt->iwin, iw, ih, 0, 0, STATE_NORMAL, 0); + IclassApply(tt->tooltippic, tt->iwin, iw, ih, 0, 0, STATE_NORMAL, 0, ST_TOOLTIP); } else EUnmapWindow(disp, tt->iwin); @@ -374,13 +374,13 @@ EMoveResizeWindow(disp, tt->win, xx - ww, yy - hh, w, h); - IclassApply(tt->s_iclass[0], tt->s_win[0], 8, 8, 0, 0, STATE_NORMAL, 0); - IclassApply(tt->s_iclass[1], tt->s_win[1], 16, 16, 0, 0, STATE_NORMAL, 0); - IclassApply(tt->s_iclass[2], tt->s_win[2], 24, 24, 0, 0, STATE_NORMAL, 0); - IclassApply(tt->s_iclass[3], tt->s_win[3], 32, 32, 0, 0, STATE_NORMAL, 0); + IclassApply(tt->s_iclass[0], tt->s_win[0], 8, 8, 0, 0, STATE_NORMAL, 0, ST_TOOLTIP); + IclassApply(tt->s_iclass[1], tt->s_win[1], 16, 16, 0, 0, STATE_NORMAL, 0, ST_TOOLTIP); + IclassApply(tt->s_iclass[2], tt->s_win[2], 24, 24, 0, 0, STATE_NORMAL, 0, ST_TOOLTIP); + IclassApply(tt->s_iclass[3], tt->s_win[3], 32, 32, 0, 0, STATE_NORMAL, 0, ST_TOOLTIP); if (Conf.theme.transparency && tt->iclass->norm.normal->transparent == 0) tt->iclass->norm.normal->transparent = 2; - IclassApply(tt->iclass, tt->win, w, h, 0, 0, STATE_NORMAL, 0); + IclassApply(tt->iclass, tt->win, w, h, 0, 0, STATE_NORMAL, 0, ST_TOOLTIP); EMapRaised(disp, tt->s_win[0]); EMapRaised(disp, tt->s_win[1]); EMapRaised(disp, tt->s_win[2]); diff -ur e.orig/src/warp.c e/src/warp.c --- e.orig/src/warp.c 2004-05-30 20:18:20.000000000 -0700 +++ e/src/warp.c 2004-06-01 00:38:15.000000000 -0700 @@ -240,9 +240,9 @@ EMoveResizeWindow(disp, warplist[i].win, 0, (h * i), mw, mh); if (ewin == warplist[i].ewin) IclassApply(ic, warplist[i].win, mw, mh, 0, 0, STATE_CLICKED, - 0); + 0, ST_WARP); else - IclassApply(ic, warplist[i].win, mw, mh, 0, 0, STATE_NORMAL, 0); + IclassApply(ic, warplist[i].win, mw, mh, 0, 0, STATE_NORMAL, 0, ST_WARP); } PropagateShapes(warpFocusTitleWindow); EMapWindow(disp, warpFocusTitleWindow); @@ -266,7 +266,7 @@ state = (ewin == warplist[i].ewin) ? STATE_CLICKED : STATE_NORMAL; - IclassApply(ic, warplist[i].win, mw, mh, 0, 0, state, 0); + IclassApply(ic, warplist[i].win, mw, mh, 0, 0, state, 0, ST_WARP); TclassApply(ic, warplist[i].win, mw, mh, 0, 0, state, 0, tc, warplist[i].txt); } |