mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-15 08:02:34 -05:00
Extensive code policing (indentation levels, tab characters).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6199 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
f89087df4b
commit
31b28f523a
4 changed files with 302 additions and 310 deletions
|
|
@ -172,7 +172,8 @@ static int get_raw_button (void)
|
|||
/* return a release event */
|
||||
button_state &= ~k;
|
||||
k |= BUTTON_REL;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
if(k) {
|
||||
button_state |= k;
|
||||
k = button_state;
|
||||
|
|
|
|||
|
|
@ -299,32 +299,31 @@ int screenhack_handle_event(Display *dpy, XEvent *event,
|
|||
}
|
||||
break;
|
||||
case Expose:
|
||||
{
|
||||
screen_redraw();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
case ClientMessage:
|
||||
{
|
||||
if (event->xclient.message_type != XA_WM_PROTOCOLS) {
|
||||
char *s = XGetAtomName(dpy, event->xclient.message_type);
|
||||
if (!s) s = "(null)";
|
||||
if (!s)
|
||||
s = "(null)";
|
||||
fprintf (stderr, "%s: unknown ClientMessage %s received!\n",
|
||||
progname, s);
|
||||
}
|
||||
else if (event->xclient.data.l[0] != (int)XA_WM_DELETE_WINDOW) {
|
||||
char *s1 = XGetAtomName(dpy, event->xclient.message_type);
|
||||
char *s2 = XGetAtomName(dpy, event->xclient.data.l[0]);
|
||||
if (!s1) s1 = "(null)";
|
||||
if (!s2) s2 = "(null)";
|
||||
if (!s1)
|
||||
s1 = "(null)";
|
||||
if (!s2)
|
||||
s2 = "(null)";
|
||||
fprintf (stderr, "%s: unknown ClientMessage %s[%s] received!\n",
|
||||
progname, s1, s2);
|
||||
}
|
||||
else {
|
||||
exit (0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return key;
|
||||
|
|
@ -344,8 +343,7 @@ int screenhack_handle_events(bool *release, bool *repeat)
|
|||
}
|
||||
|
||||
|
||||
static Visual *
|
||||
pick_visual (Screen *screen)
|
||||
static Visual *pick_visual (Screen *screen)
|
||||
{
|
||||
#ifdef USE_GL
|
||||
/* If we're linking against GL (that is, this is the version of
|
||||
|
|
@ -444,13 +442,13 @@ int main (int argc, char **argv)
|
|||
snprintf(geometry, 40, "*geometry: %dx%d",
|
||||
LCD_WIDTH*display_zoom+14, LCD_HEIGHT*display_zoom+8);
|
||||
#else
|
||||
snprintf(geometry, 40, "*geometry: %dx%d", 280*display_zoom, 132*display_zoom);
|
||||
snprintf(geometry, 40, "*geometry: %dx%d", 280*display_zoom,
|
||||
132*display_zoom);
|
||||
#endif
|
||||
default_defaults[GEOMETRY_POSITION]=geometry;
|
||||
}
|
||||
printf(KEYBOARD_GENERIC KEYBOARD_SPECIFIC);
|
||||
|
||||
|
||||
merge_options ();
|
||||
|
||||
#ifdef __sgi
|
||||
|
|
|
|||
|
|
@ -84,8 +84,7 @@ void init_window ()
|
|||
cmap = xgwa.colormap;
|
||||
|
||||
gcv.function = GXxor;
|
||||
gcv.foreground =
|
||||
get_pixel_resource ("foreground", "Foreground", dpy, cmap);
|
||||
gcv.foreground = get_pixel_resource("foreground", "Foreground", dpy, cmap);
|
||||
draw_gc = XCreateGC (dpy, window, GCForeground, &gcv);
|
||||
|
||||
screen_resized(LCD_WIDTH, LCD_HEIGHT);
|
||||
|
|
@ -97,40 +96,38 @@ void screen_resized(int width, int height)
|
|||
maxx = width;
|
||||
maxy = height;
|
||||
|
||||
XSetForeground (dpy, draw_gc, get_pixel_resource ("background", "Background",
|
||||
dpy, cmap));
|
||||
XFillRectangle(dpy, window, draw_gc, 0, 0, width*display_zoom, height*display_zoom);
|
||||
XSetForeground(dpy, draw_gc,
|
||||
get_pixel_resource("background", "Background", dpy, cmap));
|
||||
XFillRectangle(dpy, window, draw_gc, 0, 0, width*display_zoom,
|
||||
height*display_zoom);
|
||||
lcd_display_redraw=true;
|
||||
screen_redraw();
|
||||
}
|
||||
|
||||
void drawrect(int color, int x1, int y1, int x2, int y2)
|
||||
{
|
||||
if (color==0) {
|
||||
if (color==0)
|
||||
XSetForeground(dpy, draw_gc,
|
||||
get_pixel_resource("background", "Background", dpy, cmap));
|
||||
}
|
||||
else
|
||||
XSetForeground(dpy, draw_gc,
|
||||
get_pixel_resource("foreground", "Foreground", dpy, cmap));
|
||||
|
||||
XFillRectangle(dpy, window, draw_gc, x1*display_zoom, y1*display_zoom,
|
||||
x2*display_zoom, y2*display_zoom);
|
||||
|
||||
}
|
||||
|
||||
static void help(void)
|
||||
{
|
||||
printf(PROGNAME " " ROCKBOXUI_VERSION " " __DATE__ "\n"
|
||||
"usage: " PROGNAME "\n"
|
||||
);
|
||||
"usage: " PROGNAME "\n");
|
||||
}
|
||||
|
||||
void drawline(int color, int x1, int y1, int x2, int y2)
|
||||
{
|
||||
if (color==0) {
|
||||
if (color==0)
|
||||
XSetForeground(dpy, draw_gc,
|
||||
get_pixel_resource("background", "Background", dpy, cmap));
|
||||
}
|
||||
else
|
||||
XSetForeground(dpy, draw_gc,
|
||||
get_pixel_resource("foreground", "Foreground", dpy, cmap));
|
||||
|
|
@ -144,10 +141,9 @@ void drawline(int color, int x1, int y1, int x2, int y2)
|
|||
|
||||
void drawdot(int color, int x, int y)
|
||||
{
|
||||
if (color==0) {
|
||||
if (color==0)
|
||||
XSetForeground(dpy, draw_gc,
|
||||
get_pixel_resource("background", "Background", dpy, cmap));
|
||||
}
|
||||
else
|
||||
XSetForeground(dpy, draw_gc,
|
||||
get_pixel_resource("foreground", "Foreground", dpy, cmap));
|
||||
|
|
@ -158,10 +154,9 @@ void drawdot(int color, int x, int y)
|
|||
|
||||
void drawdots(int color, struct coordinate *points, int count)
|
||||
{
|
||||
if (color==0) {
|
||||
if (color==0)
|
||||
XSetForeground(dpy, draw_gc,
|
||||
get_pixel_resource("background", "Background", dpy, cmap));
|
||||
}
|
||||
else
|
||||
XSetForeground(dpy, draw_gc,
|
||||
get_pixel_resource("foreground", "Foreground", dpy, cmap));
|
||||
|
|
@ -177,10 +172,9 @@ void drawdots(int color, struct coordinate *points, int count)
|
|||
|
||||
void drawrectangles(int color, struct rectangle *points, int count)
|
||||
{
|
||||
if (color==0) {
|
||||
if (color==0)
|
||||
XSetForeground(dpy, draw_gc,
|
||||
get_pixel_resource("background", "Background", dpy, cmap));
|
||||
}
|
||||
else
|
||||
XSetForeground(dpy, draw_gc,
|
||||
get_pixel_resource("foreground", "Foreground", dpy, cmap));
|
||||
|
|
@ -191,21 +185,20 @@ void drawrectangles(int color, struct rectangle *points, int count)
|
|||
points[count].y*display_zoom,
|
||||
points[count].width*display_zoom,
|
||||
points[count].height*display_zoom);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void drawtext(int color, int x, int y, char *text)
|
||||
{
|
||||
if (color==0) {
|
||||
if (color==0)
|
||||
XSetForeground(dpy, draw_gc,
|
||||
get_pixel_resource("background", "Background", dpy, cmap));
|
||||
}
|
||||
else
|
||||
XSetForeground(dpy, draw_gc,
|
||||
get_pixel_resource("foreground", "Foreground", dpy, cmap));
|
||||
|
||||
XDrawString(dpy, window, draw_gc, x*display_zoom, y*display_zoom, text, strlen(text));
|
||||
XDrawString(dpy, window, draw_gc, x*display_zoom, y*display_zoom, text,
|
||||
strlen(text));
|
||||
}
|
||||
|
||||
/* this is where the applicaton starts */
|
||||
|
|
@ -218,9 +211,9 @@ screenhack (Display *the_dpy, Window the_window)
|
|||
|
||||
/* This doesn't work, but I don't know why (Daniel 1999-12-01) */
|
||||
helpme = get_boolean_resource ("help", "Boolean");
|
||||
if(helpme) {
|
||||
if(helpme)
|
||||
help();
|
||||
}
|
||||
|
||||
printf(PROGNAME " " ROCKBOXUI_VERSION " (" __DATE__ ")\n");
|
||||
|
||||
dpy=the_dpy;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue