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 435:7a5d71e8560b
prev424:421d68e78c46
next436:e8c461d2545e
author nkeynes
date Wed Oct 10 11:02:04 2007 +0000 (14 years ago)
permissions -rw-r--r--
last change First cut of new GUI
file annotate diff log raw
1.1 --- a/src/drivers/video_gtk.c Sun Oct 07 05:42:25 2007 +0000
1.2 +++ b/src/drivers/video_gtk.c Wed Oct 10 11:02:04 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: video_gtk.c,v 1.12 2007-10-07 05:42:25 nkeynes Exp $
1.6 + * $Id: video_gtk.c,v 1.13 2007-10-10 11:02:04 nkeynes Exp $
1.7 *
1.8 * The PC side of the video support (responsible for actually displaying /
1.9 * rendering frames)
1.10 @@ -23,9 +23,10 @@
1.11 #include "dream.h"
1.12 #include "display.h"
1.13 #include "drivers/video_x11.h"
1.14 +#include "gui/gtkui.h"
1.15
1.16 GdkImage *video_img = NULL;
1.17 -GtkWindow *video_win = NULL;
1.18 +GtkWidget *video_win = NULL;
1.19 GtkWidget *video_area = NULL;
1.20 uint32_t video_width = 640;
1.21 uint32_t video_height = 480;
1.22 @@ -63,17 +64,29 @@
1.23 return TRUE;
1.24 }
1.25
1.26 +gboolean video_gtk_expose_callback(GtkWidget *widget, GdkEventExpose *event, gpointer data )
1.27 +{
1.28 + /* redisplay last frame */
1.29 +}
1.30 +
1.31 gboolean video_gtk_init()
1.32 {
1.33 + /*
1.34 video_win = GTK_WINDOW(gtk_window_new( GTK_WINDOW_TOPLEVEL ));
1.35 gtk_window_set_title( video_win, APP_NAME " - Emulation Window" );
1.36 gtk_window_set_policy( video_win, FALSE, FALSE, FALSE );
1.37 + gtk_window_set_default_size( video_win, video_width, video_height );
1.38 + */
1.39
1.40 + video_win = gtk_gui_get_renderarea();
1.41 +
1.42 g_signal_connect( video_win, "key_press_event",
1.43 G_CALLBACK(video_gtk_keydown_callback), NULL );
1.44 g_signal_connect( video_win, "key_release_event",
1.45 G_CALLBACK(video_gtk_keyup_callback), NULL );
1.46 - gtk_widget_add_events( GTK_WIDGET(video_win),
1.47 + g_signal_connect( video_win, "expose_event",
1.48 + G_CALLBACK(video_gtk_expose_callback), NULL );
1.49 + gtk_widget_add_events( video_win,
1.50 GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK |
1.51 GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK );
1.52 video_area = gtk_image_new();
1.53 @@ -84,7 +97,6 @@
1.54 video_width, video_height );
1.55 gtk_image_set_from_image( GTK_IMAGE(video_area), video_img, NULL );
1.56
1.57 - gtk_window_set_default_size( video_win, video_width, video_height );
1.58
1.59 return video_glx_init( gdk_x11_display_get_xdisplay( gtk_widget_get_display(GTK_WIDGET(video_win))),
1.60 gdk_x11_screen_get_xscreen( gtk_widget_get_screen(GTK_WIDGET(video_win))),
.