mass addition of new gtk-doc-style comments for functions, some cleanup of

2004-09-23  David Hoover <karma@deadmoose.com>
	* src/*.c: mass addition of new gtk-doc-style comments for functions,
	some cleanup of language & formatting in existing comments, minor
	whitespace fixes, etc.

	Slightly revised and committed by terra@gnome.org (Morten Welinder)
This commit is contained in:
David Hoover 2004-10-04 15:45:22 +00:00 committed by Morten Welinder
parent fe825b0663
commit e3218c5303
33 changed files with 1542 additions and 275 deletions

View File

@ -1,3 +1,10 @@
2004-09-23 David Hoover <karma@deadmoose.com>
* src/*.c: mass addition of new gtk-doc-style comments for functions,
some cleanup of language & formatting in existing comments, minor
whitespace fixes, etc.
Slightly revised and committed by terra@gnome.org (Morten Welinder)
2004-07-26 Shane Butler <shane_b@users.sourceforge.net>
* widgets/gtkbox.xml: Fixed bug with loading GtkBoxes where too

View File

@ -54,7 +54,7 @@ if (...) {
Over time we'll migrate to the preferred form.
Naming conventions:
- function names sholud be lowercase and prefixed with the
- function names should be lowercase and prefixed with the
file name (or, if the function is static and the name too long,
with an abbreviation), e.g:
glade_project_window_my_function ()

4
TODO
View File

@ -63,7 +63,7 @@ Normal tasks:
B__ C
|
\__ D
When hiding the childs of "A" and showingt htem again, the state of B and its
When hiding the childs of "A" and showing them again, the state of B and its
childs is lost, this should go into gtk+.
@ -84,7 +84,7 @@ Problems found with the gtk-spin button
- Does not emit a click up, click down signal
- If you change the max or min of the adjustment and emit an adjustment
changed signal it does not evaluates if the current value is inside the range
- The inability to be used wihtout an adjustment (clock)
- The inability to be used without an adjustment (clock)
discuss with jamesh
- How are we going to save pixmaps

View File

@ -37,7 +37,12 @@
#define GLADE_TAG_PALETTE "GladePalette"
/**
* glade_catalog_delete:
* @catalog:
*
* Frees @catalog and its associated memory.
*/
void
glade_catalog_delete (GladeCatalog *catalog)
{
@ -158,6 +163,13 @@ lblError:
return NULL;
}
/**
* glade_catalog_load_all:
*
* TODO: write me
*
* Returns:
*/
GList *
glade_catalog_load_all (void)
{
@ -202,15 +214,28 @@ glade_catalog_load_all (void)
return catalogs;
}
const char *glade_catalog_get_title (GladeCatalog *catalog)
/**
* glade_catalog_get_title:
* @catalog: a #GladeCatalog
*
* Returns: a pointer to the title of @catalog
*/
const char *
glade_catalog_get_title (GladeCatalog *catalog)
{
g_return_val_if_fail (catalog != NULL, NULL);
return catalog->title;
}
GList *glade_catalog_get_widget_classes (GladeCatalog *catalog)
/**
* glade_catalog_get_widget_classes:
* @catalog: a #GladeCatalog
*
* Returns: a #GList containing the widget classes in @catalog
*/
GList *
glade_catalog_get_widget_classes (GladeCatalog *catalog)
{
g_return_val_if_fail (catalog != NULL, NULL);
return catalog->widget_classes;
}

View File

