]> git.street.me.uk Git - andy/viking.git/commitdiff
Update to at least Gtk2.16.
authorRob Norris <rw_norris@hotmail.com>
Sun, 15 Sep 2013 20:58:11 +0000 (21:58 +0100)
committerRob Norris <rw_norris@hotmail.com>
Sat, 26 Oct 2013 13:46:02 +0000 (14:46 +0100)
Use later method for getting allocated widget sizes.

configure.ac
src/print-preview.c
src/viktrwlayer_propwin.c
src/vikviewport.c

index 3a5cf3d387f99cd3430b6e3ef4d0d921b60fa4f1..73b57b92f598f42e3c90f916f734b839ba15c625 100644 (file)
@@ -67,7 +67,7 @@ dnl  ------------------
 PKG_CHECK_MODULES(PACKAGE, [
         glib-2.0          >= 2.16
         gthread-2.0       >= 2.2
-        gtk+-2.0          >= 2.14
+        gtk+-2.0          >= 2.16
         gio-2.0           >= 2.12
 ])
 
index 82096055cb0e450e0902e5812e2e85bc2651e754..0ac7ab624ea1fa9ebeb5957cb1b6b89218a47005 100644 (file)
@@ -495,8 +495,10 @@ vik_print_preview_expose_event (GtkWidget        *widget,
 
       if (preview->pixbuf == NULL)
         {
-          gint width  = MIN (widget->allocation.width, 1024);
-          gint height = MIN (widget->allocation.height, 1024);
+          GtkAllocation allocation;
+          gtk_widget_get_allocation ( widget, &allocation );
+          gint width  = MIN (allocation.width, 1024);
+          gint height = MIN (allocation.height, 1024);
 
           preview->pixbuf = get_thumbnail(drawable, width, height);
         }
index fcd3effbc63c4ffcb46e41a05958aab11136c8d0..dccaf7be5243dad20f45c5ad946fa3dd77c43671 100644 (file)
@@ -350,7 +350,9 @@ static void save_image_and_draw_graph_marks (GtkWidget *image,
   saved_img->saved = TRUE;
 
   if ((marker_x >= MARGIN) && (marker_x < (PROFILE_WIDTH + MARGIN))) {
-    gdk_draw_line (GDK_DRAWABLE(pix), gc, marker_x, 0, marker_x, image->allocation.height);
+    GtkAllocation allocation;
+    gtk_widget_get_allocation ( image, &allocation );
+    gdk_draw_line (GDK_DRAWABLE(pix), gc, marker_x, 0, marker_x, allocation.height);
     *marker_drawn = TRUE;
   }
   else
@@ -414,7 +416,10 @@ static void track_graph_click( GtkWidget *event_box, GdkEventButton *event, Prop
       graph_type == PROPWIN_GRAPH_TYPE_DISTANCE_TIME ||
       graph_type == PROPWIN_GRAPH_TYPE_ELEVATION_TIME );
 
-  VikTrackpoint *trackpoint = set_center_at_graph_position(event->x, event_box->allocation.width, widgets->vtl, widgets->vlp, widgets->vvp, widgets->tr, is_time_graph, widgets->profile_width);
+  GtkAllocation allocation;
+  gtk_widget_get_allocation ( event_box, &allocation );
+
+  VikTrackpoint *trackpoint = set_center_at_graph_position(event->x, allocation.width, widgets->vtl, widgets->vlp, widgets->vvp, widgets->tr, is_time_graph, widgets->profile_width);
   // Unable to get the point so give up
   if ( trackpoint == NULL ) {
     gtk_dialog_set_response_sensitive(GTK_DIALOG(widgets->dialog), VIK_TRW_LAYER_PROPWIN_SPLIT_MARKER, FALSE);
@@ -639,7 +644,10 @@ void track_profile_move( GtkWidget *event_box, GdkEventMotion *event, PropWidget
   else
     mouse_x = event->x;
 
-  gdouble x = mouse_x - event_box->allocation.width / 2 + widgets->profile_width / 2 - MARGIN / 2;
+  GtkAllocation allocation;
+  gtk_widget_get_allocation ( event_box, &allocation );
+
+  gdouble x = mouse_x - allocation.width / 2 + widgets->profile_width / 2 - MARGIN / 2;
   if (x < 0)
     x = 0;
   if (x > widgets->profile_width)
@@ -716,7 +724,10 @@ void track_gradient_move( GtkWidget *event_box, GdkEventMotion *event, PropWidge
   else
     mouse_x = event->x;
 
-  gdouble x = mouse_x - event_box->allocation.width / 2 + widgets->profile_width / 2 - MARGIN / 2;
+  GtkAllocation allocation;
+  gtk_widget_get_allocation ( event_box, &allocation );
+
+  gdouble x = mouse_x - allocation.width / 2 + widgets->profile_width / 2 - MARGIN / 2;
   if (x < 0)
     x = 0;
   if (x > widgets->profile_width)
@@ -793,7 +804,9 @@ void track_vt_move( GtkWidget *event_box, GdkEventMotion *event, PropWidgets *wi
   else
     mouse_x = event->x;
 
-  gdouble x = mouse_x - event_box->allocation.width / 2 + widgets->profile_width / 2 - MARGIN / 2;
+  GtkAllocation allocation;
+  gtk_widget_get_allocation ( event_box, &allocation );
+  gdouble x = mouse_x - allocation.width / 2 + widgets->profile_width / 2 - MARGIN / 2;
   if (x < 0)
     x = 0;
   if (x > widgets->profile_width)
@@ -887,7 +900,10 @@ void track_dt_move( GtkWidget *event_box, GdkEventMotion *event, PropWidgets *wi
   else
     mouse_x = event->x;
 
-  gdouble x = mouse_x - event_box->allocation.width / 2 + widgets->profile_width / 2 - MARGIN / 2;
+  GtkAllocation allocation;
+  gtk_widget_get_allocation ( event_box, &allocation );
+
+  gdouble x = mouse_x - allocation.width / 2 + widgets->profile_width / 2 - MARGIN / 2;
   if (x < 0)
     x = 0;
   if (x > widgets->profile_width)
@@ -966,7 +982,10 @@ void track_et_move( GtkWidget *event_box, GdkEventMotion *event, PropWidgets *wi
   else
     mouse_x = event->x;
 
-  gdouble x = mouse_x - event_box->allocation.width / 2 + widgets->profile_width / 2 - MARGIN / 2;
+  GtkAllocation allocation;
+  gtk_widget_get_allocation ( event_box, &allocation );
+
+  gdouble x = mouse_x - allocation.width / 2 + widgets->profile_width / 2 - MARGIN / 2;
   if (x < 0)
     x = 0;
   if (x > widgets->profile_width)
@@ -1042,7 +1061,10 @@ void track_sd_move( GtkWidget *event_box, GdkEventMotion *event, PropWidgets *wi
   else
     mouse_x = event->x;
 
-  gdouble x = mouse_x - event_box->allocation.width / 2 + widgets->profile_width / 2 - MARGIN / 2;
+  GtkAllocation allocation;
+  gtk_widget_get_allocation ( event_box, &allocation );
+
+  gdouble x = mouse_x - allocation.width / 2 + widgets->profile_width / 2 - MARGIN / 2;
   if (x < 0)
     x = 0;
   if (x > widgets->profile_width)
index 28216d9d39bb41c3c4d54eddb4ff005171e0dd34..f7c98ffa66bcb3e27e7d360ca2457b9f93217193 100644 (file)
@@ -340,8 +340,10 @@ gboolean vik_viewport_configure ( VikViewport *vvp )
 {
   g_return_val_if_fail ( vvp != NULL, TRUE );
 
-  vvp->width = GTK_WIDGET(vvp)->allocation.width;
-  vvp->height = GTK_WIDGET(vvp)->allocation.height;
+  GtkAllocation allocation;
+  gtk_widget_get_allocation ( GTK_WIDGET(vvp), &allocation );
+  vvp->width = allocation.width;
+  vvp->height = allocation.height;
 
   vvp->width_2 = vvp->width/2;
   vvp->height_2 = vvp->height/2;