]> Pileus Git - ~andy/gtk/commitdiff
API: Remove colormap setting and getting from GtkWidget
authorBenjamin Otte <otte@redhat.com>
Sat, 28 Aug 2010 21:19:28 +0000 (23:19 +0200)
committerBenjamin Otte <otte@redhat.com>
Sun, 26 Sep 2010 13:11:32 +0000 (15:11 +0200)
gtk_widget_get_colormap() and gtk_widget_set_colormap() are gone. They
are replaced by visuals.

docs/reference/gtk/gtk3-sections.txt
gtk/gtk.symbols
gtk/gtkwidget.c
gtk/gtkwidget.h

index 7fc5eaf1044cc83d29bc9127f5ec011c502399b5..da15ddf44f844e74e69297cf37638c5a1ffca2b9 100644 (file)
@@ -4805,8 +4805,6 @@ gtk_widget_get_device_events
 gtk_widget_add_device_events
 gtk_widget_get_toplevel
 gtk_widget_get_ancestor
-gtk_widget_get_colormap
-gtk_widget_set_colormap
 gtk_widget_get_visual
 gtk_widget_get_pointer
 gtk_widget_is_ancestor
index ad913bdc217aed4507554fd06fdc8b2a24767e5b..ab04faea9f5701106b5231177c90e23449ac6b35 100644 (file)
@@ -4213,7 +4213,6 @@ gtk_widget_get_child_requisition
 #endif
 gtk_widget_get_child_visible
 gtk_widget_get_clipboard
-gtk_widget_get_colormap
 gtk_widget_get_composite_name
 gtk_widget_get_default_colormap
 gtk_widget_get_default_direction
@@ -4300,7 +4299,6 @@ gtk_widget_set_accel_path
 gtk_widget_set_allocation
 gtk_widget_set_app_paintable
 gtk_widget_set_child_visible
-gtk_widget_set_colormap
 gtk_widget_set_composite_name
 gtk_widget_set_default_colormap
 gtk_widget_set_default_direction
index cf8ce66819c389e655ba2e7ec9479a551594228a..a51ec940f74a594c5697058fe7bf693c337632c5 100644 (file)
@@ -452,7 +452,6 @@ static GQuark               quark_parent_window = 0;
 static GQuark          quark_pointer_window = 0;
 static GQuark          quark_shape_info = 0;
 static GQuark          quark_input_shape_info = 0;
-static GQuark          quark_colormap = 0;
 static GQuark          quark_pango_context = 0;
 static GQuark          quark_rc_style = 0;
 static GQuark          quark_accessible_object = 0;
@@ -549,7 +548,6 @@ gtk_widget_class_init (GtkWidgetClass *klass)
   quark_pointer_window = g_quark_from_static_string ("gtk-pointer-window");
   quark_shape_info = g_quark_from_static_string ("gtk-shape-info");
   quark_input_shape_info = g_quark_from_static_string ("gtk-input-shape-info");
-  quark_colormap = g_quark_from_static_string ("gtk-colormap");
   quark_pango_context = g_quark_from_static_string ("gtk-pango-context");
   quark_rc_style = g_quark_from_static_string ("gtk-rc-style");
   quark_accessible_object = g_quark_from_static_string ("gtk-accessible-object");
@@ -8658,47 +8656,6 @@ gtk_widget_get_ancestor (GtkWidget *widget,
   return widget;
 }
 
-/**
- * gtk_widget_get_colormap:
- * @widget: a #GtkWidget
- * 
- * Gets the colormap that will be used to render @widget. No reference will
- * be added to the returned colormap; it should not be unreferenced.
- *
- * Return value: (transfer none): the colormap used by @widget
- **/
-GdkColormap*
-gtk_widget_get_colormap (GtkWidget *widget)
-{
-  GtkWidgetPrivate *priv;
-  GdkColormap *colormap;
-  GtkWidget *tmp_widget;
-  
-  g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
-
-  priv = widget->priv;
-
-  if (priv->window)
-    {
-      colormap = gdk_drawable_get_colormap (priv->window);
-      /* If window was destroyed previously, we'll get NULL here */
-      if (colormap)
-       return colormap;
-    }
-
-  tmp_widget = widget;
-  while (tmp_widget)
-    {
-      colormap = g_object_get_qdata (G_OBJECT (tmp_widget), quark_colormap);
-      if (colormap)
-       return colormap;
-
-      tmp_widget= tmp_widget->priv->parent;
-    }
-
-  return gdk_screen_get_default_colormap (gtk_widget_get_screen (widget));
-}
-
 /**
  * gtk_widget_get_visual:
  * @widget: a #GtkWidget
@@ -8748,32 +8705,6 @@ gtk_widget_get_settings (GtkWidget *widget)
   return gtk_settings_get_for_screen (gtk_widget_get_screen (widget));
 }
 
-/**
- * gtk_widget_set_colormap:
- * @widget: a #GtkWidget
- * @colormap: a colormap
- *
- * Sets the colormap for the widget to the given value. Widget must not
- * have been previously realized. This probably should only be used
- * from an <function>init()</function> function (i.e. from the constructor 
- * for the widget).
- **/
-void
-gtk_widget_set_colormap (GtkWidget   *widget,
-                         GdkColormap *colormap)
-{
-  g_return_if_fail (GTK_IS_WIDGET (widget));
-  g_return_if_fail (!gtk_widget_get_realized (widget));
-  g_return_if_fail (GDK_IS_COLORMAP (colormap));
-
-  g_object_ref (colormap);
-  
-  g_object_set_qdata_full (G_OBJECT (widget), 
-                          quark_colormap,
-                          colormap,
-                          g_object_unref);
-}
-
 /**
  * gtk_widget_get_events:
  * @widget: a #GtkWidget
index 9faaad7aaa51a0fd7a0efe04f428ce9f3a72d0c5..52cbbfd87cc849392ac2286892518875a288a8b8 100644 (file)
@@ -731,7 +731,6 @@ GdkExtensionMode gtk_widget_get_extension_events (GtkWidget *widget);
 GtkWidget*   gtk_widget_get_toplevel   (GtkWidget      *widget);
 GtkWidget*   gtk_widget_get_ancestor   (GtkWidget      *widget,
                                         GType           widget_type);
-GdkColormap* gtk_widget_get_colormap   (GtkWidget      *widget);
 GdkVisual*   gtk_widget_get_visual     (GtkWidget      *widget);
 
 GdkScreen *   gtk_widget_get_screen      (GtkWidget *widget);
@@ -772,15 +771,6 @@ void     gtk_widget_set_margin_bottom (GtkWidget *widget,
                                        gint       margin);
 
 
-/* The following functions must not be called on an already
- * realized widget. Because it is possible that somebody
- * can call get_colormap() or get_visual() and save the
- * result, these functions are probably only safe to
- * call in a widget's init() function.
- */
-void         gtk_widget_set_colormap    (GtkWidget      *widget,
-                                        GdkColormap    *colormap);
-
 gint        gtk_widget_get_events      (GtkWidget      *widget);
 GdkEventMask gtk_widget_get_device_events (GtkWidget   *widget,
                                            GdkDevice    *device);