[libdazzle] api: add missing _new() function implementations



commit aedb4cd6dc079267dbae0f4cd8413ff2effd3c3e
Author: Zander Brown <ajhb2001 outlook com>
Date:   Wed Jun 27 19:12:42 2018 +0100

    api: add missing _new() function implementations
    
    A number of _new() functions were missing from C sources that were
    defined in the corresponding headers.

 src/prefs/dzl-preferences-flow-box.c      |  6 ++++++
 src/prefs/dzl-preferences-flow-box.h      |  2 +-
 src/shortcuts/dzl-shortcut-accel-dialog.c |  6 ++++++
 src/shortcuts/dzl-shortcut-accel-dialog.h |  2 +-
 src/suggestions/dzl-suggestion-row.c      |  6 ++++++
 src/suggestions/dzl-suggestion-row.h      |  8 ++++----
 src/widgets/dzl-box.c                     |  6 ++++++
 src/widgets/dzl-box.h                     |  2 +-
 src/widgets/dzl-elastic-bin.c             |  6 ++++++
 src/widgets/dzl-elastic-bin.h             |  2 +-
 src/widgets/dzl-empty-state.c             |  6 ++++++
 src/widgets/dzl-empty-state.h             | 26 +++++++++++++-------------
 src/widgets/dzl-entry-box.c               |  6 ++++++
 src/widgets/dzl-entry-box.h               |  2 +-
 src/widgets/dzl-file-chooser-entry.c      | 10 ++++++++++
 src/widgets/dzl-file-chooser-entry.h      | 12 ++++++------
 src/widgets/dzl-list-box-row.c            |  6 ++++++
 src/widgets/dzl-list-box-row.h            |  2 +-
 src/widgets/dzl-list-box.c                |  2 +-
 src/widgets/dzl-list-box.h                |  2 +-
 src/widgets/dzl-priority-box.c            |  6 ++++++
 src/widgets/dzl-priority-box.h            |  2 +-
 src/widgets/dzl-simple-label.c            |  4 +++-
 23 files changed, 99 insertions(+), 33 deletions(-)
---
diff --git a/src/prefs/dzl-preferences-flow-box.c b/src/prefs/dzl-preferences-flow-box.c
index 923f00e..a920277 100644
--- a/src/prefs/dzl-preferences-flow-box.c
+++ b/src/prefs/dzl-preferences-flow-box.c
@@ -38,3 +38,9 @@ static void
 dzl_preferences_flow_box_init (DzlPreferencesFlowBox *self)
 {
 }
+
+GtkWidget *
+dzl_preferences_flow_box_new (void)
+{
+  return g_object_new (DZL_TYPE_PREFERENCES_FLOW_BOX, NULL);
+}
diff --git a/src/prefs/dzl-preferences-flow-box.h b/src/prefs/dzl-preferences-flow-box.h
index f981b67..0fd6ac2 100644
--- a/src/prefs/dzl-preferences-flow-box.h
+++ b/src/prefs/dzl-preferences-flow-box.h
@@ -30,7 +30,7 @@ G_BEGIN_DECLS
 DZL_AVAILABLE_IN_ALL
 G_DECLARE_FINAL_TYPE (DzlPreferencesFlowBox, dzl_preferences_flow_box, DZL, PREFERENCES_FLOW_BOX, 
DzlColumnLayout)
 
-DZL_AVAILABLE_IN_ALL
+DZL_AVAILABLE_IN_3_30
 GtkWidget *dzl_preferences_flow_box_new (void);
 
 G_END_DECLS
diff --git a/src/shortcuts/dzl-shortcut-accel-dialog.c b/src/shortcuts/dzl-shortcut-accel-dialog.c
index 2ab7cf3..7650119 100644
--- a/src/shortcuts/dzl-shortcut-accel-dialog.c
+++ b/src/shortcuts/dzl-shortcut-accel-dialog.c
@@ -529,3 +529,9 @@ dzl_shortcut_accel_dialog_get_chord (DzlShortcutAccelDialog *self)
 
   return self->chord;
 }
+
+GtkWidget *
+dzl_shortcut_accel_dialog_new (void)
+{
+  return g_object_new (DZL_TYPE_SHORTCUT_ACCEL_DIALOG, NULL);
+}
diff --git a/src/shortcuts/dzl-shortcut-accel-dialog.h b/src/shortcuts/dzl-shortcut-accel-dialog.h
index 770e44c..abe7609 100644
--- a/src/shortcuts/dzl-shortcut-accel-dialog.h
+++ b/src/shortcuts/dzl-shortcut-accel-dialog.h
@@ -32,7 +32,7 @@ G_BEGIN_DECLS
 DZL_AVAILABLE_IN_ALL
 G_DECLARE_FINAL_TYPE (DzlShortcutAccelDialog, dzl_shortcut_accel_dialog, DZL, SHORTCUT_ACCEL_DIALOG, 
GtkDialog)
 
-DZL_AVAILABLE_IN_ALL
+DZL_AVAILABLE_IN_3_30
 GtkWidget              *dzl_shortcut_accel_dialog_new                (void);
 DZL_AVAILABLE_IN_ALL
 gchar                  *dzl_shortcut_accel_dialog_get_accelerator    (DzlShortcutAccelDialog *self);
diff --git a/src/suggestions/dzl-suggestion-row.c b/src/suggestions/dzl-suggestion-row.c
index eeb8bfb..e1d96fd 100644
--- a/src/suggestions/dzl-suggestion-row.c
+++ b/src/suggestions/dzl-suggestion-row.c
@@ -220,3 +220,9 @@ _dzl_suggestion_row_set_ellipsize (DzlSuggestionRow   *self,
   gtk_label_set_ellipsize (priv->title, title);
   gtk_label_set_ellipsize (priv->subtitle, subtitle);
 }
+
+GtkWidget *
+dzl_suggestion_row_new (void)
+{
+  return g_object_new (DZL_TYPE_SUGGESTION_ROW, NULL);
+}
diff --git a/src/suggestions/dzl-suggestion-row.h b/src/suggestions/dzl-suggestion-row.h
index 1c233ca..430d279 100644
--- a/src/suggestions/dzl-suggestion-row.h
+++ b/src/suggestions/dzl-suggestion-row.h
@@ -42,12 +42,12 @@ struct _DzlSuggestionRowClass
 };
 
 DZL_AVAILABLE_IN_ALL
-GtkWidget     *dzl_suggestion_row_new            (void);
+GtkWidget        *dzl_suggestion_row_new            (void);
 DZL_AVAILABLE_IN_ALL
-DzlSuggestion *dzl_suggestion_row_get_suggestion (DzlSuggestionRow *self);
+DzlSuggestion    *dzl_suggestion_row_get_suggestion (DzlSuggestionRow *self);
 DZL_AVAILABLE_IN_ALL
-void           dzl_suggestion_row_set_suggestion (DzlSuggestionRow *self,
-                                                  DzlSuggestion    *suggestion);
+void              dzl_suggestion_row_set_suggestion (DzlSuggestionRow *self,
+                                                     DzlSuggestion    *suggestion);
 
 G_END_DECLS
 
diff --git a/src/widgets/dzl-box.c b/src/widgets/dzl-box.c
index 3a4027b..2d0c9ce 100644
--- a/src/widgets/dzl-box.c
+++ b/src/widgets/dzl-box.c
@@ -155,3 +155,9 @@ dzl_box_init (DzlBox *self)
 
   priv->max_width_request = -1;
 }
+
+GtkWidget *
+dzl_box_new (void)
+{
+  return g_object_new (DZL_TYPE_BOX, NULL);
+}
diff --git a/src/widgets/dzl-box.h b/src/widgets/dzl-box.h
index 22e71c0..93a766d 100644
--- a/src/widgets/dzl-box.h
+++ b/src/widgets/dzl-box.h
@@ -35,7 +35,7 @@ struct _DzlBoxClass
   GtkBoxClass parent_class;
 };
 