@ -26,6 +26,11 @@
#include "glade-xml-utils.h"
#include "glade-choice.h"
/**
* glade_choice_new:
*
* Returns: a new #GladeChoice
*/
GladeChoice *
glade_choice_new (void)
{
@ -36,6 +41,12 @@ glade_choice_new (void)
return choice;
}
/**
* glade_choice_clone:
* @choice: a #GladeChoice
*
* Returns: a new #GladeChoice cloned from @choice
*/
GladeChoice *
glade_choice_clone (GladeChoice *choice)
{
@ -50,6 +61,12 @@ glade_choice_clone (GladeChoice *choice)
return clone;
}
/**
* glade_choice_free:
* @choice: a #GladeChoice
*
* Frees @choice and its associated memory.
*/
void
glade_choice_free (GladeChoice *choice)
{
@ -159,6 +176,14 @@ glade_choice_new_from_value (GEnumValue value)
return choice;
}
/**
* glade_choice_list_new_from_spec:
* @spec: a #GParamSpec
*
* TODO: write me
*
* Returns:
*/
GList *
glade_choice_list_new_from_spec (GParamSpec *spec)
{
@ -213,6 +238,14 @@ glade_choice_new_from_node (GladeXmlNode *node)
return choice;
}
/**
* glade_choice_list_new_from_node:
* @node: a #GladeXmlNode
*
* TODO: write me
*
* Returns:
*/
GList *
glade_choice_list_new_from_node (GladeXmlNode *node)
{

View File

@ -34,21 +34,23 @@ struct _GladeChoice {
*/
gchar *id;
#if 0
gchar *symbol; /* Symbol for the choice. Like GTK_WINDOW_TOPLEVEL (which
* is an integer) or GNOME_STOCK_BUTTON_FOO (which is
* not an integer). For integers which are enum'ed values
* this symbol is converted to its value
gchar *symbol; /* Symbol for the choice. Like GTK_WINDOW_TOPLEVEL
* (which is an integer) or GNOME_STOCK_BUTTON_FOO
* (which is not an integer). For integers which are
* enum'ed values this symbol is converted to its
* value
*/
#endif
gint value; /* The enum value of the symbol. The symbol GTK_WINDOW_
* TOPLEVEL will be 0 and GTK_WINDOW_POPUP will be 1
gint value; /* The enum value of the symbol. The symbol
* GTK_WINDOW_TOPLEVEL will be 0 and GTK_WINDOW_POPUP
* will be 1
*/
#if 0
const gchar *string; /* For non-integer values like GNOME_STOCK_BUTTON_OK
* it points to a string inside the library that
* contains it.
const gchar *string; /* For non-integer values like
* GNOME_STOCK_BUTTON_OK it points to a string
* inside the library that contains it.
* See glade-choice.c#glade_string_from_sring
*/
#endif

View File

@ -43,6 +43,13 @@ glade_clipboard_view_init (GladeClipboardView *view)
view->model = NULL;
}
/**
* glade_clipboard_view_get_type:
*
* Creates the typecode for the #GladeClipboardView object type.
*
* Returns: the typecode for the #GladeClipboardView object type
*/
GType
glade_clipboard_view_get_type ()
{
@ -192,12 +199,12 @@ glade_clipboard_view_construct (GladeClipboardView *view)
/**
* glade_clipboard_view_new:
* @clipboard
* @clipboard: a #GladeClipboard
*
* Create a new #GladeClipboardView widget.
* Create a new #GladeClipboardView widget for @clipboard.
*
* Return Value: a #GtkWidget.
**/
* Returns: a new #GladeClipboardView cast to be a #GtkWidget
*/
GtkWidget *
glade_clipboard_view_new (GladeClipboard *clipboard)
{
@ -212,6 +219,13 @@ glade_clipboard_view_new (GladeClipboard *clipboard)
return GTK_WIDGET (view);
}
/**
* glade_clipboard_view_add:
* @view: a #GladeClipboardView
* @widget: a #GladeWidget
*
* Adds @widget to @view.
*/
void
glade_clipboard_view_add (GladeClipboardView *view, GladeWidget *widget)
{
@ -224,6 +238,13 @@ glade_clipboard_view_add (GladeClipboardView *view, GladeWidget *widget)
gtk_list_store_set (view->model, &iter, 0, widget, -1);
}
/**
* glade_cliboard_view_remove:
* @view: a #GladeClipboardView
* @widget: a #GladeWidget
*
* Removes @widget from @view.
*/
void
glade_clipboard_view_remove (GladeClipboardView *view, GladeWidget *widget)
{
@ -245,4 +266,3 @@ glade_clipboard_view_remove (GladeClipboardView *view, GladeWidget *widget)
gtk_list_store_remove (view->model, &iter);
}

View File

@ -47,10 +47,10 @@ glade_clipboard_init (GladeClipboard *clipboard)
/**
* glade_clipboard_get_type:
*
* Creates the typecode for the GladeClipboard object type.
* Creates the typecode for the #GladeClipboard object type.
*
* Return value: the typecode for the GladeClipboard object type.
**/
* Returns: the typecode for the #GladeClipboard object type
*/
GType
glade_clipboard_get_type ()
{
@ -78,12 +78,9 @@ glade_clipboard_get_type ()
/**
* glade_clipboard_new:
* @:
*
* Create a new @GladeClipboard object.
*
* Return Value: a @GladeClipboard object.
**/
* Returns: a new #GladeClipboard object
*/
GladeClipboard *
glade_clipboard_new ()
{
@ -92,11 +89,12 @@ glade_clipboard_new ()
/**
* glade_clipboard_add:
* @clipboard:
* @widget:
* @clipboard: a #GladeClipboard
* @widget: a #GladeWidget
*
* Move a GladeWidget onto the Clipboard.
**/
* Adds @widget to @clipboard.
* This increses the reference count of @widget.
*/
void
glade_clipboard_add (GladeClipboard *clipboard, GladeWidget *widget)
{
@ -117,11 +115,11 @@ glade_clipboard_add (GladeClipboard *clipboard, GladeWidget *widget)
/**
* glade_clipboard_remove:
* @clipboard:
* @widget:
* @clipboard: a #GladeClipboard
* @widget: a #GladeWidget
*
* Remove a GladeWidget from the Clipboard
**/
* Removes a @widget from @clipboard.
*/
void
glade_clipboard_remove (GladeClipboard *clipboard, GladeWidget *widget)
{
@ -142,4 +140,3 @@ glade_clipboard_remove (GladeClipboard *clipboard, GladeWidget *widget)
if (clipboard->view)
glade_clipboard_view_remove (GLADE_CLIPBOARD_VIEW (clipboard->view), widget);
}

View File

@ -143,6 +143,12 @@ static MAKE_TYPE(func, type, GLADE_TYPE_COMMAND)
/**************************************************/
/**
* glade_command_undo:
* @project: a #GladeProject
*
* Undoes the last command performed in @project.
*/
void
glade_command_undo (GladeProject *project)
{
@ -168,6 +174,12 @@ glade_command_undo (GladeProject *project)
project->prev_redo_item = prev_redo_item->prev;
}
/**
* glade_command_redo:
* @project: a #GladeProject
*
* Redoes the last undone command in @project.
*/
void
glade_command_redo (GladeProject *project)
{
@ -285,8 +297,8 @@ glade_command_set_property_undo (GladeCommand *cmd)
}
/**
* Execute the set property command and revert it. Ie, after the execution of this
* function cmd will point to the undo action
* Execute the set property command and revert it. IE, after the execution of
* this function cmd will point to the undo action
*/
static gboolean
glade_command_set_property_execute (GladeCommand *cmd)
@ -677,6 +689,12 @@ glade_command_create_delete_common (GladeWidget *widget,
glade_command_push_undo (widget->project, GLADE_COMMAND (me));
}
/**
* glade_command_delete:
* @widget: a #GladeWidget
*
* TODO: write me
*/
void
glade_command_delete (GladeWidget *widget)
{
@ -695,6 +713,14 @@ glade_command_delete (GladeWidget *widget)
* the new widget will be assigned to (if NULL, the project will be extracted
* from the placeholder).
*/
/**
* glade_command_create:
* @class:
* @placeholder:
* @project:
*
* TODO: write me
*/
void
glade_command_create (GladeWidgetClass *class,
GladePlaceholder *placeholder,
@ -929,6 +955,12 @@ glade_command_paste (GladePlaceholder *placeholder)
glade_command_cut_paste_common (widget, placeholder, parent->project, FALSE);
}
/**
* glade_command_cut:
* @widget: a #GladeWidget
*
* TODO: write me
*/
void
glade_command_cut (GladeWidget *widget)
{
@ -1014,7 +1046,7 @@ glade_command_add_signal_collapse (GladeCommand *this, GladeCommand *other)
}
static void
glade_command_add_remove_signal(GladeWidget *glade_widget, const GladeSignal *signal, gboolean add)
glade_command_add_remove_signal (GladeWidget *glade_widget, const GladeSignal *signal, gboolean add)
{
GladeCommandAddSignal *me = GLADE_COMMAND_ADD_SIGNAL (g_object_new (GLADE_COMMAND_ADD_SIGNAL_TYPE, NULL));
GladeCommand *cmd = GLADE_COMMAND (me);
@ -1037,14 +1069,28 @@ glade_command_add_remove_signal(GladeWidget *glade_widget, const GladeSignal *si
glade_command_push_undo (glade_widget->project, cmd);
}
/**
* glade_command_add_signal:
* @glade_widget: a #GladeWidget
* @signal: a #GladeSignal
*
* TODO: write me
*/
void
glade_command_add_signal(GladeWidget *glade_widget, const GladeSignal *signal)
glade_command_add_signal (GladeWidget *glade_widget, const GladeSignal *signal)
{
glade_command_add_remove_signal (glade_widget, signal, TRUE);
}
/**
* glade_command_remove_signal:
* @glade_widget: a #GladeWidget
* @signal: a #GladeSignal
*
* TODO: write me
*/
void
glade_command_remove_signal(GladeWidget *glade_widget, const GladeSignal *signal)
glade_command_remove_signal (GladeWidget *glade_widget, const GladeSignal *signal)
{
glade_command_add_remove_signal (glade_widget, signal, FALSE);
}

View File

@ -25,6 +25,13 @@
GladeCursor *cursor = NULL;
/**
* glade_cursor_set:
* @window: a #GdkWindow
* @type: a #GladeCursorType
*
* Sets the cursor for @window to something appropriate based on @type.
*/
void
glade_cursor_set (GdkWindow *window, GladeCursorType type)
{
@ -41,6 +48,11 @@ glade_cursor_set (GdkWindow *window, GladeCursorType type)
}
/**
* glade_cursor_init:
*
* Initializes cursors for use with glade_cursor_set().
*/
void
glade_cursor_init (void)
{

View File

@ -38,7 +38,7 @@ glade_log_handler (const char *domain,
const char *message,
gpointer data)
{
static volatile int want_breakpoint = 1;
static volatile int want_breakpoint = 0;
g_log_default_handler (domain, level, message, data);
if (want_breakpoint && ((level & (G_LOG_LEVEL_CRITICAL /* | G_LOG_LEVEL_WARNING */)) != 0))
@ -51,6 +51,12 @@ glade_set_log_handler (const char *domain)
g_log_set_handler (domain, G_LOG_LEVEL_MASK, glade_log_handler, NULL);
}
/**
* glade_setup_log_handlers:
*
* Sets up a log handler to manage all %G_LOG_LEVEL_MASK errors of domain:
* GLib, GLib-GObject, Gtk, Gdk, and domainless.
*/
void
glade_setup_log_handlers ()
{

View File

@ -109,6 +109,13 @@ glade_editor_marshal_VOID__STRING_ULONG_UINT_STRING (GClosure *closure,
data2);
}
/**
* glade_editor_get_type:
*
* Creates the typecode for the #GladeEditor object type.
*
* Returns: the typecode for the #GladeEditor object type
*/
GType
glade_editor_get_type (void)
{
@ -156,6 +163,15 @@ glade_editor_class_init (GladeEditorClass *class)
class->add_signal = NULL;
}
/**
* glade_editor_notebook_page:
* @name:
* @notebook:
*
* TODO: write me
*
* Returns:
*/
GtkWidget *
glade_editor_notebook_page (const gchar *name, GtkWidget *notebook)
{
@ -194,6 +210,11 @@ glade_editor_init (GladeEditor *editor)
editor->loading = FALSE;
}
/**
* glade_editor_new:
*
* Returns: a new #GladeEditor
*/
GladeEditor *
glade_editor_new ()
{
@ -231,7 +252,7 @@ glade_editor_widget_name_changed (GtkWidget *editable, GladeEditor *editor)
g_free (new_name);
}
/* ================================ Property Changed ==================================== */
/* ============================ Property Changed ============================ */
static void
glade_editor_property_changed_text_common (GladeProperty *property,
const gchar *text)
@ -642,7 +663,7 @@ glade_editor_property_show_flags_dialog (GtkWidget *entry,
gtk_widget_destroy (dialog);
}
/* ================================ Create inputs ==================================== */
/* ============================= Create inputs ============================= */
static GtkWidget *
glade_editor_create_input_enum_item (GladeEditorProperty *property,
GladeChoice *choice)
@ -864,6 +885,14 @@ glade_editor_create_input_object (GladeEditorProperty *property,
return NULL;
}
/**
* glade_editor_create_item_labe:
* @class:
*
* TODO: write me
*
* Returns:
*/
GtkWidget *
glade_editor_create_item_label (GladePropertyClass *class)
{
@ -1198,6 +1227,12 @@ glade_editor_load_common_page (GladeEditor *editor, GladeWidgetClass *class)
FALSE, TRUE, 0);
}
/**
* glade_editor_update_widget_name:
* @editor: a #GladeEditor
*
* TODO: write me
*/
void
glade_editor_update_widget_name (GladeEditor *editor)
{
@ -1229,7 +1264,7 @@ glade_editor_load_widget_class (GladeEditor *editor, GladeWidgetClass *class)
editor->loaded_class = class;
}
/* ================================ Load properties ================================== */
/* ============================ Load properties ============================ */
static void
glade_editor_property_set_tooltips (GladeEditorProperty *property)
{
@ -1632,11 +1667,11 @@ glade_editor_load_packing_page (GladeEditor *editor, GladeWidget *widget)
/**
* glade_editor_load_widget:
* @editor:
* @widget:
* @editor: a #GladeEditor
* @widget: a #GladeWidget
*
* Load @widget into the editor, if widget is NULL clear the editor.
**/
* Load @widget into @editor. If @widget is %NULL, clear the editor.
*/
void
glade_editor_load_widget (GladeEditor *editor, GladeWidget *widget)
{
@ -1690,6 +1725,14 @@ glade_editor_load_widget (GladeEditor *editor, GladeWidget *widget)
editor->loading = FALSE;
}
/**
* glade_editor_add_signal:
* @editor: a #GladeEditor
* @signal_id:
* @callback_name:
*
* TODO: write me
*/
void
glade_editor_add_signal (GladeEditor *editor,
guint signal_id,
@ -1711,4 +1754,3 @@ glade_editor_add_signal (GladeEditor *editor,
glade_editor_signals [ADD_SIGNAL], 0,
widget_name, widget_type, signal_id, callback_name);
}

View File

@ -57,6 +57,13 @@
#define GLADEGTK_API
#endif
/**
* glade_gtk_option_menu_set_items:
* @object:
* @value:
*
* TODO: write me
*/
void GLADEGTK_API
glade_gtk_option_menu_set_items (GObject *object, GValue *value)
{
@ -95,6 +102,12 @@ glade_gtk_option_menu_set_items (GObject *object, GValue *value)
gtk_option_menu_set_menu (GTK_OPTION_MENU (option_menu), menu);
}
/**
* glade_gtk_widget_condition:
* @klass:
*
* TODO: write me
*/
int GLADEGTK_API
glade_gtk_widget_condition (GladeWidgetClass *klass)
{
@ -116,6 +129,13 @@ glade_gtk_widget_condition (GladeWidgetClass *klass)
}
}
/**
* glade_gtk-widget_set_tooltip:
* @object:
* @value:
*
* TODO: write me
*/
void GLADEGTK_API
glade_gtk_widget_set_tooltip (GObject *object, GValue *value)
{
@ -132,6 +152,13 @@ glade_gtk_widget_set_tooltip (GObject *object, GValue *value)
gtk_tooltips_set_tip (tooltips, GTK_WIDGET (object), NULL, NULL);
}
/**
* glade_gtk-widget_get_tooltip:
* @object:
* @value:
*
* TODO: write me
*/
void GLADEGTK_API
glade_gtk_widget_get_tooltip (GObject *object, GValue *value)
{
@ -141,6 +168,13 @@ glade_gtk_widget_get_tooltip (GObject *object, GValue *value)
g_value_set_string (value, tooltips_data->tip_text);
}
/**
* glade_gtk_progress_bar_set_format:
* @object:
* @value:
*
* TODO: write me
*/
void GLADEGTK_API
glade_gtk_progress_bar_set_format (GObject *object, GValue *value)
{
@ -153,6 +187,13 @@ glade_gtk_progress_bar_set_format (GObject *object, GValue *value)
gtk_progress_set_format_string (GTK_PROGRESS (bar), format);
}
/**
* glade_gtk_spin_button_set_max:
* @object:
* @value:
*
* TODO: write me
*/
void GLADEGTK_API
glade_gtk_spin_button_set_max (GObject *object, GValue *value)
{
@ -164,7 +205,13 @@ glade_gtk_spin_button_set_max (GObject *object, GValue *value)
gtk_adjustment_changed (adjustment);
}
/**
* glade_gtk_spin_button_set_min:
* @object:
* @value:
*
* TODO: write me
*/
void GLADEGTK_API
glade_gtk_spin_button_set_min (GObject *object, GValue *value)
{
@ -176,6 +223,13 @@ glade_gtk_spin_button_set_min (GObject *object, GValue *value)
gtk_adjustment_changed (adjustment);
}
/**
* glade_gtk_spin_button_set_step_increment:
* @object:
* @value:
*
* TODO: write me
*/
void GLADEGTK_API
glade_gtk_spin_button_set_step_increment (GObject *object, GValue *value)
{
@ -187,6 +241,13 @@ glade_gtk_spin_button_set_step_increment (GObject *object, GValue *value)
gtk_adjustment_changed (adjustment);
}
/**
* glade_gtk_spin_button_set_page_increment:
* @object:
* @value:
*
* TODO: write me
*/
void GLADEGTK_API
glade_gtk_spin_button_set_page_increment (GObject *object, GValue *value)
{
@ -198,6 +259,13 @@ glade_gtk_spin_button_set_page_increment (GObject *object, GValue *value)
gtk_adjustment_changed (adjustment);
}
/**
* glade_gtk_spin_button_set_page_size:
* @object:
* @value:
*
* TODO: write me
*/
void GLADEGTK_API
glade_gtk_spin_button_set_page_size (GObject *object, GValue *value)
{
@ -209,7 +277,13 @@ glade_gtk_spin_button_set_page_size (GObject *object, GValue *value)
gtk_adjustment_changed (adjustment);
}
/**
* glade_gtk_box_get_size:
* @object:
* @value:
*
* TODO: write me
*/
void GLADEGTK_API
glade_gtk_box_get_size (GObject *object, GValue *value)
{
@ -219,6 +293,13 @@ glade_gtk_box_get_size (GObject *object, GValue *value)
g_value_set_int (value, g_list_length (box->children));
}
/**
* glade_gtk_box_set_size:
* @object:
* @value:
*
* TODO: write me
*/
void GLADEGTK_API
glade_gtk_box_set_size (GObject *object, GValue *value)
{
@ -274,6 +355,13 @@ glade_gtk_box_set_size (GObject *object, GValue *value)
g_object_set_data (object, "glade_nb_placeholders", GINT_TO_POINTER (new_size));
}
/**
* glade_gtk_toolbar_get_size:
* @object:
* @value:
*
* TODO: write me
*/
void GLADEGTK_API
glade_gtk_toolbar_get_size (GObject *object, GValue *value)
{
@ -287,6 +375,13 @@ glade_gtk_toolbar_get_size (GObject *object, GValue *value)
g_value_set_int (value, toolbar->num_children);
}
/**
* glade_gtk_toolbar_set_size:
* @object:
* @value:
*
* TODO: write me
*/
void GLADEGTK_API
glade_gtk_toolbar_set_size (GObject *object, GValue *value)
{
@ -332,6 +427,13 @@ glade_gtk_toolbar_set_size (GObject *object, GValue *value)
}
}
/**
* glade_gtk_notebook_get_n_pages:
* @object:
* @value:
*
* TODO: write me
*/
void GLADEGTK_API
glade_gtk_notebook_get_n_pages (GObject *object, GValue *value)
{
@ -345,6 +447,13 @@ glade_gtk_notebook_get_n_pages (GObject *object, GValue *value)
g_value_set_int (value, g_list_length (notebook->children));
}
/**
* glade_gtk_notebook_set_n_pages:
* @object:
* @value:
*
* TODO: write me
*/
void GLADEGTK_API
glade_gtk_notebook_set_n_pages (GObject *object, GValue *value)
{
@ -402,6 +511,13 @@ glade_gtk_notebook_set_n_pages (GObject *object, GValue *value)
}
}
/**
* glade_gtk_notebook_set_n_common:
* @object:
* @value:
*
* TODO: write me
*/
void GLADEGTK_API
glade_gtk_table_set_n_common (GObject *object, GValue *value, gboolean for_rows)
{
@ -473,18 +589,39 @@ glade_gtk_table_set_n_common (GObject *object, GValue *value, gboolean for_rows)
g_object_set_data (object, "glade_nb_placeholders", GINT_TO_POINTER (new_size * (for_rows ? table->ncols : table->nrows)));
}
/**
* glade_gtk_table_set_n_rows:
* @object:
* @value:
*
* TODO: write me
*/
void GLADEGTK_API
glade_gtk_table_set_n_rows (GObject *object, GValue *value)
{
glade_gtk_table_set_n_common (object, value, TRUE);
}
/**
* glade_gtk_table_set_n_columns:
* @object:
* @value:
*
* TODO: write me
*/
void GLADEGTK_API
glade_gtk_table_set_n_columns (GObject *object, GValue *value)
{
glade_gtk_table_set_n_common (object, value, FALSE);
}
/**
* glade_gtk_button_set_stock:
* @object:
* @value:
*
* TODO: write me
*/
void GLADEGTK_API
glade_gtk_button_set_stock (GObject *object, GValue *value)
{
@ -552,6 +689,13 @@ glade_gtk_button_set_stock (GObject *object, GValue *value)
}
}
/**
* glade_gtk_statusbar_get_has_resize_grip:
* @object:
* @value:
*
* TODO: write me
*/
void GLADEGTK_API
glade_gtk_statusbar_get_has_resize_grip (GObject *object, GValue *value)
{
@ -565,6 +709,13 @@ glade_gtk_statusbar_get_has_resize_grip (GObject *object, GValue *value)
g_value_set_boolean (value, gtk_statusbar_get_has_resize_grip (statusbar));
}
/**
* glade_gtk_statusbar_set_has_resize_grip:
* @object:
* @value:
*
* TODO: write me
*/
void GLADEGTK_API
glade_gtk_statusbar_set_has_resize_grip (GObject *object, GValue *value)
{
@ -578,26 +729,54 @@ glade_gtk_statusbar_set_has_resize_grip (GObject *object, GValue *value)
gtk_statusbar_set_has_resize_grip (statusbar, has_resize_grip);
}
/**
* empty:
* @object: a #GObject
* @value: a #GValue
*
* This function does absolutely nothing
*/
void GLADEGTK_API
empty (GObject *object, GValue *value)
{
}
/**
* ignore:
* @object: a #GObject
* @value: a #GValue
*
* This function does absolutely nothing
*/
void GLADEGTK_API
ignore (GObject *object, GValue *value)
{
}
/* ------------------------------------ Pre Create functions ------------------------------ */
/* a GtkTable starts with a default size of 1x1, and setter/getter of rows/columns expect
* the GtkTable to hold this number of placeholders, so we should add it */
/* -------------------------- Pre Create functions -------------------------- */
/* a GtkTable starts with a default size of 1x1, and setter/getter of
* rows/columns expect * the GtkTable to hold this number of placeholders, so
* we should add it
*/
/**
* glade_gtk_table_pre_create:
* @object:
*
* TODO: write me
*/
void GLADEGTK_API
glade_gtk_table_pre_create (GObject *object)
{
gtk_table_attach_defaults (GTK_TABLE (object), glade_placeholder_new (), 0, 1, 0, 1);
}
/**
* glade_gtk_tree_pre_create:
* @object:
*
* TODO: write me
*/
void GLADEGTK_API
glade_gtk_tree_view_pre_create (GObject *object)
{
@ -618,7 +797,7 @@ glade_gtk_tree_view_pre_create (GObject *object)
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), column);
}
/* ------------------------------------ Post Create functions ------------------------------ */
/* ------------------------- Post Create functions ------------------------- */
static int
ask_for_number (const char *title, const char *name, int min, int max, int def)
{
@ -656,6 +835,12 @@ ask_for_number (const char *title, const char *name, int min, int max, int def)
return number;
}
/**
* glade_gtk_box_post_create:
* @object:
*
* TODO: write me
*/
void GLADEGTK_API
glade_gtk_box_post_create (GObject *object)
{
@ -668,6 +853,12 @@ glade_gtk_box_post_create (GObject *object)
glade_property_set (property, &value);
}
/**
* glade_gtk_notebook_post_create:
* @object:
*
* TODO: write me
*/
void GLADEGTK_API
glade_gtk_notebook_post_create (GObject *object)
{
@ -678,6 +869,12 @@ glade_gtk_notebook_post_create (GObject *object)
g_value_set_int (&value, ask_for_number(_("Create a notebook"), _("Number of pages:"), 0, 100, 3));
}
/**
* glade_gtk_table_post_create:
* @object:
*
* TODO: write me
*/
void GLADEGTK_API
glade_gtk_table_post_create (GObject *object)
{
@ -734,6 +931,12 @@ glade_gtk_table_post_create (GObject *object)
gtk_widget_destroy (dialog);
}
/**
* glade_gtk_window_post_create:
* @object:
*
* TODO: write me
*/
void GLADEGTK_API
glade_gtk_window_post_create (GObject *object)
{
@ -744,6 +947,12 @@ glade_gtk_window_post_create (GObject *object)
gtk_window_set_default_size (window, 440, 250);
}
/**
* glade_gtk_dialog_post_create:
* @object:
*
* TODO: write me
*/
void GLADEGTK_API
glade_gtk_dialog_post_create (GObject *object)
{
@ -782,6 +991,12 @@ glade_gtk_dialog_post_create (GObject *object)
gtk_window_set_default_size (GTK_WINDOW (dialog), 320, 260);
}
/**
* glade_gtk_message_dialog_post_create:
* @object:
*
* TODO: write me
*/
void GLADEGTK_API
glade_gtk_message_dialog_post_create (GObject *object)
{
@ -816,7 +1031,15 @@ glade_gtk_table_post_create (GObject *object)
}
#endif
/* --------------------------------- Replace child functions ------------------------------- */
/* ------------------------ Replace child functions ------------------------ */
/**
* glade_gtk_container_replace_child:
* @current:
* @new:
* @container:
*
* TODO: write me
*/
void GLADEGTK_API
glade_gtk_container_replace_child (GtkWidget *current,
GtkWidget *new,
@ -871,6 +1094,14 @@ glade_gtk_container_replace_child (GtkWidget *current,
#endif
}
/**
* glade_gtk_notebook_replace_child:
* @current:
* @new:
* @container:
*
* TODO: write me
*/
void GLADEGTK_API
glade_gtk_notebook_replace_child (GtkWidget *current,
GtkWidget *new,
@ -911,7 +1142,13 @@ glade_gtk_notebook_replace_child (GtkWidget *current,
gtk_notebook_set_current_page (notebook, page_num);
}
/* ------------------------------------ Fill Empty functions ------------------------------- */
/* -------------------------- Fill Empty functions -------------------------- */
/**
* glade_gtk_container_fill_empty:
* @container:
*
* TODO: write me
*/
void GLADEGTK_API
glade_gtk_container_fill_empty (GObject *container)
{
@ -920,6 +1157,12 @@ glade_gtk_container_fill_empty (GObject *container)
gtk_container_add (GTK_CONTAINER (container), glade_placeholder_new ());
}
/**
* glade_gtk_dialog_fill_empty:
* @dialog:
*
* TODO: write me
*/
void GLADEGTK_API
glade_gtk_dialog_fill_empty (GObject *dialog)
{
@ -930,6 +1173,12 @@ glade_gtk_dialog_fill_empty (GObject *dialog)
glade_placeholder_new ());
}
/**
* glade_gtk_paned_fill_empty:
* @paned:
*
* TODO: write me
*/
void GLADEGTK_API
glade_gtk_paned_fill_empty (GObject *paned)
{
@ -939,7 +1188,15 @@ glade_gtk_paned_fill_empty (GObject *paned)
gtk_paned_add2 (GTK_PANED (paned), glade_placeholder_new ());
}
/* -------------------------------- Get Internal Child functions --------------------------- */
/* ---------------------- Get Internal Child functions ---------------------- */
/**
* glade_gtk_dialog_get_internal_child:
* @dialog:
* @name:
* @child:
*
* TODO: write me
*/
void GLADEGTK_API
glade_gtk_dialog_get_internal_child (GtkWidget *dialog,
const gchar *name,
@ -959,6 +1216,16 @@ glade_gtk_dialog_get_internal_child (GtkWidget *dialog,
*child = child_widget;
}
/**
* glade_gtk_dialog_child_property_applies:
* @ancestor:
* @widget:
* @property_id:
*
* TODO: write me
*
* Returns:
*/
int GLADEGTK_API
glade_gtk_dialog_child_property_applies (GtkWidget *ancestor,
GtkWidget *widget,
@ -977,4 +1244,3 @@ glade_gtk_dialog_child_property_applies (GtkWidget *ancestor,
return FALSE;
}

View File

@ -27,6 +27,11 @@
#define INITIAL_WORDS 4
/**
* glade_id_allocator_new:
*
* Returns: a new #GladeIDAllocator
*/
GladeIDAllocator *
glade_id_allocator_new (void)
{
@ -39,6 +44,12 @@ glade_id_allocator_new (void)
return allocator;
}
/**
* glade_id_allocator_free:
* @allocator: a #GladeIDAllocator
*
* Frees @allocator and its associated memory
*/
void
glade_id_allocator_free (GladeIDAllocator *allocator)
{
@ -79,7 +90,13 @@ first_set_bit (guint32 word)
return result + table[word & 0xf];
}
/**
* glade_id_allocator_alloc:
* @allocator: a #GladeIDAllocator
*
* TODO: write me
* Returns:
*/
guint
glade_id_allocator_alloc (GladeIDAllocator *allocator)
{
@ -109,6 +126,13 @@ glade_id_allocator_alloc (GladeIDAllocator *allocator)
}
}
/**
* glade_id_allocator_release:
* @allocator:
* @id:
*
* TODO: write me
*/
void
glade_id_allocator_release (GladeIDAllocator *allocator,
guint id)
@ -117,7 +141,7 @@ glade_id_allocator_release (GladeIDAllocator *allocator,
allocator->data[id >> 5] |= 1 << (id & 31);
}
/* test of allocator
#ifdef GLADE_ID_ALLOCATOR_TEST
int main (int argc, char **argv)
{
GladeIDAllocator *allocator = glade_id_allocator_new ();
@ -146,4 +170,4 @@ int main (int argc, char **argv)
return 0;
}
*/
#endif

View File

@ -1401,10 +1401,10 @@ static GtkDialogClass *parent_class;
/**
* glade_keys_dialog_get_type:
*
* Creates the typecode for the GladeKeysDialog object type.
* Creates the typecode for the #GladeKeysDialog object type.
*
* Return value: the typecode for the GladeKeysDialog object type.
**/
* Returns: the typecode for the #GladeKeysDialog object type
*/
GType
glade_keys_dialog_get_type (void)
{
@ -1525,7 +1525,9 @@ glade_keys_dialog_init (GladeKeysDialog *dialog)
* glade_keys_dialog_new:
*
* Creates a dialog to select an accelerator key.
**/
*
* Returns: the new dialog cast as a #GtkWidget
*/
GtkWidget *
glade_keys_dialog_new (void)
{
@ -1538,11 +1540,13 @@ glade_keys_dialog_new (void)
/**
* glade_keys_dialog_get_selected_key_symbol:
* @dialog: a #GladeKeysDialog
*
* Retrieves the currently selected key. Returns NULL if no key is selected.
* You are supposed to run this after having received an OK response from
* the dialog.
**/
* Retrieves the selected key in @dialog. You are supposed to run this after
* having received an OK response from the dialog.
*
* Returns: the currently selected key, or %NULL if none is selected
*/
gchar *
glade_keys_dialog_get_selected_key_symbol (GladeKeysDialog *dialog)
{
@ -1561,4 +1565,3 @@ glade_keys_dialog_get_selected_key_symbol (GladeKeysDialog *dialog)
return key_sym;
}

View File

@ -104,6 +104,13 @@ static void glade_menu_editor_destroy (GtkObject *object);
static GtkWindowClass *parent_class = NULL;
/**
* glade_menu_editor_get_type:
*
* Creates the typecode for the #GladeMenuEditor object type.
*
* Returns: the typecode for the #GladeMenuEditor object type
*/
GType
glade_menu_editor_get_type (void)
{
@ -3167,10 +3174,16 @@ glade_menu_editor_set_menu (GladeMenuEditor *menued, GtkMenuShell *menu)
}
/**
* glade_menu_editor_new:
* @project:
* @menu:
*
* This creates a menu editor to edit the given menubar or popup menu in
* the given project. When the user selects the 'OK' or 'Apply' buttons,
* the menu widget will be updated. If the menu is destroyed, the menu editor
* is automatically destroyed as well.
*
* Returns: a new #GtkMenuEditor, cast as a #GtkWidget
*/
GtkWidget*
glade_menu_editor_new (GladeProject *project, GtkMenuShell *menu)
@ -3209,4 +3222,3 @@ glade_menu_editor_reset (GladeMenuEditor *menued)
gtk_list_clear_items (GTK_LIST (GTK_COMBO (menued->group_combo)->list),
0, -1);
}

View File

@ -50,6 +50,13 @@ static guint glade_palette_signals[LAST_SIGNAL] = {0};
static GtkWindowClass *parent_class = NULL;
/**
* glade_palette_get_type:
*
* Creates the typecode for the #GladePalette object type.
*
* Returns: the typecode for the #GladePalette object type
*/
GType
glade_palette_get_type (void)
{
@ -312,6 +319,13 @@ glade_palette_on_catalog_button_toggled (GtkWidget *button,
return TRUE;
}
/**
* glade_palette_append_catalog:
* @palette: a #GladePalette
* @catalog: a #GladeCatalog
*
* TODO: write me
*/
void
glade_palette_append_catalog (GladePalette *palette, GladeCatalog *catalog)
{
@ -341,6 +355,14 @@ glade_palette_append_catalog (GladePalette *palette, GladeCatalog *catalog)
gtk_widget_show (palette->notebook);
}
/**
* glade_palette_new:
* @catalogs:
*
* TODO: write me
*
* Returns:
*/
GladePalette *
glade_palette_new (GList *catalogs)
{
@ -356,6 +378,12 @@ glade_palette_new (GList *catalogs)
return palette;
}
/**
* glade_palette_unselect_widget:
* @palette:
*
* TODO: write me
*/
void
glade_palette_unselect_widget (GladePalette *palette)
{
@ -363,4 +391,3 @@ glade_palette_unselect_widget (GladePalette *palette)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (palette->selector), TRUE);
}

View File

@ -28,6 +28,15 @@
#include "glade-parameter.h"
#include "glade-property-class.h"
/**
* glade_parameter_get_integer:
* @parameters: a #GList of #GladeParameters
* @key: a string containing the parameter name
* @value: a pointer to a #gint
*
* Searches through @parameters looking for a #GladeParameter named @key. If
* found, it stores a #gint representation of its value into @value.
*/
void
glade_parameter_get_integer (GList *parameters, const gchar *key, gint *value)
{
@ -44,6 +53,15 @@ glade_parameter_get_integer (GList *parameters, const gchar *key, gint *value)
}
}
/**
* glade_parameter_get_float:
* @parameters: a #GList of #GladeParameters
* @key: a string containing the parameter name
* @value: a pointer to a #gfloat
*
* Searches through @parameters looking for a #GladeParameter named @key. If
* found, it stores a #gfloat representation of its value into @value.
*/
void
glade_parameter_get_float (GList *parameters, const gchar *key, gfloat *value)
{
@ -60,7 +78,15 @@ glade_parameter_get_float (GList *parameters, const gchar *key, gfloat *value)
}
}
/**
* glade_parameter_get_boolean:
* @parameters: a #GList of #GladeParameters
* @key: a string containing the parameter name
* @value: a pointer to a #gboolean
*
* Searches through @parameters looking for a #GladeParameter named @key. If
* found, it stores a #gboolean representation of its value into @value.
*/
void
glade_parameter_get_boolean (GList *parameters, const gchar *key, gboolean *value)
{
@ -83,6 +109,16 @@ glade_parameter_get_boolean (GList *parameters, const gchar *key, gboolean *valu
}
}
/**
* glade_parameter_get_string:
* @parameters: a #GList of #GladeParameters
* @key: a string containing the parameter name
* @value: a pointer to an string
*
* Searches through @parameters looking for a #GladeParameter named @key. If
* found, it stores a newly copied string representation of its value into
* @value.
*/
void
glade_parameter_get_string (GList *parameters, const gchar *key, gchar **value)
{
@ -101,6 +137,12 @@ glade_parameter_get_string (GList *parameters, const gchar *key, gchar **value)
}
}
/**
* glade_parameter_free:
* @parameter: a #GladeParameter
*
* Frees @parameter and its associated memory.
*/
void
glade_parameter_free (GladeParameter *parameter)
{
@ -112,6 +154,11 @@ glade_parameter_free (GladeParameter *parameter)
g_free (parameter);
}
/**
* glade_parameter_new:
*
* Returns: a new #GladeParameter
*/
GladeParameter *
glade_parameter_new (void)
{
@ -122,19 +169,25 @@ glade_parameter_new (void)
return parameter;
}
/**
* glade_parameter_clone:
* @parameter: a #GladeParameter
*
* Returns: a new #GladeParameter cloned from @parameter
*/
GladeParameter *
glade_parameter_clone (GladeParameter *parameter)
{
GladeParameter *clon;
GladeParameter *clone;
if (parameter == NULL)
return NULL;
clon = glade_parameter_new ();
clon->key = g_strdup (parameter->key);
clon->value = g_strdup (parameter->value);
clone = glade_parameter_new ();
clone->key = g_strdup (parameter->key);
clone->value = g_strdup (parameter->value);
return clon;
return clone;
}
static GladeParameter *
@ -155,6 +208,17 @@ glade_parameter_new_from_node (GladeXmlNode *node)
return parameter;
}
/**
* glade_parameter_list_find_by_key:
* @list: a #GList containing #GladeParameters
* @key: a string used as a parameter key
*
* Searches through @list looking for a node which contains a
* #GladeParameter matching @key
*
* Returns: the #GList node containing the located #GladeParameter,
* or %NULL if none is found
*/
GList *
glade_parameter_list_find_by_key (GList *list, const gchar *key)
{
@ -170,7 +234,15 @@ glade_parameter_list_find_by_key (GList *list, const gchar *key)
return NULL;
}
/**
* glade_parameter_list_new_from_node:
* @list: a #GList node
* @node: a #GladeXmlNode
*
* TODO: write me
*
* Returns:
*/
GList *
glade_parameter_list_new_from_node (GList *list, GladeXmlNode *node)
{
@ -212,15 +284,14 @@ glade_parameter_list_new_from_node (GList *list, GladeXmlNode *node)
return list;
}
/**
* glade_parameter_adjustment_new:
* @parameter:
* @property_class: a #GladePropertyClass
*
* Creates a GtkAdjustment from a list of parameters.
* Creates a #GtkAdjustment from the list of parameters inside @property_class.
*
* Return Value: A newly created GtkAdjustment
**/
* Returns: a new #GtkAdjustment
*/
GtkAdjustment *
glade_parameter_adjustment_new (GladePropertyClass *property_class)
{
@ -266,4 +337,3 @@ glade_parameter_adjustment_new (GladePropertyClass *property_class)
climb_rate));
return adjustment;
}

View File

@ -66,7 +66,13 @@ static char *placeholder_xpm[] = {
" .. "
};
/**
* glade_placeholder_get_type:
*
* Creates the typecode for the #GladePlaceholder object type.
*
* Returns: the typecode for the #GladePlaceholder object type
*/
GType
glade_placeholder_get_type (void)
{
@ -121,7 +127,12 @@ glade_placeholder_init (GladePlaceholder *placeholder)
gtk_widget_show (GTK_WIDGET (placeholder));
}
GtkWidget*
/**
* glade_placeholder_new:
*
* Returns: a new #GladePlaceholder cast as a #GtkWidget
*/
GtkWidget *
glade_placeholder_new (void)
{
return g_object_new (GLADE_TYPE_PLACEHOLDER, NULL);
@ -135,7 +146,8 @@ glade_placeholder_finalize (GObject *object)
g_return_if_fail (GLADE_IS_PLACEHOLDER (object));
placeholder = GLADE_PLACEHOLDER (object);
/* placeholder->placeholder_pixmap can be NULL if the placeholder is destroyed before it's realized */
/* placeholder->placeholder_pixmap can be NULL if the placeholder is
* destroyed before it's realized */
if (placeholder->placeholder_pixmap)
g_object_unref (placeholder->placeholder_pixmap);
@ -328,4 +340,3 @@ glade_placeholder_popup_menu (GtkWidget *widget)
return TRUE;
}

View File

@ -105,7 +105,7 @@ static GtkWidget *
glade_popup_create_menu (GladeWidget *widget, gboolean add_childs);
static void
glade_popup_populate_childs(GtkWidget* popup_menu, GladeWidget* parent)
glade_popup_populate_childs (GtkWidget* popup_menu, GladeWidget* parent)
{
while (parent) {
GtkWidget *child;
@ -173,6 +173,13 @@ glade_popup_create_placeholder_menu (GladePlaceholder *placeholder)
return popup_menu;
}
/**
* glade_popup_widget_pop:
* @widget:
* @event:
*
* TODO: write me
*/
void
glade_popup_widget_pop (GladeWidget *widget, GdkEventButton *event)
{
@ -199,6 +206,13 @@ glade_popup_widget_pop (GladeWidget *widget, GdkEventButton *event)
NULL, NULL, button, event_time);
}
/**
* glade_popup_placeholder_pop:
* @placeholder:
* @event:
*
* TODO: write me
*/
void
glade_popup_placeholder_pop (GladePlaceholder *placeholder,
GdkEventButton *event)
@ -225,4 +239,3 @@ glade_popup_placeholder_pop (GladePlaceholder *placeholder,
gtk_menu_popup (GTK_MENU (popup_menu), NULL, NULL,
NULL, NULL, button, event_time);
}

View File

