packages: nautilus-ideviceinfo/nautilus-ideviceinfo-gtk3.patch (NEW) - port...

megabajt megabajt at pld-linux.org
Fri May 13 18:38:05 CEST 2011


Author: megabajt                     Date: Fri May 13 16:38:05 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- port to gtk+3

---- Files affected:
packages/nautilus-ideviceinfo:
   nautilus-ideviceinfo-gtk3.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/nautilus-ideviceinfo/nautilus-ideviceinfo-gtk3.patch
diff -u /dev/null packages/nautilus-ideviceinfo/nautilus-ideviceinfo-gtk3.patch:1.1
--- /dev/null	Fri May 13 18:38:05 2011
+++ packages/nautilus-ideviceinfo/nautilus-ideviceinfo-gtk3.patch	Fri May 13 18:38:00 2011
@@ -0,0 +1,257 @@
+--- nautilus-ideviceinfo-0.1.0/src/rb-segmented-bar.c.gtk3	2011-05-13 16:19:31.445656321 +0200
++++ nautilus-ideviceinfo-0.1.0/src/rb-segmented-bar.c	2011-05-13 18:19:41.983130611 +0200
+@@ -38,12 +38,9 @@
+ #define MINIMUM_HEIGHT 26
+ 
+ static void rb_segmented_bar_finalize (GObject *object);
+-static void rb_segmented_bar_size_request (GtkWidget *widget,
+-					   GtkRequisition *requisition);
+ static void rb_segmented_bar_size_allocate(GtkWidget *widget,
+ 					   GtkAllocation *allocation);
+-static gboolean rb_segmented_bar_expose (GtkWidget *widget,
+-					 GdkEventExpose *event);
++static gboolean rb_segmented_bar_draw (GtkWidget *widget, cairo_t *context);
+ static void rb_segmented_bar_get_property (GObject *object, guint param_id,
+ 					   GValue *value, GParamSpec *pspec);
+ static void rb_segmented_bar_set_property (GObject *object, guint param_id,
+@@ -51,6 +48,12 @@ static void rb_segmented_bar_set_propert
+ 
+ static gchar *rb_segmented_bar_default_value_formatter (gdouble percent,
+ 						       	gpointer data);
++static void rb_segmented_bar_get_preferred_height (GtkWidget *widget,
++						   int *minimum_height,
++						   int *natural_height);
++static void rb_segmented_bar_get_preferred_width (GtkWidget *widget,
++						  int *minimum_width,
++						  int *natural_width);
+ 
+ static void compute_layout_size (RBSegmentedBar *bar);
+ 
+@@ -135,7 +138,7 @@ rb_segmented_bar_init (RBSegmentedBar *b
+ 	priv->segment_box_size = 12;
+ 	priv->segment_box_spacing = 6;
+ 	priv->value_formatter = rb_segmented_bar_default_value_formatter;
+-	GTK_WIDGET_SET_FLAGS (GTK_WIDGET (bar), GTK_NO_WINDOW);
++	gtk_widget_set_has_window (GTK_WIDGET (bar), FALSE);
+ }
+ 
+ static void
+@@ -148,8 +151,9 @@ rb_segmented_bar_class_init (RBSegmented
+ 	object_class->get_property = rb_segmented_bar_get_property;
+ 	object_class->set_property = rb_segmented_bar_set_property;
+ 
+-	widget_class->expose_event = rb_segmented_bar_expose;
+-	widget_class->size_request = rb_segmented_bar_size_request;
++	widget_class->draw = rb_segmented_bar_draw;
++	widget_class->get_preferred_height = rb_segmented_bar_get_preferred_height;
++	widget_class->get_preferred_width = rb_segmented_bar_get_preferred_width;
+ 	widget_class->size_allocate = rb_segmented_bar_size_allocate;
+ 
+         /**
+@@ -263,29 +267,44 @@ rb_segmented_bar_default_value_formatter
+ }
+ 
+ static void
+-rb_segmented_bar_size_request (GtkWidget *widget,
+-			       GtkRequisition *requisition)
++rb_segmented_bar_get_preferred_height (GtkWidget *widget, int *minimum_height, int *natural_height)
+ {
+ 	RBSegmentedBarPrivate *priv;
+-	guint real_height;
+-
+-	g_return_if_fail (requisition != NULL);
++	guint height;
+ 
+ 	priv = RB_SEGMENTED_BAR_GET_PRIVATE (RB_SEGMENTED_BAR (widget));
+ 
+ 	if (priv->reflect) {
+-		real_height = MINIMUM_HEIGHT*1.75;
++		height = MINIMUM_HEIGHT * 1.75;
+ 	} else {
+-		real_height = MINIMUM_HEIGHT;
++		height = MINIMUM_HEIGHT;
+ 	}
+ 	if (priv->show_labels) {
+ 		compute_layout_size (RB_SEGMENTED_BAR (widget));
+-		requisition->height = MAX (MINIMUM_HEIGHT + priv->bar_label_spacing + priv->layout_height,
+-						 real_height);
+-	} else {
+-		requisition->height = real_height;
++		height = MAX (MINIMUM_HEIGHT + priv->bar_label_spacing + priv->layout_height, height);
+ 	}
+-	requisition->width = MAX (priv->layout_width, 200);
++
++	if (minimum_height)
++		*minimum_height = height;
++	if (natural_height)
++		*natural_height = height;
++}
++
++static void
++rb_segmented_bar_get_preferred_width (GtkWidget *widget, int *minimum_width, int *natural_width)
++{
++	RBSegmentedBarPrivate *priv;
++	int width;
++
++	priv = RB_SEGMENTED_BAR_GET_PRIVATE (RB_SEGMENTED_BAR (widget));
++
++	compute_layout_size (RB_SEGMENTED_BAR (widget));
++	width = MAX (priv->layout_width, 200);
++
++	if (minimum_width)
++		*minimum_width = width;
++	if (natural_width)
++		*natural_width = width;
+ }
+ 
+ static PangoLayout *create_adapt_layout (GtkWidget *widget, PangoLayout *layout,
+@@ -389,6 +408,7 @@ rb_segmented_bar_size_allocate(GtkWidget
+ { 
+ 	guint real_height;
+ 	RBSegmentedBarPrivate *priv = RB_SEGMENTED_BAR_GET_PRIVATE (widget);
++	GtkAllocation new_allocation;
+ 
+ 	g_return_if_fail(RB_IS_SEGMENTED_BAR(widget)); 
+ 	g_return_if_fail(allocation != NULL); 
+@@ -398,15 +418,16 @@ rb_segmented_bar_size_allocate(GtkWidget
+ 	} else {
+ 		real_height = priv->bar_height;
+ 	}
+-	widget->allocation = *allocation; 
++	gtk_widget_set_allocation (widget, allocation); 
+ 	if (priv->show_labels) {
+ 		compute_layout_size (RB_SEGMENTED_BAR (widget));
+-		widget->allocation.height = MAX (priv->bar_height + priv->bar_label_spacing + priv->layout_height,
+-						 real_height);
++		new_allocation.height = MAX (priv->bar_height + priv->bar_label_spacing + priv->layout_height,
++					     real_height);
+ 	} else {
+-		widget->allocation.height = real_height;
++		new_allocation.height = real_height;
+ 	}
+-	widget->allocation.width = priv->layout_width + 2*(priv->h_padding);
++	new_allocation.width = priv->layout_width + 2*(priv->h_padding);
++	gtk_widget_set_allocation (widget, &new_allocation);
+ 	GTK_WIDGET_CLASS(rb_segmented_bar_parent_class)->size_allocate(widget, allocation); 
+ }
+ 
+@@ -647,7 +668,7 @@ static void rb_segmented_bar_render_labe
+ 	RBSegmentedBarPrivate *priv;
+ 	PangoLayout *layout;
+ 	Color text_color;
+-	GdkColor *gdk_color;
++	GdkRGBA gdk_color;
+ 	int x = 0;
+ 	GList *it;
+ 	gboolean is_rtl = (gtk_widget_get_direction(GTK_WIDGET(bar)) == GTK_TEXT_DIR_RTL);
+@@ -657,10 +678,12 @@ static void rb_segmented_bar_render_labe
+ 	if (priv->segments == NULL) {
+ 		return;
+ 	}
+-	gdk_color = &GTK_WIDGET (bar)->style->fg[GTK_WIDGET_STATE (GTK_WIDGET (bar))];
+-	text_color.red = gdk_color->red / 65535.0;
+-	text_color.green = gdk_color->green / 65535.0;
+-	text_color.blue = gdk_color->blue / 65535.0;
++	gtk_style_context_get_color (gtk_widget_get_style_context (GTK_WIDGET (bar)),
++				     gtk_widget_get_state_flags (GTK_WIDGET (bar)),
++				     &gdk_color);
++	text_color.red = gdk_color.red;
++	text_color.green = gdk_color.green;
++	text_color.blue = gdk_color.blue;
+ 	text_color.alpha = 1.0;
+ 	layout = NULL;
+ 	if (is_rtl) {
+@@ -739,38 +762,35 @@ static void rb_segmented_bar_render_labe
+ }
+ 
+ static gboolean
+-rb_segmented_bar_expose (GtkWidget *widget,
+-			 GdkEventExpose *event)
++rb_segmented_bar_draw (GtkWidget *widget, cairo_t *context_)
+ {
+ 	RBSegmentedBar *bar;
+ 	RBSegmentedBarPrivate *priv;
+-	cairo_t *context;
++	GtkAllocation allocation;
+ 	cairo_pattern_t *bar_pattern;
++	cairo_t *context;
+ 
+ 	g_return_val_if_fail (RB_IS_SEGMENTED_BAR (widget), FALSE);
+-	if (GTK_WIDGET_DRAWABLE (widget) == FALSE) {
+-		return FALSE;
+-	}
+ 
+ 	bar = RB_SEGMENTED_BAR (widget);
+ 	priv = RB_SEGMENTED_BAR_GET_PRIVATE (bar);
+-
+-	context = gdk_cairo_create (GDK_DRAWABLE (widget->window));
++	
++	context = gdk_cairo_create (gtk_widget_get_window (widget));
+ 	
+ 	if (priv->reflect) {
+ 		cairo_push_group (context);
+ 	}
+ 
+ 	cairo_set_operator (context, CAIRO_OPERATOR_OVER);
+-	cairo_translate (context, widget->allocation.x + priv->h_padding,
+-			 widget->allocation.y);
++	gtk_widget_get_allocation (widget, &allocation);
++	cairo_translate (context, allocation.x + priv->h_padding, allocation.y);
+ 	cairo_rectangle (context, 0, 0,
+-			 widget->allocation.width - priv->h_padding,
++			 allocation.width - priv->h_padding,
+ 			 MAX (2*priv->bar_height, priv->bar_height + priv->bar_label_spacing + priv->layout_height));
+ 	cairo_clip (context);
+ 
+ 	bar_pattern = rb_segmented_bar_render (bar, 
+-					       widget->allocation.width - 2*priv->h_padding,
++					       allocation.width - 2*priv->h_padding,
+ 					       priv->bar_height);
+ 
+ 	cairo_save (context);
+@@ -785,7 +805,7 @@ rb_segmented_bar_expose (GtkWidget *widg
+ 		cairo_save (context);
+ 
+ 		cairo_rectangle (context, 0, priv->bar_height,
+-				 widget->allocation.width - priv->h_padding,
++				 allocation.width - priv->h_padding,
+ 				 priv->bar_height);
+ 		cairo_clip (context);
+ 		cairo_matrix_init_scale (&matrix, 1, -1);
+@@ -812,11 +832,11 @@ rb_segmented_bar_expose (GtkWidget *widg
+ 	if (priv->show_labels) {
+ 		if (priv->reflect) {
+ 			cairo_translate (context,
+-					 widget->allocation.x + (widget->allocation.width - priv->layout_width)/2,
+-					 widget->allocation.y + priv->bar_height + priv->bar_label_spacing);
++					 allocation.x + (allocation.width - priv->layout_width)/2,
++					 allocation.y + priv->bar_height + priv->bar_label_spacing);
+ 		} else {
+ 			cairo_translate (context,
+-					 -priv->h_padding + (widget->allocation.width - priv->layout_width)/2,
++					 -priv->h_padding + (allocation.width - priv->layout_width)/2,
+ 					 priv->bar_height + priv->bar_label_spacing);
+ 		}
+ 		rb_segmented_bar_render_labels (bar, context);
+--- nautilus-ideviceinfo-0.1.0/configure.ac.gtk3	2011-05-13 18:10:44.909373522 +0200
++++ nautilus-ideviceinfo-0.1.0/configure.ac	2011-05-13 18:12:26.188824843 +0200
+@@ -17,8 +17,8 @@ AC_PROG_LIBTOOL
+ LIBIMOBILE_REQS=0.9.7
+ GLIB2_REQS=2.14.1
+ LIBPLIST_REQS=0.15
+-GTK2_REQS=2.16
+-NAUTILUS_REQS=2.21.2
++GTK3_REQS=3.0.0
++NAUTILUS_REQS=3.0.0
+ LIBGPOD_REQS=0.7.90
+ LIBXML_REQS=2.6.30
+ 
+@@ -26,7 +26,7 @@ LIBXML_REQS=2.6.30
+ PKG_CHECK_MODULES(WIDGET, libimobiledevice-1.0 >= $LIBIMOBILE_REQS
+ 		          glib-2.0 >= $GLIB2_REQS
+ 			  libplist >= $LIBPLIST_REQS
+-			  gtk+-2.0 >= $GTK2_REQS)
++			  gtk+-3.0 >= $GTK3_REQS)
+ PKG_CHECK_MODULES(libnautilusextension, libnautilus-extension >= $NAUTILUS_REQS)
+ PKG_CHECK_MODULES(libgpod, libgpod-1.0 >= $LIBGPOD_REQS, enable_libgpod=yes, enable_libgpod=no)
+ PKG_CHECK_MODULES(libxml, libxml-2.0 >= $LIBXML_REQS)
================================================================


More information about the pld-cvs-commit mailing list