-DZL_AVAILABLE_IN_ALL
+DZL_AVAILABLE_IN_3_30
 GtkWidget *dzl_box_new                   (void);
 DZL_AVAILABLE_IN_ALL
 GtkWidget *dzl_box_get_nth_child         (DzlBox    *self,
diff --git a/src/widgets/dzl-elastic-bin.c b/src/widgets/dzl-elastic-bin.c
index 5cca378..e47ae56 100644
--- a/src/widgets/dzl-elastic-bin.c
+++ b/src/widgets/dzl-elastic-bin.c
@@ -278,3 +278,9 @@ dzl_elastic_bin_init (DzlElasticBin *self)
                            self,
                            G_CONNECT_SWAPPED);
 }
+
+GtkWidget *
+dzl_elastic_bin_new (void)
+{
+  return g_object_new (DZL_TYPE_ELASTIC_BIN, NULL);
+}
diff --git a/src/widgets/dzl-elastic-bin.h b/src/widgets/dzl-elastic-bin.h
index 6edd256..d94fe73 100644
--- a/src/widgets/dzl-elastic-bin.h
+++ b/src/widgets/dzl-elastic-bin.h
@@ -40,7 +40,7 @@ struct _DzlElasticBinClass
   gpointer _reserved4;
 };
 
-DZL_AVAILABLE_IN_ALL
+DZL_AVAILABLE_IN_3_30
 GtkWidget *dzl_elastic_bin_new (void);
 
 G_END_DECLS
diff --git a/src/widgets/dzl-empty-state.c b/src/widgets/dzl-empty-state.c
index 52e9c36..f7f1456 100644
--- a/src/widgets/dzl-empty-state.c
+++ b/src/widgets/dzl-empty-state.c
@@ -278,6 +278,12 @@ dzl_empty_state_init (DzlEmptyState *self)
                            G_CONNECT_SWAPPED);
 }
 
+GtkWidget *
+dzl_empty_state_new (void)
+{
+  return g_object_new (DZL_TYPE_EMPTY_STATE, NULL);
+}
+
 const gchar *
 dzl_empty_state_get_icon_name (DzlEmptyState *self)
 {
diff --git a/src/widgets/dzl-empty-state.h b/src/widgets/dzl-empty-state.h
index 9a3554b..ea0cfb4 100644
--- a/src/widgets/dzl-empty-state.h
+++ b/src/widgets/dzl-empty-state.h
@@ -35,26 +35,26 @@ struct _DzlEmptyStateClass
   GtkBinClass parent_class;
 };
 
+DZL_AVAILABLE_IN_3_30
+GtkWidget    *dzl_empty_state_new          (void);
 DZL_AVAILABLE_IN_ALL
-GtkWidget   *dzl_empty_state_new           (void);
+const gchar  *dzl_empty_state_get_icon_name (DzlEmptyState *self);
 DZL_AVAILABLE_IN_ALL
-const gchar *dzl_empty_state_get_icon_name (DzlEmptyState *self);
+void          dzl_empty_state_set_icon_name (DzlEmptyState *self,
+                                             const gchar   *icon_name);
 DZL_AVAILABLE_IN_ALL
-void         dzl_empty_state_set_icon_name (DzlEmptyState *self,
-                                            const gchar   *icon_name);
+void          dzl_empty_state_set_resource  (DzlEmptyState *self,
+                                             const gchar   *resource);
 DZL_AVAILABLE_IN_ALL
-void         dzl_empty_state_set_resource  (DzlEmptyState *self,
-                                            const gchar   *resource);
+const gchar  *dzl_empty_state_get_title     (DzlEmptyState *self);
 DZL_AVAILABLE_IN_ALL
-const gchar *dzl_empty_state_get_title     (DzlEmptyState *self);
+void          dzl_empty_state_set_title     (DzlEmptyState *self,
+                                             const gchar   *title);
 DZL_AVAILABLE_IN_ALL
-void         dzl_empty_state_set_title     (DzlEmptyState *self,
-                                            const gchar   *title);
+const gchar  *dzl_empty_state_get_subtitle  (DzlEmptyState *self);
 DZL_AVAILABLE_IN_ALL
