Enlightenment CVS committal
Author : kwo
Project : e16
Module : e
Dir : e16/e/src
Modified Files:
aclass.c borders.c borders.h config.c container.c desktops.c
dialog.c iclass.c iclass.h menus.c tclass.c text.c theme.c
Log Message:
Theme element fallback cleanups
- don't create fallback classes before they are needed.
- use of fallbacks was missing a number of places.
- setting theme to "-" will run entirely on fallbacks.
===================================================================
RCS file: /cvs/e/e16/e/src/aclass.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -3 -r1.50 -r1.51
--- aclass.c 30 Mar 2008 12:13:14 -0000 1.50
+++ aclass.c 22 Jun 2008 13:34:41 -0000 1.51
@@ -1125,28 +1125,6 @@
return match;
}
-static void
-AclassSetupFallback(void)
-{
- ActionClass *ac;
- Action *aa;
-
- /* Create a default fallback actionclass for the fallback border */
- ac = ActionclassCreate("__FALLBACK_ACTION", 0);
-
- aa = ActionCreate(EVENT_MOUSE_DOWN, 1, 0, 0, 1, 0, NULL, NULL);
- ActionclassAddAction(ac, aa);
- ActionAddTo(aa, "wop * mo ptr");
-
- aa = ActionCreate(EVENT_MOUSE_DOWN, 1, 0, 0, 2, 0, NULL, NULL);
- ActionclassAddAction(ac, aa);
- ActionAddTo(aa, "wop * close");
-
- aa = ActionCreate(EVENT_MOUSE_DOWN, 1, 0, 0, 3, 0, NULL, NULL);
- ActionclassAddAction(ac, aa);
- ActionAddTo(aa, "wop * sz ptr");
-}
-
/*
* Actions module
*/
@@ -1157,7 +1135,6 @@
switch (sig)
{
case ESIGNAL_INIT:
- AclassSetupFallback();
AclassConfigLoadConfig("bindings.cfg");
AclassConfigLoadUser();
break;
===================================================================
RCS file: /cvs/e/e16/e/src/borders.c,v
retrieving revision 1.308
retrieving revision 1.309
diff -u -3 -r1.308 -r1.309
--- borders.c 10 May 2008 23:22:31 -0000 1.308
+++ borders.c 22 Jun 2008 13:34:41 -0000 1.309
@@ -48,6 +48,7 @@
static void BorderDestroy(Border * b);
static void BorderWinpartHandleEvents(Win win, XEvent * ev, void *prm);
static void BorderFrameHandleEvents(Win win, XEvent * ev, void *prm);
+static Border *BorderGetFallback(void);
static void
BorderWinpartRealise(EWin * ewin, int i)
@@ -452,7 +453,7 @@
b = BorderFind("DEFAULT");
if (!b)
- b = BorderFind("__FALLBACK_BORDER");
+ b = BorderGetFallback();
done:
ewin->normal_border = ewin->border = b;
@@ -661,6 +662,8 @@
Border *
BorderFind(const char *name)
{
+ if (!name)
+ return NULL;
return (Border *) ecore_list_find(border_list, _BorderMatchName, name);
}
@@ -1206,6 +1209,9 @@
Border *b;
b = BorderCreate("__FILLER");
+ if (!b)
+ return b;
+
b->throwaway = 1;
b->border.left = left;
@@ -1213,6 +1219,8 @@
b->border.top = top;
b->border.bottom = bottom;
+ ImageclassGetBlack(); /* Creates the __BLACK ImageClass */
+
if (top)
BorderWinpartAdd(b, "__BLACK", NULL, NULL, NULL, 1, FLAG_BUTTON, 0,
1, 99999, 1, 99999,
@@ -1247,8 +1255,38 @@
return (Border **) ecore_list_items_get(border_list, pnum);
}
-void
-BordersSetupFallback(void)
+static ActionClass *
+BorderGetFallbackAclass(void)
+{
+ ActionClass *ac;
+ Action *aa;
+
+ ac = ActionclassFind("__fb_bd_ac");
+ if (ac)
+ return ac;
+
+ /* Create fallback actionclass for the fallback border */
+ ac = ActionclassCreate("__fb_bd_ac", 0);
+ if (!ac)
+ return ac;
+
+ aa = ActionCreate(EVENT_MOUSE_DOWN, 1, 0, 0, 1, 0, NULL, NULL);
+ ActionclassAddAction(ac, aa);
+ ActionAddTo(aa, "wop * mo ptr");
+
+ aa = ActionCreate(EVENT_MOUSE_DOWN, 1, 0, 0, 2, 0, NULL, NULL);
+ ActionclassAddAction(ac, aa);
+ ActionAddTo(aa, "wop * close");
+
+ aa = ActionCreate(EVENT_MOUSE_DOWN, 1, 0, 0, 3, 0, NULL, NULL);
+ ActionclassAddAction(ac, aa);
+ ActionAddTo(aa, "wop * sz ptr");
+
+ return ac;
+}
+
+static Border *
+BorderGetFallback(void)
{
/*
* This function creates simple internal data members to be used in
@@ -1257,29 +1295,35 @@
* least E won't barf on us then.
*/
Border *b;
- ImageClass *ic;
ActionClass *ac;
- ac = ActionclassFind("__FALLBACK_ACTION");
- ic = ImageclassFind("__FALLBACK_ICLASS", 0);
+ b = BorderFind("__fb_bd");
+ if (b)
+ return b;
- /* create a fallback border in case no border is found */
- b = BorderCreate("__FALLBACK_BORDER");
+ ac = BorderGetFallbackAclass(); /* Creates the fallback ac */
+
+ /* Create fallback border */
+ b = BorderCreate("__fb_bd");
+ if (!b)
+ return b;
b->border.left = 8;
b->border.right = 8;
b->border.top = 8;
b->border.bottom = 8;
- BorderWinpartAdd(b, "__FALLBACK_ICLASS", "__FALLBACK_ACTION", NULL, NULL,
+ BorderWinpartAdd(b, "__fb_ic", "__fb_bd_ac", NULL, NULL,
1, FLAG_BUTTON, 0, 8, 99999, 8, 99999, -1, 0, 0, 0, 0,
-1, 1024, -1, 0, 7, 1);
- BorderWinpartAdd(b, "__FALLBACK_ICLASS", "__FALLBACK_ACTION", NULL, NULL,
+ BorderWinpartAdd(b, "__fb_ic", "__fb_bd_ac", NULL, NULL,
1, FLAG_BUTTON, 0, 8, 99999, 8, 99999, -1, 0, 0, 1024,
-8, -1, 1024, -1, 1024, -1, 1);
- BorderWinpartAdd(b, "__FALLBACK_ICLASS", "__FALLBACK_ACTION", NULL, NULL,
+ BorderWinpartAdd(b, "__fb_ic", "__fb_bd_ac", NULL, NULL,
1, FLAG_BUTTON, 0, 8, 99999, 8, 99999, -1, 0, 0, 0, 8,
-1, 0, 7, 1024, -9, 1);
- BorderWinpartAdd(b, "__FALLBACK_ICLASS", "__FALLBACK_ACTION", NULL, NULL,
+ BorderWinpartAdd(b, "__fb_ic", "__fb_bd_ac", NULL, NULL,
1, FLAG_BUTTON, 0, 8, 99999, 8, 99999, -1, 1024, -8, 0,
8, -1, 1024, -1, 1024, -9, 1);
+
+ return b;
}
===================================================================
RCS file: /cvs/e/e16/e/src/borders.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- borders.h 10 May 2008 23:22:31 -0000 1.15
+++ borders.h 22 Jun 2008 13:34:41 -0000 1.16
@@ -101,6 +101,5 @@
void BordersForeach(void (*func) (Border * b, void *data),
void *data);
Border **BordersGetList(int *pnum);
-void BordersSetupFallback(void);
#endif /* _BORDERS_H_ */
===================================================================
RCS file: /cvs/e/e16/e/src/config.c,v
retrieving revision 1.162
retrieving revision 1.163
diff -u -3 -r1.162 -r1.163
--- config.c 24 Mar 2008 11:12:39 -0000 1.162
+++ config.c 22 Jun 2008 13:34:41 -0000 1.163
@@ -619,8 +619,5 @@
/* Font mappings no longer needed */
FontConfigUnload();
- /* Loose ends... */
- BordersSetupFallback();
-
return 0;
}
===================================================================
RCS file: /cvs/e/e16/e/src/container.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -3 -r1.22 -r1.23
--- container.c 24 Mar 2008 11:12:39 -0000 1.22
+++ container.c 22 Jun 2008 13:34:42 -0000 1.23
@@ -531,7 +531,7 @@
static void
ContainerDrawScroll(Container * ct)
{
- ImageClass *ic;
+ ImageClass *ic, *ic_sbb;
EImageBorder *pad;
int arrow_mode = ct->arrow_side;
int bs, bw, bx;
@@ -543,13 +543,13 @@
if (ct->h < 2 * ct->arrow_thickness + ct->knob_length)
arrow_mode = 3; /* No arrows */
- ic = ImageclassFind("ICONBOX_SCROLLBAR_BASE_VERTICAL", 0);
- pad = ImageclassGetPadding(ic);
+ ic_sbb = ImageclassFind("ICONBOX_SCROLLBAR_BASE_VERTICAL", 1);
+ pad = ImageclassGetPadding(ic_sbb);
if (arrow_mode < 3)
bs = ct->h - (ct->arrow_thickness * 2);
else
bs = ct->h;
- if (ic)
+ if (pad)
bs -= pad->top + pad->bottom;
bw = (ct->h * bs) / ct->max;
if (bs < 1)
@@ -559,7 +559,7 @@
if (bw < 1)
bw = 1;
bx = ((ct->pos * bs) / ct->max);
- if (ic)
+ if (pad)
bx += pad->top;
if ((ct->scrollbar_hide) && (bw == bs))
goto do_hide_sb;
@@ -686,15 +686,13 @@
}
}
- ic = ImageclassFind("ICONBOX_SCROLLBAR_BASE_VERTICAL", 0);
- if (ic)
- ImageclassApply(ic, ct->scroll_win, 0, 0, STATE_NORMAL, ST_ICONBOX);
+ ImageclassApply(ic_sbb, ct->scroll_win, 0, 0, STATE_NORMAL, ST_ICONBOX);
EMoveResizeWindow(ct->scrollbar_win,
(ct->scroll_thickness - ct->bar_thickness) / 2, bx,
ct->bar_thickness, bw);
- ic = ImageclassFind("ICONBOX_SCROLLBAR_KNOB_VERTICAL", 0);
+ ic = ImageclassFind("ICONBOX_SCROLLBAR_KNOB_VERTICAL", 1);
if (ic)
{
state = STATE_NORMAL;
@@ -728,7 +726,7 @@
if (arrow_mode < 3)
{
- ic = ImageclassFind("ICONBOX_ARROW_UP", 0);
+ ic = ImageclassFind("ICONBOX_ARROW_UP", 1);
if (ic)
{
state = STATE_NORMAL;
@@ -739,7 +737,7 @@
ImageclassApply(ic, ct->arrow1_win, 0, 0, state, ST_ICONBOX);
}
- ic = ImageclassFind("ICONBOX_ARROW_DOWN", 0);
+ ic = ImageclassFind("ICONBOX_ARROW_DOWN", 1);
if (ic)
{
state = STATE_NORMAL;
@@ -756,13 +754,13 @@
if (ct->w < 2 * ct->arrow_thickness + ct->knob_length)
arrow_mode = 3; /* No arrows */
- ic = ImageclassFind("ICONBOX_SCROLLBAR_BASE_HORIZONTAL", 0);
- pad = ImageclassGetPadding(ic);
+ ic_sbb = ImageclassFind("ICONBOX_SCROLLBAR_BASE_HORIZONTAL", 1);
+ pad = ImageclassGetPadding(ic_sbb);
if (arrow_mode < 3)
bs = ct->w - (ct->arrow_thickness * 2);
else
bs = ct->w;
- if (ic)
+ if (pad)
bs -= pad->left + pad->right;
bw = (ct->w * bs) / ct->max;
if (bs < 1)
@@ -772,7 +770,7 @@
if (bw < 1)
bw = 1;
bx = ((ct->pos * bs) / ct->max);
- if (ic)
+ if (pad)
bx += pad->left;
if ((ct->scrollbar_hide) && (bw == bs))
goto do_hide_sb;
@@ -902,11 +900,9 @@
(ct->scroll_thickness - ct->bar_thickness) / 2, bw,
ct->bar_thickness);
- ic = ImageclassFind("ICONBOX_SCROLLBAR_BASE_HORIZONTAL", 0);
- if (ic)
- ImageclassApply(ic, ct->scroll_win, 0, 0, STATE_NORMAL, ST_ICONBOX);
+ ImageclassApply(ic_sbb, ct->scroll_win, 0, 0, STATE_NORMAL, ST_ICONBOX);
- ic = ImageclassFind("ICONBOX_SCROLLBAR_KNOB_HORIZONTAL", 0);
+ ic = ImageclassFind("ICONBOX_SCROLLBAR_KNOB_HORIZONTAL", 1);
if (ic)
{
state = STATE_NORMAL;
@@ -940,7 +936,7 @@
if (arrow_mode < 3)
{
- ic = ImageclassFind("ICONBOX_ARROW_LEFT", 0);
+ ic = ImageclassFind("ICONBOX_ARROW_LEFT", 1);
if (ic)
{
state = STATE_NORMAL;
@@ -951,7 +947,7 @@
ImageclassApply(ic, ct->arrow1_win, 0, 0, state, ST_ICONBOX);
}
- ic = ImageclassFind("ICONBOX_ARROW_RIGHT", 0);
+ ic = ImageclassFind("ICONBOX_ARROW_RIGHT", 1);
if (ic)
{
state = STATE_NORMAL;
@@ -1297,7 +1293,7 @@
Container *ct = (Container *) prm;
static int px, py, pos0;
int bs, dp;
- ImageClass *ic;
+ ImageClass *ic_sbb;
EImageBorder *pad;
switch (ev->type)
@@ -1333,10 +1329,10 @@
if (ct->orientation)
{
- ic = ImageclassFind("ICONBOX_SCROLLBAR_BASE_VERTICAL", 0);
- pad = ImageclassGetPadding(ic);
+ ic_sbb = ImageclassFind("ICONBOX_SCROLLBAR_BASE_VERTICAL", 1);
+ pad = ImageclassGetPadding(ic_sbb);
bs = ct->h - (ct->arrow_thickness * 2);
- if (ic)
+ if (pad)
bs -= pad->top + pad->bottom;
if (bs < 1)
bs = 1;
@@ -1344,10 +1340,10 @@
}
else
{
- ic = ImageclassFind("ICONBOX_SCROLLBAR_BASE_HORIZONTAL", 0);
- pad = ImageclassGetPadding(ic);
+ ic_sbb = ImageclassFind("ICONBOX_SCROLLBAR_BASE_HORIZONTAL", 1);
+ pad = ImageclassGetPadding(ic_sbb);
bs = ct->w - (ct->arrow_thickness * 2);
- if (ic)
+ if (pad)
bs -= pad->left + pad->right;
if (bs < 1)
bs = 1;
===================================================================
RCS file: /cvs/e/e16/e/src/desktops.c,v
retrieving revision 1.290
retrieving revision 1.291
diff -u -3 -r1.290 -r1.291
--- desktops.c 5 Jun 2008 17:42:59 -0000 1.290
+++ desktops.c 22 Jun 2008 13:34:42 -0000 1.291
@@ -2204,9 +2204,8 @@
if (!called)
{
- ic = ImageclassFind("SETTINGS_DESKTOP_AREA", 0);
- if (ic)
- ImageclassApply(ic, win, 0, 0, STATE_NORMAL, ST_SOLID);
+ ic = ImageclassFind("SETTINGS_DESKTOP_AREA", 1);
+ ImageclassApply(ic, win, 0, 0, STATE_NORMAL, ST_SOLID);
for (i = 0; i < ENLIGHTENMENT_CONF_NUM_DESKTOPS; i++)
wins[i] = 0;
called = 1;
@@ -2231,9 +2230,8 @@
}
else
{
- ic = ImageclassFind("SETTINGS_DESKTOP_AREA", 0);
- if (ic)
- ImageclassApply(ic, wins[i], 0, 0, STATE_NORMAL, ST_SOLID);
+ ic = ImageclassFind("SETTINGS_DESKTOP_AREA", 1);
+ ImageclassApply(ic, wins[i], 0, 0, STATE_NORMAL, ST_SOLID);
}
}
}
@@ -2445,11 +2443,11 @@
{
ImageClass *ic;
- ic = ImageclassFind("SETTINGS_AREA_AREA", 0);
+ ic = ImageclassFind("SETTINGS_AREA_AREA", 1);
ImageclassApply(ic, win, 0, 0, STATE_NORMAL, ST_SOLID);
awin = ECreateWindow(win, 0, 0, 18, 14, 0);
- ic = ImageclassFind("SETTINGS_AREADESK_AREA", 0);
+ ic = ImageclassFind("SETTINGS_AREADESK_AREA", 1);
ImageclassApply(ic, awin, 0, 0, STATE_NORMAL, ST_SOLID);
called = 1;
===================================================================
RCS file: /cvs/e/e16/e/src/dialog.c,v
retrieving revision 1.201
retrieving revision 1.202
diff -u -3 -r1.201 -r1.202
--- dialog.c 10 May 2008 23:15:32 -0000 1.201
+++ dialog.c 22 Jun 2008 13:34:42 -0000 1.202
@@ -939,7 +939,7 @@
static void
DialogRealizeItem(Dialog * d, DItem * di)
{
- const char *def = NULL;
+ const char *iclass, *tclass;
int iw = 0, ih = 0;
int register_win_callback;
EImage *im;
@@ -949,43 +949,60 @@
return;
di->realized = 1;
+ iclass = tclass = NULL;
if (di->type == DITEM_BUTTON)
{
- def = "DIALOG_WIDGET_BUTTON";
+ iclass = "DIALOG_WIDGET_BUTTON";
+ tclass = iclass;
}
else if (di->type == DITEM_CHECKBUTTON)
{
- def = "DIALOG_WIDGET_CHECK_BUTTON";
+ iclass = "DIALOG_WIDGET_CHECK_BUTTON";
+ tclass = iclass;
}
else if (di->type == DITEM_TEXT)
{
- def = "DIALOG_WIDGET_TEXT";
+ tclass = "DIALOG_WIDGET_TEXT";
}
else if (di->type == DITEM_SEPARATOR)
{
- def = "DIALOG_WIDGET_SEPARATOR";
+ iclass = "DIALOG_WIDGET_SEPARATOR";
}
- else if (di->type == DITEM_TABLE)
+ else if (di->type == DITEM_RADIOBUTTON)
{
- def = "DIALOG_WIDGET_TABLE";
+ iclass = "DIALOG_WIDGET_RADIO_BUTTON";
+ tclass = iclass;
}
- else if (di->type == DITEM_RADIOBUTTON)
+#if 0
+ else if (di->type == DITEM_SLIDER)
{
- def = "DIALOG_WIDGET_RADIO_BUTTON";
+ iclass = NULL;
}
+#endif
else if (di->type == DITEM_AREA)
{
- def = "DIALOG_WIDGET_AREA";
+ iclass = "DIALOG_WIDGET_AREA";
}
- else
+
+ if (!di->iclass && iclass)
{
- def = "DIALOG_WIDGET_BUTTON";
+ di->iclass = ImageclassAlloc(iclass, 1);
+ if (!di->iclass)
+ {
+ di->type = DITEM_NONE;
+ return;
+ }
}
- if (!di->iclass)
- di->iclass = ImageclassAlloc(def, 1);
- if (!di->tclass)
- di->tclass = TextclassAlloc(def, 1);
+ if (!di->tclass && tclass)
+ {
+ di->tclass = TextclassAlloc(tclass, 1);
+ if (!di->tclass)
+ {
+ di->type = DITEM_NONE;
+ return;
+ }
+ }
if (di->type == DITEM_TABLE)
{
@@ -1713,7 +1730,7 @@
draw_text:
di->state = state;
- if (!di->text)
+ if (!di->text || !di->tclass)
break;
if (!d->redraw)
EXCopyAreaTiled(d->pmm_bg.pmap, None, WinGetPmap(d->win),
===================================================================
RCS file: /cvs/e/e16/e/src/iclass.c,v
retrieving revision 1.137
retrieving revision 1.138
diff -u -3 -r1.137 -r1.138
--- iclass.c 5 Jun 2008 08:55:20 -0000 1.137
+++ iclass.c 22 Jun 2008 13:34:42 -0000 1.138
@@ -84,6 +84,8 @@
static Ecore_List *iclass_list = NULL;
+static ImageClass *ImageclassGetFallback(void);
+
#ifdef ENABLE_THEME_TRANSPARENCY
static EImageColorModifier *icm = NULL;
@@ -422,10 +424,10 @@
if (ic || !fallback)
return ic;
- ic = (ImageClass *) ecore_list_find(iclass_list, _ImageclassMatchName,
- "__FALLBACK_ICLASS");
-
- return ic;
+#if 0
+ Eprintf("%s: Get fallback (%s)\n", __func__, name);
+#endif
+ return ImageclassGetFallback();
}
#define ISTATE_SET_STATE(which, fallback) \
@@ -1313,13 +1315,19 @@
}
}
-static void
-ImageclassSetupFallback(void)
+static ImageClass *
+ImageclassGetFallback(void)
{
ImageClass *ic;
- /* create a fallback imageclass in case no imageclass can be found */
- ic = ImageclassCreate("__FALLBACK_ICLASS");
+ ic = ImageclassFind("__fb_ic", 0);
+ if (ic)
+ return ic;
+
+ /* Create fallback imageclass */
+ ic = ImageclassCreate("__fb_ic");
+ if (!ic)
+ return ic;
ic->norm.normal = ImagestateCreate(NULL);
ImagestateColorsSetGray(ic->norm.normal, 255, 255, 160, 0, 0);
@@ -1348,20 +1356,36 @@
SET_COLOR(&(ic->active.clicked->bg), 230, 190, 210);
ic->active.clicked->bevelstyle = BEVEL_AMIGA;
- ic->padding.left = 8;
- ic->padding.right = 8;
- ic->padding.top = 8;
- ic->padding.bottom = 8;
+ ic->padding.left = 4;
+ ic->padding.right = 4;
+ ic->padding.top = 4;
+ ic->padding.bottom = 4;
ImageclassPopulate(ic);
+ return ic;
+}
+
+ImageClass *
+ImageclassGetBlack(void)
+{
+ ImageClass *ic;
+
+ ic = ImageclassFind("__BLACK", 0);
+ if (ic)
+ return ic;
+
/* Create all black image class for filler borders */
ic = ImageclassCreate("__BLACK");
+ if (!ic)
+ return ic;
ic->norm.normal = ImagestateCreate(NULL);
ImagestateColorsSetGray(ic->norm.normal, 0, 0, 0, 0, 0);
ImageclassPopulate(ic);
+
+ return ic;
}
/*
@@ -1369,17 +1393,6 @@
*/
static void
-ImageclassSighan(int sig, void *prm __UNUSED__)
-{
- switch (sig)
- {
- case ESIGNAL_INIT:
- ImageclassSetupFallback();
- break;
- }
-}
-
-static void
ImageclassIpc(const char *params)
{
char param1[1024];
@@ -1549,7 +1562,7 @@
static const IpcItem ImageclassIpcArray[] = {
{
ImageclassIpc,
- "imageclass", NULL,
+ "imageclass", "ic",
"List imageclasses, apply an imageclass",
NULL}
,
@@ -1562,7 +1575,7 @@
extern const EModule ModImageclass;
const EModule ModImageclass = {
"imageclass", "ic",
- ImageclassSighan,
+ NULL,
{N_IPC_FUNCS, ImageclassIpcArray}
,
{0, NULL}
===================================================================
RCS file: /cvs/e/e16/e/src/iclass.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -3 -r1.19 -r1.20
--- iclass.h 3 Feb 2008 16:52:38 -0000 1.19
+++ iclass.h 22 Jun 2008 13:34:42 -0000 1.20
@@ -109,6 +109,7 @@
ImageState *ImageclassGetImageState(ImageClass * ic, int state,
int active, int sticky);
ImageClass *ImageclassCreateSimple(const char *name, const char
*image);
+ImageClass *ImageclassGetBlack(void);
EImage *ImageclassGetImage(ImageClass * ic, int active, int sticky,
int state);
void ImageclassApplySimple(ImageClass * ic, Win win,
===================================================================
RCS file: /cvs/e/e16/e/src/menus.c,v
retrieving revision 1.302
retrieving revision 1.303
diff -u -3 -r1.302 -r1.303
--- menus.c 5 Jun 2008 08:55:21 -0000 1.302
+++ menus.c 22 Jun 2008 13:34:42 -0000 1.303
@@ -378,13 +378,6 @@
m->ref_count++;
}
-static void
-MenuStyleSetName(MenuStyle * ms, const char *name)
-{
- Efree(ms->name);
- ms->name = Estrdup(name);
-}
-
static MenuStyle *
MenuStyleCreate(const char *name)
{
@@ -398,8 +391,8 @@
menu_style_list = ecore_list_new();
ecore_list_prepend(menu_style_list, ms);
+ ms->name = Estrdup(name);
ms->iconpos = ICON_LEFT;
- MenuStyleSetName(ms, name);
return ms;
}
@@ -437,8 +430,28 @@
MenuStyle *
MenuStyleFind(const char *name)
{
- return (MenuStyle *) ecore_list_find(menu_style_list, _MenuStyleMatchName,
- name);
+ MenuStyle *ms;
+
+ ms = (MenuStyle *) ecore_list_find(menu_style_list, _MenuStyleMatchName,
+ name);
+ if (ms)
+ return ms;
+
+ ms = (MenuStyle *) ecore_list_find(menu_style_list, _MenuStyleMatchName,
+ "__fb_ms");
+ if (ms)
+ return ms;
+
+ ms = MenuStyleCreate("__fb_ms");
+ if (!ms)
+ return ms;
+
+ ms->tclass = TextclassFind(NULL, 1);
+ ms->bg_iclass = ImageclassFind(NULL, 1);
+ ms->item_iclass = ImageclassFind(NULL, 1);
+ ms->sub_iclass = ImageclassFind(NULL, 1);
+
+ return ms;
}
void
@@ -1930,7 +1943,7 @@
sscanf(p3, "%s %n", s3, &len);
ic = NULL;
if (strcmp("NULL", s3))
- ic = ImageclassFind(s3, 0);
+ ic = ImageclassFind(s3, 1);
mm = MenuFind(s2, NULL);
mi = MenuItemCreate(p3 + len, ic, NULL, mm);
MenuAddItem(m, mi);
===================================================================
RCS file: /cvs/e/e16/e/src/tclass.c,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -3 -r1.60 -r1.61
--- tclass.c 23 Feb 2008 12:13:28 -0000 1.60
+++ tclass.c 22 Jun 2008 13:34:42 -0000 1.61
@@ -33,6 +33,8 @@
static Ecore_List *tclass_list = NULL;
+static TextClass *TextclassGetFallback(void);
+
static char *
TextstateFontLookup(const char *name)
{
@@ -229,10 +231,10 @@
if (tc || !fallback)
return tc;
- tc = (TextClass *) ecore_list_find(tclass_list, _TextclassMatchName,
- "__FALLBACK_TCLASS");
-
- return tc;
+#if 0
+ Eprintf("%s: Get fallback (%s)\n", __func__, name);
+#endif
+ return TextclassGetFallback();
}
int
@@ -369,28 +371,32 @@
return err;
}
-/*
- * Textclass Module
- */
-
-static void
-TextclassSighan(int sig, void *prm __UNUSED__)
+static TextClass *
+TextclassGetFallback(void)
{
TextClass *tc;
- switch (sig)
- {
- case ESIGNAL_INIT:
- /* create a fallback textclass in case no textclass is found */
- tc = TextclassCreate("__FALLBACK_TCLASS");
- tc->norm.normal =
- TextstateCreate("-*-helvetica-medium-r-*-*-12-*-*-*-*-*-*-*");
- SET_COLOR(&(tc->norm.normal->fg_col), 0, 0, 0);
- TextclassPopulate(tc);
- break;
- }
+ tc = TextclassFind("__fb_tc", 0);
+ if (tc)
+ return tc;
+
+ /* Create fallback textclass */
+ tc = TextclassCreate("__fb_tc");
+ if (!tc)
+ return tc;
+
+ tc->norm.normal =
+ TextstateCreate("-*-helvetica-medium-r-*-*-12-*-*-*-*-*-*-*");
+ SET_COLOR(&(tc->norm.normal->fg_col), 0, 0, 0);
+ TextclassPopulate(tc);
+
+ return tc;
}
+/*
+ * Textclass Module
+ */
+
static void
TextclassIpc(const char *params)
{
@@ -513,7 +519,7 @@
static const IpcItem TextclassIpcArray[] = {
{
TextclassIpc,
- "textclass", NULL,
+ "textclass", "tc",
"List textclasses, apply a textclass",
NULL}
,
@@ -526,7 +532,7 @@
extern const EModule ModTextclass;
const EModule ModTextclass = {
"textclass", "tc",
- TextclassSighan,
+ NULL,
{N_IPC_FUNCS, TextclassIpcArray}
,
{0, NULL}
===================================================================
RCS file: /cvs/e/e16/e/src/text.c,v
retrieving revision 1.99
retrieving revision 1.100
diff -u -3 -r1.99 -r1.100
--- text.c 23 Mar 2008 11:54:24 -0000 1.99
+++ text.c 22 Jun 2008 13:34:42 -0000 1.100
@@ -179,6 +179,9 @@
TextState *
TextclassGetTextState(TextClass * tclass, int state, int active, int sticky)
{
+ if (!tclass)
+ return NULL;
+
if (active)
{
if (!sticky)
===================================================================
RCS file: /cvs/e/e16/e/src/theme.c,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -3 -r1.70 -r1.71
--- theme.c 16 Jun 2008 21:22:41 -0000 1.70
+++ theme.c 22 Jun 2008 13:34:42 -0000 1.71
@@ -373,7 +373,8 @@
return ret;
}
- ret = ThemeGetDefault();
+ if (strcmp(theme, "-"))
+ ret = ThemeGetDefault();
#if ENABLE_THEME_SANITY_CHECKING
badtheme = Estrdup(theme);
#endif
@@ -427,7 +428,7 @@
Conf.theme.name = (theme) ? fullfileof(theme) : NULL;
Efree(Mode.theme.path);
- Mode.theme.path = theme;
+ Mode.theme.path = (theme) ? theme : Estrdup("-");
}
static void
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs