Remove some deprecated stuff from GdkWindow

Also, substitute the deprecated functions with the correct ones
This commit is contained in:
Javier Jardón 2010-05-12 04:25:46 +02:00
parent c6a789998a
commit 2b64a7fd54
15 changed files with 14 additions and 293 deletions

View File

@ -3102,7 +3102,7 @@ like this:</para>
gc = gdk_gc_new(widget->window);
/* find proper dimensions for rectangle */
gdk_window_get_size(widget->window, &amp;width, &amp;height);
gdk_drawable_get_size(widget->window, &amp;width, &amp;height);
/* the color we want to use */
color = (GdkColor *)malloc(sizeof(GdkColor));

View File

@ -612,8 +612,6 @@ GdkWindowAttr
GdkWindowAttributesType
gdk_window_new
gdk_window_destroy
gdk_window_ref
gdk_window_unref
gdk_window_get_window_type
gdk_window_at_pointer
gdk_window_show
@ -647,7 +645,6 @@ gdk_window_reparent
gdk_window_clear
gdk_window_clear_area
gdk_window_clear_area_e
gdk_window_copy_area
gdk_window_raise
gdk_window_lower
gdk_window_restack
@ -696,14 +693,12 @@ gdk_window_input_shape_combine_region
gdk_window_set_child_input_shapes
gdk_window_merge_child_input_shapes
gdk_window_set_static_gravities
gdk_window_set_hints
gdk_window_set_title
gdk_window_set_background
gdk_window_set_back_pixmap
GDK_PARENT_RELATIVE
gdk_window_set_cursor
gdk_window_get_cursor
gdk_window_set_colormap
gdk_window_get_user_data
gdk_window_get_geometry
gdk_window_set_geometry_hints
@ -717,10 +712,6 @@ gdk_window_set_urgency_hint
gdk_window_get_position
gdk_window_get_root_origin
gdk_window_get_frame_extents
gdk_window_get_size
gdk_window_get_visual
gdk_window_get_colormap
gdk_window_get_type
gdk_window_get_origin
gdk_window_get_deskrelative_origin
gdk_window_get_root_coords
@ -1237,7 +1228,6 @@ gdk_drag_context_get_type
<TITLE>X Window System Interaction</TITLE>
<FILE>x_interaction</FILE>
GDK_ROOT_WINDOW
GDK_ROOT_PARENT
GDK_DISPLAY
GDK_WINDOW_XDISPLAY
GDK_WINDOW_XID

View File

@ -383,7 +383,7 @@ union, 16-bit data uses the s array, and 32-bit data uses the l array.
<!-- ##### STRUCT GdkEventNoExpose ##### -->
<para>
Generated when the area of a #GdkDrawable being copied, with gdk_draw_drawable()
or gdk_window_copy_area(), was completely available.
, was completely available.
</para>
<para>
FIXME: add more here.

View File