-const gchar *dzl_empty_state_get_subtitle  (DzlEmptyState *self);
-DZL_AVAILABLE_IN_ALL
-void         dzl_empty_state_set_subtitle  (DzlEmptyState *self,
-                                            const gchar   *title);
+void          dzl_empty_state_set_subtitle  (DzlEmptyState *self,
+                                             const gchar   *title);
 
 G_END_DECLS
 
diff --git a/src/widgets/dzl-entry-box.c b/src/widgets/dzl-entry-box.c
index 70cbd88..77a45e1 100644
--- a/src/widgets/dzl-entry-box.c
+++ b/src/widgets/dzl-entry-box.c
@@ -147,3 +147,9 @@ dzl_entry_box_init (DzlEntryBox *self)
   gtk_container_set_reallocate_redraws (GTK_CONTAINER (self), TRUE);
   G_GNUC_END_IGNORE_DEPRECATIONS;
 }
+
+GtkWidget *
+dzl_entry_box_new (void)
+{
+  return g_object_new (DZL_TYPE_ENTRY_BOX, NULL);
+}
diff --git a/src/widgets/dzl-entry-box.h b/src/widgets/dzl-entry-box.h
index a5e42dd..7ec9da2 100644
--- a/src/widgets/dzl-entry-box.h
+++ b/src/widgets/dzl-entry-box.h
@@ -30,7 +30,7 @@ G_BEGIN_DECLS
 DZL_AVAILABLE_IN_ALL
 G_DECLARE_FINAL_TYPE (DzlEntryBox, dzl_entry_box, DZL, ENTRY_BOX, GtkBox)
 
-DZL_AVAILABLE_IN_ALL
+DZL_AVAILABLE_IN_3_30
 GtkWidget *dzl_entry_box_new (void);
 
 G_END_DECLS
diff --git a/src/widgets/dzl-file-chooser-entry.c b/src/widgets/dzl-file-chooser-entry.c
index 0605e8d..6192b2c 100644
--- a/src/widgets/dzl-file-chooser-entry.c
+++ b/src/widgets/dzl-file-chooser-entry.c
@@ -562,3 +562,13 @@ dzl_file_chooser_entry_set_file (DzlFileChooserEntry *self,
 
   g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_FILE]);
 }
+
+GtkWidget *
+dzl_file_chooser_entry_new (const gchar          *title,
+                            GtkFileChooserAction  action)
+{
+  return g_object_new (DZL_TYPE_FILE_CHOOSER_ENTRY,
+                       "title", title,
+                       "action", action,
+                       NULL);
+}
diff --git a/src/widgets/dzl-file-chooser-entry.h b/src/widgets/dzl-file-chooser-entry.h
index a430026..d08dcd0 100644
--- a/src/widgets/dzl-file-chooser-entry.h
+++ b/src/widgets/dzl-file-chooser-entry.h
@@ -40,14 +40,14 @@ struct _DzlFileChooserEntryClass
   gpointer _reserved4;
 };
 
+DZL_AVAILABLE_IN_3_30
+GtkWidget           *dzl_file_chooser_entry_new      (const gchar          *title,
+                                                      GtkFileChooserAction  action);
 DZL_AVAILABLE_IN_ALL
-GtkWidget *dzl_file_chooser_entry_new      (const gchar          *title,
-                                            GtkFileChooserAction  action);
+GFile               *dzl_file_chooser_entry_get_file (DzlFileChooserEntry *self);
 DZL_AVAILABLE_IN_ALL
-GFile     *dzl_file_chooser_entry_get_file (DzlFileChooserEntry *self);
-DZL_AVAILABLE_IN_ALL
-void       dzl_file_chooser_entry_set_file (DzlFileChooserEntry *self,
-                                            GFile               *file);
+void                 dzl_file_chooser_entry_set_file (DzlFileChooserEntry *self,
+                                                      GFile               *file);
 
 G_END_DECLS
 
