[gtk+/rendering-cleanup: 140/141] API: Remove GdkColormap
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/rendering-cleanup: 140/141] API: Remove GdkColormap
- Date: Thu, 9 Sep 2010 16:35:06 +0000 (UTC)
commit 415b4f1c6a6c34d1991bb1af5586da72d9875da7
Author: Benjamin Otte <otte redhat com>
Date: Sun Aug 29 13:06:35 2010 +0200
API: Remove GdkColormap
docs/reference/gdk/gdk3-sections.txt | 22 +-
gdk/Makefile.am | 1 -
gdk/gdk.symbols | 12 -
gdk/gdkcolor.c | 65 +--
gdk/gdkcolor.h | 61 +--
gdk/gdktypes.h | 1 -
gdk/quartz/Makefile.am | 1 -
gdk/quartz/gdkcolor-quartz.c | 113 ----
gdk/win32/Makefile.am | 1 -
gdk/win32/gdkcolor-win32.c | 1121 --------------------------------
gdk/win32/gdkprivate-win32.h | 3 -
gdk/win32/makefile.msc | 1 -
gdk/x11/Makefile.am | 1 -
gdk/x11/gdkcolor-x11.c | 1168 ----------------------------------
gdk/x11/gdkscreen-x11.c | 2 -
gdk/x11/gdkscreen-x11.h | 1 -
gdk/x11/gdkx.h | 7 -
gtk/tests/defaultvalue.c | 2 -
18 files changed, 9 insertions(+), 2574 deletions(-)
---
diff --git a/docs/reference/gdk/gdk3-sections.txt b/docs/reference/gdk/gdk3-sections.txt
index d365bce..fae4d38 100644
--- a/docs/reference/gdk/gdk3-sections.txt
+++ b/docs/reference/gdk/gdk3-sections.txt
@@ -243,16 +243,9 @@ gdk_pixbuf_get_from_surface
</SECTION>
<SECTION>
-<TITLE>Colormaps and Colors</TITLE>
+<TITLE>Colors</TITLE>
<FILE>colors</FILE>
GdkColor
-GdkColormap
-gdk_colormap_new
-gdk_colormap_alloc_colors
-gdk_colormap_alloc_color
-gdk_colormap_free_colors
-gdk_colormap_get_visual
-gdk_colormap_get_screen
gdk_color_copy
gdk_color_free
gdk_color_parse
@@ -261,18 +254,8 @@ gdk_color_hash
gdk_color_to_string
<SUBSECTION Standard>
-GDK_COLORMAP
-GDK_COLORMAP_GET_CLASS
-GDK_TYPE_COLORMAP
-GDK_IS_COLORMAP
-GDK_COLORMAP_CLASS
-GDK_IS_COLORMAP_CLASS
GDK_TYPE_COLOR
-<SUBSECTION Private>
-GdkColormapClass
-gdk_colormap_get_type
-gdk_color_get_type
</SECTION>
<SECTION>
@@ -1000,9 +983,6 @@ gdk_x11_screen_lookup_visual
gdk_x11_window_set_user_time
gdk_x11_window_move_to_current_desktop
gdk_x11_display_get_user_time
-gdk_x11_colormap_foreign_new
-gdk_x11_colormap_get_xcolormap
-gdk_x11_colormap_get_xdisplay
gdk_x11_cursor_get_xcursor
gdk_x11_cursor_get_xdisplay
gdk_x11_display_broadcast_startup_message
diff --git a/gdk/Makefile.am b/gdk/Makefile.am
index 3f8b9a8..fb9a19a 100644
--- a/gdk/Makefile.am
+++ b/gdk/Makefile.am
@@ -187,7 +187,6 @@ x11_introspection_files = \
x11/checksettings.c \
x11/gdkapplaunchcontext-x11.c \
x11/gdkasync.c \
- x11/gdkcolor-x11.c \
x11/gdkcursor-x11.c \
x11/gdkdevice-core.c \
x11/gdkdevicemanager-core.c \
diff --git a/gdk/gdk.symbols b/gdk/gdk.symbols
index 815717a..d7b639f 100644
--- a/gdk/gdk.symbols
+++ b/gdk/gdk.symbols
@@ -303,23 +303,11 @@ gdk_color_equal
gdk_color_free
gdk_color_get_type G_GNUC_CONST
gdk_color_hash
-gdk_colormap_alloc_color
-gdk_colormap_get_visual
gdk_color_parse
gdk_color_to_string
#endif
#endif
-#if IN_HEADER(__GDK_COLOR_H__)
-#if IN_FILE(__GDK_COLOR_X11_C__)
-gdk_colormap_new
-gdk_colormap_get_type G_GNUC_CONST
-gdk_colormap_alloc_colors
-gdk_colormap_free_colors
-gdk_colormap_get_screen
-#endif
-#endif
-
#if IN_HEADER(__GDK_CURSOR_H__)
#if IN_FILE(__GDK_CURSOR_C__)
gdk_cursor_get_type G_GNUC_CONST
diff --git a/gdk/gdkcolor.c b/gdk/gdkcolor.c
index ce5c89c..8441600 100644
--- a/gdk/gdkcolor.c
+++ b/gdk/gdkcolor.c
@@ -33,22 +33,6 @@
/**
- * gdk_colormap_get_visual:
- * @colormap: a #GdkColormap.
- *
- * Returns the visual for which a given colormap was created.
- *
- * Return value: the visual of the colormap.
- **/
-GdkVisual *
-gdk_colormap_get_visual (GdkColormap *colormap)
-{
- g_return_val_if_fail (GDK_IS_COLORMAP (colormap), NULL);
-
- return colormap->visual;
-}
-
-/**
* gdk_color_copy:
* @color: a #GdkColor.
*
@@ -84,39 +68,6 @@ gdk_color_free (GdkColor *color)
g_slice_free (GdkColor, color);
}
-/********************
- * Color allocation *
- ********************/
-
-/**
- * gdk_colormap_alloc_color:
- * @colormap: a #GdkColormap.
- * @color: the color to allocate. On return the
- * <structfield>pixel</structfield> field will be
- * filled in if allocation succeeds.
- * @writeable: this parameter has no effect, and it's here for mere
- * compatibility.
- * @best_match: If %TRUE, GDK will attempt to do matching against
- * existing colors if the color cannot be allocated as requested.
- *
- * Allocates a single color from a colormap.
- *
- * Return value: %TRUE if the allocation succeeded.
- **/
-gboolean
-gdk_colormap_alloc_color (GdkColormap *colormap,
- GdkColor *color,
- gboolean writeable,
- gboolean best_match)
-{
- gboolean success;
-
- gdk_colormap_alloc_colors (colormap, color, 1, writeable, best_match,
- &success);
-
- return success;
-}
-
/**
* gdk_color_hash:
* @colora: a #GdkColor.
@@ -168,15 +119,13 @@ G_DEFINE_BOXED_TYPE (GdkColor, gdk_color,
* Parses a textual specification of a color and fill in the
* <structfield>red</structfield>, <structfield>green</structfield>,
* and <structfield>blue</structfield> fields of a #GdkColor
- * structure. The color is <emphasis>not</emphasis> allocated, you
- * must call gdk_colormap_alloc_color() yourself. The string can
- * either one of a large set of standard names. (Taken from the X11
- * <filename>rgb.txt</filename> file), or it can be a hex value in the
- * form '#rgb' '#rrggbb' '#rrrgggbbb' or
- * '#rrrrggggbbbb' where 'r', 'g' and 'b' are hex digits of the
- * red, green, and blue components of the color, respectively. (White
- * in the four forms is '#fff' '#ffffff' '#fffffffff' and
- * '#ffffffffffff')
+ * structure. The string can either one of a large set of standard
+ * names. (Taken from the X11 <filename>rgb.txt</filename> file), or
+ * it can be a hex value in the form '#rgb' '#rrggbb'
+ * '#rrrgggbbb' or '#rrrrggggbbbb' where 'r', 'g' and 'b' are
+ * hex digits of the red, green, and blue components of the color,
+ * respectively. (White in the four forms is '#fff' '#ffffff'
+ * '#fffffffff' and '#ffffffffffff')
*
* Return value: %TRUE if the parsing succeeded.
**/
diff --git a/gdk/gdkcolor.h b/gdk/gdkcolor.h
index d531cbe..97da01b 100644
--- a/gdk/gdkcolor.h
+++ b/gdk/gdkcolor.h
@@ -38,10 +38,7 @@ G_BEGIN_DECLS
/* The color type.
* A color consists of red, green and blue values in the
- * range 0-65535 and a pixel value. The pixel value is highly
- * dependent on the depth and colormap which this color will
- * be used to draw into. Therefore, sharing colors between
- * colormaps is a bad idea.
+ * range 0-65535 and a pixel value. The pixel value is unused.
*/
struct _GdkColor
{
@@ -51,64 +48,8 @@ struct _GdkColor
guint16 blue;
};
-/* The colormap type.
- */
-
-typedef struct _GdkColormapClass GdkColormapClass;
-
-#define GDK_TYPE_COLORMAP (gdk_colormap_get_type ())
-#define GDK_COLORMAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_COLORMAP, GdkColormap))
-#define GDK_COLORMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_COLORMAP, GdkColormapClass))
-#define GDK_IS_COLORMAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_COLORMAP))
-#define GDK_IS_COLORMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_COLORMAP))
-#define GDK_COLORMAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_COLORMAP, GdkColormapClass))
-
#define GDK_TYPE_COLOR (gdk_color_get_type ())
-struct _GdkColormap
-{
- /*< private >*/
- GObject parent_instance;
-
- /*< public >*/
- gint GSEAL (size);
- GdkColor *GSEAL (colors);
-
- /*< private >*/
- GdkVisual *GSEAL (visual);
-
- gpointer GSEAL (windowing_data);
-};
-
-struct _GdkColormapClass
-{
- GObjectClass parent_class;
-
-};
-
-GType gdk_colormap_get_type (void) G_GNUC_CONST;
-
-GdkColormap* gdk_colormap_new (GdkVisual *visual,
- gboolean allocate);
-
-GdkScreen *gdk_colormap_get_screen (GdkColormap *cmap);
-
-gint gdk_colormap_alloc_colors (GdkColormap *colormap,
- GdkColor *colors,
- gint n_colors,
- gboolean writeable,
- gboolean best_match,
- gboolean *success);
-gboolean gdk_colormap_alloc_color (GdkColormap *colormap,
- GdkColor *color,
- gboolean writeable,
- gboolean best_match);
-void gdk_colormap_free_colors (GdkColormap *colormap,
- const GdkColor *colors,
- gint n_colors);
-
-GdkVisual *gdk_colormap_get_visual (GdkColormap *colormap);
-
GdkColor *gdk_color_copy (const GdkColor *color);
void gdk_color_free (GdkColor *color);
gboolean gdk_color_parse (const gchar *spec,
diff --git a/gdk/gdktypes.h b/gdk/gdktypes.h
index e36d01c..42ebf59 100644
--- a/gdk/gdktypes.h
+++ b/gdk/gdktypes.h
@@ -90,7 +90,6 @@ typedef guint32 GdkNativeWindow;
/* Forward declarations of commonly used types
*/
typedef struct _GdkColor GdkColor;
-typedef struct _GdkColormap GdkColormap;
typedef struct _GdkCursor GdkCursor;
typedef struct _GdkVisual GdkVisual;
diff --git a/gdk/quartz/Makefile.am b/gdk/quartz/Makefile.am
index 683ea3e..96b0e61 100644
--- a/gdk/quartz/Makefile.am
+++ b/gdk/quartz/Makefile.am
@@ -22,7 +22,6 @@ libgdk_quartz_la_SOURCES = \
GdkQuartzWindow.c \
GdkQuartzWindow.h \
gdkapplaunchcontext-quartz.c \
- gdkcolor-quartz.c \
gdkcursor-quartz.c \
gdkdevice-core.c \
gdkdevicemanager-core.c \
diff --git a/gdk/win32/Makefile.am b/gdk/win32/Makefile.am
index a1cf0fd..d851ccf 100644
--- a/gdk/win32/Makefile.am
+++ b/gdk/win32/Makefile.am
@@ -27,7 +27,6 @@ EXTRA_DIST += \
libgdk_win32_la_SOURCES = \
xcursors.h \
gdkapplaunchcontext-win32.c \
- gdkcolor-win32.c \
gdkcursor-win32.c \
gdkdevicemanager-win32.c \
gdkdevicemanager-win32.h \
diff --git a/gdk/win32/gdkprivate-win32.h b/gdk/win32/gdkprivate-win32.h
index a14f192..384167e 100644
--- a/gdk/win32/gdkprivate-win32.h
+++ b/gdk/win32/gdkprivate-win32.h
@@ -179,9 +179,6 @@ void gdk_win32_handle_table_insert (HANDLE *handle,
gpointer data);
void gdk_win32_handle_table_remove (HANDLE handle);
-COLORREF _gdk_win32_colormap_color (GdkColormap *colormap,
- gulong pixel);
-
HRGN _gdk_win32_cairo_region_to_hrgn (const cairo_region_t *region,
gint x_origin,
gint y_origin);
diff --git a/gdk/win32/makefile.msc b/gdk/win32/makefile.msc
index c87eeed..3dac7c6 100644
--- a/gdk/win32/makefile.msc
+++ b/gdk/win32/makefile.msc
@@ -32,7 +32,6 @@ all: \
gdk_win32_OBJECTS = \
gdkapplaunchcontext-win32.obj \
- gdkcolor-win32.obj \
gdkcursor-win32.obj \
gdkdnd-win32.obj \
gdkdisplay-win32.obj \
diff --git a/gdk/x11/Makefile.am b/gdk/x11/Makefile.am
index f0d45c2..6344754 100644
--- a/gdk/x11/Makefile.am
+++ b/gdk/x11/Makefile.am
@@ -21,7 +21,6 @@ libgdk_x11_la_SOURCES = \
gdkapplaunchcontext-x11.c \
gdkasync.c \
gdkasync.h \
- gdkcolor-x11.c \
gdkcursor-x11.c \
gdkdevice-core.h \
gdkdevice-core.c \
diff --git a/gdk/x11/gdkscreen-x11.c b/gdk/x11/gdkscreen-x11.c
index 840db0a..62ad23e 100644
--- a/gdk/x11/gdkscreen-x11.c
+++ b/gdk/x11/gdkscreen-x11.c
@@ -295,8 +295,6 @@ gdk_screen_x11_finalize (GObject *object)
g_free (screen_x11->window_manager_name);
- g_hash_table_destroy (screen_x11->colormap_hash);
-
deinit_multihead (GDK_SCREEN (object));
G_OBJECT_CLASS (_gdk_screen_x11_parent_class)->finalize (object);
diff --git a/gdk/x11/gdkscreen-x11.h b/gdk/x11/gdkscreen-x11.h
index b0c6303..07fec61 100644
--- a/gdk/x11/gdkscreen-x11.h
+++ b/gdk/x11/gdkscreen-x11.h
@@ -78,7 +78,6 @@ struct _GdkScreenX11
GdkVisualType available_types[6];
gint navailable_types;
GHashTable *visual_hash;
- GHashTable *colormap_hash;
GdkVisual *rgba_visual;
/* X settings */
diff --git a/gdk/x11/gdkx.h b/gdk/x11/gdkx.h
index 045657f..f08fe35 100644
--- a/gdk/x11/gdkx.h
+++ b/gdk/x11/gdkx.h
@@ -41,8 +41,6 @@ extern Display *gdk_display;
Display *gdk_x11_drawable_get_xdisplay (GdkDrawable *drawable);
XID gdk_x11_drawable_get_xid (GdkDrawable *drawable);
GdkDrawable *gdk_x11_window_get_drawable_impl (GdkWindow *window);
-Display *gdk_x11_colormap_get_xdisplay (GdkColormap *colormap);
-Colormap gdk_x11_colormap_get_xcolormap (GdkColormap *colormap);
Display *gdk_x11_cursor_get_xdisplay (GdkCursor *cursor);
Cursor gdk_x11_cursor_get_xcursor (GdkCursor *cursor);
Display *gdk_x11_display_get_xdisplay (GdkDisplay *display);
@@ -61,8 +59,6 @@ Display *gdk_x11_get_default_xdisplay (void);
gint gdk_x11_get_default_screen (void);
#endif
-#define GDK_COLORMAP_XDISPLAY(cmap) (gdk_x11_colormap_get_xdisplay (cmap))
-#define GDK_COLORMAP_XCOLORMAP(cmap) (gdk_x11_colormap_get_xcolormap (cmap))
#define GDK_CURSOR_XDISPLAY(cursor) (gdk_x11_cursor_get_xdisplay (cursor))
#define GDK_CURSOR_XCURSOR(cursor) (gdk_x11_cursor_get_xcursor (cursor))
@@ -113,9 +109,6 @@ GdkVisual* gdk_x11_screen_lookup_visual (GdkScreen *screen,
GdkVisual* gdkx_visual_get (VisualID xvisualid);
#endif
-GdkColormap *gdk_x11_colormap_foreign_new (GdkVisual *visual,
- Colormap xcolormap);
-
/* Return the Gdk* for a particular XID */
gpointer gdk_xid_table_lookup_for_display (GdkDisplay *display,
XID xid);
diff --git a/gtk/tests/defaultvalue.c b/gtk/tests/defaultvalue.c
index 52848eb..ace79ff 100644
--- a/gtk/tests/defaultvalue.c
+++ b/gtk/tests/defaultvalue.c
@@ -84,8 +84,6 @@ test_type (gconstpointer data)
if (g_type_is_a (type, GTK_TYPE_SETTINGS))
instance = g_object_ref (gtk_settings_get_default ());
- else if (g_type_is_a (type, GDK_TYPE_COLORMAP))
- instance = g_object_ref (gdk_colormap_new (gdk_visual_get_best (), TRUE));
else if (g_type_is_a (type, GDK_TYPE_WINDOW))
{
GdkWindowAttr attributes;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]