More API docs moved inline.

This commit is contained in:
Matthias Clasen 2002-10-24 21:24:20 +00:00
parent 1f1f2e9127
commit f607812226
12 changed files with 270 additions and 245 deletions

View File

@ -1,22 +1,10 @@
2002-10-24 Matthias Clasen <maclas@gmx.de>
* 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 <maclas@gmx.de>

View File

@ -1,22 +1,10 @@
2002-10-24 Matthias Clasen <maclas@gmx.de>
* 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 <maclas@gmx.de>

View File

@ -1,22 +1,10 @@
2002-10-24 Matthias Clasen <maclas@gmx.de>
* 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 <maclas@gmx.de>

View File

@ -1,22 +1,10 @@
2002-10-24 Matthias Clasen <maclas@gmx.de>
* 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 <maclas@gmx.de>

View File

@ -1,22 +1,10 @@
2002-10-24 Matthias Clasen <maclas@gmx.de>
* 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 <maclas@gmx.de>

View File

@ -1,22 +1,10 @@
2002-10-24 Matthias Clasen <maclas@gmx.de>
* 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 <maclas@gmx.de>

View File

@ -1,3 +1,8 @@
2002-10-24 Matthias Clasen <maclas@gmx.de>
* gdk/tmpl/dnd.sgml:
* gdk/tmpl/cursors.sgml: More docs moved inline.
2002-10-24 Matthias Clasen <maclas@gmx.de>
* gdk/tmpl/colors.sgml: Some docs moved inline.

View File

@ -119,56 +119,15 @@ The standard cursors available.
<!-- ##### FUNCTION gdk_cursor_new_from_pixmap ##### -->
<para>
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.
</para>
<example><title>Creating a custom cursor.</title>
<programlisting>
/* This data is in X bitmap format, and can be created with the 'bitmap'
utility. */
&num;define cursor1_width 16
&num;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, &amp;fg, &amp;bg, 8, 8);
gdk_pixmap_unref (source);
gdk_pixmap_unref (mask);
gdk_window_set_cursor (widget->window, cursor);
</programlisting>
</example>
@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:
<!-- ##### FUNCTION gdk_cursor_new_for_display ##### -->
@ -212,7 +171,5 @@ The color does not have to be allocated first.
Destroys a cursor, freeing any resources allocated for it.
</para>
<!-- # Unused Parameters # -->
@cursor: a #GdkCursor.

View File

@ -24,76 +24,53 @@ the GTK+ documentation for more information.
<!-- ##### FUNCTION gdk_drag_get_selection ##### -->
<para>
Returns the selection atom for the current source window.
</para>
@context: a #GdkDragContext.
@Returns: the selection atom.
@context:
@Returns:
<!-- ##### FUNCTION gdk_drag_abort ##### -->
<para>
Aborts a drag without dropping.
</para>
<para>
This function is called by the drag source.
</para>
@context: a #GdkDragContext.
@time: the timestamp for this operation.
@context:
@time:
<!-- ##### FUNCTION gdk_drop_reply ##### -->
<para>
Accepts or rejects a drop.
</para>
<para>
This function is called by the drag destination in response
to a drop initiated by the drag source.
</para>
@context: a #GdkDragContext.
@ok: %TRUE if the drop is accepted.
@time: the timestamp for this operation.
@context:
@ok:
@time:
<!-- ##### FUNCTION gdk_drag_context_new ##### -->
<para>
Creates a new #GdkDragContext.
</para>
@Returns: the newly created #GdkDragContext.
@Returns:
<!-- ##### FUNCTION gdk_drag_drop ##### -->
<para>
Drops on the current destination.
</para>
<para>
This function is called by the drag source.
</para>
@context: a #GdkDragContext.
@time: the timestamp for this operation.
@context:
@time:
<!-- ##### FUNCTION gdk_drag_find_window ##### -->
<para>
Finds the destination window and DND protocol to use at the
given pointer position.
</para>
<para>
This function is called by the drag source to obtain the
@dest_window and @protocol parameters for gdk_drag_motion().
</para>
@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:
<!-- ##### FUNCTION gdk_drag_find_window_for_screen ##### -->
@ -112,68 +89,51 @@ This function is called by the drag source to obtain the
<!-- ##### FUNCTION gdk_drag_context_ref ##### -->
<para>
Deprecated function; use g_object_ref() instead.
</para>
@context: a #GdkDragContext.
@context:
<!-- ##### FUNCTION gdk_drag_begin ##### -->
<para>
Starts a drag and creates a new drag context for it.
</para>
<para>
This function is called by the drag source.
</para>
@window: the source window for this drag.
@targets: the list of offered targets.
@Returns: a newly created #GdkDragContext.
@window:
@targets:
@Returns:
<!-- ##### FUNCTION gdk_drag_motion ##### -->
<para>
Updates the drag context when the pointer moves or the
set of actions changes.
</para>
<para>
This function is called by the drag source.
</para>
@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:
<!-- ##### FUNCTION gdk_drop_finish ##### -->
<para>
Ends the drag operation after a drop.
</para>
<para>
This function is called by the drag destination.
</para>
@context: a #GtkDragContext.
@success: %TRUE if the data was successfully received.
@time: the timestamp for this operation.
@context:
@success:
@time:
<!-- ##### FUNCTION gdk_drag_get_protocol ##### -->
<para>
Finds out the DND protocol supported by a window.
</para>
@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:
<!-- ##### FUNCTION gdk_drag_get_protocol_for_display ##### -->
@ -204,10 +164,9 @@ which DND is done.
<!-- ##### FUNCTION gdk_drag_context_unref ##### -->
<para>
Deprecated function; use g_object_unref() instead.
</para>
@context: a #GdkDragContext.
@context:
<!-- ##### STRUCT GdkDragContext ##### -->
@ -246,16 +205,10 @@ should do with the dropped data.
<!-- ##### FUNCTION gdk_drag_status ##### -->
<para>
Selects one of the actions offered by the drag source.
</para>
<para>
This function is called by the drag destination in response to
gdk_drag_motion() called by the drag source.
</para>
@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:

View File

@ -26,6 +26,22 @@
#include <gdkdnd.h>
/**
* 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)

View File

@ -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.
*
* <example><title>Creating a custom cursor.</title>
* <programlisting>
* /* This data is in X bitmap format, and can be created with the 'bitmap'
* utility. *<!-- -->/
* &num;define cursor1_width 16
* &num;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, &amp;fg, &amp;bg, 8, 8);
* gdk_pixmap_unref (source);
* gdk_pixmap_unref (mask);
*
*
* gdk_window_set_cursor (widget->window, cursor);
* </programlisting>
* </example>
*
* Return value: a new #GdkCursor.
**/
GdkCursor*
gdk_cursor_new_from_pixmap (GdkPixmap *source,
GdkPixmap *mask,

View File

@ -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)
{