mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-24 07:02:30 +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:
@@ -19,88 +19,80 @@
|
||||
* USA.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <WINGs/WINGs.h>
|
||||
#include <WINGs/WUtil.h>
|
||||
|
||||
void
|
||||
wAbort()
|
||||
void wAbort()
|
||||
{
|
||||
exit(0);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
void show(WMWidget *self, void *data)
|
||||
void show(WMWidget * self, void *data)
|
||||
{
|
||||
char buf[60];
|
||||
void *d;
|
||||
WMLabel *l = (WMLabel*)data;
|
||||
d = WMGetHangedData(self);
|
||||
sprintf(buf, "%i - 0x%x - 0%o", (int)(uintptr_t)d, (int)(uintptr_t)d,
|
||||
(int)(uintptr_t)d);
|
||||
WMSetLabelText(l, buf);
|
||||
char buf[60];
|
||||
void *d;
|
||||
WMLabel *l = (WMLabel *) data;
|
||||
d = WMGetHangedData(self);
|
||||
sprintf(buf, "%i - 0x%x - 0%o", (int)(uintptr_t) d, (int)(uintptr_t) d, (int)(uintptr_t) d);
|
||||
WMSetLabelText(l, buf);
|
||||
}
|
||||
|
||||
void quit(WMWidget *self, void *data)
|
||||
void quit(WMWidget * self, void *data)
|
||||
{
|
||||
exit(0);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
Display *dpy;
|
||||
WMWindow *win;
|
||||
WMScreen *scr;
|
||||
WMButton *lab, *l0=NULL;
|
||||
WMLabel *pos;
|
||||
int x, y, c;
|
||||
char buf[20];
|
||||
Display *dpy;
|
||||
WMWindow *win;
|
||||
WMScreen *scr;
|
||||
WMButton *lab, *l0 = NULL;
|
||||
WMLabel *pos;
|
||||
int x, y, c;
|
||||
char buf[20];
|
||||
|
||||
WMInitializeApplication("FontView", &argc, argv);
|
||||
WMInitializeApplication("FontView", &argc, argv);
|
||||
|
||||
dpy = XOpenDisplay("");
|
||||
if (!dpy) {
|
||||
wfatal("cant open display");
|
||||
exit(0);
|
||||
}
|
||||
dpy = XOpenDisplay("");
|
||||
if (!dpy) {
|
||||
wfatal("cant open display");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
scr = WMCreateSimpleApplicationScreen(dpy);
|
||||
scr = WMCreateSimpleApplicationScreen(dpy);
|
||||
|
||||
win = WMCreateWindow(scr, "main");
|
||||
WMResizeWidget(win, 20*33, 20+20*9);
|
||||
WMSetWindowTitle(win, "Font Chars");
|
||||
WMSetWindowCloseAction(win, quit, NULL);
|
||||
pos = WMCreateLabel(win);
|
||||
WMResizeWidget(pos, 20*33, 20);
|
||||
WMMoveWidget(pos, 10, 5);
|
||||
win = WMCreateWindow(scr, "main");
|
||||
WMResizeWidget(win, 20 * 33, 20 + 20 * 9);
|
||||
WMSetWindowTitle(win, "Font Chars");
|
||||
WMSetWindowCloseAction(win, quit, NULL);
|
||||
pos = WMCreateLabel(win);
|
||||
WMResizeWidget(pos, 20 * 33, 20);
|
||||
WMMoveWidget(pos, 10, 5);
|
||||
|
||||
c = 0;
|
||||
for (y=0; y<8; y++) {
|
||||
for (x=0; x<32; x++, c++) {
|
||||
lab = WMCreateCustomButton(win, WBBStateLightMask);
|
||||
WMResizeWidget(lab, 20, 20);
|
||||
WMMoveWidget(lab, 10+x*20, 30+y*20);
|
||||
sprintf(buf, "%c", c);
|
||||
WMSetButtonText(lab, buf);
|
||||
WMSetButtonAction(lab, show, pos);
|
||||
WMHangData(lab, (void*)(uintptr_t)c);
|
||||
if (c>0) {
|
||||
WMGroupButtons(l0, lab);
|
||||
} else {
|
||||
l0 = lab;
|
||||
}
|
||||
}
|
||||
}
|
||||
WMRealizeWidget(win);
|
||||
WMMapSubwidgets(win);
|
||||
WMMapWidget(win);
|
||||
WMScreenMainLoop(scr);
|
||||
return 0;
|
||||
c = 0;
|
||||
for (y = 0; y < 8; y++) {
|
||||
for (x = 0; x < 32; x++, c++) {
|
||||
lab = WMCreateCustomButton(win, WBBStateLightMask);
|
||||
WMResizeWidget(lab, 20, 20);
|
||||
WMMoveWidget(lab, 10 + x * 20, 30 + y * 20);
|
||||
sprintf(buf, "%c", c);
|
||||
WMSetButtonText(lab, buf);
|
||||
WMSetButtonAction(lab, show, pos);
|
||||
WMHangData(lab, (void *)(uintptr_t) c);
|
||||
if (c > 0) {
|
||||
WMGroupButtons(l0, lab);
|
||||
} else {
|
||||
l0 = lab;
|
||||
}
|
||||
}
|
||||
}
|
||||
WMRealizeWidget(win);
|
||||
WMMapSubwidgets(win);
|
||||
WMMapWidget(win);
|
||||
WMScreenMainLoop(scr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user