pspp-cvs
[Top][All Lists]
Advanced

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

[Pspp-cvs] pspp lib/gtksheet/gtksheet.c src/ui/gui/data-ed...


From: John Darrington
Subject: [Pspp-cvs] pspp lib/gtksheet/gtksheet.c src/ui/gui/data-ed...
Date: Sun, 02 Mar 2008 12:12:39 +0000

CVSROOT:        /sources/pspp
Module name:    pspp
Changes by:     John Darrington <jmd>   08/03/02 12:12:38

Modified files:
        lib/gtksheet   : gtksheet.c 
        src/ui/gui     : data-editor.c find-dialog.c 
                         psppire-data-editor.c 

Log message:
        Updated some deprecated functions with modern ones.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/lib/gtksheet/gtksheet.c?cvsroot=pspp&r1=1.41&r2=1.42
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/data-editor.c?cvsroot=pspp&r1=1.68&r2=1.69
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/find-dialog.c?cvsroot=pspp&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/psppire-data-editor.c?cvsroot=pspp&r1=1.1&r2=1.2

Patches:
Index: lib/gtksheet/gtksheet.c
===================================================================
RCS file: /sources/pspp/pspp/lib/gtksheet/gtksheet.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -b -r1.41 -r1.42
--- lib/gtksheet/gtksheet.c     2 Mar 2008 04:39:51 -0000       1.41
+++ lib/gtksheet/gtksheet.c     2 Mar 2008 12:12:38 -0000       1.42
@@ -1313,11 +1313,13 @@
   sheet->bg_gc = NULL;
   sheet->x_drag = 0;
   sheet->y_drag = 0;
-
   gdk_color_parse ("white", &sheet->bg_color);
-  gdk_color_alloc (gdk_colormap_get_system (), &sheet->bg_color);
+  gdk_colormap_alloc_color (gdk_colormap_get_system (), &sheet->bg_color, 
FALSE,
+                            TRUE);
   gdk_color_parse ("gray", &sheet->grid_color);
-  gdk_color_alloc (gdk_colormap_get_system (), &sheet->grid_color);
+  gdk_colormap_alloc_color (gdk_colormap_get_system (), &sheet->grid_color, 
FALSE,
+                            TRUE);
+
   sheet->show_grid = TRUE;
 
   sheet->motion_timer = 0;
@@ -1615,7 +1617,7 @@
   if (!color)
     {
       gdk_color_parse ("white", &sheet->bg_color);
-      gdk_color_alloc (gdk_colormap_get_system (), &sheet->bg_color);
+      gdk_colormap_alloc_color (gdk_colormap_get_system (), &sheet->bg_color, 
FALSE, TRUE);
     }
   else
     sheet->bg_color = *color;
@@ -1633,7 +1635,7 @@
   if (!color)
     {
       gdk_color_parse ("black", &sheet->grid_color);
-      gdk_color_alloc (gdk_colormap_get_system (), &sheet->grid_color);
+      gdk_colormap_alloc_color (gdk_colormap_get_system (), 
&sheet->grid_color, FALSE, TRUE);
     }
   else
     sheet->grid_color = *color;
@@ -2598,24 +2600,21 @@
 
   /* GCs */
   if (sheet->fg_gc)
-    gdk_gc_unref (sheet->fg_gc);
+    g_object_unref (sheet->fg_gc);
   if (sheet->bg_gc)
-    gdk_gc_unref (sheet->bg_gc);
+    g_object_unref (sheet->bg_gc);
   sheet->fg_gc = gdk_gc_new (widget->window);
   sheet->bg_gc = gdk_gc_new (widget->window);
 
   colormap = gtk_widget_get_colormap (widget);
 
-  gdk_color_white (colormap, &widget->style->white);
-  gdk_color_black (colormap, &widget->style->black);
-
   gdk_gc_get_values (sheet->fg_gc, &auxvalues);
 
   values.foreground = widget->style->white;
   values.function = GDK_INVERT;
   values.subwindow_mode = GDK_INCLUDE_INFERIORS;
   if (sheet->xor_gc)
