Disable colormodifier stuff (non-functional).

SVN revision: 14212
This commit is contained in:
Kim Woelders 2005-04-15 23:59:59 +00:00
parent 6b071fb6d2
commit 1432d457f4
5 changed files with 63 additions and 7 deletions

10
src/E.h
View File

@ -60,6 +60,8 @@
#include <Imlib2.h>
#define ENABLE_COLOR_MODIFIERS 0 /* Not functional */
#define ENABLE_TRANSPARENCY 1
#define ENABLE_THEME_TRANSPARENCY 1
@ -393,6 +395,7 @@ typedef struct
}
VirtRoot;
#if ENABLE_COLOR_MODIFIERS
typedef struct _modcurve
{
int num;
@ -409,6 +412,7 @@ typedef struct _colormodifierclass
unsigned int ref_count;
}
ColorModifierClass;
#endif
typedef struct _imagestate
{
@ -421,7 +425,9 @@ typedef struct _imagestate
int pixmapfillstyle;
XColor bg, hi, lo, hihi, lolo;
int bevelstyle;
#if ENABLE_COLOR_MODIFIERS
ColorModifierClass *colmod;
#endif
}
ImageState;
@ -439,7 +445,9 @@ typedef struct _imageclass
char *name;
ImageStateArray norm, active, sticky, sticky_active;
Imlib_Border padding;
#if ENABLE_COLOR_MODIFIERS
ColorModifierClass *colmod;
#endif
unsigned int ref_count;
}
ImageClass;
@ -1318,6 +1326,7 @@ int ButtonEmbedWindow(Button * ButtonToUse,
Window WindowToEmbed);
/* cmclass.c */
#if ENABLE_COLOR_MODIFIERS
void CreateCurve(ModCurve * c);
void FreeModCurve(ModCurve * c);
void FreeCMClass(ColorModifierClass * cm);
@ -1332,6 +1341,7 @@ void ModifyCMClass(char *name, int rnum, unsigned char *rpx,
int bnum, unsigned char *bpx,
unsigned char *bpy);
int ColorModifierConfigLoad(FILE * fs);
#endif
/* comms.c */
void CommsInit(void);

View File

