Commit 50a72eda authored by Matthias Clasen's avatar Matthias Clasen

Seal gdk

Add G_SEAL annotation for struct members, and add accessors for
the (useful) fields. Patch based on work by Garrett Regier,
see bug #592580.
parent 57754ede
...@@ -55,6 +55,8 @@ gdk_error_trap_pop ...@@ -55,6 +55,8 @@ gdk_error_trap_pop
<SUBSECTION> <SUBSECTION>
GDK_WINDOWING_X11 GDK_WINDOWING_X11
GDK_WINDOWING_WIN32 GDK_WINDOWING_WIN32
GDK_WINDOWING_QUARTZ
GDK_WINDOWING_DIRECTFB
<SUBSECTION Standard> <SUBSECTION Standard>
GDK_TYPE_GRAB_STATUS GDK_TYPE_GRAB_STATUS
...@@ -282,6 +284,15 @@ gdk_image_new ...@@ -282,6 +284,15 @@ gdk_image_new
GdkImageType GdkImageType
gdk_image_get_colormap gdk_image_get_colormap
gdk_image_set_colormap gdk_image_set_colormap
gdk_image_get_bits_per_pixel
gdk_image_get_bytes_per_pixel
gdk_image_get_bytes_per_line
gdk_image_get_byte_order
gdk_image_get_depth
gdk_image_get_height
gdk_image_get_image_type
gdk_image_get_visual
gdk_image_get_width
<SUBSECTION> <SUBSECTION>
gdk_image_put_pixel gdk_image_put_pixel
...@@ -571,7 +582,14 @@ GdkByteOrder ...@@ -571,7 +582,14 @@ GdkByteOrder
gdk_query_depths gdk_query_depths
gdk_query_visual_types gdk_query_visual_types
gdk_list_visuals gdk_list_visuals
gdk_visual_get_bits_per_rgb
gdk_visual_get_blue_pixel_details
gdk_visual_get_byte_order
gdk_visual_get_colormap_size
gdk_visual_get_depth
gdk_visual_get_green_pixel_details
gdk_visual_get_red_pixel_details
gdk_visual_get_visual_type
gdk_visual_get_best_depth gdk_visual_get_best_depth
gdk_visual_get_best_type gdk_visual_get_best_type
gdk_visual_get_system gdk_visual_get_system
...@@ -619,6 +637,8 @@ gdk_window_hide ...@@ -619,6 +637,8 @@ gdk_window_hide
gdk_window_is_destroyed gdk_window_is_destroyed
gdk_window_is_visible gdk_window_is_visible
gdk_window_is_viewable gdk_window_is_viewable
gdk_window_is_input_only
gdk_window_is_shaped
gdk_window_get_state gdk_window_get_state
gdk_window_withdraw gdk_window_withdraw
gdk_window_iconify gdk_window_iconify
...@@ -633,6 +653,7 @@ gdk_window_set_keep_above ...@@ -633,6 +653,7 @@ gdk_window_set_keep_above
gdk_window_set_keep_below gdk_window_set_keep_below
gdk_window_set_opacity gdk_window_set_opacity
gdk_window_set_composited gdk_window_set_composited
gdk_window_get_composited
gdk_window_move gdk_window_move
gdk_window_resize gdk_window_resize
gdk_window_move_resize gdk_window_move_resize
...@@ -677,7 +698,9 @@ gdk_window_configure_finished ...@@ -677,7 +698,9 @@ gdk_window_configure_finished
gdk_window_set_user_data gdk_window_set_user_data
gdk_window_set_override_redirect gdk_window_set_override_redirect
gdk_window_set_accept_focus gdk_window_set_accept_focus
gdk_window_get_accept_focus
gdk_window_set_focus_on_map gdk_window_set_focus_on_map
gdk_window_get_focus_on_map
gdk_window_add_filter gdk_window_add_filter
gdk_window_remove_filter gdk_window_remove_filter
GdkFilterFunc GdkFilterFunc
...@@ -694,7 +717,9 @@ gdk_window_merge_child_input_shapes ...@@ -694,7 +717,9 @@ gdk_window_merge_child_input_shapes
gdk_window_set_static_gravities gdk_window_set_static_gravities
gdk_window_set_title gdk_window_set_title
gdk_window_set_background gdk_window_set_background
gdk_window_get_background
gdk_window_set_back_pixmap gdk_window_set_back_pixmap
gdk_window_get_back_pixmap
GDK_PARENT_RELATIVE GDK_PARENT_RELATIVE
gdk_window_set_cursor gdk_window_set_cursor
gdk_window_get_cursor gdk_window_get_cursor
...@@ -703,6 +728,7 @@ gdk_window_get_geometry ...@@ -703,6 +728,7 @@ gdk_window_get_geometry
gdk_window_set_geometry_hints gdk_window_set_geometry_hints
gdk_window_set_icon_list gdk_window_set_icon_list
gdk_window_set_modal_hint gdk_window_set_modal_hint
gdk_window_get_modal_hint
gdk_window_set_type_hint gdk_window_set_type_hint
gdk_window_get_type_hint gdk_window_get_type_hint
gdk_window_set_skip_taskbar_hint gdk_window_set_skip_taskbar_hint
...@@ -1010,11 +1036,17 @@ GdkDeviceKey ...@@ -1010,11 +1036,17 @@ GdkDeviceKey
GdkDeviceAxis GdkDeviceAxis
GdkAxisUse GdkAxisUse
gdk_devices_list gdk_devices_list
gdk_device_get_name
gdk_device_set_source gdk_device_set_source
gdk_device_get_source
gdk_device_set_mode gdk_device_set_mode
gdk_device_get_mode
gdk_device_set_key gdk_device_set_key
gdk_device_get_key
gdk_device_set_axis_use gdk_device_set_axis_use
gdk_device_get_axis_use
gdk_device_get_core_pointer gdk_device_get_core_pointer
gdk_device_get_has_cursor
<SUBSECTION> <SUBSECTION>
gdk_device_get_state gdk_device_get_state
...@@ -1204,6 +1236,10 @@ GdkDragContext ...@@ -1204,6 +1236,10 @@ GdkDragContext
GdkDragAction GdkDragAction
gdk_drag_status gdk_drag_status
gdk_drag_drop_succeeded gdk_drag_drop_succeeded
gdk_drag_context_get_action
gdk_drag_context_get_actions
gdk_drag_context_get_suggested_action
gdk_drag_context_list_targets
<SUBSECTION Standard> <SUBSECTION Standard>
GDK_DRAG_CONTEXT GDK_DRAG_CONTEXT
......
...@@ -391,7 +391,14 @@ Removes the X error trap installed with gdk_error_trap_push(). ...@@ -391,7 +391,14 @@ Removes the X error trap installed with gdk_error_trap_push().
<!-- ##### MACRO GDK_WINDOWING_X11 ##### --> <!-- ##### MACRO GDK_WINDOWING_X11 ##### -->
<para> <para>
This macro is defined if GDK is configured to use the X backend. This macro is defined if GDK is configured to use the X11 backend.
</para>
<!-- ##### MACRO GDK_WINDOWING_WIN32 ##### -->
<para>
This macro is defined if GDK is configured to use the win32 backend.
</para> </para>
......
...@@ -371,7 +371,13 @@ gdk_cursor_get_image ...@@ -371,7 +371,13 @@ gdk_cursor_get_image
#if IN_FILE(__GDK_INPUT_C__) #if IN_FILE(__GDK_INPUT_C__)
gdk_device_free_history gdk_device_free_history
gdk_device_get_axis gdk_device_get_axis
gdk_device_get_axis_use
gdk_device_get_has_cursor
gdk_device_get_history gdk_device_get_history
gdk_device_get_key
gdk_device_get_mode
gdk_device_get_name
gdk_device_get_source
gdk_device_get_type G_GNUC_CONST gdk_device_get_type G_GNUC_CONST
gdk_device_set_axis_use gdk_device_set_axis_use
gdk_device_set_key gdk_device_set_key
...@@ -519,6 +525,10 @@ gdk_drop_reply ...@@ -519,6 +525,10 @@ gdk_drop_reply
#if IN_HEADER(__GDK_DND_H__) #if IN_HEADER(__GDK_DND_H__)
#if IN_FILE(__GDK_DND_C__) #if IN_FILE(__GDK_DND_C__)
gdk_drag_context_get_action
gdk_drag_context_get_actions
gdk_drag_context_get_suggested_action
gdk_drag_context_list_targets
gdk_drag_find_window gdk_drag_find_window
gdk_drag_get_protocol gdk_drag_get_protocol
#endif #endif
...@@ -644,14 +654,20 @@ gdk_window_resize ...@@ -644,14 +654,20 @@ gdk_window_resize
gdk_window_move_resize gdk_window_move_resize
gdk_window_scroll gdk_window_scroll
gdk_window_move_region gdk_window_move_region
gdk_window_set_background gdk_window_get_accept_focus
gdk_window_set_back_pixmap gdk_window_get_back_pixmap
gdk_window_set_cursor gdk_window_get_background
gdk_window_get_composited
gdk_window_get_cursor gdk_window_get_cursor
gdk_window_get_deskrelative_origin
gdk_window_get_focus_on_map
gdk_window_get_geometry gdk_window_get_geometry
gdk_window_get_modal_hint
gdk_window_get_origin gdk_window_get_origin
gdk_window_get_root_coords gdk_window_get_root_coords
gdk_window_get_deskrelative_origin gdk_window_set_background
gdk_window_set_back_pixmap
gdk_window_set_cursor
gdk_window_shape_combine_mask gdk_window_shape_combine_mask
gdk_window_shape_combine_region gdk_window_shape_combine_region
gdk_window_set_child_shapes gdk_window_set_child_shapes
...@@ -690,10 +706,12 @@ gdk_window_get_effective_toplevel ...@@ -690,10 +706,12 @@ gdk_window_get_effective_toplevel
gdk_window_get_update_area gdk_window_get_update_area
gdk_window_get_user_data gdk_window_get_user_data
gdk_window_get_window_type gdk_window_get_window_type
gdk_window_is_destroyed
gdk_window_invalidate_maybe_recurse gdk_window_invalidate_maybe_recurse
gdk_window_invalidate_rect gdk_window_invalidate_rect
gdk_window_invalidate_region gdk_window_invalidate_region
gdk_window_is_destroyed
gdk_window_is_input_only
gdk_window_is_shaped
gdk_window_is_viewable gdk_window_is_viewable
gdk_window_is_visible gdk_window_is_visible
gdk_window_object_get_type G_GNUC_CONST gdk_window_object_get_type G_GNUC_CONST
...@@ -785,8 +803,17 @@ gdk_window_configure_finished ...@@ -785,8 +803,17 @@ gdk_window_configure_finished
#if IN_HEADER(__GDK_IMAGE_H__) #if IN_HEADER(__GDK_IMAGE_H__)
#if IN_FILE(__GDK_IMAGE_C__) #if IN_FILE(__GDK_IMAGE_C__)
gdk_image_set_colormap gdk_image_get_bits_per_pixel
gdk_image_get_bytes_per_pixel
gdk_image_get_bytes_per_line
gdk_image_get_byte_order
gdk_image_get_colormap gdk_image_get_colormap
gdk_image_get_depth
gdk_image_get_height
gdk_image_get_image_type
gdk_image_get_visual
gdk_image_get_width
gdk_image_set_colormap
gdk_image_new gdk_image_new
#endif #endif
#endif #endif
...@@ -854,7 +881,15 @@ gdk_keyval_name G_GNUC_CONST ...@@ -854,7 +881,15 @@ gdk_keyval_name G_GNUC_CONST
#if IN_HEADER(__GDK_VISUAL_H__) #if IN_HEADER(__GDK_VISUAL_H__)
#if IN_FILE(__GDK_VISUAL_C__) #if IN_FILE(__GDK_VISUAL_C__)
gdk_list_visuals gdk_list_visuals
gdk_visual_get_bits_per_rgb
gdk_visual_get_blue_pixel_details
gdk_visual_get_byte_order
gdk_visual_get_colormap_size
gdk_visual_get_depth
gdk_visual_get_green_pixel_details
gdk_visual_get_red_pixel_details
gdk_visual_get_system gdk_visual_get_system
gdk_visual_get_visual_type
#endif #endif
#endif #endif
......
...@@ -71,13 +71,13 @@ struct _GdkColormap ...@@ -71,13 +71,13 @@ struct _GdkColormap
GObject parent_instance; GObject parent_instance;
/*< public >*/ /*< public >*/
gint size; gint GSEAL (size);
GdkColor *colors; GdkColor *GSEAL (colors);
/*< private >*/ /*< private >*/
GdkVisual *visual; GdkVisual *GSEAL (visual);
gpointer windowing_data; gpointer GSEAL (windowing_data);
}; };
struct _GdkColormapClass struct _GdkColormapClass
......
...@@ -126,9 +126,9 @@ typedef enum ...@@ -126,9 +126,9 @@ typedef enum
struct _GdkCursor struct _GdkCursor
{ {
GdkCursorType type; GdkCursorType GSEAL (type);
/*< private >*/ /*< private >*/
guint ref_count; guint GSEAL (ref_count);
}; };
/* Cursors /* Cursors
......
...@@ -75,34 +75,34 @@ struct _GdkDisplay ...@@ -75,34 +75,34 @@ struct _GdkDisplay
GObject parent_instance; GObject parent_instance;
/*< private >*/ /*< private >*/
GList *queued_events; GList *GSEAL (queued_events);
GList *queued_tail; GList *GSEAL (queued_tail);
/* Information for determining if the latest button click /* Information for determining if the latest button click
* is part of a double-click or triple-click * is part of a double-click or triple-click
*/ */
guint32 button_click_time[2]; /* The last 2 button click times. */ guint32 GSEAL (button_click_time[2]); /* The last 2 button click times. */
GdkWindow *button_window[2]; /* The last 2 windows to receive button presses. */ GdkWindow *GSEAL (button_window[2]); /* The last 2 windows to receive button presses. */
gint button_number[2]; /* The last 2 buttons to be pressed. */ gint GSEAL (button_number[2]); /* The last 2 buttons to be pressed. */
guint double_click_time; /* Maximum time between clicks in msecs */ guint GSEAL (double_click_time); /* Maximum time between clicks in msecs */
GdkDevice *core_pointer; /* Core pointer device */ GdkDevice *GSEAL (core_pointer); /* Core pointer device */
const GdkDisplayPointerHooks *pointer_hooks; /* Current hooks for querying pointer */ const GdkDisplayPointerHooks *GSEAL (pointer_hooks); /* Current hooks for querying pointer */
guint closed : 1; /* Whether this display has been closed */ guint GSEAL (closed) : 1; /* Whether this display has been closed */
guint ignore_core_events : 1; /* Don't send core motion and button event */ guint GSEAL (ignore_core_events) : 1; /* Don't send core motion and button event */
guint double_click_distance; /* Maximum distance between clicks in pixels */ guint GSEAL (double_click_distance); /* Maximum distance between clicks in pixels */
gint button_x[2]; /* The last 2 button click positions. */ gint GSEAL (button_x[2]); /* The last 2 button click positions. */
gint button_y[2]; gint GSEAL (button_y[2]);
GList *pointer_grabs; GList *GSEAL (pointer_grabs);
GdkKeyboardGrabInfo keyboard_grab; GdkKeyboardGrabInfo GSEAL (keyboard_grab);
GdkPointerWindowInfo pointer_info; GdkPointerWindowInfo GSEAL (pointer_info);
/* Last reported event time from server */ /* Last reported event time from server */
guint32 last_event_time; guint32 GSEAL (last_event_time);
}; };
struct _GdkDisplayClass struct _GdkDisplayClass
......
...@@ -77,5 +77,78 @@ gdk_drag_get_protocol (GdkNativeWindow xid, ...@@ -77,5 +77,78 @@ gdk_drag_get_protocol (GdkNativeWindow xid,
return gdk_drag_get_protocol_for_display (gdk_display_get_default (), xid, protocol); return gdk_drag_get_protocol_for_display (gdk_display_get_default (), xid, protocol);
} }
/**
* gdk_drag_context_list_targets:
* @context: a #GdkDragContext
*
* Retrieves the list of targets of the context.
*
* Return value: a #GList of targets
*
* Since: 2.22
**/
GList *
gdk_drag_context_list_targets (GdkDragContext *context)
{
g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), NULL);
return context->targets;
}
/**
* gdk_drag_context_get_actions:
* @context: a #GdkDragContext
*
* Determines the bitmask of actions proposed by the source if
* gdk_drag_context_suggested_action() returns GDK_ACTION_ASK.
*
* Return value: the #GdkDragAction flags
*
* Since: 2.22
**/
GdkDragAction
gdk_drag_context_get_actions (GdkDragContext *context)
{
g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), GDK_ACTION_DEFAULT);
return context->actions;
}
/**
* gdk_drag_context_get_suggested_action:
* @context: a #GdkDragContext
*
* Determines the suggested drag action of the context.
*
* Return value: a #GdkDragAction value
*
* Since: 2.22
**/
GdkDragAction
gdk_drag_context_get_suggested_action (GdkDragContext *context)
{
g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), 0);
return context->suggested_action;
}
/**
* gdk_drag_context_get_action:
* @context: a #GdkDragContext
*
* Determines the action chosen by the drag destination.
*
* Return value: a #GdkDragAction value
*
* Since: 2.22
**/
GdkDragAction
gdk_drag_context_get_action (GdkDragContext *context)
{
g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), 0);
return context->action;
}
#define __GDK_DND_C__ #define __GDK_DND_C__
#include "gdkaliasdef.c" #include "gdkaliasdef.c"
...@@ -77,29 +77,28 @@ struct _GdkDragContext { ...@@ -77,29 +77,28 @@ struct _GdkDragContext {
/*< public >*/ /*< public >*/
GdkDragProtocol protocol; GdkDragProtocol GSEAL (protocol);
gboolean is_source; gboolean GSEAL (is_source);
GdkWindow *source_window; GdkWindow *GSEAL (source_window);
GdkWindow *dest_window; GdkWindow *GSEAL (dest_window);
GList *targets; GList *GSEAL (targets);
GdkDragAction actions; GdkDragAction GSEAL (actions);
GdkDragAction suggested_action; GdkDragAction GSEAL (suggested_action);
GdkDragAction action; GdkDragAction GSEAL (action);
guint32 start_time; guint32 GSEAL (start_time);
/*< private >*/ /*< private >*/
gpointer windowing_data; gpointer GSEAL (windowing_data);
}; };
struct _GdkDragContextClass { struct _GdkDragContextClass {
GObjectClass parent_class; GObjectClass parent_class;
}; };
/* Drag and Drop */ /* Drag and Drop */
...@@ -107,6 +106,11 @@ struct _GdkDragContextClass { ...@@ -107,6 +106,11 @@ struct _GdkDragContextClass {
GType gdk_drag_context_get_type (void) G_GNUC_CONST; GType gdk_drag_context_get_type (void) G_GNUC_CONST;
GdkDragContext * gdk_drag_context_new (void); GdkDragContext * gdk_drag_context_new (void);
GList *gdk_drag_context_list_targets (GdkDragContext *context);
GdkDragAction gdk_drag_context_get_actions (GdkDragContext *context);
GdkDragAction gdk_drag_context_get_suggested_action (GdkDragContext *context);
GdkDragAction gdk_drag_context_get_action (GdkDragContext *context);
/* Destination side */ /* Destination side */
void gdk_drag_status (GdkDragContext *context, void gdk_drag_status (GdkDragContext *context,
......
...@@ -190,12 +190,12 @@ struct _GdkGC ...@@ -190,12 +190,12 @@ struct _GdkGC
{ {
GObject parent_instance; GObject parent_instance;
gint clip_x_origin; gint GSEAL (clip_x_origin);
gint clip_y_origin; gint GSEAL (clip_y_origin);
gint ts_x_origin; gint GSEAL (ts_x_origin);
gint ts_y_origin; gint GSEAL (ts_y_origin);
GdkColormap *colormap; GdkColormap *GSEAL (colormap);
}; };
struct _GdkGCClass struct _GdkGCClass
......
...@@ -81,6 +81,168 @@ gdk_image_get_colormap (GdkImage *image) ...@@ -81,6 +81,168 @@ gdk_image_get_colormap (GdkImage *image)
return image->colormap; return image->colormap;
} }
/**
* gdk_image_get_image_type:
* @image: a #GdkImage
*
* Determines the type of a given image.
*
* Return value: the #GdkImageType of the image
*
* Since: 2.22
**/
GdkImageType
gdk_image_get_image_type (GdkImage *image)
{
g_return_val_if_fail (GDK_IS_IMAGE (image), 0);
return image->type;
}
/**
* gdk_image_get_visual:
* @image: a #GdkImage
*
* Determines the visual that was used to create the image.
*
* Return value: a #GdkVisual
*
* Since: 2.22
**/
GdkVisual *
gdk_image_get_visual (GdkImage *image)
{
g_return_val_if_fail (GDK_IS_IMAGE (image), NULL);
return image->visual;
}
/**
* gdk_image_get_byte_order:
* @image: a #GdkImage
*
* Determines the byte order of the image.
*
* Return value: a #GdkVisual
*
* Since: 2.22
**/
GdkByteOrder
gdk_image_get_byte_order (GdkImage *image)
{
g_return_val_if_fail (GDK_IS_IMAGE (image), 0);
return image->byte_order;
}
/**
* gdk_image_get_width:
* @image: a #GdkImage
*
* Determines the width of the image.
*
* Return value: the width
*
* Since: 2.22
**/
gint
gdk_image_get_width (GdkImage *image)
{
g_return_val_if_fail (GDK_IS_IMAGE (image), 0);
return image->width;
}
/**
* gdk_image_get_height:
* @image: a #GdkImage
*
* Determines the height of the image.
*
* Return value: the height
*
* Since: 2.22
**/
gint
gdk_image_get_height (GdkImage *image)
{
g_return_val_if_fail (GDK_IS_IMAGE (image), 0);
return image->height;
}
/**
* gdk_image_get_depth:
* @image: a #GdkImage
*
* Determines the depth of the image.
*
* Return value: the depth
*
* Since: 2.22
**/
guint16
gdk_image_get_depth (GdkImage *image)
{
g_return_val_if_fail (GDK_IS_IMAGE (image), 0);
return image->depth;
}
/**
* gdk_image_get_bytes_per_pixel:
* @image: a #GdkImage
*
* Determines the number of bytes per pixel of the image.
*
* Return value: the bytes per pixel
*
* Since: 2.22
**/
guint16
gdk_image_get_bytes_per_pixel (GdkImage *image)
{
g_return_val_if_fail (GDK_IS_IMAGE (image), 0);
return image->bpp;
}
/**
* gdk_image_get_bytes_per_line:
* @image: a #GdkImage
*
* Determines the number of bytes per line of the image.
*
* Return value: the bytes per line
*
* Since: 2.22
**/
guint16
gdk_image_get_bytes_per_line (GdkImage *image)
{
g_return_val_if_fail (GDK_IS_IMAGE (image), 0);
return image->bpl;
}
/**
* gdk_image_get_bits_per_pixel:
* @image: a #GdkImage
*
* Determines the number of bits per pixel of the image.
*
* Return value: the bits per pixel
*
* Since: 2.22
**/
guint16
gdk_image_get_bits_per_pixel (GdkImage *image)
{
g_return_val_if_fail (GDK_IS_IMAGE (image), 0);
return image->bits_per_pixel;
}
/* We have N_REGION GDK_SCRATCH_IMAGE_WIDTH x GDK_SCRATCH_IMAGE_HEIGHT regions divided /* We have N_REGION GDK_SCRATCH_IMAGE_WIDTH x GDK_SCRATCH_IMAGE_HEIGHT regions divided
* up between n_images different images. possible_n_images gives * up between n_images different images. possible_n_images gives
* various divisors of N_REGIONS. The reason for allowing this * various divisors of N_REGIONS. The reason for allowing this
......
...@@ -68,21 +68,21 @@ struct _GdkImage ...@@ -68,21 +68,21 @@ struct _GdkImage
/*< public >*/ /*< public >*/