Remove pseudotransparency support - 1
Has been disabled by default for 5 years. - Remove autofoo stuff. - Unifdef ENABLE_TRANSPARENCY and ENABLE_THEME_TRANSPARENCY. - Remove transparency settings from docs/e16.xml.
This commit is contained in:
parent
c20cac547a
commit
fda39df73d
10
configure.ac
10
configure.ac
|
@ -411,15 +411,6 @@ if test "x$enable_dialogs" = "xyes"; then
|
|||
AC_DEFINE(ENABLE_DIALOGS, 1, [Configuration dialog support])
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(pseudotrans,
|
||||
AC_HELP_STRING([--enable-pseudotrans],
|
||||
[enable support for pseudo-transparency @<:@default=no@:>@]),,
|
||||
enable_pseudotrans=no)
|
||||
if test "x$enable_pseudotrans" = "xyes"; then
|
||||
AC_DEFINE(ENABLE_TRANSPARENCY, 1, [Enable pseudotransparency])
|
||||
AC_DEFINE(ENABLE_THEME_TRANSPARENCY, 1, [Enable adjusting theme element pseudotransparency])
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(container,
|
||||
AC_HELP_STRING([--enable-container],
|
||||
[use container window (experimental) @<:@default=yes@:>@]),,
|
||||
|
@ -510,7 +501,6 @@ echo " Modules ...................... $enable_modules"
|
|||
echo " Visibility hiding ............ $enable_visibility_hiding (only useful with modules)"
|
||||
echo " Window mode helper library ... $enable_libhack"
|
||||
echo " Dialogs ...................... $enable_dialogs"
|
||||
echo " Pseudo-transparency .......... $enable_pseudotrans"
|
||||
echo
|
||||
echo "Experimental options - DO NOT USE unless you know what you are doing"
|
||||
echo " GLX .......................... $enable_glx"
|
||||
|
|
14
docs/e16.xml
14
docs/e16.xml
|
@ -1304,20 +1304,6 @@ tooltips.showroottooltip = 1
|
|||
# [int] Tooltip delay
|
||||
tooltips.delay = 1500
|
||||
|
||||
# [int] Theme transparency(0-255)
|
||||
transparency.alpha = 0
|
||||
# [int] Item transparencies (0: off, 1: background, 2: glass)
|
||||
transparency.menu = 1
|
||||
transparency.menu_item = 1
|
||||
transparency.tooltip = 2
|
||||
transparency.widget = 1
|
||||
transparency.hilight = 0
|
||||
transparency.border = 1
|
||||
transparency.iconbox = 1
|
||||
transparency.dialog = 1
|
||||
transparency.pager = 1
|
||||
transparency.warplist = 1
|
||||
|
||||
# [bool] Enable focus list (alt-tab)
|
||||
warplist.enable = 1
|
||||
# [bool] Show sticky windows
|
||||
|
|
17
src/E.h
17
src/E.h
|
@ -3,7 +3,7 @@
|
|||
/*****************************************************************************/
|
||||
/*
|
||||
* Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors
|
||||
* Copyright (C) 2004-2017 Kim Woelders
|
||||
* Copyright (C) 2004-2018 Kim Woelders
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to
|
||||
|
@ -282,21 +282,6 @@ typedef struct {
|
|||
char *extra_path;
|
||||
char *font_cfg;
|
||||
} theme;
|
||||
#ifdef ENABLE_THEME_TRANSPARENCY
|
||||
struct {
|
||||
int alpha;
|
||||
int border;
|
||||
int widget;
|
||||
int iconbox;
|
||||
int menu;
|
||||
int menu_item;
|
||||
int tooltip;
|
||||
int dialog;
|
||||
int hilight;
|
||||
int pager;
|
||||
int warplist;
|
||||
} trans;
|
||||
#endif
|
||||
struct {
|
||||
char enable;
|
||||
char showsticky;
|
||||
|
|
|
@ -77,7 +77,6 @@ e16_SOURCES = \
|
|||
menus-misc.c \
|
||||
misc.c \
|
||||
mod-misc.c \
|
||||
mod-trans.c \
|
||||
moveresize.c \
|
||||
mwm.c \
|
||||
pager.c \
|
||||
|
|
250
src/iclass.c
250
src/iclass.c
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors
|
||||
* Copyright (C) 2004-2015 Kim Woelders
|
||||
* Copyright (C) 2004-2018 Kim Woelders
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to
|
||||
|
@ -72,84 +72,6 @@ static LIST_HEAD(iclass_list);
|
|||
|
||||
static ImageClass *ImageclassGetFallback(void);
|
||||
|
||||
#ifdef ENABLE_THEME_TRANSPARENCY
|
||||
|
||||
static EImageColorModifier *icm = NULL;
|
||||
|
||||
static int prev_alpha = -1;
|
||||
|
||||
int
|
||||
TransparencyEnabled(void)
|
||||
{
|
||||
return Conf.trans.alpha;
|
||||
}
|
||||
|
||||
int
|
||||
TransparencyUpdateNeeded(void)
|
||||
{
|
||||
return Conf.trans.alpha || prev_alpha;
|
||||
}
|
||||
|
||||
static void
|
||||
TransparencyMakeColorModifier(void)
|
||||
{
|
||||
int i;
|
||||
unsigned char gray[256];
|
||||
unsigned char alpha[256];
|
||||
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
gray[i] = i;
|
||||
alpha[i] = 255 - Conf.trans.alpha;
|
||||
}
|
||||
|
||||
if (!icm)
|
||||
icm = EImageColorModifierCreate();
|
||||
EImageColorModifierSetTables(icm, gray, gray, gray, alpha);
|
||||
}
|
||||
|
||||
void
|
||||
TransparencySet(int transparency)
|
||||
{
|
||||
int changed;
|
||||
|
||||
if (transparency < 0)
|
||||
transparency = 0;
|
||||
else if (transparency > 255)
|
||||
transparency = 255;
|
||||
|
||||
/* This will render the initial startup stuff correctly since !changed */
|
||||
if (prev_alpha == -1)
|
||||
{
|
||||
prev_alpha = Conf.trans.alpha = transparency;
|
||||
changed = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
changed = Conf.trans.alpha != transparency;
|
||||
prev_alpha = Conf.trans.alpha;
|
||||
Conf.trans.alpha = transparency;
|
||||
}
|
||||
|
||||
if (!changed)
|
||||
return;
|
||||
|
||||
/* Generate the color modifier tables */
|
||||
TransparencyMakeColorModifier();
|
||||
|
||||
if (changed < 0)
|
||||
return;
|
||||
|
||||
if (prev_alpha == 0)
|
||||
{
|
||||
/* Hack to get tiled backgrounds regenerated at full size */
|
||||
BackgroundsInvalidate(1);
|
||||
}
|
||||
ModulesSignal(ESIGNAL_THEME_TRANS_CHANGE, NULL);
|
||||
}
|
||||
|
||||
#endif /* ENABLE_THEME_TRANSPARENCY */
|
||||
|
||||
EImage *
|
||||
ThemeImageLoad(const char *file)
|
||||
{
|
||||
|
@ -644,14 +566,6 @@ ImageclassCreateSimple(const char *name, const char *image)
|
|||
return ic;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_THEME_TRANSPARENCY
|
||||
int
|
||||
ImageclassIsTransparent(ImageClass * ic)
|
||||
{
|
||||
return ic && ic->norm.normal && ic->norm.normal->transparent;
|
||||
}
|
||||
#endif
|
||||
|
||||
static ImageState *
|
||||
ImageclassGetImageState1(ImageStateArray * pisa, int state)
|
||||
{
|
||||
|
@ -726,100 +640,11 @@ ImageclassGetImage(ImageClass * ic, int active, int sticky, int state)
|
|||
return im;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_TRANSPARENCY
|
||||
static int
|
||||
pt_type_to_flags(int image_type)
|
||||
{
|
||||
int flags;
|
||||
|
||||
if (Conf.trans.alpha == 0)
|
||||
return ICLASS_ATTR_OPAQUE;
|
||||
|
||||
switch (image_type)
|
||||
{
|
||||
default:
|
||||
case ST_SOLID:
|
||||
case ST_BUTTON:
|
||||
flags = ICLASS_ATTR_OPAQUE;
|
||||
break;
|
||||
case ST_BORDER:
|
||||
flags = Conf.trans.border;
|
||||
break;
|
||||
case ST_WIDGET:
|
||||
flags = Conf.trans.widget;
|
||||
break;
|
||||
case ST_ICONBOX:
|
||||
flags = Conf.trans.iconbox;
|
||||
break;
|
||||
case ST_MENU:
|
||||
flags = Conf.trans.menu;
|
||||
break;
|
||||
case ST_MENU_ITEM:
|
||||
flags = Conf.trans.menu_item;
|
||||
break;
|
||||
case ST_TOOLTIP:
|
||||
flags = Conf.trans.tooltip;
|
||||
break;
|
||||
case ST_DIALOG:
|
||||
flags = Conf.trans.dialog;
|
||||
break;
|
||||
case ST_HILIGHT:
|
||||
flags = Conf.trans.hilight;
|
||||
break;
|
||||
case ST_PAGER:
|
||||
flags = Conf.trans.pager;
|
||||
break;
|
||||
case ST_WARPLIST:
|
||||
flags = Conf.trans.warplist;
|
||||
break;
|
||||
}
|
||||
if (flags != ICLASS_ATTR_OPAQUE)
|
||||
flags |= ICLASS_ATTR_USE_CM;
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
static EImage *
|
||||
pt_get_bg_image(Win win, int w, int h, int use_root)
|
||||
{
|
||||
EImage *ii = NULL;
|
||||
Win cr;
|
||||
EX_Drawable bg;
|
||||
int xx, yy;
|
||||
|
||||
bg = DeskGetBackgroundPixmap(DesksGetCurrent());
|
||||
if (use_root || bg == NoXID)
|
||||
{
|
||||
cr = VROOT;
|
||||
bg = WinGetXwin(VROOT);
|
||||
}
|
||||
else
|
||||
{
|
||||
cr = EoGetWin(DesksGetCurrent());
|
||||
}
|
||||
ETranslateCoordinates(win, cr, 0, 0, &xx, &yy, NULL);
|
||||
#if 0
|
||||
Eprintf("%s: %#x %d %d %d %d\n", __func__, WinGetXwin(win), xx, yy, w, h);
|
||||
#endif
|
||||
if (xx < WinGetW(VROOT) && yy < WinGetH(VROOT) && xx + w >= 0 && yy + h >= 0)
|
||||
{
|
||||
/* Create the background base image */
|
||||
ii = EImageGrabDrawable(bg, NoXID, xx, yy, w, h, !EServerIsGrabbed());
|
||||
}
|
||||
|
||||
return ii;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
EImage *
|
||||
ImageclassGetImageBlended(ImageClass * ic, Win win __UNUSED__, int w, int h,
|
||||
int active, int sticky, int state,
|
||||
int image_type __UNUSED__)
|
||||
{
|
||||
#ifdef ENABLE_TRANSPARENCY
|
||||
int flags;
|
||||
#endif
|
||||
ImageState *is;
|
||||
EImage *im, *bg;
|
||||
|
||||
|
@ -836,20 +661,6 @@ ImageclassGetImageBlended(ImageClass * ic, Win win __UNUSED__, int w, int h,
|
|||
if (!im)
|
||||
return NULL;
|
||||
|
||||
#ifdef ENABLE_TRANSPARENCY
|
||||
flags = pt_type_to_flags(image_type);
|
||||
if (flags != ICLASS_ATTR_OPAQUE)
|
||||
{
|
||||
bg = pt_get_bg_image(win, w, h, flags & ICLASS_ATTR_GLASS);
|
||||
if (bg)
|
||||
{
|
||||
/* FIXME - Tiling not implemented */
|
||||
EImageBlendCM(bg, im, (flags & ICLASS_ATTR_USE_CM) ? icm : NULL);
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (is->pixmapfillstyle == FILL_STRETCH)
|
||||
{
|
||||
bg = EImageCreateScaled(im, 0, 0, 0, 0, w, h);
|
||||
|
@ -871,9 +682,6 @@ ImageclassGetImageBlended(ImageClass * ic, Win win __UNUSED__, int w, int h,
|
|||
EImageTile(bg, im, 0, tw, th, 0, 0, w, h, 0, 0);
|
||||
}
|
||||
|
||||
#ifdef ENABLE_TRANSPARENCY
|
||||
done:
|
||||
#endif
|
||||
if ((is->unloadable) || (Conf.memory_paranoia))
|
||||
{
|
||||
EImageFree(is->im);
|
||||
|
@ -888,62 +696,6 @@ ImagestateMakePmapMask(ImageState * is, Win win, PmapMask * pmm,
|
|||
int pmapflags __UNUSED__, int w, int h,
|
||||
int image_type __UNUSED__)
|
||||
{
|
||||
#ifdef ENABLE_TRANSPARENCY
|
||||
EImage *ii = NULL;
|
||||
int flags;
|
||||
EX_Pixmap pmap, mask;
|
||||
|
||||
flags = pt_type_to_flags(image_type);
|
||||
|
||||
/*
|
||||
* is->transparent flags:
|
||||
* 0x01: Use desktop background pixmap as base
|
||||
* 0x02: Use root window as base (use only for transients, if at all)
|
||||
* 0x04: Don't apply image mask to result
|
||||
*/
|
||||
if (is->transparent && EImageHasAlpha(is->im))
|
||||
flags = is->transparent;
|
||||
|
||||
if (flags != ICLASS_ATTR_OPAQUE)
|
||||
{
|
||||
ii = pt_get_bg_image(win, w, h, flags & ICLASS_ATTR_GLASS);
|
||||
}
|
||||
else
|
||||
{
|
||||
#if 0
|
||||
Eprintf("%s: %#x %d %d\n", __func__, WinGetXwin(win), w, h);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (ii)
|
||||
{
|
||||
EImageBlendCM(ii, is->im, (flags & ICLASS_ATTR_USE_CM) ? icm : NULL);
|
||||
|
||||
pmm->type = 0;
|
||||
pmm->pmap = pmap = ECreatePixmap(win, w, h, 0);
|
||||
pmm->mask = NoXID;
|
||||
pmm->w = w;
|
||||
pmm->h = h;
|
||||
EImageRenderOnDrawable(ii, win, pmap, 0, 0, 0, w, h);
|
||||
|
||||
if ((pmapflags & IC_FLAG_MAKE_MASK) && !(flags & ICLASS_ATTR_NO_CLIP))
|
||||
{
|
||||
if (EImageHasAlpha(is->im))
|
||||
{
|
||||
/* Make the scaled clip mask to be used */
|
||||
EImageRenderPixmaps(is->im, win, EIMAGE_ANTI_ALIAS, &pmap,
|
||||
&mask, w, h);
|
||||
|
||||
/* Replace the mask with the correct one */
|
||||
pmm->mask = EXCreatePixmapCopy(mask, w, h, 1);
|
||||
|
||||
EImagePixmapsFree(pmap, mask);
|
||||
}
|
||||
}
|
||||
EImageDecache(ii);
|
||||
}
|
||||
else
|
||||
#endif /* ENABLE_TRANSPARENCY */
|
||||
if (is->pixmapfillstyle == FILL_STRETCH)
|
||||
{
|
||||
pmm->type = 1;
|
||||
|
|
15
src/iclass.h
15
src/iclass.h
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors
|
||||
* Copyright (C) 2004-2014 Kim Woelders
|
||||
* Copyright (C) 2004-2018 Kim Woelders
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to
|
||||
|
@ -57,12 +57,6 @@
|
|||
#define ST_WARPLIST 10
|
||||
#define ST_BUTTON 11
|
||||
|
||||
#define ICLASS_ATTR_OPAQUE 0x00 /* No transparency */
|
||||
#define ICLASS_ATTR_BG 0x01 /* Background transparency */
|
||||
#define ICLASS_ATTR_GLASS 0x02 /* Glass transparency */
|
||||
#define ICLASS_ATTR_NO_CLIP 0x04 /* Don't apply clip mask */
|
||||
#define ICLASS_ATTR_USE_CM 0x08 /* Use colormodifier */
|
||||
|
||||
/* ImageclassApplyCopy flags */
|
||||
#define IC_FLAG_NONE 0x00 /* No flags */
|
||||
#define IC_FLAG_WRITABLE 0x01 /* Provide writable pixmaps */
|
||||
|
@ -76,16 +70,9 @@
|
|||
/* iclass.c */
|
||||
int ImageclassConfigLoad(FILE * fs);
|
||||
|
||||
#ifdef ENABLE_THEME_TRANSPARENCY
|
||||
void TransparencySet(int transparency);
|
||||
int TransparencyEnabled(void);
|
||||
int TransparencyUpdateNeeded(void);
|
||||
int ImageclassIsTransparent(ImageClass * ic);
|
||||
#else
|
||||
#define TransparencyEnabled() 0
|
||||
#define TransparencyUpdateNeeded() 0
|
||||
#define ImageclassIsTransparent(ic) 0
|
||||
#endif
|
||||
|
||||
ImageClass *ImageclassFind(const char *name, int fallback);
|
||||
ImageClass *ImageclassAlloc(const char *name, int fallback);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2003-2014 Kim Woelders
|
||||
* Copyright (C) 2003-2018 Kim Woelders
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to
|
||||
|
@ -64,9 +64,6 @@ extern const EModule ModTextclass;
|
|||
extern const EModule ModTheme;
|
||||
extern const EModule ModTooltips;
|
||||
|
||||
#ifdef ENABLE_THEME_TRANSPARENCY
|
||||
extern const EModule ModTransparency;
|
||||
#endif
|
||||
extern const EModule ModWarplist;
|
||||
extern const EModule ModWindowMatch;
|
||||
|
||||
|
@ -100,9 +97,6 @@ const EModule *const p_modules[] = {
|
|||
&ModTextclass,
|
||||
&ModTheme,
|
||||
&ModTooltips,
|
||||
#ifdef ENABLE_THEME_TRANSPARENCY
|
||||
&ModTransparency,
|
||||
#endif
|
||||
&ModWarplist,
|
||||
&ModWindowMatch,
|
||||
};
|
||||
|
|
304
src/mod-trans.c
304
src/mod-trans.c
|
@ -1,304 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2004-2007 Jaron Omega
|
||||
* Copyright (C) 2004-2014 Kim Woelders
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
#include "E.h"
|
||||
#include "dialog.h"
|
||||
#include "emodule.h"
|
||||
#include "iclass.h"
|
||||
#include "settings.h"
|
||||
#include "timers.h"
|
||||
|
||||
#ifdef ENABLE_THEME_TRANSPARENCY
|
||||
/*
|
||||
* Theme transparency settings
|
||||
*/
|
||||
|
||||
#if ENABLE_DIALOGS
|
||||
static Timer *st_timer = NULL;
|
||||
|
||||
static int
|
||||
TransparencyChangeTimeout(void *data)
|
||||
{
|
||||
TransparencySet(PTR2INT(data));
|
||||
|
||||
st_timer = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
TransparencyChange(int val)
|
||||
{
|
||||
TIMER_DEL(st_timer);
|
||||
TIMER_ADD(st_timer, 10, TransparencyChangeTimeout, INT2PTR(val));
|
||||
}
|
||||
|
||||
/*
|
||||
* Configuration dialog
|
||||
*/
|
||||
typedef struct {
|
||||
int theme_transparency;
|
||||
|
||||
int st_border;
|
||||
int st_widget;
|
||||
int st_dialog;
|
||||
int st_menu;
|
||||
int st_tooltip;
|
||||
int st_hilight;
|
||||
} TransDlgData;
|
||||
|
||||
static void
|
||||
_DlgApplyThemeTrans(Dialog * d, int val __UNUSED__, void *data __UNUSED__)
|
||||
{
|
||||
TransDlgData *dd = DLG_DATA_GET(d, TransDlgData);
|
||||
|
||||
Conf.trans.border = dd->st_border;
|
||||
Conf.trans.widget = dd->st_widget;
|
||||
Conf.trans.dialog = dd->st_dialog;
|
||||
Conf.trans.menu = dd->st_menu;
|
||||
Conf.trans.tooltip = dd->st_tooltip;
|
||||
Conf.trans.hilight = Conf.trans.menu_item = dd->st_hilight;
|
||||
Conf.trans.pager = ICLASS_ATTR_BG;
|
||||
Conf.trans.iconbox = ICLASS_ATTR_BG;
|
||||
Conf.trans.warplist = ICLASS_ATTR_BG;
|
||||
#if 0 /* Should not be necessary */
|
||||
TransparencyChange(dd->theme_transparency);
|
||||
#endif
|
||||
|
||||
autosave();
|
||||
}
|
||||
|
||||
static void
|
||||
_DlgThemeTransparencyText(DItem * di, TransDlgData * dd)
|
||||
{
|
||||
char s[256];
|
||||
|
||||
Esnprintf(s, sizeof(s), _("Theme transparency: %2d"),
|
||||
dd->theme_transparency);
|
||||
DialogItemSetText(di, s);
|
||||
}
|
||||
|
||||
static void
|
||||
CB_ThemeTransparency(Dialog * d, int val __UNUSED__, void *data)
|
||||
{
|
||||
TransDlgData *dd = DLG_DATA_GET(d, TransDlgData);
|
||||
DItem *di = (DItem *) data;
|
||||
|
||||
_DlgThemeTransparencyText(di, dd);
|
||||
TransparencyChange(dd->theme_transparency);
|
||||
}
|
||||
|
||||
static void
|
||||
_DlgFillThemeTrans(Dialog * d, DItem * table, void *data __UNUSED__)
|
||||
{
|
||||
TransDlgData *dd = DLG_DATA_GET(d, TransDlgData);
|
||||
DItem *di, *label;
|
||||
DItem *radio_border, *radio_widget, *radio_menu,
|
||||
*radio_dialog, *radio_tooltip, *radio_hilight;
|
||||
|
||||
dd->st_border = Conf.trans.border;
|
||||
dd->st_widget = Conf.trans.widget;
|
||||
dd->st_dialog = Conf.trans.dialog;
|
||||
dd->st_menu = Conf.trans.menu;
|
||||
dd->st_tooltip = Conf.trans.tooltip;
|
||||
dd->st_hilight = Conf.trans.hilight;
|
||||
|
||||
dd->theme_transparency = Conf.trans.alpha;
|
||||
|
||||
DialogItemTableSetOptions(table, 7, 0, 0, 0);
|
||||
|
||||
di = DialogAddItem(table, DITEM_TEXT);
|
||||
DialogItemSetColSpan(di, 7);
|
||||
DialogItemSetAlign(di, 0, 512);
|
||||
DialogItemSetText(di, _("Changes Might Require Restart:"));
|
||||
|
||||
di = DialogAddItem(table, DITEM_SEPARATOR);
|
||||
DialogItemSetColSpan(di, 7);
|
||||
|
||||
DialogAddItem(table, DITEM_NONE);
|
||||
|
||||
di = DialogAddItem(table, DITEM_TEXT);
|
||||
DialogItemSetAlign(di, 0, 512);
|
||||
DialogItemSetText(di, _("Borders:"));
|
||||
|
||||
di = DialogAddItem(table, DITEM_TEXT);
|
||||
DialogItemSetAlign(di, 0, 512);
|
||||
DialogItemSetText(di, _("Menus:"));
|
||||
|
||||
di = DialogAddItem(table, DITEM_TEXT);
|
||||
DialogItemSetAlign(di, 0, 512);
|
||||
DialogItemSetText(di, _("Hilights:"));
|
||||
|
||||
di = DialogAddItem(table, DITEM_TEXT);
|
||||
DialogItemSetAlign(di, 0, 512);
|
||||
DialogItemSetText(di, _("E Widgets:"));
|
||||
|
||||
di = DialogAddItem(table, DITEM_TEXT);
|
||||
DialogItemSetAlign(di, 0, 512);
|
||||
DialogItemSetText(di, _("E Dialogs:"));
|
||||
|
||||
di = DialogAddItem(table, DITEM_TEXT);
|
||||
DialogItemSetAlign(di, 0, 512);
|
||||
DialogItemSetText(di, _("Tooltips:"));
|
||||
|
||||
di = DialogAddItem(table, DITEM_TEXT);
|
||||
DialogItemSetAlign(di, 0, 1024);
|
||||
DialogItemSetText(di, _("Opaque"));
|
||||
|
||||
radio_border = di = DialogAddItem(table, DITEM_RADIOBUTTON);
|
||||
DialogItemRadioButtonSetFirst(di, radio_border);
|
||||
DialogItemRadioButtonGroupSetVal(di, 0);
|
||||
|
||||
radio_menu = di = DialogAddItem(table, DITEM_RADIOBUTTON);
|
||||
DialogItemRadioButtonSetFirst(di, radio_menu);
|
||||
DialogItemRadioButtonGroupSetVal(di, 0);
|
||||
|
||||
radio_hilight = di = DialogAddItem(table, DITEM_RADIOBUTTON);
|
||||
DialogItemRadioButtonSetFirst(di, radio_hilight);
|
||||
DialogItemRadioButtonGroupSetVal(di, 0);
|
||||
|
||||
radio_widget = di = DialogAddItem(table, DITEM_RADIOBUTTON);
|
||||
DialogItemRadioButtonSetFirst(di, radio_widget);
|
||||
DialogItemRadioButtonGroupSetVal(di, 0);
|
||||
|
||||
radio_dialog = di = DialogAddItem(table, DITEM_RADIOBUTTON);
|
||||
DialogItemRadioButtonSetFirst(di, radio_dialog);
|
||||
DialogItemRadioButtonGroupSetVal(di, 0);
|
||||
|
||||
radio_tooltip = di = DialogAddItem(table, DITEM_RADIOBUTTON);
|
||||
DialogItemRadioButtonSetFirst(di, radio_tooltip);
|
||||
DialogItemRadioButtonGroupSetVal(di, 0);
|
||||
|
||||
di = DialogAddItem(table, DITEM_TEXT);
|
||||
DialogItemSetAlign(di, 0, 1024);
|
||||
DialogItemSetText(di, _("Background"));
|
||||
|
||||
di = DialogAddItem(table, DITEM_RADIOBUTTON);
|
||||
DialogItemRadioButtonSetFirst(di, radio_border);
|
||||
DialogItemRadioButtonGroupSetVal(di, 1);
|
||||
DialogItemRadioButtonGroupSetValPtr(radio_border, &dd->st_border);
|
||||
|
||||
di = DialogAddItem(table, DITEM_RADIOBUTTON);
|
||||
DialogItemRadioButtonSetFirst(di, radio_menu);
|
||||
DialogItemRadioButtonGroupSetVal(di, 1);
|
||||
DialogItemRadioButtonGroupSetValPtr(radio_menu, &dd->st_menu);
|
||||
|
||||
di = DialogAddItem(table, DITEM_RADIOBUTTON);
|
||||
DialogItemRadioButtonSetFirst(di, radio_hilight);
|
||||
DialogItemRadioButtonGroupSetVal(di, 1);
|
||||
DialogItemRadioButtonGroupSetValPtr(radio_hilight, &dd->st_hilight);
|
||||
|
||||
di = DialogAddItem(table, DITEM_RADIOBUTTON);
|
||||
DialogItemRadioButtonSetFirst(di, radio_widget);
|
||||
DialogItemRadioButtonGroupSetVal(di, 1);
|
||||
DialogItemRadioButtonGroupSetValPtr(radio_widget, &dd->st_widget);
|
||||
|
||||
di = DialogAddItem(table, DITEM_RADIOBUTTON);
|
||||
DialogItemRadioButtonSetFirst(di, radio_dialog);
|
||||
DialogItemRadioButtonGroupSetVal(di, 1);
|
||||
DialogItemRadioButtonGroupSetValPtr(radio_dialog, &dd->st_dialog);
|
||||
|
||||
di = DialogAddItem(table, DITEM_RADIOBUTTON);
|
||||
DialogItemRadioButtonSetFirst(di, radio_tooltip);
|
||||
DialogItemRadioButtonGroupSetVal(di, 1);
|
||||
|
||||
di = DialogAddItem(table, DITEM_TEXT);
|
||||
DialogItemSetAlign(di, 0, 1024);
|
||||
DialogItemSetText(di, _("Glass"));
|
||||
|
||||
di = DialogAddItem(table, DITEM_NONE);
|
||||
DialogItemSetColSpan(di, 5);
|
||||
|
||||
di = DialogAddItem(table, DITEM_RADIOBUTTON);
|
||||
DialogItemRadioButtonSetFirst(di, radio_tooltip);
|
||||
DialogItemRadioButtonGroupSetVal(di, 2);
|
||||
DialogItemRadioButtonGroupSetValPtr(radio_tooltip, &dd->st_tooltip);
|
||||
|
||||
di = DialogAddItem(table, DITEM_SEPARATOR);
|
||||
DialogItemSetColSpan(di, 7);
|
||||
|
||||
di = label = DialogAddItem(table, DITEM_TEXT);
|
||||
DialogItemSetColSpan(di, 7);
|
||||
DialogItemSetAlign(di, 512, 512);
|
||||
_DlgThemeTransparencyText(di, dd);
|
||||
|
||||
di = DialogAddItem(table, DITEM_SLIDER);
|
||||
DialogItemSetColSpan(di, 7);
|
||||
DialogItemSliderSetMinLength(di, 10);
|
||||
DialogItemSliderSetBounds(di, 0, 255);
|
||||
DialogItemSliderSetUnits(di, 4);
|
||||
DialogItemSliderSetJump(di, 16);
|
||||
DialogItemSliderSetValPtr(di, &dd->theme_transparency);
|
||||
DialogItemSetCallback(di, CB_ThemeTransparency, 0, (void *)label);
|
||||
}
|
||||
|
||||
const DialogDef DlgThemeTrans = {
|
||||
"CONFIGURE_TRANS",
|
||||
N_("Transparency"), N_("Selective Transparency Settings"),
|
||||
sizeof(TransDlgData),
|
||||
SOUND_SETTINGS_TRANS,
|
||||
"pix/tips.png",
|
||||
N_("Enlightenment Selective Transparency\n" "Settings Dialog"),
|
||||
_DlgFillThemeTrans,
|
||||
DLG_OAC, _DlgApplyThemeTrans, NULL
|
||||
};
|
||||
#endif /* ENABLE_DIALOGS */
|
||||
|
||||
static void
|
||||
TransparencySighan(int sig, void *prm __UNUSED__)
|
||||
{
|
||||
switch (sig)
|
||||
{
|
||||
case ESIGNAL_CONFIGURE:
|
||||
TransparencySet(Conf.trans.alpha);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static const CfgItem TransCfgItems[] = {
|
||||
CFG_ITEM_INT(Conf.trans, alpha, 0),
|
||||
CFG_ITEM_INT(Conf.trans, menu, ICLASS_ATTR_BG),
|
||||
CFG_ITEM_INT(Conf.trans, menu_item, ICLASS_ATTR_BG),
|
||||
CFG_ITEM_INT(Conf.trans, tooltip, ICLASS_ATTR_GLASS),
|
||||
CFG_ITEM_INT(Conf.trans, widget, ICLASS_ATTR_BG),
|
||||
CFG_ITEM_INT(Conf.trans, hilight, ICLASS_ATTR_OPAQUE),
|
||||
CFG_ITEM_INT(Conf.trans, border, ICLASS_ATTR_BG),
|
||||
CFG_ITEM_INT(Conf.trans, iconbox, ICLASS_ATTR_BG),
|
||||
CFG_ITEM_INT(Conf.trans, dialog, ICLASS_ATTR_BG),
|
||||
CFG_ITEM_INT(Conf.trans, pager, ICLASS_ATTR_BG),
|
||||
CFG_ITEM_INT(Conf.trans, warplist, ICLASS_ATTR_BG),
|
||||
};
|
||||
#define N_CFG_ITEMS (sizeof(TransCfgItems)/sizeof(CfgItem))
|
||||
|
||||
/*
|
||||
* Module descriptor
|
||||
*/
|
||||
extern const EModule ModTransparency;
|
||||
|
||||
const EModule ModTransparency = {
|
||||
"transparency", "tr",
|
||||
TransparencySighan,
|
||||
{0, NULL},
|
||||
{N_CFG_ITEMS, TransCfgItems}
|
||||
};
|
||||
|
||||
#endif /* ENABLE_THEME_TRANSPARENCY */
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors
|
||||
* Copyright (C) 2004-2016 Kim Woelders
|
||||
* Copyright (C) 2004-2018 Kim Woelders
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to
|
||||
|
@ -713,9 +713,6 @@ static const DialogDef *const dialogs[] = {
|
|||
&DlgFx,
|
||||
&DlgBackground,
|
||||
&DlgTheme,
|
||||
#ifdef ENABLE_THEME_TRANSPARENCY
|
||||
&DlgThemeTrans,
|
||||
#endif
|
||||
#if USE_COMPOSITE
|
||||
&DlgComposite,
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue