[gnumeric] Namespace: more renaming of canvas items.



commit da324e2b107ae68f3eb42ba979dbfbe389463eb1
Author: Morten Welinder <terra gnome org>
Date:   Mon Mar 25 20:04:56 2013 -0400

    Namespace: more renaming of canvas items.

 src/gnm-pane-impl.h     |    6 +-
 src/gnm-pane.c          |   54 +++++++++---------
 src/gnumeric.css        |    8 +-
 src/gui-gnumeric.h      |    6 +-
 src/item-bar.c          |    6 +-
 src/item-cursor.c       |  148 +++++++++++++++++++++++-----------------------
 src/item-cursor.h       |   32 +++++------
 src/item-edit.c         |   38 ++++++------
 src/item-edit.h         |    9 +--
 src/item-grid.c         |   98 ++++++++++++++++----------------
 src/item-grid.h         |    9 +--
 src/sheet-control-gui.c |   10 ++--
 src/sheet-object.c      |    4 +-
 13 files changed, 212 insertions(+), 216 deletions(-)
---
diff --git a/src/gnm-pane-impl.h b/src/gnm-pane-impl.h
index f6c2329..52a7d77 100644
--- a/src/gnm-pane-impl.h
+++ b/src/gnm-pane-impl.h
@@ -54,11 +54,11 @@ struct _GnmPane {
                GocPoint  *points;
        } size_guide;
 
-       ItemGrid      *grid;
-       ItemEdit      *editor;
+       GnmItemGrid *grid;
+       GnmItemEdit *editor;
 
        struct {
-               ItemCursor *std, *rangesel, *special;
+               GnmItemCursor *std, *rangesel, *special;
                GSList *animated;
 
                GSList *expr_range;     /* highlight refs while editing */
diff --git a/src/gnm-pane.c b/src/gnm-pane.c
index 7c503a8..6b5434e 100644
--- a/src/gnm-pane.c
+++ b/src/gnm-pane.c
@@ -1191,16 +1191,16 @@ gnm_pane_new (SheetControlGUI *scg,
        gnm_pane_drag_dest_init (pane, scg);
 
        item = goc_item_new (pane->grid_items,
-               item_grid_get_type (),
+               gnm_item_grid_get_type (),
                "SheetControlGUI", scg,
                NULL);
-       pane->grid = ITEM_GRID (item);
+       pane->grid = GNM_ITEM_GRID (item);
 
        item = goc_item_new (pane->grid_items,
-               item_cursor_get_type (),
+               gnm_item_cursor_get_type (),
                "SheetControlGUI", scg,
                NULL);
-       pane->cursor.std = ITEM_CURSOR (item);
+       pane->cursor.std = GNM_ITEM_CURSOR (item);
        if (col_headers)
                gnm_pane_header_init (pane, scg, TRUE);
        else
@@ -2143,15 +2143,15 @@ gnm_pane_reposition_cursors (GnmPane *pane)
 {
        GSList *l;
 
-       item_cursor_reposition (pane->cursor.std);
+       gnm_item_cursor_reposition (pane->cursor.std);
        if (NULL != pane->cursor.rangesel)
-               item_cursor_reposition (pane->cursor.rangesel);
+               gnm_item_cursor_reposition (pane->cursor.rangesel);
        if (NULL != pane->cursor.special)
-               item_cursor_reposition (pane->cursor.special);
+               gnm_item_cursor_reposition (pane->cursor.special);
        for (l = pane->cursor.expr_range; l; l = l->next)
-               item_cursor_reposition (ITEM_CURSOR (l->data));
+               gnm_item_cursor_reposition (GNM_ITEM_CURSOR (l->data));
        for (l = pane->cursor.animated; l; l = l->next)
-               item_cursor_reposition (ITEM_CURSOR (l->data));
+               gnm_item_cursor_reposition (GNM_ITEM_CURSOR (l->data));
 
        /* ctrl pts do not scale with the zoom, compensate */
        if (pane->drag.ctrl_pts != NULL)
@@ -2162,7 +2162,7 @@ gnm_pane_reposition_cursors (GnmPane *pane)
 gboolean
 gnm_pane_cursor_bound_set (GnmPane *pane, GnmRange const *r)
 {
-       return item_cursor_bound_set (pane->cursor.std, r);
+       return gnm_item_cursor_bound_set (pane->cursor.std, r);
 }
 
 /****************************************************************************/
@@ -2170,7 +2170,7 @@ gnm_pane_cursor_bound_set (GnmPane *pane, GnmRange const *r)
 gboolean
 gnm_pane_rangesel_bound_set (GnmPane *pane, GnmRange const *r)
 {
-       return item_cursor_bound_set (pane->cursor.rangesel, r);
+       return gnm_item_cursor_bound_set (pane->cursor.rangesel, r);
 }
 void
 gnm_pane_rangesel_start (GnmPane *pane, GnmRange const *r)
@@ -2183,14 +2183,14 @@ gnm_pane_rangesel_start (GnmPane *pane, GnmRange const *r)
        /* Hide the primary cursor while the range selection cursor is visible
         * and we are selecting on a different sheet than the expr being edited */
        if (scg_sheet (scg) != wb_control_cur_sheet (scg_wbc (scg)))
-               item_cursor_set_visibility (pane->cursor.std, FALSE);
+               gnm_item_cursor_set_visibility (pane->cursor.std, FALSE);
        item = goc_item_new (pane->grid_items,
-               item_cursor_get_type (),
+               gnm_item_cursor_get_type (),
                "SheetControlGUI", scg,
-               "style",        ITEM_CURSOR_ANTED,
+               "style",        GNM_ITEM_CURSOR_ANTED,
                NULL);
-       pane->cursor.rangesel = ITEM_CURSOR (item);
-       item_cursor_bound_set (pane->cursor.rangesel, r);
+       pane->cursor.rangesel = GNM_ITEM_CURSOR (item);
+       gnm_item_cursor_bound_set (pane->cursor.rangesel, r);
 }
 
 void
@@ -2201,7 +2201,7 @@ gnm_pane_rangesel_stop (GnmPane *pane)
        pane->cursor.rangesel = NULL;
 
        /* Make the primary cursor visible again */
-       item_cursor_set_visibility (pane->cursor.std, TRUE);
+       gnm_item_cursor_set_visibility (pane->cursor.std, TRUE);
 
        gnm_pane_slide_stop (pane);
 }
@@ -2211,7 +2211,7 @@ gnm_pane_rangesel_stop (GnmPane *pane)
 gboolean
 gnm_pane_special_cursor_bound_set (GnmPane *pane, GnmRange const *r)
 {
-       return item_cursor_bound_set (pane->cursor.special, r);
+       return gnm_item_cursor_bound_set (pane->cursor.special, r);
 }
 
 void
@@ -2223,12 +2223,12 @@ gnm_pane_special_cursor_start (GnmPane *pane, int style, int button)
        g_return_if_fail (pane->cursor.special == NULL);
        item = goc_item_new (
                GOC_GROUP (canvas->root),
-               item_cursor_get_type (),
+               gnm_item_cursor_get_type (),
                "SheetControlGUI", pane->simple.scg,
                "style",           style,
                "button",          button,
                NULL);
-       pane->cursor.special = ITEM_CURSOR (item);
+       pane->cursor.special = GNM_ITEM_CURSOR (item);
 }
 
 void
@@ -2256,17 +2256,17 @@ void
 gnm_pane_expr_cursor_bound_set (GnmPane *pane, GnmRange const *r,
                                gchar const *color)
 {
-       ItemCursor *cursor;
+       GnmItemCursor *cursor;
 
-       cursor = (ItemCursor *) goc_item_new
+       cursor = (GnmItemCursor *) goc_item_new
                (GOC_GROUP (GOC_CANVAS (pane)->root),
-                item_cursor_get_type (),
+                gnm_item_cursor_get_type (),
                 "SheetControlGUI",     pane->simple.scg,
-                "style",               ITEM_CURSOR_EXPR_RANGE,
+                "style",               GNM_ITEM_CURSOR_EXPR_RANGE,
                 "color",               color,
                 NULL);
 
-       item_cursor_bound_set (cursor, r);
+       gnm_item_cursor_bound_set (cursor, r);
        pane->cursor.expr_range = g_slist_prepend
                (pane->cursor.expr_range, cursor);
 }
@@ -2288,9 +2288,9 @@ gnm_pane_edit_start (GnmPane *pane)
        g_return_if_fail (pane->editor == NULL);
 
        /* edit item handles visibility checks */
-       pane->editor = (ItemEdit *) goc_item_new (
+       pane->editor = (GnmItemEdit *) goc_item_new (
                GOC_GROUP (canvas->root),
-               item_edit_get_type (),
+               gnm_item_edit_get_type (),
                "SheetControlGUI",      pane->simple.scg,
                NULL);
 }
diff --git a/src/gnumeric.css b/src/gnumeric.css
index 701a2c7..243f436 100644
--- a/src/gnumeric.css
+++ b/src/gnumeric.css
@@ -1,18 +1,18 @@
 /* ------------------------------------------------------------------------- */
-/* The ItemGrid is the canvas area that holds all the cells.  */
-ItemGrid {
+/* The GnmItemGrid is the canvas area that holds all the cells.  */
+GnmItemGrid {
   background-color: white;
 }
 
 /* Function markers are enabled from View->View Properties->Cell Markers */
-ItemGrid function-marker {
+GnmItemGrid function-marker {
   color: green;
   border-color: #555555;
   /* See also GnmPane */
 }
 
 /* This is the divider between panes when an area is frozen.  */
-ItemGrid pane-divider {
+GnmItemGrid pane-divider {
   color: #333333;
 
   /* This isn't working well yet: */
diff --git a/src/gui-gnumeric.h b/src/gui-gnumeric.h
index ffb7e67..cf8e45b 100644
--- a/src/gui-gnumeric.h
+++ b/src/gui-gnumeric.h
@@ -6,10 +6,10 @@
 
 G_BEGIN_DECLS
 
-typedef struct _ItemCursor             ItemCursor;
-typedef struct _ItemGrid               ItemGrid;
+typedef struct _GnmItemCursor          GnmItemCursor;
+typedef struct _GnmItemGrid            GnmItemGrid;
 typedef struct _GnmItemBar             GnmItemBar;
-typedef struct _ItemEdit               ItemEdit;
+typedef struct _GnmItemEdit            GnmItemEdit;
 typedef struct _GnmPane                        GnmPane;
 
 typedef struct _SheetControlGUI                SheetControlGUI;
diff --git a/src/item-bar.c b/src/item-bar.c
index 4718f8e..e607ca7 100644
--- a/src/item-bar.c
+++ b/src/item-bar.c
@@ -1129,7 +1129,7 @@ item_bar_dispose (GObject *obj)
 }
 
 static void
-item_bar_init (GnmItemBar *ib)
+gnm_item_bar_init (GnmItemBar *ib)
 {
        ib->base.x0 = 0;
        ib->base.y0 = 0;
@@ -1151,7 +1151,7 @@ item_bar_init (GnmItemBar *ib)
 }
 
 static void
-item_bar_class_init (GObjectClass  *gobject_klass)
+gnm_item_bar_class_init (GObjectClass  *gobject_klass)
 {
        GocItemClass *item_klass = (GocItemClass *) gobject_klass;
 
@@ -1183,5 +1183,5 @@ item_bar_class_init (GObjectClass  *gobject_klass)
 }
 
 GSF_CLASS (GnmItemBar, gnm_item_bar,
-          item_bar_class_init, item_bar_init,
+          gnm_item_bar_class_init, gnm_item_bar_init,
           GOC_TYPE_ITEM)
diff --git a/src/item-cursor.c b/src/item-cursor.c
index 92f0696..d9c64d7 100644
--- a/src/item-cursor.c
+++ b/src/item-cursor.c
@@ -37,13 +37,13 @@
 #include <goffice/goffice.h>
 #define GNUMERIC_ITEM "CURSOR"
 
-#define ITEM_CURSOR_CLASS(k)      (G_TYPE_CHECK_CLASS_CAST ((k), item_cursor_get_type (), ItemCursorClass))
+#define ITEM_CURSOR_CLASS(k)      (G_TYPE_CHECK_CLASS_CAST ((k), gnm_item_cursor_get_type (), 
GnmItemCursorClass))
 
 #define AUTO_HANDLE_WIDTH      2
 #define AUTO_HANDLE_SPACE      (AUTO_HANDLE_WIDTH * 2)
 #define CLIP_SAFETY_MARGIN      (AUTO_HANDLE_SPACE + 5)
 
-struct _ItemCursor {
+struct _GnmItemCursor {
        GocItem canvas_item;
 
        SheetControlGUI *scg;
@@ -57,7 +57,7 @@ struct _ItemCursor {
        GtkWidget        *tip;
        GnmCellPos last_tip_pos;
 
-       ItemCursorStyle style;
+       GnmItemCursorStyle style;
        int      state;
        int      animation_timer;
 
@@ -87,7 +87,7 @@ struct _ItemCursor {
 
        GdkRGBA  color;
 };
-typedef GocItemClass ItemCursorClass;
+typedef GocItemClass GnmItemCursorClass;
 
 static GocItemClass *parent_class;
 
@@ -100,7 +100,7 @@ enum {
 };
 
 static int
-cb_item_cursor_animation (ItemCursor *ic)
+cb_item_cursor_animation (GnmItemCursor *ic)
 {
        GocItem *item = GOC_ITEM (ic);
 
@@ -112,7 +112,7 @@ cb_item_cursor_animation (ItemCursor *ic)
 static void
 item_cursor_dispose (GObject *obj)
 {
-       ItemCursor *ic = ITEM_CURSOR (obj);
+       GnmItemCursor *ic = GNM_ITEM_CURSOR (obj);
 
        if (ic->tip) {
                gtk_widget_destroy (gtk_widget_get_toplevel (ic->tip));
@@ -125,12 +125,12 @@ item_cursor_dispose (GObject *obj)
 static void
 item_cursor_realize (GocItem *item)
 {
-       ItemCursor *ic = ITEM_CURSOR (item);
+       GnmItemCursor *ic = GNM_ITEM_CURSOR (item);
 
        if (parent_class->realize)
                (*parent_class->realize) (item);
 
-       if (ic->style == ITEM_CURSOR_ANTED) {
+       if (ic->style == GNM_ITEM_CURSOR_ANTED) {
                g_return_if_fail (ic->animation_timer == -1);
                ic->animation_timer = g_timeout_add (
                        150, (GSourceFunc) cb_item_cursor_animation,
@@ -141,7 +141,7 @@ item_cursor_realize (GocItem *item)
 static void
 item_cursor_unrealize (GocItem *item)
 {
-       ItemCursor *ic = ITEM_CURSOR (item);
+       GnmItemCursor *ic = GNM_ITEM_CURSOR (item);
 
        if (ic->animation_timer != -1) {
                g_source_remove (ic->animation_timer);
@@ -155,7 +155,7 @@ item_cursor_unrealize (GocItem *item)
 static void
 item_cursor_update_bounds (GocItem *item)
 {
-       ItemCursor      *ic = ITEM_CURSOR (item);
+       GnmItemCursor   *ic = GNM_ITEM_CURSOR (item);
        GnmPane         *pane = GNM_PANE (item->canvas);
        SheetControlGUI const * const scg = ic->scg;
        int tmp;
@@ -182,7 +182,7 @@ item_cursor_update_bounds (GocItem *item)
        item->y0 = (ic->outline.y1 - 2) / scale;
 
        /* for the autohandle */
-       tmp = (ic->style == ITEM_CURSOR_SELECTION) ? AUTO_HANDLE_WIDTH : 0;
+       tmp = (ic->style == GNM_ITEM_CURSOR_SELECTION) ? AUTO_HANDLE_WIDTH : 0;
        item->x1 = (ic->outline.x2 + 3 + tmp) / scale;
        item->y1 = (ic->outline.y2 + 3 + tmp) / scale;
 }
@@ -190,7 +190,7 @@ item_cursor_update_bounds (GocItem *item)
 static void
 item_cursor_draw (GocItem const *item, cairo_t *cr)
 {
-       ItemCursor *ic = ITEM_CURSOR (item);
+       GnmItemCursor *ic = GNM_ITEM_CURSOR (item);
        int x0, y0, x1, y1; /* in widget coordinates */
        GocPoint points[5];
        int i, draw_thick, draw_handle;
@@ -237,8 +237,8 @@ item_cursor_draw (GocItem const *item, cairo_t *cr)
        draw_xor      = TRUE;
 
        switch (ic->style) {
-       case ITEM_CURSOR_AUTOFILL:
-       case ITEM_CURSOR_DRAG:
+       case GNM_ITEM_CURSOR_AUTOFILL:
+       case GNM_ITEM_CURSOR_DRAG:
                draw_center   = TRUE;
                draw_thick    = 3;
                draw_stippled = TRUE;
@@ -246,13 +246,13 @@ item_cursor_draw (GocItem const *item, cairo_t *cr)
                back          = &gs_white;
                break;
 
-       case ITEM_CURSOR_EXPR_RANGE:
+       case GNM_ITEM_CURSOR_EXPR_RANGE:
                draw_center   = TRUE;
                draw_thick    = (item->canvas->last_item == item) ? 3 : 2;
                draw_xor      = FALSE;
                break;
 
-       case ITEM_CURSOR_SELECTION:
+       case GNM_ITEM_CURSOR_SELECTION:
                draw_internal = TRUE;
                draw_external = TRUE;
                {
@@ -277,7 +277,7 @@ item_cursor_draw (GocItem const *item, cairo_t *cr)
                }
                break;
 
-       case ITEM_CURSOR_ANTED:
+       case GNM_ITEM_CURSOR_ANTED:
                draw_center   = TRUE;
                draw_thick    = 2;
                if (ic->state) {
@@ -452,10 +452,10 @@ item_cursor_draw (GocItem const *item, cairo_t *cr)
 }
 
 gboolean
-item_cursor_bound_set (ItemCursor *ic, GnmRange const *new_bound)
+gnm_item_cursor_bound_set (GnmItemCursor *ic, GnmRange const *new_bound)
 {
        GocItem *item;
-       g_return_val_if_fail (IS_ITEM_CURSOR (ic), FALSE);
+       g_return_val_if_fail (GNM_IS_ITEM_CURSOR (ic), FALSE);
        g_return_val_if_fail (range_is_sane (new_bound), FALSE);
 
        if (ic->pos_initialized && range_equal (&ic->pos, new_bound))
@@ -473,7 +473,7 @@ item_cursor_bound_set (ItemCursor *ic, GnmRange const *new_bound)
 }
 
 /**
- * item_cursor_reposition:
+ * gnm_item_cursor_reposition:
  *
  * Re-compute the pixel position of the cursor.
  *
@@ -481,7 +481,7 @@ item_cursor_bound_set (ItemCursor *ic, GnmRange const *new_bound)
  * must regenerate to stay in sync.
  **/
 void
-item_cursor_reposition (ItemCursor *ic)
+gnm_item_cursor_reposition (GnmItemCursor *ic)
 {
        g_return_if_fail (GOC_IS_ITEM (ic));
        goc_item_bounds_changed (GOC_ITEM (ic));
@@ -491,14 +491,14 @@ static double
 item_cursor_distance (GocItem *item, double x, double y,
                      GocItem **actual_item)
 {
-       ItemCursor const *ic = ITEM_CURSOR (item);
+       GnmItemCursor const *ic = GNM_ITEM_CURSOR (item);
 
        /* Cursor should not always receive events
         * 1) when invisible
         * 2) when animated
         * 3) while a guru is up
         */
-       if (!ic->visible || ic->style == ITEM_CURSOR_ANTED ||
+       if (!ic->visible || ic->style == GNM_ITEM_CURSOR_ANTED ||
            wbc_gtk_get_guru (scg_wbcg (ic->scg)) != NULL)
                return DBL_MAX;
 
@@ -522,7 +522,7 @@ item_cursor_distance (GocItem *item, double x, double y,
 }
 
 static void
-item_cursor_setup_auto_fill (ItemCursor *ic, ItemCursor const *parent, int x, int y)
+item_cursor_setup_auto_fill (GnmItemCursor *ic, GnmItemCursor const *parent, int x, int y)
 {
        Sheet const *sheet = scg_sheet (parent->scg);
        GSList *merges;
@@ -551,7 +551,7 @@ item_cursor_setup_auto_fill (ItemCursor *ic, ItemCursor const *parent, int x, in
 }
 
 static inline gboolean
-item_cursor_in_drag_handle (ItemCursor *ic, gint64 x, gint64 y)
+item_cursor_in_drag_handle (GnmItemCursor *ic, gint64 x, gint64 y)
 {
        double scale = ic->canvas_item.canvas->pixels_per_unit;
        gint64 const y_test = ic->auto_fill_handle_at_top
@@ -574,7 +574,7 @@ item_cursor_in_drag_handle (ItemCursor *ic, gint64 x, gint64 y)
 }
 
 static void
-item_cursor_set_cursor (GocCanvas *canvas, ItemCursor *ic, gint64 x, gint64 y)
+item_cursor_set_cursor (GocCanvas *canvas, GnmItemCursor *ic, gint64 x, gint64 y)
 {
        GdkCursorType cursor;
 
@@ -591,10 +591,10 @@ item_cursor_selection_motion (GocItem *item, double x_, double y_)
 {
        GocCanvas  *canvas = item->canvas;
        GnmPane  *pane = GNM_PANE (canvas);
-       ItemCursor *ic = ITEM_CURSOR (item);
+       GnmItemCursor *ic = GNM_ITEM_CURSOR (item);
        int style, button;
        gint64 x = x_ * canvas->pixels_per_unit, y = y_ * canvas->pixels_per_unit;
-       ItemCursor *special_cursor;
+       GnmItemCursor *special_cursor;
        GdkEventMotion *event = (GdkEventMotion *) goc_canvas_get_cur_event (item->canvas);
 
        if (ic->drag_button < 0) {
@@ -607,9 +607,9 @@ item_cursor_selection_motion (GocItem *item, double x_, double y_)
         * the border or the handlebox
         */
        if (item_cursor_in_drag_handle (ic, x_, y_))
-               style = ITEM_CURSOR_AUTOFILL;
+               style = GNM_ITEM_CURSOR_AUTOFILL;
        else
-               style = ITEM_CURSOR_DRAG;
+               style = GNM_ITEM_CURSOR_DRAG;
 
        button = ic->drag_button;
        ic->drag_button = -1;
@@ -618,7 +618,7 @@ item_cursor_selection_motion (GocItem *item, double x_, double y_)
        scg_special_cursor_start (ic->scg, style, button);
        special_cursor = pane->cursor.special;
        special_cursor->drag_button_state = ic->drag_button_state;
-       if (style == ITEM_CURSOR_AUTOFILL)
+       if (style == GNM_ITEM_CURSOR_AUTOFILL)
                item_cursor_setup_auto_fill (
                        special_cursor, ic, x, y);
 
@@ -688,7 +688,7 @@ typedef enum {
 } ActionType;
 
 static void
-item_cursor_do_action (ItemCursor *ic, ActionType action)
+item_cursor_do_action (GnmItemCursor *ic, ActionType action)
 {
        SheetView       *sv;
        Sheet           *sheet;
@@ -764,7 +764,7 @@ context_menu_hander (GnumericPopupMenuElement const *element,
 }
 
 static void
-item_cursor_popup_menu (ItemCursor *ic, GdkEventButton *event)
+item_cursor_popup_menu (GnmItemCursor *ic, GdkEventButton *event)
 {
        static GnumericPopupMenuElement const popup_elements[] = {
                { N_("_Move"),          NULL,
@@ -803,7 +803,7 @@ item_cursor_popup_menu (ItemCursor *ic, GdkEventButton *event)
 }
 
 static void
-item_cursor_do_drop (ItemCursor *ic, GdkEventButton *event)
+item_cursor_do_drop (GnmItemCursor *ic, GdkEventButton *event)
 {
        /* Only do the operation if something moved */
        SheetView const *sv = scg_view (ic->scg);
@@ -824,9 +824,9 @@ item_cursor_do_drop (ItemCursor *ic, GdkEventButton *event)
 }
 
 void
-item_cursor_set_visibility (ItemCursor *ic, gboolean visible)
+gnm_item_cursor_set_visibility (GnmItemCursor *ic, gboolean visible)
 {
-       g_return_if_fail (IS_ITEM_CURSOR (ic));
+       g_return_if_fail (GNM_IS_ITEM_CURSOR (ic));
 
        if (ic->visible == visible)
                return;
@@ -839,7 +839,7 @@ item_cursor_set_visibility (ItemCursor *ic, gboolean visible)
 }
 
 static void
-item_cursor_tip_setlabel (ItemCursor *ic, char const *text)
+item_cursor_tip_setlabel (GnmItemCursor *ic, char const *text)
 {
        if (ic->tip == NULL) {
                GtkWidget *cw = GTK_WIDGET (GOC_ITEM (ic)->canvas);
@@ -858,7 +858,7 @@ item_cursor_tip_setlabel (ItemCursor *ic, char const *text)
 static gboolean
 cb_move_cursor (GnmPane *pane, GnmPaneSlideInfo const *info)
 {
-       ItemCursor *ic = info->user_data;
+       GnmItemCursor *ic = info->user_data;
        int const w = (ic->pos.end.col - ic->pos.start.col);
        int const h = (ic->pos.end.row - ic->pos.start.row);
        GnmRange r;
@@ -886,7 +886,7 @@ cb_move_cursor (GnmPane *pane, GnmPaneSlideInfo const *info)
 }
 
 static void
-item_cursor_handle_motion (ItemCursor *ic, double x, double y,
+item_cursor_handle_motion (GnmItemCursor *ic, double x, double y,
                           GnmPaneSlideHandler slide_handler)
 {
        GocCanvas *canvas = GOC_ITEM (ic)->canvas;
@@ -899,7 +899,7 @@ item_cursor_handle_motion (ItemCursor *ic, double x, double y,
 }
 
 static gboolean
-item_cursor_drag_motion (ItemCursor *ic, double x, double y)
+item_cursor_drag_motion (GnmItemCursor *ic, double x, double y)
 {
        item_cursor_handle_motion (ic, x, y, &cb_move_cursor);
        return TRUE;
@@ -935,7 +935,7 @@ limit_string_height_and_width (GString *s, size_t wmax, size_t hmax)
 static gboolean
 cb_autofill_scroll (GnmPane *pane, GnmPaneSlideInfo const *info)
 {
-       ItemCursor *ic = info->user_data;
+       GnmItemCursor *ic = info->user_data;
        GnmRange r = ic->autofill_src;
        int col = info->col, row = info->row;
        int h, w;
@@ -1018,10 +1018,10 @@ cb_autofill_scroll (GnmPane *pane, GnmPaneSlideInfo const *info)
 static gboolean
 item_cursor_button_pressed (GocItem *item, int button, double x_, double y_)
 {
-       ItemCursor *ic = ITEM_CURSOR (item);
+       GnmItemCursor *ic = GNM_ITEM_CURSOR (item);
        gint64 x = x_ * item->canvas->pixels_per_unit, y = y_ * item->canvas->pixels_per_unit;
        GdkEventButton *event = (GdkEventButton *) goc_canvas_get_cur_event (item->canvas);
-       if (ic->style == ITEM_CURSOR_EXPR_RANGE)
+       if (ic->style == GNM_ITEM_CURSOR_EXPR_RANGE)
                return FALSE;
 
        /* While editing nothing should be draggable */
@@ -1030,12 +1030,12 @@ item_cursor_button_pressed (GocItem *item, int button, double x_, double y_)
 
        switch (ic->style) {
 
-       case ITEM_CURSOR_ANTED:
+       case GNM_ITEM_CURSOR_ANTED:
                g_warning ("Animated cursors should not receive events, "
                           "the point method should preclude that");
                return FALSE;
 
-       case ITEM_CURSOR_SELECTION:
+       case GNM_ITEM_CURSOR_SELECTION:
                /* NOTE : this cannot be called while we are editing.  because
                 * the point routine excludes events.  so we do not need to
                 * call wbcg_edit_finish.
@@ -1072,7 +1072,7 @@ item_cursor_button_pressed (GocItem *item, int button, double x_, double y_)
                        scg_context_menu (ic->scg, event, FALSE, FALSE);
                return TRUE;
 
-       case ITEM_CURSOR_DRAG:
+       case GNM_ITEM_CURSOR_DRAG:
                /* This kind of cursor is created and grabbed.  Then destroyed
                 * when the button is released.  If we are seeing a press it
                 * means that someone has pressed another button WHILE THE
@@ -1089,12 +1089,12 @@ item_cursor_button_pressed (GocItem *item, int button, double x_, double y_)
 static gboolean
 item_cursor_button2_pressed (GocItem *item, int button, double x_, double y_)
 {
-       ItemCursor *ic = ITEM_CURSOR (item);
+       GnmItemCursor *ic = GNM_ITEM_CURSOR (item);
        GdkEventButton *event = (GdkEventButton *) goc_canvas_get_cur_event (item->canvas);
 
        switch (ic->style) {
 
-       case ITEM_CURSOR_SELECTION: {
+       case GNM_ITEM_CURSOR_SELECTION: {
                Sheet *sheet = scg_sheet (ic->scg);
                int final_col = ic->pos.end.col;
                int final_row = ic->pos.end.row;
@@ -1244,7 +1244,7 @@ item_cursor_button2_pressed (GocItem *item, int button, double x_, double y_)
                return TRUE;
        }
 
-       case ITEM_CURSOR_DRAG:
+       case GNM_ITEM_CURSOR_DRAG:
                return TRUE;
 
        default:
@@ -1256,7 +1256,7 @@ item_cursor_button2_pressed (GocItem *item, int button, double x_, double y_)
 static gboolean
 item_cursor_motion (GocItem *item, double x_, double y_)
 {
-       ItemCursor *ic = ITEM_CURSOR (item);
+       GnmItemCursor *ic = GNM_ITEM_CURSOR (item);
        gint64 x = x_ * item->canvas->pixels_per_unit, y = y_ * item->canvas->pixels_per_unit;
        ic->last_x = x;
        ic->last_y = y;
@@ -1264,7 +1264,7 @@ item_cursor_motion (GocItem *item, double x_, double y_)
                item_cursor_set_cursor (item->canvas, ic, x, y);
                return TRUE;
        }
-       if (ic->style == ITEM_CURSOR_EXPR_RANGE)
+       if (ic->style == GNM_ITEM_CURSOR_EXPR_RANGE)
                return FALSE;
 
        /* While editing nothing should be draggable */
@@ -1272,19 +1272,19 @@ item_cursor_motion (GocItem *item, double x_, double y_)
                return TRUE;
        switch (ic->style) {
 
-       case ITEM_CURSOR_ANTED:
+       case GNM_ITEM_CURSOR_ANTED:
                g_warning ("Animated cursors should not receive events, "
                           "the point method should preclude that");
                return FALSE;
 
-       case ITEM_CURSOR_SELECTION:
+       case GNM_ITEM_CURSOR_SELECTION:
                return item_cursor_selection_motion (item, x, y);
 
-       case ITEM_CURSOR_DRAG:
+       case GNM_ITEM_CURSOR_DRAG:
                return item_cursor_drag_motion (ic, x, y);
 
-       case ITEM_CURSOR_AUTOFILL:
-               item_cursor_handle_motion (ITEM_CURSOR (item), x, y, &cb_autofill_scroll);
+       case GNM_ITEM_CURSOR_AUTOFILL:
+               item_cursor_handle_motion (GNM_ITEM_CURSOR (item), x, y, &cb_autofill_scroll);
                return TRUE;
 
        default:
@@ -1295,11 +1295,11 @@ item_cursor_motion (GocItem *item, double x_, double y_)
 static gboolean
 item_cursor_button_released (GocItem *item, int button, G_GNUC_UNUSED double x, G_GNUC_UNUSED double y)
 {
-       ItemCursor *ic = ITEM_CURSOR (item);
+       GnmItemCursor *ic = GNM_ITEM_CURSOR (item);
        GdkEventButton *event = (GdkEventButton *) goc_canvas_get_cur_event (item->canvas);
        WBCGtk *wbcg = scg_wbcg (ic->scg);
 
-       if (ic->style == ITEM_CURSOR_EXPR_RANGE)
+       if (ic->style == GNM_ITEM_CURSOR_EXPR_RANGE)
                return FALSE;
 
        /* While editing nothing should be draggable */
@@ -1307,12 +1307,12 @@ item_cursor_button_released (GocItem *item, int button, G_GNUC_UNUSED double x,
                return TRUE;
 
        switch (ic->style) {
-       case ITEM_CURSOR_ANTED:
+       case GNM_ITEM_CURSOR_ANTED:
                g_warning ("Animated cursors should not receive events, "
                           "the point method should preclude that");
                return FALSE;
 
-       case ITEM_CURSOR_SELECTION:
+       case GNM_ITEM_CURSOR_SELECTION:
                if (ic->drag_button != button)
                        return TRUE;
 
@@ -1325,7 +1325,7 @@ item_cursor_button_released (GocItem *item, int button, G_GNUC_UNUSED double x,
                                                     NULL);
                return TRUE;
 
-       case ITEM_CURSOR_DRAG:
+       case GNM_ITEM_CURSOR_DRAG:
                if (ic->drag_button != button)
                        return TRUE;
 
@@ -1337,7 +1337,7 @@ item_cursor_button_released (GocItem *item, int button, G_GNUC_UNUSED double x,
                                                     NULL);
                return TRUE;
 
-       case ITEM_CURSOR_AUTOFILL: {
+       case GNM_ITEM_CURSOR_AUTOFILL: {
                gboolean inverse_autofill =
                        (ic->pos.start.col < ic->autofill_src.start.col ||
                         ic->pos.start.row < ic->autofill_src.start.row);
@@ -1369,13 +1369,13 @@ item_cursor_button_released (GocItem *item, int button, G_GNUC_UNUSED double x,
 static gboolean
 item_cursor_enter_notify (GocItem *item, double x_, double y_)
 {
-       ItemCursor *ic = ITEM_CURSOR (item);
+       GnmItemCursor *ic = GNM_ITEM_CURSOR (item);
        gint64 x = x_ * item->canvas->pixels_per_unit, y = y_ * item->canvas->pixels_per_unit;
-       if (ic->style == ITEM_CURSOR_EXPR_RANGE) {
+       if (ic->style == GNM_ITEM_CURSOR_EXPR_RANGE) {
                gnm_widget_set_cursor_type (GTK_WIDGET (item->canvas), GDK_ARROW);
                goc_item_invalidate (item);
        }
-       else if (ic->style == ITEM_CURSOR_SELECTION)
+       else if (ic->style == GNM_ITEM_CURSOR_SELECTION)
                item_cursor_set_cursor (item->canvas, ic, x, y);
        return FALSE;
 }
@@ -1383,8 +1383,8 @@ item_cursor_enter_notify (GocItem *item, double x_, double y_)
 static gboolean
 item_cursor_leave_notify (GocItem *item, G_GNUC_UNUSED double x, G_GNUC_UNUSED double y)
 {
-       ItemCursor *ic = ITEM_CURSOR (item);
-       if (ic->style == ITEM_CURSOR_EXPR_RANGE)
+       GnmItemCursor *ic = GNM_ITEM_CURSOR (item);
+       if (ic->style == GNM_ITEM_CURSOR_EXPR_RANGE)
                goc_item_invalidate (item);
        return FALSE;
 }
@@ -1393,7 +1393,7 @@ static void
 item_cursor_set_property (GObject *obj, guint param_id,
                          GValue const *value, GParamSpec *pspec)
 {
-       ItemCursor *ic = ITEM_CURSOR (obj);
+       GnmItemCursor *ic = GNM_ITEM_CURSOR (obj);
        char const *color_name;
 
        switch (param_id) {
@@ -1418,10 +1418,10 @@ item_cursor_set_property (GObject *obj, guint param_id,
 }
 
 /*
- * ItemCursor class initialization
+ * GnmItemCursor class initialization
  */
 static void
-item_cursor_class_init (GObjectClass *gobject_klass)
+gnm_item_cursor_class_init (GObjectClass *gobject_klass)
 {
 
        GocItemClass *item_klass = (GocItemClass *) gobject_klass;
@@ -1465,7 +1465,7 @@ item_cursor_class_init (GObjectClass *gobject_klass)
 }
 
 static void
-item_cursor_init (ItemCursor *ic)
+gnm_item_cursor_init (GnmItemCursor *ic)
 {
        ic->pos_initialized = FALSE;
        ic->pos.start.col = 0;
@@ -1483,7 +1483,7 @@ item_cursor_init (ItemCursor *ic)
        ic->last_x = 0;
        ic->last_y = 0;
 
-       ic->style = ITEM_CURSOR_SELECTION;
+       ic->style = GNM_ITEM_CURSOR_SELECTION;
        ic->state = 0;
        ic->animation_timer = -1;
 
@@ -1493,6 +1493,6 @@ item_cursor_init (ItemCursor *ic)
        ic->drag_button = -1;
 }
 
-GSF_CLASS (ItemCursor, item_cursor,
-          item_cursor_class_init, item_cursor_init,
+GSF_CLASS (GnmItemCursor, gnm_item_cursor,
+          gnm_item_cursor_class_init, gnm_item_cursor_init,
           GOC_TYPE_ITEM)
diff --git a/src/item-cursor.h b/src/item-cursor.h
index cad315b..a889027 100644
--- a/src/item-cursor.h
+++ b/src/item-cursor.h
@@ -1,29 +1,27 @@
-/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 #ifndef _GNM_ITEM_CURSOR_H_
-# define _GNM_ITEM_CURSOR_H_
+#define _GNM_ITEM_CURSOR_H_
 
 #include "gui-gnumeric.h"
 #include <glib-object.h>
-#include <goffice/canvas/goffice-canvas.h>
 
 G_BEGIN_DECLS
 
-#define ITEM_CURSOR(obj)          (G_TYPE_CHECK_INSTANCE_CAST((obj), item_cursor_get_type (), ItemCursor))
-#define IS_ITEM_CURSOR(o)         (G_TYPE_CHECK_INSTANCE_TYPE((o), item_cursor_get_type ()))
+#define GNM_ITEM_CURSOR(obj)          (G_TYPE_CHECK_INSTANCE_CAST((obj), gnm_item_cursor_get_type (), 
GnmItemCursor))
+#define GNM_IS_ITEM_CURSOR(o)         (G_TYPE_CHECK_INSTANCE_TYPE((o), gnm_item_cursor_get_type ()))
 
 typedef enum {
-       ITEM_CURSOR_SELECTION,
-       ITEM_CURSOR_ANTED,
-       ITEM_CURSOR_AUTOFILL,
-       ITEM_CURSOR_DRAG,
-       ITEM_CURSOR_EXPR_RANGE
-} ItemCursorStyle;
-
-GType item_cursor_get_type (void);
-
-gboolean item_cursor_bound_set     (ItemCursor *ic, GnmRange const *bound);
-void     item_cursor_set_visibility (ItemCursor *ic, gboolean visible);
-void     item_cursor_reposition     (ItemCursor *ic);
+       GNM_ITEM_CURSOR_SELECTION,
+       GNM_ITEM_CURSOR_ANTED,
+       GNM_ITEM_CURSOR_AUTOFILL,
+       GNM_ITEM_CURSOR_DRAG,
+       GNM_ITEM_CURSOR_EXPR_RANGE
+} GnmItemCursorStyle;
+
+GType gnm_item_cursor_get_type (void);
+
+gboolean gnm_item_cursor_bound_set      (GnmItemCursor *ic, GnmRange const *bound);
+void     gnm_item_cursor_set_visibility (GnmItemCursor *ic, gboolean visible);
+void     gnm_item_cursor_reposition     (GnmItemCursor *ic);
 
 G_END_DECLS
 
diff --git a/src/item-edit.c b/src/item-edit.c
index 75d1486..c2ce6ee 100644
--- a/src/item-edit.c
+++ b/src/item-edit.c
@@ -43,7 +43,7 @@
 
 static GocItemClass *parent_class;
 
-struct _ItemEdit {
+struct _GnmItemEdit {
        GocItem item;
 
        SheetControlGUI *scg;
@@ -61,7 +61,7 @@ struct _ItemEdit {
        GnmStyle  *style;
 };
 
-typedef GocItemClass ItemEditClass;
+typedef GocItemClass GnmItemEditClass;
 
 /* The arguments we take */
 enum {
@@ -70,7 +70,7 @@ enum {
 };
 
 static void
-get_top_left (ItemEdit const *ie, int *top, int *left, PangoDirection dir)
+get_top_left (GnmItemEdit const *ie, int *top, int *left, PangoDirection dir)
 {
        GnmVAlign const align = gnm_style_get_align_v (ie->style);
        GocItem *item = GOC_ITEM (ie);
@@ -116,7 +116,7 @@ gnm_apply_attribute_list (PangoAttrList *attrs, PangoAttrList *added_attrs)
 static void
 item_edit_draw (GocItem const *item, cairo_t *cr)
 {
-       ItemEdit  const *ie     = ITEM_EDIT (item);
+       GnmItemEdit  const *ie  = GNM_ITEM_EDIT (item);
        int top, left;
        GOColor color;
        int x0, y0, x1, y1; /* in widget coordinates */
@@ -270,7 +270,7 @@ static int
 item_edit_button_pressed (GocItem *item, int button, double x, double y)
 {
        if (button == 1) {
-               ItemEdit *ie = ITEM_EDIT (item);
+               GnmItemEdit *ie = GNM_ITEM_EDIT (item);
                GtkEditable *ed = GTK_EDITABLE (ie->entry);
                int target_index, trailing;
                char const *text = pango_layout_get_text (ie->layout);
@@ -323,7 +323,7 @@ item_edit_button_pressed (GocItem *item, int button, double x, double y)
 static gboolean
 item_edit_motion (GocItem *item, double x, double y)
 {
-       ItemEdit *ie = ITEM_EDIT (item);
+       GnmItemEdit *ie = GNM_ITEM_EDIT (item);
        if (ie->sel_start >= 0) {
                GtkEditable *ed = GTK_EDITABLE (ie->entry);
                int target_index, trailing;
@@ -381,7 +381,7 @@ static gboolean
 item_edit_button_released (GocItem *item, G_GNUC_UNUSED int button,
                           G_GNUC_UNUSED double x, G_GNUC_UNUSED double y)
 {
-       ItemEdit *ie = ITEM_EDIT (item);
+       GnmItemEdit *ie = GNM_ITEM_EDIT (item);
        if (ie->sel_start >= 0) {
                ie->sel_start = -1;
                return TRUE;
@@ -392,7 +392,7 @@ item_edit_button_released (GocItem *item, G_GNUC_UNUSED int button,
 static void
 item_edit_update_bounds (GocItem *item)
 {
-       ItemEdit *ie = ITEM_EDIT (item);
+       GnmItemEdit *ie = GNM_ITEM_EDIT (item);
        double scale = item->canvas->pixels_per_unit;
 
        if (ie->gfont != NULL) {
@@ -545,14 +545,14 @@ cb_entry_cursor_event (GocItem *item)
 {
        /* ensure we draw a cursor when moving quickly no matter what the
         * current state is */
-       ITEM_EDIT (item)->cursor_visible = TRUE;
+       GNM_ITEM_EDIT (item)->cursor_visible = TRUE;
        goc_item_invalidate (item);
 
        return TRUE;
 }
 
 static int
-cb_item_edit_cursor_blink (ItemEdit *ie)
+cb_item_edit_cursor_blink (GnmItemEdit *ie)
 {
        GocItem *item = GOC_ITEM (ie);
 
@@ -563,7 +563,7 @@ cb_item_edit_cursor_blink (ItemEdit *ie)
 }
 
 static void
-item_edit_cursor_blink_stop (ItemEdit *ie)
+item_edit_cursor_blink_stop (GnmItemEdit *ie)
 {
        if (ie->blink_timer != -1) {
                g_source_remove (ie->blink_timer);
@@ -572,7 +572,7 @@ item_edit_cursor_blink_stop (ItemEdit *ie)
 }
 
 static void
-item_edit_cursor_blink_start (ItemEdit *ie)
+item_edit_cursor_blink_start (GnmItemEdit *ie)
 {
        gboolean blink;
        int      blink_time;
@@ -590,7 +590,7 @@ item_edit_cursor_blink_start (ItemEdit *ie)
 static void
 item_edit_realize (GocItem *item)
 {
-       ItemEdit *ie = ITEM_EDIT (item);
+       GnmItemEdit *ie = GNM_ITEM_EDIT (item);
        Sheet const *sheet;
        GnmPane *pane;
        double scale;
@@ -658,7 +658,7 @@ item_edit_realize (GocItem *item)
 static void
 item_edit_unrealize (GocItem *item)
 {
-       ItemEdit *ie = ITEM_EDIT (item);
+       GnmItemEdit *ie = GNM_ITEM_EDIT (item);
 
        item_edit_cursor_blink_stop (ie);
 
@@ -684,7 +684,7 @@ item_edit_unrealize (GocItem *item)
 }
 
 static void
-item_edit_init (ItemEdit *ie)
+gnm_item_edit_init (GnmItemEdit *ie)
 {
        ie->scg = NULL;
        ie->pos.col = -1;
@@ -699,7 +699,7 @@ static void
 item_edit_set_property (GObject *gobject, guint param_id,
                        GValue const *value, GParamSpec *pspec)
 {
-       ItemEdit *ie = ITEM_EDIT (gobject);
+       GnmItemEdit *ie = GNM_ITEM_EDIT (gobject);
 
        switch (param_id) {
        case ARG_SHEET_CONTROL_GUI: {
@@ -718,7 +718,7 @@ item_edit_set_property (GObject *gobject, guint param_id,
 }
 
 static void
-item_edit_class_init (GObjectClass *gobject_class)
+gnm_item_edit_class_init (GObjectClass *gobject_class)
 {
        GocItemClass *item_class = (GocItemClass *) gobject_class;
 
@@ -748,6 +748,6 @@ item_edit_class_init (GObjectClass *gobject_class)
        item_class->button_released = item_edit_button_released;
 }
 
-GSF_CLASS (ItemEdit, item_edit,
-          item_edit_class_init, item_edit_init,
+GSF_CLASS (GnmItemEdit, gnm_item_edit,
+          gnm_item_edit_class_init, gnm_item_edit_init,
           GOC_TYPE_ITEM)
diff --git a/src/item-edit.h b/src/item-edit.h
index bab451b..9813023 100644
--- a/src/item-edit.h
+++ b/src/item-edit.h
@@ -1,16 +1,15 @@
-/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 #ifndef _GNM_ITEM_EDIT_H_
-# define _GNM_ITEM_EDIT_H_
+#define _GNM_ITEM_EDIT_H_
 
 #include "gui-gnumeric.h"
 #include <glib-object.h>
 
 G_BEGIN_DECLS
 
-#define ITEM_EDIT(obj)          (G_TYPE_CHECK_INSTANCE_CAST((obj), item_edit_get_type (), ItemEdit))
-#define IS_ITEM_EDIT(o)         (G_TYPE_CHECK_INSTANCE_TYPE((o), item_edit_get_type ()))
+#define GNM_ITEM_EDIT(obj)    (G_TYPE_CHECK_INSTANCE_CAST((obj), gnm_item_edit_get_type (), GnmItemEdit))
+#define GNM_IS_ITEM_EDIT(o)   (G_TYPE_CHECK_INSTANCE_TYPE((o), gnm_item_edit_get_type ()))
 
-GType item_edit_get_type (void);
+GType gnm_item_edit_get_type (void);
 
 G_END_DECLS
 
diff --git a/src/item-grid.c b/src/item-grid.c
index 2063dea..8a8fe39 100644
--- a/src/item-grid.c
+++ b/src/item-grid.c
@@ -55,12 +55,12 @@
 #endif
 
 typedef enum {
-       ITEM_GRID_NO_SELECTION,
-       ITEM_GRID_SELECTING_CELL_RANGE,
-       ITEM_GRID_SELECTING_FORMULA_RANGE
+       GNM_ITEM_GRID_NO_SELECTION,
+       GNM_ITEM_GRID_SELECTING_CELL_RANGE,
+       GNM_ITEM_GRID_SELECTING_FORMULA_RANGE
 } ItemGridSelectionType;
 
-struct _ItemGrid {
+struct _GnmItemGrid {
        GocItem canvas_item;
 
        SheetControlGUI *scg;
@@ -89,17 +89,17 @@ struct _ItemGrid {
        int pane_divider_width;
 
 };
-typedef GocItemClass ItemGridClass;
+typedef GocItemClass GnmItemGridClass;
 static GocItemClass *parent_class;
 
 enum {
-       ITEM_GRID_PROP_0,
-       ITEM_GRID_PROP_SHEET_CONTROL_GUI,
-       ITEM_GRID_PROP_BOUND
+       GNM_ITEM_GRID_PROP_0,
+       GNM_ITEM_GRID_PROP_SHEET_CONTROL_GUI,
+       GNM_ITEM_GRID_PROP_BOUND
 };
 
 static void
-ig_reload_style (ItemGrid *ig)
+ig_reload_style (GnmItemGrid *ig)
 {
        GocItem *item = GOC_ITEM (ig);
        GtkStyleContext *context = goc_item_get_style_context (item);
@@ -133,7 +133,7 @@ ig_reload_style (ItemGrid *ig)
 }
 
 static void
-ig_clear_hlink_tip (ItemGrid *ig)
+ig_clear_hlink_tip (GnmItemGrid *ig)
 {
        if (ig->tip_timer != 0) {
                g_source_remove (ig->tip_timer);
@@ -149,7 +149,7 @@ ig_clear_hlink_tip (ItemGrid *ig)
 static void
 item_grid_finalize (GObject *object)
 {
-       ItemGrid *ig = ITEM_GRID (object);
+       GnmItemGrid *ig = GNM_ITEM_GRID (object);
 
        if (ig->cursor_timer != 0) {
                g_source_remove (ig->cursor_timer);
@@ -162,7 +162,7 @@ item_grid_finalize (GObject *object)
 }
 
 static gint
-cb_cursor_motion (ItemGrid *ig)
+cb_cursor_motion (GnmItemGrid *ig)
 {
        Sheet const *sheet = scg_sheet (ig->scg);
        GocCanvas *canvas = ig->canvas_item.canvas;
@@ -198,11 +198,11 @@ static void
 item_grid_realize (GocItem *item)
 {
        GdkDisplay *display;
-       ItemGrid   *ig;
+       GnmItemGrid   *ig;
 
        parent_class->realize (item);
 
-       ig = ITEM_GRID (item);
+       ig = GNM_ITEM_GRID (item);
        ig_reload_style (ig);
 
        display = gtk_widget_get_display (GTK_WIDGET (item->canvas));
@@ -216,7 +216,7 @@ item_grid_realize (GocItem *item)
 static void
 item_grid_unrealize (GocItem *item)
 {
-       ItemGrid *ig = ITEM_GRID (item);
+       GnmItemGrid *ig = GNM_ITEM_GRID (item);
        g_clear_object (&ig->cursor_link);
        g_clear_object (&ig->cursor_cross);
        parent_class->unrealize (item);
@@ -232,7 +232,7 @@ item_grid_update_bounds (GocItem *item)
 }
 
 static void
-draw_function_marker (ItemGrid *ig,
+draw_function_marker (GnmItemGrid *ig,
                      GnmCell const *cell, cairo_t *cr,
                      double x, double y, double w, double h, int const dir)
 {
@@ -264,7 +264,7 @@ draw_function_marker (ItemGrid *ig,
 }
 
 static void
-item_grid_draw_merged_range (cairo_t *cr, ItemGrid *ig,
+item_grid_draw_merged_range (cairo_t *cr, GnmItemGrid *ig,
                             int start_x, int start_y,
                             GnmRange const *view, GnmRange const *range,
                             gboolean draw_selection, GtkStyleContext *ctxt)
@@ -368,7 +368,7 @@ item_grid_draw_merged_range (cairo_t *cr, ItemGrid *ig,
 }
 
 static void
-item_grid_draw_background (cairo_t *cr, ItemGrid *ig,
+item_grid_draw_background (cairo_t *cr, GnmItemGrid *ig,
                           GnmStyle const *style,
                           int col, int row, int x, int y, int w, int h,
                           gboolean draw_selection, GtkStyleContext *ctxt)
@@ -402,7 +402,7 @@ merged_col_cmp (GnmRange const *a, GnmRange const *b)
 }
 
 static void
-ig_cairo_draw_bound (ItemGrid *ig, cairo_t* cr, int x0, int y0, int x1, int y1)
+ig_cairo_draw_bound (GnmItemGrid *ig, cairo_t* cr, int x0, int y0, int x1, int y1)
 {
        double width = ig->pane_divider_width;
        cairo_set_line_width (cr, width);
@@ -428,7 +428,7 @@ item_grid_draw_region (GocItem const *item, cairo_t *cr,
        Sheet const *sheet = scg_sheet (pane->simple.scg);
        WBCGtk *wbcg = scg_wbcg (pane->simple.scg);
        GnmCell const * const edit_cell = wbcg->editing_cell;
-       ItemGrid *ig = ITEM_GRID (item);
+       GnmItemGrid *ig = GNM_ITEM_GRID (item);
        ColRowInfo const *ri = NULL, *next_ri = NULL;
        int const dir = sheet->text_is_rtl ? -1 : 1;
        SheetView const *sv = scg_view (ig->scg);
@@ -860,7 +860,7 @@ item_grid_distance (GocItem *item, G_GNUC_UNUSED double x, G_GNUC_UNUSED double
 /***********************************************************************/
 
 static gboolean
-ig_obj_create_begin (ItemGrid *ig, int button, gint64 x, gint64 y)
+ig_obj_create_begin (GnmItemGrid *ig, int button, gint64 x, gint64 y)
 {
        GnmPane *pane = GNM_PANE (GOC_ITEM (ig)->canvas);
        SheetObject *so = ig->scg->wbcg->new_object;
@@ -887,7 +887,7 @@ ig_obj_create_begin (ItemGrid *ig, int button, gint64 x, gint64 y)
 static int
 item_grid_button_pressed (GocItem *item, int button, double x_, double y_)
 {
-       ItemGrid *ig = ITEM_GRID (item);
+       GnmItemGrid *ig = GNM_ITEM_GRID (item);
        GocCanvas    *canvas = item->canvas;
        GnmPane *pane = GNM_PANE (canvas);
        SheetControlGUI *scg = ig->scg;
@@ -927,7 +927,7 @@ item_grid_button_pressed (GocItem *item, int button, double x_, double y_)
         * reset the location to a new place, or extend the selection.
         */
        if (button == 1 && scg->rangesel.active) {
-               ig->selecting = ITEM_GRID_SELECTING_FORMULA_RANGE;
+               ig->selecting = GNM_ITEM_GRID_SELECTING_FORMULA_RANGE;
                if (event->state & GDK_SHIFT_MASK)
                        scg_rangesel_extend_to (scg, pos.col, pos.row);
                else
@@ -944,7 +944,7 @@ item_grid_button_pressed (GocItem *item, int button, double x_, double y_)
         */
        if (button == 1 && wbcg_rangesel_possible (wbcg)) {
                scg_rangesel_start (scg, pos.col, pos.row, pos.col, pos.row);
-               ig->selecting = ITEM_GRID_SELECTING_FORMULA_RANGE;
+               ig->selecting = GNM_ITEM_GRID_SELECTING_FORMULA_RANGE;
                gnm_pane_slide_init (pane);
                gnm_simple_canvas_grab (item,
                        GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK,
@@ -1006,7 +1006,7 @@ item_grid_button_pressed (GocItem *item, int button, double x_, double y_)
                }
 
                ig->last_click_time = event->time;
-               ig->selecting = ITEM_GRID_SELECTING_CELL_RANGE;
+               ig->selecting = GNM_ITEM_GRID_SELECTING_CELL_RANGE;
                gnm_pane_slide_init (pane);
                gnm_simple_canvas_grab (item,
                        GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK,
@@ -1045,7 +1045,7 @@ cb_extend_expr_range (GnmPane *pane, GnmPaneSlideInfo const *info)
 }
 
 static gint
-cb_cursor_come_to_rest (ItemGrid *ig)
+cb_cursor_come_to_rest (GnmItemGrid *ig)
 {
        Sheet const *sheet = scg_sheet (ig->scg);
        GocCanvas *canvas = ig->canvas_item.canvas;
@@ -1085,13 +1085,13 @@ cb_cursor_come_to_rest (ItemGrid *ig)
 static gboolean
 item_grid_motion (GocItem *item, double x_, double y_)
 {
-       ItemGrid *ig = ITEM_GRID (item);
+       GnmItemGrid *ig = GNM_ITEM_GRID (item);
        GocCanvas *canvas = item->canvas;
        GnmPane   *pane = GNM_PANE (canvas);
        GnmPaneSlideHandler slide_handler = NULL;
        gint64 x = x_ * canvas->pixels_per_unit, y = y_ * canvas->pixels_per_unit;
        switch (ig->selecting) {
-       case ITEM_GRID_NO_SELECTION:
+       case GNM_ITEM_GRID_NO_SELECTION:
                if (ig->cursor_timer == 0)
                        ig->cursor_timer = g_timeout_add (100,
                                (GSourceFunc)cb_cursor_motion, ig);
@@ -1102,10 +1102,10 @@ item_grid_motion (GocItem *item, double x_, double y_)
                ig->last_x = x;
                ig->last_y = y;
                return TRUE;
-       case ITEM_GRID_SELECTING_CELL_RANGE :
+       case GNM_ITEM_GRID_SELECTING_CELL_RANGE :
                slide_handler = &cb_extend_cell_range;
                break;
-       case ITEM_GRID_SELECTING_FORMULA_RANGE :
+       case GNM_ITEM_GRID_SELECTING_FORMULA_RANGE :
                slide_handler = &cb_extend_expr_range;
                break;
        default:
@@ -1122,7 +1122,7 @@ item_grid_motion (GocItem *item, double x_, double y_)
 static gboolean
 item_grid_button_released (GocItem *item, int button, G_GNUC_UNUSED double x_, G_GNUC_UNUSED double y_)
 {
-       ItemGrid *ig = ITEM_GRID (item);
+       GnmItemGrid *ig = GNM_ITEM_GRID (item);
        GnmPane  *pane = GNM_PANE (item->canvas);
        SheetControlGUI *scg = ig->scg;
        Sheet *sheet = scg_sheet (scg);
@@ -1135,16 +1135,16 @@ item_grid_button_released (GocItem *item, int button, G_GNUC_UNUSED double x_, G
        gnm_pane_slide_stop (pane);
 
        switch (selecting) {
-       case ITEM_GRID_NO_SELECTION:
+       case GNM_ITEM_GRID_NO_SELECTION:
                return TRUE;
 
-       case ITEM_GRID_SELECTING_FORMULA_RANGE :
+       case GNM_ITEM_GRID_SELECTING_FORMULA_RANGE :
 /*  Removal of this code (2 lines)                                                */
 /*  should fix http://bugzilla.gnome.org/show_bug.cgi?id=63485                    */
 /*                     sheet_make_cell_visible (sheet,                           */
 /*                             sheet->edit_pos.col, sheet->edit_pos.row, FALSE); */
                /* Fall through */
-       case ITEM_GRID_SELECTING_CELL_RANGE :
+       case GNM_ITEM_GRID_SELECTING_CELL_RANGE :
                sv_selection_simplify (scg_view (scg));
                wb_view_selection_desc (
                        wb_control_view (scg_wbc (scg)), TRUE, NULL);
@@ -1154,14 +1154,14 @@ item_grid_button_released (GocItem *item, int button, G_GNUC_UNUSED double x_, G
                g_assert_not_reached ();
        }
 
-       ig->selecting = ITEM_GRID_NO_SELECTION;
+       ig->selecting = GNM_ITEM_GRID_NO_SELECTION;
        gnm_simple_canvas_ungrab (item, event->time);
 
-       if (selecting == ITEM_GRID_SELECTING_FORMULA_RANGE)
+       if (selecting == GNM_ITEM_GRID_SELECTING_FORMULA_RANGE)
                gnm_expr_entry_signal_update (
                        wbcg_get_entry_logical (scg_wbcg (scg)), TRUE);
 
-       if (selecting == ITEM_GRID_SELECTING_CELL_RANGE) {
+       if (selecting == GNM_ITEM_GRID_SELECTING_CELL_RANGE) {
                GnmCellPos const *pos = sv_is_singleton_selected (scg_view (scg));
                if (pos != NULL) {
                        GnmHLink *link;
@@ -1177,7 +1177,7 @@ item_grid_button_released (GocItem *item, int button, G_GNUC_UNUSED double x_, G
 static gboolean
 item_grid_enter_notify (GocItem *item, G_GNUC_UNUSED double x, G_GNUC_UNUSED double y)
 {
-       ItemGrid  *ig = ITEM_GRID (item);
+       GnmItemGrid  *ig = GNM_ITEM_GRID (item);
        scg_set_display_cursor (ig->scg);
        return TRUE;
 }
@@ -1185,7 +1185,7 @@ item_grid_enter_notify (GocItem *item, G_GNUC_UNUSED double x, G_GNUC_UNUSED dou
 static gboolean
 item_grid_leave_notify (GocItem *item, G_GNUC_UNUSED double x, G_GNUC_UNUSED double y)
 {
-       ItemGrid  *ig = ITEM_GRID (item);
+       GnmItemGrid  *ig = GNM_ITEM_GRID (item);
        ig_clear_hlink_tip (ig);
        if (ig->cursor_timer != 0) {
                g_source_remove (ig->cursor_timer);
@@ -1195,7 +1195,7 @@ item_grid_leave_notify (GocItem *item, G_GNUC_UNUSED double x, G_GNUC_UNUSED dou
 }
 
 static void
-item_grid_init (ItemGrid *ig)
+gnm_item_grid_init (GnmItemGrid *ig)
 {
        GocItem *item = GOC_ITEM (ig);
 
@@ -1204,7 +1204,7 @@ item_grid_init (ItemGrid *ig)
        item->x1 = 0;
        item->y1 = 0;
 
-       ig->selecting = ITEM_GRID_NO_SELECTION;
+       ig->selecting = GNM_ITEM_GRID_NO_SELECTION;
        /* We need something at least as big as any sheet.  */
        ig->bound.start.col = ig->bound.start.row = 0;
        ig->bound.end.col = GNM_MAX_COLS - 1;
@@ -1219,15 +1219,15 @@ static void
 item_grid_set_property (GObject *obj, guint param_id,
                        GValue const *value, G_GNUC_UNUSED GParamSpec *pspec)
 {
-       ItemGrid *ig = ITEM_GRID (obj);
+       GnmItemGrid *ig = GNM_ITEM_GRID (obj);
        GnmRange const *r;
 
        switch (param_id) {
-       case ITEM_GRID_PROP_SHEET_CONTROL_GUI :
+       case GNM_ITEM_GRID_PROP_SHEET_CONTROL_GUI :
                ig->scg = g_value_get_object (value);
                break;
 
-       case ITEM_GRID_PROP_BOUND :
+       case GNM_ITEM_GRID_PROP_BOUND :
                r = g_value_get_pointer (value);
                g_return_if_fail (r != NULL);
                ig->bound =  *r;
@@ -1236,7 +1236,7 @@ item_grid_set_property (GObject *obj, guint param_id,
 }
 
 static void
-item_grid_class_init (GObjectClass *gobject_klass)
+gnm_item_grid_class_init (GObjectClass *gobject_klass)
 {
        GocItemClass *item_klass = (GocItemClass *) gobject_klass;
 
@@ -1244,12 +1244,12 @@ item_grid_class_init (GObjectClass *gobject_klass)
 
        gobject_klass->finalize     = item_grid_finalize;
        gobject_klass->set_property = item_grid_set_property;
-       g_object_class_install_property (gobject_klass, ITEM_GRID_PROP_SHEET_CONTROL_GUI,
+       g_object_class_install_property (gobject_klass, GNM_ITEM_GRID_PROP_SHEET_CONTROL_GUI,
                g_param_spec_object ("SheetControlGUI", "SheetControlGUI",
                        "the sheet control gui controlling the item",
                        SHEET_CONTROL_GUI_TYPE,
                         GSF_PARAM_STATIC | G_PARAM_WRITABLE));
-       g_object_class_install_property (gobject_klass, ITEM_GRID_PROP_BOUND,
+       g_object_class_install_property (gobject_klass, GNM_ITEM_GRID_PROP_BOUND,
                g_param_spec_pointer ("bound", "Bound",
                        "The display bounds",
                        GSF_PARAM_STATIC | G_PARAM_WRITABLE));
@@ -1266,6 +1266,6 @@ item_grid_class_init (GObjectClass *gobject_klass)
        item_klass->distance        = item_grid_distance;
 }
 
-GSF_CLASS (ItemGrid, item_grid,
-          item_grid_class_init, item_grid_init,
+GSF_CLASS (GnmItemGrid, gnm_item_grid,
+          gnm_item_grid_class_init, gnm_item_grid_init,
           GOC_TYPE_ITEM)
diff --git a/src/item-grid.h b/src/item-grid.h
index 043839f..089eef4 100644
--- a/src/item-grid.h
+++ b/src/item-grid.h
@@ -1,17 +1,16 @@
 /* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 #ifndef _GNM_ITEM_GRID_H_
-# define _GNM_ITEM_GRID_H_
+#define _GNM_ITEM_GRID_H_
 
 #include "gui-gnumeric.h"
 #include <glib-object.h>
-#include <goffice/canvas/goffice-canvas.h>
 
 G_BEGIN_DECLS
 
-#define ITEM_GRID(obj)          (G_TYPE_CHECK_INSTANCE_CAST((obj), item_grid_get_type (), ItemGrid))
-#define IS_ITEM_GRID(o)         (G_TYPE_CHECK_INSTANCE_TYPE((o), item_grid_get_type ()))
+#define GNM_ITEM_GRID(obj)          (G_TYPE_CHECK_INSTANCE_CAST((obj), gnm_item_grid_get_type (), 
GnmItemGrid))
+#define GNM_IS_ITEM_GRID(o)         (G_TYPE_CHECK_INSTANCE_TYPE((o), gnm_item_grid_get_type ()))
 
-GType item_grid_get_type (void);
+GType gnm_item_grid_get_type (void);
 
 G_END_DECLS
 
diff --git a/src/sheet-control-gui.c b/src/sheet-control-gui.c
index da1d1c0..bd6fa24 100644
--- a/src/sheet-control-gui.c
+++ b/src/sheet-control-gui.c
@@ -1836,13 +1836,13 @@ scg_ant (SheetControl *sc)
                GnmRange const *r = l->data;
 
                SCG_FOREACH_PANE (scg, pane, {
-                       ItemCursor *ic = ITEM_CURSOR (goc_item_new (
+                       GnmItemCursor *ic = GNM_ITEM_CURSOR (goc_item_new (
                                pane->grid_items,
-                               item_cursor_get_type (),
+                               gnm_item_cursor_get_type (),
                                "SheetControlGUI", scg,
-                               "style",        ITEM_CURSOR_ANTED,
+                               "style",        GNM_ITEM_CURSOR_ANTED,
                                NULL));
-                       item_cursor_bound_set (ic, r);
+                       gnm_item_cursor_bound_set (ic, r);
                        pane->cursor.animated =
                                g_slist_prepend (pane->cursor.animated, ic);
                });
@@ -2436,7 +2436,7 @@ scg_cursor_visible (SheetControlGUI *scg, gboolean is_visible)
                return;
 
        SCG_FOREACH_PANE (scg, pane,
-               item_cursor_set_visibility (pane->cursor.std, is_visible););
+               gnm_item_cursor_set_visibility (pane->cursor.std, is_visible););
 
        sv_selection_foreach (sc->view, cb_redraw_sel, sc);
 }
diff --git a/src/sheet-object.c b/src/sheet-object.c
index d135afa..23a693f 100644
--- a/src/sheet-object.c
+++ b/src/sheet-object.c
@@ -1307,7 +1307,7 @@ sheet_object_view_enter_notify (GocItem *item, double x, double y)
        SheetObject *so;
 
        if (IS_GNM_PANE (item->canvas) && scg_wbcg (GNM_SIMPLE_CANVAS (item->canvas)->scg)->new_object) {
-               ItemGrid *grid = GNM_PANE (item->canvas)->grid;
+               GnmItemGrid *grid = GNM_PANE (item->canvas)->grid;
                return GOC_ITEM_GET_CLASS (grid)->enter_notify (GOC_ITEM (grid), x, y);
        }
 
@@ -1393,7 +1393,7 @@ sheet_object_view_button_pressed (GocItem *item, int button, double x, double y)
        SheetObject *so;
        if (IS_GNM_PANE (item->canvas)) {
                if (scg_wbcg (GNM_SIMPLE_CANVAS (item->canvas)->scg)->new_object) {
-                       ItemGrid *grid = GNM_PANE (item->canvas)->grid;
+                       GnmItemGrid *grid = GNM_PANE (item->canvas)->grid;
                        return GOC_ITEM_GET_CLASS (grid)->button_pressed (GOC_ITEM (grid), button, x, y);
                }
 


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