1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-21 13:28:05 +01:00

wmcore code clean

This patch changes spaces with tabs, make the comments shorter and removes
some old comments.
This commit is contained in:
Rodolfo García Peñas (kix)
2012-10-06 17:58:52 +02:00
committed by Carlos R. Mafra
parent 41af9ca07f
commit e3db102591
2 changed files with 34 additions and 45 deletions

View File

@@ -34,18 +34,15 @@ extern WPreferences wPreferences;
/* cursors */ /* cursors */
extern Cursor wCursor[WCUR_LAST]; extern Cursor wCursor[WCUR_LAST];
extern XContext wWinContext; extern XContext wWinContext;
/* /*----------------------------------------------------------------------
*----------------------------------------------------------------------
* wCoreCreateTopLevel-- * wCoreCreateTopLevel--
* Creates a toplevel window used for icons, menus and dialogs. * Creates a toplevel window used for icons, menus and dialogs.
* *
* Returns: * Returns:
* The created window. * The created window.
*---------------------------------------------------------------------- *--------------------------------------------------------------------- */
*/
WCoreWindow *wCoreCreateTopLevel(WScreen *screen, int x, int y, int width, int height, int bwidth, int depth, Visual *visual, Colormap colormap) WCoreWindow *wCoreCreateTopLevel(WScreen *screen, int x, int y, int width, int height, int bwidth, int depth, Visual *visual, Colormap colormap)
{ {
WCoreWindow *core; WCoreWindow *core;
@@ -54,17 +51,15 @@ WCoreWindow *wCoreCreateTopLevel(WScreen * screen, int x, int y, int width, int
core = wmalloc(sizeof(WCoreWindow)); core = wmalloc(sizeof(WCoreWindow));
/* don't set CWBackPixel so that transparent XRender windows vmask = CWBorderPixel | CWCursor | CWEventMask | CWOverrideRedirect;
are see-through */
vmask = /*CWBackPixmap|CWBackPixel| */ CWBorderPixel | CWCursor | CWEventMask
| CWOverrideRedirect;
attribs.override_redirect = True; attribs.override_redirect = True;
attribs.cursor = wCursor[WCUR_DEFAULT]; attribs.cursor = wCursor[WCUR_DEFAULT];
attribs.background_pixmap = None; attribs.background_pixmap = None;
attribs.background_pixel = screen->black_pixel; attribs.background_pixel = screen->black_pixel;
attribs.border_pixel = screen->frame_border_pixel; attribs.border_pixel = screen->frame_border_pixel;
attribs.event_mask = SubstructureRedirectMask | ButtonPressMask attribs.event_mask = SubstructureRedirectMask | ButtonPressMask |
| ButtonReleaseMask | ButtonMotionMask | ExposureMask | EnterWindowMask | LeaveWindowMask; ButtonReleaseMask | ButtonMotionMask |
ExposureMask | EnterWindowMask | LeaveWindowMask;
vmask |= CWColormap; vmask |= CWColormap;
attribs.colormap = colormap; attribs.colormap = colormap;
@@ -74,18 +69,15 @@ WCoreWindow *wCoreCreateTopLevel(WScreen * screen, int x, int y, int width, int
core->width = width; core->width = width;
core->height = height; core->height = height;
core->screen_ptr = screen; core->screen_ptr = screen;
core->descriptor.self = core; core->descriptor.self = core;
XClearWindow(dpy, core->window); XClearWindow(dpy, core->window);
XSaveContext(dpy, core->window, wWinContext, (XPointer) & core->descriptor); XSaveContext(dpy, core->window, wWinContext, (XPointer) & core->descriptor);
return core; return core;
} }
/* /*----------------------------------------------------------------------
*----------------------------------------------------------------------
* wCoreCreate-- * wCoreCreate--
* Creates a brand new child window. * Creates a brand new child window.
* The window will have a border width of 0 and color is black. * The window will have a border width of 0 and color is black.
@@ -98,9 +90,7 @@ WCoreWindow *wCoreCreateTopLevel(WScreen * screen, int x, int y, int width, int
* *
* Notes: * Notes:
* The event mask is initialized to a default value. * The event mask is initialized to a default value.
* *--------------------------------------------------------------------- */
*----------------------------------------------------------------------
*/
WCoreWindow *wCoreCreate(WCoreWindow *parent, int x, int y, int width, int height) WCoreWindow *wCoreCreate(WCoreWindow *parent, int x, int y, int width, int height)
{ {
WCoreWindow *core; WCoreWindow *core;
@@ -109,22 +99,22 @@ WCoreWindow *wCoreCreate(WCoreWindow * parent, int x, int y, int width, int heig
core = wmalloc(sizeof(WCoreWindow)); core = wmalloc(sizeof(WCoreWindow));
vmask = /*CWBackPixmap|CWBackPixel| */ CWBorderPixel | CWCursor | CWEventMask; vmask = CWBorderPixel | CWCursor | CWEventMask;
attribs.cursor = wCursor[WCUR_DEFAULT]; attribs.cursor = wCursor[WCUR_DEFAULT];
attribs.background_pixmap = None; attribs.background_pixmap = None;
attribs.background_pixel = parent->screen_ptr->black_pixel; attribs.background_pixel = parent->screen_ptr->black_pixel;
attribs.event_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask attribs.event_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask |
| ButtonReleaseMask | ButtonMotionMask | ExposureMask | EnterWindowMask | LeaveWindowMask; ButtonReleaseMask | ButtonMotionMask |
ExposureMask | EnterWindowMask | LeaveWindowMask;
vmask |= CWColormap; vmask |= CWColormap;
attribs.colormap = parent->screen_ptr->w_colormap; attribs.colormap = parent->screen_ptr->w_colormap;
core->window = core->window = XCreateWindow(dpy, parent->window, x, y, width, height, 0,
XCreateWindow(dpy, parent->window, x, y, width, height, 0,
parent->screen_ptr->w_depth, CopyFromParent, parent->screen_ptr->w_depth, CopyFromParent,
parent->screen_ptr->w_visual, vmask, &attribs); parent->screen_ptr->w_visual, vmask, &attribs);
core->width = width; core->width = width;
core->height = height; core->height = height;
core->screen_ptr = parent->screen_ptr; core->screen_ptr = parent->screen_ptr;
core->descriptor.self = core; core->descriptor.self = core;
XSaveContext(dpy, core->window, wWinContext, (XPointer) & core->descriptor); XSaveContext(dpy, core->window, wWinContext, (XPointer) & core->descriptor);
@@ -133,9 +123,9 @@ WCoreWindow *wCoreCreate(WCoreWindow * parent, int x, int y, int width, int heig
void wCoreDestroy(WCoreWindow * core) void wCoreDestroy(WCoreWindow * core)
{ {
if (core->stacking) { if (core->stacking)
wfree(core->stacking); wfree(core->stacking);
}
XDeleteContext(dpy, core->window, wWinContext); XDeleteContext(dpy, core->window, wWinContext);
XDestroyWindow(dpy, core->window); XDestroyWindow(dpy, core->window);
wfree(core); wfree(core);
@@ -152,6 +142,7 @@ void wCoreConfigure(WCoreWindow * core, int req_x, int req_y, int req_w, int req
if (req_w <= 0) if (req_w <= 0)
req_w = core->width; req_w = core->width;
if (req_h <= 0) if (req_h <= 0)
req_h = core->height; req_h = core->height;

View File

@@ -41,16 +41,14 @@ typedef struct _WCoreWindow {
WStacking *stacking; /* window stacking information */ WStacking *stacking; /* window stacking information */
} WCoreWindow; } WCoreWindow;
WCoreWindow *wCoreCreateTopLevel(WScreen *screen, int x, int y, int width, WCoreWindow *wCoreCreateTopLevel(WScreen *screen, int x, int y, int width,
int height, int bwidth, int height, int bwidth,
int depth, Visual *visual, Colormap colormap); int depth, Visual *visual, Colormap colormap);
WCoreWindow *wCoreCreate(WCoreWindow *parent, int x, int y, WCoreWindow *wCoreCreate(WCoreWindow *parent, int x, int y,
int width, int height); int width, int height);
void wCoreDestroy(WCoreWindow *core); void wCoreDestroy(WCoreWindow *core);
void wCoreConfigure(WCoreWindow *core, int req_x, int req_y, void wCoreConfigure(WCoreWindow *core, int req_x, int req_y,
int req_w, int req_h); int req_w, int req_h);
#endif #endif