[gtk+] API: remove gdk_screen_get_rgb_colormap/visual()
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] API: remove gdk_screen_get_rgb_colormap/visual()
- Date: Tue, 10 Aug 2010 19:12:57 +0000 (UTC)
commit d54c2cfeeed56f3bf0b16b4e80b2b9d0fa180221
Author: Benjamin Otte <otte redhat com>
Date: Tue Jul 13 02:40:12 2010 +0200
API: remove gdk_screen_get_rgb_colormap/visual()
People want to use gdk_screen_get_default_colormap/visual().
Also, GdkRGB is about to die.
docs/reference/gdk/gdk3-sections.txt | 2 -
docs/reference/gdk/tmpl/gdkscreen.sgml | 18 --------
gdk/gdk.symbols | 7 ---
gdk/gdkrgb.c | 70 ++++++++------------------------
gdk/gdkscreen.h | 2 -
gtk/gtktrayicon-x11.c | 2 -
6 files changed, 17 insertions(+), 84 deletions(-)
---
diff --git a/docs/reference/gdk/gdk3-sections.txt b/docs/reference/gdk/gdk3-sections.txt
index 2833bbc..dddc351 100644
--- a/docs/reference/gdk/gdk3-sections.txt
+++ b/docs/reference/gdk/gdk3-sections.txt
@@ -202,8 +202,6 @@ gdk_screen_get_default_colormap
gdk_screen_set_default_colormap
gdk_screen_get_system_colormap
gdk_screen_get_system_visual
-gdk_screen_get_rgb_colormap
-gdk_screen_get_rgb_visual
gdk_screen_get_rgba_colormap
gdk_screen_get_rgba_visual
gdk_screen_is_composited
diff --git a/docs/reference/gdk/tmpl/gdkscreen.sgml b/docs/reference/gdk/tmpl/gdkscreen.sgml
index eeeed17..96055d3 100644
--- a/docs/reference/gdk/tmpl/gdkscreen.sgml
+++ b/docs/reference/gdk/tmpl/gdkscreen.sgml
@@ -113,24 +113,6 @@ when GDK gets multihead support.
@Returns:
-<!-- ##### FUNCTION gdk_screen_get_rgb_colormap ##### -->
-<para>
-
-</para>
-
- screen:
- Returns:
-
-
-<!-- ##### FUNCTION gdk_screen_get_rgb_visual ##### -->
-<para>
-
-</para>
-
- screen:
- Returns:
-
-
<!-- ##### FUNCTION gdk_screen_get_rgba_colormap ##### -->
<para>
diff --git a/gdk/gdk.symbols b/gdk/gdk.symbols
index 5b5fb25..c0eeaa4 100644
--- a/gdk/gdk.symbols
+++ b/gdk/gdk.symbols
@@ -1017,13 +1017,6 @@ gdk_screen_get_default
#endif
#if IN_HEADER(__GDK_SCREEN_H__)
-#if IN_FILE(__GDK_RGB_C__)
-gdk_screen_get_rgb_colormap
-gdk_screen_get_rgb_visual
-#endif
-#endif
-
-#if IN_HEADER(__GDK_SCREEN_H__)
#if IN_FILE(__GDK_VISUAL_X11_C__)
gdk_screen_get_system_visual
gdk_screen_list_visuals
diff --git a/gdk/gdkrgb.c b/gdk/gdkrgb.c
index c82f44e..f21412d 100644
--- a/gdk/gdkrgb.c
+++ b/gdk/gdkrgb.c
@@ -3292,6 +3292,22 @@ gdk_draw_rgb_image_core (GdkRgbInfo *image_info,
}
}
+static GdkColormap *
+gdk_screen_get_rgb_colormap (GdkScreen *screen)
+{
+ GdkColormap *cmap;
+ g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
+ cmap = g_object_get_data (G_OBJECT (screen), "rgb-colormap");
+ if (!cmap)
+ {
+ GdkRgbInfo *image_info = gdk_rgb_create_info (gdk_rgb_choose_visual (screen), NULL);
+ cmap = image_info->cmap;
+ g_object_set_data (G_OBJECT (screen), "rgb-colormap", cmap);
+ }
+
+ return cmap;
+}
+
static GdkRgbInfo *
gdk_rgb_get_info_from_drawable (GdkDrawable *drawable)
{
@@ -3641,58 +3657,6 @@ gdk_rgb_get_colormap (void)
}
/**
- * gdk_screen_get_rgb_colormap:
- * @screen: a #GdkScreen.
- *
- * Gets the preferred colormap for rendering image data on @screen.
- * Not a very useful function; historically, GDK could only render RGB
- * image data to one colormap and visual, but in the current version
- * it can render to any colormap and visual. So there's no need to
- * call this function.
- *
- * Return value: (transfer none): the preferred colormap
- *
- * Since: 2.2
- **/
-GdkColormap *
-gdk_screen_get_rgb_colormap (GdkScreen *screen)
-{
- GdkColormap *cmap;
- g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
- cmap = g_object_get_data (G_OBJECT (screen), "rgb-colormap");
- if (!cmap)
- {
- GdkRgbInfo *image_info = gdk_rgb_create_info (gdk_rgb_choose_visual (screen), NULL);
- cmap = image_info->cmap;
- g_object_set_data (G_OBJECT (screen), "rgb-colormap", cmap);
- }
-
- return cmap;
-}
-
-/**
- * gdk_screen_get_rgb_visual:
- * @screen: a #GdkScreen
- *
- * Gets a "preferred visual" chosen by GdkRGB for rendering image data
- * on @screen. In previous versions of
- * GDK, this was the only visual GdkRGB could use for rendering. In
- * current versions, it's simply the visual GdkRGB would have chosen as
- * the optimal one in those previous versions. GdkRGB can now render to
- * drawables with any visual.
- *
- * Return value: (transfer none): The #GdkVisual chosen by GdkRGB.
- *
- * Since: 2.2
- **/
-GdkVisual *
-gdk_screen_get_rgb_visual (GdkScreen *screen)
-{
- g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
- return gdk_colormap_get_visual (gdk_screen_get_rgb_colormap (screen));
-}
-
-/**
* gdk_rgb_get_visual:
*
* Gets a "preferred visual" chosen by GdkRGB for rendering image data
@@ -3707,5 +3671,5 @@ gdk_screen_get_rgb_visual (GdkScreen *screen)
GdkVisual *
gdk_rgb_get_visual (void)
{
- return gdk_screen_get_rgb_visual (gdk_screen_get_default ());
+ return gdk_colormap_get_visual (gdk_screen_get_rgb_colormap (gdk_screen_get_default ()));
}
diff --git a/gdk/gdkscreen.h b/gdk/gdkscreen.h
index 200d643..ac6834a 100644
--- a/gdk/gdkscreen.h
+++ b/gdk/gdkscreen.h
@@ -72,8 +72,6 @@ void gdk_screen_set_default_colormap (GdkScreen *screen,
GdkColormap *colormap);
GdkColormap* gdk_screen_get_system_colormap (GdkScreen *screen);
GdkVisual* gdk_screen_get_system_visual (GdkScreen *screen);
-GdkColormap *gdk_screen_get_rgb_colormap (GdkScreen *screen);
-GdkVisual * gdk_screen_get_rgb_visual (GdkScreen *screen);
GdkColormap *gdk_screen_get_rgba_colormap (GdkScreen *screen);
GdkVisual * gdk_screen_get_rgba_visual (GdkScreen *screen);
gboolean gdk_screen_is_composited (GdkScreen *screen);
diff --git a/gtk/gtktrayicon-x11.c b/gtk/gtktrayicon-x11.c
index 7013e44..5e7a75c 100644
--- a/gtk/gtktrayicon-x11.c
+++ b/gtk/gtktrayicon-x11.c
@@ -829,8 +829,6 @@ gtk_tray_icon_set_colormap (GtkTrayIcon *icon)
if (visual == NULL || visual == gdk_screen_get_system_visual (screen))
colormap = gdk_screen_get_system_colormap (screen);
- else if (visual == gdk_screen_get_rgb_visual (screen))
- colormap = gdk_screen_get_rgb_colormap (screen);
else if (visual == gdk_screen_get_rgba_visual (screen))
colormap = gdk_screen_get_rgba_colormap (screen);
else
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]