Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dorota Czaplejewicz
gtk
Commits
894d402c
Commit
894d402c
authored
Aug 29, 2010
by
Benjamin Otte
Browse files
API: Remove gdk_drawable_set_colormap()
parent
e3161576
Changes
11
Hide whitespace changes
Inline
Side-by-side
docs/reference/gdk/gdk3-sections.txt
View file @
894d402c
...
...
@@ -288,7 +288,6 @@ GdkDrawable
gdk_drawable_get_display
gdk_drawable_get_screen
gdk_drawable_get_visual
gdk_drawable_set_colormap
gdk_drawable_get_colormap
gdk_drawable_get_depth
gdk_drawable_get_size
...
...
gdk/gdk.symbols
View file @
894d402c
...
...
@@ -541,7 +541,6 @@ gdk_drawable_get_size
gdk_drawable_get_type G_GNUC_CONST
gdk_drawable_get_visible_region
gdk_drawable_get_visual
gdk_drawable_set_colormap
#endif
#endif
...
...
gdk/gdkdraw.c
View file @
894d402c
...
...
@@ -150,29 +150,6 @@ gdk_drawable_get_display (GdkDrawable *drawable)
return
gdk_screen_get_display
(
gdk_drawable_get_screen
(
drawable
));
}
/**
* gdk_drawable_set_colormap:
* @drawable: a #GdkDrawable
* @colormap: a #GdkColormap
*
* Sets the colormap associated with @drawable. Normally this will
* happen automatically when the drawable is created; you only need to
* use this function if the drawable-creating function did not have a
* way to determine the colormap, and you then use drawable operations
* that require a colormap. The colormap for all drawables and
* graphics contexts you intend to use together should match.
**/
void
gdk_drawable_set_colormap
(
GdkDrawable
*
drawable
,
GdkColormap
*
cmap
)
{
g_return_if_fail
(
GDK_IS_DRAWABLE
(
drawable
));
g_return_if_fail
(
cmap
==
NULL
||
gdk_drawable_get_depth
(
drawable
)
==
cmap
->
visual
->
depth
);
GDK_DRAWABLE_GET_CLASS
(
drawable
)
->
set_colormap
(
drawable
,
cmap
);
}
/**
* gdk_drawable_get_colormap:
* @drawable: a #GdkDrawable
...
...
gdk/gdkdrawable.h
View file @
894d402c
...
...
@@ -61,9 +61,6 @@ struct _GdkDrawableClass
gint
*
width
,
gint
*
height
);
void
(
*
set_colormap
)
(
GdkDrawable
*
drawable
,
GdkColormap
*
cmap
);
GdkColormap
*
(
*
get_colormap
)
(
GdkDrawable
*
drawable
);
GdkVisual
*
(
*
get_visual
)
(
GdkDrawable
*
drawable
);
GdkScreen
*
(
*
get_screen
)
(
GdkDrawable
*
drawable
);
...
...
@@ -98,8 +95,6 @@ GType gdk_drawable_get_type (void) G_GNUC_CONST;
void
gdk_drawable_get_size
(
GdkDrawable
*
drawable
,
gint
*
width
,
gint
*
height
);
void
gdk_drawable_set_colormap
(
GdkDrawable
*
drawable
,
GdkColormap
*
colormap
);
GdkColormap
*
gdk_drawable_get_colormap
(
GdkDrawable
*
drawable
);
GdkVisual
*
gdk_drawable_get_visual
(
GdkDrawable
*
drawable
);
gint
gdk_drawable_get_depth
(
GdkDrawable
*
drawable
);
...
...
gdk/gdkoffscreenwindow.c
View file @
894d402c
...
...
@@ -148,27 +148,6 @@ gdk_offscreen_window_get_colormap (GdkDrawable *drawable)
return
offscreen
->
colormap
;
}
static
void
gdk_offscreen_window_set_colormap
(
GdkDrawable
*
drawable
,
GdkColormap
*
colormap
)
{
GdkOffscreenWindow
*
offscreen
=
GDK_OFFSCREEN_WINDOW
(
drawable
);
if
(
colormap
&&
GDK_WINDOW_DESTROYED
(
offscreen
->
wrapper
))
return
;
if
(
offscreen
->
colormap
==
colormap
)
return
;
if
(
offscreen
->
colormap
)
g_object_unref
(
offscreen
->
colormap
);
offscreen
->
colormap
=
colormap
;
if
(
offscreen
->
colormap
)
g_object_ref
(
offscreen
->
colormap
);
}
static
gint
gdk_offscreen_window_get_depth
(
GdkDrawable
*
drawable
)
{
...
...
@@ -756,7 +735,6 @@ gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass)
object_class
->
finalize
=
gdk_offscreen_window_finalize
;
drawable_class
->
ref_cairo_surface
=
gdk_offscreen_window_ref_cairo_surface
;
drawable_class
->
set_colormap
=
gdk_offscreen_window_set_colormap
;
drawable_class
->
get_colormap
=
gdk_offscreen_window_get_colormap
;
drawable_class
->
get_depth
=
gdk_offscreen_window_get_depth
;
drawable_class
->
get_screen
=
gdk_offscreen_window_get_screen
;
...
...
gdk/gdkwindow.c
View file @
894d402c
...
...
@@ -230,8 +230,6 @@ static void gdk_window_real_get_size (GdkDrawable *drawable,
static
GdkVisual
*
gdk_window_real_get_visual
(
GdkDrawable
*
drawable
);
static
gint
gdk_window_real_get_depth
(
GdkDrawable
*
drawable
);
static
GdkScreen
*
gdk_window_real_get_screen
(
GdkDrawable
*
drawable
);
static
void
gdk_window_real_set_colormap
(
GdkDrawable
*
drawable
,
GdkColormap
*
cmap
);
static
GdkColormap
*
gdk_window_real_get_colormap
(
GdkDrawable
*
drawable
);
static
cairo_region_t
*
gdk_window_get_clip_region
(
GdkDrawable
*
drawable
);
...
...
@@ -381,7 +379,6 @@ gdk_window_class_init (GdkWindowObjectClass *klass)
drawable_class
->
get_depth
=
gdk_window_real_get_depth
;
drawable_class
->
get_screen
=
gdk_window_real_get_screen
;
drawable_class
->
get_size
=
gdk_window_real_get_size
;
drawable_class
->
set_colormap
=
gdk_window_real_set_colormap
;
drawable_class
->
get_colormap
=
gdk_window_real_get_colormap
;
drawable_class
->
get_visual
=
gdk_window_real_get_visual
;
drawable_class
->
ref_cairo_surface
=
gdk_window_ref_cairo_surface
;
...
...
@@ -2059,8 +2056,6 @@ _gdk_window_destroy_hierarchy (GdkWindow *window,
window_remove_filters
(
window
);
gdk_drawable_set_colormap
(
GDK_DRAWABLE
(
window
),
NULL
);
window_remove_from_pointer_info
(
window
,
display
);
if
(
private
->
clip_region
)
...
...
@@ -3644,27 +3639,6 @@ gdk_window_real_get_screen (GdkDrawable *drawable)
return
gdk_drawable_get_screen
(
GDK_WINDOW_OBJECT
(
drawable
)
->
impl
);
}
static
void
gdk_window_real_set_colormap
(
GdkDrawable
*
drawable
,
GdkColormap
*
cmap
)
{
GdkWindowObject
*
private
;
g_return_if_fail
(
GDK_IS_WINDOW
(
drawable
));
if
(
GDK_WINDOW_DESTROYED
(
drawable
))
return
;
private
=
(
GdkWindowObject
*
)
drawable
;
/* different colormap than parent, requires native window */
if
(
!
private
->
input_only
&&
cmap
!=
gdk_drawable_get_colormap
((
GdkDrawable
*
)(
private
->
parent
)))
gdk_window_ensure_native
((
GdkWindow
*
)
drawable
);
gdk_drawable_set_colormap
(
private
->
impl
,
cmap
);
}
static
GdkColormap
*
gdk_window_real_get_colormap
(
GdkDrawable
*
drawable
)
{
...
...
gdk/quartz/gdkdrawable-quartz.c
View file @
894d402c
...
...
@@ -106,22 +106,6 @@ gdk_quartz_ref_cairo_surface (GdkDrawable *drawable)
return
impl
->
cairo_surface
;
}
static
void
gdk_quartz_set_colormap
(
GdkDrawable
*
drawable
,
GdkColormap
*
colormap
)
{
GdkDrawableImplQuartz
*
impl
=
GDK_DRAWABLE_IMPL_QUARTZ
(
drawable
);
if
(
impl
->
colormap
==
colormap
)
return
;
if
(
impl
->
colormap
)
g_object_unref
(
impl
->
colormap
);
impl
->
colormap
=
colormap
;
if
(
impl
->
colormap
)
g_object_ref
(
impl
->
colormap
);
}
static
GdkColormap
*
gdk_quartz_get_colormap
(
GdkDrawable
*
drawable
)
{
...
...
@@ -172,7 +156,6 @@ gdk_drawable_impl_quartz_class_init (GdkDrawableImplQuartzClass *klass)
drawable_class
->
ref_cairo_surface
=
gdk_quartz_ref_cairo_surface
;
drawable_class
->
create_cairo_surface
=
gdk_quartz_create_cairo_surface
;
drawable_class
->
set_colormap
=
gdk_quartz_set_colormap
;
drawable_class
->
get_colormap
=
gdk_quartz_get_colormap
;
drawable_class
->
get_depth
=
gdk_quartz_get_depth
;
...
...
gdk/win32/gdkdrawable-win32.c
View file @
894d402c
...
...
@@ -53,9 +53,6 @@ static cairo_surface_t *gdk_win32_create_cairo_surface (GdkDrawable *drawable,
int
width
,
int
height
);
static
void
gdk_win32_set_colormap
(
GdkDrawable
*
drawable
,
GdkColormap
*
colormap
);
static
GdkColormap
*
gdk_win32_get_colormap
(
GdkDrawable
*
drawable
);
static
gint
gdk_win32_get_depth
(
GdkDrawable
*
drawable
);
...
...
@@ -82,7 +79,6 @@ _gdk_drawable_impl_win32_class_init (GdkDrawableImplWin32Class *klass)
drawable_class
->
ref_cairo_surface
=
gdk_win32_ref_cairo_surface
;
drawable_class
->
create_cairo_surface
=
gdk_win32_create_cairo_surface
;
drawable_class
->
set_colormap
=
gdk_win32_set_colormap
;
drawable_class
->
get_colormap
=
gdk_win32_get_colormap
;
drawable_class
->
get_depth
=
gdk_win32_get_depth
;
...
...
@@ -98,8 +94,6 @@ _gdk_drawable_impl_win32_init (GdkDrawableImplWin32 *impl)
static
void
gdk_drawable_impl_win32_finalize
(
GObject
*
object
)
{
gdk_drawable_set_colormap
(
GDK_DRAWABLE
(
object
),
NULL
);
G_OBJECT_CLASS
(
_gdk_drawable_impl_win32_parent_class
)
->
finalize
(
object
);
}
...
...
@@ -113,22 +107,6 @@ gdk_win32_get_colormap (GdkDrawable *drawable)
return
GDK_DRAWABLE_IMPL_WIN32
(
drawable
)
->
colormap
;
}
static
void
gdk_win32_set_colormap
(
GdkDrawable
*
drawable
,
GdkColormap
*
colormap
)
{
GdkDrawableImplWin32
*
impl
=
GDK_DRAWABLE_IMPL_WIN32
(
drawable
);
if
(
impl
->
colormap
==
colormap
)
return
;
if
(
impl
->
colormap
)
g_object_unref
(
impl
->
colormap
);
impl
->
colormap
=
colormap
;
if
(
impl
->
colormap
)
g_object_ref
(
impl
->
colormap
);
}
/* Drawing
*/
...
...
gdk/win32/gdkwindow-win32.c
View file @
894d402c
...
...
@@ -38,8 +38,6 @@
#include "gdkenumtypes.h"
static
GdkColormap
*
gdk_window_impl_win32_get_colormap
(
GdkDrawable
*
drawable
);
static
void
gdk_window_impl_win32_set_colormap
(
GdkDrawable
*
drawable
,
GdkColormap
*
cmap
);
static
void
gdk_window_impl_win32_init
(
GdkWindowImplWin32
*
window
);
static
void
gdk_window_impl_win32_class_init
(
GdkWindowImplWin32Class
*
klass
);
static
void
gdk_window_impl_win32_finalize
(
GObject
*
object
);
...
...
@@ -134,7 +132,6 @@ gdk_window_impl_win32_class_init (GdkWindowImplWin32Class *klass)
object_class
->
finalize
=
gdk_window_impl_win32_finalize
;
drawable_class
->
set_colormap
=
gdk_window_impl_win32_set_colormap
;
drawable_class
->
get_colormap
=
gdk_window_impl_win32_get_colormap
;
}
...
...
@@ -211,28 +208,6 @@ gdk_window_impl_win32_get_colormap (GdkDrawable *drawable)
return
drawable_impl
->
colormap
;
}
static
void
gdk_window_impl_win32_set_colormap
(
GdkDrawable
*
drawable
,
GdkColormap
*
cmap
)
{
GdkWindowImplWin32
*
impl
;
GdkDrawableImplWin32
*
draw_impl
;
g_return_if_fail
(
GDK_IS_WINDOW_IMPL_WIN32
(
drawable
));
impl
=
GDK_WINDOW_IMPL_WIN32
(
drawable
);
draw_impl
=
GDK_DRAWABLE_IMPL_WIN32
(
drawable
);
/* chain up */
GDK_DRAWABLE_CLASS
(
parent_class
)
->
set_colormap
(
drawable
,
cmap
);
if
(
cmap
)
{
/* XXX */
g_print
(
"gdk_window_impl_win32_set_colormap: XXX
\n
"
);
}
}
void
_gdk_root_window_size_init
(
void
)
{
...
...
gdk/x11/gdkdrawable-x11.c
View file @
894d402c
...
...
@@ -44,16 +44,11 @@ static cairo_surface_t *gdk_x11_create_cairo_surface (GdkDrawable *drawable,
int
width
,
int
height
);
static
void
gdk_x11_set_colormap
(
GdkDrawable
*
drawable
,
GdkColormap
*
colormap
);
static
GdkColormap
*
gdk_x11_get_colormap
(
GdkDrawable
*
drawable
);
static
gint
gdk_x11_get_depth
(
GdkDrawable
*
drawable
);
static
GdkScreen
*
gdk_x11_get_screen
(
GdkDrawable
*
drawable
);
static
GdkVisual
*
gdk_x11_get_visual
(
GdkDrawable
*
drawable
);
static
void
gdk_drawable_impl_x11_finalize
(
GObject
*
object
);
static
const
cairo_user_data_key_t
gdk_x11_cairo_key
;
G_DEFINE_TYPE
(
GdkDrawableImplX11
,
_gdk_drawable_impl_x11
,
GDK_TYPE_DRAWABLE
)
...
...
@@ -62,14 +57,10 @@ static void
_gdk_drawable_impl_x11_class_init
(
GdkDrawableImplX11Class
*
klass
)
{
GdkDrawableClass
*
drawable_class
=
GDK_DRAWABLE_CLASS
(
klass
);
GObjectClass
*
object_class
=
G_OBJECT_CLASS
(
klass
);
object_class
->
finalize
=
gdk_drawable_impl_x11_finalize
;
drawable_class
->
ref_cairo_surface
=
gdk_x11_ref_cairo_surface
;
drawable_class
->
create_cairo_surface
=
gdk_x11_create_cairo_surface
;
drawable_class
->
set_colormap
=
gdk_x11_set_colormap
;
drawable_class
->
get_colormap
=
gdk_x11_get_colormap
;
drawable_class
->
get_depth
=
gdk_x11_get_depth
;
...
...
@@ -82,14 +73,6 @@ _gdk_drawable_impl_x11_init (GdkDrawableImplX11 *impl)
{
}
static
void
gdk_drawable_impl_x11_finalize
(
GObject
*
object
)
{
gdk_drawable_set_colormap
(
GDK_DRAWABLE
(
object
),
NULL
);
G_OBJECT_CLASS
(
_gdk_drawable_impl_x11_parent_class
)
->
finalize
(
object
);
}
/**
* _gdk_x11_drawable_finish:
* @drawable: a #GdkDrawableImplX11.
...
...
@@ -144,24 +127,6 @@ gdk_x11_get_colormap (GdkDrawable *drawable)
return
impl
->
colormap
;
}
static
void
gdk_x11_set_colormap
(
GdkDrawable
*
drawable
,
GdkColormap
*
colormap
)
{
GdkDrawableImplX11
*
impl
;
impl
=
GDK_DRAWABLE_IMPL_X11
(
drawable
);
if
(
impl
->
colormap
==
colormap
)
return
;
if
(
impl
->
colormap
)
g_object_unref
(
impl
->
colormap
);
impl
->
colormap
=
colormap
;
if
(
impl
->
colormap
)
g_object_ref
(
impl
->
colormap
);
}
static
gint
gdk_x11_get_depth
(
GdkDrawable
*
drawable
)
{
...
...
gdk/x11/gdkwindow-x11.c
View file @
894d402c
...
...
@@ -112,8 +112,6 @@ static void gdk_window_x11_set_background (GdkWindow *window,
cairo_pattern_t
*
pattern
);
static
GdkColormap
*
gdk_window_impl_x11_get_colormap
(
GdkDrawable
*
drawable
);
static
void
gdk_window_impl_x11_set_colormap
(
GdkDrawable
*
drawable
,
GdkColormap
*
cmap
);
static
void
gdk_window_impl_x11_finalize
(
GObject
*
object
);
static
void
gdk_window_impl_iface_init
(
GdkWindowImplIface
*
iface
);
...
...
@@ -182,7 +180,6 @@ gdk_window_impl_x11_class_init (GdkWindowImplX11Class *klass)
object_class
->
finalize
=
gdk_window_impl_x11_finalize
;
drawable_class
->
set_colormap
=
gdk_window_impl_x11_set_colormap
;
drawable_class
->
get_colormap
=
gdk_window_impl_x11_get_colormap
;
}
...
...
@@ -454,35 +451,6 @@ gdk_window_impl_x11_get_colormap (GdkDrawable *drawable)
return
drawable_impl
->
colormap
;
}
static
void
gdk_window_impl_x11_set_colormap
(
GdkDrawable
*
drawable
,
GdkColormap
*
cmap
)
{
GdkDrawableImplX11
*
draw_impl
;
g_return_if_fail
(
GDK_IS_WINDOW_IMPL_X11
(
drawable
));
draw_impl
=
GDK_DRAWABLE_IMPL_X11
(
drawable
);
if
(
cmap
&&
GDK_WINDOW_DESTROYED
(
draw_impl
->
wrapper
))
return
;
/* chain up */
GDK_DRAWABLE_CLASS
(
gdk_window_impl_x11_parent_class
)
->
set_colormap
(
drawable
,
cmap
);
if
(
cmap
)
{
XSetWindowColormap
(
GDK_SCREEN_XDISPLAY
(
draw_impl
->
screen
),
draw_impl
->
xid
,
GDK_COLORMAP_XCOLORMAP
(
cmap
));
if
(((
GdkWindowObject
*
)
draw_impl
->
wrapper
)
->
window_type
!=
GDK_WINDOW_TOPLEVEL
)
gdk_window_add_colormap_windows
(
GDK_WINDOW
(
draw_impl
->
wrapper
));
}
}
void
_gdk_windowing_window_init
(
GdkScreen
*
screen
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment