mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-24 12:41:16 +00:00
API: remove gdk_screen_get_rgb_colormap/visual()
People want to use gdk_screen_get_default_colormap/visual(). Also, GdkRGB is about to die.
This commit is contained in:
parent
32c95ebe27
commit
d54c2cfeee
@ -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
|
||||
|
@ -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>
|
||||
|
||||
|
@ -1016,13 +1016,6 @@ gdk_screen_get_default
|
||||
#endif
|
||||
#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
|
||||
|
70
gdk/gdkrgb.c
70
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)
|
||||
{
|
||||
@ -3640,58 +3656,6 @@ gdk_rgb_get_colormap (void)
|
||||
return cmap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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:
|
||||
*
|
||||
@ -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 ()));
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user