mirror of
https://github.com/gryf/wmaker.git
synced 2026-02-08 01:15:56 +01:00
Change to the linux kernel coding style
for arq in `git ls-files *.c`; do
echo $arq;
indent -linux -l115 $arq;
done
The different line break at 115 columns is because
I use a widescreen monitor :-)
This commit is contained in:
174
src/wcore.c
174
src/wcore.c
@@ -30,7 +30,6 @@
|
||||
#include "WindowMaker.h"
|
||||
#include "wcore.h"
|
||||
|
||||
|
||||
/****** Global Variables ******/
|
||||
extern WPreferences wPreferences;
|
||||
|
||||
@@ -39,7 +38,6 @@ extern Cursor wCursor[WCUR_LAST];
|
||||
|
||||
extern XContext wWinContext;
|
||||
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
* wCoreCreateTopLevel--
|
||||
@@ -49,50 +47,45 @@ extern XContext wWinContext;
|
||||
* The created window.
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
WCoreWindow*
|
||||
wCoreCreateTopLevel(WScreen *screen, int x, int y, int width, int height,
|
||||
int bwidth)
|
||||
WCoreWindow *wCoreCreateTopLevel(WScreen * screen, int x, int y, int width, int height, int bwidth)
|
||||
{
|
||||
WCoreWindow *core;
|
||||
int vmask;
|
||||
XSetWindowAttributes attribs;
|
||||
WCoreWindow *core;
|
||||
int vmask;
|
||||
XSetWindowAttributes attribs;
|
||||
|
||||
core = wmalloc(sizeof(WCoreWindow));
|
||||
memset(core, 0, sizeof(WCoreWindow));
|
||||
core = wmalloc(sizeof(WCoreWindow));
|
||||
memset(core, 0, sizeof(WCoreWindow));
|
||||
|
||||
/* don't set CWBackPixel so that transparent XRender windows
|
||||
are see-through */
|
||||
vmask = /*CWBackPixmap|CWBackPixel|*/CWBorderPixel|CWCursor|CWEventMask
|
||||
|CWOverrideRedirect;
|
||||
attribs.override_redirect = True;
|
||||
attribs.cursor = wCursor[WCUR_DEFAULT];
|
||||
attribs.background_pixmap = None;
|
||||
attribs.background_pixel = screen->black_pixel;
|
||||
attribs.border_pixel = screen->frame_border_pixel;
|
||||
attribs.event_mask = SubstructureRedirectMask | ButtonPressMask
|
||||
| ButtonReleaseMask | ButtonMotionMask | ExposureMask | EnterWindowMask
|
||||
| LeaveWindowMask;
|
||||
/* don't set CWBackPixel so that transparent XRender windows
|
||||
are see-through */
|
||||
vmask = /*CWBackPixmap|CWBackPixel| */ CWBorderPixel | CWCursor | CWEventMask
|
||||
| CWOverrideRedirect;
|
||||
attribs.override_redirect = True;
|
||||
attribs.cursor = wCursor[WCUR_DEFAULT];
|
||||
attribs.background_pixmap = None;
|
||||
attribs.background_pixel = screen->black_pixel;
|
||||
attribs.border_pixel = screen->frame_border_pixel;
|
||||
attribs.event_mask = SubstructureRedirectMask | ButtonPressMask
|
||||
| ButtonReleaseMask | ButtonMotionMask | ExposureMask | EnterWindowMask | LeaveWindowMask;
|
||||
|
||||
vmask |= CWColormap;
|
||||
attribs.colormap = screen->w_colormap;
|
||||
vmask |= CWColormap;
|
||||
attribs.colormap = screen->w_colormap;
|
||||
|
||||
core->window = XCreateWindow(dpy, screen->root_win, x, y, width, height,
|
||||
bwidth, screen->w_depth, CopyFromParent,
|
||||
screen->w_visual, vmask, &attribs);
|
||||
core->width = width;
|
||||
core->height = height;
|
||||
core->screen_ptr = screen;
|
||||
core->window = XCreateWindow(dpy, screen->root_win, x, y, width, height,
|
||||
bwidth, screen->w_depth, CopyFromParent, screen->w_visual, vmask, &attribs);
|
||||
core->width = width;
|
||||
core->height = height;
|
||||
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--
|
||||
@@ -110,78 +103,69 @@ wCoreCreateTopLevel(WScreen *screen, int x, int y, int width, int height,
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
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;
|
||||
int vmask;
|
||||
XSetWindowAttributes attribs;
|
||||
WCoreWindow *core;
|
||||
int vmask;
|
||||
XSetWindowAttributes attribs;
|
||||
|
||||
core=wmalloc(sizeof(WCoreWindow));
|
||||
memset(core, 0, sizeof(WCoreWindow));
|
||||
core = wmalloc(sizeof(WCoreWindow));
|
||||
memset(core, 0, sizeof(WCoreWindow));
|
||||
|
||||
vmask = /*CWBackPixmap|CWBackPixel|*/CWBorderPixel|CWCursor|CWEventMask;
|
||||
attribs.cursor = wCursor[WCUR_DEFAULT];
|
||||
attribs.background_pixmap = None;
|
||||
attribs.background_pixel = parent->screen_ptr->black_pixel;
|
||||
attribs.event_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask
|
||||
| ButtonReleaseMask | ButtonMotionMask | ExposureMask | EnterWindowMask
|
||||
| LeaveWindowMask;
|
||||
/*
|
||||
vmask |= CWColormap;
|
||||
attribs.colormap = parent->screen_ptr->w_colormap;
|
||||
*/
|
||||
core->window =
|
||||
XCreateWindow(dpy, parent->window, x, y, width, height, 0,
|
||||
parent->screen_ptr->w_depth, CopyFromParent,
|
||||
parent->screen_ptr->w_visual, vmask, &attribs);
|
||||
core->width=width;
|
||||
core->height=height;
|
||||
core->screen_ptr = parent->screen_ptr;
|
||||
vmask = /*CWBackPixmap|CWBackPixel| */ CWBorderPixel | CWCursor | CWEventMask;
|
||||
attribs.cursor = wCursor[WCUR_DEFAULT];
|
||||
attribs.background_pixmap = None;
|
||||
attribs.background_pixel = parent->screen_ptr->black_pixel;
|
||||
attribs.event_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask
|
||||
| ButtonReleaseMask | ButtonMotionMask | ExposureMask | EnterWindowMask | LeaveWindowMask;
|
||||
/*
|
||||
vmask |= CWColormap;
|
||||
attribs.colormap = parent->screen_ptr->w_colormap;
|
||||
*/
|
||||
core->window =
|
||||
XCreateWindow(dpy, parent->window, x, y, width, height, 0,
|
||||
parent->screen_ptr->w_depth, CopyFromParent,
|
||||
parent->screen_ptr->w_visual, vmask, &attribs);
|
||||
core->width = width;
|
||||
core->height = height;
|
||||
core->screen_ptr = parent->screen_ptr;
|
||||
|
||||
core->descriptor.self = core;
|
||||
core->descriptor.self = core;
|
||||
|
||||
XSaveContext(dpy, core->window, wWinContext, (XPointer)&core->descriptor);
|
||||
return core;
|
||||
XSaveContext(dpy, core->window, wWinContext, (XPointer) & core->descriptor);
|
||||
return core;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
wCoreDestroy(WCoreWindow *core)
|
||||
void wCoreDestroy(WCoreWindow * core)
|
||||
{
|
||||
if (core->stacking) {
|
||||
wfree(core->stacking);
|
||||
}
|
||||
XDeleteContext(dpy, core->window, wWinContext);
|
||||
XDestroyWindow(dpy, core->window);
|
||||
wfree(core);
|
||||
if (core->stacking) {
|
||||
wfree(core->stacking);
|
||||
}
|
||||
XDeleteContext(dpy, core->window, wWinContext);
|
||||
XDestroyWindow(dpy, core->window);
|
||||
wfree(core);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
wCoreConfigure(WCoreWindow *core, int req_x, int req_y, int req_w, int req_h)
|
||||
void wCoreConfigure(WCoreWindow * core, int req_x, int req_y, int req_w, int req_h)
|
||||
{
|
||||
XWindowChanges xwc;
|
||||
unsigned int mask;
|
||||
XWindowChanges xwc;
|
||||
unsigned int mask;
|
||||
|
||||
mask = CWX|CWY;
|
||||
xwc.x = req_x;
|
||||
xwc.y = req_y;
|
||||
mask = CWX | CWY;
|
||||
xwc.x = req_x;
|
||||
xwc.y = req_y;
|
||||
|
||||
if (req_w <= 0)
|
||||
req_w = core->width;
|
||||
if (req_h <= 0)
|
||||
req_h = core->height;
|
||||
if (req_w <= 0)
|
||||
req_w = core->width;
|
||||
if (req_h <= 0)
|
||||
req_h = core->height;
|
||||
|
||||
if (req_w != core->width || req_h != core->height) {
|
||||
mask |= CWWidth | CWHeight;
|
||||
xwc.width = req_w;
|
||||
xwc.height = req_h;
|
||||
core->width = req_w;
|
||||
core->height = req_h;
|
||||
}
|
||||
XConfigureWindow(dpy, core->window, mask, &xwc);
|
||||
if (req_w != core->width || req_h != core->height) {
|
||||
mask |= CWWidth | CWHeight;
|
||||
xwc.width = req_w;
|
||||
xwc.height = req_h;
|
||||
core->width = req_w;
|
||||
core->height = req_h;
|
||||
}
|
||||
XConfigureWindow(dpy, core->window, mask, &xwc);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user