-    gdk_gc_unref (sheet->xor_gc);
+    g_object_unref (sheet->xor_gc);
   sheet->xor_gc = gdk_gc_new_with_values (widget->window,
                                          &values,
                                          GDK_GC_FOREGROUND |
@@ -2629,7 +2628,8 @@
   gtk_widget_set_parent_window (sheet->button, sheet->sheet_window);
   gtk_widget_set_parent (sheet->button, GTK_WIDGET (sheet));
 
-  if (!sheet->cursor_drag)
+
+  gdk_cursor_unref (sheet->cursor_drag);
     sheet->cursor_drag = gdk_cursor_new (GDK_PLUS);
 
   if (sheet->column_titles_visible)
@@ -2704,11 +2704,11 @@
 
   sheet = GTK_SHEET (widget);
 
-  gdk_cursor_destroy (sheet->cursor_drag);
+  gdk_cursor_unref (sheet->cursor_drag);
 
-  gdk_gc_destroy (sheet->xor_gc);
-  gdk_gc_destroy (sheet->fg_gc);
-  gdk_gc_destroy (sheet->bg_gc);
+  g_object_unref (sheet->xor_gc);
+  g_object_unref (sheet->fg_gc);
+  g_object_unref (sheet->bg_gc);
 
   gdk_window_destroy (sheet->sheet_window);
   gdk_window_destroy (sheet->column_title_window);
@@ -2722,7 +2722,6 @@
 
   sheet->column_title_window = NULL;
   sheet->sheet_window = NULL;
-  sheet->cursor_drag = NULL;
   sheet->xor_gc = NULL;
   sheet->fg_gc = NULL;
   sheet->bg_gc = NULL;
@@ -2748,10 +2747,7 @@
     {
       GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
 
-      if (!sheet->cursor_drag) sheet->cursor_drag = gdk_cursor_new (GDK_PLUS);
-
       gdk_window_show (widget->window);
-
       gdk_window_show (sheet->sheet_window);
 
       if (sheet->column_titles_visible)
@@ -3081,7 +3077,7 @@
   gdk_gc_set_clip_rectangle (fg_gc, NULL);
   g_object_unref (layout);
 
-  gdk_draw_pixmap (sheet->sheet_window,
+  gdk_draw_drawable (sheet->sheet_window,
                   GTK_WIDGET (sheet)->style->fg_gc[GTK_STATE_NORMAL],
                   sheet->pixmap,
                   area.x,
@@ -3148,7 +3144,7 @@
                          sheet->sheet_window_width - area.x,
                          sheet->sheet_window_height);
 
-      gdk_draw_pixmap (sheet->sheet_window,
+      gdk_draw_drawable (sheet->sheet_window,
                       GTK_WIDGET (sheet)->style->fg_gc[GTK_STATE_NORMAL],
                       sheet->pixmap,
                       area.x,
@@ -3175,7 +3171,7 @@
                          sheet->sheet_window_width,
                          sheet->sheet_window_height - area.y);
 
-      gdk_draw_pixmap (sheet->sheet_window,
+      gdk_draw_drawable (sheet->sheet_window,
                       GTK_WIDGET (sheet)->style->fg_gc[GTK_STATE_NORMAL],
                       sheet->pixmap,
                       area.x,
@@ -3321,7 +3317,7 @@
   if (range.rowi == yyy_row_count (sheet) - 1)
     height = sheet->sheet_window_height - y;
 
-  gdk_draw_pixmap (sheet->sheet_window,
+  gdk_draw_drawable (sheet->sheet_window,
                   GTK_WIDGET (sheet)->style->fg_gc[GTK_STATE_NORMAL],
                   sheet->pixmap,
                   x,
@@ -3802,7 +3798,7 @@
   gtk_widget_unmap (sheet->entry_widget);
 
   if (row != -1 && col != -1)
-    gdk_draw_pixmap (sheet->sheet_window,
+    gdk_draw_drawable (sheet->sheet_window,
                     GTK_WIDGET (sheet)->style->fg_gc[GTK_STATE_NORMAL],
                     sheet->pixmap,
                     COLUMN_LEFT_XPIXEL (sheet, col)- 1,
@@ -3970,7 +3966,7 @@
   else
     {
       /* reallocate if sizes don't match */
-      gdk_window_get_size (sheet->pixmap,
+      gdk_drawable_get_size (sheet->pixmap,
                           &pixmap_width, &pixmap_height);
       if ( (pixmap_width != width) || (pixmap_height != height))
        {
@@ -4060,7 +4056,7 @@
                    }
                  if (j == sheet->range.coli) width = width + 3;
 
-                 gdk_draw_pixmap (sheet->sheet_window,
+                 gdk_draw_drawable (sheet->sheet_window,
                                   GTK_WIDGET 
(sheet)->style->fg_gc[GTK_STATE_NORMAL],
                                   sheet->pixmap,
                                   x + 1,
@@ -4134,7 +4130,7 @@
                }
              if (j == sheet->range.coli) width = width + 3;
 
-             gdk_draw_pixmap (sheet->sheet_window,
+             gdk_draw_drawable (sheet->sheet_window,
                               GTK_WIDGET 
(sheet)->style->fg_gc[GTK_STATE_NORMAL],
                               sheet->pixmap,
                               x + 1,
@@ -4323,7 +4319,7 @@
     {
       x = COLUMN_LEFT_XPIXEL (sheet, range.col0);
       y = ROW_TOP_YPIXEL (sheet, range.row0);
-      gdk_draw_pixmap (sheet->sheet_window,
+      gdk_draw_drawable (sheet->sheet_window,
                       GTK_WIDGET (sheet)->style->fg_gc[GTK_STATE_NORMAL],
                       sheet->pixmap,
                       x - 1,
@@ -4351,7 +4347,7 @@
          y = ROW_TOP_YPIXEL (sheet, MIN_VISIBLE_ROW (sheet))+3;
          width = 3;
        }
-      gdk_draw_pixmap (sheet->sheet_window,
+      gdk_draw_drawable (sheet->sheet_window,
                       GTK_WIDGET (sheet)->style->fg_gc[GTK_STATE_NORMAL],
                       sheet->pixmap,
                       x - width,
@@ -4379,7 +4375,7 @@
          x = COLUMN_LEFT_XPIXEL (sheet, MIN_VISIBLE_COLUMN (sheet))+3;
          width = 3;
        }
-      gdk_draw_pixmap (sheet->sheet_window,
+      gdk_draw_drawable (sheet->sheet_window,
                       GTK_WIDGET (sheet)->style->fg_gc[GTK_STATE_NORMAL],
                       sheet->pixmap,
                       x - width,
@@ -4404,7 +4400,7 @@
       width = 1;
       if (sheet->state == GTK_SHEET_RANGE_SELECTED) width = 3;
       if (sheet->state == GTK_SHEET_NORMAL) width = 3;
-      gdk_draw_pixmap (sheet->sheet_window,
+      gdk_draw_drawable (sheet->sheet_window,
                       GTK_WIDGET (sheet)->style->fg_gc[GTK_STATE_NORMAL],
                       sheet->pixmap,
                       x - width,
@@ -5236,7 +5232,7 @@
          new_cursor = GDK_SB_H_DOUBLE_ARROW;
          if (new_cursor != sheet->cursor_drag->type)
            {
-             gdk_cursor_destroy (sheet->cursor_drag);
+             gdk_cursor_unref (sheet->cursor_drag);
              sheet->cursor_drag = gdk_cursor_new (GDK_SB_H_DOUBLE_ARROW);
              gdk_window_set_cursor (sheet->column_title_window,
                                     sheet->cursor_drag);
@@ -5248,7 +5244,7 @@
          if (!GTK_SHEET_IN_XDRAG (sheet) &&
              new_cursor != sheet->cursor_drag->type)
            {
-             gdk_cursor_destroy (sheet->cursor_drag);
+             gdk_cursor_unref (sheet->cursor_drag);
              sheet->cursor_drag = gdk_cursor_new (GDK_TOP_LEFT_ARROW);
              gdk_window_set_cursor (sheet->column_title_window,
                                     sheet->cursor_drag);
@@ -5265,7 +5261,7 @@
          new_cursor = GDK_SB_V_DOUBLE_ARROW;
          if (new_cursor != sheet->cursor_drag->type)
            {
-             gdk_cursor_destroy (sheet->cursor_drag);
+             gdk_cursor_unref (sheet->cursor_drag);
              sheet->cursor_drag = gdk_cursor_new (GDK_SB_V_DOUBLE_ARROW);
              gdk_window_set_cursor (sheet->row_title_window, 
sheet->cursor_drag);
            }
@@ -5276,7 +5272,7 @@
          if (!GTK_SHEET_IN_YDRAG (sheet) &&
              new_cursor != sheet->cursor_drag->type)
            {
-             gdk_cursor_destroy (sheet->cursor_drag);
+             gdk_cursor_unref (sheet->cursor_drag);
              sheet->cursor_drag = gdk_cursor_new (GDK_TOP_LEFT_ARROW);
              gdk_window_set_cursor (sheet->row_title_window, 
sheet->cursor_drag);
            }
@@ -5291,7 +5287,7 @@
        !GTK_SHEET_IN_RESIZE (sheet) &&
        new_cursor != sheet->cursor_drag->type)
     {
-      gdk_cursor_destroy (sheet->cursor_drag);
+      gdk_cursor_unref (sheet->cursor_drag);
       sheet->cursor_drag = gdk_cursor_new (GDK_PLUS);
       gdk_window_set_cursor (sheet->sheet_window, sheet->cursor_drag);
     }
@@ -5302,7 +5298,7 @@
 
        new_cursor != sheet->cursor_drag->type)
     {
-      gdk_cursor_destroy (sheet->cursor_drag);
+      gdk_cursor_unref (sheet->cursor_drag);
       sheet->cursor_drag = gdk_cursor_new (GDK_TOP_LEFT_ARROW);
       gdk_window_set_cursor (sheet->sheet_window, sheet->cursor_drag);
     }
@@ -5315,7 +5311,7 @@
        GTK_SHEET_IN_RESIZE (sheet)) &&
        new_cursor != sheet->cursor_drag->type)
     {
-      gdk_cursor_destroy (sheet->cursor_drag);
+      gdk_cursor_unref (sheet->cursor_drag);
       sheet->cursor_drag = gdk_cursor_new (GDK_SIZING);
       gdk_window_set_cursor (sheet->sheet_window, sheet->cursor_drag);
     }
@@ -5569,7 +5565,7 @@
       sheet->range.row0 = r;
       sheet->range.coli = c;
       sheet->range.rowi = r;
-      gdk_draw_pixmap (sheet->sheet_window,
+      gdk_draw_drawable (sheet->sheet_window,
                       GTK_WIDGET (sheet)->style->fg_gc[GTK_STATE_NORMAL],
                       sheet->pixmap,
                       COLUMN_LEFT_XPIXEL (sheet, c)- 1,
@@ -6347,7 +6343,6 @@
   if (GTK_IS_ENTRY (sheet->entry_container))
     return (sheet->entry_container);
 
-  //parent = GTK_WIDGET (sheet->entry_widget);
   parent = sheet->entry_container;
 
   if (GTK_IS_TABLE (parent)) children = GTK_TABLE (parent)->children;
@@ -7156,7 +7151,6 @@
     {
       GdkColormap *colormap;
       colormap = gdk_colormap_get_system ();
-      gdk_color_black (colormap, &attributes->foreground);
       attributes->background = sheet->bg_color;
     }
   attributes->justification = xxx_column_justification (sheet, col);

Index: src/ui/gui/data-editor.c
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/data-editor.c,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -b -r1.68 -r1.69
--- src/ui/gui/data-editor.c    2 Mar 2008 04:34:58 -0000       1.68
+++ src/ui/gui/data-editor.c    2 Mar 2008 12:12:38 -0000       1.69
@@ -1000,7 +1000,7 @@
 {
   struct data_editor *de = data;
 
-  gtk_notebook_set_page (GTK_NOTEBOOK (de->data_editor), 
PSPPIRE_DATA_EDITOR_DATA_VIEW);
+  gtk_notebook_set_current_page (GTK_NOTEBOOK (de->data_editor), 
PSPPIRE_DATA_EDITOR_DATA_VIEW);
 }
 
 
@@ -1009,7 +1009,7 @@
 {
   struct data_editor *de = data;
 
-  gtk_notebook_set_page (GTK_NOTEBOOK (de->data_editor), 
PSPPIRE_DATA_EDITOR_VARIABLE_VIEW);
+  gtk_notebook_set_current_page (GTK_NOTEBOOK (de->data_editor), 
PSPPIRE_DATA_EDITOR_VARIABLE_VIEW);
 }
 
 

Index: src/ui/gui/find-dialog.c
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/find-dialog.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- src/ui/gui/find-dialog.c    2 Mar 2008 04:34:58 -0000       1.9
+++ src/ui/gui/find-dialog.c    2 Mar 2008 12:12:38 -0000       1.10
@@ -114,7 +114,7 @@
 
   if ( x != -1)
     {
-      gtk_notebook_set_page (GTK_NOTEBOOK (fd->de->data_editor),
+      gtk_notebook_set_current_page (GTK_NOTEBOOK (fd->de->data_editor),
                             PSPPIRE_DATA_EDITOR_DATA_VIEW);
 
       g_object_set (fd->de->data_editor,

Index: src/ui/gui/psppire-data-editor.c
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/psppire-data-editor.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- src/ui/gui/psppire-data-editor.c    29 Feb 2008 09:13:53 -0000      1.1
+++ src/ui/gui/psppire-data-editor.c    2 Mar 2008 12:12:38 -0000       1.2
@@ -1023,7 +1023,7 @@
   GtkSheetRange range;
   gint row, col;
 
-  if ( gtk_notebook_current_page (GTK_NOTEBOOK (de)) != 
PSPPIRE_DATA_EDITOR_DATA_VIEW)
+  if ( gtk_notebook_get_current_page (GTK_NOTEBOOK (de)) != 
PSPPIRE_DATA_EDITOR_DATA_VIEW)
     return FALSE;
 
   gtk_sheet_get_active_cell (GTK_SHEET (de->data_sheet), &row, &col);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]