[gnome-builder] genesis: add interface helpers



commit 7812452196edcce15a9da0e4f22f1cc97b9b0595
Author: Christian Hergert <chergert redhat com>
Date:   Thu Jun 30 02:23:19 2016 -0700

    genesis: add interface helpers
    
    We need a few more strings from the interface. While I am really not a
    big fan of this sort of design (as opposed to giving the addins more
    control over their destiny) this seems to be the easiest way forward.

 libide/genesis/ide-genesis-addin.c |   33 +++++++++++++++++++++++++
 libide/genesis/ide-genesis-addin.h |   46 ++++++++++++++++++++---------------
 2 files changed, 59 insertions(+), 20 deletions(-)
---
diff --git a/libide/genesis/ide-genesis-addin.c b/libide/genesis/ide-genesis-addin.c
index f5004a2..ad101cc 100644
--- a/libide/genesis/ide-genesis-addin.c
+++ b/libide/genesis/ide-genesis-addin.c
@@ -81,3 +81,36 @@ ide_genesis_addin_run_finish (IdeGenesisAddin  *self,
 
   return IDE_GENESIS_ADDIN_GET_IFACE (self)->run_finish (self, result, error);
 }
+
+gint
+ide_genesis_addin_get_priority (IdeGenesisAddin *self)
+{
+  g_return_val_if_fail (IDE_IS_GENESIS_ADDIN (self), 0);
+
+  if (IDE_GENESIS_ADDIN_GET_IFACE (self)->get_priority)
+    return IDE_GENESIS_ADDIN_GET_IFACE (self)->get_priority (self);
+
+  return 0;
+}
+
+gchar *
+ide_genesis_addin_get_label (IdeGenesisAddin *self)
+{
+  g_return_val_if_fail (IDE_IS_GENESIS_ADDIN (self), NULL);
+
+  if (IDE_GENESIS_ADDIN_GET_IFACE (self)->get_label)
+    return IDE_GENESIS_ADDIN_GET_IFACE (self)->get_label (self);
+
+  return NULL;
+}
+
+gchar *
+ide_genesis_addin_get_next_label (IdeGenesisAddin *self)
+{
+  g_return_val_if_fail (IDE_IS_GENESIS_ADDIN (self), NULL);
+
+  if (IDE_GENESIS_ADDIN_GET_IFACE (self)->get_next_label)
+    return IDE_GENESIS_ADDIN_GET_IFACE (self)->get_next_label (self);
+
+  return NULL;
+}
diff --git a/libide/genesis/ide-genesis-addin.h b/libide/genesis/ide-genesis-addin.h
index d7fefab..de2abfc 100644
--- a/libide/genesis/ide-genesis-addin.h
+++ b/libide/genesis/ide-genesis-addin.h
@@ -31,28 +31,34 @@ struct _IdeGenesisAddinInterface
 {
   GTypeInterface parent_interface;
 
-  gchar     *(*get_title)     (IdeGenesisAddin      *self);
-  gchar     *(*get_icon_name) (IdeGenesisAddin      *self);
-  GtkWidget *(*get_widget)    (IdeGenesisAddin      *self);
-  void       (*run_async)     (IdeGenesisAddin      *self,
-                               GCancellable         *cancellable,
-                               GAsyncReadyCallback   callback,
-                               gpointer              user_data);
-  gboolean   (*run_finish)    (IdeGenesisAddin      *self,
-                               GAsyncResult         *result,
-                               GError              **error);
+  gchar     *(*get_title)      (IdeGenesisAddin      *self);
+  gchar     *(*get_icon_name)  (IdeGenesisAddin      *self);
+  GtkWidget *(*get_widget)     (IdeGenesisAddin      *self);
+  void       (*run_async)      (IdeGenesisAddin      *self,
+                                GCancellable         *cancellable,
+                                GAsyncReadyCallback   callback,
+                                gpointer              user_data);
+  gboolean   (*run_finish)     (IdeGenesisAddin      *self,
+                                GAsyncResult         *result,
+                                GError              **error);
+  gchar     *(*get_label)      (IdeGenesisAddin      *self);
+  gchar     *(*get_next_label) (IdeGenesisAddin      *self);
+  gint       (*get_priority)   (IdeGenesisAddin      *self);
 };
 
-gchar     *ide_genesis_addin_get_title     (IdeGenesisAddin      *self);
-gchar     *ide_genesis_addin_get_icon_name (IdeGenesisAddin      *self);
-GtkWidget *ide_genesis_addin_get_widget    (IdeGenesisAddin      *self);
-void       ide_genesis_addin_run_async     (IdeGenesisAddin      *self,
-                                            GCancellable         *cancellable,
-                                            GAsyncReadyCallback   callback,
-                                            gpointer              user_data);
-gboolean   ide_genesis_addin_run_finish    (IdeGenesisAddin      *self,
-                                            GAsyncResult         *result,
-                                            GError              **error);
+gchar     *ide_genesis_addin_get_label      (IdeGenesisAddin      *self);
+gchar     *ide_genesis_addin_get_next_label (IdeGenesisAddin      *self);
+gint       ide_genesis_addin_get_priority   (IdeGenesisAddin      *self);
+gchar     *ide_genesis_addin_get_title      (IdeGenesisAddin      *self);
+gchar     *ide_genesis_addin_get_icon_name  (IdeGenesisAddin      *self);
+GtkWidget *ide_genesis_addin_get_widget     (IdeGenesisAddin      *self);
+void       ide_genesis_addin_run_async      (IdeGenesisAddin      *self,
+                                             GCancellable         *cancellable,
+                                             GAsyncReadyCallback   callback,
+                                             gpointer              user_data);
+gboolean   ide_genesis_addin_run_finish     (IdeGenesisAddin      *self,
+                                             GAsyncResult         *result,
+                                             GError              **error);
 
 G_END_DECLS
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]