Add some glx support stuff.

SVN revision: 28810
This commit is contained in:
Kim Woelders 2007-03-19 05:37:57 +00:00
parent ade6499592
commit c120bcd309
4 changed files with 53 additions and 24 deletions

View File

@ -92,7 +92,9 @@
#define INV_GEOM (INV_POS | INV_SIZE)
#define INV_ALL (INV_POS | INV_SIZE | INV_CLIP | INV_OPACITY | INV_SHADOW | INV_PIXMAP)
struct _eoci
typedef struct _cmhook ECmWinInfo;
struct _cmhook
{
EObj *next; /* Paint order */
EObj *prev; /* Paint order */

View File

@ -26,10 +26,6 @@
#include "etypes.h"
#include "xwin.h"
#if USE_COMPOSITE
typedef struct _eoci ECmWinInfo;
#endif
typedef struct _eobj EObj;
struct _eobj
@ -51,17 +47,20 @@ struct _eobj
unsigned noredir:1; /* Do not redirect */
unsigned shadow:1; /* Enable shadows */
unsigned fade:1; /* Enable fading */
#if USE_COMPOSITE
unsigned int opacity;
ECmWinInfo *cmhook;
unsigned int serial;
#endif
struct
{
char *wm_name;
char *wm_res_name;
char *wm_res_class;
} icccm;
#if USE_COMPOSITE
unsigned int serial;
unsigned int opacity;
struct _cmhook *cmhook;
#endif
#if USE_GLX
struct _glhook *glhook;
#endif
};
#define EOBJ_TYPE_EWIN 0
@ -165,6 +164,10 @@ int EobjLower(EObj * eo);
void EobjShapeUpdate(EObj * eo, int propagate);
void EobjsRepaint(void);
Pixmap EobjGetPixmap(const EObj * eo);
#if USE_GLX
struct _etexture *EobjGetTexture(EObj * eo);
#endif
void EobjChangeOpacity(EObj * eo, unsigned int opacity);
void EobjChangeShadow(EObj * eo, int shadow);
void EobjSetLayer(EObj * eo, int layer);

50
src/x.c
View File

@ -347,12 +347,33 @@ ECreateWindow(Win parent, int x, int y, int w, int h, int saveunder)
}
#if USE_COMPOSITE
Win
ECreateArgbWindow(Win parent, int x, int y, int w, int h, Win cwin)
static Win
ECreateWindowVDC(Win parent, int x, int y, int w, int h,
Visual * vis, unsigned int depth, Colormap cmap)
{
EXID *win;
Window xwin;
XSetWindowAttributes attr;
attr.background_pixmap = None;
attr.border_pixel = 0;
attr.backing_store = NotUseful;
attr.save_under = False;
attr.override_redirect = False;
attr.colormap = cmap;
xwin = XCreateWindow(disp, parent->xwin, x, y, w, h, 0,
depth, InputOutput, vis,
CWOverrideRedirect | CWSaveUnder | CWBackingStore |
CWColormap | CWBackPixmap | CWBorderPixel, &attr);
win = EXidSet(xwin, parent, x, y, w, h, depth, vis, cmap);
return win;
}
Win
ECreateArgbWindow(Win parent, int x, int y, int w, int h, Win cwin)
{
int depth;
Visual *vis;
Colormap cmap;
@ -376,23 +397,24 @@ ECreateArgbWindow(Win parent, int x, int y, int w, int h, Win cwin)
cmap = argb_cmap;
}
attr.background_pixmap = None;
attr.border_pixel = 0;
attr.backing_store = NotUseful;
attr.save_under = False;
attr.override_redirect = False;
attr.colormap = cmap;
return ECreateWindowVDC(parent, x, y, w, h, vis, depth, cmap);
}
xwin = XCreateWindow(disp, parent->xwin, x, y, w, h, 0,
depth, InputOutput, vis,
CWOverrideRedirect | CWSaveUnder | CWBackingStore |
CWColormap | CWBackPixmap | CWBorderPixel, &attr);
win = EXidSet(xwin, parent, x, y, w, h, depth, vis, cmap);
#if USE_GLX
Win
ECreateWindowVD(Win parent, int x, int y, int w, int h,
Visual * vis, unsigned int depth)
{
Colormap cmap;
return win;
cmap = XCreateColormap(disp, VRoot.xwin, vis, AllocNone);
return ECreateWindowVDC(parent, x, y, w, h, vis, depth, cmap);
}
#endif
#endif /* USE_COMPOSITE */
Win
ECreateObjectWindow(Win parent, int x, int y, int w, int h, int saveunder,
int type, Win cwin, char *argb_ret)

View File

@ -125,6 +125,8 @@ Win ECreateWindow(Win parent, int x, int y, int w, int h,
int saveunder);
Win ECreateArgbWindow(Win parent, int x, int y, int w, int h,
Win cwin);
Win ECreateWindowVD(Win parent, int x, int y, int w, int h,
Visual * vis, unsigned int depth);
Win ECreateClientWindow(Win parent, int x, int y, int w, int h);
Win ECreateObjectWindow(Win parent, int x, int y, int w,
int h, int saveunder, int type,