diff --git a/ChangeLog b/ChangeLog index e06bfa6e4a..33fa896751 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,22 +1,10 @@ 2002-10-24 Matthias Clasen - * gdk/gdkcolor.c (gdk_colormap_alloc_color): - (gdk_colormap_get_visual): - (gdk_colors_store): - (gdk_color_copy): - (gdk_color_free): - (gdk_color_white): - (gdk_color_black): - (gdk_color_parse): - (gdk_color_alloc): - - * gdk/x11/gdkcolor-x11.c (gdk_colormap_new): - (gdk_colormap_get_system_size): - (gdk_colormap_change): - (gdk_colormap_alloc_colors): - (gdk_colors_alloc): - (gdk_colors_free): - (gdk_color_change): + * gdk/gdkdnd.c: + * gdk/x11/gdkdnd-x11.c: + * gdk/x11/gdkcursor-x11.c: + * gdk/gdkcolor.c: + * gdk/x11/gdkcolor-x11.c: Some docs moved inline. 2002-10-23 Matthias Clasen diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index e06bfa6e4a..33fa896751 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,22 +1,10 @@ 2002-10-24 Matthias Clasen - * gdk/gdkcolor.c (gdk_colormap_alloc_color): - (gdk_colormap_get_visual): - (gdk_colors_store): - (gdk_color_copy): - (gdk_color_free): - (gdk_color_white): - (gdk_color_black): - (gdk_color_parse): - (gdk_color_alloc): - - * gdk/x11/gdkcolor-x11.c (gdk_colormap_new): - (gdk_colormap_get_system_size): - (gdk_colormap_change): - (gdk_colormap_alloc_colors): - (gdk_colors_alloc): - (gdk_colors_free): - (gdk_color_change): + * gdk/gdkdnd.c: + * gdk/x11/gdkdnd-x11.c: + * gdk/x11/gdkcursor-x11.c: + * gdk/gdkcolor.c: + * gdk/x11/gdkcolor-x11.c: Some docs moved inline. 2002-10-23 Matthias Clasen diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index e06bfa6e4a..33fa896751 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,22 +1,10 @@ 2002-10-24 Matthias Clasen - * gdk/gdkcolor.c (gdk_colormap_alloc_color): - (gdk_colormap_get_visual): - (gdk_colors_store): - (gdk_color_copy): - (gdk_color_free): - (gdk_color_white): - (gdk_color_black): - (gdk_color_parse): - (gdk_color_alloc): - - * gdk/x11/gdkcolor-x11.c (gdk_colormap_new): - (gdk_colormap_get_system_size): - (gdk_colormap_change): - (gdk_colormap_alloc_colors): - (gdk_colors_alloc): - (gdk_colors_free): - (gdk_color_change): + * gdk/gdkdnd.c: + * gdk/x11/gdkdnd-x11.c: + * gdk/x11/gdkcursor-x11.c: + * gdk/gdkcolor.c: + * gdk/x11/gdkcolor-x11.c: Some docs moved inline. 2002-10-23 Matthias Clasen diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index e06bfa6e4a..33fa896751 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,22 +1,10 @@ 2002-10-24 Matthias Clasen - * gdk/gdkcolor.c (gdk_colormap_alloc_color): - (gdk_colormap_get_visual): - (gdk_colors_store): - (gdk_color_copy): - (gdk_color_free): - (gdk_color_white): - (gdk_color_black): - (gdk_color_parse): - (gdk_color_alloc): - - * gdk/x11/gdkcolor-x11.c (gdk_colormap_new): - (gdk_colormap_get_system_size): - (gdk_colormap_change): - (gdk_colormap_alloc_colors): - (gdk_colors_alloc): - (gdk_colors_free): - (gdk_color_change): + * gdk/gdkdnd.c: + * gdk/x11/gdkdnd-x11.c: + * gdk/x11/gdkcursor-x11.c: + * gdk/gdkcolor.c: + * gdk/x11/gdkcolor-x11.c: Some docs moved inline. 2002-10-23 Matthias Clasen diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index e06bfa6e4a..33fa896751 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,22 +1,10 @@ 2002-10-24 Matthias Clasen - * gdk/gdkcolor.c (gdk_colormap_alloc_color): - (gdk_colormap_get_visual): - (gdk_colors_store): - (gdk_color_copy): - (gdk_color_free): - (gdk_color_white): - (gdk_color_black): - (gdk_color_parse): - (gdk_color_alloc): - - * gdk/x11/gdkcolor-x11.c (gdk_colormap_new): - (gdk_colormap_get_system_size): - (gdk_colormap_change): - (gdk_colormap_alloc_colors): - (gdk_colors_alloc): - (gdk_colors_free): - (gdk_color_change): + * gdk/gdkdnd.c: + * gdk/x11/gdkdnd-x11.c: + * gdk/x11/gdkcursor-x11.c: + * gdk/gdkcolor.c: + * gdk/x11/gdkcolor-x11.c: Some docs moved inline. 2002-10-23 Matthias Clasen diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index e06bfa6e4a..33fa896751 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,22 +1,10 @@ 2002-10-24 Matthias Clasen - * gdk/gdkcolor.c (gdk_colormap_alloc_color): - (gdk_colormap_get_visual): - (gdk_colors_store): - (gdk_color_copy): - (gdk_color_free): - (gdk_color_white): - (gdk_color_black): - (gdk_color_parse): - (gdk_color_alloc): - - * gdk/x11/gdkcolor-x11.c (gdk_colormap_new): - (gdk_colormap_get_system_size): - (gdk_colormap_change): - (gdk_colormap_alloc_colors): - (gdk_colors_alloc): - (gdk_colors_free): - (gdk_color_change): + * gdk/gdkdnd.c: + * gdk/x11/gdkdnd-x11.c: + * gdk/x11/gdkcursor-x11.c: + * gdk/gdkcolor.c: + * gdk/x11/gdkcolor-x11.c: Some docs moved inline. 2002-10-23 Matthias Clasen diff --git a/docs/reference/ChangeLog b/docs/reference/ChangeLog index 3ab6229ec2..2d7a3d0a37 100644 --- a/docs/reference/ChangeLog +++ b/docs/reference/ChangeLog @@ -1,3 +1,8 @@ +2002-10-24 Matthias Clasen + + * gdk/tmpl/dnd.sgml: + * gdk/tmpl/cursors.sgml: More docs moved inline. + 2002-10-24 Matthias Clasen * gdk/tmpl/colors.sgml: Some docs moved inline. diff --git a/docs/reference/gdk/tmpl/cursors.sgml b/docs/reference/gdk/tmpl/cursors.sgml index 8f41d37741..98e6e8ffa4 100644 --- a/docs/reference/gdk/tmpl/cursors.sgml +++ b/docs/reference/gdk/tmpl/cursors.sgml @@ -119,56 +119,15 @@ The standard cursors available. -Creates a new cursor from a given pixmap and mask. Both the pixmap and mask -must have a depth of 1 (i.e. each pixel has only 2 values - on or off). -The standard cursor size is 16 by 16 pixels. You can create a bitmap -from inline data as in the below example. -Creating a custom cursor. - -/* This data is in X bitmap format, and can be created with the 'bitmap' - utility. */ -#define cursor1_width 16 -#define cursor1_height 16 -static unsigned char cursor1_bits[] = { - 0x80, 0x01, 0x40, 0x02, 0x20, 0x04, 0x10, 0x08, 0x08, 0x10, 0x04, 0x20, - 0x82, 0x41, 0x41, 0x82, 0x41, 0x82, 0x82, 0x41, 0x04, 0x20, 0x08, 0x10, - 0x10, 0x08, 0x20, 0x04, 0x40, 0x02, 0x80, 0x01}; -static unsigned char cursor1mask_bits[] = { - 0x80, 0x01, 0xc0, 0x03, 0x60, 0x06, 0x30, 0x0c, 0x18, 0x18, 0x8c, 0x31, - 0xc6, 0x63, 0x63, 0xc6, 0x63, 0xc6, 0xc6, 0x63, 0x8c, 0x31, 0x18, 0x18, - 0x30, 0x0c, 0x60, 0x06, 0xc0, 0x03, 0x80, 0x01}; - - - GdkCursor *cursor; - GdkPixmap *source, *mask; - GdkColor fg = { 0, 65535, 0, 0 }; /* Red. */ - GdkColor bg = { 0, 0, 0, 65535 }; /* Blue. */ - - - source = gdk_bitmap_create_from_data (NULL, cursor1_bits, - cursor1_width, cursor1_height); - mask = gdk_bitmap_create_from_data (NULL, cursor1mask_bits, - cursor1_width, cursor1_height); - cursor = gdk_cursor_new_from_pixmap (source, mask, &fg, &bg, 8, 8); - gdk_pixmap_unref (source); - gdk_pixmap_unref (mask); - - - gdk_window_set_cursor (widget->window, cursor); - - - -@source: the pixmap specifying the cursor. -@mask: the pixmap specifying the mask, which must be the same size as @source. -@fg: the foreground color, used for the bits in the source which are 1. -The color does not have to be allocated first. -@bg: the background color, used for the bits in the source which are 0. -The color does not have to be allocated first. -@x: the horizontal offset of the 'hotspot' of the cursor. -@y: the vertical offset of the 'hotspot' of the cursor. -@Returns: a new #GdkCursor. +@source: +@mask: +@fg: +@bg: +@x: +@y: +@Returns: @@ -212,7 +171,5 @@ The color does not have to be allocated first. Destroys a cursor, freeing any resources allocated for it. - -@cursor: a #GdkCursor. diff --git a/docs/reference/gdk/tmpl/dnd.sgml b/docs/reference/gdk/tmpl/dnd.sgml index 07005b1169..f652b77481 100644 --- a/docs/reference/gdk/tmpl/dnd.sgml +++ b/docs/reference/gdk/tmpl/dnd.sgml @@ -24,76 +24,53 @@ the GTK+ documentation for more information. -Returns the selection atom for the current source window. -@context: a #GdkDragContext. -@Returns: the selection atom. - +@context: +@Returns: -Aborts a drag without dropping. - - -This function is called by the drag source. -@context: a #GdkDragContext. -@time: the timestamp for this operation. +@context: +@time: -Accepts or rejects a drop. - - -This function is called by the drag destination in response -to a drop initiated by the drag source. -@context: a #GdkDragContext. -@ok: %TRUE if the drop is accepted. -@time: the timestamp for this operation. +@context: +@ok: +@time: -Creates a new #GdkDragContext. -@Returns: the newly created #GdkDragContext. +@Returns: -Drops on the current destination. - - -This function is called by the drag source. -@context: a #GdkDragContext. -@time: the timestamp for this operation. +@context: +@time: -Finds the destination window and DND protocol to use at the -given pointer position. - - -This function is called by the drag source to obtain the -@dest_window and @protocol parameters for gdk_drag_motion(). -@context: a #GdkDragContext. -@drag_window: a window which may be at the pointer position, but - should be ignored, since it is put up by the drag source as an icon. -@x_root: the x position of the pointer in root coordinates. -@y_root: the y position of the pointer in root coordinates. -@dest_window: location to store the destination window in. -@protocol: location to store the DND protocol in. +@context: +@drag_window: +@x_root: +@y_root: +@dest_window: +@protocol: @@ -112,68 +89,51 @@ This function is called by the drag source to obtain the -Deprecated function; use g_object_ref() instead. -@context: a #GdkDragContext. +@context: -Starts a drag and creates a new drag context for it. - - -This function is called by the drag source. -@window: the source window for this drag. -@targets: the list of offered targets. -@Returns: a newly created #GdkDragContext. +@window: +@targets: +@Returns: -Updates the drag context when the pointer moves or the -set of actions changes. - - -This function is called by the drag source. -@context: a #GdkDragContext. -@dest_window: the new destination window, obtained by gdk_drag_find_window(). -@protocol: the DND protocol in use, obtained by gdk_drag_find_window(). -@x_root: the x position of the pointer in root coordinates. -@y_root: the y position of the pointer in root coordinates. -@suggested_action: the suggested action. -@possible_actions: the possible actions. -@time: the timestamp for this operation. -@Returns: FIXME +@context: +@dest_window: +@protocol: +@x_root: +@y_root: +@suggested_action: +@possible_actions: +@time: +@Returns: -Ends the drag operation after a drop. - - -This function is called by the drag destination. -@context: a #GtkDragContext. -@success: %TRUE if the data was successfully received. -@time: the timestamp for this operation. +@context: +@success: +@time: -Finds out the DND protocol supported by a window. -@xid: the X id of the destination window. -@protocol: location where the supported DND protocol is returned. -@Returns: the X id of the window where the drop should happen. This - may be @xid or the X id of a proxy window, or None if @xid doesn't - support Drag and Drop. +@xid: +@protocol: +@Returns: @@ -204,10 +164,9 @@ which DND is done. -Deprecated function; use g_object_unref() instead. -@context: a #GdkDragContext. +@context: @@ -246,16 +205,10 @@ should do with the dropped data. -Selects one of the actions offered by the drag source. - - -This function is called by the drag destination in response to -gdk_drag_motion() called by the drag source. -@context: a #GdkDragContext. -@action: the selected action which will be taken when a drop happens, - or 0 to indicate that a drop will not be accepted. -@time: the timestamp for this operation. +@context: +@action: +@time: diff --git a/gdk/gdkdnd.c b/gdk/gdkdnd.c index 27c657cec6..00117119b6 100644 --- a/gdk/gdkdnd.c +++ b/gdk/gdkdnd.c @@ -26,6 +26,22 @@ #include +/** + * gdk_drag_find_window: + * @context: a #GdkDragContext. + * @drag_window: a window which may be at the pointer position, but + * should be ignored, since it is put up by the drag source as an icon. + * @x_root: the x position of the pointer in root coordinates. + * @y_root: the y position of the pointer in root coordinates. + * @dest_window: location to store the destination window in. + * @protocol: location to store the DND protocol in. + * + * Finds the destination window and DND protocol to use at the + * given pointer position. + * + * This function is called by the drag source to obtain the + * @dest_window and @protocol parameters for gdk_drag_motion(). + **/ void gdk_drag_find_window (GdkDragContext *context, GdkWindow *drag_window, @@ -39,6 +55,17 @@ gdk_drag_find_window (GdkDragContext *context, x_root, y_root, dest_window, protocol); } +/** + * gdk_drag_get_protocol: + * @xid: the X id of the destination window. + * @protocol: location where the supported DND protocol is returned. + * + * Finds out the DND protocol supported by a window. + * + * Return value: the X id of the window where the drop should happen. This + * may be @xid or the X id of a proxy window, or None if @xid doesn't + * support Drag and Drop. + **/ guint32 gdk_drag_get_protocol (guint32 xid, GdkDragProtocol *protocol) diff --git a/gdk/x11/gdkcursor-x11.c b/gdk/x11/gdkcursor-x11.c index 3a424d2495..4a3dee082e 100644 --- a/gdk/x11/gdkcursor-x11.c +++ b/gdk/x11/gdkcursor-x11.c @@ -124,6 +124,61 @@ gdk_cursor_new_for_display (GdkDisplay *display, return cursor; } +/** + * gdk_cursor_new_from_pixmap: + * @source: the pixmap specifying the cursor. + * @mask: the pixmap specifying the mask, which must be the same size as + * @source. + * @fg: the foreground color, used for the bits in the source which are 1. + * The color does not have to be allocated first. + * @bg: the background color, used for the bits in the source which are 0. + * The color does not have to be allocated first. + * @x: the horizontal offset of the 'hotspot' of the cursor. + * @y: the vertical offset of the 'hotspot' of the cursor. + * + * Creates a new cursor from a given pixmap and mask. Both the pixmap and mask + * must have a depth of 1 (i.e. each pixel has only 2 values - on or off). + * The standard cursor size is 16 by 16 pixels. You can create a bitmap + * from inline data as in the below example. + * + * Creating a custom cursor. + * + * /* This data is in X bitmap format, and can be created with the 'bitmap' + * utility. */ + * #define cursor1_width 16 + * #define cursor1_height 16 + * static unsigned char cursor1_bits[] = { + * 0x80, 0x01, 0x40, 0x02, 0x20, 0x04, 0x10, 0x08, 0x08, 0x10, 0x04, 0x20, + * 0x82, 0x41, 0x41, 0x82, 0x41, 0x82, 0x82, 0x41, 0x04, 0x20, 0x08, 0x10, + * 0x10, 0x08, 0x20, 0x04, 0x40, 0x02, 0x80, 0x01}; + * + * static unsigned char cursor1mask_bits[] = { + * 0x80, 0x01, 0xc0, 0x03, 0x60, 0x06, 0x30, 0x0c, 0x18, 0x18, 0x8c, 0x31, + * 0xc6, 0x63, 0x63, 0xc6, 0x63, 0xc6, 0xc6, 0x63, 0x8c, 0x31, 0x18, 0x18, + * 0x30, 0x0c, 0x60, 0x06, 0xc0, 0x03, 0x80, 0x01}; + * + * + * GdkCursor *cursor; + * GdkPixmap *source, *mask; + * GdkColor fg = { 0, 65535, 0, 0 }; /* Red. */ + * GdkColor bg = { 0, 0, 0, 65535 }; /* Blue. */ + * + * + * source = gdk_bitmap_create_from_data (NULL, cursor1_bits, + * cursor1_width, cursor1_height); + * mask = gdk_bitmap_create_from_data (NULL, cursor1mask_bits, + * cursor1_width, cursor1_height); + * cursor = gdk_cursor_new_from_pixmap (source, mask, &fg, &bg, 8, 8); + * gdk_pixmap_unref (source); + * gdk_pixmap_unref (mask); + * + * + * gdk_window_set_cursor (widget->window, cursor); + * + * + * + * Return value: a new #GdkCursor. + **/ GdkCursor* gdk_cursor_new_from_pixmap (GdkPixmap *source, GdkPixmap *mask, diff --git a/gdk/x11/gdkdnd-x11.c b/gdk/x11/gdkdnd-x11.c index f2e5850c9f..ab96e66901 100644 --- a/gdk/x11/gdkdnd-x11.c +++ b/gdk/x11/gdkdnd-x11.c @@ -217,12 +217,25 @@ gdk_drag_context_finalize (GObject *object) /* Drag Contexts */ +/** + * gdk_drag_context_new: + * + * Creates a new #GdkDragContext. + * + * Return value: the newly created #GdkDragContext. + **/ GdkDragContext * gdk_drag_context_new (void) { return g_object_new (gdk_drag_context_get_type (), NULL); } +/** + * gdk_drag_context_ref: + * @context: a #GdkDragContext. + * + * Deprecated function; use g_object_ref() instead. + **/ void gdk_drag_context_ref (GdkDragContext *context) { @@ -231,6 +244,12 @@ gdk_drag_context_ref (GdkDragContext *context) g_object_ref (context); } +/** + * gdk_drag_context_unref: + * @context: a #GdkDragContext. + * + * Deprecated function; use g_object_unref() instead. + **/ void gdk_drag_context_unref (GdkDragContext *context) { @@ -2735,6 +2754,17 @@ gdk_drag_do_leave (GdkDragContext *context, guint32 time) } } +/** + * gdk_drag_begin: + * @window: the source window for this drag. + * @targets: the list of offered targets. + * + * Starts a drag and creates a new drag context for it. + * + * This function is called by the drag source. + * + * Return value: a newly created #GdkDragContext. + **/ GdkDragContext * gdk_drag_begin (GdkWindow *window, GList *targets) @@ -2938,6 +2968,25 @@ gdk_drag_find_window_for_screen (GdkDragContext *context, } } +/** + * gdk_drag_motion: + * @context: a #GdkDragContext. + * @dest_window: the new destination window, obtained by + * gdk_drag_find_window(). + * @protocol: the DND protocol in use, obtained by gdk_drag_find_window(). + * @x_root: the x position of the pointer in root coordinates. + * @y_root: the y position of the pointer in root coordinates. + * @suggested_action: the suggested action. + * @possible_actions: the possible actions. + * @time: the timestamp for this operation. + * + * Updates the drag context when the pointer moves or the + * set of actions changes. + * + * This function is called by the drag source. + * + * Return value: FIXME + **/ gboolean gdk_drag_motion (GdkDragContext *context, GdkWindow *dest_window, @@ -3080,6 +3129,15 @@ gdk_drag_motion (GdkDragContext *context, return FALSE; } +/** + * gdk_drag_drop: + * @context: a #GdkDragContext. + * @time: the timestamp for this operation. + * + * Drops on the current destination. + * + * This function is called by the drag source. + **/ void gdk_drag_drop (GdkDragContext *context, guint32 time) @@ -3111,6 +3169,15 @@ gdk_drag_drop (GdkDragContext *context, } } +/** + * gdk_drag_abort: + * @context: a #GdkDragContext. + * @time: the timestamp for this operation. + * + * Aborts a drag without dropping. + * + * This function is called by the drag source. + **/ void gdk_drag_abort (GdkDragContext *context, guint32 time) @@ -3122,6 +3189,18 @@ gdk_drag_abort (GdkDragContext *context, /* Destination side */ +/** + * gdk_drag_status: + * @context: a #GdkDragContext. + * @action: the selected action which will be taken when a drop happens, + * or 0 to indicate that a drop will not be accepted. + * @time: the timestamp for this operation. + * + * Selects one of the actions offered by the drag source. + * + * This function is called by the drag destination in response to + * gdk_drag_motion() called by the drag source. + **/ void gdk_drag_status (GdkDragContext *context, GdkDragAction action, @@ -3221,6 +3300,17 @@ gdk_drag_status (GdkDragContext *context, private->old_action = action; } +/** + * gdk_drop_reply: + * @context: a #GdkDragContext. + * @ok: %TRUE if the drop is accepted. + * @time: the timestamp for this operation. + * + * Accepts or rejects a drop. + * + * This function is called by the drag destination in response + * to a drop initiated by the drag source. + **/ void gdk_drop_reply (GdkDragContext *context, gboolean ok, @@ -3263,6 +3353,16 @@ gdk_drop_reply (GdkDragContext *context, } } +/** + * gdk_drop_finish: + * @context: a #GtkDragContext. + * @success: %TRUE if the data was successfully received. + * @time: the timestamp for this operation. + * + * Ends the drag operation after a drop. + * + * This function is called by the drag destination. + **/ void gdk_drop_finish (GdkDragContext *context, gboolean success, @@ -3339,14 +3439,14 @@ gdk_window_register_dnd (GdkWindow *window) (guchar *)&xdnd_version, 1); } -/************************************************************* +/** * gdk_drag_get_selection: - * Returns the selection atom for the current source window - * arguments: - * - * results: - *************************************************************/ - + * @context: a #GdkDragContext. + * + * Returns the selection atom for the current source window. + * + * Return value: the selection atom. + **/ GdkAtom gdk_drag_get_selection (GdkDragContext *context) {