diff --git a/src/widgets/dzl-list-box-row.c b/src/widgets/dzl-list-box-row.c
index 62bd44c..9aead57 100644
--- a/src/widgets/dzl-list-box-row.c
+++ b/src/widgets/dzl-list-box-row.c
@@ -60,3 +60,9 @@ static void
 dzl_list_box_row_init (DzlListBoxRow *self)
 {
 }
+
+GtkWidget *
+dzl_list_box_row_new (void)
+{
+  return g_object_new (DZL_TYPE_LIST_BOX_ROW, NULL);
+}
diff --git a/src/widgets/dzl-list-box-row.h b/src/widgets/dzl-list-box-row.h
index cddee34..6dbd512 100644
--- a/src/widgets/dzl-list-box-row.h
+++ b/src/widgets/dzl-list-box-row.h
@@ -33,7 +33,7 @@ struct _DzlListBoxRowClass
   GtkListBoxRowClass parent_class;
 };
 
-DZL_AVAILABLE_IN_ALL
+DZL_AVAILABLE_IN_3_30
 GtkWidget *dzl_list_box_row_new (void);
 
 G_END_DECLS
diff --git a/src/widgets/dzl-list-box.c b/src/widgets/dzl-list-box.c
index 1e8e6be..167c92e 100644
--- a/src/widgets/dzl-list-box.c
+++ b/src/widgets/dzl-list-box.c
@@ -310,7 +310,7 @@ dzl_list_box_init (DzlListBox *self)
   g_queue_init (&priv->trashed_rows);
 }
 
-DzlListBox *
+GtkWidget *
 dzl_list_box_new (GType        row_type,
                   const gchar *property_name)
 {
diff --git a/src/widgets/dzl-list-box.h b/src/widgets/dzl-list-box.h
index c967480..7251e13 100644
--- a/src/widgets/dzl-list-box.h
+++ b/src/widgets/dzl-list-box.h
@@ -39,7 +39,7 @@ struct _DzlListBoxClass
 };
 
 DZL_AVAILABLE_IN_ALL
-DzlListBox  *dzl_list_box_new               (GType        row_type,
+GtkWidget   *dzl_list_box_new               (GType        row_type,
                                              const gchar *property_name);
 DZL_AVAILABLE_IN_ALL
 GType        dzl_list_box_get_row_type      (DzlListBox  *self);
diff --git a/src/widgets/dzl-priority-box.c b/src/widgets/dzl-priority-box.c
index 145a239..fc8be50 100644
--- a/src/widgets/dzl-priority-box.c
+++ b/src/widgets/dzl-priority-box.c
@@ -267,3 +267,9 @@ dzl_priority_box_init (DzlPriorityBox *self)
 
   priv->children = g_array_new (FALSE, FALSE, sizeof (DzlPriorityBoxChild));
 }
+
+GtkWidget *
+dzl_priority_box_new (void)
+{
+  return g_object_new (DZL_TYPE_PRIORITY_BOX, NULL);
+}
diff --git a/src/widgets/dzl-priority-box.h b/src/widgets/dzl-priority-box.h
index 747d2cc..d0c9e8d 100644
--- a/src/widgets/dzl-priority-box.h
+++ b/src/widgets/dzl-priority-box.h
@@ -40,7 +40,7 @@ struct _DzlPriorityBoxClass
   gpointer _reserved4;
 };
 
-DZL_AVAILABLE_IN_ALL
+DZL_AVAILABLE_IN_3_30
 GtkWidget *dzl_priority_box_new (void);
 
 G_END_DECLS
diff --git a/src/widgets/dzl-simple-label.c b/src/widgets/dzl-simple-label.c
index bd2c02a..3df420e 100644
--- a/src/widgets/dzl-simple-label.c
+++ b/src/widgets/dzl-simple-label.c
@@ -299,7 +299,9 @@ dzl_simple_label_init (DzlSimpleLabel *self)
 GtkWidget *
 dzl_simple_label_new (const gchar *label)
 {
-  return g_object_new (DZL_TYPE_SIMPLE_LABEL, NULL);
+  return g_object_new (DZL_TYPE_SIMPLE_LABEL,
+                       "label", label,
+                       NULL);
 }
 
 const gchar *


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