]> git.sur5r.net Git - glabels/commitdiff
Fixed low hanging deprecations and warnings.
authorJim Evins <evins@snaught.com>
Mon, 20 May 2013 01:26:32 +0000 (18:26 -0700)
committerJim Evins <evins@snaught.com>
Mon, 20 May 2013 01:26:32 +0000 (18:26 -0700)
17 files changed:
src/color-combo-button.c
src/color-combo.c
src/field-button.c
src/font-combo-menu-item.c
src/font-combo.c
src/font-util.c
src/label-image.c
src/label-object.c
src/label-text.c
src/label.h
src/merge-text.c
src/mini-preview.c
src/str-util.h
src/ui-property-bar.c
src/view.c
src/window.c
src/xml-label.c

index 8a5e988d46524db7de11f9cf941b88048188ade2..11b304c6652d5fafd7a5cfbf90d98d901bb9d48c 100644 (file)
@@ -138,7 +138,7 @@ gl_color_combo_button_init (glColorComboButton *this)
 
         this->priv = g_new0 (glColorComboButtonPrivate, 1);
 
-        this->priv->button_vbox = gtk_vbox_new (FALSE, 0);
+        this->priv->button_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
 
         this->priv->button = gtk_toggle_button_new ();
         gtk_container_add (GTK_CONTAINER (this->priv->button), this->priv->button_vbox);
@@ -339,7 +339,7 @@ menu_position_function (GtkMenu            *menu,
         /*
          * Size of menu.
          */
-        gtk_widget_size_request (this->priv->menu, &menu_requisition);
+        gtk_widget_get_preferred_size (this->priv->menu, NULL, &menu_requisition);
         h_menu = menu_requisition.height;
         w_menu = menu_requisition.width;
 
index ea29ebe10c630bcbc45968927730f61731d11a11..d2ec63ec80789531d9e5cd34f5510779c871c33f 100644 (file)
@@ -129,7 +129,7 @@ gl_color_combo_init (glColorCombo *this)
 
         this->priv = g_new0 (glColorComboPrivate, 1);
 
-        hbox = gtk_hbox_new (FALSE, 3);
+        hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 3);
         gtk_container_add (GTK_CONTAINER (this), hbox);
         
         this->priv->swatch = gl_color_swatch_new (IMAGE_W, IMAGE_H, GL_COLOR_NONE);
@@ -277,7 +277,7 @@ menu_position_function (GtkMenu       *menu,
         /*
          * Size of menu.
          */
-        gtk_widget_size_request (this->priv->menu, &menu_requisition);
+        gtk_widget_get_preferred_size (this->priv->menu, NULL, &menu_requisition);
         h_menu = menu_requisition.height;
         w_menu = menu_requisition.width;
 
index 8b8c4e5b379e8560bef886ce3ffe73a91b5c493b..98a803c1a2e28e612fd2fdeb63c2d82472bb612d 100644 (file)
@@ -129,7 +129,7 @@ gl_field_button_init (glFieldButton *this)
 
         this->priv = g_new0 (glFieldButtonPrivate, 1);
 
-        hbox = gtk_hbox_new (FALSE, 3);
+        hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 3);
         gtk_container_add (GTK_CONTAINER (this), hbox);
         
         this->priv->label = gtk_label_new ("");
@@ -283,7 +283,7 @@ menu_position_function (GtkMenu       *menu,
         /*
          * Size of menu.
          */
-        gtk_widget_size_request (this->priv->menu, &menu_requisition);
+        gtk_widget_get_preferred_size (this->priv->menu, NULL, &menu_requisition);
         h_menu = menu_requisition.height;
         w_menu = menu_requisition.width;
 
index 6d958d6d535deead8326fee08b0537fba1c2f0a0..1f125188bf5d6c1a58caaf9a11e2cc9469abbf47 100644 (file)
@@ -142,7 +142,7 @@ gl_font_combo_menu_item_new (gchar *font_family)
 
         this->priv->font_family = g_strdup (font_family);
 
-        hbox = gtk_hbox_new (FALSE, 6);
+        hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
         gtk_container_add (GTK_CONTAINER (this), hbox);
 
         sample = gl_font_sample_new (SAMPLE_W, SAMPLE_H, short_sample_text, font_family);
index 3c9480f5965a69c05decd378b87f041aa0b4cb2d..cf24d9de0702cd462abff328049064f30904aa4f 100644 (file)
@@ -118,7 +118,7 @@ gl_font_combo_init (glFontCombo *this)
 
         this->priv = g_new0 (glFontComboPrivate, 1);
 
-        hbox = gtk_hbox_new (FALSE, 3);
+        hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 3);
         gtk_container_add (GTK_CONTAINER (this), hbox);
         
         this->priv->label = gtk_label_new ("");
@@ -258,7 +258,7 @@ menu_position_function (GtkMenu      *menu,
         /*
          * Size of menu.
          */
-        gtk_widget_size_request (this->priv->menu, &menu_requisition);
+        gtk_widget_get_preferred_size (this->priv->menu, NULL, &menu_requisition);
         h_menu = menu_requisition.height;
         w_menu = menu_requisition.width;
 
index a9c67e969b207f88712bfc4ba26891369e53d30f..88ecf1191404f3867954b7a6b188bb4b5ea87ea0 100644 (file)
@@ -46,7 +46,7 @@ gl_font_util_get_all_families (void)
         if ( !list )
         {
                 fontmap = pango_cairo_font_map_new ();
-                context = pango_cairo_font_map_create_context (PANGO_CAIRO_FONT_MAP (fontmap));
+                context = pango_font_map_create_context (PANGO_FONT_MAP (fontmap));
 
                 pango_context_list_families (context, &families, &n);
 
@@ -84,7 +84,7 @@ gl_font_util_get_proportional_families (void)
         if ( !list )
         {
                 fontmap = pango_cairo_font_map_new ();
-                context = pango_cairo_font_map_create_context (PANGO_CAIRO_FONT_MAP (fontmap));
+                context = pango_font_map_create_context (PANGO_FONT_MAP (fontmap));
 
                 pango_context_list_families (context, &families, &n);
 
@@ -125,7 +125,7 @@ gl_font_util_get_fixed_width_families (void)
         if ( !list )
         {
                 fontmap = pango_cairo_font_map_new ();
-                context = pango_cairo_font_map_create_context (PANGO_CAIRO_FONT_MAP (fontmap));
+                context = pango_font_map_create_context (PANGO_FONT_MAP (fontmap));
 
                 pango_context_list_families (context, &families, &n);
 
index f5e458559ea87149080b91e1e2e91dd8fb37679b..4a64f203a0114c188bbf4dc21a51c2df61914849 100644 (file)
@@ -26,7 +26,6 @@
 #include <glib.h>
 #include <gdk/gdk.h>
 #include <librsvg/rsvg.h>
-#include <librsvg/rsvg-cairo.h>
 
 #include "pixbuf-util.h"
 #include "file-util.h"
index 8d48e53a4e7e87937bd4790fd56a16a3fdc39c56..987f1b549995f1e6b28ce859972c82685ae39b5d 100644 (file)
@@ -381,8 +381,6 @@ gl_label_object_set_position (glLabelObject *object,
                              gdouble        y,
                               gboolean       checkpoint)
 {
-       gdouble  dx, dy;
-
        gl_debug (DEBUG_LABEL, "START");
 
        g_return_if_fail (object && GL_IS_LABEL_OBJECT (object));
@@ -394,9 +392,6 @@ gl_label_object_set_position (glLabelObject *object,
                         gl_label_checkpoint (object->priv->parent, _("Move"));
                 }
 
-               dx = x - object->priv->x;
-               dy = y - object->priv->y;
-
                object->priv->x = x;
                object->priv->y = y;
 
index d51e30008f6eb1f3b7e19261b4b1ac4d2cf95465..3f0305f91532a58cfb44ff9db8f609ce5419fdf0 100644 (file)
@@ -531,7 +531,7 @@ get_size (glLabelObject *object,
 
        
        fontmap = pango_cairo_font_map_new ();
-       context = pango_cairo_font_map_create_context (PANGO_CAIRO_FONT_MAP (fontmap));
+       context = pango_font_map_create_context (PANGO_FONT_MAP (fontmap));
        options = cairo_font_options_create ();
         cairo_font_options_set_hint_style (options, CAIRO_HINT_STYLE_NONE);
         cairo_font_options_set_hint_metrics (options, CAIRO_HINT_METRICS_OFF);
index 0d5937300c5c8c16fde64f24a5a6a8235d61fdf5..f93f6f4e406cb6b35b005ef1fb1abf5e2e547091 100644 (file)
@@ -240,6 +240,9 @@ void          gl_label_set_selection_font_italic_flag (glLabel   *label,
 void          gl_label_set_selection_text_alignment (glLabel        *label,
                                                      PangoAlignment  text_alignment);
 
+void          gl_label_set_selection_text_valignment (glLabel        *label,
+                                                      glValignment    text_valignment);
+
 void          gl_label_set_selection_text_line_spacing (glLabel  *label,
                                                         gdouble   text_line_spacing);
 
index 4c1f7123b16caf49cfa7e3a312c328edd545e324..c60b26900cfb5da0b9a92afec876992c774c6e5d 100644 (file)
@@ -90,7 +90,6 @@ static void           gl_merge_text_copy            (glMerge          *dst_merge
 
 static GList         *parse_line                    (FILE             *fp,
                                                     gchar             delim);
-static gchar         *parse_field                   (gchar            *raw_field);
 static void           free_fields                   (GList           **fields);
 
 
@@ -189,7 +188,7 @@ gl_merge_text_set_property (GObject      *object,
        switch (param_id) {
 
        case ARG_DELIM:
-               merge_text->priv->delim = g_value_get_char (value);
+               merge_text->priv->delim = g_value_get_schar (value);
                gl_debug (DEBUG_MERGE, "ARG \"delim\" = \"%c\"",
                          merge_text->priv->delim);
                break;
@@ -225,7 +224,7 @@ gl_merge_text_get_property (GObject     *object,
        switch (param_id) {
 
        case ARG_DELIM:
-               g_value_set_char (value, merge_text->priv->delim);
+               g_value_set_schar (value, merge_text->priv->delim);
                break;
 
         case ARG_LINE1_HAS_KEYS:
index dc92d6e4b7a8ab64d71981bcded5fb2c32e5ddc7..8e64d60c6c3665abab4e7cf73a0e9f0b54a170bd 100644 (file)
@@ -632,7 +632,6 @@ button_press_event_cb (GtkWidget      *widget,
         glMiniPreview     *this = GL_MINI_PREVIEW (widget);
         GdkWindow         *window;
         cairo_t           *cr;
-        gdouble            scale;
         gdouble            x, y;
         gint               i;
 
@@ -645,7 +644,7 @@ button_press_event_cb (GtkWidget      *widget,
 
                 cr = gdk_cairo_create (window);
 
-                scale = set_transform_and_get_scale (this, cr);
+                set_transform_and_get_scale (this, cr);
 
                 x = event->x;
                 y = event->y;
@@ -684,7 +683,6 @@ motion_notify_event_cb (GtkWidget      *widget,
         glMiniPreview *this = GL_MINI_PREVIEW (widget);
         GdkWindow     *window;
         cairo_t       *cr;
-        gdouble        scale;
         gdouble        x, y;
         gint           i;
 
@@ -696,7 +694,7 @@ motion_notify_event_cb (GtkWidget      *widget,
 
                 cr = gdk_cairo_create (window);
 
-                scale = set_transform_and_get_scale (this, cr);
+                set_transform_and_get_scale (this, cr);
 
                 x = event->x;
                 y = event->y;
@@ -979,7 +977,7 @@ draw_labels (glMiniPreview *this,
         lglTemplateOrigin         *origins;
         GtkStyle                  *style;
         guint                      base_color;
-        guint                      highlight_color, paper_color, outline_color;
+        guint                      highlight_color, outline_color;
 
         gl_debug (DEBUG_MINI_PREVIEW, "START");
 
@@ -991,7 +989,6 @@ draw_labels (glMiniPreview *this,
         style = gtk_widget_get_style (GTK_WIDGET(this));
         base_color      = gl_color_from_gdk_color (&style->base[GTK_STATE_SELECTED]);
 
-        paper_color     = gl_color_from_gdk_color (&style->light[GTK_STATE_NORMAL]);
         highlight_color = gl_color_set_opacity (base_color, 0.10);
         if (this->priv->label)
         {
index 76dda77933e9010edc71f274cc870c38ab88ea5b..1451c8fb224218f1a96b59d2a21be13c112fdbba 100644 (file)
 #include <glib.h>
 #include <pango/pango.h>
 
+#include "label-object.h"
+
 G_BEGIN_DECLS
 
 const gchar        *gl_str_util_align_to_string       (PangoAlignment     align);
 PangoAlignment      gl_str_util_string_to_align       (const gchar       *string);
 
+const gchar        *gl_str_util_valign_to_string      (glValignment       valign);
+glValignment        gl_str_util_string_to_valign      (const gchar       *string);
+
 const gchar        *gl_str_util_weight_to_string      (PangoWeight        weight);
 PangoWeight         gl_str_util_string_to_weight      (const gchar       *string);
 
index e4eba22774f285061dbe0a0a2e9b5ed4c9de9c20..dec3a0bef6280722313de6fba6bb03ec9c427f50 100644 (file)
@@ -26,6 +26,7 @@
 #include <gtk/gtk.h>
 #include <string.h>
 
+#include "label.h"
 #include "builder-util.h"
 #include "font-combo.h"
 #include "color-combo-button.h"
index 020713db46b37e602878c048eb3930319fe8a343..23eda5244e1dca0b7be03fa7de0d322f8305ac4f 100644 (file)
@@ -597,8 +597,8 @@ size_allocate_cb (glView         *view,
 
        gl_debug (DEBUG_VIEW, "START");
 
-        hadjustment = gtk_layout_get_hadjustment(GTK_LAYOUT (view->canvas));
-        vadjustment = gtk_layout_get_vadjustment(GTK_LAYOUT (view->canvas));
+        hadjustment = gtk_scrollable_get_hadjustment(GTK_SCROLLABLE (view->canvas));
+        vadjustment = gtk_scrollable_get_vadjustment(GTK_SCROLLABLE (view->canvas));
 
         gtk_adjustment_set_page_size( hadjustment, allocation->width);
         gtk_adjustment_set_page_increment( hadjustment, allocation->width / 2);
@@ -669,8 +669,8 @@ label_resized_cb (glView  *view)
 
        gl_debug (DEBUG_VIEW, "START");
 
-        hadjustment = gtk_layout_get_hadjustment(GTK_LAYOUT (view->canvas));
-        vadjustment = gtk_layout_get_vadjustment(GTK_LAYOUT (view->canvas));
+        hadjustment = gtk_scrollable_get_hadjustment(GTK_SCROLLABLE (view->canvas));
+        vadjustment = gtk_scrollable_get_vadjustment(GTK_SCROLLABLE (view->canvas));
 
         g_signal_emit_by_name (hadjustment, "changed");
         g_signal_emit_by_name (vadjustment, "changed");
@@ -1062,7 +1062,7 @@ gl_view_arrow_mode (glView *view)
 
         cursor = gdk_cursor_new (GDK_LEFT_PTR);
        gdk_window_set_cursor (window, cursor);
-        gdk_cursor_unref (cursor);
+        g_object_unref (G_OBJECT (cursor));
 
        view->mode = GL_VIEW_MODE_ARROW;
         view->state = GL_VIEW_IDLE;
@@ -1113,7 +1113,7 @@ gl_view_object_create_mode (glView            *view,
        }
 
        gdk_window_set_cursor (window, cursor);
-        gdk_cursor_unref (cursor);
+        g_object_unref (G_OBJECT (cursor));
 
        view->mode = GL_VIEW_MODE_OBJECT_CREATE;
         view->state = GL_VIEW_IDLE;
@@ -1437,7 +1437,7 @@ motion_notify_event_cb (glView            *view,
                                 cursor = gdk_cursor_new (GDK_LEFT_PTR);
                         }
                         gdk_window_set_cursor (window, cursor);
-                        gdk_cursor_unref (cursor);
+                        g_object_unref (G_OBJECT (cursor));
                         break;
 
                 case GL_VIEW_ARROW_SELECT_REGION:
@@ -1788,7 +1788,7 @@ button_release_event_cb (glView            *view,
                         view->state = GL_VIEW_IDLE;
                         cursor = gdk_cursor_new (GDK_LEFT_PTR);
                         gdk_window_set_cursor (window, cursor);
-                        gdk_cursor_unref (cursor);
+                        g_object_unref (G_OBJECT (cursor));
 
                         gl_label_select_object (view->label, view->create_object);
                         break;
@@ -1846,7 +1846,7 @@ key_press_event_cb (glView            *view,
                         gl_label_delete_selection (view->label);
                         cursor = gdk_cursor_new (GDK_LEFT_PTR);
                         gdk_window_set_cursor (window, cursor);
-                        gdk_cursor_unref (cursor);
+                        g_object_unref (G_OBJECT (cursor));
                         break;
                 default:
                         return FALSE;
index f2883dc04b7fc6ebe20b70874122dfd139a99e20..ca39c4fdb5af3a9af529cda64cee2d439dbd2100 100644 (file)
@@ -140,7 +140,7 @@ gl_window_init (glWindow *window)
 
        gl_debug (DEBUG_WINDOW, "START");
 
-       vbox1 = gtk_vbox_new (FALSE, 0);
+       vbox1 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
        gtk_container_add (GTK_CONTAINER (window), vbox1);
 
        window->ui = ui = gl_ui_new (window);
@@ -154,7 +154,7 @@ gl_window_init (glWindow *window)
                            gtk_ui_manager_get_widget (ui, "/DrawingToolBar"),
                            FALSE, FALSE, 0);
 
-       window->hbox = gtk_hbox_new (FALSE, 0);
+       window->hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
        gtk_box_pack_start (GTK_BOX (vbox1), window->hbox, TRUE, TRUE, 0);
 
        window->sidebar = GL_UI_SIDEBAR (gl_ui_sidebar_new ());
@@ -163,7 +163,7 @@ gl_window_init (glWindow *window)
        window->property_bar = GL_UI_PROPERTY_BAR (gl_ui_property_bar_new ());
        gtk_box_pack_start (GTK_BOX (vbox1), GTK_WIDGET (window->property_bar), FALSE, FALSE, 0);
 
-       status_hbox = gtk_hbox_new (FALSE, 0);
+       status_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
        gtk_box_pack_start (GTK_BOX (vbox1), status_hbox, FALSE, FALSE, 0);
 
        window->status_bar = gtk_statusbar_new ();
index f7743fd5b8da0264c17cf936bc57a4750abef596..293c0745c26c103aa3cd3e87352eaa73a2c757b2 100644 (file)
@@ -1842,7 +1842,6 @@ xml_create_toplevel_span (xmlNodePtr        parent,
        PangoWeight       font_weight;
        gboolean          font_italic_flag;
        glColorNode      *color_node;
-       PangoAlignment    align;
        gdouble           text_line_spacing;
        GList            *lines, *p_line, *p_node;
        glTextNode       *text_node;
@@ -1868,7 +1867,6 @@ xml_create_toplevel_span (xmlNodePtr        parent,
        }
        gl_color_node_free (&color_node);
        
-       align = gl_label_object_get_text_alignment (GL_LABEL_OBJECT(object_text));
        lgl_xml_set_prop_string (node, "font_family", font_family);
        lgl_xml_set_prop_double (node, "font_size", font_size);
        lgl_xml_set_prop_string (node, "font_weight", gl_str_util_weight_to_string (font_weight));