mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-30 18:32:34 +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:
@@ -1,5 +1,4 @@
|
||||
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#include "WINGsP.h"
|
||||
@@ -8,166 +7,143 @@
|
||||
|
||||
#include "GNUstep.h"
|
||||
|
||||
|
||||
|
||||
extern struct W_Application WMApplication;
|
||||
|
||||
|
||||
void
|
||||
WMSetApplicationIconWindow(WMScreen *scr, Window window)
|
||||
void WMSetApplicationIconWindow(WMScreen * scr, Window window)
|
||||
{
|
||||
scr->applicationIconWindow = window;
|
||||
scr->applicationIconWindow = window;
|
||||
|
||||
if (scr->groupLeader) {
|
||||
XWMHints *hints;
|
||||
if (scr->groupLeader) {
|
||||
XWMHints *hints;
|
||||
|
||||
hints = XGetWMHints(scr->display, scr->groupLeader);
|
||||
hints->flags |= IconWindowHint;
|
||||
hints->icon_window = window;
|
||||
hints = XGetWMHints(scr->display, scr->groupLeader);
|
||||
hints->flags |= IconWindowHint;
|
||||
hints->icon_window = window;
|
||||
|
||||
XSetWMHints(scr->display, scr->groupLeader, hints);
|
||||
XFree(hints);
|
||||
}
|
||||
XSetWMHints(scr->display, scr->groupLeader, hints);
|
||||
XFree(hints);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
WMSetApplicationIconImage(WMScreen *scr, RImage *image)
|
||||
void WMSetApplicationIconImage(WMScreen * scr, RImage * image)
|
||||
{
|
||||
WMPixmap *icon;
|
||||
WMPixmap *icon;
|
||||
|
||||
if (scr->applicationIconImage == image)
|
||||
return;
|
||||
if (scr->applicationIconImage == image)
|
||||
return;
|
||||
|
||||
if (scr->applicationIconImage)
|
||||
RReleaseImage(scr->applicationIconImage);
|
||||
if (scr->applicationIconImage)
|
||||
RReleaseImage(scr->applicationIconImage);
|
||||
|
||||
scr->applicationIconImage = RRetainImage(image);
|
||||
scr->applicationIconImage = RRetainImage(image);
|
||||
|
||||
/* TODO: check whether we should set the pixmap only if there's none yet */
|
||||
if (image!=NULL && (icon=WMCreatePixmapFromRImage(scr, image, 128))!=NULL) {
|
||||
WMSetApplicationIconPixmap(scr, icon);
|
||||
WMReleasePixmap(icon);
|
||||
}
|
||||
/* TODO: check whether we should set the pixmap only if there's none yet */
|
||||
if (image != NULL && (icon = WMCreatePixmapFromRImage(scr, image, 128)) != NULL) {
|
||||
WMSetApplicationIconPixmap(scr, icon);
|
||||
WMReleasePixmap(icon);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
RImage*
|
||||
WMGetApplicationIconImage(WMScreen *scr)
|
||||
RImage *WMGetApplicationIconImage(WMScreen * scr)
|
||||
{
|
||||
return scr->applicationIconImage;
|
||||
return scr->applicationIconImage;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
WMSetApplicationIconPixmap(WMScreen *scr, WMPixmap *icon)
|
||||
void WMSetApplicationIconPixmap(WMScreen * scr, WMPixmap * icon)
|
||||
{
|
||||
if (scr->applicationIconPixmap == icon)
|
||||
return;
|
||||
if (scr->applicationIconPixmap == icon)
|
||||
return;
|
||||
|
||||
if (scr->applicationIconPixmap)
|
||||
WMReleasePixmap(scr->applicationIconPixmap);
|
||||
if (scr->applicationIconPixmap)
|
||||
WMReleasePixmap(scr->applicationIconPixmap);
|
||||
|
||||
scr->applicationIconPixmap = WMRetainPixmap(icon);
|
||||
scr->applicationIconPixmap = WMRetainPixmap(icon);
|
||||
|
||||
if (scr->groupLeader) {
|
||||
XWMHints *hints;
|
||||
if (scr->groupLeader) {
|
||||
XWMHints *hints;
|
||||
|
||||
hints = XGetWMHints(scr->display, scr->groupLeader);
|
||||
hints->flags |= IconPixmapHint|IconMaskHint;
|
||||
hints->icon_pixmap = (icon!=NULL ? icon->pixmap : None);
|
||||
hints->icon_mask = (icon!=NULL ? icon->mask : None);
|
||||
hints = XGetWMHints(scr->display, scr->groupLeader);
|
||||
hints->flags |= IconPixmapHint | IconMaskHint;
|
||||
hints->icon_pixmap = (icon != NULL ? icon->pixmap : None);
|
||||
hints->icon_mask = (icon != NULL ? icon->mask : None);
|
||||
|
||||
XSetWMHints(scr->display, scr->groupLeader, hints);
|
||||
XFree(hints);
|
||||
}
|
||||
XSetWMHints(scr->display, scr->groupLeader, hints);
|
||||
XFree(hints);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
WMPixmap*
|
||||
WMGetApplicationIconPixmap(WMScreen *scr)
|
||||
WMPixmap *WMGetApplicationIconPixmap(WMScreen * scr)
|
||||
{
|
||||
return scr->applicationIconPixmap;
|
||||
return scr->applicationIconPixmap;
|
||||
}
|
||||
|
||||
|
||||
WMPixmap*
|
||||
WMCreateApplicationIconBlendedPixmap(WMScreen *scr, RColor *color)
|
||||
WMPixmap *WMCreateApplicationIconBlendedPixmap(WMScreen * scr, RColor * color)
|
||||
{
|
||||
WMPixmap *pix;
|
||||
WMPixmap *pix;
|
||||
|
||||
if (scr->applicationIconImage) {
|
||||
RColor gray;
|
||||
if (scr->applicationIconImage) {
|
||||
RColor gray;
|
||||
|
||||
gray.red = 0xae;
|
||||
gray.green = 0xaa;
|
||||
gray.blue = 0xae;
|
||||
gray.alpha = 0xff;
|
||||
gray.red = 0xae;
|
||||
gray.green = 0xaa;
|
||||
gray.blue = 0xae;
|
||||
gray.alpha = 0xff;
|
||||
|
||||
if (!color)
|
||||
color = &gray;
|
||||
if (!color)
|
||||
color = &gray;
|
||||
|
||||
pix = WMCreateBlendedPixmapFromRImage(scr, scr->applicationIconImage,
|
||||
color);
|
||||
} else {
|
||||
pix = NULL;
|
||||
}
|
||||
pix = WMCreateBlendedPixmapFromRImage(scr, scr->applicationIconImage, color);
|
||||
} else {
|
||||
pix = NULL;
|
||||
}
|
||||
|
||||
return pix;
|
||||
return pix;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
WMSetApplicationHasAppIcon(WMScreen *scr, Bool flag)
|
||||
void WMSetApplicationHasAppIcon(WMScreen * scr, Bool flag)
|
||||
{
|
||||
scr->aflags.hasAppIcon = ((flag==0) ? 0 : 1);
|
||||
scr->aflags.hasAppIcon = ((flag == 0) ? 0 : 1);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
W_InitApplication(WMScreen *scr)
|
||||
void W_InitApplication(WMScreen * scr)
|
||||
{
|
||||
Window leader;
|
||||
XClassHint *classHint;
|
||||
XWMHints *hints;
|
||||
Window leader;
|
||||
XClassHint *classHint;
|
||||
XWMHints *hints;
|
||||
|
||||
leader = XCreateSimpleWindow(scr->display, scr->rootWin, -1, -1,
|
||||
1, 1, 0, 0, 0);
|
||||
leader = XCreateSimpleWindow(scr->display, scr->rootWin, -1, -1, 1, 1, 0, 0, 0);
|
||||
|
||||
if (!scr->aflags.simpleApplication) {
|
||||
classHint = XAllocClassHint();
|
||||
classHint->res_name = "groupLeader";
|
||||
classHint->res_class = WMApplication.applicationName;
|
||||
XSetClassHint(scr->display, leader, classHint);
|
||||
XFree(classHint);
|
||||
if (!scr->aflags.simpleApplication) {
|
||||
classHint = XAllocClassHint();
|
||||
classHint->res_name = "groupLeader";
|
||||
classHint->res_class = WMApplication.applicationName;
|
||||
XSetClassHint(scr->display, leader, classHint);
|
||||
XFree(classHint);
|
||||
|
||||
XSetCommand(scr->display, leader, WMApplication.argv,
|
||||
WMApplication.argc);
|
||||
XSetCommand(scr->display, leader, WMApplication.argv, WMApplication.argc);
|
||||
|
||||
hints = XAllocWMHints();
|
||||
hints = XAllocWMHints();
|
||||
|
||||
hints->flags = WindowGroupHint;
|
||||
hints->window_group = leader;
|
||||
hints->flags = WindowGroupHint;
|
||||
hints->window_group = leader;
|
||||
|
||||
/* This code will never actually be reached, because to have
|
||||
* scr->applicationIconPixmap set we need to have a screen first,
|
||||
* but this function is called in the screen creation process.
|
||||
* -Dan
|
||||
*/
|
||||
if (scr->applicationIconPixmap) {
|
||||
hints->flags |= IconPixmapHint;
|
||||
hints->icon_pixmap = scr->applicationIconPixmap->pixmap;
|
||||
if (scr->applicationIconPixmap->mask) {
|
||||
hints->flags |= IconMaskHint;
|
||||
hints->icon_mask = scr->applicationIconPixmap->mask;
|
||||
}
|
||||
}
|
||||
/* This code will never actually be reached, because to have
|
||||
* scr->applicationIconPixmap set we need to have a screen first,
|
||||
* but this function is called in the screen creation process.
|
||||
* -Dan
|
||||
*/
|
||||
if (scr->applicationIconPixmap) {
|
||||
hints->flags |= IconPixmapHint;
|
||||
hints->icon_pixmap = scr->applicationIconPixmap->pixmap;
|
||||
if (scr->applicationIconPixmap->mask) {
|
||||
hints->flags |= IconMaskHint;
|
||||
hints->icon_mask = scr->applicationIconPixmap->mask;
|
||||
}
|
||||
}
|
||||
|
||||
XSetWMHints(scr->display, leader, hints);
|
||||
XSetWMHints(scr->display, leader, hints);
|
||||
|
||||
XFree(hints);
|
||||
}
|
||||
scr->groupLeader = leader;
|
||||
XFree(hints);
|
||||
}
|
||||
scr->groupLeader = leader;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user