[Xfce4-commits] [xfce/libxfce4ui] 04/04: Rename introspection GIR to 4ui-2.0 to match util

noreply at xfce.org noreply at xfce.org
Sat Jun 24 19:35:29 CEST 2017


This is an automated email from the git hooks/post-receive script.

e   r   i   c       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository xfce/libxfce4ui.

commit e27efecb8c86038e8c4d3e44f64c1880b8053de3
Author: Eric Koegel <eric.koegel at gmail.com>
Date:   Sat Jun 24 15:00:26 2017 +0300

    Rename introspection GIR to 4ui-2.0 to match util
    
    Add introspection annotations and add a hello world python
    example.
---
 .gitignore                           |  7 +++--
 libxfce4ui/Makefile.am               | 18 ++++++-------
 libxfce4ui/xfce-dialogs.c            | 52 ++++++++++++++++++------------------
 libxfce4ui/xfce-gdk-extensions.c     |  2 +-
 libxfce4ui/xfce-gtk-extensions.c     | 10 +++----
 libxfce4ui/xfce-sm-client.c          |  8 +++---
 libxfce4ui/xfce-spawn.c              | 26 +++++++++---------
 libxfce4ui/xfce-titled-dialog.c      | 12 ++++-----
 python-example/test-introspection.py | 26 ++++++++++++++++++
 9 files changed, 95 insertions(+), 66 deletions(-)

diff --git a/.gitignore b/.gitignore
index e390580..744986b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -66,8 +66,8 @@ libxfce4ui/libxfce4ui-marshal.c
 libxfce4ui/libxfce4ui-marshal.h
 libxfce4ui/stamp-libxfce4ui-enum-types.h
 libxfce4ui/stamp-libxfce4ui-marshal.h
-libxfce4ui/libxfce4ui-2.gir
-libxfce4ui/libxfce4ui-2.typelib
+libxfce4ui/libxfce4ui-2.0.gir
+libxfce4ui/libxfce4ui-2.0.typelib
 xfce4-about/about-dialog-ui.h
 xfce4-about/xfce4-about
 xfce4-about/xfce4-about.desktop
@@ -90,3 +90,6 @@ docs/test-suite.log
 libxfce4ui/abicheck.sh.log
 libxfce4ui/abicheck.sh.trs
 libxfce4ui/test-suite.log
+
+# example folder location
+python-example/html/
diff --git a/libxfce4ui/Makefile.am b/libxfce4ui/Makefile.am
index cb68aad..00d27ee 100644
--- a/libxfce4ui/Makefile.am
+++ b/libxfce4ui/Makefile.am
@@ -112,15 +112,15 @@ INTROSPECTION_COMPILER_ARGS = \
 	--includedir=.
 
 if HAVE_INTROSPECTION
-introspection_sources = $(filter-out %private.h %.c, $(libxfce4ui_2_la_SOURCES))
-
-libxfce4ui-2.gir: libxfce4ui-2.la Makefile
-libxfce4ui_2_gir_INCLUDES = GObject-2.0 GLib-2.0 Gtk-3.0 libxfce4util-1.0
-libxfce4ui_2_gir_CFLAGS = $(AM_CPPFLAGS)
-libxfce4ui_2_gir_LIBS = libxfce4ui-2.la
-libxfce4ui_2_gir_FILES = $(introspection_sources)
-libxfce4ui_2_gir_EXPORT_PACKAGES = libxfce4ui-2
-INTROSPECTION_GIRS += libxfce4ui-2.gir
+introspection_sources = $(filter-out %private.h, $(libxfce4ui_2_la_SOURCES))
+
+libxfce4ui-2.0.gir: libxfce4ui-2.la Makefile
+libxfce4ui_2_0_gir_INCLUDES = GObject-2.0 GLib-2.0 Gtk-3.0 libxfce4util-1.0
+libxfce4ui_2_0_gir_CFLAGS = $(AM_CPPFLAGS)
+libxfce4ui_2_0_gir_LIBS = libxfce4ui-2.la
+libxfce4ui_2_0_gir_FILES = $(introspection_sources)
+libxfce4ui_2_0_gir_EXPORT_PACKAGES = libxfce4ui-2
+INTROSPECTION_GIRS += libxfce4ui-2.0.gir
 
 girdir = $(datadir)/gir-1.0
 gir_DATA = $(INTROSPECTION_GIRS)
