[brasero] Fix #588406 - Allow user to zoom in/out in media previewer with mouse wheel



commit e3eed98f1b7f43017f70017806cd022827d088f7
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date:   Wed Dec 2 19:39:01 2009 +0100

    Fix #588406 -  Allow user to zoom in/out in media previewer with mouse wheel

 src/brasero-player-bacon.c |  306 ++++++++++++++++++--------------------------
 src/brasero-player.c       |  111 +++++++++++++----
 2 files changed, 213 insertions(+), 204 deletions(-)
---
diff --git a/src/brasero-player-bacon.c b/src/brasero-player-bacon.c
index 2b4c8da..1cafefa 100644
--- a/src/brasero-player-bacon.c
+++ b/src/brasero-player-bacon.c
@@ -43,35 +43,6 @@
 #include "brasero-player-bacon.h"
 #include "brasero-setting.h"
 
-static void brasero_player_bacon_class_init(BraseroPlayerBaconClass *klass);
-static void brasero_player_bacon_init(BraseroPlayerBacon *sp);
-static void brasero_player_bacon_finalize(GObject *object);
-static void brasero_player_bacon_destroy (GtkObject *object);
-
-static void brasero_player_bacon_set_property (GObject *obj,
-					       guint prop_id,
-					       const GValue *value,
-					       GParamSpec *pspec);
-static void brasero_player_bacon_get_property (GObject *obj,
-					       guint prop_id,
-					       GValue *value,
-					       GParamSpec *pspec);
-
-static void brasero_player_bacon_realize (GtkWidget *widget);
-static void brasero_player_bacon_unrealize (GtkWidget *widget);
-static void brasero_player_bacon_map (GtkWidget *widget);
-static void brasero_player_bacon_unmap (GtkWidget *widget);
-
-static gboolean brasero_player_bacon_expose (GtkWidget *widget,
-					     GdkEventExpose *event);
-static void brasero_player_bacon_size_request (GtkWidget *widget,
-					       GtkRequisition *requisition);
-static void brasero_player_bacon_size_allocate (GtkWidget *widget,
-						GtkAllocation *allocation);
-
-static gboolean brasero_player_bacon_bus_messages (GstBus *bus,
-						   GstMessage *msg,
-						   BraseroPlayerBacon *bacon);
 
 struct BraseroPlayerBaconPrivate {
 	GstElement *pipe;
@@ -93,87 +64,10 @@ typedef enum {
 	EOF_SIGNAL,
 	LAST_SIGNAL
 } BraseroPlayerBaconSignalType;
-static guint brasero_player_bacon_signals [LAST_SIGNAL] = { 0 };
-
-#define GCONF_PLAYER_VOLUME	"/apps/brasero/display/volume"
-
-static GObjectClass *parent_class = NULL;
-
-GType
-brasero_player_bacon_get_type (void)
-{
-	static GType type = 0;
-
-	if(type == 0) {
-		static const GTypeInfo our_info = {
-			sizeof (BraseroPlayerBaconClass),
-			NULL,
-			NULL,
-			(GClassInitFunc)brasero_player_bacon_class_init,
-			NULL,
-			NULL,
-			sizeof (BraseroPlayerBacon),
-			0,
-			(GInstanceInitFunc)brasero_player_bacon_init,
-		};
-
-		type = g_type_register_static (GTK_TYPE_WIDGET, 
-					       "BraseroPlayerBacon",
-					       &our_info,
-					       0);
-	}
-
-	return type;
-}
-
-static void
-brasero_player_bacon_class_init (BraseroPlayerBaconClass *klass)
-{
-	GObjectClass *object_class = G_OBJECT_CLASS(klass);
-	GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (klass);
-	GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
-
-	parent_class = g_type_class_peek_parent(klass);
-
-	object_class->finalize = brasero_player_bacon_finalize;
-	object_class->set_property = brasero_player_bacon_set_property;
-	object_class->get_property = brasero_player_bacon_get_property;
-	gtk_object_class->destroy = brasero_player_bacon_destroy;
-
-	widget_class->expose_event = brasero_player_bacon_expose;
-	widget_class->map = brasero_player_bacon_map;
-	widget_class->unmap = brasero_player_bacon_unmap;
-	widget_class->realize = brasero_player_bacon_realize;
-	widget_class->unrealize = brasero_player_bacon_unrealize;
-	widget_class->size_request = brasero_player_bacon_size_request;
-	widget_class->size_allocate = brasero_player_bacon_size_allocate;
-
-	brasero_player_bacon_signals [STATE_CHANGED_SIGNAL] = 
-			g_signal_new ("state-change",
-				      G_TYPE_FROM_CLASS (klass),
-				      G_SIGNAL_RUN_LAST,
-				      G_STRUCT_OFFSET (BraseroPlayerBaconClass, state_changed),
-				      NULL, NULL,
-				      g_cclosure_marshal_VOID__INT,
-				      G_TYPE_NONE, 1, G_TYPE_INT);
 
-	brasero_player_bacon_signals [EOF_SIGNAL] = 
-			g_signal_new ("eof",
-				      G_TYPE_FROM_CLASS (klass),
-				      G_SIGNAL_RUN_LAST,
-				      G_STRUCT_OFFSET (BraseroPlayerBaconClass, eof),
-				      NULL, NULL,
-				      g_cclosure_marshal_VOID__VOID,
-				      G_TYPE_NONE, 0);
+static guint brasero_player_bacon_signals [LAST_SIGNAL] = { 0 };
 
-	g_object_class_install_property (object_class,
-					 PROP_URI,
-					 g_param_spec_string ("uri",
-							      "The uri of the media",
-							      "The uri of the media",
-							      NULL,
-							      G_PARAM_READWRITE));
-}
+G_DEFINE_TYPE (BraseroPlayerBacon, brasero_player_bacon, GTK_TYPE_WIDGET)
 
 static void
 brasero_player_bacon_set_property (GObject *obj,
@@ -219,11 +113,11 @@ brasero_player_bacon_get_property (GObject *obj,
 static void
 brasero_player_bacon_realize (GtkWidget *widget)
 {
-	GtkAllocation allocation;
 	GdkWindow *window;
+	gint attributes_mask;
+	GtkAllocation allocation;
 	GdkWindowAttr attributes;
 	BraseroPlayerBacon *bacon;
-	gint attributes_mask;
 
 	bacon = BRASERO_PLAYER_BACON (widget);
 
@@ -237,7 +131,7 @@ brasero_player_bacon_realize (GtkWidget *widget)
 	attributes.visual = gtk_widget_get_visual (widget);
 	attributes.colormap = gtk_widget_get_colormap (widget);
 	attributes.event_mask = gtk_widget_get_events (widget);
-	attributes.event_mask |= GDK_EXPOSURE_MASK;
+	attributes.event_mask |= GDK_EXPOSURE_MASK|GDK_BUTTON_PRESS_MASK;
 	attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_COLORMAP;
 
 	gtk_widget_set_window (widget, gdk_window_new (gtk_widget_get_parent_window (widget),
@@ -248,7 +142,7 @@ brasero_player_bacon_realize (GtkWidget *widget)
 
 	gtk_widget_set_style (widget, gtk_style_attach (gtk_widget_get_style (widget), window));
 	//gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
-	
+
 	GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
 }
 
@@ -259,8 +153,8 @@ brasero_player_bacon_unrealize (GtkWidget *widget)
 
 	bacon = BRASERO_PLAYER_BACON (widget);
 
-	if (GTK_WIDGET_CLASS (parent_class)->unrealize)
-		GTK_WIDGET_CLASS (parent_class)->unrealize (widget);
+	if (GTK_WIDGET_CLASS (brasero_player_bacon_parent_class)->unrealize)
+		GTK_WIDGET_CLASS (brasero_player_bacon_parent_class)->unrealize (widget);
 }
 
 static void
@@ -316,8 +210,8 @@ brasero_player_bacon_size_request (GtkWidget *widget,
 	requisition->width = PLAYER_BACON_WIDTH;
 	requisition->height = PLAYER_BACON_HEIGHT;
 
-	if (GTK_WIDGET_CLASS (parent_class)->size_request)
-		GTK_WIDGET_CLASS (parent_class)->size_request (widget, requisition);
+	if (GTK_WIDGET_CLASS (brasero_player_bacon_parent_class)->size_request)
+		GTK_WIDGET_CLASS (brasero_player_bacon_parent_class)->size_request (widget, requisition);
 }
 
 static void
@@ -356,68 +250,8 @@ brasero_player_bacon_size_allocate (GtkWidget *widget,
 					(gint) screen_height);
 		gtk_widget_set_allocation (widget, allocation);
 	}
-	else if (GTK_WIDGET_CLASS (parent_class)->size_allocate)
-		GTK_WIDGET_CLASS (parent_class)->size_allocate (widget, allocation);
-}
-
-static void
-brasero_player_bacon_destroy (GtkObject *obj)
-{
-	BraseroPlayerBacon *cobj;
-
-	cobj = BRASERO_PLAYER_BACON (obj);
-
-	/* save volume */
-	if (cobj->priv->pipe) {
-		gdouble volume;
-
-		g_object_get (cobj->priv->pipe,
-			      "volume", &volume,
-			      NULL);
-		brasero_setting_set_value (brasero_setting_get_default (),
-		                           BRASERO_SETTING_PLAYER_VOLUME,
-		                           GINT_TO_POINTER ((gint)(volume * 100)));
-	}
-
-	if (cobj->priv->xoverlay
-	&&  GST_IS_X_OVERLAY (cobj->priv->xoverlay)) {
-		cobj->priv->xoverlay = NULL;
-	}
-
-	if (cobj->priv->pipe) {
-		gst_element_set_state (cobj->priv->pipe, GST_STATE_NULL);
-		gst_object_unref (GST_OBJECT (cobj->priv->pipe));
-		cobj->priv->pipe = NULL;
-	}
-
-	if (cobj->priv->uri) {
-		g_free (cobj->priv->uri);
-		cobj->priv->uri = NULL;
-	}
-
-	if (GTK_OBJECT_CLASS (parent_class)->destroy)
-		GTK_OBJECT_CLASS (parent_class)->destroy (obj);
-}
-
-static void
-brasero_player_bacon_finalize (GObject *object)
-{
-	BraseroPlayerBacon *cobj;
-
-	cobj = BRASERO_PLAYER_BACON (object);
-
-	g_free (cobj->priv);
-	G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-GtkWidget *
-brasero_player_bacon_new (void)
-{
-	BraseroPlayerBacon *obj;
-	
-	obj = BRASERO_PLAYER_BACON (g_object_new (BRASERO_TYPE_PLAYER_BACON, NULL));
-	
-	return GTK_WIDGET (obj);
+	else if (GTK_WIDGET_CLASS (brasero_player_bacon_parent_class)->size_allocate)
+		GTK_WIDGET_CLASS (brasero_player_bacon_parent_class)->size_allocate (widget, allocation);
 }
 
 static GstBusSyncReply
@@ -426,7 +260,8 @@ brasero_player_bacon_bus_messages_handler (GstBus *bus,
 					   BraseroPlayerBacon *bacon)
 {
 	const GstStructure *structure;
-	XID window;
+	GdkWindow *window;
+	XID xid;
 
 	structure = gst_message_get_structure (message);
 	if (!structure)
@@ -436,9 +271,11 @@ brasero_player_bacon_bus_messages_handler (GstBus *bus,
 		return GST_BUS_PASS;
 	}
 
-	window = GDK_WINDOW_XWINDOW (gtk_widget_get_window (GTK_WIDGET (bacon)));
+	window = gtk_widget_get_window (GTK_WIDGET (bacon));
+	gdk_window_show_unraised (window);
+	xid = gdk_x11_drawable_get_xid (GDK_DRAWABLE (window));
 	bacon->priv->xoverlay = GST_X_OVERLAY (GST_MESSAGE_SRC (message));
-	gst_x_overlay_set_xwindow_id (bacon->priv->xoverlay, window);
+	gst_x_overlay_set_xwindow_id (bacon->priv->xoverlay, xid);
 
 	return GST_BUS_DROP;
 }
@@ -745,3 +582,110 @@ brasero_player_bacon_init (BraseroPlayerBacon *obj)
 	obj->priv = g_new0 (BraseroPlayerBaconPrivate, 1);
 	brasero_player_bacon_setup_pipe (obj);
 }
+
+static void
+brasero_player_bacon_destroy (GtkObject *obj)
+{
+	BraseroPlayerBacon *cobj;
+
+	cobj = BRASERO_PLAYER_BACON (obj);
+
+	/* save volume */
+	if (cobj->priv->pipe) {
+		gdouble volume;
+
+		g_object_get (cobj->priv->pipe,
+			      "volume", &volume,
+			      NULL);
+		brasero_setting_set_value (brasero_setting_get_default (),
+		                           BRASERO_SETTING_PLAYER_VOLUME,
+		                           GINT_TO_POINTER ((gint)(volume * 100)));
+	}
+
+	if (cobj->priv->xoverlay
+	&&  GST_IS_X_OVERLAY (cobj->priv->xoverlay)) {
+		cobj->priv->xoverlay = NULL;
+	}
+
+	if (cobj->priv->pipe) {
+		gst_element_set_state (cobj->priv->pipe, GST_STATE_NULL);
+		gst_object_unref (GST_OBJECT (cobj->priv->pipe));
+		cobj->priv->pipe = NULL;
+	}
+
+	if (cobj->priv->uri) {
+		g_free (cobj->priv->uri);
+		cobj->priv->uri = NULL;
+	}
+
+	if (GTK_OBJECT_CLASS (brasero_player_bacon_parent_class)->destroy)
+		GTK_OBJECT_CLASS (brasero_player_bacon_parent_class)->destroy (obj);
+}
+
+static void
+brasero_player_bacon_finalize (GObject *object)
+{
+	BraseroPlayerBacon *cobj;
+
+	cobj = BRASERO_PLAYER_BACON (object);
+
+	g_free (cobj->priv);
+	G_OBJECT_CLASS (brasero_player_bacon_parent_class)->finalize (object);
+}
+
+static void
+brasero_player_bacon_class_init (BraseroPlayerBaconClass *klass)
+{
+	GObjectClass *object_class = G_OBJECT_CLASS(klass);
+	GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (klass);
+	GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+
+	object_class->finalize = brasero_player_bacon_finalize;
+	object_class->set_property = brasero_player_bacon_set_property;
+	object_class->get_property = brasero_player_bacon_get_property;
+	gtk_object_class->destroy = brasero_player_bacon_destroy;
+
+	widget_class->expose_event = brasero_player_bacon_expose;
+	widget_class->map = brasero_player_bacon_map;
+	widget_class->unmap = brasero_player_bacon_unmap;
+	widget_class->realize = brasero_player_bacon_realize;
+	widget_class->unrealize = brasero_player_bacon_unrealize;
+	widget_class->size_request = brasero_player_bacon_size_request;
+	widget_class->size_allocate = brasero_player_bacon_size_allocate;
+
+	brasero_player_bacon_signals [STATE_CHANGED_SIGNAL] = 
+			g_signal_new ("state-change",
+				      G_TYPE_FROM_CLASS (klass),
+				      G_SIGNAL_RUN_LAST,
+				      G_STRUCT_OFFSET (BraseroPlayerBaconClass, state_changed),
+				      NULL, NULL,
+				      g_cclosure_marshal_VOID__INT,
+				      G_TYPE_NONE, 1, G_TYPE_INT);
+
+	brasero_player_bacon_signals [EOF_SIGNAL] = 
+			g_signal_new ("eof",
+				      G_TYPE_FROM_CLASS (klass),
+				      G_SIGNAL_RUN_LAST,
+				      G_STRUCT_OFFSET (BraseroPlayerBaconClass, eof),
+				      NULL, NULL,
+				      g_cclosure_marshal_VOID__VOID,
+				      G_TYPE_NONE, 0);
+
+	g_object_class_install_property (object_class,
+					 PROP_URI,
+					 g_param_spec_string ("uri",
+							      "The uri of the media",
+							      "The uri of the media",
+							      NULL,
+							      G_PARAM_READWRITE));
+}
+
+GtkWidget *
+brasero_player_bacon_new (void)
+{
+	BraseroPlayerBacon *obj;
+	
+	obj = BRASERO_PLAYER_BACON (g_object_new (BRASERO_TYPE_PLAYER_BACON, NULL));
+	
+	return GTK_WIDGET (obj);
+}
diff --git a/src/brasero-player.c b/src/brasero-player.c
index fac9d00..02d2048 100644
--- a/src/brasero-player.c
+++ b/src/brasero-player.c
@@ -58,14 +58,15 @@ struct BraseroPlayerPrivate {
 
 	GtkWidget *notebook;
 	GtkWidget *bacon;
-	GtkWidget *image_display;
 	GtkWidget *controls;
 
 	gint image_width;
 	gint image_height;
 	GdkPixbuf *pixbuf;
 
-	GtkWidget *image;
+
+	GtkWidget *image_display;
+	GtkWidget *image_event;
 	GtkWidget *image_zoom_in;
 	GtkWidget *image_zoom_out;
 
@@ -120,7 +121,6 @@ brasero_player_destroy_controls (BraseroPlayer *player)
 	player->priv->header = NULL;
 	player->priv->button = NULL;
 	player->priv->size = NULL;
-	player->priv->image = NULL;
 	player->priv->video_zoom_in = NULL;
 	player->priv->video_zoom_out = NULL;
 	player->priv->image_zoom_in = NULL;
@@ -145,12 +145,11 @@ brasero_player_no_multimedia_stream (BraseroPlayer *player)
 }
 
 static void
-brasero_player_video_zoom_out (GtkButton *button,
-			       BraseroPlayer *player)
+brasero_player_video_zoom_out (BraseroPlayer *player)
 {
 	GtkWidget *parent;
-	GtkAllocation player_allocation, bacon_allocation;
 	gint width, height;
+	GtkAllocation player_allocation, bacon_allocation;
 
 	gtk_widget_set_sensitive (GTK_WIDGET (player->priv->video_zoom_in), TRUE);
 
@@ -200,8 +199,14 @@ brasero_player_video_zoom_out (GtkButton *button,
 }
 
 static void
-brasero_player_video_zoom_in (GtkButton *button,
-			      BraseroPlayer *player)
+brasero_player_video_zoom_out_button_cb (GtkButton *button,
+					 BraseroPlayer *player)
+{
+	brasero_player_video_zoom_out (player);
+}
+
+static void
+brasero_player_video_zoom_in (BraseroPlayer *player)
 {
 	GtkAllocation player_allocation, bacon_allocation;
 	gint width, height;
@@ -253,6 +258,26 @@ brasero_player_video_zoom_in (GtkButton *button,
 }
 
 static void
+brasero_player_video_zoom_in_button_cb (GtkButton *button,
+					BraseroPlayer *player)
+{
+	brasero_player_video_zoom_in (player);
+}
+
+static gboolean
+brasero_player_video_scroll (BraseroPlayerBacon *bacon,
+			     GdkEventScroll *event,
+			     BraseroPlayer *player)
+{
+	if (event->direction == GDK_SCROLL_UP)
+		brasero_player_video_zoom_in (player);
+	else
+		brasero_player_video_zoom_out (player);
+
+	return TRUE;
+}
+
+static void
 brasero_player_update_position (BraseroPlayer *player)
 {
 	gdouble value;
@@ -525,7 +550,7 @@ brasero_player_create_controls_stream (BraseroPlayer *player,
 		gtk_button_set_focus_on_click (GTK_BUTTON (zoom), FALSE);
 		g_signal_connect (zoom,
 				  "clicked",
-				  G_CALLBACK (brasero_player_video_zoom_out),
+				  G_CALLBACK (brasero_player_video_zoom_out_button_cb),
 				  player);
 		gtk_box_pack_start (GTK_BOX (hbox),
 				    zoom,
@@ -541,7 +566,7 @@ brasero_player_create_controls_stream (BraseroPlayer *player,
 		gtk_button_set_focus_on_click (GTK_BUTTON (zoom), FALSE);
 		g_signal_connect (zoom,
 				  "clicked",
-				  G_CALLBACK (brasero_player_video_zoom_in),
+				  G_CALLBACK (brasero_player_video_zoom_in_button_cb),
 				  player);
 		gtk_box_pack_start (GTK_BOX (hbox),
 				    zoom,
@@ -630,8 +655,7 @@ brasero_player_scale_image (BraseroPlayer *player)
 }
 
 static void
-brasero_player_image_zoom_in (GtkButton *button,
-			      BraseroPlayer *player)
+brasero_player_image_zoom_in (BraseroPlayer *player)
 {
 	gtk_widget_set_sensitive (player->priv->image_zoom_out, TRUE);
 
@@ -649,8 +673,14 @@ brasero_player_image_zoom_in (GtkButton *button,
 }
 
 static void
-brasero_player_image_zoom_out (GtkButton *button,
-			       BraseroPlayer *player)
+brasero_player_image_zoom_in_button_cb (GtkButton *button,
+					BraseroPlayer *player)
+{
+	brasero_player_image_zoom_in (player);
+}
+
+static void
+brasero_player_image_zoom_out (BraseroPlayer *player)
 {
 	gint min_height, min_width;
 
@@ -674,6 +704,26 @@ brasero_player_image_zoom_out (GtkButton *button,
 }
 
 static void
+brasero_player_image_zoom_out_button_cb (GtkButton *button,
+					 BraseroPlayer *player)
+{
+	brasero_player_image_zoom_out (player);
+}
+
+static gboolean
+brasero_player_image_scroll (BraseroPlayerBacon *bacon,
+			     GdkEventScroll *event,
+			     BraseroPlayer *player)
+{
+	if (event->direction == GDK_SCROLL_UP)
+		brasero_player_image_zoom_in (player);
+	else
+		brasero_player_image_zoom_out (player);
+
+	return TRUE;
+}
+
+static void
 brasero_player_create_controls_image (BraseroPlayer *player)
 {
 	GtkWidget *box, *zoom;
@@ -729,7 +779,7 @@ brasero_player_create_controls_image (BraseroPlayer *player)
 	gtk_button_set_focus_on_click (GTK_BUTTON (zoom), FALSE);
 	g_signal_connect (zoom,
 			  "clicked",
-			  G_CALLBACK (brasero_player_image_zoom_out),
+			  G_CALLBACK (brasero_player_image_zoom_out_button_cb),
 			  player);
 	gtk_box_pack_start (GTK_BOX (box),
 			    zoom,
@@ -745,7 +795,7 @@ brasero_player_create_controls_image (BraseroPlayer *player)
 	gtk_button_set_focus_on_click (GTK_BUTTON (zoom), FALSE);
 	g_signal_connect (zoom,
 			  "clicked",
-			  G_CALLBACK (brasero_player_image_zoom_in),
+			  G_CALLBACK (brasero_player_image_zoom_in_button_cb),
 			  player);
 	gtk_box_pack_start (GTK_BOX (box),
 			    zoom,
@@ -825,7 +875,7 @@ brasero_player_image (BraseroPlayer *player)
 	g_free (string);
 
 	gtk_widget_hide (player->priv->bacon);
-	gtk_widget_show (player->priv->image_display);
+	gtk_widget_show (player->priv->image_event);
 	gtk_widget_show (player->priv->notebook);
 	gtk_alignment_set_padding (GTK_ALIGNMENT (player), 12, 0, 0, 0);
 
@@ -917,7 +967,7 @@ brasero_player_metadata_completed (GObject *obj,
 			gtk_widget_set_sensitive (player->priv->progress, FALSE);
 
 		gtk_widget_show (player->priv->bacon);
-		gtk_widget_hide (player->priv->image_display);
+		gtk_widget_hide (player->priv->image_event);
 		gtk_widget_show (player->priv->notebook);
 	}
 	else if (g_file_info_get_attribute_boolean (info, BRASERO_IO_HAS_AUDIO)) {
@@ -1270,8 +1320,6 @@ brasero_player_destroy (GtkObject *obj)
 	                           BRASERO_SETTING_VIDEO_SIZE_WIDTH,
 	                           GINT_TO_POINTER (player->priv->video_width));
 
-	player->priv->image = NULL;
-
 	if (player->priv->pixbuf) {
 		g_object_unref (player->priv->pixbuf);
 		player->priv->pixbuf = NULL;
@@ -1344,6 +1392,7 @@ static void
 brasero_player_init (BraseroPlayer *obj)
 {
 	GtkWidget *alignment;
+	GtkWidget *event;
 	gpointer value;
 
 	obj->priv = g_new0 (BraseroPlayerPrivate, 1);
@@ -1375,12 +1424,23 @@ brasero_player_init (BraseroPlayer *obj)
 	gtk_notebook_set_show_tabs (GTK_NOTEBOOK (obj->priv->notebook), FALSE);
 	gtk_notebook_set_show_border (GTK_NOTEBOOK (obj->priv->notebook), FALSE);
 
+	event = gtk_event_box_new ();
+	obj->priv->image_event = event;
+	gtk_event_box_set_above_child (GTK_EVENT_BOX (event), TRUE);
+	gtk_event_box_set_visible_window (GTK_EVENT_BOX (event), FALSE);
+	gtk_notebook_append_page (GTK_NOTEBOOK (obj->priv->notebook),
+				  event,
+				  NULL);
+	g_signal_connect (event,
+			  "scroll-event",
+			  G_CALLBACK (brasero_player_image_scroll),
+			  obj);
+	gtk_widget_show (event);
+
 	obj->priv->image_display = gtk_image_new ();
 	gtk_widget_show (obj->priv->image_display);
 	gtk_misc_set_alignment (GTK_MISC (obj->priv->image_display), 1.0, 0.0);
-	gtk_notebook_append_page (GTK_NOTEBOOK (obj->priv->notebook),
-				  obj->priv->image_display,
-				  NULL);
+	gtk_container_add (GTK_CONTAINER (event), obj->priv->image_display);
 
 	obj->priv->bacon = brasero_player_bacon_new ();
 	gtk_widget_show (obj->priv->bacon);
@@ -1392,6 +1452,11 @@ brasero_player_init (BraseroPlayer *obj)
 			  "eof",
 			  G_CALLBACK (brasero_player_eof_cb),
 			  obj);
+	g_signal_connect (obj->priv->bacon,
+			  "scroll-event",
+			  G_CALLBACK (brasero_player_video_scroll),
+			  obj);
+
 	gtk_notebook_append_page (GTK_NOTEBOOK (obj->priv->notebook),
 				  obj->priv->bacon,
 				  NULL);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]