Enlightenment CVS committal
Author : kwo
Project : e16
Module : e
Dir : e16/e/src
Modified Files:
buttons.c e16-ecore_hints.c e16-ecore_hints.h ecompmgr.c
eobj.c hints.c icccm.c ipc.c progress.c stacking.c
Log Message:
Rewrap stuff related to WM_NAME/CLASS.
===================================================================
RCS file: /cvs/e/e16/e/src/buttons.c,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -3 -r1.96 -r1.97
--- buttons.c 19 Nov 2006 21:55:51 -0000 1.96
+++ buttons.c 26 Nov 2006 11:11:14 -0000 1.97
@@ -217,7 +217,7 @@
static int
_ButtonMatchName(const void *data, const void *match)
{
- return strcmp(((const Button *)data)->o.name, match);
+ return strcmp(EoGetName((const Button *)data), match);
}
Button *
===================================================================
RCS file: /cvs/e/e16/e/src/e16-ecore_hints.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- e16-ecore_hints.c 21 May 2006 18:44:15 -0000 1.2
+++ e16-ecore_hints.c 26 Nov 2006 11:11:14 -0000 1.3
@@ -769,6 +769,40 @@
return ecore_x_window_prop_string_get(win, ECORE_X_ATOM_WM_NAME);
}
+void
+ecore_x_icccm_name_class_set(Ecore_X_Window win, const char *name,
+ const char *clss)
+{
+ XClassHint *xch;
+
+ xch = XAllocClassHint();
+ if (!xch)
+ return;
+ xch->res_name = (char *)name;
+ xch->res_class = (char *)clss;
+ XSetClassHint(_ecore_x_disp, win, xch);
+ XFree(xch);
+}
+
+void
+ecore_x_icccm_name_class_get(Ecore_X_Window win, char **name, char **clss)
+{
+ XClassHint xch;
+
+ *name = *clss = NULL;
+ xch.res_name = NULL;
+ xch.res_class = NULL;
+ if (XGetClassHint(_ecore_x_disp, win, &xch))
+ {
+ if (name && xch.res_name)
+ *name = strdup(xch.res_name);
+ if (clss && xch.res_class)
+ *clss = strdup(xch.res_class);
+ XFree(xch.res_name);
+ XFree(xch.res_class);
+ }
+}
+
#endif /* USE_ECORE_X */
#ifndef USE_ECORE_X
===================================================================
RCS file: /cvs/e/e16/e/src/e16-ecore_hints.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- e16-ecore_hints.h 18 Feb 2006 09:50:16 -0000 1.1
+++ e16-ecore_hints.h 26 Nov 2006 11:11:14 -0000 1.2
@@ -141,6 +141,11 @@
void ecore_x_icccm_title_set(Ecore_X_Window win,
const char *title);
char *ecore_x_icccm_title_get(Ecore_X_Window win);
+void ecore_x_icccm_name_class_set(Ecore_X_Window win,
+ const char *name,
+ const char *clss);
+void ecore_x_icccm_name_class_get(Ecore_X_Window win,
+ char **name, char **clss);
/* NETWM (EWMH) */
extern Ecore_X_Atom ECORE_X_ATOM_NET_SUPPORTED;
===================================================================
RCS file: /cvs/e/e16/e/src/ecompmgr.c,v
retrieving revision 1.132
retrieving revision 1.133
diff -u -3 -r1.132 -r1.133
--- ecompmgr.c 19 Nov 2006 22:24:59 -0000 1.132
+++ ecompmgr.c 26 Nov 2006 11:11:14 -0000 1.133
@@ -1722,7 +1722,8 @@
ECmWinInfo *cw = eo->cmhook;
Eprintf("%s %#lx: %d,%d %dx%d: %s\n", txt, EobjGetXwin(eo),
- EobjGetX(eo), EobjGetY(eo), EobjGetW(eo), EobjGetH(eo), eo->name);
+ EobjGetX(eo), EobjGetY(eo), EobjGetW(eo), EobjGetH(eo),
+ EobjGetName(eo));
if (!cw)
{
Eprintf("Not managed\n");
@@ -1877,7 +1878,7 @@
case WINDOW_SOLID:
D4printf("- clip %#lx %#lx %d,%d %dx%d: %s\n", EobjGetXwin(eo),
cw->clip, EobjGetX(eo), EobjGetY(eo), EobjGetW(eo),
- EobjGetH(eo), eo->name);
+ EobjGetH(eo), EobjGetName(eo));
#if USE_CLIP_RELATIVE_TO_DESK
ERegionUnionOffset(clip, 0, 0, cw->shape);
#else
@@ -1888,7 +1889,7 @@
default:
D4printf("- noclip %#lx %#lx %d,%d %dx%d: %s\n", EobjGetXwin(eo),
cw->clip, EobjGetX(eo), EobjGetY(eo), EobjGetW(eo),
- EobjGetH(eo), eo->name);
+ EobjGetH(eo), EobjGetName(eo));
break;
}
===================================================================
RCS file: /cvs/e/e16/e/src/eobj.c,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -3 -r1.86 -r1.87
--- eobj.c 19 Nov 2006 21:55:51 -0000 1.86
+++ eobj.c 26 Nov 2006 11:11:14 -0000 1.87
@@ -210,14 +210,14 @@
EobjListStackAdd(eo, 1);
if (EDebug(EDBUG_TYPE_EWINS))
- Eprintf("EobjInit: %#lx %s\n", EobjGetXwin(eo), eo->name);
+ Eprintf("EobjInit: %#lx %s\n", EobjGetXwin(eo), EobjGetName(eo));
}
void
EobjFini(EObj * eo)
{
if (EDebug(EDBUG_TYPE_EWINS))
- Eprintf("EobjFini: %#lx %s\n", EobjGetXwin(eo), eo->name);
+ Eprintf("EobjFini: %#lx %s\n", EobjGetXwin(eo), EobjGetName(eo));
EobjListStackDel(eo);
@@ -242,7 +242,7 @@
EobjDestroy(EObj * eo)
{
if (EDebug(EDBUG_TYPE_EWINS))
- Eprintf("EobjDestroy: %#lx %s\n", EobjGetXwin(eo), eo->name);
+ Eprintf("EobjDestroy: %#lx %s\n", EobjGetXwin(eo), EobjGetName(eo));
EobjFini(eo);
@@ -316,7 +316,7 @@
#endif
#if 0
Eprintf("EobjRegister: %#lx type=%d or=%d: %s\n", xwin, type,
- attr.override_redirect, eo->name);
+ attr.override_redirect, EobjGetName(eo));
#endif
return eo;
@@ -326,7 +326,8 @@
EobjUnregister(EObj * eo)
{
#if 0
- Eprintf("EobjUnregister: %#lx type=%d: %s\n", eo->win, eo->type, eo->name);
+ Eprintf("EobjUnregister: %#lx type=%d: %s\n", eo->win, eo->type,
+ EobjGetName(eo));
#endif
EobjDestroy(eo);
}
===================================================================
RCS file: /cvs/e/e16/e/src/hints.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -3 -r1.72 -r1.73
--- hints.c 19 Nov 2006 21:55:51 -0000 1.72
+++ hints.c 26 Nov 2006 11:11:14 -0000 1.73
@@ -168,18 +168,12 @@
void
HintsSetWindowClass(Win win, const char *name, const char *clss)
{
- XClassHint *xch;
-
if (!name)
name = "NoName";
if (!clss)
clss = "NoClass";
- xch = XAllocClassHint();
- xch->res_name = (char *)name;
- xch->res_class = (char *)clss;
- XSetClassHint(disp, WinGetXwin(win), xch);
- XFree(xch);
+ ecore_x_icccm_name_class_set(WinGetXwin(win), name, clss);
}
void
===================================================================
RCS file: /cvs/e/e16/e/src/icccm.c,v
retrieving revision 1.132
retrieving revision 1.133
diff -u -3 -r1.132 -r1.133
--- icccm.c 19 Nov 2006 22:55:32 -0000 1.132
+++ icccm.c 26 Nov 2006 11:11:14 -0000 1.133
@@ -537,19 +537,16 @@
{
if (atom_change == 0 || atom_change == ECORE_X_ATOM_WM_CLASS)
{
- XClassHint hint;
-
_EFREE(ewin->icccm.wm_res_name);
_EFREE(ewin->icccm.wm_res_class);
- if (XGetClassHint(disp, EwinGetClientXwin(ewin), &hint) ||
- (TryGroup(ewin) && XGetClassHint(disp, ewin->icccm.group, &hint)))
- {
- ewin->icccm.wm_res_name = Estrdup(hint.res_name);
- ewin->icccm.wm_res_class = Estrdup(hint.res_class);
- XFree(hint.res_name);
- XFree(hint.res_class);
- }
+ ecore_x_icccm_name_class_get(EwinGetClientXwin(ewin),
+ &ewin->icccm.wm_res_name,
+ &ewin->icccm.wm_res_class);
+ if (!ewin->icccm.wm_res_name && TryGroup(ewin))
+ ecore_x_icccm_name_class_get(ewin->icccm.group,
+ &ewin->icccm.wm_res_name,
+ &ewin->icccm.wm_res_class);
}
if (atom_change == 0 || atom_change == ECORE_X_ATOM_WM_COMMAND)
===================================================================
RCS file: /cvs/e/e16/e/src/ipc.c,v
retrieving revision 1.281
retrieving revision 1.282
diff -u -3 -r1.281 -r1.282
--- ipc.c 19 Nov 2006 21:55:51 -0000 1.281
+++ ipc.c 26 Nov 2006 11:11:14 -0000 1.282
@@ -573,10 +573,7 @@
IpcPrintf("title: %s", ewin->icccm.wm_name);
goto done;
}
- _EFREE(ewin->icccm.wm_name);
- ewin->icccm.wm_name = Estrdup(prm);
- XStoreName(disp, EwinGetClientXwin(ewin), ewin->icccm.wm_name);
- EwinBorderUpdateInfo(ewin);
+ HintsSetWindowName(EwinGetClientWin(ewin), prm);
break;
case EWIN_OP_CLOSE:
@@ -1275,7 +1272,7 @@
#else
0, 0
#endif
- , eo->name);
+ , EobjGetName(eo));
}
}
===================================================================
RCS file: /cvs/e/e16/e/src/progress.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -3 -r1.36 -r1.37
--- progress.c 19 Nov 2006 21:55:52 -0000 1.36
+++ progress.c 26 Nov 2006 11:11:14 -0000 1.37
@@ -204,7 +204,7 @@
EobjMap(p->p_win, 0);
pad = ImageclassGetPadding(p->inc);
- TextDraw(p->tc, p->win->win, None, 0, 0, STATE_NORMAL, p->win->name,
+ TextDraw(p->tc, p->win->win, None, 0, 0, STATE_NORMAL, EobjGetName(p->win),
pad->left, pad->top, p->w - (p->h * 5) - (pad->left + pad->right),
p->h - (pad->top + pad->bottom), p->h - (pad->top + pad->bottom),
TextclassGetJustification(p->tnc));
===================================================================
RCS file: /cvs/e/e16/e/src/stacking.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -3 -r1.36 -r1.37
--- stacking.c 19 Nov 2006 21:55:52 -0000 1.36
+++ stacking.c 26 Nov 2006 11:11:14 -0000 1.37
@@ -59,7 +59,7 @@
{
eo = ewl->list[i];
Eprintf(" %2d: %#10lx %#10lx %d %d %s\n", i, EobjGetXwin(eo),
- EobjGetCwin(eo), eo->desk->num, eo->ilayer, eo->name);
+ EobjGetCwin(eo), eo->desk->num, eo->ilayer, EobjGetName(eo));
}
}
#else
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs