[gnumeric] Namespace



commit 4ca3ba0a011deb1f6ecea4b8c4e7e66c426e421d
Author: Morten Welinder <terra gnome org>
Date:   Mon Mar 2 11:42:56 2015 -0500

    Namespace

 src/command-context-stderr.c |    4 ++--
 src/command-context-stderr.h |    2 +-
 src/complete-sheet.c         |   34 +++++++++++++++++-----------------
 src/complete-sheet.h         |   18 +++++++++---------
 src/complete.c               |   28 ++++++++++++++--------------
 src/complete.h               |   30 +++++++++++++++---------------
 src/gnm-pane.c               |    4 ++--
 src/gnumeric-fwd.h           |    1 +
 src/wbc-gtk-edit.c           |    2 +-
 src/wbc-gtk-impl.h           |    2 +-
 10 files changed, 63 insertions(+), 62 deletions(-)
---
diff --git a/src/command-context-stderr.c b/src/command-context-stderr.c
index f207c42..d9dcc54 100644
--- a/src/command-context-stderr.c
+++ b/src/command-context-stderr.c
@@ -39,7 +39,7 @@ void
 cmd_context_stderr_set_status (CmdContextStderr *ccs, int status)
 {
        g_return_if_fail (ccs != NULL);
-       g_return_if_fail (IS_COMMAND_CONTEXT_STDERR (ccs));
+       g_return_if_fail (GNM_IS_COMMAND_CONTEXT_STDERR (ccs));
 
        ccs->status = status;
 }
@@ -48,7 +48,7 @@ int
 cmd_context_stderr_get_status (CmdContextStderr *ccs)
 {
        g_return_val_if_fail (ccs != NULL, -1);
-       g_return_val_if_fail (IS_COMMAND_CONTEXT_STDERR (ccs), -1);
+       g_return_val_if_fail (GNM_IS_COMMAND_CONTEXT_STDERR (ccs), -1);
 
        return ccs->status;
 }
diff --git a/src/command-context-stderr.h b/src/command-context-stderr.h
index 28ce4bd..5b48e6e 100644
--- a/src/command-context-stderr.h
+++ b/src/command-context-stderr.h
@@ -9,7 +9,7 @@ G_BEGIN_DECLS
 
 #define CMD_CONTEXT_STDERR_TYPE                (cmd_context_stderr_get_type ())
 #define COMMAND_CONTEXT_STDERR(o)      (G_TYPE_CHECK_INSTANCE_CAST ((o), CMD_CONTEXT_STDERR_TYPE, 
CmdContextStderr))
-#define IS_COMMAND_CONTEXT_STDERR(o)   (G_TYPE_CHECK_INSTANCE_TYPE ((o), CMD_CONTEXT_STDERR_TYPE))
+#define GNM_IS_COMMAND_CONTEXT_STDERR(o)       (G_TYPE_CHECK_INSTANCE_TYPE ((o), CMD_CONTEXT_STDERR_TYPE))
 
 typedef struct _CmdContextStderr CmdContextStderr;
 
diff --git a/src/complete-sheet.c b/src/complete-sheet.c
index 125edf6..935010a 100644
--- a/src/complete-sheet.c
+++ b/src/complete-sheet.c
@@ -25,13 +25,13 @@
 
 #define SEARCH_STEPS   50
 
-#define PARENT_TYPE    COMPLETE_TYPE
+#define PARENT_TYPE    GNM_COMPLETE_TYPE
 
 static GObjectClass *parent_class;
 
 
 static void
-search_strategy_reset_search (CompleteSheet *cs)
+search_strategy_reset_search (GnmCompleteSheet *cs)
 {
        cs->current.col = cs->entry.col;
        cs->current.row = cs->entry.row;
@@ -42,7 +42,7 @@ search_strategy_reset_search (CompleteSheet *cs)
  * Very simple search strategy: up until blank.
  */
 static gboolean
-search_strategy_next (CompleteSheet *cs)
+search_strategy_next (GnmCompleteSheet *cs)
 {
        cs->current.row--;
        if (cs->current.row < 0)
@@ -56,16 +56,16 @@ search_strategy_next (CompleteSheet *cs)
 static void
 complete_sheet_finalize (GObject *object)
 {
-       CompleteSheet *cs = COMPLETE_SHEET (object);
+       GnmCompleteSheet *cs = COMPLETE_SHEET (object);
        g_free (cs->current_text);
        parent_class->finalize (object);
 }
 
 static gboolean
-text_matches (CompleteSheet const *cs)
+text_matches (GnmCompleteSheet const *cs)
 {
        char const *text;
-       Complete const *complete = &cs->parent;
+       GnmComplete const *complete = &cs->parent;
 
        if (cs->cell->value == NULL ||
            !VALUE_IS_STRING (cs->cell->value) ||
@@ -81,9 +81,9 @@ text_matches (CompleteSheet const *cs)
 }
 
 static gboolean
-complete_sheet_search_iteration (Complete *complete)
+complete_sheet_search_iteration (GnmComplete *complete)
 {
-       CompleteSheet *cs = COMPLETE_SHEET (complete);
+       GnmCompleteSheet *cs = COMPLETE_SHEET (complete);
        int i;
 
        if ((int)strlen (complete->text) <
@@ -107,7 +107,7 @@ complete_sheet_search_iteration (Complete *complete)
 static void
 complete_sheet_class_init (GObjectClass *object_class)
 {
-       CompleteClass *auto_complete_class = (CompleteClass *) object_class;
+       GnmCompleteClass *auto_complete_class = (GnmCompleteClass *) object_class;
 
        parent_class = g_type_class_peek (PARENT_TYPE);
        object_class->finalize = complete_sheet_finalize;
@@ -119,21 +119,21 @@ complete_sheet_class_init (GObjectClass *object_class)
  * @sheet: #Sheet
  * @col: column
  * @row: row
- * @notify: (scope async): #CompleteMatchNotifyFn
+ * @notify: (scope async): #GnmCompleteMatchNotifyFn
  * @notify_closure: user data
  *
- * Returns: (transfer full): the new #Complete.
+ * Returns: (transfer full): the new #GnmComplete.
  **/
-Complete *
-complete_sheet_new (Sheet *sheet, int col, int row, CompleteMatchNotifyFn notify, void *notify_closure)
+GnmComplete *
+complete_sheet_new (Sheet *sheet, int col, int row, GnmCompleteMatchNotifyFn notify, void *notify_closure)
 {
        /*
         * Somehow every time I pronounce this, I feel like something is not quite right.
         */
-       CompleteSheet *cs;
+       GnmCompleteSheet *cs;
 
        cs = g_object_new (COMPLETE_SHEET_TYPE, NULL);
-       complete_construct (COMPLETE (cs), notify, notify_closure);
+       complete_construct (GNM_COMPLETE (cs), notify, notify_closure);
 
        cs->sheet = sheet;
        cs->entry.col = col;
@@ -141,8 +141,8 @@ complete_sheet_new (Sheet *sheet, int col, int row, CompleteMatchNotifyFn notify
        cs->current_text = g_strdup ("");
        search_strategy_reset_search (cs);
 
-       return COMPLETE (cs);
+       return GNM_COMPLETE (cs);
 }
 
-GSF_CLASS (CompleteSheet, complete_sheet,
+GSF_CLASS (GnmCompleteSheet, complete_sheet,
           complete_sheet_class_init, NULL, PARENT_TYPE)
diff --git a/src/complete-sheet.h b/src/complete-sheet.h
index 7b97c29..0229ba1 100644
--- a/src/complete-sheet.h
+++ b/src/complete-sheet.h
@@ -8,13 +8,13 @@
 G_BEGIN_DECLS
 
 #define COMPLETE_SHEET_TYPE        (complete_sheet_get_type ())
-#define COMPLETE_SHEET(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), COMPLETE_SHEET_TYPE, CompleteSheet))
-#define COMPLETE_SHEET_CLASS(k)    (G_TYPE_CHECK_CLASS_CAST((k), COMPLETE_SHEET_TYPE, CompleteSheetClass))
-#define IS_COMPLETE_SHEET(o)       (G_TYPE_CHECK_INSTANCE_TYPE ((o), COMPLETE_SHEET_TYPE))
+#define COMPLETE_SHEET(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), COMPLETE_SHEET_TYPE, GnmCompleteSheet))
+#define COMPLETE_SHEET_CLASS(k)    (G_TYPE_CHECK_CLASS_CAST((k), COMPLETE_SHEET_TYPE, GnmCompleteSheetClass))
+#define GNM_IS_COMPLETE_SHEET(o)       (G_TYPE_CHECK_INSTANCE_TYPE ((o), COMPLETE_SHEET_TYPE))
 #define IS_COMPLETE_SHEET_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), COMPLETE_SHEET_TYPE))
 
 typedef struct {
-       Complete parent;
+       GnmComplete parent;
 
        /* Cell being entered into.  */
        Sheet *sheet;
@@ -25,15 +25,15 @@ typedef struct {
        GnmCell *cell;
 
        char  *current_text;
-} CompleteSheet;
+} GnmCompleteSheet;
 
 typedef struct {
-       CompleteClass parent_class;
-} CompleteSheetClass;
+       GnmCompleteClass parent_class;
+} GnmCompleteSheetClass;
 
 GType     complete_sheet_get_type (void);
-Complete *complete_sheet_new      (Sheet *sheet, int col, int row,
-                                  CompleteMatchNotifyFn notify,
+GnmComplete *complete_sheet_new   (Sheet *sheet, int col, int row,
+                                  GnmCompleteMatchNotifyFn notify,
                                   void *notify_closure);
 
 G_END_DECLS
diff --git a/src/complete.c b/src/complete.c
index f7bb9f2..cb3301b 100644
--- a/src/complete.c
+++ b/src/complete.c
@@ -8,13 +8,13 @@
  *
  * Theory of operation:
  *
- *    Derived types of Complete provide the search function.
+ *    Derived types of GnmComplete provide the search function.
  *
  *    The search function should not take too long to run, and try to
  *    search on each step information on its data repository.  When the
  *    data repository information has been extenuated or if a match has
  *    been found, then the method should return FALSE and invoke the
- *    notification function that was provided to Complete.
+ *    notification function that was provided to GnmComplete.
  *
  *
  * (C) 2000-2001 Ximain Inc.
@@ -28,17 +28,17 @@
 #include <stdlib.h>
 
 #define PARENT_TYPE (G_TYPE_OBJECT)
-#define ACC(o) (COMPLETE_CLASS (G_OBJECT_GET_CLASS (o)))
+#define ACC(o) (GNM_COMPLETE_CLASS (G_OBJECT_GET_CLASS (o)))
 
 /**
  * complete_construct:
- * @complete: #Complete
- * @notify: (scope async): #CompleteMatchNotifyFn
+ * @complete: #GnmComplete
+ * @notify: (scope async): #GnmCompleteMatchNotifyFn
  * @notify_closure: user data
  **/
 void
-complete_construct (Complete *complete,
-                   CompleteMatchNotifyFn notify,
+complete_construct (GnmComplete *complete,
+                   GnmCompleteMatchNotifyFn notify,
                    void *notify_closure)
 {
        complete->notify = notify;
@@ -49,7 +49,7 @@ static void
 complete_finalize (GObject *object)
 {
        GObjectClass *parent;
-       Complete *complete = COMPLETE (object);
+       GnmComplete *complete = GNM_COMPLETE (object);
 
        if (complete->idle_tag) {
                g_source_remove (complete->idle_tag);
@@ -66,7 +66,7 @@ complete_finalize (GObject *object)
 static gint
 complete_idle (gpointer data)
 {
-       Complete *complete = data;
+       GnmComplete *complete = data;
 
        g_return_val_if_fail (complete->idle_tag != 0, FALSE);
 
@@ -79,10 +79,10 @@ complete_idle (gpointer data)
 }
 
 void
-complete_start (Complete *complete, char const *text)
+complete_start (GnmComplete *complete, char const *text)
 {
        g_return_if_fail (complete != NULL);
-       g_return_if_fail (IS_COMPLETE (complete));
+       g_return_if_fail (GNM_IS_COMPLETE (complete));
        g_return_if_fail (text != NULL);
 
        if (complete->text != text) {
@@ -98,7 +98,7 @@ complete_start (Complete *complete, char const *text)
 }
 
 static gboolean
-default_search_iteration (G_GNUC_UNUSED Complete *complete)
+default_search_iteration (G_GNUC_UNUSED GnmComplete *complete)
 {
        return FALSE;
 }
@@ -106,11 +106,11 @@ default_search_iteration (G_GNUC_UNUSED Complete *complete)
 static void
 complete_class_init (GObjectClass *object_class)
 {
-       CompleteClass *complete_class = (CompleteClass *) object_class;
+       GnmCompleteClass *complete_class = (GnmCompleteClass *) object_class;
 
        object_class->finalize = complete_finalize;
        complete_class->search_iteration = default_search_iteration;
 }
 
-GSF_CLASS (Complete, complete,
+GSF_CLASS (GnmComplete, complete,
           &complete_class_init, NULL, PARENT_TYPE)
diff --git a/src/complete.h b/src/complete.h
index 9d84f83..b6d1a72 100644
--- a/src/complete.h
+++ b/src/complete.h
@@ -3,39 +3,39 @@
 # define _GNM_COMPLETE_H_
 
 #include <glib-object.h>
+#include <gnumeric-fwd.h>
 
 G_BEGIN_DECLS
 
-#define COMPLETE_TYPE        (complete_get_type ())
-#define COMPLETE(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), COMPLETE_TYPE, Complete))
-#define COMPLETE_CLASS(k)    (G_TYPE_CHECK_CLASS_CAST ((k), COMPLETE_TYPE, CompleteClass))
-#define IS_COMPLETE(o)       (G_TYPE_CHECK_INSTANCE_TYPE ((o), COMPLETE_TYPE))
-#define IS_COMPLETE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), COMPLETE_TYPE))
+#define GNM_COMPLETE_TYPE        (complete_get_type ())
+#define GNM_COMPLETE(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), GNM_COMPLETE_TYPE, GnmComplete))
+#define GNM_COMPLETE_CLASS(k)    (G_TYPE_CHECK_CLASS_CAST ((k), GNM_COMPLETE_TYPE, GnmCompleteClass))
+#define GNM_IS_COMPLETE(o)       (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNM_COMPLETE_TYPE))
 
-typedef void (*CompleteMatchNotifyFn) (char const *text, void *closure);
+typedef void (*GnmCompleteMatchNotifyFn) (char const *text, void *closure);
 
-typedef struct {
+struct GnmComplete_ {
        GObject parent;
 
-       CompleteMatchNotifyFn notify;
+       GnmCompleteMatchNotifyFn notify;
        void *notify_closure;
 
        char *text;
 
        guint idle_tag;
-} Complete;
+};
 
 typedef struct {
        GObjectClass parent_class;
 
-       void     (*start_over)       (Complete *complete);
-       gboolean (*search_iteration) (Complete *complete);
-} CompleteClass;
+       void     (*start_over)       (GnmComplete *complete);
+       gboolean (*search_iteration) (GnmComplete *complete);
+} GnmCompleteClass;
 
-void  complete_construct (Complete *complete,
-                         CompleteMatchNotifyFn notify,
+void  complete_construct (GnmComplete *complete,
+                         GnmCompleteMatchNotifyFn notify,
                          void *notify_closure);
-void  complete_start     (Complete *complete, char const *text);
+void  complete_start     (GnmComplete *complete, char const *text);
 GType complete_get_type  (void);
 
 G_END_DECLS
diff --git a/src/gnm-pane.c b/src/gnm-pane.c
index 281f2e5..57454b2 100644
--- a/src/gnm-pane.c
+++ b/src/gnm-pane.c
@@ -2821,8 +2821,8 @@ static GSF_CLASS (GnmControlCircle, control_circle,
                  control_circle_class_init, NULL,
                  GOC_TYPE_CIRCLE)
 
-#define ITEM_ACETATE(obj)          (G_TYPE_CHECK_INSTANCE_CAST((obj), item_acetate_get_type (), ItemAcetate))
-#define IS_ITEM_ACETATE(o)         (G_TYPE_CHECK_INSTANCE_TYPE((o), item_acetate_get_type ()))
+#define GNM_ITEM_ACETATE(obj)          (G_TYPE_CHECK_INSTANCE_CAST((obj), item_acetate_get_type (), 
ItemAcetate))
+#define GNM_IS_ITEM_ACETATE(o)         (G_TYPE_CHECK_INSTANCE_TYPE((o), item_acetate_get_type ()))
 
 #define MARGIN 10
 
diff --git a/src/gnumeric-fwd.h b/src/gnumeric-fwd.h
index 09993bb..0edc8ba 100644
--- a/src/gnumeric-fwd.h
+++ b/src/gnumeric-fwd.h
@@ -5,6 +5,7 @@
 
 G_BEGIN_DECLS
 
+typedef struct GnmComplete_             GnmComplete;
 typedef struct GnmScenario_             GnmScenario;
 typedef struct GnmSolverConstraint_     GnmSolverConstraint;
 typedef struct GnmSolverFactory_        GnmSolverFactory;
diff --git a/src/wbc-gtk-edit.c b/src/wbc-gtk-edit.c
index a81e2fd..c722efc 100644
--- a/src/wbc-gtk-edit.c
+++ b/src/wbc-gtk-edit.c
@@ -542,7 +542,7 @@ cb_entry_changed (G_GNUC_UNUSED GtkEntry *entry, WBCGtk *wbcg)
                wbcg->auto_max_size = text_len;
 
        if (wbv->do_auto_completion && wbcg->auto_completing)
-               complete_start (COMPLETE (wbcg->auto_complete), text);
+               complete_start (GNM_COMPLETE (wbcg->auto_complete), text);
 }
 
 static gboolean
diff --git a/src/wbc-gtk-impl.h b/src/wbc-gtk-impl.h
index b1b44ee..a74f219 100644
--- a/src/wbc-gtk-impl.h
+++ b/src/wbc-gtk-impl.h
@@ -57,7 +57,7 @@ struct _WBCGtk {
        gboolean    inside_editing;
 
        /* Auto completion */
-       GObject         *auto_complete;         /* GType is (Complete *) */
+       GnmComplete     *auto_complete;
        gboolean         auto_completing;
        char            *auto_complete_text;
 


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