changeset 1346:9d5cd9fa79d1

Add docs for all class structures.
author Elliott Sales de Andrade <quantum.analyst@gmail.com>
date Wed, 28 Aug 2019 16:44:51 -0400
parents 4589cb631393
children 1d54c0fddb2c
files gntbindable.h gntbox.h gntbutton.h gntcheckbox.h gntentry.h gntfilesel.h gntmenuitem.h gntslider.h gnttree.h gntwidget.h gntwindow.h gntwm.h gntws.h
diffstat 13 files changed, 156 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- a/gntbindable.h	Wed Aug 28 05:38:32 2019 -0400
+++ b/gntbindable.h	Wed Aug 28 16:44:51 2019 -0400
@@ -37,13 +37,27 @@
 
 typedef struct _GntBindable GntBindable;
 
+/**
+ * GntBindableClass:
+ * @remaps: A table of key remaps from one key to another.
+ * @actions: A table of registered names to actions, added by
+ *           gnt_bindable_class_register_action().
+ * @bindings: A table of registered keys to actions, added by
+ *            gnt_bindable_register_binding().
+ * @help_window: A #GntWindow used for displaying key binding help.
+ *
+ * The class structure for #GntBindable. Note, while documented, the fields here
+ * are private.
+ */
 struct _GntBindableClass
 {
+	/*< private >*/
 	GObjectClass parent;
 
-	GHashTable *remaps;   /* Key remaps */
-	GHashTable *actions;  /* name -> Action */
-	GHashTable *bindings; /* key -> ActionParam */
+	/*< public >*/
+	GHashTable *remaps;
+	GHashTable *actions;
+	GHashTable *bindings;
 
 	GntBindable * help_window;
 
--- a/gntbox.h	Wed Aug 28 05:38:32 2019 -0400
+++ b/gntbox.h	Wed Aug 28 16:44:51 2019 -0400
@@ -61,8 +61,14 @@
 	GNT_ALIGN_BOTTOM
 } GntAlignment;
 
+/**
+ * GntBoxClass:
+ *
+ * The class structure for #GntBox.
+ */
 struct _GntBoxClass
 {
+	/*< private >*/
 	GntWidgetClass parent;
 
 	/*< private >*/
--- a/gntbutton.h	Wed Aug 28 05:38:32 2019 -0400
+++ b/gntbutton.h	Wed Aug 28 16:44:51 2019 -0400
@@ -37,8 +37,14 @@
 
 #define GNT_TYPE_BUTTON gnt_button_get_type()
 
+/**
+ * GntButtonClass:
+ *
+ * The class structure for #GntButton.
+ */
 struct _GntButtonClass
 {
+	/*< private >*/
 	GntWidgetClass parent;
 
 	/*< private >*/
--- a/gntcheckbox.h	Wed Aug 28 05:38:32 2019 -0400
+++ b/gntcheckbox.h	Wed Aug 28 16:44:51 2019 -0400
@@ -37,10 +37,18 @@
 
 #define GNT_TYPE_CHECK_BOX gnt_check_box_get_type()
 
+/**
+ * GntCheckBoxClass:
+ * @toggled: The class closure for the #GntCheckBox::toggled signal.
+ *
+ * The class structure for #GntCheckBox.
+ */
 struct _GntCheckBoxClass
 {
+	/*< private >*/
 	GntButtonClass parent;
 
+	/*< public >*/
 	void (*toggled)(void);
 
 	/*< private >*/
--- a/gntentry.h	Wed Aug 28 05:38:32 2019 -0400
+++ b/gntentry.h	Wed Aug 28 16:44:51 2019 -0400
@@ -78,10 +78,18 @@
  */
 G_DECLARE_DERIVABLE_TYPE(GntEntry, gnt_entry, GNT, ENTRY, GntWidget)
 
+/**
+ * GntEntryClass:
+ * @text_changed: The class closure for the #GntEntry::text-changed signal.
+ *
+ * The class structure for #GntEntry.
+ */
 struct _GntEntryClass
 {
+	/*< private >*/
 	GntWidgetClass parent;
 
+	/*< public >*/
 	void (*text_changed)(GntEntry *entry);
 
 	/*< private >*/
--- a/gntfilesel.h	Wed Aug 28 05:38:32 2019 -0400
+++ b/gntfilesel.h	Wed Aug 28 16:44:51 2019 -0400
@@ -45,10 +45,19 @@
  */
 G_DECLARE_DERIVABLE_TYPE(GntFileSel, gnt_file_sel, GNT, FILE_SEL, GntWindow)
 
+/**
+ * GntFileSelClass:
+ * @file_selected: The class closure for the #GntFileSel::file-selected signal.
+ * @cancelled: The class closure for the #GntFileSel::cancelled signal.
+ *
+ * The class structure for #GntFileSel.
+ */
 struct _GntFileSelClass
 {
+	/*< private >*/
 	GntWindowClass parent;
 
+	/*< public >*/
 	void (*file_selected)(GntFileSel *sel, const char *path,
 	                      const char *filename);
 	void (*cancelled)(GntFileSel *sel);
--- a/gntmenuitem.h	Wed Aug 28 05:38:32 2019 -0400
+++ b/gntmenuitem.h	Wed Aug 28 16:44:51 2019 -0400
@@ -41,8 +41,14 @@
 
 typedef void (*GntMenuItemCallback)(GntMenuItem *item, gpointer data);
 
+/**
+ * GntMenuItemClass:
+ *
+ * The class structure for #GntMenuItem.
+ */
 struct _GntMenuItemClass
 {
+	/*< private >*/
 	GObjectClass parent;
 
 	/*< private >*/
--- a/gntslider.h	Wed Aug 28 05:38:32 2019 -0400
+++ b/gntslider.h	Wed Aug 28 16:44:51 2019 -0400
@@ -46,10 +46,20 @@
  */
 G_DECLARE_DERIVABLE_TYPE(GntSlider, gnt_slider, GNT, SLIDER, GntWidget)
 
+/**
+ * GntSliderClass:
+ * @changed: The class closure for the #GntSlider::changed signal.
+ *
+ * The class structure for #GntSlider.
+ *
+ * Since: 2.1.0
+ */
 struct _GntSliderClass
 {
+	/*< private >*/
 	GntWidgetClass parent;
 
+	/*< public >*/
 	void (*changed)(GntSlider *slider, int value);
 
 	/*< private >*/
--- a/gnttree.h	Wed Aug 28 05:38:32 2019 -0400
+++ b/gnttree.h	Wed Aug 28 16:44:51 2019 -0400
@@ -53,10 +53,20 @@
  */
 G_DECLARE_DERIVABLE_TYPE(GntTree, gnt_tree, GNT, TREE, GntWidget)
 
+/**
+ * GntTreeClass:
+ * @selection_changed: The class closure for the #GntTree::selection-changed
+ *                     signal.
+ * @toggled: The class closure for the #GntTree::toggled signal.
+ *
+ * The class structure for #GntTree.
+ */
 struct _GntTreeClass
 {
+	/*< private >*/
 	GntWidgetClass parent;
 
+	/*< public >*/
 	void (*selection_changed)(GntTreeRow *old, GntTreeRow * current);
 	void (*toggled)(GntTree *tree, gpointer key);
 
--- a/gntwidget.h	Wed Aug 28 05:38:32 2019 -0400
+++ b/gntwidget.h	Wed Aug 28 16:44:51 2019 -0400
@@ -68,14 +68,37 @@
  */
 G_DECLARE_DERIVABLE_TYPE(GntWidget, gnt_widget, GNT, WIDGET, GntBindable)
 
+/**
+ * GntWidgetClass:
+ * @map: The class closure for the #GntWidget::map signal.
+ * @show: This will call draw() and take focus (if it can take focus).
+ * @destroy: The class closure for the #GntWidget::destroy signal.
+ * @draw: The class closure for the #GntWidget::draw signal. This will draw the
+ *        widget.
+ * @hide: The class closure for the #GntWidget::hide signal.
+ * @expose: The class closure for the #GntWidget::expose signal.
+ * @gained_focus: The class closure for the #GntWidget::gained-focus signal.
+ * @lost_focus: The class closure for the #GntWidget::lost-focus signal.
+ * @size_request: The class closure for the #GntWidget::size-request signal.
+ * @confirm_size: The class closure for the #GntWidget::confirm-size signal.
+ * @size_changed: The class closure for the #GntWidget::size-changed signal.
+ * @set_position: The class closure for the #GntWidget::position-set signal.
+ * @key_pressed: The class closure for the #GntWidget::key-pressed signal.
+ * @activate: The class closure for the #GntWidget::activate signal.
+ * @clicked: The class closure for the #GntWidget::clicked signal.
+ *
+ * The class structure for #GntWidget.
+ */
 struct _GntWidgetClass
 {
+	/*< private >*/
 	GntBindableClass parent;
 
+	/*< public >*/
 	void (*map)(GntWidget *widget);
-	void (*show)(GntWidget *widget);		/* This will call draw() and take focus (if it can take focus) */
+	void (*show)(GntWidget *widget);
 	void (*destroy)(GntWidget *widget);
-	void (*draw)(GntWidget *widget);		/* This will draw the widget */
+	void (*draw)(GntWidget *widget);
 	void (*hide)(GntWidget *widget);
 	void (*expose)(GntWidget *widget, int x, int y, int width, int height);
 	void (*gained_focus)(GntWidget *widget);
--- a/gntwindow.h	Wed Aug 28 05:38:32 2019 -0400
+++ b/gntwindow.h	Wed Aug 28 16:44:51 2019 -0400
@@ -52,8 +52,14 @@
 	GNT_WINDOW_MAXIMIZE_Y = 1 << 1,
 } GntWindowFlags;
 
+/**
+ * GntWindowClass:
+ *
+ * The class structure for #GntWindow.
+ */
 struct _GntWindowClass
 {
+	/*< private >*/
 	GntBoxClass parent;
 
 	/*< private >*/
--- a/gntwm.h	Wed Aug 28 05:38:32 2019 -0400
+++ b/gntwm.h	Wed Aug 28 16:44:51 2019 -0400
@@ -69,56 +69,64 @@
  */
 G_DECLARE_DERIVABLE_TYPE(GntWM, gnt_wm, GNT, WM, GntBindable)
 
+/**
+ * GntWMClass:
+ * @new_window: The class closure for the #GntWM::new-win signal. This is called
+ *              when a new window is shown.
+ * @decorate_window: The class closure for the #GntWM::decorate-win signal.
+ * @close_window: The class closure for the #GntWM::close-win signal. This is
+ *                called when a window is being closed.
+ * @window_resize_confirm: The class closure for the #GntWM::confirm-resize
+ *                         signal. The WM may want to confirm a size for a
+ *                         window first.
+ * @window_resized: The class closure for the #GntWM::window-resized signal.
+ * @window_move_confirm: The class closure for the #GntWM::confirm-move signal.
+ *                       The WM may want to confirm the position of a window.
+ * @window_moved: The class closure for the #GntWM::window-moved signal.
+ * @window_update: The class closure for the #GntWM::window-update signal. This
+ *                 gets called when:
+ *                 - the title of the window changes
+ *                 - the 'urgency' of the window changes
+ * @key_pressed: This should usually return %NULL if the keys were processed by
+ *               the WM. If not, the WM can simply return the original string,
+ *               which will be processed by the default WM. The custom WM can
+ *               also return a different static string for the default WM to
+ *               process.
+ * @mouse_clicked: The class closure for the #GntWM::mouse-clicked signal.
+ * @give_focus: The class closure for the #GntWM::give-focus signal. Whatever
+ *              the WM wants to do when a window is given focus.
+ * @terminal_refresh: The class closure for the #GntWM::terminal-refresh signal.
+ *                    This is invoked whenever the terminal window is resized,
+ *                    or the screen session is attached to a new terminal.
+ *                    (i.e., from the SIGWINCH callback)
+ *                    Since: 2.1.0
+ *
+ * The class structure for #GntWM.
+ */
 struct _GntWMClass
 {
+	/*< private >*/
 	GntBindableClass parent;
 
-	/* This is called when a new window is shown */
-	void (*new_window)(GntWM *wm, GntWidget *widget);
+	/*< public >*/
 
+	void (*new_window)(GntWM *wm, GntWidget *widget);
 	void (*decorate_window)(GntWM *wm, GntWidget *win);
-	/* This is called when a window is being closed */
 	gboolean (*close_window)(GntWM *wm, GntWidget *win);
 
-	/* The WM may want to confirm a size for a window first */
 	gboolean (*window_resize_confirm)(GntWM *wm, GntWidget *win, int *w, int *h);
-
 	void (*window_resized)(GntWM *wm, GntNode *node);
 
-	/* The WM may want to confirm the position of a window */
 	gboolean (*window_move_confirm)(GntWM *wm, GntWidget *win, int *x, int *y);
-
 	void (*window_moved)(GntWM *wm, GntNode *node);
 
-	/* This gets called when:
-	 * 	 - the title of the window changes
-	 * 	 - the 'urgency' of the window changes
-	 */
 	void (*window_update)(GntWM *wm, GntNode *node);
 
-	/* This should usually return NULL if the keys were processed by the WM.
-	 * If not, the WM can simply return the original string, which will be
-	 * processed by the default WM. The custom WM can also return a different
-	 * static string for the default WM to process.
-	 */
 	gboolean (*key_pressed)(GntWM *wm, const char *key);
-
 	gboolean (*mouse_clicked)(GntWM *wm, GntMouseEvent event, int x, int y, GntWidget *widget);
 
-	/* Whatever the WM wants to do when a window is given focus */
 	void (*give_focus)(GntWM *wm, GntWidget *widget);
 
-	/* List of windows. Although the WM can keep a list of its own for the windows,
-	 * it'd be better if there was a way to share between the 'core' and the WM.
-	 */
-	/*GList *(*window_list)();*/
-
-	/* This is invoked whenever the terminal window is resized, or the
-	 * screen session is attached to a new terminal. (ie, from the
-	 * SIGWINCH callback)
-	 *
-	 * Since: 2.1.0
-	 */
 	void (*terminal_refresh)(GntWM *wm);
 
 	/*< private >*/
--- a/gntws.h	Wed Aug 28 05:38:32 2019 -0400
+++ b/gntws.h	Wed Aug 28 16:44:51 2019 -0400
@@ -47,10 +47,18 @@
  */
 G_DECLARE_DERIVABLE_TYPE(GntWS, gnt_ws, GNT, WS, GntBindable)
 
+/**
+ * GntWSClass:
+ * @draw_taskbar: This is never called?
+ *
+ * The class structure for #GntWS.
+ */
 struct _GntWSClass
 {
+	/*< private >*/
 	GntBindableClass parent;
 
+	/*< public >*/
 	void (*draw_taskbar)(GntWS *ws, gboolean reposition);
 
 	/*< private >*/