Enlightenment CVS committal
Author : kwo
Project : e16
Module : e
Dir : e16/e/src
Modified Files:
E.h ewmh.c hints.c ipc.c
Log Message:
Add basic _NET_WM_WINDOW_OPACITY handling.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.322
retrieving revision 1.323
diff -u -3 -r1.322 -r1.323
--- E.h 15 Aug 2004 20:45:23 -0000 1.322
+++ E.h 20 Aug 2004 21:13:55 -0000 1.323
@@ -874,6 +874,7 @@
struct
{
unsigned vroot:1; /* Virtual root window */
+ unsigned int opacity;
} props;
struct
{
@@ -2043,6 +2044,7 @@
void EWMH_SetWindowName(Window win, const char *name);
void EWMH_SetWindowDesktop(const EWin * ewin);
void EWMH_SetWindowState(const EWin * ewin);
+void EWMH_SetWindowOpacity(EWin * ewin, unsigned int opacity);
void EWMH_GetWindowName(EWin * ewin);
void EWMH_GetWindowIconName(EWin * ewin);
void EWMH_GetWindowDesktop(EWin * ewin);
@@ -2224,6 +2226,7 @@
void HintsSetWindowDesktop(EWin * ewin);
void HintsSetWindowArea(EWin * ewin);
void HintsSetWindowState(EWin * ewin);
+void HintsSetWindowOpacity(EWin * ewin, unsigned int opacity);
void HintsSetWindowHints(EWin * ewin);
void HintsSetWindowBorder(EWin * ewin);
void HintsGetWindowHints(EWin * ewin);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ewmh.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -3 -r1.57 -r1.58
--- ewmh.c 15 Aug 2004 20:45:23 -0000 1.57
+++ ewmh.c 20 Aug 2004 21:13:56 -0000 1.58
@@ -131,6 +131,8 @@
Atom _NET_WM_STATE_ABOVE;
Atom _NET_WM_STATE_BELOW;
+Atom _NET_WM_WINDOW_OPACITY;
+
/* Window state property change actions */
#define _NET_WM_STATE_REMOVE 0
#define _NET_WM_STATE_ADD 1
@@ -244,6 +246,8 @@
_ATOM_INIT(_NET_WM_STATE_ABOVE);
_ATOM_INIT(_NET_WM_STATE_BELOW);
+ _ATOM_INIT(_NET_WM_WINDOW_OPACITY);
+
_ATOM_INIT(_NET_WM_STRUT);
_ATOM_SET_ATOM(_NET_SUPPORTED, VRoot.win, atom_list, atom_count);
@@ -525,6 +529,15 @@
EDBUG_RETURN_;
}
+void
+EWMH_SetWindowOpacity(EWin * ewin, unsigned int opacity)
+{
+ CARD32 val = opacity;
+
+ ewin->props.opacity = opacity;
+ _ATOM_SET_CARD32(_NET_WM_WINDOW_OPACITY, ewin->win, &val, 1);
+}
+
/*
* Functions that set E-window internals from X11-properties
*/
@@ -735,6 +748,23 @@
ewin->props.vroot = 1;
Efree(val);
}
+}
+
+static void
+EWMH_GetWindowOpacity(EWin * ewin)
+{
+ CARD32 *val;
+ int size;
+
+ EDBUG(6, "EWMH_GetWindowOpacity");
+
+ val = AtomGet(ewin->client.win, _NET_WM_WINDOW_OPACITY, XA_CARDINAL, &size);
+ if (val)
+ {
+ ewin->props.opacity = val[0];
+ EWMH_SetWindowOpacity(ewin, val[0]);
+ Efree(val);
+ }
EDBUG_RETURN_;
}
@@ -768,6 +798,7 @@
{
EDBUG(6, "EWMH_GetWindowHints");
EWMH_GetWindowMisc(ewin);
+ EWMH_GetWindowOpacity(ewin);
EWMH_GetWindowName(ewin);
EWMH_GetWindowIconName(ewin);
EWMH_GetWindowDesktop(ewin);
@@ -1010,6 +1041,8 @@
EWMH_GetWindowIconName(ewin);
else if (atom_change == _NET_WM_STRUT)
EWMH_GetWindowStrut(ewin);
+ else if (atom_change == _NET_WM_WINDOW_OPACITY)
+ EWMH_GetWindowOpacity(ewin);
EDBUG_RETURN_;
}
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/hints.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -3 -r1.25 -r1.26
--- hints.c 4 Jul 2004 08:47:28 -0000 1.25
+++ hints.c 20 Aug 2004 21:13:56 -0000 1.26
@@ -223,6 +223,16 @@
}
void
+HintsSetWindowOpacity(EWin * ewin, unsigned int opacity)
+{
+ EDBUG(6, "HintsSetWindowOpacity");
+#if ENABLE_EWMH
+ EWMH_SetWindowOpacity(ewin, opacity);
+#endif
+ EDBUG_RETURN_;
+}
+
+void
HintsSetWindowHints(EWin * ewin)
{
EDBUG(6, "HintsSetWindowHints");
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ipc.c,v
retrieving revision 1.180
retrieving revision 1.181
diff -u -3 -r1.180 -r1.181
--- ipc.c 15 Aug 2004 20:45:23 -0000 1.180
+++ ipc.c 20 Aug 2004 21:13:56 -0000 1.181
@@ -3091,7 +3091,7 @@
char windowid[FILEPATH_LEN_MAX];
char operation[FILEPATH_LEN_MAX];
char param1[FILEPATH_LEN_MAX];
- unsigned int win;
+ unsigned int win, val;
if (params == NULL)
{
@@ -3255,6 +3255,21 @@
RememberImportantInfoForEwin(ewin);
}
}
+ else if (!strncmp(operation, "opacity", 2))
+ {
+ if (!strcmp(param1, "?"))
+ {
+ Esnprintf(buf, sizeof(buf), "opacity: %u",
+ ewin->props.opacity >> 24);
+ }
+ else
+ {
+ val = 0xff;
+ sscanf(param1, "%i", &val);
+ val = (val << 24) | (val << 16) | (val << 8) | val;
+ HintsSetWindowOpacity(ewin, val);
+ }
+ }
else if (!strncmp(operation, "border", 2))
{
Border *b;
-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs