[gtkmm] Fix the build with latest GTK+, using Cairo::Region.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] Fix the build with latest GTK+, using Cairo::Region.
- Date: Tue, 6 Jul 2010 13:55:27 +0000 (UTC)
commit 101cb73e75f97382d82b6317eac536e11b621a1b
Author: Murray Cumming <murrayc murrayc com>
Date: Tue Jul 6 15:55:24 2010 +0200
Fix the build with latest GTK+, using Cairo::Region.
* gdk/src/gdk_methods.defs:
* gdk/src/gdk_pixbuf_methods.defs:
* gtk/src/gtk_methods.defs: Regenerated
* gdk/src/filelist.am:
* gdk/src/region.[hg|ccg]: Removed Region, because GdkRegion was removed
from GDK.
* gdk/gdkmm/general.[h|cc]:
* gdk/src/drawable.hg
* gdk/src/gc.hg
* gdk/src/window.hg
* gtk/src/widget.hg
* tools/m4/convert_gdk.m4: Adapted, replacing use of GdkRegion with
Cairo::RefPtr<Cairo::Region>, adding const and non-const overloads
where appropriate.
This requires cairomm from git master, for Cairo::Region.
ChangeLog | 25 ++-
gdk/gdkmm/general.cc | 5 +-
gdk/gdkmm/general.h | 10 +-
gdk/src/drawable.hg | 28 +-
gdk/src/filelist.am | 1 -
gdk/src/gc.hg | 5 +-
gdk/src/gdk_methods.defs | 590 ++++++++++++++++++++++++++++-----------
gdk/src/gdk_pixbuf_methods.defs | 132 +++++++--
gdk/src/region.ccg | 60 ----
gdk/src/region.hg | 75 -----
gdk/src/window.hg | 20 +-
gtk/src/gtk_methods.defs | 4 +-
gtk/src/widget.hg | 4 +-
tools/m4/convert_gdk.m4 | 9 +-
14 files changed, 590 insertions(+), 378 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index def40c8..a8cdb71 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
+2010-07-06 Murray Cumming <murrayc murrayc-desktop>
+
+ Fix the build with latest GTK+, using Cairo::Region.
+
+ * gdk/src/gdk_methods.defs:
+ * gdk/src/gdk_pixbuf_methods.defs:
+ * gtk/src/gtk_methods.defs: Regenerated
+
+ * gdk/src/filelist.am:
+ * gdk/src/region.[hg|ccg]: Removed Region, because GdkRegion was removed
+ from GDK.
+
+ * gdk/gdkmm/general.[h|cc]:
+ * gdk/src/drawable.hg
+ * gdk/src/gc.hg
+ * gdk/src/window.hg
+ * gtk/src/widget.hg
+ * tools/m4/convert_gdk.m4: Adapted, replacing use of GdkRegion with
+ Cairo::RefPtr<Cairo::Region>, adding const and non-const overloads
+ where appropriate.
+
+ This requires cairomm from git master, for Cairo::Region.
+
2.90.4:
2010-06-29 Murray Cumming <murrayc murrayc com>
@@ -8,7 +31,7 @@
* gtk/src/gtk_methods.defs: Regenerated with h2defs.py.
* gtk/src/button.hg: Added get_event_window().
* gtk/src/table.hg: Added get_size().
-
+
2010-06-28 Murray Cumming <murrayc murrayc com>
PrintOperation: const and refcount fixes.
diff --git a/gdk/gdkmm/general.cc b/gdk/gdkmm/general.cc
index 00eb4ad..d198e92 100644
--- a/gdk/gdkmm/general.cc
+++ b/gdk/gdkmm/general.cc
@@ -74,12 +74,11 @@ void add_rectangle_to_path(const ::Cairo::RefPtr< ::Cairo::Context >& context, c
gdk_cairo_rectangle(context->cobj(), const_cast<GdkRectangle*>(rectangle.gobj()));
}
-void add_region_to_path(const ::Cairo::RefPtr< ::Cairo::Context >& context, const Gdk::Region& region)
+void add_region_to_path(const ::Cairo::RefPtr< ::Cairo::Context >& context, const ::Cairo::RefPtr< ::Cairo::Region>& region)
{
- gdk_cairo_region(context->cobj(), const_cast<GdkRegion*>(region.gobj()));
+ gdk_cairo_region(context->cobj(), (region ? region->cobj() : 0));
}
} //namespace Cairo
} //namespace Gdk
-
diff --git a/gdk/gdkmm/general.h b/gdk/gdkmm/general.h
index 9e7a03a..ba92936 100644
--- a/gdk/gdkmm/general.h
+++ b/gdk/gdkmm/general.h
@@ -22,6 +22,7 @@
#include <gdkmm/pixbuf.h>
#include <cairomm/context.h>
+#include <cairomm/region.h>
namespace Gdk
{
@@ -39,7 +40,7 @@ namespace Cairo
/** Sets the specified Gdk::Color as the source color of the Cairo context.
* @param @context The cairo context.
- * @param color The color to use as the source color.
+ * @param color The color to use as the source color.
*
* @newin{2,10}
*/
@@ -68,7 +69,7 @@ void set_source_pixmap(const ::Cairo::RefPtr< ::Cairo::Context >& context, const
/** Adds the given rectangle to the current path of the context.
*
* @param context A cairo context.
- * @param rectangle A rectangle to add to the path of the context.
+ * @param rectangle A rectangle to add to the path of the context.
*
* @newin{2,10}
*/
@@ -77,15 +78,14 @@ void add_rectangle_to_path(const ::Cairo::RefPtr< ::Cairo::Context >& context, c
/** Adds the given region to the current path of the context.
*
* @param context A cairo context.
- * @param region A region to add to the path of the context.
+ * @param region A region to add to the path of the context.
*
* @newin{2,10}
*/
-void add_region_to_path(const ::Cairo::RefPtr< ::Cairo::Context >& context, const Gdk::Region& region);
+void add_region_to_path(const ::Cairo::RefPtr< ::Cairo::Context >& context, const ::Cairo::RefPtr< ::Cairo::Region>& region);
} //namespace Cairo
} //namespace Gdk
#endif //_GDKMM_GENERAL_H
-
diff --git a/gdk/src/drawable.hg b/gdk/src/drawable.hg
index 7248ec4..a090aac 100644
--- a/gdk/src/drawable.hg
+++ b/gdk/src/drawable.hg
@@ -25,10 +25,10 @@
#include <gdkmm/gc.h>
#include <gdkmm/image.h>
#include <gdkmm/color.h>
-#include <gdkmm/region.h>
#include <gdkmm/rgbcmap.h>
#include <gdkmm/types.h>
#include <cairomm/context.h>
+#include <cairomm/region.h>
//#include <gdkmm/pixbuf.h>
@@ -51,7 +51,7 @@ class Pixbuf;
*
* To use a drawable, create a concrete Drawable of the type you wish to use
* and a Gdk::GC (graphics context) for that Drawable. With the GC you can
- * draw lines, text, arcs and such.
+ * draw lines, text, arcs and such.
*
* An alternative is to create a Cairo::Context with get_cairo_context()
* while you handle the 'exposed' event of the drawable. For more about
@@ -108,19 +108,19 @@ public:
/** Renders a rectangular portion of a pixbuf to a drawable. The destination
* drawable must have a colormap. All windows have a colormap, however, pixmaps
- * only have colormap by default if they were created with a non-<tt>0</tt> window
- * argument. Otherwise a colormap must be set on them with
+ * only have colormap by default if they were created with a non-<tt>0</tt> window
+ * argument. Otherwise a colormap must be set on them with
* Gdk::Drawable::set_colormap().
- *
- * On older X servers, rendering pixbufs with an alpha channel involves round
+ *
+ * On older X servers, rendering pixbufs with an alpha channel involves round
* trips to the X server, and may be somewhat slow.
- *
+ *
* If GDK is built with the Sun mediaLib library, the gdk_draw_pixbuf
* function is accelerated using mediaLib, which provides hardware
* acceleration on Intel, AMD, and Sparc chipsets. If desired, mediaLib
* support can be turned off by setting the GDK_DISABLE_MEDIALIB environment
* variable.
- *
+ *
* @newin{2,16}
* @param pixbuf A Gdk::Pixbuf.
* @param src_x Source X coordinate within pixbuf.
@@ -145,9 +145,14 @@ public:
// same as gdk_drawable_get_image().
void copy_to_image(const Glib::RefPtr<Image>& image, int src_x, int src_y, int dest_x, int dest_y, int width, int height) const;
_IGNORE(gdk_drawable_copy_to_image)
-
- _WRAP_METHOD(Region get_clip_region() const, gdk_drawable_get_clip_region)
- _WRAP_METHOD(Region get_visible_region() const, gdk_drawable_get_visible_region)
+
+ #m4 _CONVERSION(`cairo_region_t*',`Cairo::RefPtr<Cairo::Region>',`Cairo::RefPtr<Cairo::Region>(new Cairo::Region($3, true /* do not take ref */))')
+
+ //This is const because it returns a copy (though that is not very clear from the C documentation)
+ _WRAP_METHOD(Cairo::RefPtr<Cairo::Region> get_clip_region() const, gdk_drawable_get_clip_region)
+
+ //This is const because it returns a copy (though that is not very clear from the C documentation)
+ _WRAP_METHOD(Cairo::RefPtr<Cairo::Region> get_visible_region() const, gdk_drawable_get_visible_region)
// **** RGB stuff ****
@@ -202,4 +207,3 @@ public:
};
} // namespace Gdk
-
diff --git a/gdk/src/filelist.am b/gdk/src/filelist.am
index b148adb..9fdb770 100644
--- a/gdk/src/filelist.am
+++ b/gdk/src/filelist.am
@@ -31,7 +31,6 @@ gdkmm_files_hg = \
pixbufloader.hg \
pixmap.hg \
rectangle.hg \
- region.hg \
rgbcmap.hg \
screen.hg \
types.hg \
diff --git a/gdk/src/gc.hg b/gdk/src/gc.hg
index 6364294..974e0cf 100644
--- a/gdk/src/gc.hg
+++ b/gdk/src/gc.hg
@@ -23,8 +23,8 @@
#include <gdkmm/drawable.h>
#include <gdkmm/types.h>
#include <gdkmm/rectangle.h>
-#include <gdkmm/region.h>
#include <gdkmm/screen.h>
+#include <cairomm/region.h>
#include <gdk/gdk.h>
_DEFS(gdkmm,gdk)
_PINCLUDE(glibmm/private/object_p.h)
@@ -79,7 +79,7 @@ public:
_WRAP_METHOD(void set_clip_rectangle(const Rectangle& rectangle), gdk_gc_set_clip_rectangle)
- _WRAP_METHOD(void set_clip_region(const Region& region), gdk_gc_set_clip_region)
+ _WRAP_METHOD(void set_clip_region(const Cairo::RefPtr<Cairo::Region>& region), gdk_gc_set_clip_region)
_WRAP_METHOD(void set_subwindow(SubwindowMode mode), gdk_gc_set_subwindow)
_WRAP_METHOD(void set_exposures(bool exposures), gdk_gc_set_exposures)
_WRAP_METHOD(void set_line_attributes(int line_width, LineStyle line_style, CapStyle cap_style, JoinStyle join_style), gdk_gc_set_line_attributes)
@@ -95,4 +95,3 @@ public:
};
} /* namespace Gdk */
-
diff --git a/gdk/src/gdk_methods.defs b/gdk/src/gdk_methods.defs
index 967f594..7a52bc9 100644
--- a/gdk/src/gdk_methods.defs
+++ b/gdk/src/gdk_methods.defs
@@ -56,12 +56,6 @@
(gtype-id "GDK_TYPE_KEYMAP")
)
-(define-object Paintable
- (in-module "Gdk")
- (c-name "GdkPaintable")
- (gtype-id "GDK_TYPE_PAINTABLE")
-)
-
(define-object PangoRenderer
(in-module "Gdk")
(parent "PangoRenderer")
@@ -83,19 +77,6 @@
(gtype-id "GDK_TYPE_SCREEN")
)
-(define-object WindowImpl
- (in-module "Gdk")
- (c-name "GdkWindowImpl")
- (gtype-id "GDK_TYPE_WINDOW_IMPL")
-)
-
-(define-object WindowObject
- (in-module "Gdk")
- (parent "GdkDrawable")
- (c-name "GdkWindowObject")
- (gtype-id "GDK_TYPE_WINDOW_OBJECT")
-)
-
;; Enumerations and flags ...
(define-enum ExtensionMode
@@ -442,7 +423,6 @@
(values
'("foreground" "GDK_GC_FOREGROUND")
'("background" "GDK_GC_BACKGROUND")
- '("font" "GDK_GC_FONT")
'("function" "GDK_GC_FUNCTION")
'("fill" "GDK_GC_FILL")
'("tile" "GDK_GC_TILE")
@@ -472,61 +452,6 @@
)
)
-(define-flags ColorInfoFlags
- (in-module "Gdk")
- (c-name "GdkColorInfoFlags")
- (gtype-id "GDK_TYPE_COLOR_INFO_FLAGS")
- (values
- '("writeable" "GDK_COLOR_WRITEABLE")
- )
-)
-
-(define-flags DebugFlag
- (in-module "Gdk")
- (c-name "GdkDebugFlag")
- (gtype-id "GDK_TYPE_DEBUG_FLAG")
- (values
- '("misc" "GDK_DEBUG_MISC")
- '("events" "GDK_DEBUG_EVENTS")
- '("dnd" "GDK_DEBUG_DND")
- '("xim" "GDK_DEBUG_XIM")
- '("nograbs" "GDK_DEBUG_NOGRABS")
- '("colormap" "GDK_DEBUG_COLORMAP")
- '("gdkrgb" "GDK_DEBUG_GDKRGB")
- '("gc" "GDK_DEBUG_GC")
- '("pixmap" "GDK_DEBUG_PIXMAP")
- '("image" "GDK_DEBUG_IMAGE")
- '("input" "GDK_DEBUG_INPUT")
- '("cursor" "GDK_DEBUG_CURSOR")
- '("multihead" "GDK_DEBUG_MULTIHEAD")
- '("xinerama" "GDK_DEBUG_XINERAMA")
- '("draw" "GDK_DEBUG_DRAW")
- '("eventloop" "GDK_DEBUG_EVENTLOOP")
- )
-)
-
-(define-enum ArgType
- (in-module "Gdk")
- (c-name "GdkArgType")
- (gtype-id "GDK_TYPE_ARG_TYPE")
- (values
- '("string" "GDK_ARG_STRING")
- '("int" "GDK_ARG_INT")
- '("bool" "GDK_ARG_BOOL")
- '("nobool" "GDK_ARG_NOBOOL")
- '("callback" "GDK_ARG_CALLBACK")
- )
-)
-
-(define-flags EventFlags
- (in-module "Gdk")
- (c-name "GdkEventFlags")
- (gtype-id "GDK_TYPE_EVENT_FLAGS")
- (values
- '("pending" "GDK_EVENT_PENDING")
- )
-)
-
(define-enum PropMode
(in-module "Gdk")
(c-name "GdkPropMode")
@@ -832,10 +757,6 @@
)
-;; From gdkalias.h
-
-
-
;; From gdkapplaunchcontext.h
(define-function gdk_app_launch_context_get_type
@@ -969,7 +890,7 @@
(return-type "none")
(parameters
'("cairo_t*" "cr")
- '("const-GdkRegion*" "region")
+ '("const-cairo_region_t*" "region")
)
)
@@ -1102,10 +1023,6 @@
-;; From gdkconfig.h
-
-
-
;; From gdkcursor.h
(define-function gdk_cursor_get_type
@@ -1423,9 +1340,11 @@
)
)
-
-
-;; From gdkdeviceprivate.h
+(define-method get_client_pointer
+ (of-object "GdkDeviceManager")
+ (c-name "gdk_device_manager_get_client_pointer")
+ (return-type "GdkDevice*")
+)
@@ -2335,13 +2254,13 @@
(define-method get_clip_region
(of-object "GdkDrawable")
(c-name "gdk_drawable_get_clip_region")
- (return-type "GdkRegion*")
+ (return-type "cairo_region_t*")
)
(define-method get_visible_region
(of-object "GdkDrawable")
(c-name "gdk_drawable_get_visible_region")
- (return-type "GdkRegion*")
+ (return-type "cairo_region_t*")
)
@@ -2438,11 +2357,6 @@
(return-type "GType")
)
-(define-function gdk_font_type_get_type
- (c-name "gdk_font_type_get_type")
- (return-type "GType")
-)
-
(define-function gdk_cap_style_get_type
(c-name "gdk_cap_style_get_type")
(return-type "GType")
@@ -2488,16 +2402,6 @@
(return-type "GType")
)
-(define-function gdk_fill_rule_get_type
- (c-name "gdk_fill_rule_get_type")
- (return-type "GType")
-)
-
-(define-function gdk_overlap_type_get_type
- (c-name "gdk_overlap_type_get_type")
- (return-type "GType")
-)
-
(define-function gdk_rgb_dither_get_type
(c-name "gdk_rgb_dither_get_type")
(return-type "GType")
@@ -3027,7 +2931,7 @@
(c-name "gdk_gc_set_clip_region")
(return-type "none")
(parameters
- '("const-GdkRegion*" "region")
+ '("const-cairo_region_t*" "region")
)
)
@@ -3561,6 +3465,12 @@
(return-type "guint16")
)
+(define-method get_pixels
+ (of-object "GdkImage")
+ (c-name "gdk_image_get_pixels")
+ (return-type "gpointer")
+)
+
;; From gdkinput.h
@@ -3587,29 +3497,6 @@
-;; From gdkinternals.h
-
-(define-function gdk_synthesize_window_state
- (c-name "gdk_synthesize_window_state")
- (return-type "none")
- (parameters
- '("GdkWindow*" "window")
- '("GdkWindowState" "unset_flags")
- '("GdkWindowState" "set_flags")
- )
-)
-
-(define-function gdk_offscreen_window_get_type
- (c-name "gdk_offscreen_window_get_type")
- (return-type "GType")
-)
-
-
-
-;; From gdkintl.h
-
-
-
;; From gdkkeys.h
(define-function gdk_keymap_get_type
@@ -3695,6 +3582,12 @@
(return-type "gboolean")
)
+(define-method get_num_lock_state
+ (of-object "GdkKeymap")
+ (c-name "gdk_keymap_get_num_lock_state")
+ (return-type "gboolean")
+)
+
(define-method add_virtual_modifiers
(of-object "GdkKeymap")
(c-name "gdk_keymap_add_virtual_modifiers")
@@ -3793,14 +3686,6 @@
-;; From gdkmarshalers.h
-
-
-
-;; From gdkmedialib.h
-
-
-
;; From gdkpango.h
(define-function gdk_pango_renderer_get_type
@@ -3878,7 +3763,7 @@
(define-function gdk_pango_layout_line_get_clip_region
(c-name "gdk_pango_layout_line_get_clip_region")
- (return-type "GdkRegion*")
+ (return-type "cairo_region_t*")
(parameters
'("PangoLayoutLine*" "line")
'("gint" "x_origin")
@@ -3890,7 +3775,7 @@
(define-function gdk_pango_layout_get_clip_region
(c-name "gdk_pango_layout_get_clip_region")
- (return-type "GdkRegion*")
+ (return-type "cairo_region_t*")
(parameters
'("PangoLayout*" "layout")
'("gint" "x_origin")
@@ -4143,10 +4028,6 @@
-;; From gdkpoly-generic.h
-
-
-
;; From gdkprivate.h
(define-method destroy_notify
@@ -4358,10 +4239,6 @@
-;; From gdkregion-generic.h
-
-
-
;; From gdkregion.h
(define-function gdk_region_new
@@ -5562,7 +5439,7 @@
(c-name "gdk_window_move_region")
(return-type "none")
(parameters
- '("const-GdkRegion*" "region")
+ '("const-cairo_region_t*" "region")
'("gint" "dx")
'("gint" "dy")
)
@@ -5590,7 +5467,7 @@
(c-name "gdk_window_shape_combine_region")
(return-type "none")
(parameters
- '("const-GdkRegion*" "shape_region")
+ '("const-cairo_region_t*" "shape_region")
'("gint" "offset_x")
'("gint" "offset_y")
)
@@ -5639,7 +5516,7 @@
(c-name "gdk_window_input_shape_combine_region")
(return-type "none")
(parameters
- '("const-GdkRegion*" "shape_region")
+ '("const-cairo_region_t*" "shape_region")
'("gint" "offset_x")
'("gint" "offset_y")
)
@@ -5731,6 +5608,12 @@
)
)
+(define-method has_native
+ (of-object "GdkWindow")
+ (c-name "gdk_window_has_native")
+ (return-type "gboolean")
+)
+
(define-method set_type_hint
(of-object "GdkWindow")
(c-name "gdk_window_set_type_hint")
@@ -5820,7 +5703,7 @@
(c-name "gdk_window_begin_paint_region")
(return-type "none")
(parameters
- '("const-GdkRegion*" "region")
+ '("const-cairo_region_t*" "region")
)
)
@@ -6342,25 +6225,15 @@
(c-name "gdk_window_invalidate_region")
(return-type "none")
(parameters
- '("const-GdkRegion*" "region")
+ '("const-cairo_region_t*" "region")
'("gboolean" "invalidate_children")
)
)
-(define-method invalidate_maybe_recurse
- (of-object "GdkWindow")
- (c-name "gdk_window_invalidate_maybe_recurse")
- (return-type "none")
- (parameters
- '("const-GdkRegion*" "region")
- '("somefunc" "child_func")
- )
-)
-
(define-method get_update_area
(of-object "GdkWindow")
(c-name "gdk_window_get_update_area")
- (return-type "GdkRegion*")
+ (return-type "cairo_region_t*")
)
(define-method freeze_updates
@@ -6527,17 +6400,398 @@
-;; From gdkwindowimpl.h
+;; From gdkx.h
-(define-function gdk_window_impl_get_type
- (c-name "gdk_window_impl_get_type")
- (return-type "GType")
+(define-function gdk_x11_drawable_get_xdisplay
+ (c-name "gdk_x11_drawable_get_xdisplay")
+ (return-type "Display*")
+ (parameters
+ '("GdkDrawable*" "drawable")
+ )
+)
+
+(define-function gdk_x11_drawable_get_xid
+ (c-name "gdk_x11_drawable_get_xid")
+ (return-type "XID")
+ (parameters
+ '("GdkDrawable*" "drawable")
+ )
+)
+
+(define-function gdk_x11_window_get_drawable_impl
+ (c-name "gdk_x11_window_get_drawable_impl")
+ (return-type "GdkDrawable*")
+ (parameters
+ '("GdkWindow*" "window")
+ )
+)
+
+(define-function gdk_x11_pixmap_get_drawable_impl
+ (c-name "gdk_x11_pixmap_get_drawable_impl")
+ (return-type "GdkDrawable*")
+ (parameters
+ '("GdkPixmap*" "pixmap")
+ )
+)
+
+(define-function gdk_x11_image_get_xdisplay
+ (c-name "gdk_x11_image_get_xdisplay")
+ (return-type "Display*")
+ (parameters
+ '("GdkImage*" "image")
+ )
+)
+
+(define-function gdk_x11_image_get_ximage
+ (c-name "gdk_x11_image_get_ximage")
+ (return-type "XImage*")
+ (parameters
+ '("GdkImage*" "image")
+ )
+)
+
+(define-function gdk_x11_colormap_get_xdisplay
+ (c-name "gdk_x11_colormap_get_xdisplay")
+ (return-type "Display*")
+ (parameters
+ '("GdkColormap*" "colormap")
+ )
+)
+
+(define-function gdk_x11_colormap_get_xcolormap
+ (c-name "gdk_x11_colormap_get_xcolormap")
+ (return-type "Colormap")
+ (parameters
+ '("GdkColormap*" "colormap")
+ )
+)
+
+(define-function gdk_x11_cursor_get_xdisplay
+ (c-name "gdk_x11_cursor_get_xdisplay")
+ (return-type "Display*")
+ (parameters
+ '("GdkCursor*" "cursor")
+ )
+)
+
+(define-function gdk_x11_cursor_get_xcursor
+ (c-name "gdk_x11_cursor_get_xcursor")
+ (return-type "Cursor")
+ (parameters
+ '("GdkCursor*" "cursor")
+ )
+)
+
+(define-function gdk_x11_display_get_xdisplay
+ (c-name "gdk_x11_display_get_xdisplay")
+ (return-type "Display*")
+ (parameters
+ '("GdkDisplay*" "display")
+ )
+)
+
+(define-function gdk_x11_visual_get_xvisual
+ (c-name "gdk_x11_visual_get_xvisual")
+ (return-type "Visual*")
+ (parameters
+ '("GdkVisual*" "visual")
+ )
+)
+
+(define-function gdk_x11_gc_get_xdisplay
+ (c-name "gdk_x11_gc_get_xdisplay")
+ (return-type "Display*")
+ (parameters
+ '("GdkGC*" "gc")
+ )
+)
+
+(define-function gdk_x11_gc_get_xgc
+ (c-name "gdk_x11_gc_get_xgc")
+ (return-type "GC")
+ (parameters
+ '("GdkGC*" "gc")
+ )
+)
+
+(define-function gdk_x11_screen_get_xscreen
+ (c-name "gdk_x11_screen_get_xscreen")
+ (return-type "Screen*")
+ (parameters
+ '("GdkScreen*" "screen")
+ )
+)
+
+(define-function gdk_x11_screen_get_screen_number
+ (c-name "gdk_x11_screen_get_screen_number")
+ (return-type "int")
+ (parameters
+ '("GdkScreen*" "screen")
+ )
+)
+
+(define-function gdk_x11_window_set_user_time
+ (c-name "gdk_x11_window_set_user_time")
+ (return-type "none")
+ (parameters
+ '("GdkWindow*" "window")
+ '("guint32" "timestamp")
+ )
+)
+
+(define-function gdk_x11_window_move_to_current_desktop
+ (c-name "gdk_x11_window_move_to_current_desktop")
+ (return-type "none")
+ (parameters
+ '("GdkWindow*" "window")
+ )
+)
+
+(define-function gdk_x11_screen_get_window_manager_name
+ (c-name "gdk_x11_screen_get_window_manager_name")
+ (return-type "const-char*")
+ (parameters
+ '("GdkScreen*" "screen")
+ )
)
+(define-function gdk_x11_get_default_root_xwindow
+ (c-name "gdk_x11_get_default_root_xwindow")
+ (return-type "Window")
+)
+(define-function gdk_x11_get_default_xdisplay
+ (c-name "gdk_x11_get_default_xdisplay")
+ (return-type "Display*")
+)
-;; From keyname-table.h
+(define-function gdk_x11_get_default_screen
+ (c-name "gdk_x11_get_default_screen")
+ (return-type "gint")
+)
+
+(define-function gdk_x11_screen_lookup_visual
+ (c-name "gdk_x11_screen_lookup_visual")
+ (return-type "GdkVisual*")
+ (parameters
+ '("GdkScreen*" "screen")
+ '("VisualID" "xvisualid")
+ )
+)
+(define-function gdkx_visual_get
+ (c-name "gdkx_visual_get")
+ (return-type "GdkVisual*")
+ (parameters
+ '("VisualID" "xvisualid")
+ )
+)
+(define-function gdk_x11_colormap_foreign_new
+ (c-name "gdk_x11_colormap_foreign_new")
+ (is-constructor-of "GdkX11ColormapForeign")
+ (return-type "GdkColormap*")
+ (parameters
+ '("GdkVisual*" "visual")
+ '("Colormap" "xcolormap")
+ )
+)
-;; From stamp-gdkenumtypes.h
+(define-function gdk_xid_table_lookup_for_display
+ (c-name "gdk_xid_table_lookup_for_display")
+ (return-type "gpointer")
+ (parameters
+ '("GdkDisplay*" "display")
+ '("XID" "xid")
+ )
+)
+
+(define-function gdk_x11_get_server_time
+ (c-name "gdk_x11_get_server_time")
+ (return-type "guint32")
+ (parameters
+ '("GdkWindow*" "window")
+ )
+)
+
+(define-function gdk_x11_display_get_user_time
+ (c-name "gdk_x11_display_get_user_time")
+ (return-type "guint32")
+ (parameters
+ '("GdkDisplay*" "display")
+ )
+)
+
+(define-function gdk_x11_display_get_startup_notification_id
+ (c-name "gdk_x11_display_get_startup_notification_id")
+ (return-type "const-gchar*")
+ (parameters
+ '("GdkDisplay*" "display")
+ )
+)
+
+(define-function gdk_x11_display_set_cursor_theme
+ (c-name "gdk_x11_display_set_cursor_theme")
+ (return-type "none")
+ (parameters
+ '("GdkDisplay*" "display")
+ '("const-gchar*" "theme")
+ '("const-gint" "size")
+ )
+)
+
+(define-function gdk_x11_display_broadcast_startup_message
+ (c-name "gdk_x11_display_broadcast_startup_message")
+ (return-type "none")
+ (parameters
+ '("GdkDisplay*" "display")
+ '("const-char*" "message_type")
+ )
+ (varargs #t)
+)
+
+(define-function gdk_x11_screen_supports_net_wm_hint
+ (c-name "gdk_x11_screen_supports_net_wm_hint")
+ (return-type "gboolean")
+ (parameters
+ '("GdkScreen*" "screen")
+ '("GdkAtom" "property")
+ )
+)
+
+(define-function gdk_x11_screen_get_monitor_output
+ (c-name "gdk_x11_screen_get_monitor_output")
+ (return-type "XID")
+ (parameters
+ '("GdkScreen*" "screen")
+ '("gint" "monitor_num")
+ )
+)
+
+(define-function gdk_xid_table_lookup
+ (c-name "gdk_xid_table_lookup")
+ (return-type "gpointer")
+ (parameters
+ '("XID" "xid")
+ )
+)
+
+(define-function gdk_net_wm_supports
+ (c-name "gdk_net_wm_supports")
+ (return-type "gboolean")
+ (parameters
+ '("GdkAtom" "property")
+ )
+)
+
+(define-function gdk_x11_grab_server
+ (c-name "gdk_x11_grab_server")
+ (return-type "none")
+)
+
+(define-function gdk_x11_ungrab_server
+ (c-name "gdk_x11_ungrab_server")
+ (return-type "none")
+)
+
+(define-function gdk_x11_lookup_xdisplay
+ (c-name "gdk_x11_lookup_xdisplay")
+ (return-type "GdkDisplay*")
+ (parameters
+ '("Display*" "xdisplay")
+ )
+)
+
+(define-function gdk_x11_atom_to_xatom_for_display
+ (c-name "gdk_x11_atom_to_xatom_for_display")
+ (return-type "Atom")
+ (parameters
+ '("GdkDisplay*" "display")
+ '("GdkAtom" "atom")
+ )
+)
+
+(define-function gdk_x11_xatom_to_atom_for_display
+ (c-name "gdk_x11_xatom_to_atom_for_display")
+ (return-type "GdkAtom")
+ (parameters
+ '("GdkDisplay*" "display")
+ '("Atom" "xatom")
+ )
+)
+
+(define-function gdk_x11_get_xatom_by_name_for_display
+ (c-name "gdk_x11_get_xatom_by_name_for_display")
+ (return-type "Atom")
+ (parameters
+ '("GdkDisplay*" "display")
+ '("const-gchar*" "atom_name")
+ )
+)
+
+(define-function gdk_x11_get_xatom_name_for_display
+ (c-name "gdk_x11_get_xatom_name_for_display")
+ (return-type "const-gchar*")
+ (parameters
+ '("GdkDisplay*" "display")
+ '("Atom" "xatom")
+ )
+)
+
+(define-function gdk_x11_atom_to_xatom
+ (c-name "gdk_x11_atom_to_xatom")
+ (return-type "Atom")
+ (parameters
+ '("GdkAtom" "atom")
+ )
+)
+
+(define-function gdk_x11_xatom_to_atom
+ (c-name "gdk_x11_xatom_to_atom")
+ (return-type "GdkAtom")
+ (parameters
+ '("Atom" "xatom")
+ )
+)
+
+(define-function gdk_x11_get_xatom_by_name
+ (c-name "gdk_x11_get_xatom_by_name")
+ (return-type "Atom")
+ (parameters
+ '("const-gchar*" "atom_name")
+ )
+)
+
+(define-function gdk_x11_get_xatom_name
+ (c-name "gdk_x11_get_xatom_name")
+ (return-type "const-gchar*")
+ (parameters
+ '("Atom" "xatom")
+ )
+)
+
+(define-function gdk_x11_display_grab
+ (c-name "gdk_x11_display_grab")
+ (return-type "none")
+ (parameters
+ '("GdkDisplay*" "display")
+ )
+)
+
+(define-function gdk_x11_display_ungrab
+ (c-name "gdk_x11_display_ungrab")
+ (return-type "none")
+ (parameters
+ '("GdkDisplay*" "display")
+ )
+)
+
+(define-function gdk_x11_register_standard_event_type
+ (c-name "gdk_x11_register_standard_event_type")
+ (return-type "none")
+ (parameters
+ '("GdkDisplay*" "display")
+ '("gint" "event_base")
+ '("gint" "n_events")
+ )
+)
diff --git a/gdk/src/gdk_pixbuf_methods.defs b/gdk/src/gdk_pixbuf_methods.defs
index 51d82af..d90e252 100644
--- a/gdk/src/gdk_pixbuf_methods.defs
+++ b/gdk/src/gdk_pixbuf_methods.defs
@@ -1,12 +1,5 @@
;; -*- scheme -*-
; object definitions ...
-(define-object Pixbuf
- (in-module "Gdk")
- (parent "GObject")
- (c-name "GdkPixbuf")
- (gtype-id "GDK_TYPE_PIXBUF")
-)
-
(define-object PixbufAnimation
(in-module "Gdk")
(parent "GObject")
@@ -98,9 +91,37 @@
)
)
+(define-flags PixdataType
+ (in-module "Gdk")
+ (c-name "GdkPixdataType")
+ (gtype-id "GDK_TYPE_PIXDATA_TYPE")
+ (values
+ '("color-type-rgb" "GDK_PIXDATA_COLOR_TYPE_RGB")
+ '("color-type-rgba" "GDK_PIXDATA_COLOR_TYPE_RGBA")
+ '("color-type-mask" "GDK_PIXDATA_COLOR_TYPE_MASK")
+ '("sample-width-8" "GDK_PIXDATA_SAMPLE_WIDTH_8")
+ '("sample-width-mask" "GDK_PIXDATA_SAMPLE_WIDTH_MASK")
+ '("encoding-raw" "GDK_PIXDATA_ENCODING_RAW")
+ '("encoding-rle" "GDK_PIXDATA_ENCODING_RLE")
+ '("encoding-mask" "GDK_PIXDATA_ENCODING_MASK")
+ )
+)
-;; From gdk-pixbuf-alias.h
-
+(define-flags PixdataDumpType
+ (in-module "Gdk")
+ (c-name "GdkPixdataDumpType")
+ (gtype-id "GDK_TYPE_PIXDATA_DUMP_TYPE")
+ (values
+ '("pixdata-stream" "GDK_PIXDATA_DUMP_PIXDATA_STREAM")
+ '("pixdata-struct" "GDK_PIXDATA_DUMP_PIXDATA_STRUCT")
+ '("macros" "GDK_PIXDATA_DUMP_MACROS")
+ '("gtypes" "GDK_PIXDATA_DUMP_GTYPES")
+ '("ctypes" "GDK_PIXDATA_DUMP_CTYPES")
+ '("static" "GDK_PIXDATA_DUMP_STATIC")
+ '("const" "GDK_PIXDATA_DUMP_CONST")
+ '("rle-decoder" "GDK_PIXDATA_DUMP_RLE_DECODER")
+ )
+)
;; From gdk-pixbuf-animation.h
@@ -595,12 +616,13 @@
-;; From gdk-pixbuf-i18n.h
-
-
-
;; From gdk-pixbuf-io.h
+(define-function gdk_pixbuf_format_get_type
+ (c-name "gdk_pixbuf_format_get_type")
+ (return-type "GType")
+)
+
(define-function gdk_pixbuf_get_formats
(c-name "gdk_pixbuf_get_formats")
(return-type "GSList*")
@@ -673,6 +695,18 @@
)
)
+(define-method copy
+ (of-object "GdkPixbufFormat")
+ (c-name "gdk_pixbuf_format_copy")
+ (return-type "GdkPixbufFormat*")
+)
+
+(define-method free
+ (of-object "GdkPixbufFormat")
+ (c-name "gdk_pixbuf_format_free")
+ (return-type "none")
+)
+
(define-method set_option
(of-object "GdkPixbuf")
(c-name "gdk_pixbuf_set_option")
@@ -770,24 +804,6 @@
-;; From gdk-pixbuf-private.h
-
-
-
-;; From gdk-pixbuf-scaled-anim.h
-
-(define-function gdk_pixbuf_scaled_anim_get_type
- (c-name "gdk_pixbuf_scaled_anim_get_type")
- (return-type "GType")
-)
-
-(define-function gdk_pixbuf_scaled_anim_iter_get_type
- (c-name "gdk_pixbuf_scaled_anim_iter_get_type")
- (return-type "GType")
-)
-
-
-
;; From gdk-pixbuf-simple-anim.h
(define-function gdk_pixbuf_simple_anim_get_type
@@ -945,3 +961,57 @@
)
+
+;; From gdk-pixdata.h
+
+(define-method serialize
+ (of-object "GdkPixdata")
+ (c-name "gdk_pixdata_serialize")
+ (return-type "guint8*")
+ (parameters
+ '("guint*" "stream_length_p")
+ )
+)
+
+(define-method deserialize
+ (of-object "GdkPixdata")
+ (c-name "gdk_pixdata_deserialize")
+ (return-type "gboolean")
+ (parameters
+ '("guint" "stream_length")
+ '("const-guint8*" "stream")
+ '("GError**" "error")
+ )
+)
+
+(define-method from_pixbuf
+ (of-object "GdkPixdata")
+ (c-name "gdk_pixdata_from_pixbuf")
+ (return-type "gpointer")
+ (parameters
+ '("const-GdkPixbuf*" "pixbuf")
+ '("gboolean" "use_rle")
+ )
+)
+
+(define-function gdk_pixbuf_from_pixdata
+ (c-name "gdk_pixbuf_from_pixdata")
+ (return-type "GdkPixbuf*")
+ (parameters
+ '("const-GdkPixdata*" "pixdata")
+ '("gboolean" "copy_pixels")
+ '("GError**" "error")
+ )
+)
+
+(define-method to_csource
+ (of-object "GdkPixdata")
+ (c-name "gdk_pixdata_to_csource")
+ (return-type "GString*")
+ (parameters
+ '("const-gchar*" "name")
+ '("GdkPixdataDumpType" "dump_type")
+ )
+)
+
+
diff --git a/gdk/src/window.hg b/gdk/src/window.hg
index 2c13f6d..ebff040 100644
--- a/gdk/src/window.hg
+++ b/gdk/src/window.hg
@@ -21,7 +21,7 @@ _CONFIGINCLUDE(gdkmmconfig.h)
#include <gdkmm/bitmap.h>
//#include <gdkmm/cursor.h>
#include <gdkmm/types.h>
-#include <gdkmm/region.h>
+#include <cairomm/region.h>
#include <gdk/gdk.h>
_DEFS(gdkmm,gdk)
@@ -109,19 +109,19 @@ public:
_WRAP_METHOD(void remove_filter(GdkFilterFunc function, gpointer data), gdk_window_remove_filter)
_WRAP_METHOD(void scroll(int dx, int dy), gdk_window_scroll)
- _WRAP_METHOD(void move_region(const Region& region, int dx, int dy), gdk_window_move_region)
+ _WRAP_METHOD(void move_region(const Cairo::RefPtr<Cairo::Region>& region, int dx, int dy), gdk_window_move_region)
_WRAP_METHOD(bool ensure_native(), gdk_window_ensure_native)
_WRAP_METHOD(void shape_combine_mask(const Glib::RefPtr<Bitmap>& mask, int x, int y), gdk_window_shape_combine_mask)
void unset_shape_combine_mask();
- _WRAP_METHOD(void shape_combine_region(const Region& shape_region, int offset_x, int offset_y), gdk_window_shape_combine_region)
+ _WRAP_METHOD(void shape_combine_region(const Cairo::RefPtr<Cairo::Region>& shape_region, int offset_x, int offset_y), gdk_window_shape_combine_region)
_WRAP_METHOD(void set_child_shapes(), gdk_window_set_child_shapes)
_WRAP_METHOD(void set_composited(bool composited = TRUE), gdk_window_set_composited)
_WRAP_METHOD(void merge_child_shapes(), gdk_window_merge_child_shapes)
_WRAP_METHOD(void input_shape_combine_mask(const Glib::RefPtr<Bitmap>& mask, int x, int y), gdk_window_input_shape_combine_mask)
- _WRAP_METHOD(void input_shape_combine_region (const Region& shape_region, int offset_x, int offset_y), gdk_window_input_shape_combine_region)
+ _WRAP_METHOD(void input_shape_combine_region (const Cairo::RefPtr<Cairo::Region>& shape_region, int offset_x, int offset_y), gdk_window_input_shape_combine_region)
_WRAP_METHOD(void set_child_input_shapes(), gdk_window_set_child_input_shapes)
_WRAP_METHOD(void merge_child_input_shapes(), gdk_window_merge_child_input_shapes)
@@ -136,7 +136,7 @@ public:
_WRAP_METHOD(static void set_sm_client_id(const Glib::ustring& sm_client_id), gdk_set_sm_client_id)
static void unset_sm_client_id();
_WRAP_METHOD(void begin_paint_rect(const Rectangle& rectangle), gdk_window_begin_paint_rect)
- _WRAP_METHOD(void begin_paint_region(const Region& region), gdk_window_begin_paint_region)
+ _WRAP_METHOD(void begin_paint_region(const Cairo::RefPtr<Cairo::Region>& region), gdk_window_begin_paint_region)
_WRAP_METHOD(void end_paint(), gdk_window_end_paint)
_WRAP_METHOD(void flush(), gdk_window_flush)
_WRAP_METHOD(void set_title(const Glib::ustring& title), gdk_window_set_title)
@@ -227,10 +227,12 @@ public:
*/
void invalidate(bool invalidate_children);
- _WRAP_METHOD(void invalidate_region(const Region& region, bool invalidate_children = true), gdk_window_invalidate_region)
+ _WRAP_METHOD(void invalidate_region(const Cairo::RefPtr<Cairo::Region>& region, bool invalidate_children = true), gdk_window_invalidate_region)
- _WRAP_METHOD(Region get_update_area(), gdk_window_get_update_area)
- //This method should not have a const version - see the docs.
+#m4 _CONVERSION(`cairo_region_t*',`Cairo::RefPtr<Cairo::Region>',`Cairo::RefPtr<Cairo::Region>(new Cairo::Region(($3), true /* do not take ref */))')
+
+ //This method should not have a const version - see the docs
+ _WRAP_METHOD(Cairo::RefPtr<Cairo::Region> get_update_area(), gdk_window_get_update_area)
_WRAP_METHOD(void freeze_updates(), gdk_window_freeze_updates)
_WRAP_METHOD(void thaw_updates(), gdk_window_thaw_updates)
@@ -294,7 +296,7 @@ public:
_WRAP_METHOD(Glib::RefPtr<Window> get_offscreen_embedder(), gdk_offscreen_window_get_embedder, refreturn)
_WRAP_METHOD(Glib::RefPtr<const Window> get_offscreen_embedder() const, gdk_offscreen_window_get_embedder, constversion, refreturn)
-
+
_WRAP_METHOD(void set_offscreen_embedder(const Glib::RefPtr<Window>& embedder), gdk_offscreen_window_set_embedder)
_WRAP_METHOD(void redirect_to_drawable(const Glib::RefPtr<Drawable>& drawable, int src_x, int src_y, int dest_x, int dest_y, int width, int height), gdk_window_redirect_to_drawable)
diff --git a/gtk/src/gtk_methods.defs b/gtk/src/gtk_methods.defs
index f2460e4..1e7bbf1 100644
--- a/gtk/src/gtk_methods.defs
+++ b/gtk/src/gtk_methods.defs
@@ -27550,9 +27550,9 @@
(define-method region_intersect
(of-object "GtkWidget")
(c-name "gtk_widget_region_intersect")
- (return-type "GdkRegion*")
+ (return-type "cairo_region_t*")
(parameters
- '("const-GdkRegion*" "region")
+ '("const-cairo_region_t*" "region")
)
)
diff --git a/gtk/src/widget.hg b/gtk/src/widget.hg
index 83e65bc..7e3ee90 100644
--- a/gtk/src/widget.hg
+++ b/gtk/src/widget.hg
@@ -182,7 +182,9 @@ public:
bool intersect(const Gdk::Rectangle& area) const;
_WRAP_METHOD(bool intersect(const Gdk::Rectangle& area, Gdk::Rectangle& intersection) const, gtk_widget_intersect)
- _WRAP_METHOD(Gdk::Region region_intersect(const Gdk::Region& region) const, gtk_widget_region_intersect)
+#m4 _CONVERSION(`cairo_region_t*',`Cairo::RefPtr<Cairo::Region>',`Cairo::RefPtr<Cairo::Region>(new Cairo::Region($3, true /* do not take ref */))')
+
+ _WRAP_METHOD(Cairo::RefPtr<Cairo::Region> region_intersect(const Cairo::RefPtr<Cairo::Region>& region) const, gtk_widget_region_intersect)
_WRAP_METHOD(void freeze_child_notify(), gtk_widget_freeze_child_notify)
_WRAP_METHOD(void child_notify(const Glib::ustring& child_property), gtk_widget_child_notify)
diff --git a/tools/m4/convert_gdk.m4 b/tools/m4/convert_gdk.m4
index 0ab9132..b0700bf 100644
--- a/tools/m4/convert_gdk.m4
+++ b/tools/m4/convert_gdk.m4
@@ -76,11 +76,8 @@ _CONVERSION(`Gdk::Rectangle&',`GdkRectangle*',($3).gobj())
_CONVERSION(`const Rectangle&',`const GdkRectangle*',($3).gobj())
_CONVERSION(`const Gdk::Rectangle&',`const GdkRectangle*',($3).gobj())
_CONVERSION(`Font&',`GdkFont*',($3).gobj())
-#_CONVERSION(`Region&',`GdkRegion*',($3).gobj())
-_CONVERSION(`const Region&',`const GdkRegion*',($3).gobj())
-_CONVERSION(`const Gdk::Region&',`const GdkRegion*',($3).gobj())
-_CONVERSION(`const Region&',`GdkRegion*',const_cast<$2>(($3).gobj()))
-_CONVERSION(`const Gdk::Region&',`GdkRegion*',const_cast<$2>(($3).gobj()))
+_CONVERSION(`const Cairo::RefPtr<Cairo::Region>&',`const cairo_region_t*',`(($3) ? ($3)->cobj() : 0)')
+_CONVERSION(`const Cairo::RefPtr<const Cairo::Region>&',`cairo_region_t*',`(($3) ? ($3)->cobj() : 0)')
_CONVERSION(`const Glib::RefPtr<Gdk::Colormap>&',`GdkColormap*',__CONVERT_REFPTR_TO_P)
_CONVERSION(`const Glib::RefPtr<Gdk::Pixmap>&',`GdkPixmap*',__CONVERT_REFPTR_TO_P)
@@ -229,8 +226,6 @@ _CONVERSION(`const char*const*',`const char**',`const_cast<const char**>($3)',`$
_CONVERSION(GdkFont*, Gdk::Font, `Gdk::Font($3)')
_CONVERSION(GdkEvent*, Event, `Event($3)')
-_CONVERSION(GdkRegion*, Region, `Region($3)')
-_CONVERSION(GdkRegion*, Gdk::Region, `Gdk::Region($3)')
_CONVERSION(`GdkTimeCoord**&',`GdkTimeCoord***',`&($3)')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]