diff --git a/libxfce4ui/xfce-dialogs.c b/libxfce4ui/xfce-dialogs.c
index 7f84e8c..07ff515 100644
--- a/libxfce4ui/xfce-dialogs.c
+++ b/libxfce4ui/xfce-dialogs.c
@@ -140,12 +140,12 @@ xfce_dialog_show_help_response (GtkWidget *dialog,
 
 /**
  * xfce_dialog_show_help:
- * @parent    : transient parent of the dialog, or %NULL.
- * @component : name of the component opening the help page or %NULL. If the
+ * @parent    : (allow-none): transient parent of the dialog, or %NULL.
+ * @component : (allow-none): name of the component opening the help page or %NULL. If the
  *              value is %NULL the target will be the main page of the
  *              documentation website.
- * @page      : subpage of the @component on the website or %NULL.
- * @offset    : anchor offset in @page or %NULL.
+ * @page      : (allow-none): subpage of the @component on the website or %NULL.
+ * @offset    : (allow-none): anchor offset in @page or %NULL.
  *
  * Asks the user to visit the online documentation. If confirmed, it will open
  * the webbrowser and redirect the user to the correct location.
@@ -170,13 +170,13 @@ xfce_dialog_show_help (GtkWindow   *parent,
 
 /**
  * xfce_dialog_show_help_with_version:
- * @parent    : transient parent of the dialog, or %NULL.
- * @component : name of the component opening the help page or %NULL. If the
+ * @parent    : (allow-none): transient parent of the dialog, or %NULL.
+ * @component : (allow-none): name of the component opening the help page or %NULL. If the
  *              value is %NULL the target will be the main page of the
  *              documentation website.
- * @page      : subpage of the @component on the website or %NULL.
- * @offset    : anchor offset in @page or %NULL.
- * @version   : alternative version, or %NULL to use xfce_version_string().
+ * @page      : (allow-none): subpage of the @component on the website or %NULL.
+ * @offset    : (allow-none): anchor offset in @page or %NULL.
+ * @version   : (allow-none): alternative version, or %NULL to use xfce_version_string().
  *
  * Asks the user to visit the online documentation. If confirmed, it will open
  * the webbrowser and redirect the user to the correct location.
@@ -321,8 +321,8 @@ xfce_dialog_show_help_with_version (GtkWindow   *parent,
 
 /**
  * xfce_dialog_show_info:
- * @parent         : transient parent of the dialog, or %NULL.
- * @secondary_text : secondary text of the dialog or %NULL.
+ * @parent         : (allow-none): transient parent of the dialog, or %NULL.
+ * @secondary_text : (allow-none): secondary text of the dialog or %NULL.
  * @primary_format : the printf()-style format for the primary problem description.
  * @...            : argument list for the @format.
  *
@@ -364,8 +364,8 @@ xfce_dialog_show_info (GtkWindow   *parent,
 
 /**
  * xfce_dialog_show_warning:
- * @parent         : transient parent of the dialog, or %NULL.
- * @secondary_text : secondary text of the dialog or %NULL.
+ * @parent         : (allow-none): transient parent of the dialog, or %NULL.
+ * @secondary_text : (allow-none): secondary text of the dialog or %NULL.
  * @primary_format : the printf()-style format for the primary problem description.
  * @...            : argument list for the @format.
  *
@@ -407,8 +407,8 @@ xfce_dialog_show_warning (GtkWindow   *parent,
 
 /**
  * xfce_dialog_show_error:
- * @parent         : transient parent of the dialog, or %NULL.
- * @error          : a #GError, which gives a more precise description of the problem or %NULL.
+ * @parent         : (allow-none): transient parent of the dialog, or %NULL.
+ * @error          : (allow-none): a #GError, which gives a more precise description of the problem or %NULL.
  * @primary_format : the printf()-style format for the primary problem description.
  * @...            : argument list for the @primary_format.
  *
@@ -451,12 +451,12 @@ xfce_dialog_show_error (GtkWindow    *parent,
 
 /**
  * xfce_dialog_confirm:
- * @parent         : transient parent of the dialog, or %NULL.
+ * @parent         : (allow-none): transient parent of the dialog, or %NULL.
  * @stock_id       : the stock name of the confirm button, for example #GTK_STOCK_YES or #GTK_STOCK_CLEAR.
- * @confirm_label  : if non-%NULL, this text is used on the confirm button together with the @stock_id icon.
- * @secondary_text : secondary text in the dialog.
- * @primary_format : the printf()-style format for the dialog question.
- * @...            : argument list for the @primary_format.
+ * @confirm_label  : (allow-none): if non-%NULL, this text is used on the confirm button together with the @stock_id icon.
+ * @secondary_text : (allow-none): secondary text in the dialog.
+ * @primary_format : (allow-none): the printf()-style format for the dialog question.
+ * @...            : (allow-none): argument list for the @primary_format.
  *
  * Runs a questions dialog, that has a 'Cancel' and a 'Confirm' button. The 'Confirm'
  * button text can be set by @action if given.
@@ -530,8 +530,8 @@ xfce_dialog_confirm (GtkWindow   *parent,
 
 /**
  * xfce_message_dialog_new_valist:
- * @parent            : transient parent of the dialog, or %NULL.
- * @title             : title of the dialog, or %NULL.
+ * @parent            : (allow-none): transient parent of the dialog, or %NULL.
+ * @title             : (allow-none): title of the dialog, or %NULL.
  * @icon_stock_id     : gtk stock icon name to show in the dialog.
  * @primary_text      : primary text shown in large bold font.
  * @secondary_text    : secondary text shown in normal font.
@@ -808,8 +808,8 @@ xfce_message_dialog_new_valist (GtkWindow   *parent,
 
 /**
  * xfce_message_dialog_new:
- * @parent            : transient parent of the dialog, or %NULL.
- * @title             : title of the dialog, or %NULL.
+ * @parent            : (allow-none): transient parent of the dialog, or %NULL.
+ * @title             : (allow-none): title of the dialog, or %NULL.
  * @stock_id          : gtk stock icon name to show in the dialog.
  * @primary_text      : primary text shown in large bold font.
  * @secondary_text    : secondary text shown in normal font.
@@ -906,8 +906,8 @@ xfce_message_dialog_new (GtkWindow   *parent,
 
 /**
  * xfce_message_dialog:
- * @parent            : transient parent of the dialog, or %NULL.
- * @title             : title of the dialog, or %NULL.
+ * @parent            : (allow-none): transient parent of the dialog, or %NULL.
+ * @title             : (allow-none): title of the dialog, or %NULL.
  * @stock_id          : gtk stock icon name to show in the dialog.
  * @primary_text      : primary text shown in large bold font.
  * @secondary_text    : secondary text shown in normal font.
diff --git a/libxfce4ui/xfce-gdk-extensions.c b/libxfce4ui/xfce-gdk-extensions.c
index 7b1e0b9..69dc7bf 100644
--- a/libxfce4ui/xfce-gdk-extensions.c
+++ b/libxfce4ui/xfce-gdk-extensions.c
@@ -48,7 +48,7 @@
 
 /**
  * xfce_gdk_screen_get_active:
- * @monitor_return : Address to store the monitor number to or %NULL.
+ * @monitor_return : (out) (allow-none): Address to store the monitor number to or %NULL.
  *
  * Returns the currently active #GdkScreen, that is, the screen which
  * currently contains the pointer. If no active screen was found, the
diff --git a/libxfce4ui/xfce-gtk-extensions.c b/libxfce4ui/xfce-gtk-extensions.c
index 94a705f..6355485 100644
--- a/libxfce4ui/xfce-gtk-extensions.c
+++ b/libxfce4ui/xfce-gtk-extensions.c
@@ -102,7 +102,7 @@ xfce_gtk_button_new_mixed (const gchar *stock_id,
 /**
  * xfce_gtk_frame_box_new:
  * @label            : the text to use as the label of the frame.
- * @container_return : return location for the frame's container.
+ * @container_return : (out) (allow-none): return location for the frame's container.
  *
  * Creates an Xfce-styled frame. The frame is a #GtkFrame, without
  * outline and an optional bolded text label.  The contents of the
@@ -221,10 +221,10 @@ xfce_gtk_window_center_on_active_screen (GtkWindow *window)
 /**
  * xfce_gtk_menu_popup_until_mapped:
  * @menu: a #GtkMenu.
- * @parent_menu_shell: the menu shell containing the triggering menu item, or %NULL.
- * @parent_menu_item: the menu item whose activation triggered the popup, or %NULL.
- * @func: (scope call): a user supplied function used to position the menu, or %NULL.
- * @data: user supplied data to be passed to func.
+ * @parent_menu_shell: (allow-none): the menu shell containing the triggering menu item, or %NULL.
+ * @parent_menu_item: (allow-none): the menu item whose activation triggered the popup, or %NULL.
+ * @func: (scope call) (allow-none): a user supplied function used to position the menu, or %NULL.
+ * @data: (allow-none): user supplied data to be passed to func.
  * @button: the mouse button which was pressed to initiate the event.
  * @activate_time: the time at which the activation event occurred.
  *
diff --git a/libxfce4ui/xfce-sm-client.c b/libxfce4ui/xfce-sm-client.c
index a053d14..8b1d503 100644
--- a/libxfce4ui/xfce-sm-client.c
+++ b/libxfce4ui/xfce-sm-client.c
@@ -1442,7 +1442,7 @@ xfce_sm_client_get_option_group(gint  argc,
 }
 
 /**
- * xfce_sm_client_get:
+ * xfce_sm_client_get: (constructor)
  *
  * Gets the application's SM client instance.  This is best
  * used with xfce_sm_client_get_option_group() above (and using
@@ -1471,7 +1471,7 @@ xfce_sm_client_get(void)
 }
 
 /**
- * xfce_sm_client_get_with_argv:
+ * xfce_sm_client_get_with_argv: (constructor)
  * @argc: The number of arguments passed to main()
  * @argv: The argument vector passed to main()
  * @restart_style: An #XfceSMClientRestartStyle
@@ -1505,7 +1505,7 @@ xfce_sm_client_get_with_argv(gint argc,
 }
 
 /**
- * xfce_sm_client_get_full:
+ * xfce_sm_client_get_full: (constructor)
  * @restart_style: An XfceSMClientRestartStyle
  * @priority: A restart priority
  * @resumed_client_id: The client id used in the previous session
@@ -1548,7 +1548,7 @@ xfce_sm_client_get_full(XfceSMClientRestartStyle restart_style,
 /**
  * xfce_sm_client_connect:
  * @sm_client: An #XfceSMClient
- * @error: A #GError location.
+ * @error: (out) (allow-none) (transfer full): A #GError location.
  *
  * Attempts to connect to the session manager.
  *
diff --git a/libxfce4ui/xfce-spawn.c b/libxfce4ui/xfce-spawn.c
index ced3c89..a31c359 100644
--- a/libxfce4ui/xfce-spawn.c
+++ b/libxfce4ui/xfce-spawn.c
@@ -262,12 +262,12 @@ xfce_spawn_get_active_workspace_number (GdkScreen *screen)
 
 /**
  * xfce_spawn_on_screen_with_child_watch:
- * @screen              : a #GdkScreen or %NULL to use the active screen,
+ * @screen              : (allow-none): a #GdkScreen or %NULL to use the active screen,
  *                        see xfce_gdk_screen_get_active().
- * @working_directory   : child's current working directory or %NULL to
+ * @working_directory   : (allow-none): child's current working directory or %NULL to
  *                        inherit parent's.
  * @argv                : child's argument vector.
- * @envp                : child's environment vector or %NULL to inherit
+ * @envp                : (allow-none): child's environment vector or %NULL to inherit
  *                        parent's.
  * @flags               : flags from #GSpawnFlags. #G_SPAWN_DO_NOT_REAP_CHILD
  *                        is not allowed, you should use the
@@ -279,10 +279,10 @@ xfce_spawn_get_active_workspace_number (GdkScreen *screen)
  *                        have direct access to the event time you could use
  *                        gtk_get_current_event_time() or if nothing is
  *                        available 0 is valid too.
- * @startup_icon_name   : application icon or %NULL.
- * @child_watch_closure : closure that is triggered when the child exists
+ * @startup_icon_name   : (allow-none): application icon or %NULL.
+ * @child_watch_closure : (allow-none): closure that is triggered when the child exists
  *                        or %NULL.
- * @error               : return location for errors or %NULL.
+ * @error               : (out) (allow-none) (transfer full): return location for errors or %NULL.
  *
  * Like xfce_spawn_on_screen(), but allows to attach a closure to watch the
  * child's exit status. This because only one g_child_watch_add() is allowed on
@@ -483,12 +483,12 @@ xfce_spawn_on_screen_with_child_watch (GdkScreen    *screen,
 
 /**
  * xfce_spawn_on_screen:
- * @screen            : a #GdkScreen or %NULL to use the active screen,
+ * @screen            : (allow-none): a #GdkScreen or %NULL to use the active screen,
  *                      see xfce_gdk_screen_get_active().
- * @working_directory : child's current working directory or %NULL to
+ * @working_directory : (allow-none): child's current working directory or %NULL to
  *                      inherit parent's.
  * @argv              : child's argument vector.
- * @envp              : child's environment vector or %NULL to inherit
+ * @envp              : (allow-none): child's environment vector or %NULL to inherit
  *                      parent's.
  * @flags             : flags from #GSpawnFlags. #G_SPAWN_DO_NOT_REAP_CHILD
  *                      is not allowed, use xfce_spawn_on_screen_with_child_watch()
@@ -500,8 +500,8 @@ xfce_spawn_on_screen_with_child_watch (GdkScreen    *screen,
  *                      have direct access to the event time you could use
  *                      gtk_get_current_event_time() or if nothing is
  *                      available 0 is valid too.
- * @startup_icon_name : application icon or %NULL.
- * @error             : return location for errors or %NULL.
+ * @startup_icon_name : (allow-none): application icon or %NULL.
+ * @error             : (out) (allow-none) (transfer full): return location for errors or %NULL.
  *
  * Like gdk_spawn_on_screen(), but also supports startup notification
  * (if Libxfce4ui was built with startup notification support).
@@ -529,11 +529,11 @@ xfce_spawn_on_screen (GdkScreen    *screen,
 
 /**
  * xfce_spawn_command_line_on_screen:
- * @screen            : a #GdkScreen or %NULL to use the active screen, see xfce_gdk_screen_get_active().
+ * @screen            : (allow-none): a #GdkScreen or %NULL to use the active screen, see xfce_gdk_screen_get_active().
  * @command_line      : command line to run.
  * @in_terminal       : whether to run @command_line in a terminal.
  * @startup_notify    : whether to use startup notification.
- * @error             : location for a #GError or %NULL.
+ * @error             : (out) (allow-none) (transfer full): location for a #GError or %NULL.
  *
  * Executes the given @command_line and returns %TRUE if the
  * command terminated successfully. Else, the @error is set
diff --git a/libxfce4ui/xfce-titled-dialog.c b/libxfce4ui/xfce-titled-dialog.c
index 0d948d9..9e24399 100644
--- a/libxfce4ui/xfce-titled-dialog.c
+++ b/libxfce4ui/xfce-titled-dialog.c
@@ -279,10 +279,10 @@ xfce_titled_dialog_new (void)
 
 /**
  * xfce_titled_dialog_new_with_buttons:
- * @title             : title of the dialog, or %NULL.
- * @parent            : transient parent window of the dialog, or %NULL.
+ * @title             : (allow-none): title of the dialog, or %NULL.
+ * @parent            : (allow-none): transient parent window of the dialog, or %NULL.
  * @flags             : from #GtkDialogFlags.
- * @first_button_text : stock ID or text to go in first, or %NULL.
+ * @first_button_text : (allow-none): stock ID or text to go in first, or %NULL.
  * @...               : response ID for the first button, then additional buttons, ending with %NULL.
  *
  * See the documentation of gtk_dialog_new_with_buttons() for details about the
@@ -330,11 +330,11 @@ xfce_titled_dialog_new_with_buttons (const gchar    *title,
 
 /**
  * xfce_titled_dialog_new_with_mixed_buttons:
- * @title                  : title of the dialog, or %NULL.
- * @parent                 : transient parent window of the dialog, or %NULL.
+ * @title                  :  (allow-none):title of the dialog, or %NULL.
+ * @parent                 : (allow-none): transient parent window of the dialog, or %NULL.
  * @flags                  : from #GtkDialogFlags.
  * @first_button_icon_name : icon name to go in first, or "" for no icon.
- * @first_button_text      : text to go in first, or %NULL.
+ * @first_button_text      : (allow-none): text to go in first, or %NULL.
  * @...                    : response ID for the first button, then additional buttons, ending with %NULL.
  *
  * Creates an #XfceTitledDialog using xfce_gtk_button_new_mixed. This allows
diff --git a/python-example/test-introspection.py b/python-example/test-introspection.py
new file mode 100755
index 0000000..0bcadea
--- /dev/null
+++ b/python-example/test-introspection.py
@@ -0,0 +1,26 @@
+#!/usr/bin/env python3
+
+# You can generate python documentation with the following commands:
+# g-ir-doc-tool --language Python -o ./html ../libxfce4ui/libxfce4ui-2.0.gir
+# yelp ./html/
+
+import gi.repository
+# Set the search path to use the newly generated introspection files
+gi.require_version('GIRepository', '2.0')
+from gi.repository import GIRepository
+GIRepository.Repository.prepend_search_path('../libxfce4ui/')
+# randomly search for libxfce4util's gir and typelib
+GIRepository.Repository.prepend_search_path('/usr/local/share/gir-1.0/')
+GIRepository.Repository.prepend_search_path('/usr/local/lib/girepository-1.0/')
+# Now import 4ui
+gi.require_version('libxfce4ui', '2.0')
+from gi.repository import libxfce4ui
+# and Gtk3
+gi.require_version('Gtk', '3.0')
+from gi.repository import Gtk
+
+# see if it works
+titled_dialog = libxfce4ui.TitledDialog(subtitle="    Hello Xfce Python Developer!    ")
+titled_dialog.connect("delete-event", Gtk.main_quit)
+titled_dialog.show()
+Gtk.main()

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list