mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-15 08:02:34 -05:00
warning hunt and kill session
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1000 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
7a8d95d8ff
commit
ed6c7e4e03
8 changed files with 84 additions and 71 deletions
|
|
@ -39,6 +39,10 @@ void button_init()
|
||||||
* +,Enter = On, Off
|
* +,Enter = On, Off
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* from uibasic.c */
|
||||||
|
extern int screenhack_handle_events (void);
|
||||||
|
|
||||||
static int get_raw_button (void)
|
static int get_raw_button (void)
|
||||||
{
|
{
|
||||||
int k = screenhack_handle_events();
|
int k = screenhack_handle_events();
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,16 @@
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
int x11_open(char *name, int opts);
|
||||||
|
|
||||||
#define open(x,y) x11_open(x,y)
|
#define open(x,y) x11_open(x,y)
|
||||||
|
|
||||||
#include "../../firmware/common/file.h"
|
#include "../../firmware/common/file.h"
|
||||||
|
|
||||||
|
extern int open(char* pathname, int flags);
|
||||||
|
extern int close(int fd);
|
||||||
|
extern int read(int fd, void* buf, int count);
|
||||||
|
extern int lseek(int fd, int offset, int whence);
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,15 @@
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include "debug.h"
|
||||||
|
|
||||||
#define DIRFUNCTIONS_DEFINED /* prevent those prototypes */
|
#define DIRFUNCTIONS_DEFINED /* prevent those prototypes */
|
||||||
#define dirent x11_dirent
|
#define dirent x11_dirent
|
||||||
#include "../../firmware/common/dir.h"
|
#include "../../firmware/common/dir.h"
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,9 @@ extern Display *dpy;
|
||||||
|
|
||||||
unsigned char display_copy[LCD_WIDTH][LCD_HEIGHT/8];
|
unsigned char display_copy[LCD_WIDTH][LCD_HEIGHT/8];
|
||||||
|
|
||||||
|
/* this is in uibasic.c */
|
||||||
|
extern void drawdots(int color, XPoint *points, int count);
|
||||||
|
|
||||||
void lcd_update (void)
|
void lcd_update (void)
|
||||||
{
|
{
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
|
||||||
|
|
@ -166,6 +166,7 @@ static int screenhack_ehandler (Display *dpy, XErrorEvent *error)
|
||||||
|
|
||||||
static Bool MapNotify_event_p (Display *dpy, XEvent *event, XPointer window)
|
static Bool MapNotify_event_p (Display *dpy, XEvent *event, XPointer window)
|
||||||
{
|
{
|
||||||
|
(void)dpy;
|
||||||
return (event->xany.type == MapNotify &&
|
return (event->xany.type == MapNotify &&
|
||||||
event->xvisibility.window == (Window) window);
|
event->xvisibility.window == (Window) window);
|
||||||
}
|
}
|
||||||
|
|
@ -184,64 +185,60 @@ static Atom XA_WM_PROTOCOLS, XA_WM_DELETE_WINDOW;
|
||||||
int screenhack_handle_event (Display *dpy, XEvent *event)
|
int screenhack_handle_event (Display *dpy, XEvent *event)
|
||||||
{
|
{
|
||||||
int key=0;
|
int key=0;
|
||||||
switch (event->xany.type)
|
switch (event->xany.type) {
|
||||||
{
|
case KeyPress:
|
||||||
case KeyPress:
|
{
|
||||||
{
|
KeySym keysym;
|
||||||
KeySym keysym;
|
unsigned char c = 0;
|
||||||
unsigned char c = 0;
|
XLookupString (&event->xkey, &c, 1, &keysym, 0);
|
||||||
XLookupString (&event->xkey, &c, 1, &keysym, 0);
|
if (! (keysym >= XK_Shift_L && keysym <= XK_Hyper_R))
|
||||||
if (! (keysym >= XK_Shift_L && keysym <= XK_Hyper_R))
|
XBell (dpy, 0); /* beep for non-chord keys */
|
||||||
XBell (dpy, 0); /* beep for non-chord keys */
|
key = keysym;
|
||||||
key = keysym;
|
/* fprintf(stderr, "KEY PRESSED: %c (%02x)\n", c, c); */
|
||||||
/* fprintf(stderr, "KEY PRESSED: %c (%02x)\n", c, c); */
|
}
|
||||||
}
|
break;
|
||||||
break;
|
case ResizeRequest:
|
||||||
case ResizeRequest:
|
screen_resized(event->xresizerequest.width,
|
||||||
screen_resized(event->xresizerequest.width,
|
event->xresizerequest.height);
|
||||||
event->xresizerequest.height);
|
screen_redraw();
|
||||||
screen_redraw();
|
fprintf(stderr, "WINDOW RESIZED to width %d height %d\n",
|
||||||
fprintf(stderr, "WINDOW RESIZED to width %d height %d\n",
|
event->xresizerequest.width, event->xresizerequest.height);
|
||||||
event->xresizerequest.width, event->xresizerequest.height);
|
break;
|
||||||
break;
|
default:
|
||||||
default:
|
|
||||||
/* fprintf(stderr, "EVENT: %d (see /usr/include/X11/X.h)\n",
|
/* fprintf(stderr, "EVENT: %d (see /usr/include/X11/X.h)\n",
|
||||||
event->xany.type);
|
event->xany.type);
|
||||||
*/
|
*/
|
||||||
break;
|
break;
|
||||||
case Expose:
|
case Expose:
|
||||||
screen_redraw();
|
screen_redraw();
|
||||||
fprintf(stderr, "EXPOSE: x: %d y: %d width: %d height: %d\n",
|
fprintf(stderr, "EXPOSE: x: %d y: %d width: %d height: %d\n",
|
||||||
event->xexpose.x, event->xexpose.y,
|
event->xexpose.x, event->xexpose.y,
|
||||||
event->xexpose.width, event->xexpose.height);
|
event->xexpose.width, event->xexpose.height);
|
||||||
break;
|
break;
|
||||||
case ButtonPress:
|
case ButtonPress:
|
||||||
fprintf(stderr, "BUTTON PRESSED: x: %d y:%d\n",event->xbutton.x,event->xbutton.y);
|
fprintf(stderr, "BUTTON PRESSED: x: %d y:%d\n",event->xbutton.x,event->xbutton.y);
|
||||||
break;
|
break;
|
||||||
case ClientMessage:
|
case ClientMessage:
|
||||||
{
|
{
|
||||||
if (event->xclient.message_type != XA_WM_PROTOCOLS)
|
if (event->xclient.message_type != XA_WM_PROTOCOLS) {
|
||||||
{
|
char *s = XGetAtomName(dpy, event->xclient.message_type);
|
||||||
char *s = XGetAtomName(dpy, event->xclient.message_type);
|
if (!s) s = "(null)";
|
||||||
if (!s) s = "(null)";
|
fprintf (stderr, "%s: unknown ClientMessage %s received!\n",
|
||||||
fprintf (stderr, "%s: unknown ClientMessage %s received!\n",
|
progname, s);
|
||||||
progname, s);
|
}
|
||||||
}
|
else if (event->xclient.data.l[0] != (int)XA_WM_DELETE_WINDOW) {
|
||||||
else if (event->xclient.data.l[0] != XA_WM_DELETE_WINDOW)
|
char *s1 = XGetAtomName(dpy, event->xclient.message_type);
|
||||||
{
|
char *s2 = XGetAtomName(dpy, event->xclient.data.l[0]);
|
||||||
char *s1 = XGetAtomName(dpy, event->xclient.message_type);
|
if (!s1) s1 = "(null)";
|
||||||
char *s2 = XGetAtomName(dpy, event->xclient.data.l[0]);
|
if (!s2) s2 = "(null)";
|
||||||
if (!s1) s1 = "(null)";
|
fprintf (stderr, "%s: unknown ClientMessage %s[%s] received!\n",
|
||||||
if (!s2) s2 = "(null)";
|
progname, s1, s2);
|
||||||
fprintf (stderr, "%s: unknown ClientMessage %s[%s] received!\n",
|
}
|
||||||
progname, s1, s2);
|
else {
|
||||||
}
|
exit (0);
|
||||||
else
|
}
|
||||||
{
|
}
|
||||||
exit (0);
|
break;
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
|
|
@ -311,10 +308,10 @@ static void visual_warning (Screen *screen, Window window, Visual *visual,
|
||||||
if (window == RootWindowOfScreen (screen))
|
if (window == RootWindowOfScreen (screen))
|
||||||
strcpy (win, "root window");
|
strcpy (win, "root window");
|
||||||
else
|
else
|
||||||
sprintf (win, "window 0x%x", (unsigned long) window);
|
sprintf (win, "window 0x%lx", (long) window);
|
||||||
|
|
||||||
if (window_p)
|
if (window_p)
|
||||||
sprintf (why, "-window-id 0x%x", (unsigned long) window);
|
sprintf (why, "-window-id 0x%lx", (long)window);
|
||||||
else
|
else
|
||||||
strcpy (why, "-root");
|
strcpy (why, "-root");
|
||||||
|
|
||||||
|
|
@ -333,8 +330,8 @@ static void visual_warning (Screen *screen, Window window, Visual *visual,
|
||||||
{
|
{
|
||||||
fprintf (stderr, "%s: ignoring `-visual %s' because of `%s'.\n",
|
fprintf (stderr, "%s: ignoring `-visual %s' because of `%s'.\n",
|
||||||
progname, visual_string, why);
|
progname, visual_string, why);
|
||||||
fprintf (stderr, "%s: using %s's visual 0x%x.\n",
|
fprintf (stderr, "%s: using %s's visual 0x%lx.\n",
|
||||||
progname, win, XVisualIDFromVisual (visual));
|
progname, win, (long)XVisualIDFromVisual (visual));
|
||||||
}
|
}
|
||||||
free (visual_string);
|
free (visual_string);
|
||||||
}
|
}
|
||||||
|
|
@ -345,8 +342,8 @@ static void visual_warning (Screen *screen, Window window, Visual *visual,
|
||||||
{
|
{
|
||||||
fprintf (stderr, "%s: ignoring `-install' because of `%s'.\n",
|
fprintf (stderr, "%s: ignoring `-install' because of `%s'.\n",
|
||||||
progname, why);
|
progname, why);
|
||||||
fprintf (stderr, "%s: using %s's colormap 0x%x.\n",
|
fprintf (stderr, "%s: using %s's colormap 0x%lx.\n",
|
||||||
progname, win, (unsigned long) cmap);
|
progname, win, (long) cmap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "kernel.h"
|
#include "kernel.h"
|
||||||
|
#include <poll.h>
|
||||||
|
|
||||||
/* ticks is HZ per second */
|
/* ticks is HZ per second */
|
||||||
void x11_sleep(int ticks)
|
void x11_sleep(int ticks)
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,6 @@ void init_window ()
|
||||||
{
|
{
|
||||||
XGCValues gcv;
|
XGCValues gcv;
|
||||||
XWindowAttributes xgwa;
|
XWindowAttributes xgwa;
|
||||||
char *test_p;
|
|
||||||
|
|
||||||
XGetWindowAttributes (dpy, window, &xgwa);
|
XGetWindowAttributes (dpy, window, &xgwa);
|
||||||
|
|
||||||
|
|
@ -176,15 +175,12 @@ void drawtext(int color, int x, int y, char *text)
|
||||||
XDrawString(dpy, window, draw_gc, x, y, text, strlen(text));
|
XDrawString(dpy, window, draw_gc, x, y, text, strlen(text));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* this is where the applicaton starts */
|
||||||
|
extern void app_main(void);
|
||||||
|
|
||||||
void
|
void
|
||||||
screenhack (Display *the_dpy, Window the_window)
|
screenhack (Display *the_dpy, Window the_window)
|
||||||
{
|
{
|
||||||
unsigned short porttouse=0;
|
|
||||||
char *proxy = NULL;
|
|
||||||
char *url = NULL;
|
|
||||||
int i;
|
|
||||||
char *guiname="Rock-the-box";
|
|
||||||
Bool helpme;
|
Bool helpme;
|
||||||
|
|
||||||
/* This doesn't work, but I don't know why (Daniel 1999-12-01) */
|
/* This doesn't work, but I don't know why (Daniel 1999-12-01) */
|
||||||
|
|
@ -206,8 +202,6 @@ screenhack (Display *the_dpy, Window the_window)
|
||||||
|
|
||||||
void screen_redraw()
|
void screen_redraw()
|
||||||
{
|
{
|
||||||
int y, x;
|
|
||||||
|
|
||||||
/* draw a border around the "Recorder" screen */
|
/* draw a border around the "Recorder" screen */
|
||||||
|
|
||||||
#define X1 0
|
#define X1 0
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ VirtualRootWindowOfScreen(screen) Screen *screen;
|
||||||
if (screen != save_screen) {
|
if (screen != save_screen) {
|
||||||
Display *dpy = DisplayOfScreen(screen);
|
Display *dpy = DisplayOfScreen(screen);
|
||||||
Atom __SWM_VROOT = None;
|
Atom __SWM_VROOT = None;
|
||||||
int i;
|
unsigned int i;
|
||||||
Window rootReturn, parentReturn, *children;
|
Window rootReturn, parentReturn, *children;
|
||||||
unsigned int numChildren;
|
unsigned int numChildren;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue