]> git.sur5r.net Git - glabels/commitdiff
Use accessor functions instead direct access
authorJim Evins <evins@snaught.com>
Sun, 22 Nov 2009 23:50:38 +0000 (18:50 -0500)
committerJim Evins <evins@snaught.com>
Sun, 22 Nov 2009 23:50:38 +0000 (18:50 -0500)
Replaced direct access of widget fields with accessor functions.  This round
catches flags and allocations which now have accessor functions in Gtk 2.18.
As a result, the master branch now requires Gtk-2.18/GNOME-2.28.

15 files changed:
configure.in
docs/libglabels/libglabels-decl-list.txt [deleted file]
src/color-combo-button.c
src/color-combo.c
src/color-swatch.c
src/field-button.c
src/font-combo.c
src/font-sample.c
src/glabels-batch.c
src/merge-text.c
src/mini-label-preview.c
src/mini-preview.c
src/object-editor-edit-page.c
src/view.c
src/wdgt-chain-button.c

index 86315131869da7c47c640f75cce95c4f6caed65f..663d849d4b832ceaf1dc7622a96db96d22ac79ce 100644 (file)
@@ -58,13 +58,13 @@ dnl ---------------------------------------------------------------------------
 dnl - Library dependencies
 dnl ---------------------------------------------------------------------------
 dnl Required dependencies
-GLIB_REQUIRED=2.20.0
-GTK_REQUIRED=2.16.0
-GCONF_REQUIRED=2.26.0
+GLIB_REQUIRED=2.22.0
+GTK_REQUIRED=2.18.0
+GCONF_REQUIRED=2.28.0
 LIBXML_REQUIRED=2.7.0
 
 dnl Optional dependencies
-LIBEBOOK_REQUIRED=2.26.0
+LIBEBOOK_REQUIRED=2.28.0
 LIBBARCODE_REQUIRED=0.98
 LIBQRENCODE_REQUIRED=3.1.0
 LIBIEC16022_REQUIRED=0.2.4
diff --git a/docs/libglabels/libglabels-decl-list.txt b/docs/libglabels/libglabels-decl-list.txt
deleted file mode 100644 (file)
index b86ecf0..0000000
+++ /dev/null
@@ -1,172 +0,0 @@
-<SECTION>
-<FILE>xml-paper</FILE>
-lgl_xml_paper_read_papers_from_file
-lgl_xml_paper_parse_papers_doc
-lgl_xml_paper_parse_paper_node
-</SECTION>
-
-<SECTION>
-<FILE>xml-category</FILE>
-lgl_xml_category_read_categories_from_file
-lgl_xml_category_parse_categories_doc
-lgl_xml_category_parse_category_node
-</SECTION>
-
-<SECTION>
-<FILE>libglabels</FILE>
-</SECTION>
-
-<SECTION>
-<FILE>db</FILE>
-lglDbRegStatus
-lgl_db_init
-lgl_db_get_paper_id_list
-lgl_db_free_paper_id_list
-lgl_db_get_paper_name_list
-lgl_db_free_paper_name_list
-lgl_db_lookup_paper_from_name
-lgl_db_lookup_paper_from_id
-lgl_db_lookup_paper_id_from_name
-lgl_db_lookup_paper_name_from_id
-lgl_db_is_paper_id_known
-lgl_db_is_paper_id_other
-lgl_db_get_category_id_list
-lgl_db_free_category_id_list
-lgl_db_get_category_name_list
-lgl_db_free_category_name_list
-lgl_db_lookup_category_from_name
-lgl_db_lookup_category_from_id
-lgl_db_lookup_category_id_from_name
-lgl_db_lookup_category_name_from_id
-lgl_db_is_category_id_known
-lgl_db_get_brand_list
-lgl_db_free_brand_list
-lgl_db_register_template
-lgl_db_does_template_exist
-lgl_db_does_template_name_exist
-lgl_db_get_template_name_list_unique
-lgl_db_get_template_name_list_all
-lgl_db_free_template_name_list
-lgl_db_lookup_template_from_name
-lgl_db_print_known_papers
-lgl_db_print_known_categories
-lgl_db_print_known_templates
-lgl_db_print_aliases
-</SECTION>
-
-<SECTION>
-<FILE>units</FILE>
-lglUnits
-lgl_units_get_id
-lgl_units_from_id
-lgl_units_get_name
-lgl_units_from_name
-lgl_units_get_points_per_unit
-lgl_units_get_units_per_point
-</SECTION>
-
-<SECTION>
-<FILE>str</FILE>
-lgl_str_utf8_casecmp
-</SECTION>
-
-<SECTION>
-<FILE>template</FILE>
-lglTemplate
-lglTemplateAlias
-lglTemplateFrameAll
-lglTemplateFrameRect
-lglTemplateFrameRound
-lglTemplateFrameCD
-lglTemplateLayout
-lglTemplateMarkupMargin
-lglTemplateMarkupLine
-lglTemplateMarkupCircle
-lglTemplateMarkupRect
-lglTemplateOrigin
-lglTemplateFrameShape
-lglTemplateFrame
-lglTemplateMarkupType
-lglTemplateMarkup
-lgl_template_get_name
-lgl_template_do_templates_match
-lgl_template_does_brand_match
-lgl_template_does_page_size_match
-lgl_template_does_category_match
-lgl_template_frame_get_size
-lgl_template_frame_get_n_labels
-lgl_template_frame_get_origins
-lgl_template_new
-lgl_template_add_alias
-lgl_template_add_category
-lgl_template_add_frame
-lgl_template_frame_rect_new
-lgl_template_alias_new
-lgl_template_frame_round_new
-lgl_template_frame_cd_new
-lgl_template_frame_add_layout
-lgl_template_frame_add_markup
-lgl_template_layout_new
-lgl_template_markup_margin_new
-lgl_template_markup_line_new
-lgl_template_markup_circle_new
-lgl_template_markup_rect_new
-lgl_template_dup
-lgl_template_free
-lgl_template_alias_dup
-lgl_template_alias_free
-lgl_template_frame_dup
-lgl_template_frame_free
-lgl_template_layout_dup
-lgl_template_layout_free
-lgl_template_markup_dup
-lgl_template_markup_free
-</SECTION>
-
-<SECTION>
-<FILE>category</FILE>
-lglCategory
-lgl_category_new
-lgl_category_dup
-lgl_category_free
-</SECTION>
-
-<SECTION>
-<FILE>xml</FILE>
-LGL_XML_NAME_SPACE
-lgl_xml_get_prop_string
-lgl_xml_get_prop_i18n_string
-lgl_xml_get_prop_double
-lgl_xml_get_prop_boolean
-lgl_xml_get_prop_int
-lgl_xml_get_prop_uint
-lgl_xml_get_prop_length
-lgl_xml_set_prop_string
-lgl_xml_set_prop_double
-lgl_xml_set_prop_boolean
-lgl_xml_set_prop_int
-lgl_xml_set_prop_uint_hex
-lgl_xml_set_prop_length
-lgl_xml_is_node
-lgl_xml_get_node_content
-lgl_xml_set_default_units
-</SECTION>
-
-<SECTION>
-<FILE>xml-template</FILE>
-lgl_xml_template_read_templates_from_file
-lgl_xml_template_parse_templates_doc
-lgl_xml_template_parse_template_node
-lgl_xml_template_write_templates_to_file
-lgl_xml_template_write_template_to_file
-lgl_xml_template_create_template_node
-</SECTION>
-
-<SECTION>
-<FILE>paper</FILE>
-lglPaper
-lgl_paper_new
-lgl_paper_dup
-lgl_paper_free
-</SECTION>
-
index 3593275a186147e9e5f81dbe937fd103c9137689..80ec08fdeeeff91e1048c5457935ad982b7d5e33 100644 (file)
@@ -306,7 +306,7 @@ menu_position_function (GtkMenu            *menu,
         gint                w_screen, h_screen;
         GdkWindow          *window;
         gint                x_window, y_window;
-        GtkAllocation      *allocation;
+        GtkAllocation       allocation;
         gint                x_this, y_this, h_this;
         GtkRequisition      menu_requisition;
         gint                h_menu, w_menu;
@@ -327,10 +327,10 @@ menu_position_function (GtkMenu            *menu,
         /*
          *  Position and size of "this" inside window
          */
-        allocation = &GTK_WIDGET (this)->allocation;
-        x_this = allocation->x;
-        y_this = allocation->y;
-        h_this = allocation->height;
+        gtk_widget_get_allocation (GTK_WIDGET (this), &allocation);
+        x_this = allocation.x;
+        y_this = allocation.y;
+        h_this = allocation.height;
 
         /*
          * Size of menu.
index 0334efdc15083fb9e836086020e936bf385b682c..c833f19343e264bca65b1c5d5b0c42cadb4a2542 100644 (file)
@@ -248,7 +248,7 @@ menu_position_function (GtkMenu       *menu,
         gint                w_screen, h_screen;
         GdkWindow          *window;
         gint                x_window, y_window;
-        GtkAllocation      *allocation;
+        GtkAllocation       allocation;
         gint                x_this, y_this, h_this;
         GtkRequisition      menu_requisition;
         gint                h_menu, w_menu;
@@ -269,10 +269,10 @@ menu_position_function (GtkMenu       *menu,
         /*
          *  Position and size of "this" inside window
          */
-        allocation = &GTK_WIDGET (this)->allocation;
-        x_this = allocation->x;
-        y_this = allocation->y;
-        h_this = allocation->height;
+        gtk_widget_get_allocation (GTK_WIDGET (this), &allocation);
+        x_this = allocation.x;
+        y_this = allocation.y;
+        h_this = allocation.height;
 
         /*
          * Size of menu.
index d850e528e7d56151aedc90cce8d953b6c10c25d8..f43108f71f8d460f7c86ab265fc9df554e9a7fbd 100644 (file)
@@ -96,7 +96,7 @@ gl_color_swatch_class_init (glColorSwatchClass *class)
 static void
 gl_color_swatch_init (glColorSwatch *this)
 {
-        GTK_WIDGET_SET_FLAGS (GTK_WIDGET (this), GTK_NO_WINDOW);
+        gtk_widget_set_has_window (GTK_WIDGET (this), FALSE);
 
        this->priv = g_new0 (glColorSwatchPrivate, 1);
 }
@@ -191,8 +191,9 @@ static gboolean
 expose_event_cb (GtkWidget      *widget,
                  GdkEventExpose *event)
 {
-        GdkWindow *window;
-       cairo_t   *cr;
+        GdkWindow     *window;
+       cairo_t       *cr;
+        GtkAllocation  allocation;
 
         window = gtk_widget_get_window (widget);
 
@@ -203,7 +204,8 @@ expose_event_cb (GtkWidget      *widget,
                        event->area.width, event->area.height);
        cairo_clip (cr);
 
-        cairo_translate (cr, widget->allocation.x, widget->allocation.y);
+        gtk_widget_get_allocation (widget, &allocation);
+        cairo_translate (cr, allocation.x, allocation.y);
 
        draw_swatch (GL_COLOR_SWATCH (widget), cr);
 
@@ -220,20 +222,22 @@ static void
 draw_swatch (glColorSwatch *this,
              cairo_t       *cr)
 {
-        GtkStyle  *style;
-        gdouble    w, h;
-        guint      fill_color, line_color;
+        GtkAllocation  allocation;
+        GtkStyle      *style;
+        gdouble        w, h;
+        guint          fill_color, line_color;
 
 
         cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE);
 
 
-        w = GTK_WIDGET (this)->allocation.width;
-        h = GTK_WIDGET (this)->allocation.height;
+        gtk_widget_get_allocation (GTK_WIDGET (this), &allocation);
+        w = allocation.width;
+        h = allocation.height;
 
 
         style = gtk_widget_get_style (GTK_WIDGET (this));
-        if ( GTK_WIDGET_IS_SENSITIVE (GTK_WIDGET (this)) )
+        if ( gtk_widget_is_sensitive (GTK_WIDGET (this)) )
         {
                 fill_color = this->priv->color;
                 line_color = gl_color_from_gdk_color (&style->fg[GTK_STATE_NORMAL]);
index 4000d41beec0b281d57a5e9fdc9584b84017dd0b..a0061a8fe98f1a66f6e099701de833afd406f51c 100644 (file)
@@ -202,7 +202,7 @@ menu_position_function (GtkMenu       *menu,
         gint                w_screen, h_screen;
         GdkWindow          *window;
         gint                x_window, y_window;
-        GtkAllocation      *allocation;
+        GtkAllocation       allocation;
         gint                x_this, y_this, h_this;
         GtkRequisition      menu_requisition;
         gint                h_menu, w_menu;
@@ -223,10 +223,10 @@ menu_position_function (GtkMenu       *menu,
         /*
          *  Position and size of "this" inside window
          */
-        allocation = &GTK_WIDGET (this)->allocation;
-        x_this = allocation->x;
-        y_this = allocation->y;
-        h_this = allocation->height;
+        gtk_widget_get_allocation (GTK_WIDGET (this), &allocation);
+        x_this = allocation.x;
+        y_this = allocation.y;
+        h_this = allocation.height;
 
         /*
          * Size of menu.
index 49b0d7ee36c11d18e18c5e31a507180b40f9315b..993089f2e09c7174cbbca47f3358c8443c45123c 100644 (file)
@@ -229,7 +229,7 @@ menu_position_function (GtkMenu      *menu,
         gint                w_screen, h_screen;
         GdkWindow          *window;
         gint                x_window, y_window;
-        GtkAllocation      *allocation;
+        GtkAllocation       allocation;
         gint                x_this, y_this, h_this;
         GtkRequisition      menu_requisition;
         gint                h_menu, w_menu;
@@ -250,10 +250,10 @@ menu_position_function (GtkMenu      *menu,
         /*
          *  Position and size of "this" inside window
          */
-        allocation = &GTK_WIDGET (this)->allocation;
-        x_this = allocation->x;
-        y_this = allocation->y;
-        h_this = allocation->height;
+        gtk_widget_get_allocation (GTK_WIDGET (this), &allocation);
+        x_this = allocation.x;
+        y_this = allocation.y;
+        h_this = allocation.height;
 
         /*
          * Size of menu.
index ff04ac85cddaa03ef72d43191b18ba89d5ac5bef..4302064981beb4d7eeb1d5aedc048aa173bd3f39 100644 (file)
@@ -99,7 +99,7 @@ gl_font_sample_class_init (glFontSampleClass *class)
 static void
 gl_font_sample_init (glFontSample *this)
 {
-        GTK_WIDGET_SET_FLAGS (GTK_WIDGET (this), GTK_NO_WINDOW);
+        gtk_widget_set_has_window (GTK_WIDGET (this), FALSE);
 
        this->priv = g_new0 (glFontSamplePrivate, 1);
 }
@@ -185,8 +185,9 @@ static gboolean
 expose_event_cb (GtkWidget      *widget,
                  GdkEventExpose *event)
 {
-        GdkWindow *window;
-       cairo_t   *cr;
+        GdkWindow     *window;
+       cairo_t       *cr;
+        GtkAllocation  allocation;
 
         window = gtk_widget_get_window (widget);
 
@@ -197,7 +198,8 @@ expose_event_cb (GtkWidget      *widget,
                        event->area.width, event->area.height);
        cairo_clip (cr);
 
-        cairo_translate (cr, widget->allocation.x, widget->allocation.y);
+        gtk_widget_get_allocation (widget, &allocation);
+        cairo_translate (cr, allocation.x, allocation.y);
 
        draw_sample (GL_FONT_SAMPLE (widget), cr);
 
@@ -214,6 +216,7 @@ static void
 draw_sample (glFontSample *this,
              cairo_t       *cr)
 {
+        GtkAllocation         allocation;
         GtkStyle             *style;
         gdouble               w, h;
         guint                 fill_color, line_color;
@@ -223,13 +226,13 @@ draw_sample (glFontSample *this,
         gdouble               layout_x, layout_y, layout_width, layout_height;
 
 
-
-        w = GTK_WIDGET (this)->allocation.width;
-        h = GTK_WIDGET (this)->allocation.height;
+        gtk_widget_get_allocation (GTK_WIDGET (this), &allocation);
+        w = allocation.width;
+        h = allocation.height;
 
 
         style = gtk_widget_get_style (GTK_WIDGET (this));
-        if ( GTK_WIDGET_IS_SENSITIVE (GTK_WIDGET (this)) )
+        if ( gtk_widget_is_sensitive (GTK_WIDGET (this)) )
         {
                 fill_color = gl_color_from_gdk_color (&style->light[GTK_STATE_NORMAL]);
                 line_color = gl_color_from_gdk_color (&style->fg[GTK_STATE_NORMAL]);
index b05673bd2e33966d35d69ffb86260791edf0d316..ac574326670860309968e2428364d54cbeb62062 100644 (file)
@@ -31,7 +31,6 @@
 #include "print-op.h"
 #include "file-util.h"
 #include "prefs.h"
-#include "font-history.h"
 #include "debug.h"
 
 /*============================================*/
@@ -128,8 +127,6 @@ main (int argc, char **argv)
         gl_merge_init ();
         lgl_db_init ();
        gl_prefs_init ();
-        gl_template_history_init ();
-        gl_font_history_init ();
 
         /* now print the files */
         for (p = file_list; p; p = p->next) {
index b502a871cb118ff08b60bfb119873ccc17e676dd..e23803e9d01f96823bb6abf60dad0184df841c0f 100644 (file)
@@ -158,7 +158,6 @@ static void
 gl_merge_text_finalize (GObject *object)
 {
        glMergeText *merge_text = GL_MERGE_TEXT (object);
-        gint         i;
 
        gl_debug (DEBUG_MERGE, "START");
 
@@ -284,10 +283,7 @@ static GList *
 gl_merge_text_get_key_list (glMerge *merge)
 {
        glMergeText   *merge_text;
-       GList         *record_list, *p_rec;
-       glMergeRecord *record;
-       GList         *p_field;
-       gint           i_field, n_fields_line, n_fields;
+       gint           i_field, n_fields;
        GList         *key_list;
        
        gl_debug (DEBUG_MERGE, "BEGIN");
index e5f21813b28604c10ee1a918b2d211dc233cd2a3..ec78aad99c230a2f4758a0e5b9429fa34f5a5862 100644 (file)
@@ -100,7 +100,7 @@ gl_mini_label_preview_class_init (glMiniLabelPreviewClass *class)
 static void
 gl_mini_label_preview_init (glMiniLabelPreview *this)
 {
-        GTK_WIDGET_SET_FLAGS (GTK_WIDGET (this), GTK_NO_WINDOW);
+        gtk_widget_set_has_window (GTK_WIDGET (this), FALSE);
 
        this->priv = g_new0 (glMiniLabelPreviewPrivate, 1);
 }
@@ -203,8 +203,9 @@ static gboolean
 expose_event_cb (GtkWidget      *widget,
                  GdkEventExpose *event)
 {
-        GdkWindow *window;
-       cairo_t   *cr;
+        GdkWindow     *window;
+       cairo_t       *cr;
+        GtkAllocation  allocation;
 
         window = gtk_widget_get_window (widget);
 
@@ -215,7 +216,8 @@ expose_event_cb (GtkWidget      *widget,
                        event->area.width, event->area.height);
        cairo_clip (cr);
 
-        cairo_translate (cr, widget->allocation.x, widget->allocation.y);
+        gtk_widget_get_allocation (widget, &allocation);
+        cairo_translate (cr, allocation.x, allocation.y);
 
        draw_preview (GL_MINI_LABEL_PREVIEW (widget), cr);
 
@@ -232,6 +234,7 @@ static void
 draw_preview (glMiniLabelPreview *this,
               cairo_t            *cr)
 {
+        GtkAllocation           allocation;
         GtkStyle               *style;
         gdouble                 w, h;
         guint                   fill_color, line_color, shadow_color;
@@ -240,12 +243,13 @@ draw_preview (glMiniLabelPreview *this,
         gdouble                 scale;
 
 
-        w = GTK_WIDGET (this)->allocation.width;
-        h = GTK_WIDGET (this)->allocation.height;
+        gtk_widget_get_allocation (GTK_WIDGET (this), &allocation);
+        w = allocation.width;
+        h = allocation.height;
 
 
         style = gtk_widget_get_style (GTK_WIDGET (this));
-        if ( GTK_WIDGET_IS_SENSITIVE (GTK_WIDGET (this)) )
+        if ( gtk_widget_is_sensitive (GTK_WIDGET (this)) )
         {
                 fill_color   = gl_color_from_gdk_color (&style->light[GTK_STATE_NORMAL]);
                 line_color   = gl_color_from_gdk_color (&style->fg[GTK_STATE_NORMAL]);
index 2d5882a51556b64054007ee372cea2caa6e18a76..6ba6ddefc069f2431ec9688d6648fe30d228bed5 100644 (file)
@@ -224,7 +224,7 @@ gl_mini_preview_init (glMiniPreview *this)
         gtk_event_box_set_visible_window (GTK_EVENT_BOX (this), FALSE);
 
         this->priv->canvas = gtk_drawing_area_new ();
-        GTK_WIDGET_SET_FLAGS (this->priv->canvas, GTK_NO_WINDOW);
+        gtk_widget_set_has_window(this->priv->canvas, FALSE);
         gtk_container_add (GTK_CONTAINER (this), this->priv->canvas);
 
         g_signal_connect (G_OBJECT (this->priv->canvas), "expose-event",
@@ -555,14 +555,16 @@ static gdouble
 set_transform_and_get_scale (glMiniPreview *this,
                              cairo_t       *cr)
 {
-       lglTemplate *template = this->priv->template;
-        gdouble      w, h;
-        gdouble      scale;
-        gdouble      offset_x, offset_y;
+       lglTemplate   *template = this->priv->template;
+        GtkAllocation  allocation;
+        gdouble        w, h;
+        gdouble        scale;
+        gdouble        offset_x, offset_y;
 
         /* Establish scale and origin. */
-        w = GTK_WIDGET (this)->allocation.width;
-        h = GTK_WIDGET (this)->allocation.height;
+        gtk_widget_get_allocation (GTK_WIDGET (this), &allocation);
+        w = allocation.width;
+        h = allocation.height;
 
         /* establish scale. */
         scale = MIN( (w - 2*MARGIN - 2*SHADOW_OFFSET)/template->page_width,
@@ -752,6 +754,7 @@ expose_event_cb (GtkWidget       *widget,
 {
         GdkWindow     *window;
        cairo_t       *cr;
+        GtkAllocation  allocation;
 
        gl_debug (DEBUG_MINI_PREVIEW, "START");
 
@@ -765,7 +768,9 @@ expose_event_cb (GtkWidget       *widget,
                        event->area.x, event->area.y,
                        event->area.width, event->area.height);
        cairo_clip (cr);
-        cairo_translate (cr, widget->allocation.x, widget->allocation.y);
+
+        gtk_widget_get_allocation (widget, &allocation);
+        cairo_translate (cr, allocation.x, allocation.y);
        
        draw (this, cr);
 
index c85ff5be584975201c33bac2485d0f465214a13e..704b8efe06c22e223fb6fb9067442982de22b87d 100644 (file)
@@ -76,8 +76,9 @@ gl_object_editor_prepare_edit_page (glObjectEditor       *editor)
        editor->priv->edit_insert_field_button = gl_field_button_new (_("Insert merge field"));
         gtk_box_pack_start (GTK_BOX (editor->priv->edit_insert_field_vbox),
                             editor->priv->edit_insert_field_button, FALSE, FALSE, 0);
-        GTK_WIDGET_UNSET_FLAGS (editor->priv->edit_insert_field_button,
-                                GTK_CAN_FOCUS | GTK_CAN_DEFAULT);
+
+        gtk_widget_set_can_focus (editor->priv->edit_insert_field_button, FALSE);
+        gtk_widget_set_can_default (editor->priv->edit_insert_field_button, FALSE);
 
        /* Un-hide */
        gtk_widget_show_all (editor->priv->edit_page_vbox);
index ca917342242d9e1ee532edbfbb3290ec197b5b9e..c814cd13f67817265b3477a8d2878f1487a55973 100644 (file)
@@ -328,7 +328,7 @@ gl_view_init (glView *view)
        gtk_widget_modify_bg (GTK_WIDGET (view->canvas), GTK_STATE_NORMAL, bg_color);
        g_free (bg_color);
 
-        GTK_WIDGET_SET_FLAGS (GTK_WIDGET (view->canvas), GTK_CAN_FOCUS);
+        gtk_widget_set_can_focus (GTK_WIDGET (view->canvas), TRUE);
 
         gtk_widget_add_events (GTK_WIDGET (view->canvas),
                                (GDK_FOCUS_CHANGE_MASK   |
@@ -2675,19 +2675,21 @@ gl_view_zoom_out (glView *view)
 void
 gl_view_zoom_to_fit (glView *view)
 {
-       gint    w_view, h_view;
-       gdouble w_label, h_label;
-       gdouble x_scale, y_scale, scale;
+        GtkAllocation  allocation;
+       gint           w_view, h_view;
+       gdouble        w_label, h_label;
+       gdouble        x_scale, y_scale, scale;
 
        gl_debug (DEBUG_VIEW, "");
 
-       if ( ! GTK_WIDGET_VISIBLE(view)) {
+       if ( ! gtk_widget_get_window (GTK_WIDGET (view)) ) {
                set_zoom_real (view, 1.0, TRUE);
                return;
        }
 
-       w_view = GTK_WIDGET(view)->allocation.width;
-       h_view = GTK_WIDGET(view)->allocation.height;
+        gtk_widget_get_allocation (GTK_WIDGET (view), &allocation);
+       w_view = allocation.width;
+       h_view = allocation.height;
 
        gl_label_get_size (GL_LABEL(view->label), &w_label, &h_label);
 
@@ -3237,8 +3239,6 @@ static gboolean
 focus_in_event_cb (glView            *view,
                    GdkEventFocus     *event)
 {
-        GTK_WIDGET_SET_FLAGS (GTK_WIDGET (view->canvas), GTK_HAS_FOCUS);
-
         return FALSE;
 }
 
@@ -3250,8 +3250,6 @@ static gboolean
 focus_out_event_cb (glView            *view,
                     GdkEventFocus     *event)
 {
-        GTK_WIDGET_UNSET_FLAGS (GTK_WIDGET (view->canvas), GTK_HAS_FOCUS);
-
         return FALSE;
 }
 
index be6ab62d0b4823aae959d767a014e1105402f262..5963fea9ad144a921f912b87ade4a4d1158612cf 100644 (file)
@@ -229,6 +229,7 @@ gl_wdgt_chain_button_draw_lines (GtkWidget         *widget,
                                 GdkEventExpose    *eevent,
                                 glWdgtChainButton *button)
 {
+  GtkAllocation        allocation;
   GdkPoint             points[3];
   GdkPoint             buf;
   GtkShadowType               shadow;
@@ -241,8 +242,9 @@ gl_wdgt_chain_button_draw_lines (GtkWidget         *widget,
 
   g_return_val_if_fail (GL_WDGT_IS_CHAIN_BUTTON (button), FALSE);
 
-  points[0].x = widget->allocation.width / 2;
-  points[0].y = widget->allocation.height / 2;
+  gtk_widget_get_allocation (widget, &allocation);
+  points[0].x = allocation.width / 2;
+  points[0].y = allocation.height / 2;
 
   which_line = (widget == button->line1) ? 1 : -1;
 
@@ -268,7 +270,7 @@ gl_wdgt_chain_button_draw_lines (GtkWidget         *widget,
       points[1].x = points[0].x - SHORT_LINE;
       points[1].y = points[0].y;
       points[2].x = points[1].x;
-      points[2].y = (which_line == 1) ? widget->allocation.height - 1 : 0;
+      points[2].y = (which_line == 1) ? allocation.height - 1 : 0;
       shadow = GTK_SHADOW_ETCHED_IN;
       break;
     case GL_WDGT_CHAIN_RIGHT:
@@ -276,14 +278,14 @@ gl_wdgt_chain_button_draw_lines (GtkWidget         *widget,
       points[1].x = points[0].x + SHORT_LINE;
       points[1].y = points[0].y;
       points[2].x = points[1].x;
-      points[2].y = (which_line == 1) ? widget->allocation.height - 1 : 0;
+      points[2].y = (which_line == 1) ? allocation.height - 1 : 0;
       shadow = GTK_SHADOW_ETCHED_OUT;
       break;
     case GL_WDGT_CHAIN_TOP:
       points[0].y += SHORT_LINE;
       points[1].x = points[0].x;
       points[1].y = points[0].y - SHORT_LINE;
-      points[2].x = (which_line == 1) ? widget->allocation.width - 1 : 0;
+      points[2].x = (which_line == 1) ? allocation.width - 1 : 0;
       points[2].y = points[1].y;
       shadow = GTK_SHADOW_ETCHED_OUT;
       break;
@@ -291,7 +293,7 @@ gl_wdgt_chain_button_draw_lines (GtkWidget         *widget,
       points[0].y -= SHORT_LINE;
       points[1].x = points[0].x;
       points[1].y = points[0].y + SHORT_LINE;
-      points[2].x = (which_line == 1) ? widget->allocation.width - 1 : 0;
+      points[2].x = (which_line == 1) ? allocation.width - 1 : 0;
       points[2].y = points[1].y;
       shadow = GTK_SHADOW_ETCHED_IN;
       break;