@ -510,21 +510,6 @@ corresponding flag in #GdkWindowAttributesType.
@window:
<!-- ##### MACRO gdk_window_ref ##### -->
<para>
Deprecated equivalent of g_object_ref()
</para>
@Returns: the window
<!-- ##### MACRO gdk_window_unref ##### -->
<para>
Deprecated equivalent of g_object_unref()
</para>
<!-- ##### FUNCTION gdk_window_get_window_type ##### -->
<para>
@ -825,26 +810,6 @@ Deprecated equivalent of g_object_unref()
@height:
<!-- ##### MACRO gdk_window_copy_area ##### -->
<para>
Deprecated equivalent to gdk_draw_drawable(), see that function for docs
</para>
@drawable: a #GdkDrawable
@gc: a #GdkGC sharing the drawable's visual and colormap
@x: X position in @drawable where the rectangle should be drawn
@y: Y position in @drawable where the rectangle should be drawn
@source_drawable: the source #GdkDrawable, which may be the same as @drawable
@source_x: X position in @src of rectangle to draw
@source_y: Y position in @src of rectangle to draw
@width: width of rectangle to draw, or -1 for entire @src width
@height: height of rectangle to draw, or -1 for entire @src height
<!-- # Unused Parameters # -->
@drawable: a #GdkDrawable
@xdest: X position in @drawable where the rectangle should be drawn
@ydest: Y position in @drawable where the rectangle should be drawn
<!-- ##### FUNCTION gdk_window_raise ##### -->
<para>
@ -1248,21 +1213,6 @@ backend, <type>MSG</type>s for Win32).
@Returns:
<!-- ##### FUNCTION gdk_window_set_hints ##### -->
<para>
</para>
@window:
@x:
@y:
@min_width:
@min_height:
@max_width:
@max_height:
@flags:
<!-- ##### FUNCTION gdk_window_set_title ##### -->
<para>
@ -1318,13 +1268,6 @@ window.
@Returns:
<!-- ##### MACRO gdk_window_set_colormap ##### -->
<para>
Deprecated equivalent to gdk_drawable_set_colormap()
</para>
<!-- ##### FUNCTION gdk_window_get_user_data ##### -->
<para>
@ -1449,37 +1392,6 @@ Deprecated equivalent to gdk_drawable_set_colormap()
@rect:
<!-- ##### MACRO gdk_window_get_size ##### -->
<para>
Deprecated equivalent of gdk_drawable_get_size().
</para>
<!-- ##### MACRO gdk_window_get_visual ##### -->
<para>
Deprecated equivalent of gdk_drawable_get_visual().
</para>
@Returns: the #GdkVisual of the window
<!-- ##### MACRO gdk_window_get_colormap ##### -->
<para>
Deprecated equivalent of gdk_drawable_get_colormap().
</para>
@Returns: colormap for the window
<!-- ##### MACRO gdk_window_get_type ##### -->
<para>
Deprecated equivalent of gdk_drawable_get_type().
</para>
@Returns: type of drawable
<!-- ##### FUNCTION gdk_window_get_origin ##### -->
<para>

View File

@ -26,14 +26,6 @@ Obtains the Xlib window id of the root window of the current screen.
</para>
<!-- ##### MACRO GDK_ROOT_PARENT ##### -->
<para>
Obtains the Xlib window id of the root window of the default screen.
</para>
<!-- ##### MACRO GDK_DISPLAY ##### -->
<para>
The current display.

View File

