Add more documentation.

svn path=/trunk/; revision=18453
This commit is contained in:
Matthias Clasen
2007-07-12 01:55:15 +00:00
parent 8fb1dc2411
commit 37b454c5cc
4 changed files with 84 additions and 42 deletions

View File

@ -63,6 +63,20 @@ gtk_cell_editable_base_init (gpointer g_class)
if (! initialized) if (! initialized)
{ {
/**
* GtkCellEditable::editing-done:
* @cell_editable: the object on which the signal was emitted
*
* This signal is a sign for the cell renderer to update its
* value from the @cell_editable.
*
* Implementations of #GtkCellEditable are responsible for
* emitting this signal when they are done editing, e.g.
* #GtkEntry is emitting it when the user presses Enter.
*
* gtk_cell_editable_editing_done() is a convenience method
* for emitting ::editing-done.
*/
g_signal_new (I_("editing_done"), g_signal_new (I_("editing_done"),
GTK_TYPE_CELL_EDITABLE, GTK_TYPE_CELL_EDITABLE,
G_SIGNAL_RUN_LAST, G_SIGNAL_RUN_LAST,
@ -70,6 +84,23 @@ gtk_cell_editable_base_init (gpointer g_class)
NULL, NULL, NULL, NULL,
_gtk_marshal_VOID__VOID, _gtk_marshal_VOID__VOID,
G_TYPE_NONE, 0); G_TYPE_NONE, 0);
/**
* GtkCellEditable::remove-widget:
* @cell_editable: the object on which the signal was emitted
*
* This signal is meant to indicate that the cell is finished
* editing, and the widget may now be destroyed.
*
* Implementations of #GtkCellEditable are responsible for
* emitting this signal when they are done editing. It must
* be emitted after the #GtkCellEditable::editing-done signal,
* to give the cell renderer a chance to update the cell's value
* before the widget is removed.
*
* gtk_cell_editable_remove_widget() is a convenience method
* for emitting ::remove-widget.
*/
g_signal_new (I_("remove_widget"), g_signal_new (I_("remove_widget"),
GTK_TYPE_CELL_EDITABLE, GTK_TYPE_CELL_EDITABLE,
G_SIGNAL_RUN_LAST, G_SIGNAL_RUN_LAST,
@ -86,9 +117,9 @@ gtk_cell_editable_base_init (gpointer g_class)
* @cell_editable: A #GtkCellEditable * @cell_editable: A #GtkCellEditable
* @event: A #GdkEvent, or %NULL * @event: A #GdkEvent, or %NULL
* *
* Begins editing on a @cell_editable. @event is the #GdkEvent that began the * Begins editing on a @cell_editable. @event is the #GdkEvent that began
* editing process. It may be %NULL, in the instance that editing was initiated * the editing process. It may be %NULL, in the instance that editing was
* through programatic means. * initiated through programatic means.
**/ **/
void void
gtk_cell_editable_start_editing (GtkCellEditable *cell_editable, gtk_cell_editable_start_editing (GtkCellEditable *cell_editable,
@ -103,8 +134,7 @@ gtk_cell_editable_start_editing (GtkCellEditable *cell_editable,
* gtk_cell_editable_editing_done: * gtk_cell_editable_editing_done:
* @cell_editable: A #GtkTreeEditable * @cell_editable: A #GtkTreeEditable
* *
* Emits the "editing_done" signal. This signal is a sign for the cell renderer * Emits the #GtkCellEditable::editing-done signal.
* to update its value from the cell.
**/ **/
void void
gtk_cell_editable_editing_done (GtkCellEditable *cell_editable) gtk_cell_editable_editing_done (GtkCellEditable *cell_editable)
@ -118,8 +148,7 @@ gtk_cell_editable_editing_done (GtkCellEditable *cell_editable)
* gtk_cell_editable_remove_widget: * gtk_cell_editable_remove_widget:
* @cell_editable: A #GtkTreeEditable * @cell_editable: A #GtkTreeEditable
* *
* Emits the "remove_widget" signal. This signal is meant to indicate that the * Emits the #GtkCellEditable::remove-widget signal.
* cell is finished editing, and the widget may now be destroyed.
**/ **/
void void
gtk_cell_editable_remove_widget (GtkCellEditable *cell_editable) gtk_cell_editable_remove_widget (GtkCellEditable *cell_editable)

View File

@ -111,7 +111,7 @@ gtk_cell_renderer_class_init (GtkCellRendererClass *class)
* cell. For example, an editable cell renderer could be written to cancel * cell. For example, an editable cell renderer could be written to cancel
* editing when the user presses Escape. * editing when the user presses Escape.
* *
* See also: gtk_cell_renderer_editing_canceled() * See also: gtk_cell_renderer_stop_editing().
* *
* Since: 2.4 * Since: 2.4
*/ */
@ -471,12 +471,13 @@ set_cell_bg_color (GtkCellRenderer *cell,
* @width: location to return width needed to render a cell, or %NULL * @width: location to return width needed to render a cell, or %NULL
* @height: location to return height needed to render a cell, or %NULL * @height: location to return height needed to render a cell, or %NULL
* *
* Obtains the width and height needed to render the cell. Used by view widgets * Obtains the width and height needed to render the cell. Used by view
* to determine the appropriate size for the cell_area passed to * widgets to determine the appropriate size for the cell_area passed to
* gtk_cell_renderer_render(). If @cell_area is not %NULL, fills in the x and y * gtk_cell_renderer_render(). If @cell_area is not %NULL, fills in the
* offsets (if set) of the cell relative to this location. Please note that the * x and y offsets (if set) of the cell relative to this location.
* values set in @width and @height, as well as those in @x_offset and @y_offset *
* are inclusive of the xpad and ypad properties. * Please note that the values set in @width and @height, as well as those
* in @x_offset and @y_offset are inclusive of the xpad and ypad properties.
**/ **/
void void
gtk_cell_renderer_get_size (GtkCellRenderer *cell, gtk_cell_renderer_get_size (GtkCellRenderer *cell,
@ -518,7 +519,8 @@ gtk_cell_renderer_get_size (GtkCellRenderer *cell,
* @cell: a #GtkCellRenderer * @cell: a #GtkCellRenderer
* @window: a #GdkDrawable to draw to * @window: a #GdkDrawable to draw to
* @widget: the widget owning @window * @widget: the widget owning @window
* @background_area: entire cell area (including tree expanders and maybe padding on the sides) * @background_area: entire cell area (including tree expanders and maybe
* padding on the sides)
* @cell_area: area normally rendered by a cell renderer * @cell_area: area normally rendered by a cell renderer
* @expose_area: area that actually needs updating * @expose_area: area that actually needs updating
* @flags: flags that affect rendering * @flags: flags that affect rendering
@ -530,7 +532,6 @@ gtk_cell_renderer_get_size (GtkCellRenderer *cell,
* blank space around the cell, and also the area containing the tree expander; * blank space around the cell, and also the area containing the tree expander;
* so the @background_area rectangles for all cells tile to cover the entire * so the @background_area rectangles for all cells tile to cover the entire
* @window. @expose_area is a clip rectangle. * @window. @expose_area is a clip rectangle.
*
**/ **/
void void
gtk_cell_renderer_render (GtkCellRenderer *cell, gtk_cell_renderer_render (GtkCellRenderer *cell,
@ -574,14 +575,15 @@ gtk_cell_renderer_render (GtkCellRenderer *cell,
* @cell: a #GtkCellRenderer * @cell: a #GtkCellRenderer
* @event: a #GdkEvent * @event: a #GdkEvent
* @widget: widget that received the event * @widget: widget that received the event
* @path: widget-dependent string representation of the event location; e.g. for #GtkTreeView, a string representation of #GtkTreePath * @path: widget-dependent string representation of the event location;
* @background_area: background area as passed to @gtk_cell_renderer_render * e.g. for #GtkTreeView, a string representation of #GtkTreePath
* @cell_area: cell area as passed to @gtk_cell_renderer_render * @background_area: background area as passed to gtk_cell_renderer_render()
* @cell_area: cell area as passed to gtk_cell_renderer_render()
* @flags: render flags * @flags: render flags
* *
* Passes an activate event to the cell renderer for possible processing. Some * Passes an activate event to the cell renderer for possible processing.
* cell renderers may use events; for example, #GtkCellRendererToggle toggles * Some cell renderers may use events; for example, #GtkCellRendererToggle
* when it gets a mouse click. * toggles when it gets a mouse click.
* *
* Return value: %TRUE if the event was consumed/handled * Return value: %TRUE if the event was consumed/handled
**/ **/
@ -616,9 +618,10 @@ gtk_cell_renderer_activate (GtkCellRenderer *cell,
* @cell: a #GtkCellRenderer * @cell: a #GtkCellRenderer
* @event: a #GdkEvent * @event: a #GdkEvent
* @widget: widget that received the event * @widget: widget that received the event
* @path: widget-dependent string representation of the event location; e.g. for #GtkTreeView, a string representation of #GtkTreePath * @path: widget-dependent string representation of the event location;
* @background_area: background area as passed to @gtk_cell_renderer_render * e.g. for #GtkTreeView, a string representation of #GtkTreePath
* @cell_area: cell area as passed to @gtk_cell_renderer_render * @background_area: background area as passed to gtk_cell_renderer_render()
* @cell_area: cell area as passed to gtk_cell_renderer_render()
* @flags: render flags * @flags: render flags
* *
* Passes an activate event to the cell renderer for possible processing. * Passes an activate event to the cell renderer for possible processing.
@ -723,10 +726,12 @@ gtk_cell_renderer_get_fixed_size (GtkCellRenderer *cell,
* gtk_cell_renderer_editing_canceled: * gtk_cell_renderer_editing_canceled:
* @cell: A #GtkCellRenderer * @cell: A #GtkCellRenderer
* *
* Causes the cell renderer to emit the "editing-canceled" signal. This * Causes the cell renderer to emit the #GtkCellRenderer::editing-canceled
* function is for use only by implementations of cell renderers that need to * signal.
* notify the client program that an editing process was canceled and the *
* changes were not committed. * This function is for use only by implementations of cell renderers that
* need to notify the client program that an editing process was canceled
* and the changes were not committed.
* *
* Since: 2.4 * Since: 2.4
* Deprecated: 2.6: Use gtk_cell_renderer_stop_editing() instead * Deprecated: 2.6: Use gtk_cell_renderer_stop_editing() instead
@ -745,9 +750,12 @@ gtk_cell_renderer_editing_canceled (GtkCellRenderer *cell)
* @canceled: %TRUE if the editing has been canceled * @canceled: %TRUE if the editing has been canceled
* *
* Informs the cell renderer that the editing is stopped. * Informs the cell renderer that the editing is stopped.
* If @canceled is %TRUE, the cell renderer will emit the "editing-canceled" * If @canceled is %TRUE, the cell renderer will emit the
* signal. This function should be called by cell renderer implementations * #GtkCellRenderer::editing-canceled signal.
* in response to the "editing-done" signal of #GtkCellEditable. *
* This function should be called by cell renderer implementations
* in response to the #GtkCellEditable::editing-done signal of
* #GtkCellEditable.
* *
* Since: 2.6 * Since: 2.6
**/ **/

View File

@ -94,13 +94,15 @@ gtk_cell_renderer_combo_class_init (GtkCellRendererComboClass *klass)
/** /**
* GtkCellRendererCombo:text-column: * GtkCellRendererCombo:text-column:
* *
* Specifies the model column which holds the possible values for the combo box. * Specifies the model column which holds the possible values for the
* Note that this refers to the model specified in the model property, * combo box.
* <emphasis>not</emphasis> the model backing the tree view to which this cell
* renderer is attached.
* *
* #GtkCellRendererCombo automatically adds a text cell renderer for this column * Note that this refers to the model specified in the model property,
* to its combo box. * <emphasis>not</emphasis> the model backing the tree view to which
* this cell renderer is attached.
*
* #GtkCellRendererCombo automatically adds a text cell renderer for
* this column to its combo box.
* *
* Since: 2.6 * Since: 2.6
*/ */
@ -117,8 +119,8 @@ gtk_cell_renderer_combo_class_init (GtkCellRendererComboClass *klass)
/** /**
* GtkCellRendererCombo:has-entry: * GtkCellRendererCombo:has-entry:
* *
* If %TRUE, the cell renderer will include an entry and allow to enter values * If %TRUE, the cell renderer will include an entry and allow to enter
* other than the ones in the popup list. * values other than the ones in the popup list.
* *
* Since: 2.6 * Since: 2.6
*/ */

View File

@ -562,11 +562,14 @@ gtk_cell_renderer_text_class_init (GtkCellRendererTextClass *class)
/** /**
* GtkCellRendererText::edited * GtkCellRendererText::edited
* @renderer: the object which received the signal. * @renderer: the object which received the signal
* @path: the path identifying the edited cell. * @path: the path identifying the edited cell
* @new_text: the new text. * @new_text: the new text
* *
* This signal is emitted after @renderer has been edited. * This signal is emitted after @renderer has been edited.
*
* It is the responsibility of the application to update the model
* and store @new_text at the position indicated by @path.
*/ */
text_cell_renderer_signals [EDITED] = text_cell_renderer_signals [EDITED] =
g_signal_new (I_("edited"), g_signal_new (I_("edited"),