Search
lxdream.org :: lxdream/src/drivers/video_gtk.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/drivers/video_gtk.c
changeset 736:a02d1475ccfd
prev700:4650d0c7f6f9
next770:429ff505c450
author nkeynes
date Mon Jul 14 07:44:42 2008 +0000 (11 years ago)
permissions -rw-r--r--
last change Re-indent everything consistently
Fix include guards for consistency as well
file annotate diff log raw
1.1 --- a/src/drivers/video_gtk.c Sun Jun 22 06:49:00 2008 +0000
1.2 +++ b/src/drivers/video_gtk.c Mon Jul 14 07:44:42 2008 +0000
1.3 @@ -37,18 +37,18 @@
1.4
1.5 guint gdk_keycode_to_modifier( GdkDisplay *display, guint keycode )
1.6 {
1.7 - int i;
1.8 - int result = 0;
1.9 - Display *xdisplay = GDK_DISPLAY_XDISPLAY (display);
1.10 - XModifierKeymap *keymap = XGetModifierMapping( xdisplay );
1.11 - for( i=0; i<8*keymap->max_keypermod; i++ ) {
1.12 - if( keymap->modifiermap[i] == keycode ) {
1.13 - result = 1 << (i/keymap->max_keypermod);
1.14 - break;
1.15 + int i;
1.16 + int result = 0;
1.17 + Display *xdisplay = GDK_DISPLAY_XDISPLAY (display);
1.18 + XModifierKeymap *keymap = XGetModifierMapping( xdisplay );
1.19 + for( i=0; i<8*keymap->max_keypermod; i++ ) {
1.20 + if( keymap->modifiermap[i] == keycode ) {
1.21 + result = 1 << (i/keymap->max_keypermod);
1.22 + break;
1.23 + }
1.24 }
1.25 - }
1.26 - XFreeModifiermap(keymap);
1.27 - return result;
1.28 + XFreeModifiermap(keymap);
1.29 + return result;
1.30 }
1.31
1.32 #if !(GTK_CHECK_VERSION(2,8,0))
1.33 @@ -84,17 +84,17 @@
1.34 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
1.35 */
1.36 void gdk_display_warp_pointer (GdkDisplay *display,
1.37 - GdkScreen *screen,
1.38 - gint x,
1.39 - gint y)
1.40 + GdkScreen *screen,
1.41 + gint x,
1.42 + gint y)
1.43 {
1.44 - Display *xdisplay;
1.45 - Window dest;
1.46 + Display *xdisplay;
1.47 + Window dest;
1.48
1.49 - xdisplay = GDK_DISPLAY_XDISPLAY (display);
1.50 - dest = GDK_WINDOW_XWINDOW (gdk_screen_get_root_window (screen));
1.51 + xdisplay = GDK_DISPLAY_XDISPLAY (display);
1.52 + dest = GDK_WINDOW_XWINDOW (gdk_screen_get_root_window (screen));
1.53
1.54 - XWarpPointer (xdisplay, None, dest, 0, 0, 0, 0, x, y);
1.55 + XWarpPointer (xdisplay, None, dest, 0, 0, 0, 0, x, y);
1.56 }
1.57
1.58 #endif
1.59 @@ -109,7 +109,7 @@
1.60
1.61 guint gdk_keycode_to_modifier( GdkDisplay *display, guint keycode )
1.62 {
1.63 - return 0;
1.64 + return 0;
1.65 }
1.66
1.67 #endif
1.68 @@ -136,12 +136,12 @@
1.69 NULL,
1.70 NULL, NULL, NULL, NULL, NULL,
1.71 video_gtk_display_blank, NULL };
1.72 -
1.73 +
1.74 uint16_t video_gtk_resolve_keysym( const gchar *keysym )
1.75 {
1.76 int val = gdk_keyval_from_name( keysym );
1.77 if( val == GDK_VoidSymbol )
1.78 - return 0;
1.79 + return 0;
1.80 return (uint16_t)val;
1.81 }
1.82
1.83 @@ -162,9 +162,9 @@
1.84 uint16_t video_gtk_keycode_to_dckeysym(uint16_t keycode)
1.85 {
1.86 if( keycode >= 'a' && keycode <= 'z' ) {
1.87 - return (keycode - 'a') + DCKB_a;
1.88 + return (keycode - 'a') + DCKB_a;
1.89 } else if( keycode >= '1' && keycode <= '9' ) {
1.90 - return (keycode - '1') + DCKB_1;
1.91 + return (keycode - '1') + DCKB_1;
1.92 }
1.93 switch(keycode) {
1.94 case GDK_0: return DCKB_0;
1.95 @@ -244,9 +244,9 @@
1.96 GTK_WIDGET_SET_FLAGS(drawable, GTK_CAN_FOCUS|GTK_CAN_DEFAULT);
1.97
1.98 g_signal_connect( drawable, "expose_event",
1.99 - G_CALLBACK(video_gtk_expose_callback), NULL );
1.100 + G_CALLBACK(video_gtk_expose_callback), NULL );
1.101 g_signal_connect( drawable, "configure_event",
1.102 - G_CALLBACK(video_gtk_resize_callback), NULL );
1.103 + G_CALLBACK(video_gtk_resize_callback), NULL );
1.104
1.105 #ifdef HAVE_GLX
1.106 Display *display = gdk_x11_display_get_xdisplay( gtk_widget_get_display(drawable));
1.107 @@ -270,9 +270,9 @@
1.108
1.109 gboolean video_gtk_init()
1.110 {
1.111 -
1.112 +
1.113 if( gtk_video_drawable == NULL ) {
1.114 - return FALSE;
1.115 + return FALSE;
1.116 }
1.117
1.118 video_width = gtk_video_drawable->allocation.width;
1.119 @@ -284,21 +284,21 @@
1.120 Display *display = gdk_x11_display_get_xdisplay( gtk_widget_get_display(GTK_WIDGET(gtk_video_drawable)));
1.121 Window window = GDK_WINDOW_XWINDOW( GTK_WIDGET(gtk_video_drawable)->window );
1.122 if( ! video_glx_init_context( display, window ) ||
1.123 - ! video_glx_init_driver( &display_gtk_driver ) ) {
1.124 + ! video_glx_init_driver( &display_gtk_driver ) ) {
1.125 return FALSE;
1.126 }
1.127 #else
1.128 #ifdef HAVE_NSGL
1.129 NSView *view = gdk_quartz_window_get_nsview(gtk_video_drawable->window);
1.130 if( ! video_nsgl_init_driver( view, &display_gtk_driver ) ) {
1.131 - return FALSE;
1.132 + return FALSE;
1.133 }
1.134 #endif
1.135 #endif
1.136 #endif
1.137
1.138 pvr2_setup_gl_context();
1.139 -
1.140 +
1.141 #ifdef HAVE_LINUX_JOYSTICK
1.142 linux_joystick_init();
1.143 #endif
1.144 @@ -325,10 +325,10 @@
1.145 video_gdk_shutdown();
1.146 #else
1.147 #ifdef HAVE_GLX
1.148 - video_glx_shutdown();
1.149 + video_glx_shutdown();
1.150 #else
1.151 #ifdef HAVE_NSGL
1.152 - video_nsgl_shutdown();
1.153 + video_nsgl_shutdown();
1.154 #endif
1.155 #endif
1.156 #endif
.