@ -1526,26 +1526,6 @@ gdk_window_directfb_lower (GdkWindow *window)
}
}
void
gdk_window_set_hints (GdkWindow *window,
gint x,
gint y,
gint min_width,
gint min_height,
gint max_width,
gint max_height,
gint flags)
{
g_return_if_fail (GDK_IS_WINDOW (window));
if (GDK_WINDOW_DESTROYED (window))
return;
D_DEBUG_AT( GDKDFB_Window, "%s( %p, %3d,%3d, min %4dx%4d, max %4dx%4d, flags 0x%08x )\n", G_STRFUNC,
window, x,y, min_width, min_height, max_width, max_height, flags );
/* N/A */
}
void
gdk_window_set_geometry_hints (GdkWindow *window,
const GdkGeometry *geometry,

View File

@ -744,9 +744,6 @@ gdk_window_foreign_new_for_display
gdk_window_focus
gdk_window_lookup
gdk_window_lookup_for_display
#ifndef GDK_DISABLE_DEPRECATED
gdk_window_set_hints
#endif
gdk_window_get_type_hint
gdk_window_set_type_hint
gdk_window_set_modal_hint

View File

@ -475,16 +475,6 @@ GdkWindow* gdk_window_lookup_for_display (GdkDisplay *display,
/* GdkWindow */
#ifndef GDK_DISABLE_DEPRECATED
void gdk_window_set_hints (GdkWindow *window,
gint x,
gint y,
gint min_width,
gint min_height,
gint max_width,
gint max_height,
gint flags);
#endif
void gdk_window_set_type_hint (GdkWindow *window,
GdkWindowTypeHint hint);
GdkWindowTypeHint gdk_window_get_type_hint (GdkWindow *window);
@ -699,19 +689,6 @@ void gdk_window_redirect_to_drawable (GdkWindow *window,
gint height);
void gdk_window_remove_redirection (GdkWindow *window);
#ifndef GDK_DISABLE_DEPRECATED
#define GDK_ROOT_PARENT() (gdk_get_default_root_window ())
#define gdk_window_get_size gdk_drawable_get_size
#define gdk_window_get_type gdk_window_get_window_type
#define gdk_window_get_colormap gdk_drawable_get_colormap
#define gdk_window_set_colormap gdk_drawable_set_colormap
#define gdk_window_get_visual gdk_drawable_get_visual
#define gdk_window_ref g_object_ref
#define gdk_window_unref g_object_unref
#define gdk_window_copy_area(drawable,gc,x,y,source_drawable,source_x,source_y,width,height) \
gdk_draw_pixmap(drawable,gc,source_drawable,source_x,source_y,x,y,width,height)
#endif /* GDK_DISABLE_DEPRECATED */
G_END_DECLS

View File

@ -1333,9 +1333,9 @@ move_resize_window_internal (GdkWindow *window,
old_visible.x = -private->x;
old_visible.y = -private->y;
gdk_window_get_size (GDK_DRAWABLE (private->parent),
&old_visible.width,
&old_visible.height);
gdk_drawable_get_size (GDK_DRAWABLE (private->parent),
&old_visible.width,
&old_visible.height);
}
if (x != -1)
@ -2341,19 +2341,6 @@ gdk_window_focus (GdkWindow *window,
}
}
void
gdk_window_set_hints (GdkWindow *window,
gint x,
gint y,
gint min_width,
gint min_height,
gint max_width,
gint max_height,
gint flags)
{
/* FIXME: Implement */
}
static
gint window_type_hint_to_level (GdkWindowTypeHint hint)
{

View File

@ -361,7 +361,7 @@ test_pixmaps (gint depth)
{
pixmap = gdk_pixmap_new (NULL, width, height, depth);
ASSERT (pixmap != NULL);
gdk_window_get_size (pixmap, &w, &h);
gdk_drawable_get_size (pixmap, &w, &h);
QTESTF (w == width, (" w:%d", w));
QTESTF (h == height, (" h:%d", h));
image = gdk_drawable_get_image (pixmap, 0, 0, w, h);
@ -444,10 +444,10 @@ test_temp_windows (void)
gdk_window_get_geometry (window, &x, &y, &w, &h, &d);
QTESTF (w == 37, ("w:%d", w));
QTESTF (h == 19, ("h:%d", h));
visual = gdk_window_get_visual (window);
visual = gdk_drawable_get_visual (window);
QTEST (visual == system_visual);
gdk_window_hide (window);
gdk_window_unref (window);
g_object_unref (window);
}
TEST (retval);
}
@ -600,7 +600,7 @@ test_one_line_on_drawable (GdkDrawable *drawable,
line_width = gcvalues.line_width > 0 ? gcvalues.line_width : 1;
w_up = w_left = line_width/2;
w_down = w_right = (line_width & 1) ? line_width/2 : line_width/2-1;
gdk_window_get_size (drawable, &w, &h);
gdk_drawable_get_size (drawable, &w, &h);
oldimage = gdk_drawable_get_image (drawable, 0, 0, w, h);
if (depth == 32)
@ -714,7 +714,7 @@ test_one_rectangle_on_drawable (GdkDrawable *drawable,
w_down = w_right = (line_width & 1) ? line_width/2 : line_width/2-1;
}
gdk_window_get_size (drawable, &w, &h);
gdk_drawable_get_size (drawable, &w, &h);
oldimage = gdk_drawable_get_image (drawable, 0, 0, w, h);
if (depth == 32)
@ -820,7 +820,7 @@ test_some_arcs_on_drawable (GdkDrawable *drawable,
w_down = w_right = (line_width & 1) ? line_width/2 : line_width/2-1;
}
gdk_window_get_size (drawable, &w, &h);
gdk_drawable_get_size (drawable, &w, &h);
oldimage = gdk_drawable_get_image (drawable, 0, 0, w, h);
if (depth == 32)

View File

@ -2359,7 +2359,7 @@ gdk_window_register_dnd (GdkWindow *window)
OTHER_API_FAILED ("RegisterDragDrop");
else
{
gdk_window_ref (window);
g_object_ref (window);
g_hash_table_insert (target_ctx_for_window, GDK_WINDOW_HWND (window), ctx);
}
}

View File

@ -41,8 +41,6 @@ G_BEGIN_DECLS
#include "gdkprivate-win32.h"
#undef GDK_ROOT_PARENT /* internal access is direct */
#define GDK_ROOT_PARENT() ((GdkWindow *) _gdk_parent_root)
#define GDK_WINDOW_HWND(win) (GDK_DRAWABLE_IMPL_WIN32(((GdkWindowObject *)win)->impl)->handle)
#define GDK_PIXMAP_HBITMAP(pixmap) (GDK_DRAWABLE_IMPL_WIN32(((GdkPixmapObject *)pixmap)->impl)->handle)
#define GDK_DRAWABLE_IMPL_WIN32_HANDLE(d) (((GdkDrawableImplWin32 *) d)->handle)

View File

@ -1460,52 +1460,6 @@ gdk_win32_window_lower (GdkWindow *window)
}
}
void
gdk_window_set_hints (GdkWindow *window,
gint x,
gint y,
gint min_width,
gint min_height,
gint max_width,
gint max_height,
gint flags)
{
/* Note that this function is obsolete */
GdkWindowImplWin32 *impl;
g_return_if_fail (GDK_IS_WINDOW (window));
if (GDK_WINDOW_DESTROYED (window))
return;
impl = GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (window)->impl);
GDK_NOTE (MISC, g_print ("gdk_window_set_hints: %p: %dx%d..%dx%d @%+d%+d\n",
GDK_WINDOW_HWND (window),
min_width, min_height, max_width, max_height,
x, y));
if (flags)
{
GdkGeometry geom;
gint geom_mask = 0;
geom.min_width = min_width;
geom.min_height = min_height;
geom.max_width = max_width;
geom.max_height = max_height;
if (flags & GDK_HINT_MIN_SIZE)
geom_mask |= GDK_HINT_MIN_SIZE;
if (flags & GDK_HINT_MAX_SIZE)
geom_mask |= GDK_HINT_MAX_SIZE;
gdk_window_set_geometry_hints (window, &geom, geom_mask);
}
}
void
gdk_window_set_urgency_hint (GdkWindow *window,
gboolean urgent)

