[gthumb] Replacing references for members being accessed directly by their getters and setters



commit aa218da1e3ffdfa2ef6b5dbb7e651fa8f8cd51a1
Author: Lincoln de Sousa <lincoln comum org>
Date:   Fri May 13 17:30:35 2011 -0300

    Replacing references for members being accessed directly by their getters and setters
    
    In other words, we are now making it possible to compile gthumb with the
    --enable-gseal flag.

 extensions/file_manager/callbacks.c                |   30 ++++++++------------
 extensions/gstreamer_tools/gth-media-viewer-page.c |    4 +-
 extensions/image_viewer/gth-image-viewer-page.c    |    7 ++++-
 3 files changed, 20 insertions(+), 21 deletions(-)
---
diff --git a/extensions/file_manager/callbacks.c b/extensions/file_manager/callbacks.c
index 14bbb0a..1ea2c19 100644
--- a/extensions/file_manager/callbacks.c
+++ b/extensions/file_manager/callbacks.c
@@ -268,27 +268,22 @@ gth_file_list_drag_data_received (GtkWidget        *file_view,
 	gboolean     success = FALSE;
 	char       **uris;
 	GList       *selected_files;
+	GdkDragAction action;
 
 	g_signal_stop_emission_by_name (file_view, "drag-data-received");
 
-	/*
-	if ((gdk_drag_context_get_suggested_action (context) == GDK_ACTION_COPY)
-	    || (gdk_drag_context_get_suggested_action (context) == GDK_ACTION_MOVE))
-	{
-		success = TRUE;
-	}
-	*/
-
-	if ((context->suggested_action == GDK_ACTION_COPY)
-	    || (context->suggested_action == GDK_ACTION_MOVE)
-	    || (context->suggested_action == GDK_ACTION_ASK))
-	{
+	action = gdk_drag_context_get_suggested_action (context);
+	if (action == GDK_ACTION_COPY || action == GDK_ACTION_MOVE) {
 		success = TRUE;
 	}
 
-	if (context->suggested_action == GDK_ACTION_ASK) {
-		context->action = _gtk_menu_ask_drag_drop_action (file_view, context->actions, time);
-		success = context->action != 0;
+	if (action == GDK_ACTION_ASK) {
+		GdkDragAction actions =
+			_gtk_menu_ask_drag_drop_action (file_view,
+							gdk_drag_context_get_actions (context),
+							time);
+		gdk_drag_status (context, actions, time);
+		success = gdk_drag_context_get_selected_action (context) != 0;
 	}
 
 	gtk_drag_finish (context, success, FALSE, time);
@@ -325,8 +320,7 @@ gth_file_list_drag_data_received (GtkWidget        *file_view,
 			gboolean       move;
 
 			file_source = gth_browser_get_location_source (browser);
-			/*move = gdk_drag_context_get_action (context) == GDK_ACTION_MOVE;*/
-			move = context->action == GDK_ACTION_MOVE;
+			move = gdk_drag_context_get_selected_action (context) == GDK_ACTION_MOVE;
 			if (move && ! gth_file_source_can_cut (file_source, (GFile *) selected_files->data)) {
 				GtkWidget *dialog;
 				int        response;
@@ -457,7 +451,7 @@ gth_file_list_drag_motion (GtkWidget      *file_view,
 			data->scroll_event = 0;
 		}
 	}
-	else if (context->suggested_action == GDK_ACTION_ASK)
+	else if (gdk_drag_context_get_suggested_action (context) == GDK_ACTION_ASK)
 		gdk_drag_status (context, GDK_ACTION_ASK, time);
 	else
 		gdk_drag_status (context, GDK_ACTION_COPY, time);
diff --git a/extensions/gstreamer_tools/gth-media-viewer-page.c b/extensions/gstreamer_tools/gth-media-viewer-page.c
index 768e56c..0c95bb3 100644
--- a/extensions/gstreamer_tools/gth-media-viewer-page.c
+++ b/extensions/gstreamer_tools/gth-media-viewer-page.c
@@ -751,7 +751,7 @@ remove_fullscreen_toolbar (GthMediaViewerPage *self)
 	if (self->priv->fullscreen_toolbar == NULL)
 		return;
 
-	if (self->priv->mediabar->parent == self->priv->fullscreen_toolbar) {
+	if (gtk_widget_get_parent (self->priv->mediabar) == self->priv->fullscreen_toolbar) {
 		g_object_ref (self->priv->mediabar);
 		gtk_container_remove (GTK_CONTAINER (self->priv->fullscreen_toolbar), self->priv->mediabar);
 		gtk_box_pack_start (GTK_BOX (self->priv->area_box), self->priv->mediabar, FALSE, FALSE, 0);
@@ -1139,7 +1139,7 @@ gth_media_viewer_page_real_fullscreen (GthViewerPage *base,
 		gtk_container_set_border_width (GTK_CONTAINER (self->priv->fullscreen_toolbar), 0);
 	}
 
-	if (self->priv->mediabar->parent == self->priv->area_box) {
+	if (gtk_widget_get_parent (self->priv->mediabar) == self->priv->area_box) {
 		g_object_ref (self->priv->mediabar);
 		gtk_container_remove (GTK_CONTAINER (self->priv->area_box), self->priv->mediabar);
 		gtk_container_add (GTK_CONTAINER (self->priv->fullscreen_toolbar), self->priv->mediabar);
diff --git a/extensions/image_viewer/gth-image-viewer-page.c b/extensions/image_viewer/gth-image-viewer-page.c
index 9fe157c..7781094 100644
--- a/extensions/image_viewer/gth-image-viewer-page.c
+++ b/extensions/image_viewer/gth-image-viewer-page.c
@@ -604,6 +604,8 @@ paint_comment_over_image_func (GthImageViewer *image_viewer,
 	int                 text_y;
 	int                 icon_x;
 	int                 icon_y;
+	GtkStyle           *style;
+	PangoFontDescription *font;
 
 	file_info = g_string_new ("");
 
@@ -634,9 +636,12 @@ paint_comment_over_image_func (GthImageViewer *image_viewer,
 			        n_visibles,
 				g_file_info_get_attribute_string (file_data->info, "standard::display-name"));
 
+	style = gtk_widget_get_style (GTK_WIDGET (self->priv->viewer));
 	layout = gtk_widget_create_pango_layout (GTK_WIDGET (self->priv->viewer), NULL);
+	gtk_style_get (style, PANGO_TYPE_FONT_DESCRIPTION, "font", &font, NULL);
+
 	pango_layout_set_wrap (layout, PANGO_WRAP_WORD);
-	pango_layout_set_font_description (layout, GTK_WIDGET (self->priv->viewer)->style->font_desc);
+	pango_layout_set_font_description (layout, font);
 	pango_layout_set_alignment (layout, PANGO_ALIGN_LEFT);
 
 	if (! pango_parse_markup (file_info->str,



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