mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 12:58:08 +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 <X11/Xlib.h>
|
||||
#include "wraster.h"
|
||||
#include <stdlib.h>
|
||||
@@ -12,59 +11,56 @@ RContext *ctx;
|
||||
RImage *img;
|
||||
Pixmap pix;
|
||||
|
||||
|
||||
#define MAX(a,b) (a)>(b) ? (a) : (b)
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
RContextAttributes attr;
|
||||
float a;
|
||||
RContextAttributes attr;
|
||||
float a;
|
||||
|
||||
dpy = XOpenDisplay("");
|
||||
if (!dpy) {
|
||||
puts("cant open display");
|
||||
exit(1);
|
||||
}
|
||||
dpy = XOpenDisplay("");
|
||||
if (!dpy) {
|
||||
puts("cant open display");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
attr.flags = RC_RenderMode | RC_ColorsPerChannel;
|
||||
attr.render_mode = RDitheredRendering;
|
||||
attr.colors_per_channel = 4;
|
||||
ctx = RCreateContext(dpy, DefaultScreen(dpy), &attr);
|
||||
attr.flags = RC_RenderMode | RC_ColorsPerChannel;
|
||||
attr.render_mode = RDitheredRendering;
|
||||
attr.colors_per_channel = 4;
|
||||
ctx = RCreateContext(dpy, DefaultScreen(dpy), &attr);
|
||||
|
||||
if (argc<2)
|
||||
img = RGetImageFromXPMData(ctx, image_name);
|
||||
else
|
||||
img = RLoadImage(ctx, argv[1], 0);
|
||||
if (argc < 2)
|
||||
img = RGetImageFromXPMData(ctx, image_name);
|
||||
else
|
||||
img = RLoadImage(ctx, argv[1], 0);
|
||||
|
||||
if (!img) {
|
||||
puts(RMessageForError(RErrorCode));
|
||||
exit(1);
|
||||
}
|
||||
win = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 10, 10,
|
||||
MAX(img->width, img->height),
|
||||
MAX(img->height, img->width), 0, 0, 0);
|
||||
XMapRaised(dpy, win);
|
||||
XFlush(dpy);
|
||||
if (!img) {
|
||||
puts(RMessageForError(RErrorCode));
|
||||
exit(1);
|
||||
}
|
||||
win = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 10, 10,
|
||||
MAX(img->width, img->height), MAX(img->height, img->width), 0, 0, 0);
|
||||
XMapRaised(dpy, win);
|
||||
XFlush(dpy);
|
||||
|
||||
a = 0;
|
||||
while (1) {
|
||||
RImage *tmp;
|
||||
a = 0;
|
||||
while (1) {
|
||||
RImage *tmp;
|
||||
|
||||
a = a + 1.0;
|
||||
a = a + 1.0;
|
||||
|
||||
tmp = RRotateImage(img, a);
|
||||
if (!RConvertImage(ctx, tmp, &pix)) {
|
||||
puts(RMessageForError(RErrorCode));
|
||||
exit(1);
|
||||
}
|
||||
RReleaseImage(tmp);
|
||||
tmp = RRotateImage(img, a);
|
||||
if (!RConvertImage(ctx, tmp, &pix)) {
|
||||
puts(RMessageForError(RErrorCode));
|
||||
exit(1);
|
||||
}
|
||||
RReleaseImage(tmp);
|
||||
|
||||
XSetWindowBackgroundPixmap(dpy, win, pix);
|
||||
XFreePixmap(dpy, pix);
|
||||
XClearWindow(dpy, win);
|
||||
XSync(dpy, 0);
|
||||
usleep(50000);
|
||||
}
|
||||
exit(0);
|
||||
XSetWindowBackgroundPixmap(dpy, win, pix);
|
||||
XFreePixmap(dpy, pix);
|
||||
XClearWindow(dpy, win);
|
||||
XSync(dpy, 0);
|
||||
usleep(50000);
|
||||
}
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user