View File

@ -1877,72 +1877,6 @@ gdk_window_focus (GdkWindow *window,
}
}
/**
* gdk_window_set_hints:
* @window: a #GdkWindow
* @x: ignored field, does not matter
* @y: ignored field, does not matter
* @min_width: minimum width hint
* @min_height: minimum height hint
* @max_width: max width hint
* @max_height: max height hint
* @flags: logical OR of GDK_HINT_POS, GDK_HINT_MIN_SIZE, and/or GDK_HINT_MAX_SIZE
*
* This function is broken and useless and you should ignore it.
* If using GTK+, use functions such as gtk_window_resize(), gtk_window_set_size_request(),
* gtk_window_move(), gtk_window_parse_geometry(), and gtk_window_set_geometry_hints(),
* depending on what you're trying to do.
*
* If using GDK directly, use gdk_window_set_geometry_hints().
*
**/
void
gdk_window_set_hints (GdkWindow *window,
gint x,
gint y,
gint min_width,
gint min_height,
gint max_width,
gint max_height,
gint flags)
{
XSizeHints size_hints;
if (GDK_WINDOW_DESTROYED (window) ||
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
return;
size_hints.flags = 0;
if (flags & GDK_HINT_POS)
{
size_hints.flags |= PPosition;
size_hints.x = x;
size_hints.y = y;
}
if (flags & GDK_HINT_MIN_SIZE)
{
size_hints.flags |= PMinSize;
size_hints.min_width = min_width;
size_hints.min_height = min_height;
}
if (flags & GDK_HINT_MAX_SIZE)
{
size_hints.flags |= PMaxSize;
size_hints.max_width = max_width;
size_hints.max_height = max_height;
}
/* FIXME: Would it be better to delete this property if
* flags == 0? It would save space on the server
*/
XSetWMNormalHints (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
&size_hints);
}
/**
* gdk_window_set_type_hint:
* @window: A toplevel #GdkWindow

View File

@ -2170,8 +2170,8 @@ gtk_widget_class_init (GtkWidgetClass *klass)
* @event: the #GdkEventNoExpose which triggered this signal
*
* The ::no-expose-event will be emitted when the @widget's window is
* drawn as a copy of another #GdkDrawable (with gdk_draw_drawable() or
* gdk_window_copy_area()) which was completely unobscured. If the source
* drawn as a copy of another #GdkDrawable (with gdk_draw_drawable())
* which was completely unobscured. If the source
* window was partially obscured #GdkEventExpose events will be generated
* for those areas.
*