@ -36,6 +36,13 @@ static GtkScrolledWindow *parent_class = NULL;
static void glade_project_view_class_init (GladeProjectViewClass *class);
static void glade_project_view_init (GladeProjectView *view);
/**
* glade_project_view_get_type:
*
* Creates the typecode for the #GladeProjectView object type.
*
* Returns: the typecode for the #GladeProjectView object type
*/
GType
glade_project_view_get_type (void)
{
@ -108,6 +115,15 @@ glade_project_view_find_iter (GtkTreeModel *model,
return NULL;
}
/**
* glade_project_view_find_iter_by_widget:
* @model: a #GtkTreeModel
* @findme: a #GladeWidget
*
* Looks through @model for the #GtkTreeIter corresponding to @findme.
*
* Returns: the #GtkTreeIter from @model corresponding to @findme
*/
GtkTreeIter *
glade_project_view_find_iter_by_widget (GtkTreeModel *model,
GladeWidget *findme)
@ -278,11 +294,11 @@ glade_project_view_remove_item (GladeProjectView *view,
/**
* glade_project_view_selection_update:
* @view:
* @widget:
* @view: a #GladeProjectView
* @widget: a #GladeProject
*
* The project selection has changed, update our state to reflect the changes.
**/
*/
static void
glade_project_view_selection_update (GladeProjectView *view,
GladeProject *project)
@ -527,12 +543,12 @@ glade_project_view_selection_update_cb (GladeProject *project,
/**
* glade_project_view_new:
* @type: the type of the view. It can be list or tree.
* @type: a #GladeProjectViewType
*
* Creates a new project view and ready to be used
* Creates a new #GladeProjectView of type @type
*
* Return Value: a newly created project view
**/
* Returns: a new #GladeProjectView
*/
GladeProjectView *
glade_project_view_new (GladeProjectViewType type)
{
@ -555,12 +571,12 @@ glade_project_view_new (GladeProjectViewType type)
/**
* glade_project_view_set_project:
* @view: The view we are setting the new project for
* @project: The project the view will represent, this can be NULL for stop beeing
* a view of a project.
* @view: a #GladeProjectView
* @project: a #GladeProject or %NULL
*
* Sets the project of a view.
**/
* Sets the project of @view to @project. If @project is %NULL, @view will
* stop being a view of a project.
*/
void
glade_project_view_set_project (GladeProjectView *view,
GladeProject *project)
@ -588,9 +604,10 @@ glade_project_view_set_project (GladeProjectView *view,
model = GTK_TREE_MODEL (view->model);
/* Set to null while we remove all the items from the store, because we are going to trigger
* selection_changed signal emisions on the View. By setting the project to NULL, _selection_changed_cb
* will just return. Chema
/* Set to null while we remove all the items from the store, because we
* are going to trigger selection_changed signal emisions on the View.
* By setting the project to NULL, _selection_changed_cb will just
* return.
*/
view->project = NULL;
@ -607,7 +624,7 @@ glade_project_view_set_project (GladeProjectView *view,
glade_project_view_populate_model (view);
/* Here we connect to all the signals of the project that interests us */
/* Here we connect to all the signals of the project that interest us */
view->add_widget_signal_id =
g_signal_connect (G_OBJECT (project), "add_widget",
G_CALLBACK (glade_project_view_add_widget_cb),
@ -628,15 +645,12 @@ glade_project_view_set_project (GladeProjectView *view,
/**
* glade_project_view_get_project:
* @view:
* @view: a #GladeProjectView
*
* Get's the project of a view
*
* Return Value: the project this view is representing
**/
* Returns: the #GladeProject @view represents
*/
GladeProject *
glade_project_view_get_project (GladeProjectView *view)
{
return view->project;
}

View File

@ -275,8 +275,8 @@ gpw_confirm_close_project (GladeProject *project)
switch (ret) {
case GTK_RESPONSE_YES:
/* if YES we save the project: note we cannot use gpw_save_cb
* since it saves the current project, while the modified project
* we are saving may be not the current one.
* since it saves the current project, while the modified
* project we are saving may be not the current one.
*/
if (project->path != NULL)
{
@ -378,7 +378,8 @@ gpw_close_cb (void)
return;
}
/* this is needed to prevent clearing the selection of a closed project */
/* this is needed to prevent clearing the selection of a closed project
*/
gpw->project = NULL;
glade_project_window_set_project (gpw->projects->data);
@ -471,7 +472,8 @@ gpw_delete_cb (void)
}
/* glade_util_delete_selection performs a glade_command_delete
* on each of the selected widgets */
* on each of the selected widgets
*/
glade_util_delete_selection (gpw->project);
}
@ -1238,12 +1240,25 @@ glade_project_window_create (GladeProjectWindow *gpw)
static GladeProjectWindow *glade_project_window = NULL;
/**
* glade_project_window_get:
*
* Returns: the #GladeProjectWindow
*/
GladeProjectWindow *
glade_project_window_get ()
{
return glade_project_window;
}
/**
* glade_project_window_new:
* @catalogs:
*
* TODO: write me
*
* Returns:
*/
GladeProjectWindow *
glade_project_window_new (GList *catalogs)
{
@ -1354,6 +1369,11 @@ glade_project_window_add_project (GladeProject *project)
glade_project_window_set_project (project);
}
/**
* glade_project_window_new_project:
*
* Creates a new #GladeProject and adds it to the #GladeProjectWindow.
*/
void
glade_project_window_new_project (void)
{
@ -1373,6 +1393,12 @@ glade_project_window_new_project (void)
glade_project_window_add_project (project);
}
/**
* glade_project_window_open_project:
* @path: a string containing a filename
*
* Opens the project specified by @path and adds it to the #GladeProjectWindow.
*/
void
glade_project_window_open_project (const gchar *path)
{
@ -1394,6 +1420,15 @@ glade_project_window_open_project (const gchar *path)
glade_project_window_add_project (project);
}
/**
* glade_project_window_change_menu_label:
* @gpw:
* @path:
* @prefix:
* @suffix:
*
* TODO: write me
*/
void
glade_project_window_change_menu_label (GladeProjectWindow *gpw,
const gchar *path,
@ -1428,6 +1463,11 @@ glade_project_window_change_menu_label (GladeProjectWindow *gpw,
g_free (text);
}
/**
* glade_project_window_refresh_undo_redo:
*
* TODO: write me
*/
void
glade_project_window_refresh_undo_redo (void)
{
@ -1465,6 +1505,11 @@ glade_project_window_refresh_undo_redo (void)
gtk_widget_set_sensitive (gpw->toolbar_redo, redo_description != NULL);
}
/**
* glade_project_window_show_all:
*
* TODO: write me
*/
void
glade_project_window_show_all ()
{
@ -1476,4 +1521,3 @@ glade_project_window_show_all ()
gpw_show_palette (gpw);
gpw_show_editor (gpw);
}

View File

@ -54,6 +54,13 @@ enum
static guint glade_project_signals[LAST_SIGNAL] = {0};
static GObjectClass *parent_class = NULL;
/**
* glade_project_get_type:
*
* Creates the typecode for the #GladeProject object type.
*
* Returns: the typecode for the #GladeProject object type
*/
GType
glade_project_get_type (void)
{
@ -153,6 +160,16 @@ glade_project_init (GladeProject *project)
project->tooltips = gtk_tooltips_new ();
}
/**
* glade_project_new:
* @untitled: Whether or not this project is untitled
*
* Creates a new #GladeProject. If @untitled is %TRUE, sets the project's
* name to "Untitled 1" or some such, giving a unique number each time
* called.
*
* Returns: a new #GladeProject
*/
GladeProject *
glade_project_new (gboolean untitled)
{
@ -215,6 +232,12 @@ glade_project_finalize (GObject *object)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
/**
* glade_project_selection_changed:
* @project: a #GladeProject
*
* Causes @project to emit a "selection_changed" signal.
*/
void
glade_project_selection_changed (GladeProject *project)
{
@ -305,6 +328,14 @@ glade_project_add_widget (GladeProject *project, GtkWidget *widget)
gwidget);
}
/**
* glade_project_release_widget_name:
* @project: a #GladeProject
* @glade_widget:
* @widget_name:
*
* TODO: Write me
*/
void
glade_project_release_widget_name (GladeProject *project, GladeWidget *glade_widget, const char *widget_name)
{
@ -349,12 +380,13 @@ glade_project_release_widget_name (GladeProject *project, GladeWidget *glade_wid
/**
* glade_project_remove_widget:
* @project: the project the widget is removed from
* @widget: the GtkWidget to remove
* @project: a #GladeProject
* @widget: the #GtkWidget to remove
*
* Remove a widget from the project.
* Note that when removing the GtkWidget from the project we
* don't change ->project in the associated GladeWidget, this
* Removes @widget from @project.
*
* Note that when removing the #GtkWidget from the project we
* don't change ->project in the associated #GladeWidget; this
* way UNDO can work.
*/
void
@ -405,6 +437,14 @@ glade_project_remove_widget (GladeProject *project, GtkWidget *widget)
gwidget);
}
/**
* glade_project_widget_name_changed:
* @project: a #GladeProject
* @widget: a #GladeWidget
* @old_name:
*
* TODO: write me
*/
void
glade_project_widget_name_changed (GladeProject *project, GladeWidget *widget, const char *old_name)
{
@ -423,12 +463,12 @@ glade_project_widget_name_changed (GladeProject *project, GladeWidget *widget, c
/**
* glade_project_get_widget_by_name:
* @project: The project in which to look for
* @project: a #GladeProject
* @name: The user visible name of the widget we are looking for
*
* Finds a GladeWidget inside a project given its name
* Searches through @project looking for a #GladeWidget named @name.
*
* Return Value: a pointer to the wiget, NULL if the widget does not exist
* Returns: a pointer to the widget, %NULL if the widget does not exist
*/
GladeWidget *
glade_project_get_widget_by_name (GladeProject *project, const gchar *name)
@ -452,14 +492,14 @@ glade_project_get_widget_by_name (GladeProject *project, const gchar *name)
/**
* glade_project_new_widget_name:
* @project: The project in which we will insert this widget
* @project: a #GladeProject
* @base_name: base name of the widget to create
*
* Creates a new name for the widget that doesn't collides with
* any of the names on the project passed as argument. This name
* will start with @base_name.
* Creates a new name for a widget that doesn't collide with any of the names
* already in @project. This name will start with @base_name.
*
* Return Value: a string to the new name, NULL if there is not enough memory
* Returns: a string containing the new name, %NULL if there is not enough
* memory for this string
*/
char *
glade_project_new_widget_name (GladeProject *project, const char *base_name)
@ -494,6 +534,15 @@ glade_project_new_widget_name (GladeProject *project, const char *base_name)
return NULL;
}
/**
* glade_project_selection_clear:
* @project: a #GladeProject
* @emit_signal: whether or not to emit a signal indication a selection change
*
* TODO: write me
*
* If @emit_signal is %TRUE, calls glade_project_selection_changed().
*/
void
glade_project_selection_clear (GladeProject *project, gboolean emit_signal)
{
@ -518,6 +567,16 @@ glade_project_selection_clear (GladeProject *project, gboolean emit_signal)
glade_project_selection_changed (project);
}
/**
* glade_project_selection_remove:
* @project: a #GladeProject
* @widget:
* @emit_signal: whether or not to emit a signal indication a selection change
*
* TODO: write me
*
* If @emit_signal is %TRUE, calls glade_project_selection_changed().
*/
void
glade_project_selection_remove (GladeProject *project,
GtkWidget *widget,
@ -539,6 +598,16 @@ glade_project_selection_remove (GladeProject *project,
}
}
/**
* glade_project_selection_add:
* @project: a #GladeProject
* @widget:
* @emit_signal: whether or not to emit a signal indication a selection change
*
* TODO: write me
*
* If @emit_signal is %TRUE, calls glade_project_selection_changed().
*/
void
glade_project_selection_add (GladeProject *project,
GtkWidget *widget,
@ -560,6 +629,16 @@ glade_project_selection_add (GladeProject *project,
}
}
/**
* glade_project_selection_set:
* @project: a #GladeProject
* @widget:
* @emit_signal: whether or not to emit a signal indication a selection change
*
* TODO: write me
*
* If @emit_signal is %TRUE, calls glade_project_selection_changed().
*/
void
glade_project_selection_set (GladeProject *project,
GtkWidget *widget,
@ -575,6 +654,13 @@ glade_project_selection_set (GladeProject *project,
glade_project_selection_add (project, widget, emit_signal);
}
/**
* glade_project_selection_get:
* @project: a #GladeProject
*
* Returns: a #GList containing the #GtkWidget items currently selected in
* @project
*/
GList *
glade_project_selection_get (GladeProject *project)
{
@ -585,10 +671,11 @@ glade_project_selection_get (GladeProject *project)
/**
* glade_project_write:
* @project:
* @context: a #GladeXmlContext
* @project: a #GladeProject
*
* Returns the root node of a newly created xml representation of the
* project and its contents.
* Returns: the root node of a newly created xml representation of the
* project and its contents
*/
static GladeXmlNode *
glade_project_write (GladeXmlContext *context, const GladeProject *project)
@ -663,10 +750,12 @@ glade_project_new_from_node (GladeXmlNode *node)
/**
* glade_project_open:
* @path:
* @path:
*
* Open a project at the given path.
* On success returns the opened project else NULL.
* Opens a project at the given path.
*
* Returns: a new #GladeProject for the opened project on success, %NULL on
* failure
*/
GladeProject *
glade_project_open (const gchar *path)
@ -694,10 +783,12 @@ glade_project_open (const gchar *path)
/**
* glade_project_save:
* @project:
* @path
* @project: a #GladeProject
* @path:
*
* Save the project to the given path. Returns TRUE on success.
* Saves @project to the given path.
*
* Returns: %TRUE on success, %FALSE on failure
*/
gboolean
glade_project_save (GladeProject *project, const gchar *path)
@ -739,7 +830,14 @@ glade_project_save (GladeProject *project, const gchar *path)
return TRUE;
}
GtkTooltips *glade_project_get_tooltips (GladeProject *project)
/**
* glade_project_get_tooltips:
* @project: a #GladeProject
*
* Returns: a #GtkTooltips object containing all tooltips for @project
*/
GtkTooltips *
glade_project_get_tooltips (GladeProject *project)
{
return project->tooltips;
}

View File

@ -33,7 +33,7 @@ struct _GladeProject
* requested
*/
GList *widgets; /* A list of GtkWidgets that make up this project.
GList *widgets; /* A list of #GtkWidgets that make up this project.
* The widgets are stored in no particular order.
*/
@ -41,7 +41,7 @@ struct _GladeProject
* because we have multiple projects and when the
* user switchs between them, he will probably
* not want to loose the selection. This is a list
* of GtkWidget items.
* of #GtkWidget items.
*/
GList *undo_stack; /* A stack with the last executed commands */

View File

@ -37,7 +37,13 @@
#include "glade-property-class.h"
#include "glade-debug.h"
/**
* glade_property_type_str_to_enum:
* @str: a string representation of a property type
*
* Returns: the #GladePropertyType described by @str, or
* %GLADE_PROPERTY_TYPE_ERROR if we do not recognize @str
*/
GladePropertyType
glade_property_type_str_to_enum (const gchar *str)
{
@ -65,6 +71,13 @@ glade_property_type_str_to_enum (const gchar *str)
return GLADE_PROPERTY_TYPE_ERROR;
}
/**
* glade_property_type_enum_to_string:
* @type: a #GladePropertyType
*
* Returns: a string representing @type, or %NULL if @type is
* either not recognized or is %GLADE_PROPERTY_TYPE_ERROR
*/
gchar *
glade_property_type_enum_to_string (GladePropertyType type)
{
@ -97,6 +110,11 @@ glade_property_type_enum_to_string (GladePropertyType type)
return NULL;
}
/**
* glade_property_class_new:
*
* Returns: a new #GladePropertyClass
*/
GladePropertyClass *
glade_property_class_new (void)
{
@ -121,54 +139,66 @@ glade_property_class_new (void)
return property_class;
}
/**
* glade_property_class_clone:
* @property_class: a #GladePropertyClass
*
* Returns: a new #GladePropertyClass cloned from @property_class
*/
GladePropertyClass *
glade_property_class_clone (GladePropertyClass *property_class)
{
GladePropertyClass *clon;
GladePropertyClass *clone;
g_return_val_if_fail (GLADE_IS_PROPERTY_CLASS (property_class), NULL);
clon = g_new0 (GladePropertyClass, 1);
clone = g_new0 (GladePropertyClass, 1);
memcpy (clon, property_class, sizeof(GladePropertyClass));
clon->id = g_strdup (clon->id);
clon->name = g_strdup (clon->name);
clon->tooltip = g_strdup (clon->tooltip);
memcpy (clone, property_class, sizeof(GladePropertyClass));
clone->id = g_strdup (clone->id);
clone->name = g_strdup (clone->name);
clone->tooltip = g_strdup (clone->tooltip);
if (G_IS_VALUE (property_class->def))
{
clon->def = g_new0 (GValue, 1);
g_value_init (clon->def, G_VALUE_TYPE (property_class->def));
g_value_copy (property_class->def, clon->def);
clone->def = g_new0 (GValue, 1);
g_value_init (clone->def, G_VALUE_TYPE (property_class->def));
g_value_copy (property_class->def, clone->def);
}
if (clon->parameters)
if (clone->parameters)
{
GList *parameter;
clon->parameters = g_list_copy (clon->parameters);
clone->parameters = g_list_copy (clone->parameters);
for (parameter = clon->parameters; parameter != NULL; parameter = parameter->next)
for (parameter = clone->parameters; parameter != NULL; parameter = parameter->next)
parameter->data = glade_parameter_clone ((GladeParameter*) parameter->data);
}
if (clon->choices)
if (clone->choices)
{
GList *choice;
clon->choices = g_list_copy (clon->choices);
clone->choices = g_list_copy (clone->choices);
for (choice = clon->choices; choice != NULL; choice = choice->next)
for (choice = clone->choices; choice != NULL; choice = choice->next)
choice->data = glade_choice_clone ((GladeChoice*) choice->data);
}
/* ok, wtf? what is the child member for? */
/* if (clon->child)
clon->child = glade_widget_class_clone (clon->child); */
/* if (clone->child)
clone->child = glade_widget_class_clone (clone->child); */
return clon;
return clone;
}
/**
* glade_property_class_free:
* @class: a #GladePropertyClass
*
* Frees @class and its associated memory.
*/
void
glade_property_class_free (GladePropertyClass *class)
{
@ -292,6 +322,15 @@ glade_property_class_get_default_from_spec (GParamSpec *spec,
return value;
}
/**
* glade_property_class_make_string_from_gvalue:
* @property_class:
* @value:
*
* TODO: write me
*
* Returns:
*/
gchar *
glade_property_class_make_string_from_gvalue (GladePropertyClass *property_class,
const GValue *value)
@ -433,7 +472,15 @@ glade_property_class_make_flags_from_string (GType type, const char *string)
return ret;
}
/**
* glade_property_class_make_gvalue_from_string:
* @property_class:
* @string:
*
* TODO: write me
*
* Returns:
*/
GValue *
glade_property_class_make_gvalue_from_string (GladePropertyClass *property_class,
const gchar *string)
@ -581,6 +628,14 @@ glade_property_get_parameters_numeric (GParamSpec *spec,
return list;
}
/**
* glade_property_class_new_from_spec:
* @spec:
*
* TODO: write me
*
* Returns:
*/
GladePropertyClass *
glade_property_class_new_from_spec (GParamSpec *spec)
{
@ -640,6 +695,15 @@ lblError:
return NULL;
}
/**
* glade_property_class_is_visible:
* @property_class:
* @widget_class:
*
* TODO: write me
*
* Returns:
*/
gboolean
glade_property_class_is_visible (GladePropertyClass *property_class, GladeWidgetClass *widget_class)
{
@ -658,9 +722,9 @@ glade_property_class_is_visible (GladePropertyClass *property_class, GladeWidget
* Updates the @property_class with the contents of the node in the xml
* file. Only the values found in the xml file are overridden.
*
* Return TRUE on success. @property_class is set to NULL if the property
* has Disabled="TRUE".
**/
* Returns: %TRUE on success. @property_class is set to NULL if the property
* has Disabled="TRUE".
*/
gboolean
glade_property_class_update_from_node (GladeXmlNode *node,
GladeWidgetClass *widget_class,
@ -793,10 +857,12 @@ glade_property_class_update_from_node (GladeXmlNode *node,
/* If this property can't be set with g_object_set, get the work around
* function
*/
/* I use here a g_warning to signal these errors instead of a dialog box, as if there is one
* of this kind of errors, there will probably a lot of them, and we don't want to inflict
* the user the pain of plenty of dialog boxes. Ideally, we should collect these errors,
* and show all of them at the end of the load processus. */
/* I use here a g_warning to signal these errors instead of a dialog
* box, as if there is one of this kind of errors, there will probably
* a lot of them, and we don't want to inflict the user the pain of
* plenty of dialog boxes. Ideally, we should collect these errors,
* and show all of them at the end of the load process.
*/
child = glade_xml_search_child (node, GLADE_TAG_SET_FUNCTION);
if (child)
{

View File

@ -33,7 +33,15 @@
#include "glade-widget-class.h"
#include "glade-debug.h"
/**
* glade_property_new:
* @class:
* @widget:
*
* TODO: write me
*
* Returns:
*/
GladeProperty *
glade_property_new (GladePropertyClass *class, GladeWidget *widget)
{
@ -58,7 +66,8 @@ glade_property_new (GladePropertyClass *class, GladeWidget *widget)
}
#endif
/* Create an empty default if the class does not specify a default value */
/* Create an empty default if the class does not specify a default
* value */
if (!class->def)
{
property->value = glade_property_class_make_gvalue_from_string (class, "");
@ -93,7 +102,13 @@ glade_property_new (GladePropertyClass *class, GladeWidget *widget)
return property;
}
/**
* glade_property_free:
* @property: a #GladeProperty
*
* Frees @property and its associated memory.
*/
void
glade_property_free (GladeProperty *property)
{
@ -135,6 +150,13 @@ glade_property_set_property (GladeProperty *property, const GValue *value)
}
}
/**
* glade_property_set:
* @property: a #GladeProperty
* @value: a #GValue
*
* TODO: write me
*/
void
glade_property_set (GladeProperty *property, const GValue *value)
{
@ -143,7 +165,7 @@ glade_property_set (GladeProperty *property, const GValue *value)
if (!g_value_type_compatible (G_VALUE_TYPE (property->value), G_VALUE_TYPE (value)))
{
g_warning ("Trying to assing an incompatible value to property %s\n",
g_warning ("Trying to assign an incompatible value to property %s\n",
property->class->id);
return;
}
@ -156,7 +178,7 @@ glade_property_set (GladeProperty *property, const GValue *value)
property->loading = TRUE;
/* if there is a custom set_property use it */
/* if there is a custom set_property, use it */
if (property->class->set_function)
(*property->class->set_function) (G_OBJECT (property->widget->widget), value);
else
@ -168,6 +190,15 @@ glade_property_set (GladeProperty *property, const GValue *value)
property->loading = FALSE;
}
/**
* glade_property_write:
* @context: a #GladeXmlContext
* @property: a #GladeProperty:
*
* TODO: write me
*
* Returns:
*/
GladeXmlNode *
glade_property_write (GladeXmlContext *context, GladeProperty *property)
{
@ -185,7 +216,8 @@ glade_property_write (GladeXmlContext *context, GladeProperty *property)
if (!node)
return NULL;
/* we should change each '-' by '_' on the name of the property (<property name="...">) */
/* we should change each '-' by '_' on the name of the property
* (<property name="...">) */
tmp = g_strdup (property->class->id);
if (!tmp)
{
@ -200,7 +232,7 @@ glade_property_write (GladeXmlContext *context, GladeProperty *property)
g_free (tmp);
/* convert the value of this property to a string, and put it between
* the openning and the closing of the property tag */
* the opening and the closing of the property tag */
tmp = glade_property_class_make_string_from_gvalue (property->class,
property->value);
if (!tmp)
@ -228,4 +260,3 @@ glade_property_write (GladeXmlContext *context, GladeProperty *property)
return node;
}

View File

@ -340,6 +340,13 @@ glade_signal_editor_construct (GladeSignalEditor *editor)
gtk_widget_show_all (editor->main_window);
}
/**
* glade_signal_editor_get_widget:
* @editor: a #GladeSignalEditor
*
* Returns: the #GtkWidget that is the main window for @editor, or %NULL if
* it does not exist
*/
GtkWidget *
glade_signal_editor_get_widget (GladeSignalEditor *editor)
{
@ -349,6 +356,12 @@ glade_signal_editor_get_widget (GladeSignalEditor *editor)
return editor->main_window;
}
/**
* glade_signal_editor_new:
* @editor: a #GladeEditor
*
* Returns: a new #GladeSignalEditor associated with @editor
*/
GladeSignalEditor *
glade_signal_editor_new (GladeEditor *editor)
{
@ -362,6 +375,13 @@ glade_signal_editor_new (GladeEditor *editor)
return signal_editor;
}
/**
* glade_signal_editor_load_widget:
* @editor: a #GladeSignalEditor
* @widget: a #GladeWidget
*
* TODO: write me
*/
void
glade_signal_editor_load_widget (GladeSignalEditor *editor,
GladeWidget *widget)
@ -418,7 +438,8 @@ glade_signal_editor_load_widget (GladeSignalEditor *editor,
GtkTreePath *path_parent_class;
GladeSignal *widget_signal = (GladeSignal*) g_ptr_array_index (signals, 0);
/* mark the class of this signal as bold and expand it, as there is at least one signal with handler */
/* mark the class of this signal as bold and expand it,
* as there is at least one signal with handler */
gtk_tree_store_set (editor->model, &parent_class, COLUMN_BOLD, TRUE, -1);
path_parent_class = gtk_tree_model_get_path (GTK_TREE_MODEL (editor->model), &parent_class);
gtk_tree_view_expand_row (GTK_TREE_VIEW (editor->signals_list), path_parent_class, FALSE);
@ -459,4 +480,3 @@ glade_signal_editor_load_widget (GladeSignalEditor *editor,
gtk_tree_view_expand_row (GTK_TREE_VIEW (editor->signals_list), path_first, FALSE);
gtk_tree_path_free (path_first);
}

View File

@ -27,7 +27,17 @@
#include "glade-signal.h"
#include "glade-xml-utils.h"
/**
* glade_signal_new:
* @name: a name for the signal
* @handler: a handler function for the signal
* @after: #gboolean indicating whether this handler should be called after
* the default handler
*
* Creates a new #GladeSignal with the given parameters.
*
* Returns: the new #GladeSignal
*/
GladeSignal *
glade_signal_new (const gchar *name, const gchar *handler, gboolean after)
{
@ -40,6 +50,12 @@ glade_signal_new (const gchar *name, const gchar *handler, gboolean after)
return signal;
}
/**
* glade_signal_free:
* @signal: a #GladeSignal
*
* Frees @signal and its associated memory.
*/
void
glade_signal_free (GladeSignal *signal)
{
@ -50,6 +66,13 @@ glade_signal_free (GladeSignal *signal)
g_free (signal);
}
/**
* glade_signal_equal:
* @sig1: a #GladeSignal
* @sig2: a #GladeSignal
*
* Returns: %TRUE if @sig1 and @sig2 have identical attributes, %FALSE otherwise
*/
gboolean
glade_signal_equal (GladeSignal *sig1, GladeSignal *sig2)
{
@ -66,12 +89,25 @@ glade_signal_equal (GladeSignal *sig1, GladeSignal *sig2)
return ret;
}
/**
* glade_signal_clone:
* @signal: a #GladeSignal
*
* Returns: a new #GladeSignal with the same attributes as @signal
*/
GladeSignal *
glade_signal_clone (const GladeSignal *signal)
{
return glade_signal_new (signal->name, signal->handler, signal->after);
}
/**
* glade_signal_write:
* @context: a #GladeXmlContext
* @signal: a #GladeSignal
*
* Returns: a new #GladeXmlNode in @context for @signal
*/
GladeXmlNode *
glade_signal_write (GladeXmlContext *context, GladeSignal *signal)
{
@ -86,6 +122,13 @@ glade_signal_write (GladeXmlContext *context, GladeSignal *signal)
return node;
}
/**
* glade_signal_new_from_node:
* @node: a #GladeXmlNode
*
* Returns: a new #GladeSignal with the attributes defined in @node, %NULL if
* there is an error
*/
GladeSignal *
glade_signal_new_from_node (GladeXmlNode *node)
{
@ -104,4 +147,3 @@ glade_signal_new_from_node (GladeXmlNode *node)
return signal;
}

View File

@ -54,6 +54,11 @@ transform_string_boolean (const GValue *src_value, GValue *dest_value)
dest_value->data[0].v_int = 0;
}
/**
* glade_register_transformations:
*
* TODO: write me
*/
void
glade_register_transformations (void)
{

View File

@ -38,6 +38,13 @@
#define GLADE_UTIL_HAS_NODES "glade_util_has_nodes"
#define GLADE_UTIL_SELECTION_NODE_SIZE 7
/**
* glade_util_widget_set_tooltip:
* @widget: a #GtkWidget
* @str: a string
*
* Creates a new tooltip from @str and sets @widget to use it.
*/
void
glade_util_widget_set_tooltip (GtkWidget *widget, const gchar *str)
{
@ -49,6 +56,14 @@ glade_util_widget_set_tooltip (GtkWidget *widget, const gchar *str)
return;
}
/**
* glade_util_get_type_from_name:
* @name:
*
* TODO: write me
*
* Returns:
*/
GType
glade_util_get_type_from_name (const gchar *name)
{
@ -87,6 +102,14 @@ glade_util_get_type_from_name (const gchar *name)
return type;
}
/**
* glade_util_ui_warn:
* @parent: a #GtkWindow cast as a #GtkWidget
* @warning: a string
*
* Creates a new warning dialog window as a child of @parent containing
* the text of @warning, runs it, then destroys it on close.
*/
void
glade_util_ui_warn (GtkWidget *parent, const gchar *warning)
{
@ -188,8 +211,17 @@ glade_util_compare_uline_labels (const gchar *labela, const gchar *labelb)
return 0;
}
/* This is a GCompareFunc for comparing the labels of 2 stock items, ignoring
any '_' characters. It isn't particularly efficient. */
/**
* glade_util_compare_stock_labels:
* @a: a #gconstpointer to a #GtkStockItem
* @b: a #gconstpointer to a #GtkStockItem
*
* This is a #GCompareFunc that compares the labels of two stock items,
* ignoring any '_' characters. It isn't particularly efficient.
*
* Returns: negative value if @a < @b; zero if @a = @b;
* positive value if @a > @b
*/
gint
glade_util_compare_stock_labels (gconstpointer a, gconstpointer b)
{
@ -220,6 +252,14 @@ glade_util_compare_stock_labels (gconstpointer a, gconstpointer b)
return retval;
}
/**
* glade_util_gtk_combo_func:
* @data:
*
* TODO: write me
*
* Returns:
*/
gchar *
glade_util_gtk_combo_func (gpointer data)
{
@ -244,6 +284,14 @@ glade_util_gtk_combo_func (gpointer data)
}
/* These are pinched from gtkcombo.c */
/**
* glade_util_gtk_combo_find:
* @combo:
*
* TODO: write me
*
* Returns:
*/
gpointer /* GtkListItem * */
glade_util_gtk_combo_find (GtkCombo * combo)
{
@ -274,12 +322,12 @@ glade_util_gtk_combo_find (GtkCombo * combo)
/**
* glade_util_hide_window:
* @window:
* @window: a #GtkWindow
*
* If you use this function to handle the delete_event of a window, when it
* will be shown again it will appear in the position where it was before
* beeing hidden.
**/
*/
void
glade_util_hide_window (GtkWindow *window)
{
@ -298,12 +346,12 @@ glade_util_hide_window (GtkWindow *window)
/**
* glade_util_file_chooser_new:
* @title: dialog title
* @parent: the window the dialog is set transient for
* @parent: the parent #GtkWindow for the dialog
* @action: a #GtkFileChooserAction to say if the dialog will open or save
*
* Returns a file chooser dialog. It's up to the caller
* to show the dialog
**/
* Returns: a file chooser dialog. The caller is responsible for showing the
* dialog
*/
GtkWidget *
glade_util_file_chooser_new (const gchar *title, GtkWindow *parent,
GtkFileChooserAction action)
@ -326,7 +374,12 @@ glade_util_file_chooser_new (const gchar *title, GtkWindow *parent,
}
/**
* changes each occurence of the character a on the string str by the character b.
* glade_util_replace:
* @str: a string
* @a: a #char
* @b: a #char
*
* Replaces each occurance of the character @a in @str to @b.
*/
void
glade_util_replace (char *str, char a, char b)
@ -343,9 +396,13 @@ glade_util_replace (char *str, char a, char b)
}
/**
* duplicates the string passed as argument, but changing each underscore
* in the original string by two underscores. Returns a newly allocated
* string.
* glade_util_duplicate_underscores:
* @name: a string
*
* Duplicates @name, but the copy has two underscores in place of any single
* underscore in the original.
*
* Returns: a newly allocated string
*/
char *
glade_util_duplicate_underscores (const char *name)
@ -494,10 +551,16 @@ glade_util_can_draw_nodes (GtkWidget *sel_widget, GdkWindow *sel_win,
return FALSE;
}
/* This is called to redraw any selection nodes that intersect the given
exposed window. It steps through all the selected widgets, converts the
coordinates so they are relative to the exposed window, then calls
glade_util_draw_nodes() to draw the selection nodes if appropriate. */
/**
* glade_util_draw_nodes_idle:
* @expose_win: a #GdkWindow
*
* Redraws any selection nodes that intersect @expose_win. Steps through all
* selected widgets, finds their coordinates, and calls glade_util_draw_nodes()
* if appropriate.
*
* Returns: %FALSE
*/
gboolean
glade_util_draw_nodes_idle (GdkWindow *expose_win)
{
@ -577,9 +640,14 @@ glade_util_draw_nodes_idle (GdkWindow *expose_win)
#define GLADE_DRAW_NODES_IDLE_PRIORITY GTK_PRIORITY_DEFAULT + 10
/* This should be called whenever a widget in the interface receives an
expose event. It sets up an idle function which will redraw any selection
nodes that intersect the exposed window. */
/**
* glade_util_queue_draw_nodes:
* @window:
*
* This function should be called whenever a widget in the interface receives
* an expose event. It sets up an idle function which will redraw any selection
* nodes that intersect the the exposed window.
*/
void
glade_util_queue_draw_nodes (GdkWindow *window)
{
@ -594,6 +662,12 @@ glade_util_queue_draw_nodes (GdkWindow *window)
window, NULL);
}
/**
* glade_util_add_nodes:
* @widget: a #GtkWidget
*
* TODO: write me
*/
void
glade_util_add_nodes (GtkWidget *widget)
{
@ -602,6 +676,12 @@ glade_util_add_nodes (GtkWidget *widget)
gtk_widget_queue_draw (widget);
}
/**
* glade_util_remove_nodes:
* @widget: a #GtkWidget
*
* TODO: write me
*/
void
glade_util_remove_nodes (GtkWidget *widget)
{
@ -612,12 +692,24 @@ glade_util_remove_nodes (GtkWidget *widget)
gtk_widget_queue_draw (widget->parent ? widget->parent : widget);
}
/**
* glade_util_has_nodes:
* @widget: a #GtkWidget
*
* Returns: %TRUE if @widget has nodes, %FALSE otherwise
*/
gboolean
glade_util_has_nodes (GtkWidget *widget)
{
return GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget), GLADE_UTIL_HAS_NODES)) != 0;
}
/**
* glade_util_delete_selection:
* @project: a #GladeProject
*
* TODO: write me
*/
void
glade_util_delete_selection (GladeProject *project)
{
@ -648,6 +740,14 @@ glade_util_delete_selection (GladeProject *project)
g_list_free (free_me);
}
/**
* glade_util_get_parent:
* @w: a #GtkWidget
*
* TODO: write me
*
* Returns:
*/
GladeWidget *
glade_util_get_parent (GtkWidget *w)
{
@ -683,6 +783,12 @@ gtk_container_children_callback (GtkWidget *widget,
*children = g_list_prepend (*children, widget);
}
/**
* glade_util_container_get_all_children:
* @container: a #GtkContainer
*
* Returns: a #GList giving the contents of @container
*/
GList *
glade_util_container_get_all_children (GtkContainer *container)
{
@ -705,8 +811,8 @@ glade_util_container_get_all_children (GtkContainer *container)
* such as one you would get on a drop operation.
* This is mostly stolen from gnome-vfs-uri.c.
*
* Returns a GList of gchars.
**/
* Returns: a #GList of gchars.
*/
GList *
glade_util_uri_list_parse (const gchar *uri_list)
{
@ -766,6 +872,13 @@ glade_util_uri_list_parse (const gchar *uri_list)
return g_list_reverse (result);
}
/**
* glade_util_object_set_property:
* @object: a #GObject
* @property: a #GladeProperty
*
* TODO: write me
*/
void
glade_util_object_set_property (GObject *object, GladeProperty *property)
{

View File

@ -80,6 +80,12 @@ glade_widget_class_compose_get_type_func (GladeWidgetClass *class)
return retval;
}
/**
* glade_widget_class_free:
* @widget_class: a #GladeWidgetClass
*
* Frees @widget_class and its associated memory.
*/
void
glade_widget_class_free (GladeWidgetClass *widget_class)
{
@ -325,14 +331,16 @@ glade_widget_class_update_properties_from_node (GladeXmlNode *node,
/**
* glade_widget_class_extend_with_file:
* @filename: complete path name of the xml file with the description of the GladeWidgetClass
* @filename: complete path name of the xml file with the description of the
* #GladeWidgetClass
*
* This function extends an existing GladeWidgetClass with the data found on the file
* with name @filename (if it exists). Notably, it will add new properties to the
* GladeWidgetClass, or modify existing ones, in function of the contents of the file.
* This function extends an existing GladeWidgetClass with the data found on
* the file with name @filename (if it exists). Notably, it will add new
* properties to the #GladeWidgetClass, or modify existing ones, in function
* of the contents of the file.
*
* @returns: TRUE if the file exists and its format is correct, FALSE otherwise.
**/
* Returns: %TRUE if the file exists and its format is correct, %FALSE otherwise
*/
static gboolean
glade_widget_class_extend_with_file (GladeWidgetClass *widget_class, const char *filename)
{
@ -414,8 +422,8 @@ glade_widget_class_extend_with_file (GladeWidgetClass *widget_class, const char
if (properties)
glade_widget_class_update_properties_from_node (properties, widget_class, &widget_class->properties);
/* if we found a <ChildProperties> tag on the xml file, we add the properties
* that we read from the xml file to the class.
/* if we found a <ChildProperties> tag on the xml file, we add the
* properties that we read from the xml file to the class.
*/
properties = glade_xml_search_child (node, GLADE_TAG_CHILD_PROPERTIES);
if (properties)
@ -434,12 +442,8 @@ glade_widget_class_extend_with_file (GladeWidgetClass *widget_class, const char
* glade_widget_class_get_by_name:
* @name: name of the widget class (for instance: GtkButton)
*
* Returns an already created GladeWidgetClass with the name passed as argument.
*
* If we have not yet created any GladeWidgetClass, this function will return %NULL.
*
* Return Value: An existing GladeWidgetClass with the name passed as argument,
* or %NULL if such a class doesn't exist.
* Returns: an existing #GladeWidgetClass with the name equaling @name,
* or %NULL if such a class doesn't exist
**/
GladeWidgetClass *
glade_widget_class_get_by_name (const char *name)
@ -456,8 +460,9 @@ glade_widget_class_get_by_name (const char *name)
* @parent_class: List of properties in the parent.
*
* Merges the properties found in the parent_properties list with the
* properties found in the widget_properties list.
* The properties in the parent_properties will be prepended to widget_properties.
* properties found in the @widget_properties list.
* The properties in the parent_properties will be prepended to
* @widget_properties.
**/
static void
glade_widget_class_merge_properties (GList **widget_properties, GList *parent_properties)
@ -501,10 +506,10 @@ glade_widget_class_merge_properties (GList **widget_properties, GList *parent_pr
* @widget_class: main class.
* @parent_class: secondary class.
*
* Merges the contents of the parent_class on the widget_class.
* The properties of the parent_class will be prepended to
* those of widget_class.
**/
* Merges the contents of the @parent_class on the @widget_class.
* The properties of the @parent_class will be prepended to
* those of @widget_class.
*/
static void
glade_widget_class_merge (GladeWidgetClass *widget_class,
GladeWidgetClass *parent_class)
@ -537,7 +542,7 @@ glade_widget_class_merge (GladeWidgetClass *widget_class,
/**
* glade_widget_class_load_library:
* @library_name: name of the library .
* @library_name: name of the library
*
* Loads the named library from the Glade modules directory, or failing that
* from the standard platform specific directories.
@ -545,7 +550,7 @@ glade_widget_class_merge (GladeWidgetClass *widget_class,
* The @library_name should not include any platform specifix prefix or suffix,
* those are automatically added, if needed, by g_module_build_path()
*
* @returns: a #GModule on success, or %NULL on failure.
* Returns: a #GModule on success, or %NULL on failure.
*/
static GModule *
glade_widget_class_load_library (const gchar *library_name)
@ -596,20 +601,21 @@ glade_widget_class_direct_children (GtkWidget *ancestor, GtkWidget *widget, cons
/**
* glade_widget_class_new:
* @name: name of the widget class (for instance: GtkButton)
* @generic_name: base of the name for the widgets of this class (for instance: button).
* This parameter is optional. For abstract classes there is no need to supply a generic_name.
* @base_filename: filename containing a further description of the widget, without
* the directory (optional).
* @generic_name: base of the name for the widgets of this class
* (for instance: button). This parameter is optional. For
* abstract classes there is no need to supply a generic_name.
* @base_filename: filename containing a further description of the widget,
* without the directory (optional).
*
* Creates a new GladeWidgetClass, initializing it with the
* Creates a new #GladeWidgetClass, initializing it with the
* name, generic_name and base_filename.
*
* The widget class will be first build using the information that the GLib object system
* returns, and then it will be expanded (optionally) with the information contained on
* the xml filename.
* The widget class will be first build using the information that the GLib
* object system returns, and then it will be expanded (optionally) with the
* information contained on the xml filename.
*
* Return Value: The new GladeWidgetClass, or %NULL if there are any errors.
**/
* Returns: a new #GladeWidgetClass, or %NULL if there are any errors
*/
GladeWidgetClass *
glade_widget_class_new (const char *name,
const char *generic_name,
@ -725,18 +731,37 @@ lblError:
return NULL;
}
/**
* glade_widget_class_get_name:
* @widget: a #GladeWidgetClass
*
* Returns: the name of @widget
*/
const gchar *
glade_widget_class_get_name (GladeWidgetClass *widget)
{
return widget->name;
}
/**
* glade_widget_class_get_type:
* @widget: a #GladeWidgetClass
*
* Returns: the #GType of @widget
*/
GType
glade_widget_class_get_type (GladeWidgetClass *widget)
{
return widget->type;
}
/**
* glade_widget_class_has_property:
* @class: a #GladeWidgetClass
* @name: a string
*
* Returns: %TRUE if @class has a property named @name, %FALSE otherwise
*/
gboolean
glade_widget_class_has_property (GladeWidgetClass *class, const gchar *name)
{
@ -755,14 +780,12 @@ glade_widget_class_has_property (GladeWidgetClass *class, const gchar *name)
/**
* glade_widget_class_dump_param_specs:
* @class:
* @class: a #GladeWidgetClass
*
* Dump to the console the properties of the Widget as specified
* by gtk+. You can also run glade3 with : "glade3 --dump GtkWindow" to
* Dump to the console the properties of @class as specified
* by gtk+. You can also run glade3 with : "glade-3 --dump GtkWindow" to
* get dump a widget class properties.
*
* Return Value:
**/
*/
void
glade_widget_class_dump_param_specs (GladeWidgetClass *class)
{
@ -777,7 +800,7 @@ glade_widget_class_dump_param_specs (GladeWidgetClass *class)
g_type_class_ref (class->type); /* hmm */
/* We count on the fact we have an instance, or else we'd have
* touse g_type_class_ref ();
* to use g_type_class_ref ();
*/
object_class = g_type_class_peek (class->type);
@ -810,6 +833,13 @@ glade_widget_class_dump_param_specs (GladeWidgetClass *class)
g_free (specs);
}
/**
* glade_widget_class_is:
* @class: a #GladeWidgetClass
* @name: a string
*
* Returns: %TRUE if @class is named @name, %FALSE otherwise
*/
gboolean
glade_widget_class_is (GladeWidgetClass *class, const gchar *name)
{
@ -821,4 +851,3 @@ glade_widget_class_is (GladeWidgetClass *class, const gchar *name)
return FALSE;
}

View File

@ -70,6 +70,13 @@ enum
static guint glade_widget_signals[LAST_SIGNAL] = {0};
static GObjectClass *parent_class = NULL;
/**
* glade_widget_get_type:
*
* Creates the typecode for the #GladeWidget object type.
*
* Returns: the typecode for the #GladeWidget object type
*/
GType
glade_widget_get_type (void)
{
@ -192,6 +199,15 @@ glade_widget_init (GladeWidget *widget)
widget->signals = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify) g_free, (GDestroyNotify) free_signals);
}
/**
* glade_widget_new:
* @klass: a #GladeWidgetClass
* @project: a #GladeProject
*
* TODO: write me
*
* Returns:
*/
GladeWidget *
glade_widget_new (GladeWidgetClass *klass, GladeProject *project)
{
@ -216,6 +232,17 @@ glade_widget_new (GladeWidgetClass *klass, GladeProject *project)
return (GladeWidget *) glade_widget;
}
/**
* glade_widget_new_for_internal_child:
* @klass:
* @parent:
* @internal_widget:
* @internal_name:
*
* TODO: write me
*
* Returns:
*/
GladeWidget *
glade_widget_new_for_internal_child (GladeWidgetClass *klass, GladeWidget *parent, GtkWidget *internal_widget, const char *internal_name)
{
@ -268,6 +295,13 @@ glade_widget_dispose (GObject *object)
widget->packing_properties = NULL;
}
/**
* glade_widget_add_signal_handler:
* @widget:
* @signal_handler:
*
* TODO: write me
*/
void
glade_widget_add_signal_handler (GladeWidget *widget, GladeSignal *signal_handler)
{
@ -276,6 +310,13 @@ glade_widget_add_signal_handler (GladeWidget *widget, GladeSignal *signal_handle
g_signal_emit (widget, glade_widget_signals[ADD_SIGNAL_HANDLER], 0, signal_handler);
}
/**
* glade_widget_remove_signal_handler:
* @widget:
* @signal_handler:
*
* TODO: write me
*/
void
glade_widget_remove_signal_handler (GladeWidget *widget, GladeSignal *signal_handler)
{
@ -284,6 +325,14 @@ glade_widget_remove_signal_handler (GladeWidget *widget, GladeSignal *signal_han
g_signal_emit (widget, glade_widget_signals[REMOVE_SIGNAL_HANDLER], 0, signal_handler);
}
/**
* glade_widget_change_signal_handler:
* @widget:
* @old_signal_handler:
* @new_signal_handler:
*
* TODO: write me
*/
void
glade_widget_change_signal_handler (GladeWidget *widget, GladeSignal *old_signal_handler, GladeSignal *new_signal_handler)
{
@ -358,6 +407,13 @@ glade_widget_get_real_property (GObject *object,
}
}
/**
* glade_widget_set_name:
* @widget: a #GladeWidget
* @name: a string
*
* Sets @widget's name to @name.
*/
void
glade_widget_set_name (GladeWidget *widget, const char *name)
{
@ -368,6 +424,12 @@ glade_widget_set_name (GladeWidget *widget, const char *name)
g_object_notify (G_OBJECT (widget), "name");
}
/**
* glade_widget_get_name:
* @widget: a #GladeWidget
*
* Returns: a pointer to @widget's name
*/
const char *
glade_widget_get_name (GladeWidget *widget)
{
@ -375,6 +437,13 @@ glade_widget_get_name (GladeWidget *widget)
return widget->name;
}
/**
* glade_widget_set_internal:
* @widget:
* @internal:
*
* TODO: write me
*/
void
glade_widget_set_internal (GladeWidget *widget, const char *internal)
{
@ -385,6 +454,14 @@ glade_widget_set_internal (GladeWidget *widget, const char *internal)
g_object_notify (G_OBJECT (widget), "internal");
}
/**
* glade_widget_get_internal:
* @widget: a #GladeWidget
*
* TODO: write me
*
* Returns:
*/
const char *
glade_widget_get_internal (GladeWidget *widget)
{
@ -420,6 +497,12 @@ glade_widget_set_class (GladeWidget *widget, GladeWidgetClass *klass)
widget->properties = g_list_reverse (widget->properties);
}
/**
* glade_widget_get_class:
* @widget: a #GladeWidget
*
* Returns: the #GladeWidgetclass of @widget
*/
GladeWidgetClass *
glade_widget_get_class (GladeWidget *widget)
{
@ -427,6 +510,13 @@ glade_widget_get_class (GladeWidget *widget)
return widget->widget_class;
}
/**
* glade_widget_set_project:
* @widget: a #GladeWidget
* @project: a #GladeProject
*
* Makes @widget belong to @project.
*/
void
glade_widget_set_project (GladeWidget *widget, GladeProject *project)
{
@ -438,6 +528,12 @@ glade_widget_set_project (GladeWidget *widget, GladeProject *project)
g_object_notify (G_OBJECT (widget), "project");
}
/**
* glade_widget_get_project:
* @widget: a #GladeWidget
*
* Returns: the #GladeProject that @widget belongs to
*/
GladeProject *
glade_widget_get_project (GladeWidget *widget)
{
@ -445,6 +541,13 @@ glade_widget_get_project (GladeWidget *widget)
return widget->project;
}
/**
* glade_widget_get_property:
* @widget: a #GladeWidget
* @id_property: a string naming a property
*
* Returns: the #GladeProperty in @widget named @id_property
*/
GladeProperty *
glade_widget_get_property (GladeWidget *widget, const char *id_property)
{
@ -532,17 +635,16 @@ glade_widget_find_deepest_child_at_position (GtkContainer *toplevel, GtkContaine
/**
* glade_widget_retrieve_from_position:
* @base:
* @x:
* @y:
* @base: a #GtkWidget
* @x: an int
* @y: an int
*
* Returns the real widget that was "clicked over" for a given event (coordinates) and a widget
* For example, when a label is clicked the button press event is triggered for its parent, this
* function takes the event and the widget that got the event and returns the real GladeWidget that was
* clicked
*
* Return Value:
**/
* Returns: the real widget that was "clicked over" for a given event
* (coordinates) and a widget.
* For example, when a label is clicked the button press event is triggered
* for its parent, this function takes the event and the widget that got the
* event and returns the real #GladeWidget that was clicked
*/
static GladeWidget *
glade_widget_retrieve_from_position (GtkWidget *base, int x, int y)
{
@ -721,6 +823,13 @@ glade_widget_connect_signal_handlers (GtkWidget *widget_gtk, gpointer data)
}
}
/**
* glade_widget_set_widget:
* @glade_widget:
* @widget_gtk:
*
* TODO: write me
*/
void
glade_widget_set_widget (GladeWidget *glade_widget, GtkWidget *widget_gtk)
{
@ -755,8 +864,9 @@ glade_widget_set_widget (GladeWidget *glade_widget, GtkWidget *widget_gtk)
if (glade_widget->internal == NULL)
{
/* we should set the values of the properties of this widget from the
* default values that we gather from the class of this widget */
/* we should set the values of the properties of this widget
* from the default values that we gather from the class of
* this widget */
glade_widget_apply_properties (glade_widget);
}
else
@ -770,6 +880,12 @@ glade_widget_set_widget (GladeWidget *glade_widget, GtkWidget *widget_gtk)
g_object_notify (G_OBJECT (glade_widget), "widget");
}
/**
* glade_widget_get_widget:
* @widget: a #GladeWidget
*
* Returns: the #GtkWidget associated with @widget
*/
GtkWidget *
glade_widget_get_widget (GladeWidget *widget)
{
@ -981,6 +1097,13 @@ glade_widget_set_packing_properties (GladeWidget *widget,
}
}
/**
* glade_widget_replace:
* @old_widget: a #GtkWidget
* @new_widget: a #GtkWidget
*
* TODO: write me
*/
void
glade_widget_replace (GtkWidget *old_widget, GtkWidget *new_widget)
{
@ -1045,6 +1168,15 @@ glade_widget_write_signals (gpointer key, gpointer value, gpointer user_data)
}
}
/**
* glade_widget_write:
* @widget:
* @context:
*
* TODO: write me
*
* Returns:
*/
GladeXmlNode *
glade_widget_write (GladeWidget *widget, GladeXmlContext *context)
{
@ -1393,6 +1525,14 @@ glade_widget_new_child_from_node (GladeXmlNode *node,
return TRUE;
}
/**
* glade_widget_read:
* @project: a #GladeProject
* @node: a #GladeXmlNode
*
* Returns: a new #GladeWidget in @project, based off the contents of @node
*/
GladeWidget *
glade_widget_read (GladeProject *project, GladeXmlNode *node)
{

View File

@ -1,6 +1,6 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* This functions are based on gnome-print/libgpa/gpa-xml.c which where in turn based on
* gnumeric/xml-io.c
/* This functions are based on gnome-print/libgpa/gpa-xml.c which were in turn
* based on gnumeric/xml-io.c
*/
/* Authors:
* Daniel Veillard <Daniel.Veillard@w3.org>
@ -35,8 +35,9 @@ struct _GladeXmlContext {
};
/* This is used inside for loops so that we skip xml comments <!-- i am a comment ->
* also to skip whitespace bettween nodes
/* This is used inside for loops so that we skip xml comments
* <!-- i am a comment ->
* also to skip whitespace between nodes
*/
#define skip_text(node) if ((strcmp ( ((xmlNodePtr)node)->name, "text") == 0) ||\
(strcmp ( ((xmlNodePtr)node)->name, "comment") == 0)) { \
@ -45,9 +46,13 @@ struct _GladeXmlContext {
(strcmp ( ((xmlNodePtr)node)->name, "comment") == 0)) { \
node = ((xmlNodePtr)node)->next; continue ; };
/*
* Set a string value for a node either carried as an attibute or as
* the content of a child.
/**
* glade_xml_set_value:
* @node_in: a #GladeXmlNode
* @name: a string
* @val: a string
*
* Sets the property @name in @node_in to @val
*/
void
glade_xml_set_value (GladeXmlNode *node_in, const char *name, const char *val)
@ -64,6 +69,14 @@ glade_xml_set_value (GladeXmlNode *node_in, const char *name, const char *val)
}
}
/**
* glade_xml_get_content:
* @node_in: a #GladeXmlNode
*
* Returns a string containing the content of @node_in.
* Note: It is the caller's responsibility to free the memory used by this
* string.
*/
gchar *
glade_xml_get_content (GladeXmlNode *node_in)
{
@ -78,6 +91,13 @@ glade_xml_get_content (GladeXmlNode *node_in)
return ret;
}
/**
* glade_xml_set_content:
* @node_in: a #GladeXmlNode
* @content: a string
*
* Sets the content of @node to @content.
*/
void
glade_xml_set_content (GladeXmlNode *node_in, const gchar *content)
{
@ -119,6 +139,13 @@ glade_xml_get_value (xmlNodePtr node, const char *name)
return NULL;
}
/**
* glade_xml_node_verify_silent:
* @node_in: a #GladeXmlNode
* @name: a string
*
* Returns: %TRUE if @node_in's name is equal to @name, %FALSE otherwise
*/
gboolean
glade_xml_node_verify_silent (GladeXmlNode *node_in, const gchar *name)
{
@ -131,6 +158,16 @@ glade_xml_node_verify_silent (GladeXmlNode *node_in, const gchar *name)
return TRUE;
}
/**
* glade_xml_node_verify:
* @node_in: a #GladeXmlNode
* @name: a string
*
* This is a wrapper around glade_xml_node_verify_silent(), only it emits
* a g_warning() if @node_in has a name different than @name.
*
* Returns: %TRUE if @node_in's name is equal to @name, %FALSE otherwise
*/
gboolean
glade_xml_node_verify (GladeXmlNode *node_in, const gchar *name)
{
@ -146,9 +183,16 @@ glade_xml_node_verify (GladeXmlNode *node_in, const gchar *name)
return TRUE;
}
/*
* Get an integer value for a node either carried as an attibute or as
/**
* glade_xml_get_value_int:
* @node_in: a #GladeXmlNode
* @name: a string
* @val: a pointer to an #int
*
* Gets an integer value for a node either carried as an attribute or as
* the content of a child.
*
* Returns: %TRUE if the node is found, %FALSE otherwise
*/
gboolean
glade_xml_get_value_int (GladeXmlNode *node_in, const char *name, int *val)
@ -174,14 +218,14 @@ glade_xml_get_value_int (GladeXmlNode *node_in, const char *name, int *val)
/**
* glade_xml_get_value_int_required:
* @node:
* @name:
* @val:
* @node: a #GladeXmlNode
* @name: a string
* @val: a pointer to an #int
*
* A wrapper arround get_value_int that displays a warning if the
* node did not contained the requested tag
* This is a wrapper around glade_xml_get_value_int(), only it emits
* a g_warning() if @node_in did not contain the requested tag
*
* Return Value:
* Returns:
**/
gboolean
glade_xml_get_value_int_required (GladeXmlNode *node, const char *name, int *val)
@ -640,6 +684,12 @@ glade_xml_doc_free (GladeXmlDoc *doc_in)
xmlFreeDoc (doc);
}
/**
* glade_xml_doc_get_root:
* @doc: a #GladeXmlDoc
*
* Returns: the #GladeXmlNode that is the document root of @doc
*/
GladeXmlNode *
glade_xml_doc_get_root (GladeXmlDoc *doc)
{
@ -649,4 +699,3 @@ glade_xml_doc_get_root (GladeXmlDoc *doc)
return (GladeXmlNode *)node;
}