@ -43,7 +43,9 @@ struct _background
char bg_tile;
BgPart bg;
BgPart top;
#if ENABLE_COLOR_MODIFIERS
ColorModifierClass *cmclass;
#endif
char keepim;
unsigned int ref_count;
};
@ -298,7 +300,9 @@ BackgroundCreate(const char *name, XColor * solid, const char *bgn, char tile,
bg->top.xperc = txperc;
bg->top.yperc = typerc;
#if ENABLE_COLOR_MODIFIERS
bg->cmclass = NULL;
#endif
bg->keepim = 0;
bg->ref_count = 0;
@ -394,12 +398,14 @@ BackgroundModify(Background * bg, XColor * solid, const char *bgn, char tile,
return updated;
}
#if ENABLE_COLOR_MODIFIERS
static void
BackgroundSetColorMofifier(Background * bg, ColorModifierClass * cm)
{
cm->ref_count++;
bg->cmclass = cm;
}
#endif
static void
BgFindImageSize(BgPart * bgp, int rw, int rh, int *pw, int *ph)
@ -480,7 +486,10 @@ BackgroundApply(Background * bg, Window win, int setbg)
unsigned int w, h, x, y;
char hasbg, hasfg;
Pixmap pmap, mask;
#if ENABLE_COLOR_MODIFIERS
ColorModifierClass *cm;
#endif
if (bg->bg.file && !bg->bg.im)
{
@ -496,6 +505,7 @@ BackgroundApply(Background * bg, Window win, int setbg)
bg->top.im = ELoadImage(bg->top.real_file);
}
#if ENABLE_COLOR_MODIFIERS
cm = bg->cmclass;
if (cm)
cm->ref_count--;
@ -528,6 +538,7 @@ BackgroundApply(Background * bg, Window win, int setbg)
}
#endif
}
#endif
hasbg = hasfg = 0;
if (bg->top.im)
@ -893,9 +904,12 @@ BackgroundsConfigLoad(FILE * fs)
char *bg2 = 0;
char *name = 0;
char ignore = 0;
ColorModifierClass *cm = NULL;
int fields;
#if ENABLE_COLOR_MODIFIERS
ColorModifierClass *cm = NULL;
#endif
ESetColor(&xclr, 0, 0, 0);
while (GetLine(s, sizeof(s), fs))
@ -965,8 +979,10 @@ BackgroundsConfigLoad(FILE * fs)
bg = BackgroundCreate(name, &xclr, bg1, i1, i2, i3,
i4, i5, i6, bg2, j1, j2, j3,
j4, j5);
#if ENABLE_COLOR_MODIFIERS
if (cm)
BackgroundSetColorMofifier(bg, cm);
#endif
}
}
}
@ -974,7 +990,9 @@ BackgroundsConfigLoad(FILE * fs)
case CONFIG_COLORMOD:
case ICLASS_COLORMOD:
#if ENABLE_COLOR_MODIFIERS
cm = FindItem(s2, 0, LIST_FINDBY_NAME, LIST_TYPE_COLORMODIFIER);
#endif
break;
case CONFIG_CLASSNAME:
@ -1176,10 +1194,12 @@ BackgroundsConfigSave(void)
bglist[i]->top.xperc, bglist[i]->top.yperc);
}
#if ENABLE_COLOR_MODIFIERS
if (bglist[i]->cmclass)
{
fprintf(fs, "370 %s\n", bglist[i]->cmclass->name);
}
#endif
for (j = 0; j < (DesksGetNumber()); j++)
{
@ -2668,7 +2688,7 @@ IPC_BackgroundUse(const char *params, Client * c __UNUSED__)
autosave();
}
#if 0 /* I doubt this is used */
#if ENABLE_COLOR_MODIFIERS
static void
IPC_BackgroundColormodifierSet(const char *params, Client * c __UNUSED__)
{
@ -2745,7 +2765,7 @@ IpcItem BackgroundsIpcArray[] = {
{
IPC_BackgroundUse, "use_bg", NULL, "Deprecated - do not use", NULL}
,
#if 0 /* I doubt this is used */
#if ENABLE_COLOR_MODIFIERS
{IPC_BackgroundColormodifierSet, "set_bg_colmod", NULL, "TBD", NULL}
,
{IPC_BackgroundColormodifierGet, "get_bg_colmod", NULL, "TBD", NULL}

View File

@ -23,6 +23,8 @@
#include "E.h"
#include "conf.h"
#if ENABLE_COLOR_MODIFIERS
void
CreateCurve(ModCurve * c)
{
@ -669,3 +671,5 @@ IpcItem CmClassIpcArray[] = {
#define N_IPC_FUNCS (sizeof(CmClassIpcArray)/sizeof(IpcItem))
#endif
#endif /* ENABLE_COLOR_MODIFIERS */

View File

@ -352,7 +352,7 @@ ConfigFileRead(FILE * fs)
ConfigAlertLoad(_("Window match"));
break;
case CONFIG_COLORMOD:
#if 0 /* FIXME - ? */
#if ENABLE_COLOR_MODIFIERS
Config_ColorModifier(fs);
#endif
break;

View File

@ -110,7 +110,9 @@ ImagestateCreate(void)
ESetColor(&(is->hihi), 255, 255, 255);
ESetColor(&(is->lolo), 64, 64, 64);
is->bevelstyle = BEVEL_NONE;
#if ENABLE_COLOR_MODIFIERS
is->colmod = NULL;
#endif
return is;
}
@ -128,11 +130,14 @@ FreeImageState(ImageState * i)
imlib_free_image();
i->im = NULL;
}
if (i->border)
Efree(i->border);
#if ENABLE_COLOR_MODIFIERS
if (i->colmod)
i->colmod->ref_count--;
#endif
}
static void
@ -219,7 +224,9 @@ ImageclassCreate(const char *name)
ic->padding.right = 0;
ic->padding.top = 0;
ic->padding.bottom = 0;
#if ENABLE_COLOR_MODIFIERS
ic->colmod = NULL;
#endif
ic->ref_count = 0;
return ic;
@ -247,8 +254,10 @@ ImageclassDestroy(ImageClass * ic)
FreeImageStateArray(&(ic->sticky));
FreeImageStateArray(&(ic->sticky_active));
#if ENABLE_COLOR_MODIFIERS
if (ic->colmod)
ic->colmod->ref_count--;
#endif
}
ImageClass *
@ -272,16 +281,20 @@ ImageclassFind(const char *name, int fallback)
if (ic->which) ImagestatePopulate(ic->which); \
else ic->which = ic->fallback;
#if ENABLE_COLOR_MODIFIERS
#define ISTATE_SET_CM(which, fallback) \
if (!ic->which->colmod) { \
ic->which->colmod = fallback; \
if (fallback) fallback->ref_count++; \
}
#endif
static void
ImageclassPopulate(ImageClass * ic)
{
#if ENABLE_COLOR_MODIFIERS
ColorModifierClass *cm;
#endif
if (!ic)
return;
@ -309,6 +322,7 @@ ImageclassPopulate(ImageClass * ic)
ISTATE_SET_STATE(sticky_active.clicked, sticky_active.normal);
ISTATE_SET_STATE(sticky_active.disabled, sticky_active.normal);
#if ENABLE_COLOR_MODIFIERS
if (!ic->colmod)
{
cm = (ColorModifierClass *) FindItem("ICLASS", 0, LIST_FINDBY_NAME,
@ -358,6 +372,7 @@ ImageclassPopulate(ImageClass * ic)
ISTATE_SET_CM(sticky_active.hilited, cm);
ISTATE_SET_CM(sticky_active.clicked, cm);
ISTATE_SET_CM(sticky_active.disabled, cm);
#endif
}
int
@ -367,12 +382,15 @@ ImageclassConfigLoad(FILE * fs)
char s[FILEPATH_LEN_MAX];
char s2[FILEPATH_LEN_MAX];
int i1;
ImageClass *ic = 0;
ImageState *ICToRead = 0;
ColorModifierClass *cm = 0;
ImageClass *ic = NULL;
ImageState *ICToRead = NULL;
int fields;
int l, r, t, b;
#if ENABLE_COLOR_MODIFIERS
ColorModifierClass *cm = NULL;
#endif
while (GetLine(s, sizeof(s), fs))
{
s2[0] = 0;
@ -429,11 +447,14 @@ ImageclassConfigLoad(FILE * fs)
ic->sticky = ICToInherit->sticky;
ic->sticky_active = ICToInherit->sticky_active;
ic->padding = ICToInherit->padding;
#if ENABLE_COLOR_MODIFIERS
ic->colmod = ICToInherit->colmod;
#endif
}
break;
case CONFIG_COLORMOD:
case ICLASS_COLORMOD:
#if ENABLE_COLOR_MODIFIERS
cm = FindItem(s2, 0, LIST_FINDBY_NAME, LIST_TYPE_COLORMODIFIER);
if (cm)
{
@ -447,6 +468,7 @@ ImageclassConfigLoad(FILE * fs)
}
cm->ref_count++;
}
#endif
break;
case ICLASS_PADDING:
{