[gnumeric] Namespace



commit bbbd8b36e48ec08b5382e7375ed9972f8a0bc3c6
Author: Morten Welinder <terra gnome org>
Date:   Mon Mar 2 11:17:44 2015 -0500

    Namespace

 plugins/excel/ms-chart.c                        |    2 +-
 plugins/excel/ms-excel-read.c                   |   14 ++--
 plugins/excel/ms-excel-write.c                  |   12 +-
 plugins/excel/xlsx-read-drawing.c               |    6 +-
 plugins/excel/xlsx-read.c                       |    6 +-
 plugins/excel/xlsx-utils.c                      |    2 +-
 plugins/excel/xlsx-write-pivot.c                |    2 +-
 plugins/excel/xlsx-write.c                      |    6 +-
 plugins/openoffice/openoffice-read.c            |    4 +-
 plugins/openoffice/openoffice-write.c           |   18 ++--
 plugins/perl-loader/perl-loader.c               |    4 +-
 plugins/python-loader/gnm-py-interpreter.c      |   10 +-
 plugins/python-loader/gnm-py-interpreter.h      |    2 +-
 plugins/python-loader/gnm-python.c              |   18 ++--
 plugins/python-loader/gnm-python.h              |    2 +-
 plugins/python-loader/py-command-line.h         |    2 +-
 plugins/python-loader/py-interpreter-selector.h |    2 +-
 plugins/python-loader/python-loader.c           |    4 +-
 plugins/python-loader/python-loader.h           |    2 +-
 src/application.c                               |   12 +--
 src/clipboard.c                                 |    2 +-
 src/cmd-edit.c                                  |    4 +-
 src/commands.c                                  |   11 +-
 src/dependent.c                                 |    4 +-
 src/dialogs/dialog-analysis-tools.c             |    2 +-
 src/dialogs/dialog-cell-format.c                |    4 +-
 src/dialogs/dialog-consolidate.c                |    2 +-
 src/dialogs/dialog-formula-guru.c               |    2 +-
 src/dialogs/dialog-printer-setup.c              |    2 +-
 src/dialogs/dialog-search.c                     |    2 +-
 src/dialogs/dialog-sheetobject-size.c           |    2 +-
 src/dialogs/dialog-so-list.c                    |    2 +-
 src/dialogs/dialog-stf-export.c                 |    2 +-
 src/dialogs/dialog-stf-preview.c                |    2 +-
 src/expr.c                                      |   56 ++++++------
 src/expr.h                                      |    2 +-
 src/gnm-cell-combo.c                            |    2 +-
 src/gnm-data-cache-source.c                     |   12 +-
 src/gnm-data-cache-source.h                     |    2 +-
 src/gnm-graph-window.h                          |    4 +-
 src/gnm-pane.c                                  |   10 +-
 src/gnm-sheet-slicer.c                          |    2 +-
 src/gnm-so-filled.c                             |    6 +-
 src/gnm-so-line.c                               |    4 +-
 src/gnm-so-path.c                               |    2 +-
 src/gnm-so-polygon.c                            |    4 +-
 src/graph.c                                     |    2 +-
 src/graph.h                                     |    2 +-
 src/gui-clipboard.c                             |   16 ++--
 src/gui-util.c                                  |    2 +-
 src/item-cursor.c                               |    2 +-
 src/item-edit.c                                 |    4 +-
 src/item-grid.c                                 |    2 +-
 src/position.c                                  |    4 +-
 src/print-info.c                                |    2 +-
 src/print.c                                     |    2 +-
 src/selection.c                                 |   26 +++---
 src/sheet-control-gui.c                         |  114 +++++++++++-----------
 src/sheet-control-gui.h                         |    7 +-
 src/sheet-control-priv.h                        |    2 +-
 src/sheet-control.c                             |   10 +-
 src/sheet-control.h                             |    6 +-
 src/sheet-filter-combo.h                        |    2 +-
 src/sheet-filter.c                              |   12 +-
 src/sheet-merge.c                               |    4 +-
 src/sheet-object-cell-comment.c                 |   26 +++---
 src/sheet-object-cell-comment.h                 |    7 +-
 src/sheet-object-component.c                    |   52 +++++-----
 src/sheet-object-component.h                    |    6 +-
 src/sheet-object-graph.c                        |   54 ++++++------
 src/sheet-object-graph.h                        |    6 +-
 src/sheet-object-image.c                        |   36 ++++----
 src/sheet-object-image.h                        |    6 +-
 src/sheet-object-widget.c                       |  100 ++++++++++----------
 src/sheet-object.c                              |   32 +++---
 src/sheet-object.h                              |    2 +-
 src/sheet-view.c                                |   70 +++++++-------
 src/sheet-view.h                                |    8 +-
 src/sheet.c                                     |   20 ++--
 src/ssindex.c                                   |    2 +-
 src/stf-export.c                                |    2 +-
 src/stf.c                                       |    6 +-
 src/tools/gnm-solver.h                          |    2 -
 src/validation-combo.h                          |    2 +-
 src/validation.c                                |    2 +-
 src/wbc-gtk-actions.c                           |    6 +-
 src/wbc-gtk-edit.c                              |    4 +-
 src/wbc-gtk-impl.h                              |    4 +-
 src/wbc-gtk.c                                   |   20 ++--
 src/widgets/gnm-cell-combo-view-impl.h          |    3 +-
 src/widgets/gnm-dao.h                           |    2 +-
 src/widgets/gnumeric-cell-renderer-expr-entry.c |    8 +-
 src/widgets/gnumeric-cell-renderer-expr-entry.h |    9 +-
 src/widgets/gnumeric-cell-renderer-text.c       |    2 +-
 src/widgets/gnumeric-cell-renderer-text.h       |    9 +-
 src/widgets/gnumeric-cell-renderer-toggle.c     |    8 +-
 src/widgets/gnumeric-cell-renderer-toggle.h     |    9 +-
 src/widgets/gnumeric-dashed-canvas-line.c       |    2 +-
 src/widgets/gnumeric-dashed-canvas-line.h       |   14 +--
 src/widgets/gnumeric-expr-entry.c               |   56 ++++++------
 src/widgets/gnumeric-expr-entry.h               |    2 +-
 src/widgets/gnumeric-lazy-list.c                |   24 +++---
 src/widgets/gnumeric-lazy-list.h                |    9 +-
 src/widgets/gnumeric-text-view.h                |    2 +-
 src/workbook-control.c                          |    2 +-
 src/workbook-priv.h                             |    3 -
 src/workbook-view.c                             |   44 +++++-----
 src/workbook-view.h                             |    7 +-
 src/workbook.c                                  |   64 +++++++-------
 src/workbook.h                                  |    6 +-
 src/xml-sax-read.c                              |    6 +-
 src/xml-sax-write.c                             |    2 +-
 112 files changed, 618 insertions(+), 650 deletions(-)
---
diff --git a/plugins/excel/ms-chart.c b/plugins/excel/ms-chart.c
index e49a2f0..cc24c76 100644
--- a/plugins/excel/ms-chart.c
+++ b/plugins/excel/ms-chart.c
@@ -4247,7 +4247,7 @@ chart_write_AI (XLChartWriteState *s, GOData const *dim, unsigned n,
        gboolean need_release = FALSE;
 
        if (dim != NULL) {
-               if (IS_GNM_GO_DATA_SCALAR (dim) || GNM_IS_GO_DATA_VECTOR (dim)) {
+               if (GNM_IS_GO_DATA_SCALAR (dim) || GNM_IS_GO_DATA_VECTOR (dim)) {
                        texpr = gnm_go_data_get_expr (dim);
                        if ((value = gnm_expr_top_get_range (texpr)) != NULL) {
                                GType const t = G_OBJECT_TYPE (dim);
diff --git a/plugins/excel/ms-excel-read.c b/plugins/excel/ms-excel-read.c
index 5e2217a..126c86f 100644
--- a/plugins/excel/ms-excel-read.c
+++ b/plugins/excel/ms-excel-read.c
@@ -508,7 +508,7 @@ ms_sheet_realize_obj (MSContainer *container, MSObj *obj)
         * we need to store the indicator */
        if (obj->excel_type == 0x19 &&
            obj->comment_pos.col >= 0 && obj->comment_pos.row >= 0) {
-               cell_comment_set_pos (CELL_COMMENT (obj->gnum_obj),
+               cell_comment_set_pos (GNM_CELL_COMMENT (obj->gnum_obj),
                                      &obj->comment_pos);
        } else {
                attr = ms_obj_attr_bag_lookup (obj->attrs, MS_OBJ_ATTR_ANCHOR);
@@ -643,11 +643,11 @@ ms_sheet_realize_obj (MSContainer *container, MSObj *obj)
                                        if (data) {
                                                excel_fill_bmp_header(data, blip->data, blip->data_len);
                                                memcpy(data + BMP_HDR_SIZE, blip->data, blip->data_len);
-                                               sheet_object_image_set_image (SHEET_OBJECT_IMAGE (so),
+                                               sheet_object_image_set_image (GNM_SO_IMAGE (so),
                                                                              blip->type, data, 
blip->data_len + BMP_HDR_SIZE, FALSE);
                                        }
                                } else {
-                                       sheet_object_image_set_image (SHEET_OBJECT_IMAGE (so),
+                                       sheet_object_image_set_image (GNM_SO_IMAGE (so),
                                                                      blip->type, blip->data, blip->data_len,
                                                                      TRUE);
                                }
@@ -665,7 +665,7 @@ ms_sheet_realize_obj (MSContainer *container, MSObj *obj)
                                         NULL, NULL);
                                if (buf_size > 0) {
                                        sheet_object_image_set_image
-                                               (SHEET_OBJECT_IMAGE (so),
+                                               (GNM_SO_IMAGE (so),
                                                 "png", buf, buf_size, FALSE);
                                }
                        }
@@ -683,7 +683,7 @@ ms_sheet_realize_obj (MSContainer *container, MSObj *obj)
                                                    MS_OBJ_ATTR_BLIP_CROP_BOTTOM)) != NULL)
                        crop_bottom = (double) attr->v.v_uint / 65536.;
 
-               sheet_object_image_set_crop (SHEET_OBJECT_IMAGE (so),
+               sheet_object_image_set_crop (GNM_SO_IMAGE (so),
                                             crop_left, crop_top, crop_right, crop_bottom);
                break;
        }
@@ -766,7 +766,7 @@ ms_sheet_create_obj (MSContainer *container, MSObj *obj)
                so = g_object_new (sheet_widget_button_get_type (), NULL);
                break;
        case MSOT_PICTURE:
-               so = g_object_new (SHEET_OBJECT_IMAGE_TYPE, NULL); /* Picture */
+               so = g_object_new (GNM_SO_IMAGE_TYPE, NULL); /* Picture */
                break;
        case MSOT_POLYGON:
                so = g_object_new (GNM_SO_POLYGON_TYPE, NULL);
@@ -3124,7 +3124,7 @@ excel_read_NOTE (BiffQuery *q, ExcelReadSheet *esheet)
 
                obj = ms_container_get_obj (&esheet->container, obj_id);
                if (obj != NULL) {
-                       cell_comment_author_set (CELL_COMMENT (obj->gnum_obj), author);
+                       cell_comment_author_set (GNM_CELL_COMMENT (obj->gnum_obj), author);
                        obj->comment_pos = pos;
                } else {
                        /* hmm, how did this happen ? we should have seen
diff --git a/plugins/excel/ms-excel-write.c b/plugins/excel/ms-excel-write.c
index 1cfb425..c652a03 100644
--- a/plugins/excel/ms-excel-write.c
+++ b/plugins/excel/ms-excel-write.c
@@ -3641,7 +3641,7 @@ excel_write_comments_biff7 (BiffPut *bp, ExcelWriteSheet *esheet)
 
        for (l = esheet->comments; l; l = l->next) {
                GnmComment const *cc = l->data;
-               GnmRange const *pos = sheet_object_get_range (SHEET_OBJECT (cc));
+               GnmRange const *pos = sheet_object_get_range (GNM_SO (cc));
                char const *in = cell_comment_text_get (cc);
                size_t out_bytes, o;
                gpointer convstr;
@@ -4366,7 +4366,7 @@ blipinf_new (SheetObjectImage *soi)
        blip = g_new0 (BlipInf, 1);
        blip->uncomp_len = -1;
        blip->needs_free = FALSE;
-       blip->so         = SHEET_OBJECT (soi);
+       blip->so         = GNM_SO (soi);
 
        g_object_get (G_OBJECT (soi),
                      "image-type", &blip->type,
@@ -5522,7 +5522,7 @@ static void
 cb_NOTE_v8 (SheetObject const *so, gconstpointer id, BiffPut *bp)
 {
        SheetObjectAnchor const *anchor = sheet_object_get_anchor (so);
-       char const *author = cell_comment_author_get (CELL_COMMENT (so));
+       char const *author = cell_comment_author_get (GNM_CELL_COMMENT (so));
        guint8 buf [4 * 2];
 
        if (!author)
@@ -5796,7 +5796,7 @@ excel_sheet_new (ExcelWriteState *ewb, Sheet *sheet,
 
        objs = sheet_objects_get (sheet, NULL, G_TYPE_NONE);
        for (l = objs; l; l = l->next) {
-               SheetObject *so = SHEET_OBJECT (l->data);
+               SheetObject *so = GNM_SO (l->data);
                gboolean handled = FALSE;
 
                if (GNM_IS_SO_GRAPH (so)) {
@@ -5806,7 +5806,7 @@ excel_sheet_new (ExcelWriteState *ewb, Sheet *sheet,
                                g_slist_prepend (esheet->objects, so);
                        handled = TRUE;
                } else if (GNM_IS_SO_IMAGE (so)) {
-                       SheetObjectImage *soi = SHEET_OBJECT_IMAGE (l->data);
+                       SheetObjectImage *soi = GNM_SO_IMAGE (l->data);
                        BlipInf *bi = blipinf_new (soi);
 
                        /* Images we can't export have a NULL BlipInf */
@@ -5846,7 +5846,7 @@ excel_sheet_new (ExcelWriteState *ewb, Sheet *sheet,
                        esheet->objects =
                                g_slist_prepend (esheet->objects, so);
                        handled = TRUE;
-               } else if (IS_GNM_FILTER_COMBO (so)) {
+               } else if (GNM_IS_FILTER_COMBO (so)) {
                        /* Handled outside loop.  */
                        continue;
                }
diff --git a/plugins/excel/xlsx-read-drawing.c b/plugins/excel/xlsx-read-drawing.c
index fa61240..ffbbc79 100644
--- a/plugins/excel/xlsx-read-drawing.c
+++ b/plugins/excel/xlsx-read-drawing.c
@@ -3034,7 +3034,7 @@ static void
 xlsx_drawing_picture (GsfXMLIn *xin, G_GNUC_UNUSED xmlChar const **attrs)
 {
        XLSXReadState *state = (XLSXReadState *)xin->user_state;
-       state->so = g_object_new (SHEET_OBJECT_IMAGE_TYPE, NULL);
+       state->so = g_object_new (GNM_SO_IMAGE_TYPE, NULL);
 }
 
 static void
@@ -3054,7 +3054,7 @@ xlsx_blip_start (GsfXMLIn *xin, xmlChar const **attrs)
                        g_return_if_fail (input != NULL);
                        size = gsf_input_size (input);
                        data = (gpointer)gsf_input_read (input, size, NULL);
-                       sheet_object_image_set_image (SHEET_OBJECT_IMAGE (state->so),
+                       sheet_object_image_set_image (GNM_SO_IMAGE (state->so),
                                                      NULL, data, size, TRUE);
                        g_object_unref (input);
        }
@@ -3505,7 +3505,7 @@ xlsx_vml_client_data_start (GsfXMLIn *xin, xmlChar const **attrs)
        } else if (typ == G_TYPE_NONE) {
                g_printerr ("Unhandled object of type %s\n", tname);
        } else {
-               state->so = SHEET_OBJECT (g_object_new (typ, NULL));
+               state->so = GNM_SO (g_object_new (typ, NULL));
                state->so_direction = GOD_ANCHOR_DIR_DOWN_RIGHT;
                state->pending_objects = g_slist_prepend (state->pending_objects, state->so);
                if (state->zindex >= 1)
diff --git a/plugins/excel/xlsx-read.c b/plugins/excel/xlsx-read.c
index 9339e81..2a68361 100644
--- a/plugins/excel/xlsx-read.c
+++ b/plugins/excel/xlsx-read.c
@@ -3825,7 +3825,7 @@ xlsx_comment_start (GsfXMLIn *xin, xmlChar const **attrs)
        GnmRange anchor_r;
 
        state->comment = g_object_new (cell_comment_get_type (), NULL);
-       so = SHEET_OBJECT (state->comment);
+       so = GNM_SO (state->comment);
        anchor_r = sheet_object_get_anchor (so)->cell_bound;
 
        for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
@@ -3841,7 +3841,7 @@ xlsx_comment_start (GsfXMLIn *xin, xmlChar const **attrs)
                        }
                }
 
-       cell_comment_set_pos (CELL_COMMENT (so), &anchor_r.start);
+       cell_comment_set_pos (GNM_CELL_COMMENT (so), &anchor_r.start);
        state->r_text = g_string_new ("");
 }
 
@@ -3858,7 +3858,7 @@ xlsx_comment_end (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
                pango_attr_list_unref (state->rich_attrs);
                state->rich_attrs = NULL;
        }
-       sheet_object_set_sheet (SHEET_OBJECT (state->comment), state->sheet);
+       sheet_object_set_sheet (GNM_SO (state->comment), state->sheet);
        g_object_unref (state->comment);
        state->comment = NULL;
 
diff --git a/plugins/excel/xlsx-utils.c b/plugins/excel/xlsx-utils.c
index 610c077..8161726 100644
--- a/plugins/excel/xlsx-utils.c
+++ b/plugins/excel/xlsx-utils.c
@@ -117,7 +117,7 @@ Workbook *
 xlsx_conventions_add_extern_ref (GnmConventions *convs, char const *path)
 {
        XLSXExprConventions *xconv = (XLSXExprConventions *)convs;
-       Workbook *res = g_object_new (WORKBOOK_TYPE, NULL);
+       Workbook *res = g_object_new (GNM_WORKBOOK_TYPE, NULL);
        char *id;
 
        (void) go_doc_set_uri (GO_DOC (res), path);
diff --git a/plugins/excel/xlsx-write-pivot.c b/plugins/excel/xlsx-write-pivot.c
index f202744..e8e6eb7 100644
--- a/plugins/excel/xlsx-write-pivot.c
+++ b/plugins/excel/xlsx-write-pivot.c
@@ -147,7 +147,7 @@ xlsx_write_pivot_cache_source (XLSXWriteState *state, GsfXMLOut *xml, GODataCach
        if (NULL == src)
                return;
 
-       if (IS_GNM_DATA_CACHE_SOURCE (src)) {
+       if (GNM_IS_DATA_CACHE_SOURCE (src)) {
                GnmDataCacheSource const *ssrc = GNM_DATA_CACHE_SOURCE (src);
                Sheet const *src_sheet  = gnm_data_cache_source_get_sheet (ssrc);
                GnmRange const  *r      = gnm_data_cache_source_get_range (ssrc);
diff --git a/plugins/excel/xlsx-write.c b/plugins/excel/xlsx-write.c
index cb492db..3295eee 100644
--- a/plugins/excel/xlsx-write.c
+++ b/plugins/excel/xlsx-write.c
@@ -2687,7 +2687,7 @@ xlsx_write_comments (XLSXWriteState *state, GsfOutput *sheet_part, GSList *objec
        /* search for comments authors */
        authors = g_hash_table_new (g_str_hash, g_str_equal);
        for (ptr = objects; ptr; ptr = ptr->next) {
-               authorname = cell_comment_author_get (CELL_COMMENT (ptr->data));
+               authorname = cell_comment_author_get (GNM_CELL_COMMENT (ptr->data));
                if (authorname != NULL && !g_hash_table_lookup_extended (authors, authorname, NULL, NULL))
                        g_hash_table_insert (authors, (gpointer) authorname, GUINT_TO_POINTER (author++));
        }
@@ -2701,7 +2701,7 @@ xlsx_write_comments (XLSXWriteState *state, GsfOutput *sheet_part, GSList *objec
                gsf_xml_out_start_element (xml, "comment");
                anchor = sheet_object_get_anchor (ptr->data);
                gsf_xml_out_add_cstr_unchecked (xml, "ref", range_as_string (&anchor->cell_bound));
-               authorname = cell_comment_author_get (CELL_COMMENT (ptr->data));
+               authorname = cell_comment_author_get (GNM_CELL_COMMENT (ptr->data));
                if (authorname != NULL)
                        gsf_xml_out_add_uint (xml, "authorId",
                                              GPOINTER_TO_UINT (g_hash_table_lookup (authors, authorname)));
@@ -2776,7 +2776,7 @@ xlsx_write_sheet (XLSXWriteState *state, GsfOutfile *wb_part, Sheet *sheet)
                         GNM_IS_SOW_COMBO (so) ||
                         GNM_IS_SOW_LIST (so))
                        legacy_drawing_objs = g_slist_prepend (legacy_drawing_objs, so);
-               else if (IS_GNM_FILTER_COMBO (so))
+               else if (GNM_IS_FILTER_COMBO (so))
                        ; /* Nothing here */
                else
                        others = g_slist_prepend (others, so);
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index 1262b0a..8f16b5a 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -8342,10 +8342,10 @@ od_draw_image (GsfXMLIn *xin, xmlChar const **attrs)
                SheetObjectImage *soi;
                gsf_off_t len = gsf_input_size (input);
                guint8 const *data = gsf_input_read (input, len, NULL);
-               soi = g_object_new (SHEET_OBJECT_IMAGE_TYPE, NULL);
+               soi = g_object_new (GNM_SO_IMAGE_TYPE, NULL);
                sheet_object_image_set_image (soi, "", (void *)data, len, TRUE);
 
-               state->chart.so = SHEET_OBJECT (soi);
+               state->chart.so = GNM_SO (soi);
                g_object_unref (input);
        } else
                oo_warning (xin, _("Unable to load "
diff --git a/plugins/openoffice/openoffice-write.c b/plugins/openoffice/openoffice-write.c
index be4c4cc..b4ba335 100644
--- a/plugins/openoffice/openoffice-write.c
+++ b/plugins/openoffice/openoffice-write.c
@@ -916,21 +916,21 @@ odf_write_sheet_object_styles (GnmOOExport *state)
                Sheet const *sheet = workbook_sheet_by_index (state->wb, i);
                GSList *objects = sheet_objects_get (sheet, NULL, GNM_SO_FILLED_TYPE), *l;
                for (l = objects; l != NULL; l = l->next) {
-                       SheetObject *so = SHEET_OBJECT (l->data);
+                       SheetObject *so = GNM_SO (l->data);
                        char *name = odf_write_sheet_object_style (state, so);
                        g_hash_table_replace (state->so_styles, so, name);
                }
                g_slist_free (objects);
                objects = sheet_objects_get (sheet, NULL, GNM_SO_LINE_TYPE);
                for (l = objects; l != NULL; l = l->next) {
-                       SheetObject *so = SHEET_OBJECT (l->data);
+                       SheetObject *so = GNM_SO (l->data);
                        char *name = odf_write_sheet_object_line_style (state, so);
                        g_hash_table_replace (state->so_styles, so, name);
                }
                g_slist_free (objects);
                objects = sheet_objects_get (sheet, NULL, GNM_SO_PATH_TYPE);
                for (l = objects; l != NULL; l = l->next) {
-                       SheetObject *so = SHEET_OBJECT (l->data);
+                       SheetObject *so = GNM_SO (l->data);
                        char *name = odf_write_sheet_object_style (state, so);
                        g_hash_table_replace (state->so_styles, so, name);
                }
@@ -3249,12 +3249,12 @@ odf_write_objects (GnmOOExport *state, GSList *objects)
                        g_warning ("NULL sheet object encountered.");
                        continue;
                }
-               if (IS_GNM_FILTER_COMBO (so) || IS_GNM_VALIDATION_COMBO(so))
+               if (GNM_IS_FILTER_COMBO (so) || GNM_IS_VALIDATION_COMBO(so))
                        continue;
                if (id != NULL)
                        odf_write_control (state, so, id);
                else if (GNM_IS_CELL_COMMENT (so))
-                       odf_write_comment (state, CELL_COMMENT (so));
+                       odf_write_comment (state, GNM_CELL_COMMENT (so));
                else if (GNM_IS_SO_FILLED (so))
                        odf_write_so_filled (state, so);
                else if (GNM_IS_SO_LINE (so))
@@ -3708,7 +3708,7 @@ odf_sheet_objects_get (Sheet const *sheet, GnmCellPos const *pos)
        g_return_val_if_fail (IS_SHEET (sheet), NULL);
 
        for (ptr = sheet->sheet_objects; ptr != NULL ; ptr = ptr->next ) {
-               SheetObject *so = SHEET_OBJECT (ptr->data);
+               SheetObject *so = GNM_SO (ptr->data);
                SheetObjectAnchor const *anchor = sheet_object_get_anchor (so);
                if (gnm_cellpos_equal (&anchor->cell_bound.start, pos))
                        res = g_slist_prepend (res, so);
@@ -3740,7 +3740,7 @@ odf_write_content_rows (GnmOOExport *state, Sheet const *sheet, int from, int to
                GSList *ptr;
 
                for (ptr = sheet->sheet_objects; ptr != NULL ; ptr = ptr->next ) {
-                       SheetObject *so = SHEET_OBJECT (ptr->data);
+                       SheetObject *so = GNM_SO (ptr->data);
                        SheetObjectAnchor const *anchor = sheet_object_get_anchor (so);
                        int row = anchor->cell_bound.start.row;
                        row_flags[row] |= RF_OBJECT;
@@ -4895,13 +4895,13 @@ odf_write_content (GnmOOExport *state, GsfOutput *child)
 
                state->sheet = sheet;
 
-               graphs = sheet_objects_get (sheet, NULL, SHEET_OBJECT_GRAPH_TYPE);
+               graphs = sheet_objects_get (sheet, NULL, GNM_SO_GRAPH_TYPE);
                for (l = graphs; l != NULL; l = l->next)
                        g_hash_table_insert (state->graphs, l->data,
                                             g_strdup_printf ("Graph%i", graph_n++));
                g_slist_free (graphs);
 
-               images = sheet_objects_get (sheet, NULL, SHEET_OBJECT_IMAGE_TYPE);
+               images = sheet_objects_get (sheet, NULL, GNM_SO_IMAGE_TYPE);
                for (l = images; l != NULL; l = l->next)
                        g_hash_table_insert (state->images, l->data,
                                             g_strdup_printf ("Image%i", image_n++));
diff --git a/plugins/perl-loader/perl-loader.c b/plugins/perl-loader/perl-loader.c
index 571adf9..49a38ab 100644
--- a/plugins/perl-loader/perl-loader.c
+++ b/plugins/perl-loader/perl-loader.c
@@ -27,7 +27,7 @@
 
 #define TYPE_GNM_PERL_PLUGIN_LOADER    (gnm_perl_plugin_loader_get_type ())
 #define GNM_PERL_PLUGIN_LOADER(o)      (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_GNM_PERL_PLUGIN_LOADER, 
GnmPerlPluginLoader))
-#define IS_GNM_PERL_PLUGIN_LOADER(o)   (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_GNM_PERL_PLUGIN_LOADER))
+#define GNM_IS_PERL_PLUGIN_LOADER(o)   (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_GNM_PERL_PLUGIN_LOADER))
 
 #define dirty _perl_dirty
 #undef _perl_dirty
@@ -377,7 +377,7 @@ gplp_class_init (GObjectClass *gobject_class)
 static void
 gplp_init (GnmPerlPluginLoader *loader_perl)
 {
-       g_return_if_fail (IS_GNM_PERL_PLUGIN_LOADER (loader_perl));
+       g_return_if_fail (GNM_IS_PERL_PLUGIN_LOADER (loader_perl));
 
        loader_perl->module_name = NULL;
 }
diff --git a/plugins/python-loader/gnm-py-interpreter.c b/plugins/python-loader/gnm-py-interpreter.c
index d42a478..28839c0 100644
--- a/plugins/python-loader/gnm-py-interpreter.c
+++ b/plugins/python-loader/gnm-py-interpreter.c
@@ -109,7 +109,7 @@ void
 gnm_py_interpreter_destroy (GnmPyInterpreter *interpreter,
                             GnmPyInterpreter *new_interpreter)
 {
-       g_return_if_fail (IS_GNM_PY_INTERPRETER (interpreter));
+       g_return_if_fail (GNM_IS_PY_INTERPRETER (interpreter));
 
        gnm_py_interpreter_switch_to (interpreter);
        Py_EndInterpreter (interpreter->py_thread_state);
@@ -121,7 +121,7 @@ gnm_py_interpreter_destroy (GnmPyInterpreter *interpreter,
 void
 gnm_py_interpreter_switch_to (GnmPyInterpreter *interpreter)
 {
-       g_return_if_fail (IS_GNM_PY_INTERPRETER (interpreter));
+       g_return_if_fail (GNM_IS_PY_INTERPRETER (interpreter));
 
        if (PyThreadState_Get ()->interp != interpreter->py_thread_state->interp) {
                (void) PyThreadState_Swap (interpreter->py_thread_state);
@@ -161,7 +161,7 @@ gnm_py_interpreter_run_string (GnmPyInterpreter *interpreter, const char *cmd,
                 *saved_stderr_obj = NULL, *stderr_obj = NULL;
        PyObject *py_str;
 
-       g_return_if_fail (IS_GNM_PY_INTERPRETER (interpreter));
+       g_return_if_fail (GNM_IS_PY_INTERPRETER (interpreter));
 
        gnm_py_interpreter_switch_to (interpreter);
 
@@ -246,7 +246,7 @@ gnm_py_interpreter_run_string (GnmPyInterpreter *interpreter, const char *cmd,
 const char *
 gnm_py_interpreter_get_name (GnmPyInterpreter *interpreter)
 {
-       g_return_val_if_fail (IS_GNM_PY_INTERPRETER (interpreter), NULL);
+       g_return_val_if_fail (GNM_IS_PY_INTERPRETER (interpreter), NULL);
 
        if (interpreter->plugin != NULL) {
                return go_plugin_get_name (interpreter->plugin);
@@ -258,7 +258,7 @@ gnm_py_interpreter_get_name (GnmPyInterpreter *interpreter)
 GOPlugin *
 gnm_py_interpreter_get_plugin (GnmPyInterpreter *interpreter)
 {
-       g_return_val_if_fail (IS_GNM_PY_INTERPRETER (interpreter), NULL);
+       g_return_val_if_fail (GNM_IS_PY_INTERPRETER (interpreter), NULL);
 
        return interpreter->plugin;
 }
diff --git a/plugins/python-loader/gnm-py-interpreter.h b/plugins/python-loader/gnm-py-interpreter.h
index 1c6709f..1cfcaaa 100644
--- a/plugins/python-loader/gnm-py-interpreter.h
+++ b/plugins/python-loader/gnm-py-interpreter.h
@@ -7,7 +7,7 @@
 
 #define GNM_PY_INTERPRETER_TYPE     (gnm_py_interpreter_get_type ())
 #define GNM_PY_INTERPRETER(o)       (G_TYPE_CHECK_INSTANCE_CAST ((o), GNM_PY_INTERPRETER_TYPE, 
GnmPyInterpreter))
-#define IS_GNM_PY_INTERPRETER(o)    (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNM_PY_INTERPRETER_TYPE))
+#define GNM_IS_PY_INTERPRETER(o)    (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNM_PY_INTERPRETER_TYPE))
 
 GType gnm_py_interpreter_get_type (void);
 typedef struct _GnmPyInterpreter GnmPyInterpreter;
diff --git a/plugins/python-loader/gnm-python.c b/plugins/python-loader/gnm-python.c
index 28dbe85..a9b01c9 100644
--- a/plugins/python-loader/gnm-python.c
+++ b/plugins/python-loader/gnm-python.c
@@ -133,8 +133,8 @@ gnm_python_object_get (GOErrorInfo **err)
 static void
 cb_interpreter_switched (GnmPyInterpreter *interpreter, GnmPython *gpy)
 {
-       g_return_if_fail (IS_GNM_PY_INTERPRETER (interpreter));
-       g_return_if_fail (IS_GNM_PYTHON (gpy));
+       g_return_if_fail (GNM_IS_PY_INTERPRETER (interpreter));
+       g_return_if_fail (GNM_IS_PYTHON (gpy));
 
        gpy->current_interpreter = interpreter;
        g_signal_emit (
@@ -146,7 +146,7 @@ gnm_python_new_interpreter (GnmPython *gpy, GOPlugin *plugin)
 {
        GnmPyInterpreter *interpreter;
 
-       g_return_val_if_fail (IS_GNM_PYTHON (gpy), NULL);
+       g_return_val_if_fail (GNM_IS_PYTHON (gpy), NULL);
        g_return_val_if_fail (GO_IS_PLUGIN (plugin), NULL);
 
        interpreter = gnm_py_interpreter_new (plugin);
@@ -163,8 +163,8 @@ gnm_python_new_interpreter (GnmPython *gpy, GOPlugin *plugin)
 void
 gnm_python_destroy_interpreter (GnmPython *gpy, GnmPyInterpreter *interpreter)
 {
-       g_return_if_fail (IS_GNM_PYTHON (gpy));
-       g_return_if_fail (IS_GNM_PY_INTERPRETER (interpreter));
+       g_return_if_fail (GNM_IS_PYTHON (gpy));
+       g_return_if_fail (GNM_IS_PY_INTERPRETER (interpreter));
        g_return_if_fail (interpreter != gpy->default_interpreter);
 
        GO_SLIST_REMOVE (gpy->interpreters, interpreter);
@@ -175,7 +175,7 @@ gnm_python_destroy_interpreter (GnmPython *gpy, GnmPyInterpreter *interpreter)
 GnmPyInterpreter *
 gnm_python_get_current_interpreter (GnmPython *gpy)
 {
-       g_return_val_if_fail (IS_GNM_PYTHON (gpy), NULL);
+       g_return_val_if_fail (GNM_IS_PYTHON (gpy), NULL);
 
        return gpy->current_interpreter;
 }
@@ -183,7 +183,7 @@ gnm_python_get_current_interpreter (GnmPython *gpy)
 GnmPyInterpreter *
 gnm_python_get_default_interpreter (GnmPython *gpy)
 {
-       g_return_val_if_fail (IS_GNM_PYTHON (gpy), NULL);
+       g_return_val_if_fail (GNM_IS_PYTHON (gpy), NULL);
 
        return gpy->default_interpreter;
 }
@@ -191,7 +191,7 @@ gnm_python_get_default_interpreter (GnmPython *gpy)
 GSList *
 gnm_python_get_interpreters (GnmPython *gpy)
 {
-       g_return_val_if_fail (IS_GNM_PYTHON (gpy), NULL);
+       g_return_val_if_fail (GNM_IS_PYTHON (gpy), NULL);
 
        return gpy->interpreters;
 }
@@ -199,7 +199,7 @@ gnm_python_get_interpreters (GnmPython *gpy)
 void
 gnm_python_clear_error_if_needed (GnmPython *gpy)
 {
-       g_return_if_fail (IS_GNM_PYTHON (gpy));
+       g_return_if_fail (GNM_IS_PYTHON (gpy));
 
        if (PyErr_Occurred () != NULL) {
                PyErr_Clear ();
diff --git a/plugins/python-loader/gnm-python.h b/plugins/python-loader/gnm-python.h
index b27820b..1a57c64 100644
--- a/plugins/python-loader/gnm-python.h
+++ b/plugins/python-loader/gnm-python.h
@@ -7,7 +7,7 @@
 
 #define GNM_PYTHON_TYPE        (gnm_python_get_type ())
 #define GNM_PYTHON(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), GNM_PYTHON_TYPE, GnmPython))
-#define IS_GNM_PYTHON(o)       (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNM_PYTHON_TYPE))
+#define GNM_IS_PYTHON(o)       (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNM_PYTHON_TYPE))
 
 GType gnm_python_get_type (void);
 typedef struct _GnmPython GnmPython;
diff --git a/plugins/python-loader/py-command-line.h b/plugins/python-loader/py-command-line.h
index 39ff86b..636de48 100644
--- a/plugins/python-loader/py-command-line.h
+++ b/plugins/python-loader/py-command-line.h
@@ -8,7 +8,7 @@
 
 #define GNM_PY_COMMAND_LINE_TYPE     (gnm_py_command_line_get_type ())
 #define GNM_PY_COMMAND_LINE(o)       (G_TYPE_CHECK_INSTANCE_CAST ((o), GNM_PY_COMMAND_LINE_TYPE, 
GnmPyCommandLine))
-#define IS_GNM_PY_COMMAND_LINE(o)    (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNM_PY_COMMAND_LINE_TYPE))
+#define GNM_IS_PY_COMMAND_LINE(o)    (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNM_PY_COMMAND_LINE_TYPE))
 
 GType gnm_py_command_line_get_type (void);
 typedef struct _GnmPyCommandLine GnmPyCommandLine;
diff --git a/plugins/python-loader/py-interpreter-selector.h b/plugins/python-loader/py-interpreter-selector.h
index 7567e31..a47cef7 100644
--- a/plugins/python-loader/py-interpreter-selector.h
+++ b/plugins/python-loader/py-interpreter-selector.h
@@ -9,7 +9,7 @@
 
 #define GNM_PY_INTERPRETER_SELECTOR_TYPE     (gnm_py_interpreter_selector_get_type ())
 #define GNM_PY_INTERPRETER_SELECTOR(o)       (G_TYPE_CHECK_INSTANCE_CAST ((o), 
GNM_PY_INTERPRETER_SELECTOR_TYPE, GnmPyInterpreterSelector))
-#define IS_GNM_PY_INTERPRETER_SELECTOR(o)    (G_TYPE_CHECK_INSTANCE_TYPE ((o), 
GNM_PY_INTERPRETER_SELECTOR_TYPE))
+#define GNM_IS_PY_INTERPRETER_SELECTOR(o)    (G_TYPE_CHECK_INSTANCE_TYPE ((o), 
GNM_PY_INTERPRETER_SELECTOR_TYPE))
 
 GType gnm_py_interpreter_selector_get_type (void);
 typedef struct _GnmPyInterpreterSelector GnmPyInterpreterSelector;
diff --git a/plugins/python-loader/python-loader.c b/plugins/python-loader/python-loader.c
index 3792823..c4cc56f 100644
--- a/plugins/python-loader/python-loader.c
+++ b/plugins/python-loader/python-loader.c
@@ -761,7 +761,7 @@ gplp_unload_service_function_group (GOPluginLoader *loader,
 {
        ServiceLoaderDataFunctionGroup *loader_data;
 
-       g_return_if_fail (IS_GNM_PYTHON_PLUGIN_LOADER (loader));
+       g_return_if_fail (GNM_IS_PYTHON_PLUGIN_LOADER (loader));
        g_return_if_fail (GNM_IS_PLUGIN_SERVICE_FUNCTION_GROUP (service));
 
        GO_INIT_RET_ERROR_INFO (ret_error);
@@ -904,7 +904,7 @@ gplp_finalize (GObject *obj)
 static void
 gplp_init (GnmPythonPluginLoader *loader_python)
 {
-       g_return_if_fail (IS_GNM_PYTHON_PLUGIN_LOADER (loader_python));
+       g_return_if_fail (GNM_IS_PYTHON_PLUGIN_LOADER (loader_python));
 
        loader_python->module_name = NULL;
        loader_python->py_object = NULL;
diff --git a/plugins/python-loader/python-loader.h b/plugins/python-loader/python-loader.h
index a6ffedd..758b2bf 100644
--- a/plugins/python-loader/python-loader.h
+++ b/plugins/python-loader/python-loader.h
@@ -5,7 +5,7 @@
 
 #define TYPE_GNM_PYTHON_PLUGIN_LOADER  (gnm_python_plugin_loader_get_type ())
 #define GNM_PYTHON_PLUGIN_LOADER(o)    (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_GNM_PYTHON_PLUGIN_LOADER, 
GnmPythonPluginLoader))
-#define IS_GNM_PYTHON_PLUGIN_LOADER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_GNM_PYTHON_PLUGIN_LOADER))
+#define GNM_IS_PYTHON_PLUGIN_LOADER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_GNM_PYTHON_PLUGIN_LOADER))
 
 GType gnm_python_plugin_loader_get_type (void);
 
diff --git a/src/application.c b/src/application.c
index 80eb454..ee6cb22 100644
--- a/src/application.c
+++ b/src/application.c
@@ -35,9 +35,7 @@
 #include <gtk/gtk.h>
 
 #define GNM_APP(o)             (G_TYPE_CHECK_INSTANCE_CAST((o), GNM_APP_TYPE, GnmApp))
-#define GNM_APP_CLASS(k)       (G_TYPE_CHECK_CLASS_CAST((k),    GNM_APP_TYPE, GnmAppClass))
-#define IS_GNM_APP(o)          (G_TYPE_CHECK_INSTANCE_TYPE((o), GNM_APP_TYPE))
-#define IS_GNM_APP_CLASS(k)    (G_TYPE_CHECK_CLASS_TYPE((k),    GNM_APP_TYPE))
+#define GNM_IS_APP(o)          (G_TYPE_CHECK_INSTANCE_TYPE((o), GNM_APP_TYPE))
 
 enum {
        APPLICATION_PROP_0,
@@ -113,7 +111,7 @@ gnm_app_get_app (void)
 void
 gnm_app_workbook_list_add (Workbook *wb)
 {
-       g_return_if_fail (IS_WORKBOOK (wb));
+       g_return_if_fail (GNM_IS_WORKBOOK (wb));
        g_return_if_fail (app != NULL);
 
        app->workbook_list = g_list_prepend (app->workbook_list, wb);
@@ -246,7 +244,7 @@ gnm_app_clipboard_cut_copy (WorkbookControl *wbc, gboolean is_cut,
 {
        Sheet *sheet;
 
-       g_return_if_fail (IS_SHEET_VIEW (sv));
+       g_return_if_fail (GNM_IS_SV (sv));
        g_return_if_fail (area != NULL);
        g_return_if_fail (app != NULL);
 
@@ -286,7 +284,7 @@ void
 gnm_app_clipboard_cut_copy_obj (WorkbookControl *wbc, gboolean is_cut,
                                SheetView *sv, GSList *objects)
 {
-       g_return_if_fail (IS_SHEET_VIEW (sv));
+       g_return_if_fail (GNM_IS_SV (sv));
        g_return_if_fail (objects != NULL);
        g_return_if_fail (app != NULL);
 
@@ -764,7 +762,7 @@ gnm_app_class_init (GObjectClass *gobject_klass)
                G_STRUCT_OFFSET (GnmAppClass, workbook_added),
                NULL, NULL,
                g_cclosure_marshal_VOID__OBJECT,
-               G_TYPE_NONE, 1, WORKBOOK_TYPE);
+               G_TYPE_NONE, 1, GNM_WORKBOOK_TYPE);
        signals[WORKBOOK_REMOVED] = g_signal_new ("workbook_removed",
                GNM_APP_TYPE,
                G_SIGNAL_RUN_LAST,
diff --git a/src/clipboard.c b/src/clipboard.c
index 5f63238..4bf64b4 100644
--- a/src/clipboard.c
+++ b/src/clipboard.c
@@ -315,7 +315,7 @@ paste_object (GnmPasteTarget const *pt, SheetObject const *src, int left, int to
        SheetObjectAnchor tmp;
 
        tmp = *sheet_object_get_anchor (src);
-       if (G_OBJECT_TYPE (src) == CELL_COMMENT_TYPE) {
+       if (G_OBJECT_TYPE (src) == GNM_CELL_COMMENT_TYPE) {
                if ((pt->paste_flags & PASTE_COMMENTS) &&
                    (pt->paste_flags & PASTE_IGNORE_COMMENTS_AT_ORIGIN &&
                     tmp.cell_bound.start.col == 0  &&
diff --git a/src/cmd-edit.c b/src/cmd-edit.c
index 8376545..9f0aea6 100644
--- a/src/cmd-edit.c
+++ b/src/cmd-edit.c
@@ -147,7 +147,7 @@ sv_select_cur_depends (SheetView *sv)
        GnmCell  *cur_cell, dummy;
        GList *deps = NULL, *ptr = NULL;
 
-       g_return_if_fail (IS_SHEET_VIEW (sv));
+       g_return_if_fail (GNM_IS_SV (sv));
 
        cur_cell = sheet_cell_get (sv->sheet,
                sv->edit_pos.col, sv->edit_pos.row);
@@ -239,7 +239,7 @@ sv_select_cur_inputs (SheetView *sv)
        GSList   *ranges, *ptr;
        GnmEvalPos ep;
 
-       g_return_if_fail (IS_SHEET_VIEW (sv));
+       g_return_if_fail (GNM_IS_SV (sv));
 
        cell = sheet_cell_get (sv->sheet,
                sv->edit_pos.col, sv->edit_pos.row);
diff --git a/src/commands.c b/src/commands.c
index 519dfbd..be1e9b2 100644
--- a/src/commands.c
+++ b/src/commands.c
@@ -125,8 +125,7 @@
 
 #define GNM_COMMAND(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), GNM_COMMAND_TYPE, GnmCommand))
 #define GNM_COMMAND_CLASS(k)    (G_TYPE_CHECK_CLASS_CAST ((k), GNM_COMMAND_TYPE, GnmCommandClass))
-#define IS_GNM_COMMAND(o)       (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNM_COMMAND_TYPE))
-#define IS_GNM_COMMAND_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GNM_COMMAND_TYPE))
+#define GNM_IS_COMMAND(o)       (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNM_COMMAND_TYPE))
 #define CMD_CLASS(o)           GNM_COMMAND_CLASS (G_OBJECT_GET_CLASS(cmd))
 
 GSF_CLASS (GnmCommand, gnm_command, NULL, NULL, G_TYPE_OBJECT)
@@ -4660,7 +4659,7 @@ cmd_objects_delete_undo (GnmCommand *cmd,
                (GFunc) sheet_object_set_sheet, me->cmd.sheet);
 
        for (l = me->objects, i = 0; l; l = l->next, i++)
-               cmd_objects_restore_location (SHEET_OBJECT (l->data),
+               cmd_objects_restore_location (GNM_SO (l->data),
                                              g_array_index(me->location,
                                                            gint, i));
        return FALSE;
@@ -5010,11 +5009,11 @@ cmd_set_comment_apply (Sheet *sheet, GnmCellPos *pos,
                        mr = gnm_sheet_merge_contains_pos (sheet, pos);
 
                        if (mr)
-                               sheet_objects_clear (sheet, mr, CELL_COMMENT_TYPE, NULL);
+                               sheet_objects_clear (sheet, mr, GNM_CELL_COMMENT_TYPE, NULL);
                        else {
                                GnmRange r;
                                r.start = r.end = *pos;
-                               sheet_objects_clear (sheet, &r, CELL_COMMENT_TYPE, NULL);
+                               sheet_objects_clear (sheet, &r, GNM_CELL_COMMENT_TYPE, NULL);
                        }
                }
        } else if (text && (strlen (text) > 0)) {
@@ -5755,7 +5754,7 @@ update_sheet_graph_cb (Sheet *sheet)
 {
        g_return_if_fail (IS_SHEET (sheet) && sheet->sheet_type == GNM_SHEET_OBJECT);
 
-       sheet_object_graph_ensure_size (SHEET_OBJECT (sheet->sheet_objects->data));
+       sheet_object_graph_ensure_size (GNM_SO (sheet->sheet_objects->data));
 }
 
 static gboolean
diff --git a/src/dependent.c b/src/dependent.c
index f412df2..7e00240 100644
--- a/src/dependent.c
+++ b/src/dependent.c
@@ -2793,7 +2793,7 @@ dependents_invalidate_sheet (Sheet *sheet, gboolean destroy)
 void
 dependents_workbook_destroy (Workbook *wb)
 {
-       g_return_if_fail (IS_WORKBOOK (wb));
+       g_return_if_fail (GNM_IS_WORKBOOK (wb));
        g_return_if_fail (wb->during_destruction);
        g_return_if_fail (wb->sheets != NULL);
 
@@ -2862,7 +2862,7 @@ workbook_recalc (Workbook *wb)
 {
        gboolean redraw = FALSE;
 
-       g_return_if_fail (IS_WORKBOOK (wb));
+       g_return_if_fail (GNM_IS_WORKBOOK (wb));
 
        gnm_app_recalc_start ();
 
diff --git a/src/dialogs/dialog-analysis-tools.c b/src/dialogs/dialog-analysis-tools.c
index 9e3e68a..67ba3b0 100644
--- a/src/dialogs/dialog-analysis-tools.c
+++ b/src/dialogs/dialog-analysis-tools.c
@@ -282,7 +282,7 @@ error_in_entry (GenericToolState *state, GtkWidget *entry, char const *err_str)
                                       GTK_MESSAGE_ERROR,
                                       "%s", err_str);
 
-       if (IS_GNM_EXPR_ENTRY (entry))
+       if (GNM_EXPR_ENTRY_IS (entry))
                gnm_expr_entry_grab_focus (GNM_EXPR_ENTRY (entry), TRUE);
        else
                focus_on_entry (GTK_ENTRY (entry));
diff --git a/src/dialogs/dialog-cell-format.c b/src/dialogs/dialog-cell-format.c
index b6ee4d8..65f574e 100644
--- a/src/dialogs/dialog-cell-format.c
+++ b/src/dialogs/dialog-cell-format.c
@@ -1174,7 +1174,7 @@ border_format_has_changed (FormatState *state, BorderPicker *edge)
                        if (line_info[i].location == edge->index &&
                            state->border.lines[i] != NULL) {
                                gnumeric_dashed_canvas_line_set_dash_index (
-                                       GNUMERIC_DASHED_CANVAS_LINE (state->border.lines[i]),
+                                       GNM_DASHED_CANVAS_LINE (state->border.lines[i]),
                                        edge->pattern_index);
                        }
                }
@@ -1371,7 +1371,7 @@ draw_border_preview (FormatState *state)
                                style = go_styled_object_get_style (GO_STYLED_OBJECT 
(state->border.lines[i]));
                                style->line.color = p->rgba;
                                gnumeric_dashed_canvas_line_set_dash_index (
-                                       GNUMERIC_DASHED_CANVAS_LINE (state->border.lines[i]),
+                                       GNM_DASHED_CANVAS_LINE (state->border.lines[i]),
                                        p->pattern_index);
                        } else
                                state->border.lines[i] = NULL;
diff --git a/src/dialogs/dialog-consolidate.c b/src/dialogs/dialog-consolidate.c
index 23b38b1..0445da2 100644
--- a/src/dialogs/dialog-consolidate.c
+++ b/src/dialogs/dialog-consolidate.c
@@ -427,7 +427,7 @@ setup_widgets (ConsolidateState *state, GtkBuilder *gui)
 
        renderer = gnumeric_cell_renderer_expr_entry_new (state->base.wbcg);
        state->cellrenderer =
-               GNUMERIC_CELL_RENDERER_EXPR_ENTRY (renderer);
+               GNM_CELL_RENDERER_EXPR_ENTRY (renderer);
        column = gtk_tree_view_column_new_with_attributes
                ("", renderer,
                 "text", SOURCE_COLUMN,
diff --git a/src/dialogs/dialog-formula-guru.c b/src/dialogs/dialog-formula-guru.c
index fb1205f..89245b4 100644
--- a/src/dialogs/dialog-formula-guru.c
+++ b/src/dialogs/dialog-formula-guru.c
@@ -900,7 +900,7 @@ dialog_formula_guru_init (FormulaGuruState *state)
                                                           "text", ARG_TYPE, NULL);
        gtk_tree_view_append_column (state->treeview, column);
        renderer = gnumeric_cell_renderer_expr_entry_new (state->wbcg);
-       state->cellrenderer = GNUMERIC_CELL_RENDERER_EXPR_ENTRY (renderer);
+       state->cellrenderer = GNM_CELL_RENDERER_EXPR_ENTRY (renderer);
        g_signal_connect (G_OBJECT (renderer), "edited",
                          G_CALLBACK (cb_dialog_formula_guru_edited), state);
        state->editable = NULL;
diff --git a/src/dialogs/dialog-printer-setup.c b/src/dialogs/dialog-printer-setup.c
index dc5ca54..ab0ef32 100644
--- a/src/dialogs/dialog-printer-setup.c
+++ b/src/dialogs/dialog-printer-setup.c
@@ -2650,7 +2650,7 @@ cb_do_print_preview (PrinterSetupState *state)
        old_pi = state->sheet->print_info;
        state->sheet->print_info = state->pi;
        if (state->sheet->sheet_type == GNM_SHEET_OBJECT) {
-               graph = GOG_GRAPH (sheet_object_graph_get_gog (SHEET_OBJECT 
(state->sheet->sheet_objects->data)));
+               graph = GOG_GRAPH (sheet_object_graph_get_gog (GNM_SO (state->sheet->sheet_objects->data)));
                if (graph) {
                        double top, bottom, left, right, edge_to_below_header, edge_to_above_footer, w, h;
                        gog_graph_get_size (graph, &width, &height);
diff --git a/src/dialogs/dialog-search.c b/src/dialogs/dialog-search.c
index 0fc6652..a26c5be 100644
--- a/src/dialogs/dialog-search.c
+++ b/src/dialogs/dialog-search.c
@@ -102,7 +102,7 @@ static void
 search_get_value (gint row, gint column, gpointer _dd, GValue *value)
 {
        DialogState *dd = (DialogState *)_dd;
-       GnumericLazyList *ll = GNUMERIC_LAZY_LIST (gtk_tree_view_get_model (dd->matches_table));
+       GnumericLazyList *ll = GNM_LAZY_LIST (gtk_tree_view_get_model (dd->matches_table));
        GnmSearchFilterResult *item = g_ptr_array_index (dd->matches, row);
        GnmCell *cell;
        GnmComment *comment;
diff --git a/src/dialogs/dialog-sheetobject-size.c b/src/dialogs/dialog-sheetobject-size.c
index 69910a6..476e90e 100644
--- a/src/dialogs/dialog-sheetobject-size.c
+++ b/src/dialogs/dialog-sheetobject-size.c
@@ -325,7 +325,7 @@ dialog_so_size (WBCGtk *wbcg, GObject *so)
        state->gui    = gui;
        state->dialog = go_gtk_builder_get_widget (state->gui, "object-size");
 
-       state->so = SHEET_OBJECT (so);
+       state->so = GNM_SO (so);
        g_object_ref (so);
 
        state->nameentry = GTK_ENTRY (go_gtk_builder_get_widget (state->gui, "name-entry"));
diff --git a/src/dialogs/dialog-so-list.c b/src/dialogs/dialog-so-list.c
index cdd0f6f..cb25aa6 100644
--- a/src/dialogs/dialog-so-list.c
+++ b/src/dialogs/dialog-so-list.c
@@ -159,7 +159,7 @@ dialog_so_list (WBCGtk *wbcg, GObject *so)
                return;
 
        state = g_new0 (GnmDialogSOList, 1);
-       if (so_list_init (state, wbcg, SHEET_OBJECT (so))) {
+       if (so_list_init (state, wbcg, GNM_SO (so))) {
                go_gtk_notice_dialog (wbcg_toplevel (wbcg), GTK_MESSAGE_ERROR,
                        _("Could not create the List Property dialog."));
                g_free (state);
diff --git a/src/dialogs/dialog-stf-export.c b/src/dialogs/dialog-stf-export.c
index 68d03d7..1a78fdf 100644
--- a/src/dialogs/dialog-stf-export.c
+++ b/src/dialogs/dialog-stf-export.c
@@ -709,7 +709,7 @@ stf_export_dialog (WBCGtk *wbcg, GnmStfExport *stfe, Workbook *wb)
 {
        TextExportState state;
 
-       g_return_val_if_fail (IS_WORKBOOK (wb), TRUE);
+       g_return_val_if_fail (GNM_IS_WORKBOOK (wb), TRUE);
        g_return_val_if_fail (GNM_IS_STF_EXPORT (stfe), TRUE);
 
        state.gui = gnm_gtk_builder_load ("dialog-stf-export.ui", NULL, GO_CMD_CONTEXT (wbcg));
diff --git a/src/dialogs/dialog-stf-preview.c b/src/dialogs/dialog-stf-preview.c
index af823a5..95d8138 100644
--- a/src/dialogs/dialog-stf-preview.c
+++ b/src/dialogs/dialog-stf-preview.c
@@ -42,7 +42,7 @@ static void
 render_get_value (gint row, gint column, gpointer _rd, GValue *value)
 {
        RenderData_t *rd = (RenderData_t *)_rd;
-       GnumericLazyList *ll = GNUMERIC_LAZY_LIST (gtk_tree_view_get_model (rd->tree_view));
+       GnumericLazyList *ll = GNM_LAZY_LIST (gtk_tree_view_get_model (rd->tree_view));
        GPtrArray *lines = rd->lines;
        GPtrArray *line = (row < (int)lines->len)
                ? g_ptr_array_index (lines, row)
diff --git a/src/expr.c b/src/expr.c
index 729aa58..86a5d6e 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -653,7 +653,7 @@ array_elem_get_corner (GnmExprArrayElem const *elem,
        g_return_val_if_fail (corner != NULL, NULL);
        g_return_val_if_fail (gnm_cell_has_expr (corner), NULL);
        g_return_val_if_fail (corner->base.texpr != (void *)0xdeadbeef, NULL);
-       g_return_val_if_fail (IS_GNM_EXPR_TOP (corner->base.texpr), NULL);
+       g_return_val_if_fail (GNM_IS_EXPR_TOP (corner->base.texpr), NULL);
 
        return corner;
 }
@@ -2843,7 +2843,7 @@ gnm_expr_top_new_constant (GnmValue *v)
 void
 gnm_expr_top_ref (GnmExprTop const *texpr)
 {
-       g_return_if_fail (IS_GNM_EXPR_TOP (texpr));
+       g_return_if_fail (GNM_IS_EXPR_TOP (texpr));
 
        ((GnmExprTop *)texpr)->refcount++;
 }
@@ -2851,7 +2851,7 @@ gnm_expr_top_ref (GnmExprTop const *texpr)
 void
 gnm_expr_top_unref (GnmExprTop const *texpr)
 {
-       g_return_if_fail (IS_GNM_EXPR_TOP (texpr));
+       g_return_if_fail (GNM_IS_EXPR_TOP (texpr));
 
        ((GnmExprTop *)texpr)->refcount--;
        if (texpr->refcount == 0) {
@@ -2877,7 +2877,7 @@ gnm_expr_top_get_type (void)
 gboolean
 gnm_expr_top_is_shared (GnmExprTop const *texpr)
 {
-       g_return_val_if_fail (IS_GNM_EXPR_TOP (texpr), FALSE);
+       g_return_val_if_fail (GNM_IS_EXPR_TOP (texpr), FALSE);
 
        return texpr->refcount > 1;
 }
@@ -2923,7 +2923,7 @@ gnm_expr_top_get_ranges (GnmExprTop const *texpr)
 {
        GSList *res = NULL;
 
-       g_return_val_if_fail (IS_GNM_EXPR_TOP (texpr), NULL);
+       g_return_val_if_fail (GNM_IS_EXPR_TOP (texpr), NULL);
        gnm_expr_walk (texpr->expr, cb_get_ranges, &res);
        return res;
 }
@@ -2931,7 +2931,7 @@ gnm_expr_top_get_ranges (GnmExprTop const *texpr)
 GnmValue *
 gnm_expr_top_get_range (GnmExprTop const *texpr)
 {
-       g_return_val_if_fail (IS_GNM_EXPR_TOP (texpr), NULL);
+       g_return_val_if_fail (GNM_IS_EXPR_TOP (texpr), NULL);
 
        return gnm_expr_get_range (texpr->expr);
 }
@@ -2941,7 +2941,7 @@ gnm_expr_top_as_string (GnmExprTop const *texpr,
                        GnmParsePos const *pp,
                        GnmConventions const *convs)
 {
-       g_return_val_if_fail (IS_GNM_EXPR_TOP (texpr), NULL);
+       g_return_val_if_fail (GNM_IS_EXPR_TOP (texpr), NULL);
 
        return gnm_expr_as_string (texpr->expr, pp, convs);
 }
@@ -2950,7 +2950,7 @@ void
 gnm_expr_top_as_gstring (GnmExprTop const *texpr,
                         GnmConventionsOut *out)
 {
-       g_return_if_fail (IS_GNM_EXPR_TOP (texpr));
+       g_return_if_fail (GNM_IS_EXPR_TOP (texpr));
        g_return_if_fail (out != NULL);
 
        do_expr_as_string (texpr->expr, 0, out);
@@ -2959,7 +2959,7 @@ gnm_expr_top_as_gstring (GnmExprTop const *texpr,
 guint
 gnm_expr_top_hash (GnmExprTop const *texpr)
 {
-       g_return_val_if_fail (IS_GNM_EXPR_TOP (texpr), 0);
+       g_return_val_if_fail (GNM_IS_EXPR_TOP (texpr), 0);
 
        if (texpr->hash == 0) {
                ((GnmExprTop *)texpr)->hash = gnm_expr_hash (texpr->expr);
@@ -2978,8 +2978,8 @@ gnm_expr_top_equal (GnmExprTop const *te1, GnmExprTop const *te2)
        if (te1 == NULL || te2 == NULL)
                return FALSE;
 
-       g_return_val_if_fail (IS_GNM_EXPR_TOP (te1), FALSE);
-       g_return_val_if_fail (IS_GNM_EXPR_TOP (te2), FALSE);
+       g_return_val_if_fail (GNM_IS_EXPR_TOP (te1), FALSE);
+       g_return_val_if_fail (GNM_IS_EXPR_TOP (te2), FALSE);
 
        if (te1->hash && te2->hash && te1->hash != te2->hash)
                return FALSE;
@@ -3014,7 +3014,7 @@ gnm_expr_top_relocate (GnmExprTop const *texpr,
 {
        RelocInfoInternal rinfo_tmp;
 
-       g_return_val_if_fail (IS_GNM_EXPR_TOP (texpr), NULL);
+       g_return_val_if_fail (GNM_IS_EXPR_TOP (texpr), NULL);
        g_return_val_if_fail (NULL != rinfo, NULL);
 
        rinfo_tmp.details = rinfo;
@@ -3037,7 +3037,7 @@ gnm_expr_top_relocate_sheet (GnmExprTop const *texpr,
        GnmExprRelocateInfo rinfo;
        GnmExprTop const *res;
 
-       g_return_val_if_fail (IS_GNM_EXPR_TOP (texpr), NULL);
+       g_return_val_if_fail (GNM_IS_EXPR_TOP (texpr), NULL);
        g_return_val_if_fail (IS_SHEET (src), NULL);
        g_return_val_if_fail (IS_SHEET (dst), NULL);
 
@@ -3063,7 +3063,7 @@ gnm_expr_top_relocate_sheet (GnmExprTop const *texpr,
 gboolean
 gnm_expr_top_contains_subtotal (GnmExprTop const *texpr)
 {
-       g_return_val_if_fail (IS_GNM_EXPR_TOP (texpr), FALSE);
+       g_return_val_if_fail (GNM_IS_EXPR_TOP (texpr), FALSE);
 
        return gnm_expr_contains_subtotal (texpr->expr);
 }
@@ -3091,7 +3091,7 @@ gnm_expr_top_is_volatile (GnmExprTop const *texpr)
         * volatile function won't even be reached.
         */
 
-       g_return_val_if_fail (IS_GNM_EXPR_TOP (texpr), FALSE);
+       g_return_val_if_fail (GNM_IS_EXPR_TOP (texpr), FALSE);
        gnm_expr_walk (texpr->expr, cb_is_volatile, &res);
        return res;
 }
@@ -3106,7 +3106,7 @@ gnm_expr_top_eval (GnmExprTop const *texpr,
        GnmEvalPos ep;
        GnmExprArrayCorner array;
 
-       g_return_val_if_fail (IS_GNM_EXPR_TOP (texpr), NULL);
+       g_return_val_if_fail (GNM_IS_EXPR_TOP (texpr), NULL);
 
        gnm_app_recalc_start ();
        if ((flags & GNM_EXPR_EVAL_ARRAY_CONTEXT) && !pos->array) {
@@ -3174,7 +3174,7 @@ gnm_expr_top_referenced_sheets (GnmExprTop const *texpr)
 {
        GSList *res = NULL;
 
-       g_return_val_if_fail (IS_GNM_EXPR_TOP (texpr), NULL);
+       g_return_val_if_fail (GNM_IS_EXPR_TOP (texpr), NULL);
        gnm_expr_walk (texpr->expr, cb_referenced_sheets, &res);
        return res;
 }
@@ -3182,7 +3182,7 @@ gnm_expr_top_referenced_sheets (GnmExprTop const *texpr)
 gboolean
 gnm_expr_top_is_err (GnmExprTop const *texpr, GnmStdError err)
 {
-       g_return_val_if_fail (IS_GNM_EXPR_TOP (texpr), FALSE);
+       g_return_val_if_fail (GNM_IS_EXPR_TOP (texpr), FALSE);
        return gnm_expr_is_err (texpr->expr, err);
 }
 
@@ -3195,7 +3195,7 @@ gnm_expr_top_is_err (GnmExprTop const *texpr, GnmStdError err)
 GnmValue const *
 gnm_expr_top_get_constant (GnmExprTop const *texpr)
 {
-       g_return_val_if_fail (IS_GNM_EXPR_TOP (texpr), NULL);
+       g_return_val_if_fail (GNM_IS_EXPR_TOP (texpr), NULL);
 
        return gnm_expr_get_constant (texpr->expr);
 }
@@ -3203,7 +3203,7 @@ gnm_expr_top_get_constant (GnmExprTop const *texpr)
 GnmCellRef const *
 gnm_expr_top_get_cellref (GnmExprTop const *texpr)
 {
-       g_return_val_if_fail (IS_GNM_EXPR_TOP (texpr), NULL);
+       g_return_val_if_fail (GNM_IS_EXPR_TOP (texpr), NULL);
 
        if (GNM_EXPR_GET_OPER (texpr->expr) != GNM_EXPR_OP_CELLREF)
                return NULL;
@@ -3232,7 +3232,7 @@ gnm_expr_top_first_funcall (GnmExprTop const *texpr)
 {
        GnmExpr const *res = NULL;
 
-       g_return_val_if_fail (IS_GNM_EXPR_TOP (texpr), NULL);
+       g_return_val_if_fail (GNM_IS_EXPR_TOP (texpr), NULL);
        gnm_expr_walk (texpr->expr, cb_first_funcall, &res);
        return res;
 }
@@ -3281,7 +3281,7 @@ gnm_expr_top_get_boundingbox (GnmExprTop const *texpr, Sheet const *sheet,
 {
        struct cb_get_boundingbox args;
 
-       g_return_if_fail (IS_GNM_EXPR_TOP (texpr));
+       g_return_if_fail (GNM_IS_EXPR_TOP (texpr));
 
        range_init_full_sheet (bound, sheet);
 
@@ -3293,7 +3293,7 @@ gnm_expr_top_get_boundingbox (GnmExprTop const *texpr, Sheet const *sheet,
 gboolean
 gnm_expr_top_is_rangeref (GnmExprTop const *texpr)
 {
-       g_return_val_if_fail (IS_GNM_EXPR_TOP (texpr), FALSE);
+       g_return_val_if_fail (GNM_IS_EXPR_TOP (texpr), FALSE);
 
        return gnm_expr_is_rangeref (texpr->expr);
 }
@@ -3307,7 +3307,7 @@ gnm_expr_top_is_rangeref (GnmExprTop const *texpr)
 GnmExprArrayCorner const *
 gnm_expr_top_get_array_corner (GnmExprTop const *texpr)
 {
-       g_return_val_if_fail (IS_GNM_EXPR_TOP (texpr), NULL);
+       g_return_val_if_fail (GNM_IS_EXPR_TOP (texpr), NULL);
        return GNM_EXPR_GET_OPER (texpr->expr) == GNM_EXPR_OP_ARRAY_CORNER
                ? &texpr->expr->array_corner
                : NULL;
@@ -3316,14 +3316,14 @@ gnm_expr_top_get_array_corner (GnmExprTop const *texpr)
 gboolean
 gnm_expr_top_is_array_corner (GnmExprTop const *texpr)
 {
-       g_return_val_if_fail (IS_GNM_EXPR_TOP (texpr), FALSE);
+       g_return_val_if_fail (GNM_IS_EXPR_TOP (texpr), FALSE);
        return GNM_EXPR_GET_OPER (texpr->expr) == GNM_EXPR_OP_ARRAY_CORNER;
 }
 
 gboolean
 gnm_expr_top_is_array_elem (GnmExprTop const *texpr, int *x, int *y)
 {
-       g_return_val_if_fail (IS_GNM_EXPR_TOP (texpr), FALSE);
+       g_return_val_if_fail (GNM_IS_EXPR_TOP (texpr), FALSE);
 
        if (GNM_EXPR_GET_OPER (texpr->expr) != GNM_EXPR_OP_ARRAY_ELEM)
                return FALSE;
@@ -3336,14 +3336,14 @@ gnm_expr_top_is_array_elem (GnmExprTop const *texpr, int *x, int *y)
 gboolean
 gnm_expr_top_is_array (GnmExprTop const *texpr)
 {
-       g_return_val_if_fail (IS_GNM_EXPR_TOP (texpr), FALSE);
+       g_return_val_if_fail (GNM_IS_EXPR_TOP (texpr), FALSE);
        return gnm_expr_is_array (texpr->expr);
 }
 
 GnmExprTop const *
 gnm_expr_top_transpose (GnmExprTop const *texpr)
 {
-       g_return_val_if_fail (IS_GNM_EXPR_TOP (texpr), NULL);
+       g_return_val_if_fail (GNM_IS_EXPR_TOP (texpr), NULL);
        switch (GNM_EXPR_GET_OPER (texpr->expr)) {
        case GNM_EXPR_OP_ARRAY_CORNER:
                /* Transpose size  */
diff --git a/src/expr.h b/src/expr.h
index 3ce615f..57370ba 100644
--- a/src/expr.h
+++ b/src/expr.h
@@ -133,7 +133,7 @@ GnmExprList *gnm_expr_list_copy       (GnmExprList *list);
 /*****************************************************************************/
 
 #define GNM_EXPR_TOP_MAGIC 0x42
-#define IS_GNM_EXPR_TOP(et) ((et) && (et)->magic == GNM_EXPR_TOP_MAGIC)
+#define GNM_IS_EXPR_TOP(et) ((et) && (et)->magic == GNM_EXPR_TOP_MAGIC)
 
 struct _GnmExprTop {
        unsigned magic : 8;
diff --git a/src/gnm-cell-combo.c b/src/gnm-cell-combo.c
index 79e0b99..a82c48b 100644
--- a/src/gnm-cell-combo.c
+++ b/src/gnm-cell-combo.c
@@ -120,7 +120,7 @@ gnm_cell_combo_class_init (GObjectClass *gobject_class)
 
        g_object_class_install_property (gobject_class, PROP_SV,
                 g_param_spec_object ("sheet-view", NULL, NULL,
-                       SHEET_VIEW_TYPE, GSF_PARAM_STATIC | G_PARAM_READWRITE));
+                       GNM_SV_TYPE, GSF_PARAM_STATIC | G_PARAM_READWRITE));
 }
 
 GSF_CLASS_ABSTRACT (GnmCellCombo, gnm_cell_combo,
diff --git a/src/gnm-data-cache-source.c b/src/gnm-data-cache-source.c
index 42c1402..6c46dfd 100644
--- a/src/gnm-data-cache-source.c
+++ b/src/gnm-data-cache-source.c
@@ -225,34 +225,34 @@ gnm_data_cache_source_new (Sheet *src_sheet,
 Sheet *
 gnm_data_cache_source_get_sheet (GnmDataCacheSource const *src)
 {
-       g_return_val_if_fail (IS_GNM_DATA_CACHE_SOURCE (src), NULL);
+       g_return_val_if_fail (GNM_IS_DATA_CACHE_SOURCE (src), NULL);
        return src->src_sheet;
 }
 
 void
 gnm_data_cache_source_set_sheet (GnmDataCacheSource *src, Sheet *sheet)
 {
-       g_return_if_fail (IS_GNM_DATA_CACHE_SOURCE (src));
+       g_return_if_fail (GNM_IS_DATA_CACHE_SOURCE (src));
 }
 
 GnmRange const *
 gnm_data_cache_source_get_range (GnmDataCacheSource const *src)
 {
-       g_return_val_if_fail (IS_GNM_DATA_CACHE_SOURCE (src), NULL);
+       g_return_val_if_fail (GNM_IS_DATA_CACHE_SOURCE (src), NULL);
        return &src->src_range;
 }
 
 void
 gnm_data_cache_source_set_range (GnmDataCacheSource *src, GnmRange const *r)
 {
-       g_return_if_fail (IS_GNM_DATA_CACHE_SOURCE (src));
+       g_return_if_fail (GNM_IS_DATA_CACHE_SOURCE (src));
        src->src_range = *r;
 }
 
 char const *
 gnm_data_cache_source_get_name  (GnmDataCacheSource const *src)
 {
-       g_return_val_if_fail (IS_GNM_DATA_CACHE_SOURCE (src), NULL);
+       g_return_val_if_fail (GNM_IS_DATA_CACHE_SOURCE (src), NULL);
        return src->src_name ? src->src_name->str : NULL;
 }
 
@@ -261,7 +261,7 @@ gnm_data_cache_source_set_name (GnmDataCacheSource *src, char const *name)
 {
        GOString *new_val;
 
-       g_return_if_fail (IS_GNM_DATA_CACHE_SOURCE (src));
+       g_return_if_fail (GNM_IS_DATA_CACHE_SOURCE (src));
 
        new_val = go_string_new (name);
        go_string_unref (src->src_name);
diff --git a/src/gnm-data-cache-source.h b/src/gnm-data-cache-source.h
index 7f7e308..9bf0e20 100644
--- a/src/gnm-data-cache-source.h
+++ b/src/gnm-data-cache-source.h
@@ -32,7 +32,7 @@ G_BEGIN_DECLS
 
 #define GNM_DATA_CACHE_SOURCE_TYPE     (gnm_data_cache_source_get_type ())
 #define GNM_DATA_CACHE_SOURCE(o)       (G_TYPE_CHECK_INSTANCE_CAST ((o), GNM_DATA_CACHE_SOURCE_TYPE, 
GnmDataCacheSource))
-#define IS_GNM_DATA_CACHE_SOURCE(o)    (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNM_DATA_CACHE_SOURCE_TYPE))
+#define GNM_IS_DATA_CACHE_SOURCE(o)    (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNM_DATA_CACHE_SOURCE_TYPE))
 
 GType gnm_data_cache_source_get_type (void);
 
diff --git a/src/gnm-graph-window.h b/src/gnm-graph-window.h
index fa006ae..3dfe365 100644
--- a/src/gnm-graph-window.h
+++ b/src/gnm-graph-window.h
@@ -9,9 +9,7 @@ G_BEGIN_DECLS
 
 #define GNM_TYPE_GRAPH_WINDOW             (gnm_graph_window_get_type ())
 #define GNM_GRAPH_WINDOW(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNM_TYPE_GRAPH_WINDOW, 
GnmGraphWindow))
-#define GNM_GRAPH_WINDOW_CLASS(vtable)    (G_TYPE_CHECK_CLASS_CAST ((vtable), GNM_TYPE_GRAPH_WINDOW, 
GnmGraphWindowClass))
-#define IS_GNM_GRAPH_WINDOW(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNM_TYPE_GRAPH_WINDOW))
-#define IS_GNM_GRAPH_WINDOW_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), GNM_TYPE_GRAPH_WINDOW))
+#define GNM_IS_GRAPH_WINDOW(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNM_TYPE_GRAPH_WINDOW))
 #define GNM_GRAPH_WINDOW_GET_CLASS(inst)  (G_TYPE_INSTANCE_GET_CLASS ((inst), GNM_TYPE_GRAPH_WINDOW, 
GnmGraphWindowClass))
 
 typedef struct _GnmGraphWindow      GnmGraphWindow;
diff --git a/src/gnm-pane.c b/src/gnm-pane.c
index 8b84811..281f2e5 100644
--- a/src/gnm-pane.c
+++ b/src/gnm-pane.c
@@ -84,7 +84,7 @@ static gboolean
 gnm_pane_object_key_press (GnmPane *pane, GdkEventKey *ev)
 {
        SheetControlGUI *scg = pane->simple.scg;
-       SheetControl    *sc = SHEET_CONTROL (scg);
+       SheetControl    *sc = GNM_SC (scg);
        gboolean const shift    = 0 != (ev->state & GDK_SHIFT_MASK);
        gboolean const control  = 0 != (ev->state & GDK_CONTROL_MASK);
        gboolean const alt      = 0 != (ev->state & GDK_MOD1_MASK);
@@ -1228,7 +1228,7 @@ gnm_pane_new (SheetControlGUI *scg,
        GnmPane *pane;
        Sheet   *sheet;
 
-       g_return_val_if_fail (IS_SHEET_CONTROL_GUI (scg), NULL);
+       g_return_val_if_fail (GNM_IS_SCG (scg), NULL);
 
        pane = g_object_new (GNM_PANE_TYPE, NULL);
        pane->index      = index;
@@ -1474,7 +1474,7 @@ gnm_pane_compute_visible_region (GnmPane *pane,
 
        /* Update the scrollbar sizes for the primary pane */
        if (pane->index == 0)
-               sc_scrollbar_config (SHEET_CONTROL (scg));
+               sc_scrollbar_config (GNM_SC (scg));
 
        /* Force the cursor to update its bounds relative to the new visible region */
        gnm_pane_reposition_cursors (pane);
@@ -2550,7 +2550,7 @@ gnm_pane_drag_begin (GnmPane *pane, SheetObject *so, GdkEvent *event)
                                  G_N_ELEMENTS (drag_types_out));
        objects = go_hash_keys (scg->selected_objects);
        for (ptr = objects; ptr != NULL; ptr = ptr->next) {
-               candidate = SHEET_OBJECT (ptr->data);
+               candidate = GNM_SO (ptr->data);
 
                if (exportable == NULL &&
                    GNM_IS_SO_EXPORTABLE (candidate))
@@ -2748,7 +2748,7 @@ control_point_button2_pressed (GocItem *item, int button, G_GNUC_UNUSED double x
 
        so  = g_object_get_data (G_OBJECT (item), "so");
        if (pane->drag.button == 1)
-               sheet_object_get_editor (so, SHEET_CONTROL (scg));
+               sheet_object_get_editor (so, GNM_SC (scg));
        return TRUE;
 }
 
diff --git a/src/gnm-sheet-slicer.c b/src/gnm-sheet-slicer.c
index 628792b..4212704 100644
--- a/src/gnm-sheet-slicer.c
+++ b/src/gnm-sheet-slicer.c
@@ -53,7 +53,7 @@ struct _GnmSheetSlicer {
 typedef GODataSlicerClass GnmSheetSlicerClass;
 
 #define GNM_SHEET_SLICER_CLASS(k)      (G_TYPE_CHECK_CLASS_CAST ((k), GNM_SHEET_SLICER_TYPE, 
GnmSheetSlicerClass))
-#define IS_GNM_SHEET_SLICER_CLASS(k)   (G_TYPE_CHECK_CLASS_TYPE ((k), GNM_SHEET_SLICER_TYPE))
+#define GNM_IS_SHEET_SLICER_CLASS(k)   (G_TYPE_CHECK_CLASS_TYPE ((k), GNM_SHEET_SLICER_TYPE))
 #define GNM_SHEET_SLICER_GET_CLASS(o)  (G_TYPE_INSTANCE_GET_CLASS ((o), GNM_SHEET_SLICER_TYPE, 
GnmSheetSlicerClass))
 
 enum {
diff --git a/src/gnm-so-filled.c b/src/gnm-so-filled.c
index 9d7870a..d18894b 100644
--- a/src/gnm-so-filled.c
+++ b/src/gnm-so-filled.c
@@ -171,7 +171,7 @@ sof_default_style (void)
 static void
 gnm_so_filled_user_config (SheetObject *so, SheetControl *sc)
 {
-       dialog_so_styled (scg_wbcg (SHEET_CONTROL_GUI (sc)), G_OBJECT (so),
+       dialog_so_styled (scg_wbcg (GNM_SCG (sc)), G_OBJECT (so),
                          sof_default_style (),
                          _("Filled Object Properties"),
                          SO_STYLED_TEXT);
@@ -473,7 +473,7 @@ gnm_so_filled_get_property (GObject *obj, guint param_id,
                g_value_set_boxed (value, sof->markup);
                break;
        case SOF_PROP_DOCUMENT:
-               g_value_set_object (value, sheet_object_get_sheet (SHEET_OBJECT (obj))->workbook);
+               g_value_set_object (value, sheet_object_get_sheet (GNM_SO (obj))->workbook);
                break;
        default :
                G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, param_id, pspec);
@@ -547,7 +547,7 @@ gnm_so_filled_init (GObject *obj)
        sof->markup = NULL;
        sof->margin_pts.top  = sof->margin_pts.bottom = 3;
        sof->margin_pts.left = sof->margin_pts.right  = 5;
-       SHEET_OBJECT (obj)->anchor.base.direction = GOD_ANCHOR_DIR_NONE_MASK;
+       GNM_SO (obj)->anchor.base.direction = GOD_ANCHOR_DIR_NONE_MASK;
 }
 
 GSF_CLASS (GnmSOFilled, gnm_so_filled,
diff --git a/src/gnm-so-line.c b/src/gnm-so-line.c
index f5deb28..0cf88fb 100644
--- a/src/gnm-so-line.c
+++ b/src/gnm-so-line.c
@@ -119,7 +119,7 @@ sol_default_style (void)
 static void
 gnm_so_line_user_config (SheetObject *so, SheetControl *sc)
 {
-       dialog_so_styled (scg_wbcg (SHEET_CONTROL_GUI (sc)), G_OBJECT (so),
+       dialog_so_styled (scg_wbcg (GNM_SCG (sc)), G_OBJECT (so),
                          sol_default_style (),
                          _("Line/Arrow Properties"), SO_STYLED_LINE);
 }
@@ -448,7 +448,7 @@ gnm_so_line_init (GObject *obj)
        sol->style = sol_default_style ();
        go_arrow_clear (&sol->start_arrow);
        go_arrow_clear (&sol->end_arrow);
-       SHEET_OBJECT (obj)->anchor.base.direction = GOD_ANCHOR_DIR_NONE_MASK;
+       GNM_SO (obj)->anchor.base.direction = GOD_ANCHOR_DIR_NONE_MASK;
 }
 
 GSF_CLASS (GnmSOLine, gnm_so_line,
diff --git a/src/gnm-so-path.c b/src/gnm-so-path.c
index cbc2c34..164e02e 100644
--- a/src/gnm-so-path.c
+++ b/src/gnm-so-path.c
@@ -195,7 +195,7 @@ static void
 gnm_so_path_user_config (SheetObject *so, SheetControl *sc)
 {
        GnmSOPath *sop = GNM_SO_PATH (so);
-       dialog_so_styled (scg_wbcg (SHEET_CONTROL_GUI (sc)), G_OBJECT (sop),
+       dialog_so_styled (scg_wbcg (GNM_SCG (sc)), G_OBJECT (sop),
                          sop_default_style (),
                          _("Filled Object Properties"),
                          SO_STYLED_TEXT);
diff --git a/src/gnm-so-polygon.c b/src/gnm-so-polygon.c
index 4aa375a..5149547 100644
--- a/src/gnm-so-polygon.c
+++ b/src/gnm-so-polygon.c
@@ -164,7 +164,7 @@ gnm_so_polygon_new_view (SheetObject *so, SheetObjectViewContainer *container)
 static void
 gnm_so_polygon_user_config (SheetObject *so, SheetControl *sc)
 {
-       dialog_so_styled (scg_wbcg (SHEET_CONTROL_GUI (sc)), G_OBJECT (so),
+       dialog_so_styled (scg_wbcg (GNM_SCG (sc)), G_OBJECT (so),
                          sop_default_style (),
                          _("Polygon Properties"), SO_STYLED_STYLE_ONLY);
 }
@@ -258,7 +258,7 @@ gnm_so_polygon_get_property (GObject *obj, guint param_id,
                g_value_set_pointer (value, sop->points);
                break;
        case SOP_PROP_DOCUMENT:
-               g_value_set_object (value, sheet_object_get_sheet (SHEET_OBJECT (obj))->workbook);
+               g_value_set_object (value, sheet_object_get_sheet (GNM_SO (obj))->workbook);
                break;
        default :
                G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, param_id, pspec);
diff --git a/src/graph.c b/src/graph.c
index 0624ed8..a9bf992 100644
--- a/src/graph.c
+++ b/src/graph.c
@@ -1455,7 +1455,7 @@ gnm_go_data_matrix_new_expr (Sheet *sheet, GnmExprTop const *texpr)
 static GnmDependent *
 gnm_go_data_get_dep (GOData const *dat)
 {
-       if (IS_GNM_GO_DATA_SCALAR (dat))
+       if (GNM_IS_GO_DATA_SCALAR (dat))
                return &((GnmGODataScalar *)dat)->dep;
        if (GNM_IS_GO_DATA_VECTOR (dat))
                return &((GnmGODataVector *)dat)->dep;
diff --git a/src/graph.h b/src/graph.h
index 7b2b6b8..35e47f4 100644
--- a/src/graph.h
+++ b/src/graph.h
@@ -17,7 +17,7 @@ void   gnm_go_data_foreach_dep (GOData *dat, SheetObject *so,
 
 #define GNM_GO_DATA_SCALAR_TYPE         (gnm_go_data_scalar_get_type ())
 #define GNM_GO_DATA_SCALAR(o)   (G_TYPE_CHECK_INSTANCE_CAST ((o), GNM_GO_DATA_SCALAR_TYPE, GnmGODataScalar))
-#define IS_GNM_GO_DATA_SCALAR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNM_GO_DATA_SCALAR_TYPE))
+#define GNM_IS_GO_DATA_SCALAR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNM_GO_DATA_SCALAR_TYPE))
 
 typedef struct _GnmGODataScalar GnmGODataScalar;
 GType   gnm_go_data_scalar_get_type  (void);
diff --git a/src/gui-clipboard.c b/src/gui-clipboard.c
index 065d0ba..458ad0c 100644
--- a/src/gui-clipboard.c
+++ b/src/gui-clipboard.c
@@ -753,14 +753,14 @@ image_write (GnmCellRegion *cr, gchar const *mime_type, int *size)
        *size = -1;
 
        g_return_val_if_fail (cr->objects != NULL, NULL);
-       so = SHEET_OBJECT (cr->objects->data);
+       so = GNM_SO (cr->objects->data);
        g_return_val_if_fail (so != NULL, NULL);
 
        if (strncmp (mime_type, "image/", 6) != 0)
                return ret;
        for (l = cr->objects; l != NULL; l = l->next) {
-               if (GNM_IS_SO_IMAGEABLE (SHEET_OBJECT (l->data))) {
-                       so = SHEET_OBJECT (l->data);
+               if (GNM_IS_SO_IMAGEABLE (GNM_SO (l->data))) {
+                       so = GNM_SO (l->data);
                        break;
                }
        }
@@ -807,12 +807,12 @@ object_write (GnmCellRegion *cr, gchar const *mime_type, int *size)
        *size = -1;
 
        g_return_val_if_fail (cr->objects != NULL, NULL);
-       so = SHEET_OBJECT (cr->objects->data);
+       so = GNM_SO (cr->objects->data);
        g_return_val_if_fail (so != NULL, NULL);
 
        for (l = cr->objects; l != NULL; l = l->next) {
-               if (GNM_IS_SO_EXPORTABLE (SHEET_OBJECT (l->data))) {
-                       so = SHEET_OBJECT (l->data);
+               if (GNM_IS_SO_EXPORTABLE (GNM_SO (l->data))) {
+                       so = GNM_SO (l->data);
                        break;
                }
        }
@@ -1099,7 +1099,7 @@ gnm_x_claim_clipboard (GdkDisplay *display)
                GSList *ptr;
                for (ptr = content->objects; ptr != NULL;
                     ptr = ptr->next) {
-                       SheetObject *candidate = SHEET_OBJECT (ptr->data);
+                       SheetObject *candidate = GNM_SO (ptr->data);
                        if (exportable == NULL && GNM_IS_SO_EXPORTABLE (candidate))
                                exportable = candidate;
                        if (imageable == NULL && GNM_IS_SO_IMAGEABLE (candidate))
@@ -1188,7 +1188,7 @@ gnm_x_store_clipboard_if_needed (Workbook *wb)
        Sheet *sheet = gnm_app_clipboard_sheet_get ();
        WBCGtk *wbcg = NULL;
 
-       g_return_if_fail (IS_WORKBOOK (wb));
+       g_return_if_fail (GNM_IS_WORKBOOK (wb));
 
        if (sheet && sheet->workbook == wb) {
                WORKBOOK_FOREACH_CONTROL (wb, view, control, {
diff --git a/src/gui-util.c b/src/gui-util.c
index 4c08cea..2fa266c 100644
--- a/src/gui-util.c
+++ b/src/gui-util.c
@@ -396,7 +396,7 @@ gnumeric_editable_enters (GtkWindow *window, GtkWidget *w)
        g_return_if_fail (GTK_IS_WINDOW(window));
 
        /* because I really do not feel like changing all the calls to this routine */
-       if (IS_GNM_EXPR_ENTRY (w))
+       if (GNM_EXPR_ENTRY_IS (w))
                w = GTK_WIDGET (gnm_expr_entry_get_entry (GNM_EXPR_ENTRY (w)));
 
        g_signal_connect_swapped (G_OBJECT (w),
diff --git a/src/item-cursor.c b/src/item-cursor.c
index bc5153e..8ec4e9c 100644
--- a/src/item-cursor.c
+++ b/src/item-cursor.c
@@ -1474,7 +1474,7 @@ gnm_item_cursor_class_init (GObjectClass *gobject_klass)
                g_param_spec_object ("SheetControlGUI",
                                     P_("SheetControlGUI"),
                                     P_("The sheet control gui controlling the item"),
-                                    SHEET_CONTROL_GUI_TYPE,
+                                    GNM_SCG_TYPE,
                                     GSF_PARAM_STATIC | G_PARAM_WRITABLE));
        g_object_class_install_property (gobject_klass, ITEM_CURSOR_PROP_STYLE,
                g_param_spec_int ("style",
diff --git a/src/item-edit.c b/src/item-edit.c
index fe006c2..89fa326 100644
--- a/src/item-edit.c
+++ b/src/item-edit.c
@@ -707,7 +707,7 @@ item_edit_set_property (GObject *gobject, guint param_id,
                /* We can only set the sheet-control-gui once */
                g_return_if_fail (ie->scg == NULL);
 
-               ie->scg = SHEET_CONTROL_GUI (g_value_get_object (value));
+               ie->scg = GNM_SCG (g_value_get_object (value));
                ie->pos = scg_view (ie->scg)->edit_pos;
                ie->entry = wbcg_get_entry (scg_wbcg (ie->scg));
                break;
@@ -731,7 +731,7 @@ gnm_item_edit_class_init (GObjectClass *gobject_class)
                g_param_spec_object ("SheetControlGUI",
                                     P_("SheetControlGUI"),
                                     P_("The sheet control gui controlling the item"),
-                                    SHEET_CONTROL_GUI_TYPE,
+                                    GNM_SCG_TYPE,
                                     /* resist the urge to use G_PARAM_CONSTRUCT_ONLY
                                      * We are going through goc_item_new, which
                                      * calls g_object_new assigns the parent pointer before
diff --git a/src/item-grid.c b/src/item-grid.c
index e00bdbe..90da14f 100644
--- a/src/item-grid.c
+++ b/src/item-grid.c
@@ -1269,7 +1269,7 @@ gnm_item_grid_class_init (GObjectClass *gobject_klass)
                g_param_spec_object ("SheetControlGUI",
                                     P_("SheetControlGUI"),
                                     P_("The sheet control gui controlling the item"),
-                                    SHEET_CONTROL_GUI_TYPE,
+                                    GNM_SCG_TYPE,
                                     GSF_PARAM_STATIC | G_PARAM_WRITABLE));
        g_object_class_install_property (gobject_klass, GNM_ITEM_GRID_PROP_BOUND,
                g_param_spec_pointer ("bound",
diff --git a/src/position.c b/src/position.c
index b02096d..49bae6f 100644
--- a/src/position.c
+++ b/src/position.c
@@ -159,7 +159,7 @@ GnmEvalPos *
 eval_pos_init_editpos (GnmEvalPos *ep, SheetView const *sv)
 {
        g_return_val_if_fail (ep != NULL, NULL);
-       g_return_val_if_fail (IS_SHEET_VIEW (sv), NULL);
+       g_return_val_if_fail (GNM_IS_SV (sv), NULL);
 
        return eval_pos_init (ep, sv_sheet (sv),
                sv->edit_pos.col, sv->edit_pos.row);
@@ -326,7 +326,7 @@ parse_pos_init_evalpos (GnmParsePos *pp, GnmEvalPos const *ep)
 GnmParsePos *
 parse_pos_init_editpos (GnmParsePos *pp, SheetView const *sv)
 {
-       g_return_val_if_fail (IS_SHEET_VIEW (sv), NULL);
+       g_return_val_if_fail (GNM_IS_SV (sv), NULL);
 
        return parse_pos_init (pp, NULL, sv_sheet (sv),
                sv->edit_pos.col, sv->edit_pos.row);
diff --git a/src/print-info.c b/src/print-info.c
index 43dec58..4913d6f 100644
--- a/src/print-info.c
+++ b/src/print-info.c
@@ -856,7 +856,7 @@ static void
 pdf_export (GOFileSaver const *fs, GOIOContext *context,
                    GoView const *view, GsfOutput *output)
 {
-       WorkbookView const *wbv = WORKBOOK_VIEW (view);
+       WorkbookView const *wbv = GNM_WORKBOOK_VIEW (view);
        Workbook const *wb = wb_view_get_workbook (wbv);
        GPtrArray *objects = g_object_get_data (G_OBJECT (wb), "pdf-objects");
 
diff --git a/src/print.c b/src/print.c
index 5818e80..3bca23c 100644
--- a/src/print.c
+++ b/src/print.c
@@ -210,7 +210,7 @@ gnm_print_sheet_objects (cairo_t *cr,
        objects = g_slist_reverse (g_slist_copy (sheet->sheet_objects));
 
        for (ptr = objects; ptr; ptr = ptr->next) {
-               SheetObject *so = SHEET_OBJECT (ptr->data);
+               SheetObject *so = GNM_SO (ptr->data);
                GnmRange const *r = &so->anchor.cell_bound;
 
                if (!sheet_object_can_print (so) ||
diff --git a/src/selection.c b/src/selection.c
index 3d5a551..e86a3b4 100644
--- a/src/selection.c
+++ b/src/selection.c
@@ -191,7 +191,7 @@ sv_is_colrow_selected (SheetView const *sv, int colrow, gboolean is_col)
 {
        GSList *l;
 
-       g_return_val_if_fail (IS_SHEET_VIEW (sv), FALSE);
+       g_return_val_if_fail (GNM_IS_SV (sv), FALSE);
 
        for (l = sv_selection_calc_simplification (sv);
             l != NULL; l = l->next) {
@@ -227,7 +227,7 @@ sv_is_full_colrow_selected (SheetView const *sv, gboolean is_cols, int index)
        GSList *l;
        gboolean found = FALSE;
 
-       g_return_val_if_fail (IS_SHEET_VIEW (sv), FALSE);
+       g_return_val_if_fail (GNM_IS_SV (sv), FALSE);
 
        for (l = sv_selection_calc_simplification (sv);
             l != NULL; l = l->next){
@@ -262,7 +262,7 @@ sv_selection_col_type (SheetView const *sv, int col)
        GnmRange const *sr;
        int ret = COL_ROW_NO_SELECTION;
 
-       g_return_val_if_fail (IS_SHEET_VIEW (sv), COL_ROW_NO_SELECTION);
+       g_return_val_if_fail (GNM_IS_SV (sv), COL_ROW_NO_SELECTION);
 
        if (sv->selections == NULL)
                return COL_ROW_NO_SELECTION;
@@ -298,7 +298,7 @@ sv_selection_row_type (SheetView const *sv, int row)
        GnmRange const *sr;
        int ret = COL_ROW_NO_SELECTION;
 
-       g_return_val_if_fail (IS_SHEET_VIEW (sv), COL_ROW_NO_SELECTION);
+       g_return_val_if_fail (GNM_IS_SV (sv), COL_ROW_NO_SELECTION);
 
        if (sv->selections == NULL)
                return COL_ROW_NO_SELECTION;
@@ -364,7 +364,7 @@ sv_menu_enable_insert (SheetView *sv, gboolean col, gboolean row)
 {
        int flags = 0;
 
-       g_return_if_fail (IS_SHEET_VIEW (sv));
+       g_return_if_fail (GNM_IS_SV (sv));
 
        if (sv->enable_insert_cols != col) {
                flags |= MS_INSERT_COLS;
@@ -403,7 +403,7 @@ selection_first_range (SheetView const *sv,
        GnmRange const *r;
        GSList *l;
 
-       g_return_val_if_fail (IS_SHEET_VIEW (sv), NULL);
+       g_return_val_if_fail (GNM_IS_SV (sv), NULL);
 
        l = sv->selections;
 
@@ -636,7 +636,7 @@ sv_selection_set (SheetView *sv, GnmCellPos const *edit,
                  int base_col, int base_row,
                  int move_col, int move_row)
 {
-       g_return_if_fail (IS_SHEET_VIEW (sv));
+       g_return_if_fail (GNM_IS_SV (sv));
 
        sheet_selection_set_internal (sv, edit,
                base_col, base_row,
@@ -688,7 +688,7 @@ sv_selection_add_full (SheetView *sv,
        GnmRange *ss;
        GnmCellPos edit;
 
-       g_return_if_fail (IS_SHEET_VIEW (sv));
+       g_return_if_fail (GNM_IS_SV (sv));
        sv_selection_simplify (sv);
 
        /* Create and prepend new selection */
@@ -761,7 +761,7 @@ sv_selection_reset (SheetView *sv)
 {
        GSList *list, *tmp;
 
-       g_return_if_fail (IS_SHEET_VIEW (sv));
+       g_return_if_fail (GNM_IS_SV (sv));
 
        /* Empty the sheets selection */
        list = sv->selections;
@@ -1094,7 +1094,7 @@ sv_selection_apply (SheetView *sv, SelectionApplyFunc const func,
        GSList *l;
        GSList *proposed = NULL;
 
-       g_return_if_fail (IS_SHEET_VIEW (sv));
+       g_return_if_fail (GNM_IS_SV (sv));
 
        if (allow_intersection) {
                for (l = sv_selection_calc_simplification (sv);
@@ -1154,7 +1154,7 @@ sv_selection_apply_in_order (SheetView *sv, SelectionApplyFunc const func,
 {
        GSList *l, *reverse;
 
-       g_return_if_fail (IS_SHEET_VIEW (sv));
+       g_return_if_fail (GNM_IS_SV (sv));
 
        reverse = g_slist_copy (sv_selection_calc_simplification (sv));
        reverse = g_slist_reverse (reverse);
@@ -1202,7 +1202,7 @@ sv_selection_foreach (SheetView *sv,
 {
        GSList *l;
 
-       g_return_val_if_fail (IS_SHEET_VIEW (sv), FALSE);
+       g_return_val_if_fail (GNM_IS_SV (sv), FALSE);
 
        for (l = sv_selection_calc_simplification (sv); l != NULL; l = l->next) {
                GnmRange *ss = l->data;
@@ -1339,7 +1339,7 @@ sv_selection_walk_step (SheetView *sv, gboolean forward, gboolean horizontal)
        gboolean is_singleton = FALSE;
        GSList *selections;
 
-       g_return_if_fail (IS_SHEET_VIEW (sv));
+       g_return_if_fail (GNM_IS_SV (sv));
        g_return_if_fail (sv->selections != NULL);
 
        selections = sv_selection_calc_simplification (sv);
diff --git a/src/sheet-control-gui.c b/src/sheet-control-gui.c
index 42ff337..97e8a56 100644
--- a/src/sheet-control-gui.c
+++ b/src/sheet-control-gui.c
@@ -94,7 +94,7 @@ GnmPane *
 scg_pane (SheetControlGUI *scg, int p)
 {
        /* it is ok to request a pane when we are not frozen */
-       g_return_val_if_fail (IS_SHEET_CONTROL_GUI (scg), NULL);
+       g_return_val_if_fail (GNM_IS_SCG (scg), NULL);
        g_return_val_if_fail (p >= 0, NULL);
        g_return_val_if_fail (p < 4, NULL);
 
@@ -110,7 +110,7 @@ scg_pane (SheetControlGUI *scg, int p)
 SheetView *
 scg_view (SheetControlGUI const *scg)
 {
-       g_return_val_if_fail (IS_SHEET_CONTROL_GUI (scg), NULL);
+       g_return_val_if_fail (GNM_IS_SCG (scg), NULL);
        return scg->sheet_control.view;
 }
 
@@ -137,7 +137,7 @@ scg_sheet (SheetControlGUI const *scg)
 WorkbookControl *
 scg_wbc (SheetControlGUI const *scg)
 {
-       g_return_val_if_fail (IS_SHEET_CONTROL_GUI (scg), NULL);
+       g_return_val_if_fail (GNM_IS_SCG (scg), NULL);
        return scg->sheet_control.wbc;
 }
 
@@ -152,7 +152,7 @@ scg_wbc (SheetControlGUI const *scg)
 WBCGtk *
 scg_wbcg (SheetControlGUI const *scg)
 {
-       g_return_val_if_fail (IS_SHEET_CONTROL_GUI (scg), NULL);
+       g_return_val_if_fail (GNM_IS_SCG (scg), NULL);
        return scg->wbcg;
 }
 
@@ -161,7 +161,7 @@ scg_redraw_all (SheetControl *sc, gboolean headers)
 {
        SheetControlGUI *scg = (SheetControlGUI *)sc;
 
-       g_return_if_fail (IS_SHEET_CONTROL_GUI (scg));
+       g_return_if_fail (GNM_IS_SCG (scg));
 
        SCG_FOREACH_PANE (scg, pane, {
                goc_canvas_invalidate (GOC_CANVAS (pane),
@@ -463,7 +463,7 @@ scg_resize_virt (SheetControl *sc, gboolean force_scroll)
 static void
 scg_scrollbar_config (SheetControl const *sc)
 {
-       SheetControlGUI *scg = SHEET_CONTROL_GUI (sc);
+       SheetControlGUI *scg = GNM_SCG (sc);
        GtkAdjustment *va = scg->va;
        GtkAdjustment *ha = scg->ha;
        GnmPane *pane = scg_pane (scg, 0);
@@ -782,7 +782,7 @@ scg_set_left_col (SheetControlGUI *scg, int col)
        Sheet const *sheet;
        GnmRange const *bound;
 
-       g_return_if_fail (IS_SHEET_CONTROL_GUI (scg));
+       g_return_if_fail (GNM_IS_SCG (scg));
 
        sheet = scg_sheet (scg);
        bound = &sheet->priv->unhidden_region;
@@ -845,7 +845,7 @@ scg_set_top_row (SheetControlGUI *scg, int row)
        Sheet const *sheet;
        GnmRange const *bound;
 
-       g_return_if_fail (IS_SHEET_CONTROL_GUI (scg));
+       g_return_if_fail (GNM_IS_SCG (scg));
 
        sheet = scg_sheet (scg);
        bound = &sheet->priv->unhidden_region;
@@ -917,7 +917,7 @@ scg_set_top_left (SheetControl *sc, int col, int row)
 {
        SheetControlGUI *scg = (SheetControlGUI *)sc;
 
-       g_return_if_fail (IS_SHEET_CONTROL_GUI (scg));
+       g_return_if_fail (GNM_IS_SCG (scg));
 
        if (!scg->pane[0])
                return;
@@ -1033,7 +1033,7 @@ scg_make_cell_visible (SheetControlGUI *scg, int col, int row,
        SheetView const *sv = scg_view (scg);
        GnmCellPos const *tl, *br;
 
-       g_return_if_fail (IS_SHEET_CONTROL_GUI (scg));
+       g_return_if_fail (GNM_IS_SCG (scg));
 
        if (!scg->active_panes)
                return;
@@ -1113,7 +1113,7 @@ scg_set_panes (SheetControl *sc)
        gboolean const being_frozen = sv_is_frozen (sv);
        GocDirection direction = (sv_sheet (sv)->text_is_rtl)? GOC_DIRECTION_RTL: GOC_DIRECTION_LTR;
 
-       g_return_if_fail (IS_SHEET_VIEW (sv));
+       g_return_if_fail (GNM_IS_SV (sv));
 
        if (!scg->pane[0])
                return;
@@ -1496,7 +1496,7 @@ cb_canvas_resize (GtkWidget *w, G_GNUC_UNUSED GtkAllocation *allocation,
 static gboolean
 post_create_cb (SheetControlGUI *scg)
 {
-       Sheet *sheet = sc_sheet (SHEET_CONTROL (scg));
+       Sheet *sheet = sc_sheet (GNM_SC (scg));
        if (sheet->sheet_objects)
                scg_object_select (scg, (SheetObject *) sheet->sheet_objects->data);
        return FALSE;
@@ -1557,12 +1557,12 @@ sheet_control_gui_new (SheetView *sv, WBCGtk *wbcg)
        GocDirection direction;
        GdkRGBA cfore, cback;
 
-       g_return_val_if_fail (IS_SHEET_VIEW (sv), NULL);
+       g_return_val_if_fail (GNM_IS_SV (sv), NULL);
 
        sheet = sv_sheet (sv);
        direction = (sheet->text_is_rtl)? GOC_DIRECTION_RTL: GOC_DIRECTION_LTR;
 
-       scg = g_object_new (SHEET_CONTROL_GUI_TYPE, NULL);
+       scg = g_object_new (GNM_SCG_TYPE, NULL);
        scg->wbcg = wbcg;
        scg->sheet_control.wbc = GNM_WBC (wbcg);
 
@@ -1685,7 +1685,7 @@ sheet_control_gui_new (SheetView *sv, WBCGtk *wbcg)
                        G_CALLBACK (cb_table_destroy), G_OBJECT (scg),
                        G_CONNECT_SWAPPED);
 
-               sv_attach_control (sv, SHEET_CONTROL (scg));
+               sv_attach_control (sv, GNM_SC (scg));
 
                g_object_connect (G_OBJECT (sheet),
                         "swapped_signal::notify::text-is-rtl", cb_scg_direction_changed, scg,
@@ -1720,7 +1720,7 @@ sheet_control_gui_new (SheetView *sv, WBCGtk *wbcg)
                        g_signal_connect (G_OBJECT (scg->vs), "key-press-event",
                                          G_CALLBACK (sheet_object_key_pressed), scg);
                }
-               sv_attach_control (sv, SHEET_CONTROL (scg));
+               sv_attach_control (sv, GNM_SC (scg));
                if (scg->vs) {
                        g_object_set_data (G_OBJECT (scg->vs), "sheet-control", scg);
                        if (sheet->sheet_objects) {
@@ -1776,7 +1776,7 @@ scg_im_destroy (SheetControlGUI *scg) {
 static void
 scg_finalize (GObject *object)
 {
-       SheetControlGUI *scg = SHEET_CONTROL_GUI (object);
+       SheetControlGUI *scg = GNM_SCG (object);
        SheetControl    *sc = (SheetControl *) scg;
        Sheet           *sheet = scg_sheet (scg);
        GSList *ptr;
@@ -1841,7 +1841,7 @@ scg_unant (SheetControl *sc)
 {
        SheetControlGUI *scg = (SheetControlGUI *)sc;
 
-       g_return_if_fail (IS_SHEET_CONTROL_GUI (scg));
+       g_return_if_fail (GNM_IS_SCG (scg));
 
        /* Always have a pane 0 */
        if (scg->active_panes == 0  || scg->pane[0]->cursor.animated == NULL)
@@ -1866,7 +1866,7 @@ scg_ant (SheetControl *sc)
        SheetControlGUI *scg = (SheetControlGUI *)sc;
        GList *l;
 
-       g_return_if_fail (IS_SHEET_CONTROL_GUI (scg));
+       g_return_if_fail (GNM_IS_SCG (scg));
 
        if (scg->active_panes == 0)
                return;
@@ -2361,7 +2361,7 @@ scg_context_menu (SheetControlGUI *scg, GdkEvent *event,
                n_links += g_slist_length (styles);
                style_list_free (styles);
 
-               objs = sheet_objects_get (sheet, r, CELL_COMMENT_TYPE);
+               objs = sheet_objects_get (sheet, r, GNM_CELL_COMMENT_TYPE);
                n_comments += g_slist_length (objs);
                g_slist_free (objs);
        }
@@ -2497,7 +2497,7 @@ void
 scg_mode_edit (SheetControlGUI *scg)
 {
        WBCGtk *wbcg;
-       g_return_if_fail (IS_SHEET_CONTROL_GUI (scg));
+       g_return_if_fail (GNM_IS_SCG (scg));
 
        wbcg = scg->wbcg;
 
@@ -2575,7 +2575,7 @@ scg_object_select (SheetControlGUI *scg, SheetObject *so)
                wbcg_insert_object_clear (scg->wbcg);
                scg_cursor_visible (scg, FALSE);
                scg_set_display_cursor (scg);
-               scg_unant (SHEET_CONTROL (scg));
+               scg_unant (GNM_SC (scg));
 
                scg->selected_objects = g_hash_table_new_full (
                        g_direct_hash, g_direct_equal,
@@ -2963,7 +2963,7 @@ scg_object_coords_to_anchor (SheetControlGUI const *scg,
        /* pane 0 always exists and the others are always use the same basis */
        GnmPane *pane = scg_pane ((SheetControlGUI *)scg, 0);
        double  tmp[4];
-       g_return_if_fail (IS_SHEET_CONTROL_GUI (scg));
+       g_return_if_fail (GNM_IS_SCG (scg));
        g_return_if_fail (coords != NULL);
 
        in_out->base.direction = GOD_ANCHOR_DIR_NONE_MASK;
@@ -3011,7 +3011,7 @@ scg_object_anchor_to_coords (SheetControlGUI const *scg,
        gint64 pixels[4];
        GnmRange const *r;
 
-       g_return_if_fail (IS_SHEET_CONTROL_GUI (scg));
+       g_return_if_fail (GNM_IS_SCG (scg));
        g_return_if_fail (anchor != NULL);
        g_return_if_fail (coords != NULL);
 
@@ -3063,7 +3063,7 @@ void
 scg_comment_display (SheetControlGUI *scg, GnmComment *cc,
                     int x, int y)
 {
-       g_return_if_fail (IS_SHEET_CONTROL_GUI (scg));
+       g_return_if_fail (GNM_IS_SCG (scg));
 
        scg_comment_timer_clear (scg);
 
@@ -3154,7 +3154,7 @@ scg_comment_display (SheetControlGUI *scg, GnmComment *cc,
 static gint
 cb_cell_comment_timer (SheetControlGUI *scg)
 {
-       g_return_val_if_fail (IS_SHEET_CONTROL_GUI (scg), FALSE);
+       g_return_val_if_fail (GNM_IS_SCG (scg), FALSE);
        g_return_val_if_fail (scg->comment.timer != 0, FALSE);
 
        scg->comment.timer = 0;
@@ -3173,7 +3173,7 @@ cb_cell_comment_timer (SheetControlGUI *scg)
 void
 scg_comment_select (SheetControlGUI *scg, GnmComment *cc, int x, int y)
 {
-       g_return_if_fail (IS_SHEET_CONTROL_GUI (scg));
+       g_return_if_fail (GNM_IS_SCG (scg));
 
        if (scg->comment.selected != NULL)
                scg_comment_unselect (scg, scg->comment.selected);
@@ -3198,7 +3198,7 @@ scg_comment_select (SheetControlGUI *scg, GnmComment *cc, int x, int y)
 void
 scg_comment_unselect (SheetControlGUI *scg, GnmComment *cc)
 {
-       g_return_if_fail (IS_SHEET_CONTROL_GUI (scg));
+       g_return_if_fail (GNM_IS_SCG (scg));
 
        if (cc == scg->comment.selected) {
                scg->comment.selected = NULL;
@@ -3225,7 +3225,7 @@ scg_colrow_distance_get (SheetControlGUI const *scg, gboolean is_cols,
        gint64 pixels = 0;
        int sign = 1;
 
-       g_return_val_if_fail (IS_SHEET_CONTROL_GUI (scg), 1);
+       g_return_val_if_fail (GNM_IS_SCG (scg), 1);
 
        if (from > to) {
                int const tmp = to;
@@ -3292,7 +3292,7 @@ scg_recompute_visible_region (SheetControl *sc, gboolean full_recompute)
 void
 scg_edit_start (SheetControlGUI *scg)
 {
-       g_return_if_fail (IS_SHEET_CONTROL_GUI (scg));
+       g_return_if_fail (GNM_IS_SCG (scg));
 
        SCG_FOREACH_PANE (scg, pane, gnm_pane_edit_start (pane););
 }
@@ -3300,7 +3300,7 @@ scg_edit_start (SheetControlGUI *scg)
 void
 scg_edit_stop (SheetControlGUI *scg)
 {
-       g_return_if_fail (IS_SHEET_CONTROL_GUI (scg));
+       g_return_if_fail (GNM_IS_SCG (scg));
 
        scg_rangesel_stop (scg, FALSE);
        SCG_FOREACH_PANE (scg, pane, gnm_pane_edit_stop (pane););
@@ -3322,7 +3322,7 @@ scg_rangesel_changed (SheetControlGUI *scg,
        GnmRange *r, last_r;
        Sheet *sheet;
 
-       g_return_if_fail (IS_SHEET_CONTROL_GUI (scg));
+       g_return_if_fail (GNM_IS_SCG (scg));
 
        scg->rangesel.base_corner.col = base_col;
        scg->rangesel.base_corner.row = base_row;
@@ -3377,7 +3377,7 @@ scg_rangesel_start (SheetControlGUI *scg,
 {
        GnmRange r;
 
-       g_return_if_fail (IS_SHEET_CONTROL_GUI (scg));
+       g_return_if_fail (GNM_IS_SCG (scg));
 
        if (scg->rangesel.active)
                return;
@@ -3398,7 +3398,7 @@ scg_rangesel_start (SheetControlGUI *scg,
 void
 scg_rangesel_stop (SheetControlGUI *scg, gboolean clear_string)
 {
-       g_return_if_fail (IS_SHEET_CONTROL_GUI (scg));
+       g_return_if_fail (GNM_IS_SCG (scg));
 
        if (!scg->rangesel.active)
                return;
@@ -3424,7 +3424,7 @@ scg_set_display_cursor (SheetControlGUI *scg)
 {
        GdkCursorType cursor = GDK_CURSOR_IS_PIXMAP;
 
-       g_return_if_fail (IS_SHEET_CONTROL_GUI (scg));
+       g_return_if_fail (GNM_IS_SCG (scg));
 
        if (scg->wbcg->new_object != NULL)
                cursor = GDK_CROSSHAIR;
@@ -3607,7 +3607,7 @@ scg_cursor_extend (SheetControlGUI *scg, int n,
 void
 scg_take_focus (SheetControlGUI *scg)
 {
-       g_return_if_fail (IS_SHEET_CONTROL_GUI (scg));
+       g_return_if_fail (GNM_IS_SCG (scg));
 
        /* FIXME: Slightly hackish. */
        if (wbcg_toplevel (scg->wbcg))
@@ -3621,21 +3621,21 @@ void
 scg_size_guide_start (SheetControlGUI *scg,
                      gboolean vert, int colrow, gboolean is_colrow_resize)
 {
-       g_return_if_fail (IS_SHEET_CONTROL_GUI (scg));
+       g_return_if_fail (GNM_IS_SCG (scg));
        SCG_FOREACH_PANE (scg, pane,
                          gnm_pane_size_guide_start (pane, vert, colrow, is_colrow_resize););
 }
 void
 scg_size_guide_motion (SheetControlGUI *scg, gboolean vert, gint64 guide_pos)
 {
-       g_return_if_fail (IS_SHEET_CONTROL_GUI (scg));
+       g_return_if_fail (GNM_IS_SCG (scg));
        SCG_FOREACH_PANE (scg, pane,
                gnm_pane_size_guide_motion (pane, vert, guide_pos););
 }
 void
 scg_size_guide_stop (SheetControlGUI *scg)
 {
-       g_return_if_fail (IS_SHEET_CONTROL_GUI (scg));
+       g_return_if_fail (GNM_IS_SCG (scg));
        SCG_FOREACH_PANE (scg, pane,
                gnm_pane_size_guide_stop (pane););
 }
@@ -3644,7 +3644,7 @@ scg_size_guide_stop (SheetControlGUI *scg)
 void
 scg_special_cursor_start (SheetControlGUI *scg, int style, int button)
 {
-       g_return_if_fail (IS_SHEET_CONTROL_GUI (scg));
+       g_return_if_fail (GNM_IS_SCG (scg));
 
        SCG_FOREACH_PANE (scg, pane,
                gnm_pane_special_cursor_start (pane, style, button););
@@ -3653,7 +3653,7 @@ scg_special_cursor_start (SheetControlGUI *scg, int style, int button)
 void
 scg_special_cursor_stop (SheetControlGUI *scg)
 {
-       g_return_if_fail (IS_SHEET_CONTROL_GUI (scg));
+       g_return_if_fail (GNM_IS_SCG (scg));
 
        SCG_FOREACH_PANE (scg, pane,
                gnm_pane_special_cursor_stop (pane););
@@ -3664,7 +3664,7 @@ scg_special_cursor_bound_set (SheetControlGUI *scg, GnmRange const *r)
 {
        gboolean changed = FALSE;
 
-       g_return_val_if_fail (IS_SHEET_CONTROL_GUI (scg), FALSE);
+       g_return_val_if_fail (GNM_IS_SCG (scg), FALSE);
 
        SCG_FOREACH_PANE (scg, pane,
                changed |= gnm_pane_special_cursor_bound_set (pane, r););
@@ -3674,7 +3674,7 @@ scg_special_cursor_bound_set (SheetControlGUI *scg, GnmRange const *r)
 static void
 scg_object_create_view (SheetControl *sc, SheetObject *so)
 {
-       SheetControlGUI *scg = SHEET_CONTROL_GUI (sc);
+       SheetControlGUI *scg = GNM_SCG (sc);
        if (scg->active_panes)
                SCG_FOREACH_PANE (scg, pane,
                        sheet_object_new_view (so, (SheetObjectViewContainer *)pane););
@@ -3690,7 +3690,7 @@ scg_scale_changed (SheetControl *sc)
        double z;
        GSList *ptr;
 
-       g_return_if_fail (IS_SHEET_CONTROL_GUI (scg));
+       g_return_if_fail (GNM_IS_SCG (scg));
 
        z = sheet->last_zoom_factor_used;
 
@@ -3707,13 +3707,13 @@ scg_scale_changed (SheetControl *sc)
        set_resize_pane_pos (scg, scg->hpane);
        /* now, update sheet objects positions and sizes */
        for (ptr = sheet->sheet_objects; ptr; ptr = ptr->next)
-               sheet_object_update_bounds (SHEET_OBJECT (ptr->data), NULL);
+               sheet_object_update_bounds (GNM_SO (ptr->data), NULL);
 }
 
 static gboolean
 cb_cell_im_timer (SheetControlGUI *scg)
 {
-       g_return_val_if_fail (IS_SHEET_CONTROL_GUI (scg), FALSE);
+       g_return_val_if_fail (GNM_IS_SCG (scg), FALSE);
        g_return_val_if_fail (scg->im.timer != 0, FALSE);
 
        scg->im.timer = 0;
@@ -3745,7 +3745,7 @@ scg_show_im_tooltip (SheetControl *sc, GnmInputMsg *im, GnmCellPos *pos)
        SheetControlGUI *scg = (SheetControlGUI *)sc;
        GnmPane *pane;
 
-       g_return_if_fail (IS_SHEET_CONTROL_GUI (scg));
+       g_return_if_fail (GNM_IS_SCG (scg));
 
        scg_im_destroy (scg);
 
@@ -3853,7 +3853,7 @@ scg_class_init (GObjectClass *object_class)
 }
 
 GSF_CLASS (SheetControlGUI, sheet_control_gui,
-          scg_class_init, scg_init, SHEET_CONTROL_TYPE)
+          scg_class_init, scg_init, GNM_SC_TYPE)
 
 static gint
 cb_scg_queued_movement (SheetControlGUI *scg)
@@ -3886,7 +3886,7 @@ scg_queue_movement (SheetControlGUI       *scg,
                    SCGUIMoveFunc        handler,
                    int n, gboolean jump, gboolean horiz)
 {
-       g_return_if_fail (IS_SHEET_CONTROL_GUI (scg));
+       g_return_if_fail (GNM_IS_SCG (scg));
 
        /* do we need to flush a pending movement */
        if (scg->delayedMovement.timer != 0) {
@@ -3938,10 +3938,10 @@ scg_image_create (SheetControlGUI *scg, SheetObjectAnchor *anchor,
        /* ensure that we are not editing anything else */
        scg_mode_edit (scg);
 
-       soi = g_object_new (SHEET_OBJECT_IMAGE_TYPE, NULL);
+       soi = g_object_new (GNM_SO_IMAGE_TYPE, NULL);
        sheet_object_image_set_image (soi, "", (guint8 *)data, len, TRUE);
 
-       so = SHEET_OBJECT (soi);
+       so = GNM_SO (soi);
        sheet_object_set_anchor (so, anchor);
        sheet_object_set_sheet (so, scg_sheet (scg));
        scg_object_select (scg, so);
@@ -4189,7 +4189,7 @@ scg_drag_receive_same_process (SheetControlGUI *scg, GtkWidget *source_widget,
                GnmCellRegion *content;
                GSList *objects;
 
-               g_return_if_fail (IS_SHEET_CONTROL_GUI (source_scg));
+               g_return_if_fail (GNM_IS_SCG (source_scg));
 
                objects = go_hash_keys (source_scg->selected_objects);
                content = clipboard_copy_obj (scg_sheet (source_scg),
@@ -4284,8 +4284,8 @@ scg_drag_send_image (G_GNUC_UNUSED SheetControlGUI *scg,
        GSList *ptr;
 
        for (ptr = objects; ptr != NULL; ptr = ptr->next) {
-               if (GNM_IS_SO_IMAGEABLE (SHEET_OBJECT (ptr->data))) {
-                       so = SHEET_OBJECT (ptr->data);
+               if (GNM_IS_SO_IMAGEABLE (GNM_SO (ptr->data))) {
+                       so = GNM_SO (ptr->data);
                        break;
                }
        }
@@ -4328,8 +4328,8 @@ scg_drag_send_graph (G_GNUC_UNUSED SheetControlGUI *scg,
        GSList *ptr;
 
        for (ptr = objects; ptr != NULL; ptr = ptr->next)
-               if (GNM_IS_SO_EXPORTABLE (SHEET_OBJECT (ptr->data))) {
-                       so = SHEET_OBJECT (ptr->data);
+               if (GNM_IS_SO_EXPORTABLE (GNM_SO (ptr->data))) {
+                       so = GNM_SO (ptr->data);
                        break;
                }
 
@@ -4408,7 +4408,7 @@ scg_drag_data_get (SheetControlGUI *scg, GtkSelectionData *selection_data)
                gtk_selection_data_set (selection_data, target,
                                        8, (void *)scg, sizeof (scg));
        else if (strcmp (target_name, "application/x-gnumeric") == 0)
-               scg_drag_send_clipboard_objects (SHEET_CONTROL (scg),
+               scg_drag_send_clipboard_objects (GNM_SC (scg),
                        selection_data, objects);
        else if (strcmp (target_name, "application/x-goffice-graph") == 0)
                scg_drag_send_graph (scg, selection_data, objects, target_name);
diff --git a/src/sheet-control-gui.h b/src/sheet-control-gui.h
index 19e8673..18b472a 100644
--- a/src/sheet-control-gui.h
+++ b/src/sheet-control-gui.h
@@ -8,10 +8,9 @@
 
 G_BEGIN_DECLS
 
-#define SHEET_CONTROL_GUI_TYPE        (sheet_control_gui_get_type ())
-#define SHEET_CONTROL_GUI(obj)        (G_TYPE_CHECK_INSTANCE_CAST((obj), SHEET_CONTROL_GUI_TYPE, 
SheetControlGUI))
-#define SHEET_CONTROL_GUI_CLASS(k)    (G_TYPE_CHECK_CLASS_CAST((k), SHEET_CONTROL_GUI_TYPE))
-#define IS_SHEET_CONTROL_GUI(o)       (G_TYPE_CHECK_INSTANCE_TYPE((o), SHEET_CONTROL_GUI_TYPE))
+#define GNM_SCG_TYPE        (sheet_control_gui_get_type ())
+#define GNM_SCG(obj)        (G_TYPE_CHECK_INSTANCE_CAST((obj), GNM_SCG_TYPE, SheetControlGUI))
+#define GNM_IS_SCG(o)       (G_TYPE_CHECK_INSTANCE_TYPE((o), GNM_SCG_TYPE))
 
 GType           sheet_control_gui_get_type (void);
 SheetControlGUI *sheet_control_gui_new     (SheetView *sv, WBCGtk *wbcg);
diff --git a/src/sheet-control-priv.h b/src/sheet-control-priv.h
index a127fba..b151256 100644
--- a/src/sheet-control-priv.h
+++ b/src/sheet-control-priv.h
@@ -39,7 +39,7 @@ typedef struct {
                                         GnmInputMsg *im, GnmCellPos *pos);
 } SheetControlClass;
 
-#define SHEET_CONTROL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), SHEET_CONTROL_TYPE, SheetControlClass))
+#define SHEET_CONTROL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GNM_SC_TYPE, SheetControlClass))
 
 G_END_DECLS
 
diff --git a/src/sheet-control.c b/src/sheet-control.c
index acb4695..fa69f8e 100644
--- a/src/sheet-control.c
+++ b/src/sheet-control.c
@@ -33,7 +33,7 @@ void sc_ ## func arglist                                      \
 {                                                              \
        SheetControlClass *sc_class;                            \
                                                                \
-       g_return_if_fail (IS_SHEET_CONTROL (sc));               \
+       g_return_if_fail (GNM_IS_SC (sc));              \
                                                                \
        sc_class = SC_CLASS (sc);                               \
        if (sc_class->handle != NULL)                           \
@@ -49,7 +49,7 @@ static void
 sc_finalize (GObject *obj)
 {
        /* Commented out until needed */
-       /* SheetControl *sc = SHEET_CONTROL (obj); */
+       /* SheetControl *sc = GNM_SC (obj); */
        parent_class->finalize (obj);
 }
 
@@ -72,7 +72,7 @@ GSF_CLASS (SheetControl, sheet_control,
 WorkbookControl *
 sc_wbc (SheetControl const *sc)
 {
-       g_return_val_if_fail (IS_SHEET_CONTROL (sc), NULL);
+       g_return_val_if_fail (GNM_IS_SC (sc), NULL);
        return sc->wbc;
 }
 
@@ -85,7 +85,7 @@ sc_wbc (SheetControl const *sc)
 Sheet *
 sc_sheet (SheetControl const *sc)
 {
-       g_return_val_if_fail (IS_SHEET_CONTROL (sc), NULL);
+       g_return_val_if_fail (GNM_IS_SC (sc), NULL);
        return sc->view ? sc->view->sheet : NULL;
 }
 
@@ -98,7 +98,7 @@ sc_sheet (SheetControl const *sc)
 SheetView *
 sc_view (SheetControl const *sc)
 {
-       g_return_val_if_fail (IS_SHEET_CONTROL (sc), NULL);
+       g_return_val_if_fail (GNM_IS_SC (sc), NULL);
        return sc->view;
 }
 
diff --git a/src/sheet-control.h b/src/sheet-control.h
index ed9e9c0..571d8cd 100644
--- a/src/sheet-control.h
+++ b/src/sheet-control.h
@@ -7,9 +7,9 @@
 
 G_BEGIN_DECLS
 
-#define SHEET_CONTROL_TYPE     (sheet_control_get_type ())
-#define SHEET_CONTROL(obj)     (G_TYPE_CHECK_INSTANCE_CAST ((obj), SHEET_CONTROL_TYPE, SheetControl))
-#define IS_SHEET_CONTROL(o)    (G_TYPE_CHECK_INSTANCE_TYPE ((o), SHEET_CONTROL_TYPE))
+#define GNM_SC_TYPE    (sheet_control_get_type ())
+#define GNM_SC(obj)    (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNM_SC_TYPE, SheetControl))
+#define GNM_IS_SC(o)   (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNM_SC_TYPE))
 
 /* Lifecycle */
 GType sheet_control_get_type   (void);
diff --git a/src/sheet-filter-combo.h b/src/sheet-filter-combo.h
index db14515..b578cf6 100644
--- a/src/sheet-filter-combo.h
+++ b/src/sheet-filter-combo.h
@@ -15,7 +15,7 @@ typedef struct {
 
 #define GNM_FILTER_COMBO_TYPE     (gnm_filter_combo_get_type ())
 #define GNM_FILTER_COMBO(obj)     (G_TYPE_CHECK_INSTANCE_CAST((obj), GNM_FILTER_COMBO_TYPE, GnmFilterCombo))
-#define IS_GNM_FILTER_COMBO(o)    (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNM_FILTER_COMBO_TYPE))
+#define GNM_IS_FILTER_COMBO(o)    (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNM_FILTER_COMBO_TYPE))
 
 GType gnm_filter_combo_get_type (void);
 void  gnm_filter_combo_apply    (GnmFilterCombo *fcombo, Sheet *target_sheet);
diff --git a/src/sheet-filter.c b/src/sheet-filter.c
index 3418884..056eebc 100644
--- a/src/sheet-filter.c
+++ b/src/sheet-filter.c
@@ -428,9 +428,9 @@ cb_hide_unwanted_percentage (GnmCellIter const *iter,
 int
 gnm_filter_combo_index (GnmFilterCombo *fcombo)
 {
-       g_return_val_if_fail (IS_GNM_FILTER_COMBO (fcombo), 0);
+       g_return_val_if_fail (GNM_IS_FILTER_COMBO (fcombo), 0);
 
-       return (sheet_object_get_range (SHEET_OBJECT (fcombo))->start.col -
+       return (sheet_object_get_range (GNM_SO (fcombo))->start.col -
                fcombo->filter->r.start.col);
 }
 
@@ -449,11 +449,11 @@ gnm_filter_combo_apply (GnmFilterCombo *fcombo, Sheet *target_sheet)
        int col, start_row, end_row;
        CellIterFlags iter_flags = CELL_ITER_IGNORE_HIDDEN;
 
-       g_return_if_fail (IS_GNM_FILTER_COMBO (fcombo));
+       g_return_if_fail (GNM_IS_FILTER_COMBO (fcombo));
 
        filter = fcombo->filter;
        cond = fcombo->cond;
-       col = sheet_object_get_range (SHEET_OBJECT (fcombo))->start.col;
+       col = sheet_object_get_range (GNM_SO (fcombo))->start.col;
        start_row = filter->r.start.row + 1;
        end_row = filter->r.end.row;
 
@@ -636,8 +636,8 @@ gnm_filter_add_field (GnmFilter *filter, int i)
        tmp.start.col = tmp.end.col = filter->r.start.col + i;
        sheet_object_anchor_init (&anchor, &tmp, a_offsets,
                GOD_ANCHOR_DIR_DOWN_RIGHT);
-       sheet_object_set_anchor (SHEET_OBJECT (fcombo), &anchor);
-       sheet_object_set_sheet (SHEET_OBJECT (fcombo), filter->sheet);
+       sheet_object_set_anchor (GNM_SO (fcombo), &anchor);
+       sheet_object_set_sheet (GNM_SO (fcombo), filter->sheet);
 
        g_ptr_array_add (filter->fields, NULL);
        for (n = filter->fields->len; --n > i ; )
diff --git a/src/sheet-merge.c b/src/sheet-merge.c
index d52edbc..23d6f17 100644
--- a/src/sheet-merge.c
+++ b/src/sheet-merge.c
@@ -141,7 +141,7 @@ gnm_sheet_merge_add (Sheet *sheet, GnmRange const *r, gboolean clear,
 
        comment = sheet_get_comment (sheet, &r2.start);
        if (comment != NULL)
-               sheet_object_update_bounds (SHEET_OBJECT (comment), NULL);
+               sheet_object_update_bounds (GNM_SO (comment), NULL);
 
        sheet_flag_status_update_range (sheet, &r2);
        if (sheet->cols.max_used < r2.end.col) {
@@ -190,7 +190,7 @@ gnm_sheet_merge_remove (Sheet *sheet, GnmRange const *r, GOCmdContext *cc)
 
        comment = sheet_get_comment (sheet, &r->start);
        if (comment != NULL)
-               sheet_object_update_bounds (SHEET_OBJECT (comment), NULL);
+               sheet_object_update_bounds (GNM_SO (comment), NULL);
 
        sheet_redraw_range (sheet, r);
        sheet_flag_status_update_range (sheet, r);
diff --git a/src/sheet-object-cell-comment.c b/src/sheet-object-cell-comment.c
index e446b9f..0023094 100644
--- a/src/sheet-object-cell-comment.c
+++ b/src/sheet-object-cell-comment.c
@@ -135,7 +135,7 @@ comment_view_button_released (GocItem *item, int button, double x, double y)
        gnm_canvas_get_screen_position (item->canvas, x, y, &ix, &iy);
        so = sheet_object_view_get_so (GNM_SO_VIEW (item));
        scg_comment_display (GNM_PANE (item->canvas)->simple.scg,
-                            CELL_COMMENT (so),
+                            GNM_CELL_COMMENT (so),
                             ix, iy);
 
        return TRUE;
@@ -175,7 +175,7 @@ comment_view_enter_notify (GocItem *item, double x, double y)
        so = sheet_object_view_get_so (GNM_SO_VIEW (item));
 
        scg_comment_select (GNM_PANE (item->canvas)->simple.scg,
-                           CELL_COMMENT (so),
+                           GNM_CELL_COMMENT (so),
                            ix, iy);
        return TRUE;
 }
@@ -184,7 +184,7 @@ static gboolean
 comment_view_leave_notify (GocItem *item, double x, double y)
 {
        scg_comment_unselect (GNM_PANE (item->canvas)->simple.scg,
-                             CELL_COMMENT (sheet_object_view_get_so (GNM_SO_VIEW (item))));
+                             GNM_CELL_COMMENT (sheet_object_view_get_so (GNM_SO_VIEW (item))));
        return TRUE;
 }
 
@@ -211,7 +211,7 @@ static GSF_CLASS (CommentView, comment_view,
 static void
 cell_comment_finalize (GObject *object)
 {
-       GnmComment *cc = CELL_COMMENT (object);
+       GnmComment *cc = GNM_CELL_COMMENT (object);
 
        g_return_if_fail (cc != NULL);
 
@@ -238,7 +238,7 @@ static void
 cell_comment_set_property (GObject *obj, guint param_id,
                           GValue const *value, GParamSpec *pspec)
 {
-       GnmComment *cc = CELL_COMMENT (obj);
+       GnmComment *cc = GNM_CELL_COMMENT (obj);
 
        switch (param_id) {
        case CC_PROP_TEXT:
@@ -267,7 +267,7 @@ static void
 cell_comment_get_property (GObject *obj, guint param_id,
                           GValue  *value,  GParamSpec *pspec)
 {
-       GnmComment *cc = CELL_COMMENT (obj);
+       GnmComment *cc = GNM_CELL_COMMENT (obj);
        switch (param_id) {
        case CC_PROP_TEXT :
                g_value_set_string (value, cc->text);
@@ -307,7 +307,7 @@ static void
 cell_comment_write_xml_sax (SheetObject const *so, GsfXMLOut *output,
                            GnmConventions const *convs)
 {
-       GnmComment const *cc = CELL_COMMENT (so);
+       GnmComment const *cc = GNM_CELL_COMMENT (so);
        if (NULL != cc->author)
                gsf_xml_out_add_cstr (output, "Author", cc->author);
        if (NULL != cc->text) {
@@ -326,7 +326,7 @@ cell_comment_prep_sax_parser (SheetObject *so, GsfXMLIn *xin,
                              xmlChar const **attrs,
                              GnmConventions const *convs)
 {
-       GnmComment *cc = CELL_COMMENT (so);
+       GnmComment *cc = GNM_CELL_COMMENT (so);
 
        for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2) {
                if (!strcmp (attrs[0], "Text"))
@@ -347,8 +347,8 @@ cell_comment_prep_sax_parser (SheetObject *so, GsfXMLIn *xin,
 static void
 cell_comment_copy (SheetObject *dst, SheetObject const *src)
 {
-       GnmComment const *comment       = CELL_COMMENT (src);
-       GnmComment       *new_comment   = CELL_COMMENT (dst);
+       GnmComment const *comment       = GNM_CELL_COMMENT (src);
+       GnmComment       *new_comment   = GNM_CELL_COMMENT (dst);
        new_comment->author = g_strdup (comment->author);
        new_comment->text   = g_strdup (comment->text);
        new_comment->markup = comment->markup;
@@ -444,7 +444,7 @@ cell_comment_set_pos (GnmComment *cc, GnmCellPos const *pos)
        r.start = r.end = *pos;
        sheet_object_anchor_init (&anchor, &r, a_offsets,
                GOD_ANCHOR_DIR_DOWN_RIGHT);
-       sheet_object_set_anchor (SHEET_OBJECT (cc), &anchor);
+       sheet_object_set_anchor (GNM_SO (cc), &anchor);
 }
 
 /**
@@ -467,7 +467,7 @@ cell_set_comment (Sheet *sheet, GnmCellPos const *pos,
        g_return_val_if_fail (IS_SHEET (sheet), NULL);
        g_return_val_if_fail (pos != NULL, NULL);
 
-       cc = g_object_new (CELL_COMMENT_TYPE, NULL);
+       cc = g_object_new (GNM_CELL_COMMENT_TYPE, NULL);
        cc->author = g_strdup (author);
        cc->text = g_strdup (text);
        cc->markup = attr;
@@ -476,7 +476,7 @@ cell_set_comment (Sheet *sheet, GnmCellPos const *pos,
 
        cell_comment_set_pos (cc, pos);
 
-       sheet_object_set_sheet (SHEET_OBJECT (cc), sheet);
+       sheet_object_set_sheet (GNM_SO (cc), sheet);
        /* setting the sheet added a reference */
        g_object_unref (cc);
 
diff --git a/src/sheet-object-cell-comment.h b/src/sheet-object-cell-comment.h
index 25c7e95..4bb410d 100644
--- a/src/sheet-object-cell-comment.h
+++ b/src/sheet-object-cell-comment.h
@@ -6,10 +6,9 @@
 
 G_BEGIN_DECLS
 
-#define CELL_COMMENT_TYPE     (cell_comment_get_type ())
-#define CELL_COMMENT(obj)     (G_TYPE_CHECK_INSTANCE_CAST((obj), CELL_COMMENT_TYPE, GnmComment))
-#define CELL_COMMENT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), CELL_COMMENT_TYPE, CellCommentClass))
-#define GNM_IS_CELL_COMMENT(o)    (G_TYPE_CHECK_INSTANCE_TYPE((o), CELL_COMMENT_TYPE))
+#define GNM_CELL_COMMENT_TYPE     (cell_comment_get_type ())
+#define GNM_CELL_COMMENT(obj)     (G_TYPE_CHECK_INSTANCE_CAST((obj), GNM_CELL_COMMENT_TYPE, GnmComment))
+#define GNM_IS_CELL_COMMENT(o)    (G_TYPE_CHECK_INSTANCE_TYPE((o), GNM_CELL_COMMENT_TYPE))
 
 GType       cell_comment_get_type (void);
 
diff --git a/src/sheet-object-component.c b/src/sheet-object-component.c
index 6204d3a..f1c0a80 100644
--- a/src/sheet-object-component.c
+++ b/src/sheet-object-component.c
@@ -85,7 +85,7 @@ static GSF_CLASS (SOComponentGocView, so_component_goc_view,
 /****************************************************************************/
 #define SHEET_OBJECT_CONFIG_KEY "sheet-object-component-key"
 
-#define SHEET_OBJECT_COMPONENT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), SHEET_OBJECT_COMPONENT_TYPE, 
SheetObjectComponentClass))
+#define SHEET_OBJECT_COMPONENT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GNM_SO_COMPONENT_TYPE, 
SheetObjectComponentClass))
 
 typedef struct {
        SheetObject  base;
@@ -99,7 +99,7 @@ static GObjectClass *parent_klass;
 static void
 gnm_soc_finalize (GObject *obj)
 {
-       SheetObjectComponent *soc = SHEET_OBJECT_COMPONENT (obj);
+       SheetObjectComponent *soc = GNM_SO_COMPONENT (obj);
 
        g_object_unref (soc->component);
 
@@ -110,7 +110,7 @@ static SheetObjectView *
 gnm_soc_new_view (SheetObject *so, SheetObjectViewContainer *container)
 {
        GnmPane *pane = GNM_PANE (container);
-       SheetObjectComponent *soc = SHEET_OBJECT_COMPONENT (so);
+       SheetObjectComponent *soc = GNM_SO_COMPONENT (so);
        GocItem *view = goc_item_new (pane->object_views,
                so_component_goc_view_get_type (),
                NULL);
@@ -147,7 +147,7 @@ gnm_soc_get_target_list (SheetObject const *so)
 static GtkTargetList *
 gnm_soc_get_object_target_list (SheetObject const *so)
 {
-       SheetObjectComponent *soc = SHEET_OBJECT_COMPONENT (so);
+       SheetObjectComponent *soc = GNM_SO_COMPONENT (so);
        GtkTargetList *tl = gtk_target_list_new (NULL, 0);
        if (soc && soc->component)
                gtk_target_list_add (tl,
@@ -159,13 +159,13 @@ static void
 gnm_soc_write_image (SheetObject const *so, char const *format, double resolution,
                     GsfOutput *output, GError **err)
 {
-       SheetObjectComponent *soc = SHEET_OBJECT_COMPONENT (so);
+       SheetObjectComponent *soc = GNM_SO_COMPONENT (so);
        gboolean res = FALSE;
        double coords[4];
        double w, h;
 
        if (so->sheet) {
-               sheet_object_position_pts_get (SHEET_OBJECT (so), coords);
+               sheet_object_position_pts_get (GNM_SO (so), coords);
                w = fabs (coords[2] - coords[0]) + 1.;
                h = fabs (coords[3] - coords[1]) + 1.;
        } else {
@@ -188,9 +188,9 @@ gnm_soc_write_image (SheetObject const *so, char const *format, double resolutio
 static void
 soc_cb_save_as (SheetObject *so, SheetControl *sc)
 {
-       SheetObjectComponent *soc = SHEET_OBJECT_COMPONENT (so);
+       SheetObjectComponent *soc = GNM_SO_COMPONENT (so);
        /* FIXME: This violates model gui barrier */
-       WBCGtk *wbcg = scg_wbcg (SHEET_CONTROL_GUI (sc));
+       WBCGtk *wbcg = scg_wbcg (GNM_SCG (sc));
        GtkWidget *dlg = gtk_file_chooser_dialog_new (_("Save as"),
                                                      GTK_WINDOW (wbcg_toplevel (wbcg)),
                                                      GTK_FILE_CHOOSER_ACTION_SAVE,
@@ -233,7 +233,7 @@ soc_cb_save_as_image (SheetObject *so, SheetControl *sc)
        GSList *l;
        GOImageFormat selected_format;
        GOImageFormatInfo const *format_info;
-       SheetObjectComponent *soc = SHEET_OBJECT_COMPONENT (so);
+       SheetObjectComponent *soc = GNM_SO_COMPONENT (so);
        double resolution;
 
        g_return_if_fail (soc != NULL);
@@ -244,7 +244,7 @@ soc_cb_save_as_image (SheetObject *so, SheetControl *sc)
        selected_format = GPOINTER_TO_UINT (l->data);
 
        /* FIXME: This violates model gui barrier */
-       wbcg = scg_wbcg (SHEET_CONTROL_GUI (sc));
+       wbcg = scg_wbcg (GNM_SCG (sc));
        uri = go_gui_get_image_save_info (wbcg_toplevel (wbcg), l, &selected_format, &resolution);
        if (!uri)
                goto out;
@@ -284,7 +284,7 @@ gnm_soc_write_object (SheetObject const *so, char const *format,
                      GsfOutput *output, GError **err,
                      GnmConventions const *convs)
 {
-       SheetObjectComponent *soc = SHEET_OBJECT_COMPONENT (so);
+       SheetObjectComponent *soc = GNM_SO_COMPONENT (so);
        char *buf;
        int length;
        gpointer user_data = NULL;
@@ -299,7 +299,7 @@ static void
 gnm_soc_write_xml_sax (SheetObject const *so, GsfXMLOut *output,
                       GnmConventions const *convs)
 {
-       SheetObjectComponent const *soc = SHEET_OBJECT_COMPONENT (so);
+       SheetObjectComponent const *soc = GNM_SO_COMPONENT (so);
        go_component_write_xml_sax (soc->component, output);
 }
 
@@ -320,7 +320,7 @@ gnm_soc_prep_sax_parser (SheetObject *so, GsfXMLIn *xin, xmlChar const **attrs,
 static void
 gnm_soc_copy (SheetObject *dst, SheetObject const *src)
 {
-       SheetObjectComponent *soc = SHEET_OBJECT_COMPONENT (src);
+       SheetObjectComponent *soc = GNM_SO_COMPONENT (src);
        GOComponent *component = go_component_duplicate (soc->component);
        sheet_object_component_set_component (dst, component);
        g_object_unref (component);
@@ -329,7 +329,7 @@ gnm_soc_copy (SheetObject *dst, SheetObject const *src)
 static void
 gnm_soc_default_size (SheetObject const *so, double *w, double *h)
 {
-       SheetObjectComponent const *soc = SHEET_OBJECT_COMPONENT (so);
+       SheetObjectComponent const *soc = GNM_SO_COMPONENT (so);
        if (soc->component && !go_component_is_resizable (soc->component)) {
                go_component_get_size (soc->component, w, h);
                *w = GO_IN_TO_PT (*w);
@@ -350,7 +350,7 @@ typedef struct {
 static void
 component_changed_cb (GOComponent *component, gnm_soc_user_config_t *data)
 {
-       SheetObjectComponent *soc = SHEET_OBJECT_COMPONENT (data->so);
+       SheetObjectComponent *soc = GNM_SO_COMPONENT (data->so);
        cmd_so_component_config (data->wbc, data->so, G_OBJECT (component), G_OBJECT (soc->component));
 }
 
@@ -366,25 +366,25 @@ destroy_cb ( gnm_soc_user_config_t *data)
 static void
 gnm_soc_user_config (SheetObject *so, SheetControl *sc)
 {
-       SheetObjectComponent *soc = SHEET_OBJECT_COMPONENT (so);
+       SheetObjectComponent *soc = GNM_SO_COMPONENT (so);
        GtkWidget *w;
        GOComponent *new_comp;
 
        g_return_if_fail (soc && soc->component);
 
-       go_component_set_command_context (soc->component, GO_CMD_CONTEXT (scg_wbcg (SHEET_CONTROL_GUI (sc))));
+       go_component_set_command_context (soc->component, GO_CMD_CONTEXT (scg_wbcg (GNM_SCG (sc))));
        new_comp = go_component_duplicate (soc->component);
-       go_component_set_command_context (new_comp, GO_CMD_CONTEXT (scg_wbcg (SHEET_CONTROL_GUI (sc))));
+       go_component_set_command_context (new_comp, GO_CMD_CONTEXT (scg_wbcg (GNM_SCG (sc))));
        w = (GtkWidget *) go_component_edit (new_comp);
        go_component_set_command_context (soc->component, NULL);
        if (w) {
                gnm_soc_user_config_t *data = g_new0 (gnm_soc_user_config_t, 1);
                data->so = so;
                data->component = new_comp;
-               data->wbc = GNM_WBC (scg_wbcg (SHEET_CONTROL_GUI (sc)));
+               data->wbc = GNM_WBC (scg_wbcg (GNM_SCG (sc)));
                data->signal = g_signal_connect (new_comp, "changed", G_CALLBACK (component_changed_cb), 
data);
                g_object_set_data_full (G_OBJECT (w), "editor", data, (GDestroyNotify) destroy_cb);
-               wbc_gtk_attach_guru (scg_wbcg (SHEET_CONTROL_GUI (sc)), w);
+               wbc_gtk_attach_guru (scg_wbcg (GNM_SCG (sc)), w);
        }
 }
 
@@ -392,7 +392,7 @@ static void
 gnm_soc_draw_cairo (SheetObject const *so, cairo_t *cr,
                          double width, double height)
 {
-       SheetObjectComponent *soc = SHEET_OBJECT_COMPONENT (so);
+       SheetObjectComponent *soc = GNM_SO_COMPONENT (so);
        g_return_if_fail (soc && soc->component);
 
        go_component_render (soc->component, cr, width, height);
@@ -424,7 +424,7 @@ gnm_soc_class_init (GObjectClass *klass)
 static void
 gnm_soc_init (GObject *obj)
 {
-       SheetObject *so = SHEET_OBJECT (obj);
+       SheetObject *so = GNM_SO (obj);
        so->anchor.base.direction = GOD_ANCHOR_DIR_DOWN_RIGHT;
 }
 
@@ -457,9 +457,9 @@ GSF_CLASS_FULL (SheetObjectComponent, sheet_object_component,
 SheetObject *
 sheet_object_component_new (GOComponent *component)
 {
-       SheetObjectComponent *soc = g_object_new (SHEET_OBJECT_COMPONENT_TYPE, NULL);
-       sheet_object_component_set_component (SHEET_OBJECT (soc), component);
-       return SHEET_OBJECT (soc);
+       SheetObjectComponent *soc = g_object_new (GNM_SO_COMPONENT_TYPE, NULL);
+       sheet_object_component_set_component (GNM_SO (soc), component);
+       return GNM_SO (soc);
 }
 
 /**
@@ -484,7 +484,7 @@ sheet_object_component_set_component (SheetObject *so, GOComponent *component)
        GnmPane *pane = (l && l->data)? GNM_PANE (GOC_ITEM (l->data)->canvas): NULL;
 
        g_return_if_fail (GNM_IS_SO_COMPONENT (so));
-       soc = SHEET_OBJECT_COMPONENT (so);
+       soc = GNM_SO_COMPONENT (so);
        if (soc->component != NULL) {
                go_component_stop_editing (soc->component);
                g_object_unref (soc->component);
diff --git a/src/sheet-object-component.h b/src/sheet-object-component.h
index 21bb7b0..fcf6400 100644
--- a/src/sheet-object-component.h
+++ b/src/sheet-object-component.h
@@ -29,9 +29,9 @@
 
 G_BEGIN_DECLS
 
-#define SHEET_OBJECT_COMPONENT_TYPE  (sheet_object_component_get_type ())
-#define GNM_IS_SO_COMPONENT(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), SHEET_OBJECT_COMPONENT_TYPE))
-#define SHEET_OBJECT_COMPONENT(o)       (G_TYPE_CHECK_INSTANCE_CAST((o), SHEET_OBJECT_COMPONENT_TYPE, 
SheetObjectComponent))
+#define GNM_SO_COMPONENT_TYPE  (sheet_object_component_get_type ())
+#define GNM_IS_SO_COMPONENT(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GNM_SO_COMPONENT_TYPE))
+#define GNM_SO_COMPONENT(o)     (G_TYPE_CHECK_INSTANCE_CAST((o), GNM_SO_COMPONENT_TYPE, 
SheetObjectComponent))
 
 GType       sheet_object_component_get_type (void);
 SheetObject *sheet_object_component_new  (GOComponent *component);
diff --git a/src/sheet-object-graph.c b/src/sheet-object-graph.c
index c13f72c..64b867c 100644
--- a/src/sheet-object-graph.c
+++ b/src/sheet-object-graph.c
@@ -91,7 +91,7 @@ static GSF_CLASS (SOGraphGocView, so_graph_goc_view,
 /****************************************************************************/
 #define SHEET_OBJECT_CONFIG_KEY "sheet-object-graph-key"
 
-#define SHEET_OBJECT_GRAPH_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), SHEET_OBJECT_GRAPH_TYPE, 
SheetObjectGraphClass))
+#define SHEET_OBJECT_GRAPH_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GNM_SO_GRAPH_TYPE, SheetObjectGraphClass))
 
 typedef struct {
        SheetObject  base;
@@ -142,7 +142,7 @@ sog_datas_set_sheet (SheetObjectGraph *sog, Sheet *sheet)
 static void
 gnm_sog_finalize (GObject *obj)
 {
-       SheetObjectGraph *sog = SHEET_OBJECT_GRAPH (obj);
+       SheetObjectGraph *sog = GNM_SO_GRAPH (obj);
 
        if (sog->renderer != NULL) {
                g_object_unref (sog->renderer);
@@ -200,7 +200,7 @@ static SheetObjectView *
 gnm_sog_new_view (SheetObject *so, SheetObjectViewContainer *container)
 {
        GnmPane *pane;
-       SheetObjectGraph *sog = SHEET_OBJECT_GRAPH (so);
+       SheetObjectGraph *sog = GNM_SO_GRAPH (so);
        if (GNM_IS_PANE (container)) {
                GocItem *view;
                pane = GNM_PANE (container);
@@ -263,13 +263,13 @@ static void
 gnm_sog_write_image (SheetObject const *so, char const *format, double resolution,
                     GsfOutput *output, GError **err)
 {
-       SheetObjectGraph *sog = SHEET_OBJECT_GRAPH (so);
+       SheetObjectGraph *sog = GNM_SO_GRAPH (so);
        gboolean res = FALSE;
        double coords[4];
        double w, h;
 
        if (so->sheet) {
-               sheet_object_position_pts_get (SHEET_OBJECT (sog), coords);
+               sheet_object_position_pts_get (GNM_SO (sog), coords);
                w = fabs (coords[2] - coords[0]) + 1.;
                h = fabs (coords[3] - coords[1]) + 1.;
        } else {
@@ -294,7 +294,7 @@ gnm_sog_write_object (SheetObject const *so, char const *format,
                      GsfOutput *output, G_GNUC_UNUSED GError **err,
                      GnmConventions const *convs)
 {
-       SheetObjectGraph *sog = SHEET_OBJECT_GRAPH (so);
+       SheetObjectGraph *sog = GNM_SO_GRAPH (so);
        GsfXMLOut *xout;
        GogObject *graph;
 
@@ -318,7 +318,7 @@ sog_cb_save_as (SheetObject *so, SheetControl *sc)
        GSList *l;
        GOImageFormat selected_format;
        GOImageFormatInfo const *format_info;
-       SheetObjectGraph *sog = SHEET_OBJECT_GRAPH (so);
+       SheetObjectGraph *sog = GNM_SO_GRAPH (so);
        double resolution;
 
        g_return_if_fail (sog != NULL);
@@ -328,7 +328,7 @@ sog_cb_save_as (SheetObject *so, SheetControl *sc)
        selected_format = GPOINTER_TO_UINT (l->data);
 
 #warning "This violates model gui barrier"
-       wbcg = scg_wbcg (SHEET_CONTROL_GUI (sc));
+       wbcg = scg_wbcg (GNM_SCG (sc));
        uri = go_gui_get_image_save_info (wbcg_toplevel (wbcg), l, &selected_format, &resolution);
        if (!uri)
                goto out;
@@ -350,8 +350,8 @@ out:
 static void
 sog_cb_open_in_new_window (SheetObject *so, SheetControl *sc)
 {
-       SheetObjectGraph *sog = SHEET_OBJECT_GRAPH (so);
-       SheetControlGUI *scg = SHEET_CONTROL_GUI (sc);
+       SheetObjectGraph *sog = GNM_SO_GRAPH (so);
+       SheetControlGUI *scg = GNM_SCG (sc);
        WBCGtk *wbcg = scg_wbcg (scg);
        GtkWidget *window;
        double coords[4];
@@ -373,8 +373,8 @@ sog_cb_open_in_new_window (SheetObject *so, SheetControl *sc)
 static void
 sog_cb_copy_to_new_sheet (SheetObject *so, SheetControl *sc)
 {
-       SheetObjectGraph *sog = SHEET_OBJECT_GRAPH (so);
-       SheetControlGUI *scg = SHEET_CONTROL_GUI (sc);
+       SheetObjectGraph *sog = GNM_SO_GRAPH (so);
+       SheetControlGUI *scg = GNM_SCG (sc);
        WorkbookControl *wbc = scg_wbc (scg);
        Sheet *sheet = wb_control_cur_sheet (wbc);
        GogGraph *graph = GOG_GRAPH (gog_object_dup (GOG_OBJECT (sog->graph), NULL, NULL));
@@ -415,7 +415,7 @@ static void
 gnm_sog_write_xml_sax (SheetObject const *so, GsfXMLOut *output,
                       GnmConventions const *convs)
 {
-       SheetObjectGraph const *sog = SHEET_OBJECT_GRAPH (so);
+       SheetObjectGraph const *sog = GNM_SO_GRAPH (so);
        gog_object_write_xml_sax (GOG_OBJECT (sog->graph), output,
                                  (gpointer)convs);
 }
@@ -445,7 +445,7 @@ gnm_sog_prep_sax_parser (SheetObject *so, GsfXMLIn *xin, xmlChar const **attrs,
 static void
 gnm_sog_copy (SheetObject *dst, SheetObject const *src)
 {
-       SheetObjectGraph const *sog = SHEET_OBJECT_GRAPH (src);
+       SheetObjectGraph const *sog = GNM_SO_GRAPH (src);
        GogGraph *graph = gog_graph_dup (sog->graph);
        sheet_object_graph_set_gog (dst, graph);
        g_object_unref (graph);
@@ -455,7 +455,7 @@ static void
 gnm_sog_draw_cairo (SheetObject const *so, cairo_t *cr,
                          double width, double height)
 {
-       gog_graph_render_to_cairo (SHEET_OBJECT_GRAPH (so)->graph,
+       gog_graph_render_to_cairo (GNM_SO_GRAPH (so)->graph,
                                   cr, width, height);
 }
 
@@ -476,13 +476,13 @@ static void
 cb_update_graph (GogGraph *graph, gnm_sog_user_config_t *data)
 {
        cmd_so_graph_config (data->wbc, data->so, G_OBJECT (graph),
-                            G_OBJECT (SHEET_OBJECT_GRAPH (data->so)->graph));
+                            G_OBJECT (GNM_SO_GRAPH (data->so)->graph));
 }
 
 static void
 gnm_sog_user_config (SheetObject *so, SheetControl *sc)
 {
-       SheetObjectGraph *sog = SHEET_OBJECT_GRAPH (so);
+       SheetObjectGraph *sog = GNM_SO_GRAPH (so);
        WBCGtk *wbcg;
        gnm_sog_user_config_t *data;
        GClosure *closure;
@@ -490,7 +490,7 @@ gnm_sog_user_config (SheetObject *so, SheetControl *sc)
        g_return_if_fail (sog != NULL);
        g_return_if_fail (sc != NULL);
 
-       wbcg = scg_wbcg (SHEET_CONTROL_GUI (sc));
+       wbcg = scg_wbcg (GNM_SCG (sc));
 
        data = g_new0 (gnm_sog_user_config_t, 1);
        data->so = so;
@@ -508,7 +508,7 @@ gnm_sog_foreach_dep (SheetObject *so,
                     SheetObjectForeachDepFunc func,
                     gpointer user)
 {
-       SheetObjectGraph *sog = SHEET_OBJECT_GRAPH (so);
+       SheetObjectGraph *sog = GNM_SO_GRAPH (so);
        GSList *ptr = gog_graph_get_data (sog->graph);
        for (; ptr != NULL ; ptr = ptr->next)
                sog_data_foreach_dep (so, ptr->data, func, user);
@@ -517,7 +517,7 @@ gnm_sog_foreach_dep (SheetObject *so,
 static gboolean
 gnm_sog_set_sheet (SheetObject *so, Sheet *sheet)
 {
-       SheetObjectGraph *sog = SHEET_OBJECT_GRAPH (so);
+       SheetObjectGraph *sog = GNM_SO_GRAPH (so);
        if (sog->graph != NULL)
                sog_datas_set_sheet (sog, sheet);
        return FALSE;
@@ -526,7 +526,7 @@ gnm_sog_set_sheet (SheetObject *so, Sheet *sheet)
 static gboolean
 gnm_sog_remove_from_sheet (SheetObject *so)
 {
-       SheetObjectGraph *sog = SHEET_OBJECT_GRAPH (so);
+       SheetObjectGraph *sog = GNM_SO_GRAPH (so);
        if (sog->graph != NULL)
                sog_datas_set_sheet (sog, NULL);
        return FALSE;
@@ -542,7 +542,7 @@ gnm_sog_default_size (G_GNUC_UNUSED SheetObject const *so, double *w, double *h)
 static void
 gnm_sog_bounds_changed (SheetObject *so)
 {
-       SheetObjectGraph *sog = SHEET_OBJECT_GRAPH (so);
+       SheetObjectGraph *sog = GNM_SO_GRAPH (so);
 
        /* If it has not been realized there is no renderer yet */
        if (sog->renderer != NULL) {
@@ -588,7 +588,7 @@ gnm_sog_class_init (GObjectClass *klass)
 static void
 gnm_sog_init (GObject *obj)
 {
-       SheetObject *so = SHEET_OBJECT (obj);
+       SheetObject *so = GNM_SO (obj);
        so->anchor.base.direction = GOD_ANCHOR_DIR_DOWN_RIGHT;
 }
 
@@ -622,9 +622,9 @@ GSF_CLASS_FULL (SheetObjectGraph, sheet_object_graph,
 SheetObject *
 sheet_object_graph_new (GogGraph *graph)
 {
-       SheetObjectGraph *sog = g_object_new (SHEET_OBJECT_GRAPH_TYPE, NULL);
-       sheet_object_graph_set_gog (SHEET_OBJECT (sog), graph);
-       return SHEET_OBJECT (sog);
+       SheetObjectGraph *sog = g_object_new (GNM_SO_GRAPH_TYPE, NULL);
+       sheet_object_graph_set_gog (GNM_SO (sog), graph);
+       return GNM_SO (sog);
 }
 
 /**
@@ -654,7 +654,7 @@ sheet_object_graph_get_gog (SheetObject *sog)
 void
 sheet_object_graph_set_gog (SheetObject *so, GogGraph *graph)
 {
-       SheetObjectGraph *sog = SHEET_OBJECT_GRAPH (so);
+       SheetObjectGraph *sog = GNM_SO_GRAPH (so);
 
        g_return_if_fail (GNM_IS_SO_GRAPH (so));
 
diff --git a/src/sheet-object-graph.h b/src/sheet-object-graph.h
index 201512a..15de8b6 100644
--- a/src/sheet-object-graph.h
+++ b/src/sheet-object-graph.h
@@ -8,9 +8,9 @@
 
 G_BEGIN_DECLS
 
-#define SHEET_OBJECT_GRAPH_TYPE  (sheet_object_graph_get_type ())
-#define GNM_IS_SO_GRAPH(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), SHEET_OBJECT_GRAPH_TYPE))
-#define SHEET_OBJECT_GRAPH(o)   (G_TYPE_CHECK_INSTANCE_CAST((o), SHEET_OBJECT_GRAPH_TYPE, SheetObjectGraph))
+#define GNM_SO_GRAPH_TYPE  (sheet_object_graph_get_type ())
+#define GNM_IS_SO_GRAPH(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GNM_SO_GRAPH_TYPE))
+#define GNM_SO_GRAPH(o)         (G_TYPE_CHECK_INSTANCE_CAST((o), GNM_SO_GRAPH_TYPE, SheetObjectGraph))
 
 GType       sheet_object_graph_get_type (void);
 SheetObject *sheet_object_graph_new  (GogGraph *graph);
diff --git a/src/sheet-object-image.c b/src/sheet-object-image.c
index a391c6e..0789344 100644
--- a/src/sheet-object-image.c
+++ b/src/sheet-object-image.c
@@ -179,7 +179,7 @@ gnm_soi_finalize (GObject *object)
 {
        SheetObjectImage *soi;
 
-       soi = SHEET_OBJECT_IMAGE (object);
+       soi = GNM_SO_IMAGE (object);
        g_free (soi->type);
        g_free (soi->name);
        if (soi->image)
@@ -191,7 +191,7 @@ gnm_soi_finalize (GObject *object)
 static SheetObjectView *
 gnm_soi_new_view (SheetObject *so, SheetObjectViewContainer *container)
 {
-       SheetObjectImage *soi = SHEET_OBJECT_IMAGE (so);
+       SheetObjectImage *soi = GNM_SO_IMAGE (so);
        GocItem *item = NULL;
 
        item = goc_item_new (
@@ -237,7 +237,7 @@ static GOImageFormat const standard_formats[] = {
 static GtkTargetList *
 gnm_soi_get_target_list (SheetObject const *so)
 {
-       SheetObjectImage *soi = SHEET_OBJECT_IMAGE (so);
+       SheetObjectImage *soi = GNM_SO_IMAGE (so);
        GtkTargetList *tl = gtk_target_list_new (NULL, 0);
        char *mime_str;
        GSList *mimes, *ptr;
@@ -273,7 +273,7 @@ gnm_soi_write_image (SheetObject const *so, char const *format,
                     G_GNUC_UNUSED double resolution,
                     GsfOutput *output, GError **err)
 {
-       SheetObjectImage *soi = SHEET_OBJECT_IMAGE (so);
+       SheetObjectImage *soi = GNM_SO_IMAGE (so);
        gboolean res;
        gsize length;
        guint8 const *data;
@@ -299,7 +299,7 @@ soi_cb_save_as (SheetObject *so, SheetControl *sc)
        GOImageFormatInfo const *format_info;
        GdkPixbuf *pixbuf = NULL;
        GError *err = NULL;
-       SheetObjectImage *soi = SHEET_OBJECT_IMAGE (so);
+       SheetObjectImage *soi = GNM_SO_IMAGE (so);
 
        g_return_if_fail (soi != NULL);
 
@@ -312,7 +312,7 @@ soi_cb_save_as (SheetObject *so, SheetControl *sc)
                l = g_slist_prepend (l, GUINT_TO_POINTER (sel_fmt));
        }
 
-       wbcg = scg_wbcg (SHEET_CONTROL_GUI (sc));
+       wbcg = scg_wbcg (GNM_SCG (sc));
 
        uri = go_gui_get_image_save_info (wbcg_toplevel (wbcg), l, &sel_fmt, NULL);
        if (!uri)
@@ -349,7 +349,7 @@ static void
 content_start (GsfXMLIn *xin, xmlChar const **attrs)
 {
        SheetObject *so = gnm_xml_in_cur_obj (xin);
-       SheetObjectImage *soi = SHEET_OBJECT_IMAGE (so);
+       SheetObjectImage *soi = GNM_SO_IMAGE (so);
        char const *image_type = NULL, *image_name = NULL;
 
        for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
@@ -366,7 +366,7 @@ static void
 content_end (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *unknown)
 {
        SheetObject *so = gnm_xml_in_cur_obj (xin);
-       SheetObjectImage *soi = SHEET_OBJECT_IMAGE (so);
+       SheetObjectImage *soi = GNM_SO_IMAGE (so);
        GString *data = xin->content;
 
        if (data->len >= 4) {
@@ -388,7 +388,7 @@ gnm_soi_prep_sax_parser (SheetObject *so, GsfXMLIn *xin,
          GSF_XML_IN_NODE_END
        };
        static GsfXMLInDoc *doc = NULL;
-       SheetObjectImage *soi = SHEET_OBJECT_IMAGE (so);
+       SheetObjectImage *soi = GNM_SO_IMAGE (so);
 
        if (NULL == doc) {
                doc = gsf_xml_in_doc_new (dtd, NULL);
@@ -414,7 +414,7 @@ gnm_soi_write_xml_sax (SheetObject const *so, GsfXMLOut *output,
        SheetObjectImage *soi;
 
        g_return_if_fail (GNM_IS_SO_IMAGE (so));
-       soi = SHEET_OBJECT_IMAGE (so);
+       soi = GNM_SO_IMAGE (so);
 
        gsf_xml_out_add_float (output, "crop-top", soi->crop_top, 3);
        gsf_xml_out_add_float (output, "crop-bottom", soi->crop_bottom, 3);
@@ -446,8 +446,8 @@ gnm_soi_write_xml_sax (SheetObject const *so, GsfXMLOut *output,
 static void
 gnm_soi_copy (SheetObject *dst, SheetObject const *src)
 {
-       SheetObjectImage const *soi = SHEET_OBJECT_IMAGE (src);
-       SheetObjectImage   *new_soi = SHEET_OBJECT_IMAGE (dst);
+       SheetObjectImage const *soi = GNM_SO_IMAGE (src);
+       SheetObjectImage   *new_soi = GNM_SO_IMAGE (dst);
 
        new_soi->type           = g_strdup (soi->type);
        new_soi->crop_top       = soi->crop_top;
@@ -461,7 +461,7 @@ static void
 gnm_soi_draw_cairo (SheetObject const *so, cairo_t *cr,
                    double width, double height)
 {
-       SheetObjectImage *soi = SHEET_OBJECT_IMAGE (so);
+       SheetObjectImage *soi = GNM_SO_IMAGE (so);
 
        if (soi->image) {
                int w = go_image_get_width (soi->image);
@@ -483,7 +483,7 @@ gnm_soi_draw_cairo (SheetObject const *so, cairo_t *cr,
 static void
 gnm_soi_default_size (SheetObject const *so, double *w, double *h)
 {
-       SheetObjectImage *soi = SHEET_OBJECT_IMAGE (so);
+       SheetObjectImage *soi = GNM_SO_IMAGE (so);
        if (soi->image) {
                *w = go_image_get_width (soi->image);
                *h = go_image_get_height (soi->image);
@@ -495,7 +495,7 @@ gnm_soi_default_size (SheetObject const *so, double *w, double *h)
 static gboolean
 gnm_soi_assign_to_sheet (SheetObject *so, Sheet *sheet)
 {
-       SheetObjectImage *soi = SHEET_OBJECT_IMAGE (so);
+       SheetObjectImage *soi = GNM_SO_IMAGE (so);
 
        if (soi->image/* && !go_image_get_name (soi->image)*/) {
                GODoc *doc = GO_DOC (sheet->workbook);
@@ -526,7 +526,7 @@ gnm_soi_get_property (GObject     *object,
                      GValue      *value,
                      GParamSpec  *pspec)
 {
-       SheetObjectImage *soi = SHEET_OBJECT_IMAGE (object);
+       SheetObjectImage *soi = GNM_SO_IMAGE (object);
        GdkPixbuf *pixbuf;
 
        switch (property_id) {
@@ -596,11 +596,11 @@ gnm_soi_init (GObject *obj)
        SheetObjectImage *soi;
        SheetObject *so;
 
-       soi = SHEET_OBJECT_IMAGE (obj);
+       soi = GNM_SO_IMAGE (obj);
        soi->crop_top = soi->crop_bottom = soi->crop_left = soi->crop_right
                = 0.0;
 
-       so = SHEET_OBJECT (obj);
+       so = GNM_SO (obj);
        so->anchor.base.direction = GOD_ANCHOR_DIR_DOWN_RIGHT;
 }
 
diff --git a/src/sheet-object-image.h b/src/sheet-object-image.h
index 67c94d9..41f4134 100644
--- a/src/sheet-object-image.h
+++ b/src/sheet-object-image.h
@@ -6,9 +6,9 @@
 
 G_BEGIN_DECLS
 
-#define SHEET_OBJECT_IMAGE_TYPE  (sheet_object_image_get_type ())
-#define SHEET_OBJECT_IMAGE(o)   (G_TYPE_CHECK_INSTANCE_CAST((o), SHEET_OBJECT_IMAGE_TYPE, SheetObjectImage))
-#define GNM_IS_SO_IMAGE(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), SHEET_OBJECT_IMAGE_TYPE))
+#define GNM_SO_IMAGE_TYPE  (sheet_object_image_get_type ())
+#define GNM_SO_IMAGE(o)         (G_TYPE_CHECK_INSTANCE_CAST((o), GNM_SO_IMAGE_TYPE, SheetObjectImage))
+#define GNM_IS_SO_IMAGE(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GNM_SO_IMAGE_TYPE))
 
 typedef struct _SheetObjectImage SheetObjectImage;
 
diff --git a/src/sheet-object-widget.c b/src/sheet-object-widget.c
index 37c4133..9b3ae91 100644
--- a/src/sheet-object-widget.c
+++ b/src/sheet-object-widget.c
@@ -329,7 +329,7 @@ sheet_object_widget_class_init (GObjectClass *object_class)
 static void
 sheet_object_widget_init (SheetObjectWidget *sow)
 {
-       SheetObject *so = SHEET_OBJECT (sow);
+       SheetObject *so = GNM_SO (sow);
        so->flags |= SHEET_OBJECT_CAN_PRESS;
 }
 
@@ -382,7 +382,7 @@ sheet_widget_frame_set_property (GObject *obj, guint param_id,
 
        switch (param_id) {
        case SOF_PROP_TEXT:
-               sheet_widget_frame_set_label (SHEET_OBJECT (swf),
+               sheet_widget_frame_set_label (GNM_SO (swf),
                                               g_value_get_string (value));
                break;
        default:
@@ -482,7 +482,7 @@ cb_frame_config_ok_clicked (G_GNUC_UNUSED GtkWidget *button, FrameConfigState *s
        gchar const *text = gtk_entry_get_text(GTK_ENTRY(state->label));
 
        cmd_so_set_frame_label (GNM_WBC (state->wbcg),
-                               SHEET_OBJECT (state->swf),
+                               GNM_SO (state->swf),
                                g_strdup (state->old_label), g_strdup (text));
        gtk_widget_destroy (state->dialog);
 }
@@ -513,7 +513,7 @@ sheet_widget_frame_set_label (SheetObject *so, char const* str)
 static void
 cb_frame_config_cancel_clicked (G_GNUC_UNUSED GtkWidget *button, FrameConfigState *state)
 {
-       sheet_widget_frame_set_label (SHEET_OBJECT (state->swf), state->old_label);
+       sheet_widget_frame_set_label (GNM_SO (state->swf), state->old_label);
 
        gtk_widget_destroy (state->dialog);
 }
@@ -524,14 +524,14 @@ cb_frame_label_changed (GtkWidget *entry, FrameConfigState *state)
        gchar const *text;
 
        text = gtk_entry_get_text(GTK_ENTRY(entry));
-       sheet_widget_frame_set_label (SHEET_OBJECT (state->swf), text);
+       sheet_widget_frame_set_label (GNM_SO (state->swf), text);
 }
 
 static void
 sheet_widget_frame_user_config (SheetObject *so, SheetControl *sc)
 {
        SheetWidgetFrame *swf = GNM_SOW_FRAME (so);
-       WBCGtk   *wbcg = scg_wbcg (SHEET_CONTROL_GUI (sc));
+       WBCGtk   *wbcg = scg_wbcg (GNM_SCG (sc));
        FrameConfigState *state;
        GtkBuilder *gui;
 
@@ -829,12 +829,12 @@ sheet_widget_button_set_property (GObject *obj, guint param_id,
 
        switch (param_id) {
        case SOB_PROP_TEXT:
-               sheet_widget_button_set_label (SHEET_OBJECT (swb),
+               sheet_widget_button_set_label (GNM_SO (swb),
                                               g_value_get_string (value));
                break;
        case SOB_PROP_MARKUP:
 #if 0
-               sheet_widget_button_set_markup (SHEET_OBJECT (swb),
+               sheet_widget_button_set_markup (GNM_SO (swb),
                                                g_value_peek_pointer (value));
 #endif
                break;
@@ -876,7 +876,7 @@ sheet_widget_button_init_full (SheetWidgetButton *swb,
                               char const *text,
                               PangoAttrList *markup)
 {
-       SheetObject *so = SHEET_OBJECT (swb);
+       SheetObject *so = GNM_SO (swb);
 
        so->flags &= ~SHEET_OBJECT_PRINT;
        swb->label = g_strdup (text);
@@ -921,11 +921,11 @@ cb_button_pressed (GtkToggleButton *button, SheetWidgetButton *swb)
 
        swb->value = TRUE;
 
-       if (so_get_ref (SHEET_OBJECT (swb), &ref, TRUE) != NULL) {
+       if (so_get_ref (GNM_SO (swb), &ref, TRUE) != NULL) {
                cmd_so_set_value (widget_wbc (GTK_WIDGET (button)),
                                  _("Pressed Button"),
                                  &ref, value_new_bool (TRUE),
-                                 sheet_object_get_sheet (SHEET_OBJECT (swb)));
+                                 sheet_object_get_sheet (GNM_SO (swb)));
        }
 }
 
@@ -936,11 +936,11 @@ cb_button_released (GtkToggleButton *button, SheetWidgetButton *swb)
 
        swb->value = FALSE;
 
-       if (so_get_ref (SHEET_OBJECT (swb), &ref, TRUE) != NULL) {
+       if (so_get_ref (GNM_SO (swb), &ref, TRUE) != NULL) {
                cmd_so_set_value (widget_wbc (GTK_WIDGET (button)),
                                  _("Released Button"),
                                  &ref, value_new_bool (FALSE),
-                                 sheet_object_get_sheet (SHEET_OBJECT (swb)));
+                                 sheet_object_get_sheet (GNM_SO (swb)));
        }
 }
 
@@ -997,7 +997,7 @@ cb_button_set_focus (G_GNUC_UNUSED GtkWidget *window, GtkWidget *focus_widget,
        /* Force an update of the content in case it needs tweaking (eg make it
         * absolute) */
        if (state->old_focus != NULL &&
-           IS_GNM_EXPR_ENTRY (gtk_widget_get_parent (state->old_focus))) {
+           GNM_EXPR_ENTRY_IS (gtk_widget_get_parent (state->old_focus))) {
                GnmParsePos  pp;
                GnmExprTop const *texpr = gnm_expr_entry_parse
                        (GNM_EXPR_ENTRY (gtk_widget_get_parent (state->old_focus)),
@@ -1023,7 +1023,7 @@ cb_button_config_destroy (ButtonConfigState *state)
 static void
 cb_button_config_ok_clicked (G_GNUC_UNUSED GtkWidget *button, ButtonConfigState *state)
 {
-       SheetObject *so = SHEET_OBJECT (state->swb);
+       SheetObject *so = GNM_SO (state->swb);
        GnmParsePos  pp;
        GnmExprTop const *texpr = gnm_expr_entry_parse (state->expression,
                parse_pos_init_sheet (&pp, so->sheet),
@@ -1039,7 +1039,7 @@ cb_button_config_ok_clicked (G_GNUC_UNUSED GtkWidget *button, ButtonConfigState
 static void
 cb_button_config_cancel_clicked (G_GNUC_UNUSED GtkWidget *button, ButtonConfigState *state)
 {
-       sheet_widget_button_set_label   (SHEET_OBJECT (state->swb),
+       sheet_widget_button_set_label   (GNM_SO (state->swb),
                                         state->old_label);
        gtk_widget_destroy (state->dialog);
 }
@@ -1047,7 +1047,7 @@ cb_button_config_cancel_clicked (G_GNUC_UNUSED GtkWidget *button, ButtonConfigSt
 static void
 cb_button_label_changed (GtkEntry *entry, ButtonConfigState *state)
 {
-       sheet_widget_button_set_label   (SHEET_OBJECT (state->swb),
+       sheet_widget_button_set_label   (GNM_SO (state->swb),
                                         gtk_entry_get_text (entry));
 }
 
@@ -1055,7 +1055,7 @@ static void
 sheet_widget_button_user_config (SheetObject *so, SheetControl *sc)
 {
        SheetWidgetButton *swb = GNM_SOW_BUTTON (so);
-       WBCGtk  *wbcg = scg_wbcg (SHEET_CONTROL_GUI (sc));
+       WBCGtk  *wbcg = scg_wbcg (GNM_SCG (sc));
        ButtonConfigState *state;
        GtkWidget *grid;
        GtkBuilder *gui;
@@ -1425,7 +1425,7 @@ cb_adjustment_widget_value_changed (GtkWidget *widget,
        if (swa->being_updated)
                return;
 
-       if (so_get_ref (SHEET_OBJECT (swa), &ref, TRUE) != NULL) {
+       if (so_get_ref (GNM_SO (swa), &ref, TRUE) != NULL) {
                GnmCell *cell = sheet_cell_fetch (ref.sheet, ref.col, ref.row);
                /* TODO : add more control for precision, XL is stupid */
                int new_val = gnm_fake_round (gtk_adjustment_get_value (swa->adjustment));
@@ -1439,7 +1439,7 @@ cb_adjustment_widget_value_changed (GtkWidget *widget,
                                  /* FIXME: This text sucks:  */
                                  _("Change widget"),
                                  &ref, value_new_int (new_val),
-                                 sheet_object_get_sheet (SHEET_OBJECT (swa)));
+                                 sheet_object_get_sheet (GNM_SO (swa)));
                swa->being_updated = FALSE;
        }
 }
@@ -1493,7 +1493,7 @@ sheet_widget_adjustment_set_property (GObject *obj, guint param_id,
 
        switch (param_id) {
        case SWA_PROP_HORIZONTAL:
-               sheet_widget_adjustment_set_horizontal (SHEET_OBJECT (swa), g_value_get_boolean (value));
+               sheet_widget_adjustment_set_horizontal (GNM_SO (swa), g_value_get_boolean (value));
                break;
        default:
                G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, param_id, pspec);
@@ -1509,7 +1509,7 @@ sheet_widget_adjustment_init_full (SheetWidgetAdjustment *swa,
        SheetObject *so;
        g_return_if_fail (swa != NULL);
 
-       so = SHEET_OBJECT (swa);
+       so = GNM_SO (swa);
        so->flags &= ~SHEET_OBJECT_PRINT;
 
        swa->adjustment = GTK_ADJUSTMENT (gtk_adjustment_new (0., 0., 100., 1., 10., 0.));
@@ -1602,7 +1602,7 @@ cb_adjustment_set_focus (G_GNUC_UNUSED GtkWidget *window, GtkWidget *focus_widge
                : NULL;
        /* Force an update of the content in case it needs tweaking (eg make it
         * absolute) */
-       if (ofp && IS_GNM_EXPR_ENTRY (ofp)) {
+       if (ofp && GNM_EXPR_ENTRY_IS (ofp)) {
                GnmParsePos  pp;
                GnmExprTop const *texpr = gnm_expr_entry_parse (
                        GNM_EXPR_ENTRY (ofp),
@@ -1628,7 +1628,7 @@ cb_adjustment_config_destroy (AdjustmentConfigState *state)
 static void
 cb_adjustment_config_ok_clicked (G_GNUC_UNUSED GtkWidget *button, AdjustmentConfigState *state)
 {
-       SheetObject *so = SHEET_OBJECT (state->swa);
+       SheetObject *so = GNM_SO (state->swa);
        GnmParsePos pp;
        GnmExprTop const *texpr = gnm_expr_entry_parse (state->expression,
                parse_pos_init_sheet (&pp, so->sheet),
@@ -1666,7 +1666,7 @@ sheet_widget_adjustment_user_config_impl (SheetObject *so, SheetControl *sc, cha
 {
        SheetWidgetAdjustment *swa = GNM_SOW_ADJUSTMENT (so);
        SheetWidgetAdjustmentClass *swa_class = SWA_CLASS (swa);
-       WBCGtk *wbcg = scg_wbcg (SHEET_CONTROL_GUI (sc));
+       WBCGtk *wbcg = scg_wbcg (GNM_SCG (sc));
        AdjustmentConfigState *state;
        GtkWidget *grid;
        GtkBuilder *gui;
@@ -2300,12 +2300,12 @@ sheet_widget_checkbox_set_property (GObject *obj, guint param_id,
                sheet_widget_checkbox_set_active (swc);
                break;
        case SOC_PROP_TEXT:
-               sheet_widget_checkbox_set_label (SHEET_OBJECT (swc),
+               sheet_widget_checkbox_set_label (GNM_SO (swc),
                                                 g_value_get_string (value));
                break;
        case SOC_PROP_MARKUP:
 #if 0
-               sheet_widget_checkbox_set_markup (SHEET_OBJECT (swc),
+               sheet_widget_checkbox_set_markup (GNM_SO (swc),
                                                g_value_peek_pointer (value));
 #endif
                break;
@@ -2391,13 +2391,13 @@ cb_checkbox_toggled (GtkToggleButton *button, SheetWidgetCheckbox *swc)
        swc->value = gtk_toggle_button_get_active (button);
        sheet_widget_checkbox_set_active (swc);
 
-       if (so_get_ref (SHEET_OBJECT (swc), &ref, TRUE) != NULL) {
+       if (so_get_ref (GNM_SO (swc), &ref, TRUE) != NULL) {
                gboolean new_val = gtk_toggle_button_get_active (button);
                cmd_so_set_value (widget_wbc (GTK_WIDGET (button)),
                                  /* FIXME: This text sucks:  */
                                  _("Clicking checkbox"),
                                  &ref, value_new_bool (new_val),
-                                 sheet_object_get_sheet (SHEET_OBJECT (swc)));
+                                 sheet_object_get_sheet (GNM_SO (swc)));
        }
 }
 
@@ -2459,7 +2459,7 @@ cb_checkbox_set_focus (G_GNUC_UNUSED GtkWidget *window, GtkWidget *focus_widget,
 
        /* Force an update of the content in case it needs tweaking (eg make it
         * absolute) */
-       if (ofp && IS_GNM_EXPR_ENTRY (ofp)) {
+       if (ofp && GNM_EXPR_ENTRY_IS (ofp)) {
                GnmParsePos  pp;
                GnmExprTop const *texpr = gnm_expr_entry_parse (
                        GNM_EXPR_ENTRY (ofp),
@@ -2485,7 +2485,7 @@ cb_checkbox_config_destroy (CheckboxConfigState *state)
 static void
 cb_checkbox_config_ok_clicked (G_GNUC_UNUSED GtkWidget *button, CheckboxConfigState *state)
 {
-       SheetObject *so = SHEET_OBJECT (state->swc);
+       SheetObject *so = GNM_SO (state->swc);
        GnmParsePos  pp;
        GnmExprTop const *texpr = gnm_expr_entry_parse (state->expression,
                parse_pos_init_sheet (&pp, so->sheet),
@@ -2501,7 +2501,7 @@ cb_checkbox_config_ok_clicked (G_GNUC_UNUSED GtkWidget *button, CheckboxConfigSt
 static void
 cb_checkbox_config_cancel_clicked (G_GNUC_UNUSED GtkWidget *button, CheckboxConfigState *state)
 {
-       sheet_widget_checkbox_set_label (SHEET_OBJECT (state->swc),
+       sheet_widget_checkbox_set_label (GNM_SO (state->swc),
                                         state->old_label);
        gtk_widget_destroy (state->dialog);
 }
@@ -2509,7 +2509,7 @@ cb_checkbox_config_cancel_clicked (G_GNUC_UNUSED GtkWidget *button, CheckboxConf
 static void
 cb_checkbox_label_changed (GtkEntry *entry, CheckboxConfigState *state)
 {
-       sheet_widget_checkbox_set_label (SHEET_OBJECT (state->swc),
+       sheet_widget_checkbox_set_label (GNM_SO (state->swc),
                                         gtk_entry_get_text (entry));
 }
 
@@ -2517,7 +2517,7 @@ static void
 sheet_widget_checkbox_user_config (SheetObject *so, SheetControl *sc)
 {
        SheetWidgetCheckbox *swc = GNM_SOW_CHECKBOX (so);
-       WBCGtk  *wbcg = scg_wbcg (SHEET_CONTROL_GUI (sc));
+       WBCGtk  *wbcg = scg_wbcg (GNM_SCG (sc));
        CheckboxConfigState *state;
        GtkWidget *grid;
        GtkBuilder *gui;
@@ -2871,17 +2871,17 @@ sheet_widget_radio_button_set_property (GObject *obj, guint param_id,
                                                      g_value_get_boolean (value));
                break;
        case SOR_PROP_TEXT:
-               sheet_widget_radio_button_set_label (SHEET_OBJECT (swrb),
+               sheet_widget_radio_button_set_label (GNM_SO (swrb),
                                                     g_value_get_string (value));
                break;
        case SOR_PROP_MARKUP:
 #if 0
-               sheet_widget_radio_button_set_markup (SHEET_OBJECT (swrb),
+               sheet_widget_radio_button_set_markup (GNM_SO (swrb),
                                                      g_value_peek_pointer (value));
 #endif
                break;
        case SOR_PROP_VALUE:
-               sheet_widget_radio_button_set_value (SHEET_OBJECT (swrb),
+               sheet_widget_radio_button_set_value (GNM_SO (swrb),
                                                      g_value_peek_pointer (value));
                break;
        default:
@@ -2988,12 +2988,12 @@ sheet_widget_radio_button_toggled (GtkToggleButton *button,
                return;
        swrb->active = gtk_toggle_button_get_active (button);
 
-       if (so_get_ref (SHEET_OBJECT (swrb), &ref, TRUE) != NULL) {
+       if (so_get_ref (GNM_SO (swrb), &ref, TRUE) != NULL) {
                cmd_so_set_value (widget_wbc (GTK_WIDGET (button)),
                                  /* FIXME: This text sucks:  */
                                  _("Clicking radiobutton"),
                                  &ref, value_dup (swrb->value),
-                                 sheet_object_get_sheet (SHEET_OBJECT (swrb)));
+                                 sheet_object_get_sheet (GNM_SO (swrb)));
        }
 }
 
@@ -3171,7 +3171,7 @@ cb_radio_button_set_focus (G_GNUC_UNUSED GtkWidget *window, GtkWidget *focus_wid
 
        /* Force an update of the content in case it needs tweaking (eg make it
         * absolute) */
-       if (ofp && IS_GNM_EXPR_ENTRY (ofp)) {
+       if (ofp && GNM_EXPR_ENTRY_IS (ofp)) {
                GnmParsePos  pp;
                GnmExprTop const *texpr = gnm_expr_entry_parse (
                        GNM_EXPR_ENTRY (ofp),
@@ -3209,7 +3209,7 @@ so_parse_value (SheetObject *so, const char *s)
 static void
 cb_radio_button_config_ok_clicked (G_GNUC_UNUSED GtkWidget *button, RadioButtonConfigState *state)
 {
-       SheetObject *so = SHEET_OBJECT (state->swrb);
+       SheetObject *so = GNM_SO (state->swrb);
        GnmParsePos  pp;
        GnmExprTop const *texpr = gnm_expr_entry_parse
                (state->expression,
@@ -3230,9 +3230,9 @@ cb_radio_button_config_ok_clicked (G_GNUC_UNUSED GtkWidget *button, RadioButtonC
 static void
 cb_radio_button_config_cancel_clicked (G_GNUC_UNUSED GtkWidget *button, RadioButtonConfigState *state)
 {
-       sheet_widget_radio_button_set_label (SHEET_OBJECT (state->swrb),
+       sheet_widget_radio_button_set_label (GNM_SO (state->swrb),
                                             state->old_label);
-       sheet_widget_radio_button_set_value (SHEET_OBJECT (state->swrb),
+       sheet_widget_radio_button_set_value (GNM_SO (state->swrb),
                                             state->old_value);
        gtk_widget_destroy (state->dialog);
 }
@@ -3240,7 +3240,7 @@ cb_radio_button_config_cancel_clicked (G_GNUC_UNUSED GtkWidget *button, RadioBut
 static void
 cb_radio_button_label_changed (GtkEntry *entry, RadioButtonConfigState *state)
 {
-       sheet_widget_radio_button_set_label (SHEET_OBJECT (state->swrb),
+       sheet_widget_radio_button_set_label (GNM_SO (state->swrb),
                                             gtk_entry_get_text (entry));
 }
 
@@ -3248,7 +3248,7 @@ static void
 cb_radio_button_value_changed (GtkEntry *entry, RadioButtonConfigState *state)
 {
        const char *text = gtk_entry_get_text (entry);
-       SheetObject *so = SHEET_OBJECT (state->swrb);
+       SheetObject *so = GNM_SO (state->swrb);
        GnmValue *val = so_parse_value (so, text);
 
        sheet_widget_radio_button_set_value (so, val);
@@ -3259,7 +3259,7 @@ static void
 sheet_widget_radio_button_user_config (SheetObject *so, SheetControl *sc)
 {
        SheetWidgetRadioButton *swrb = GNM_SOW_RADIO_BUTTON (so);
-       WBCGtk  *wbcg = scg_wbcg (SHEET_CONTROL_GUI (sc));
+       WBCGtk  *wbcg = scg_wbcg (GNM_SCG (sc));
        RadioButtonConfigState *state;
        GtkWidget *grid;
        GString *valstr;
@@ -3471,7 +3471,7 @@ sheet_widget_list_base_set_selection (SheetWidgetListBase *swl, int selection,
        if (swl->selection != selection) {
                swl->selection = selection;
                if (NULL!= wbc &&
-                   so_get_ref (SHEET_OBJECT (swl), &ref, TRUE) != NULL) {
+                   so_get_ref (GNM_SO (swl), &ref, TRUE) != NULL) {
                        GnmValue *v;
                        if (swl->result_as_index)
                                v = value_new_int (swl->selection);
@@ -3486,7 +3486,7 @@ sheet_widget_list_base_set_selection (SheetWidgetListBase *swl, int selection,
                        } else
                                v = value_new_string ("");
                        cmd_so_set_value (wbc, _("Clicking in list"), &ref, v,
-                                         sheet_object_get_sheet (SHEET_OBJECT (swl)));
+                                         sheet_object_get_sheet (GNM_SO (swl)));
                }
                g_signal_emit (G_OBJECT (swl),
                        list_base_signals [LIST_BASE_SELECTION_CHANGED], 0);
@@ -3608,7 +3608,7 @@ static void
 sheet_widget_list_base_init (SheetObjectWidget *sow)
 {
        SheetWidgetListBase *swl = GNM_SOW_LIST_BASE (sow);
-       SheetObject *so = SHEET_OBJECT (sow);
+       SheetObject *so = GNM_SO (sow);
 
        so->flags &= ~SHEET_OBJECT_PRINT;
 
@@ -3641,7 +3641,7 @@ sheet_widget_list_base_finalize (GObject *obj)
 static void
 sheet_widget_list_base_user_config (SheetObject *so, SheetControl *sc)
 {
-       dialog_so_list (scg_wbcg (SHEET_CONTROL_GUI (sc)), G_OBJECT (so));
+       dialog_so_list (scg_wbcg (GNM_SCG (sc)), G_OBJECT (so));
 }
 static gboolean
 sheet_widget_list_base_set_sheet (SheetObject *so, Sheet *sheet)
diff --git a/src/sheet-object.c b/src/sheet-object.c
index f1e69de..4704ea3 100644
--- a/src/sheet-object.c
+++ b/src/sheet-object.c
@@ -102,7 +102,7 @@ cb_so_size_position (SheetObject *so, SheetControl *sc)
 {
        WBCGtk *wbcg;
 
-       g_return_if_fail (IS_SHEET_CONTROL_GUI (sc));
+       g_return_if_fail (GNM_IS_SCG (sc));
 
        wbcg = scg_wbcg ((SheetControlGUI *)sc);
 
@@ -168,7 +168,7 @@ sheet_object_get_editor (SheetObject *so, SheetControl *sc)
 
        g_return_if_fail (GNM_IS_SO (so));
        g_return_if_fail (SO_CLASS (so));
-       g_return_if_fail (IS_SHEET_CONTROL_GUI (sc));
+       g_return_if_fail (GNM_IS_SCG (sc));
 
        wbcg = scg_wbcg ((SheetControlGUI *)sc);
 
@@ -289,7 +289,7 @@ sheet_objects_max_extent (Sheet *sheet)
        GSList *ptr;
 
        for (ptr = sheet->sheet_objects; ptr != NULL ; ptr = ptr->next ) {
-               SheetObject *so = SHEET_OBJECT (ptr->data);
+               SheetObject *so = GNM_SO (ptr->data);
 
                if (max_pos.col < so->anchor.cell_bound.end.col)
                        max_pos.col = so->anchor.cell_bound.end.col;
@@ -320,7 +320,7 @@ static void
 sheet_object_get_property (GObject *obj, guint param_id,
                           GValue  *value, GParamSpec *pspec)
 {
-       SheetObject *so = SHEET_OBJECT (obj);
+       SheetObject *so = GNM_SO (obj);
 
        switch (param_id) {
        case SO_PROP_NAME:
@@ -336,7 +336,7 @@ static void
 sheet_object_set_property (GObject *obj, guint param_id,
                           GValue const *value, GParamSpec *pspec)
 {
-       SheetObject *so = SHEET_OBJECT (obj);
+       SheetObject *so = GNM_SO (obj);
 
        switch (param_id) {
        case SO_PROP_NAME:
@@ -352,7 +352,7 @@ sheet_object_set_property (GObject *obj, guint param_id,
 static void
 sheet_object_finalize (GObject *object)
 {
-       SheetObject *so = SHEET_OBJECT (object);
+       SheetObject *so = GNM_SO (object);
        if (so->sheet != NULL)
                sheet_object_clear_sheet (so);
        g_free (so->name);
@@ -363,7 +363,7 @@ static void
 sheet_object_init (GObject *object)
 {
        int i;
-       SheetObject *so = SHEET_OBJECT (object);
+       SheetObject *so = GNM_SO (object);
 
        so->sheet = NULL;
        so->flags = SHEET_OBJECT_IS_VISIBLE | SHEET_OBJECT_PRINT |
@@ -950,7 +950,7 @@ sheet_objects_relocate (GnmExprRelocateInfo const *rinfo, gboolean update,
        if (change_sheets) {
                GSList *copy = g_slist_copy (rinfo->target_sheet->sheet_objects);
                for (ptr = copy; ptr != NULL ; ptr = ptr->next ) {
-                       SheetObject *so = SHEET_OBJECT (ptr->data);
+                       SheetObject *so = GNM_SO (ptr->data);
                        GnmRange const *r  = &so->anchor.cell_bound;
                        if (range_contains (&dest, r->start.col, r->start.row)) {
                                clear_sheet (so, pundo);
@@ -961,7 +961,7 @@ sheet_objects_relocate (GnmExprRelocateInfo const *rinfo, gboolean update,
 
        ptr = rinfo->origin_sheet->sheet_objects;
        for (; ptr != NULL ; ptr = next ) {
-               SheetObject *so = SHEET_OBJECT (ptr->data);
+               SheetObject *so = GNM_SO (ptr->data);
                GnmRange r = so->anchor.cell_bound;
 
                next = ptr->next;
@@ -1019,7 +1019,7 @@ sheet_objects_get (Sheet const *sheet, GnmRange const *r, GType t)
                GObject *obj = G_OBJECT (ptr->data);
 
                if (t == G_TYPE_NONE || t == G_OBJECT_TYPE (obj)) {
-                       SheetObject *so = SHEET_OBJECT (obj);
+                       SheetObject *so = GNM_SO (obj);
                        if (r == NULL || range_contained (&so->anchor.cell_bound, r))
                                res = g_slist_prepend (res, so);
                }
@@ -1047,7 +1047,7 @@ sheet_objects_clear (Sheet const *sheet, GnmRange const *r, GType t,
                next = ptr->next;
                if ((t == G_TYPE_NONE && G_OBJECT_TYPE (obj) != GNM_FILTER_COMBO_TYPE)
                    || t == G_OBJECT_TYPE (obj)) {
-                       SheetObject *so = SHEET_OBJECT (obj);
+                       SheetObject *so = GNM_SO (obj);
                        if (r == NULL || range_contained (&so->anchor.cell_bound, r))
                                clear_sheet (so, pundo);
                }
@@ -1322,7 +1322,7 @@ cb_so_menu_activate (GObject *menu, GocItem *view)
                if (data == NULL)
                        data = GNM_SIMPLE_CANVAS (view->canvas)->scg;
 
-               (a->func) (so, SHEET_CONTROL (data));
+               (a->func) (so, GNM_SC (data));
        }
 }
 
@@ -1449,7 +1449,7 @@ static gboolean
 sheet_object_view_button2_pressed (GocItem *item, int button, double x, double y)
 {
        if (button == 1 && !GNM_IS_PANE (item->canvas)) {
-               SheetControl *sc = SHEET_CONTROL (g_object_get_data (G_OBJECT (item->canvas), 
"sheet-control"));
+               SheetControl *sc = GNM_SC (g_object_get_data (G_OBJECT (item->canvas), "sheet-control"));
                SheetObject *so = (SheetObject *) g_object_get_qdata (G_OBJECT (item), sov_so_quark);
 
                if (sc && sheet_object_can_edit (so))
@@ -1671,12 +1671,12 @@ sheet_objects_init (void)
 {
        GNM_SO_LINE_TYPE;
        GNM_SO_FILLED_TYPE;
-       SHEET_OBJECT_GRAPH_TYPE;
-       SHEET_OBJECT_IMAGE_TYPE;
+       GNM_SO_GRAPH_TYPE;
+       GNM_SO_IMAGE_TYPE;
        GNM_GO_DATA_SCALAR_TYPE;
        GNM_GO_DATA_VECTOR_TYPE;
        GNM_GO_DATA_MATRIX_TYPE;
-       CELL_COMMENT_TYPE;
+       GNM_CELL_COMMENT_TYPE;
 
        sheet_object_widget_register ();
        sov_so_quark = g_quark_from_static_string ("SheetObject");
diff --git a/src/sheet-object.h b/src/sheet-object.h
index 9c95141..245d90c 100644
--- a/src/sheet-object.h
+++ b/src/sheet-object.h
@@ -26,7 +26,7 @@ struct _SheetObjectAnchor {
 GType sheet_object_anchor_get_type (void); /* Boxed type */
 
 #define GNM_SO_TYPE     (sheet_object_get_type ())
-#define SHEET_OBJECT(obj)     (G_TYPE_CHECK_INSTANCE_CAST((obj), GNM_SO_TYPE, SheetObject))
+#define GNM_SO(obj)     (G_TYPE_CHECK_INSTANCE_CAST((obj), GNM_SO_TYPE, SheetObject))
 #define GNM_IS_SO(o)    (G_TYPE_CHECK_INSTANCE_TYPE((o), GNM_SO_TYPE))
 GType sheet_object_get_type (void);
 
diff --git a/src/sheet-view.c b/src/sheet-view.c
index 18dc780..7fd0060 100644
--- a/src/sheet-view.c
+++ b/src/sheet-view.c
@@ -79,7 +79,7 @@ sv_sheet_name_changed (G_GNUC_UNUSED Sheet *sheet,
                       G_GNUC_UNUSED GParamSpec *pspec,
                       SheetView *sv)
 {
-       g_return_if_fail (IS_SHEET_VIEW (sv));
+       g_return_if_fail (GNM_IS_SV (sv));
        sv->edit_pos_changed.content = TRUE;
 }
 
@@ -88,7 +88,7 @@ sv_sheet_visibility_changed (Sheet *sheet,
                             G_GNUC_UNUSED GParamSpec *pspec,
                             SheetView *sv)
 {
-       g_return_if_fail (IS_SHEET_VIEW (sv));
+       g_return_if_fail (GNM_IS_SV (sv));
        /* See bug 366477.  */
        if (sheet_is_visible (sheet) && !wb_view_cur_sheet (sv->sv_wbv))
                wb_view_sheet_focus (sv->sv_wbv, sheet);
@@ -99,7 +99,7 @@ sv_sheet_r1c1_changed (G_GNUC_UNUSED Sheet *sheet,
                       G_GNUC_UNUSED GParamSpec *pspec,
                       SheetView *sv)
 {
-       g_return_if_fail (IS_SHEET_VIEW (sv));
+       g_return_if_fail (GNM_IS_SV (sv));
        sv->edit_pos_changed.location = TRUE;
 }
 
@@ -112,7 +112,7 @@ sv_sheet_r1c1_changed (G_GNUC_UNUSED Sheet *sheet,
 Sheet *
 sv_sheet (SheetView const *sv)
 {
-       g_return_val_if_fail (IS_SHEET_VIEW (sv), NULL);
+       g_return_val_if_fail (GNM_IS_SV (sv), NULL);
        return sv->sheet;
 }
 
@@ -125,7 +125,7 @@ sv_sheet (SheetView const *sv)
 WorkbookView *
 sv_wbv (SheetView const *sv)
 {
-       g_return_val_if_fail (IS_SHEET_VIEW (sv), NULL);
+       g_return_val_if_fail (GNM_IS_SV (sv), NULL);
        return sv->sv_wbv;
 }
 
@@ -152,8 +152,8 @@ sv_init_sc (SheetView const *sv, SheetControl *sc)
 void
 sv_attach_control (SheetView *sv, SheetControl *sc)
 {
-       g_return_if_fail (IS_SHEET_VIEW (sv));
-       g_return_if_fail (IS_SHEET_CONTROL (sc));
+       g_return_if_fail (GNM_IS_SV (sv));
+       g_return_if_fail (GNM_IS_SC (sc));
        g_return_if_fail (sc->view == NULL);
 
        if (sv->controls == NULL)
@@ -166,8 +166,8 @@ sv_attach_control (SheetView *sv, SheetControl *sc)
 void
 sv_detach_control (SheetControl *sc)
 {
-       g_return_if_fail (IS_SHEET_CONTROL (sc));
-       g_return_if_fail (IS_SHEET_VIEW (sc->view));
+       g_return_if_fail (GNM_IS_SC (sc));
+       g_return_if_fail (GNM_IS_SV (sc->view));
 
        g_ptr_array_remove (sc->view->controls, sc);
        if (sc->view->controls->len == 0) {
@@ -215,7 +215,7 @@ static GObjectClass *parent_class;
 static void
 sv_real_dispose (GObject *object)
 {
-       SheetView *sv = SHEET_VIEW (object);
+       SheetView *sv = GNM_SV (object);
 
        if (sv->controls != NULL) {
                SHEET_VIEW_FOREACH_CONTROL (sv, control, {
@@ -248,7 +248,7 @@ sv_real_dispose (GObject *object)
 static void
 sheet_view_class_init (GObjectClass *klass)
 {
-       SheetViewClass *wbc_class = SHEET_VIEW_CLASS (klass);
+       SheetViewClass *wbc_class = GNM_SV_CLASS (klass);
 
        g_return_if_fail (wbc_class != NULL);
 
@@ -259,7 +259,7 @@ sheet_view_class_init (GObjectClass *klass)
 static void
 sheet_view_init (GObject *object)
 {
-       SheetView *sv = SHEET_VIEW (object);
+       SheetView *sv = GNM_SV (object);
 
        /* Init menu states */
        sv->enable_insert_rows = TRUE;
@@ -294,7 +294,7 @@ sheet_view_new (Sheet *sheet, WorkbookView *wbv)
 
        g_return_val_if_fail (IS_SHEET (sheet), NULL);
 
-       sv = g_object_new (SHEET_VIEW_TYPE, NULL);
+       sv = g_object_new (GNM_SV_TYPE, NULL);
        sv->sheet = g_object_ref (sheet);
        sv->sv_wbv = wbv;
        g_ptr_array_add (sheet->sheet_views, sv);
@@ -331,7 +331,7 @@ sv_unant (SheetView *sv)
 {
        GList *ptr;
 
-       g_return_if_fail (IS_SHEET_VIEW (sv));
+       g_return_if_fail (GNM_IS_SV (sv));
 
        if (sv->ants == NULL)
                return;
@@ -354,7 +354,7 @@ sv_ant (SheetView *sv, GList *ranges)
 {
        GList *ptr;
 
-       g_return_if_fail (IS_SHEET_VIEW (sv));
+       g_return_if_fail (GNM_IS_SV (sv));
        g_return_if_fail (ranges != NULL);
 
        if (sv->ants != NULL)
@@ -371,7 +371,7 @@ void
 sv_make_cell_visible (SheetView *sv, int col, int row,
                      gboolean couple_panes)
 {
-       g_return_if_fail (IS_SHEET_VIEW (sv));
+       g_return_if_fail (GNM_IS_SV (sv));
        SHEET_VIEW_FOREACH_CONTROL(sv, control,
                sc_make_cell_visible (control, col, row, couple_panes););
 }
@@ -379,7 +379,7 @@ sv_make_cell_visible (SheetView *sv, int col, int row,
 void
 sv_redraw_range        (SheetView *sv, GnmRange const *r)
 {
-       g_return_if_fail (IS_SHEET_VIEW (sv));
+       g_return_if_fail (GNM_IS_SV (sv));
 
        SHEET_VIEW_FOREACH_CONTROL (sv, sc, sc_redraw_range (sc, r););
 }
@@ -389,7 +389,7 @@ sv_redraw_headers (SheetView const *sv,
                   gboolean col, gboolean row,
                   GnmRange const* r /* optional == NULL */)
 {
-       g_return_if_fail (IS_SHEET_VIEW (sv));
+       g_return_if_fail (GNM_IS_SV (sv));
 
        SHEET_VIEW_FOREACH_CONTROL (sv, control,
                sc_redraw_headers (control, col, row, r););
@@ -400,7 +400,7 @@ sv_selection_copy (SheetView *sv, WorkbookControl *wbc)
 {
        GnmRange const *sel;
 
-       g_return_val_if_fail (IS_SHEET_VIEW (sv), FALSE);
+       g_return_val_if_fail (GNM_IS_SV (sv), FALSE);
        if (!(sel = selection_first_range (sv, GO_CMD_CONTEXT (wbc), _("Copy"))))
                return FALSE;
 
@@ -424,7 +424,7 @@ sv_selection_cut (SheetView *sv, WorkbookControl *wbc)
         * NOTE : This command DOES NOT MOVE ANYTHING !
         *        We only store the src, paste does the move.
         */
-       g_return_val_if_fail (IS_SHEET_VIEW (sv), FALSE);
+       g_return_val_if_fail (GNM_IS_SV (sv), FALSE);
 
        if (!(sel = selection_first_range (sv, GO_CMD_CONTEXT (wbc), _("Cut"))))
                return FALSE;
@@ -456,7 +456,7 @@ sv_cursor_set (SheetView *sv,
 {
        GnmRange r;
 
-       g_return_if_fail (IS_SHEET_VIEW (sv));
+       g_return_if_fail (GNM_IS_SV (sv));
 
        /* Change the edit position */
        sv_set_edit_pos (sv, edit);
@@ -496,7 +496,7 @@ sv_set_edit_pos (SheetView *sv, GnmCellPos const *pos)
        GnmCellPos old;
        GnmRange const *merged;
 
-       g_return_if_fail (IS_SHEET_VIEW (sv));
+       g_return_if_fail (GNM_IS_SV (sv));
        g_return_if_fail (pos != NULL);
 
        old = sv->edit_pos;
@@ -554,7 +554,7 @@ sv_set_edit_pos (SheetView *sv, GnmCellPos const *pos)
 void
 sv_flag_status_update_pos (SheetView *sv, GnmCellPos const *pos)
 {
-       g_return_if_fail (IS_SHEET_VIEW (sv));
+       g_return_if_fail (GNM_IS_SV (sv));
        g_return_if_fail (pos != NULL);
 
        /* if a part of the selected region changed value update
@@ -585,7 +585,7 @@ sv_flag_status_update_pos (SheetView *sv, GnmCellPos const *pos)
 void
 sv_flag_status_update_range (SheetView *sv, GnmRange const *range)
 {
-       g_return_if_fail (IS_SHEET_VIEW (sv));
+       g_return_if_fail (GNM_IS_SV (sv));
 
        /* Force an update */
        if (range == NULL) {
@@ -619,7 +619,7 @@ sv_flag_status_update_range (SheetView *sv, GnmRange const *range)
 void
 sv_flag_style_update_range (SheetView *sv, GnmRange const *range)
 {
-       g_return_if_fail (IS_SHEET_VIEW (sv));
+       g_return_if_fail (GNM_IS_SV (sv));
        g_return_if_fail (range != NULL);
        if (range_contains (range, sv->edit_pos.col, sv->edit_pos.row))
                sv->edit_pos_changed.style  = TRUE;
@@ -636,7 +636,7 @@ sv_flag_style_update_range (SheetView *sv, GnmRange const *range)
 void
 sv_flag_selection_change (SheetView *sv)
 {
-       g_return_if_fail (IS_SHEET_VIEW (sv));
+       g_return_if_fail (GNM_IS_SV (sv));
        sv->selection_content_changed = TRUE;
 }
 
@@ -660,7 +660,7 @@ sheet_view_edit_pos_tool_tips (SheetView *sv)
 void
 sv_update (SheetView *sv)
 {
-       g_return_if_fail (IS_SHEET_VIEW (sv));
+       g_return_if_fail (GNM_IS_SV (sv));
 
        if (sv->edit_pos_changed.content) {
                sv->edit_pos_changed.content = FALSE;
@@ -714,7 +714,7 @@ sv_update (SheetView *sv)
 GnmFilter *
 sv_editpos_in_filter (SheetView const *sv)
 {
-       g_return_val_if_fail (IS_SHEET_VIEW (sv), NULL);
+       g_return_val_if_fail (GNM_IS_SV (sv), NULL);
        return gnm_sheet_filter_at_pos (sv->sheet, &sv->edit_pos);
 }
 
@@ -729,7 +729,7 @@ GnmFilter *
 sv_selection_intersects_filter_rows (SheetView const *sv)
 {
        GnmRange const *r;
-       g_return_val_if_fail (IS_SHEET_VIEW (sv), NULL);
+       g_return_val_if_fail (GNM_IS_SV (sv), NULL);
        r = selection_first_range (sv, NULL, NULL);
 
        return r ? gnm_sheet_filter_intersect_rows
@@ -748,7 +748,7 @@ GnmRange *
 sv_selection_extends_filter (SheetView const *sv, GnmFilter const *f)
 {
        GnmRange const *r;
-       g_return_val_if_fail (IS_SHEET_VIEW (sv), NULL);
+       g_return_val_if_fail (GNM_IS_SV (sv), NULL);
        r = selection_first_range (sv, NULL, NULL);
 
        return gnm_sheet_filter_can_be_extended (sv->sheet, f, r);
@@ -767,7 +767,7 @@ sv_selection_extends_filter (SheetView const *sv, GnmFilter const *f)
 GnmSheetSlicer *
 sv_editpos_in_slicer (SheetView const *sv)
 {
-       g_return_val_if_fail (IS_SHEET_VIEW (sv), NULL);
+       g_return_val_if_fail (GNM_IS_SV (sv), NULL);
        return gnm_sheet_slicers_at_pos (sv->sheet, &sv->edit_pos);
 }
 
@@ -785,7 +785,7 @@ sv_freeze_panes (SheetView *sv,
                 GnmCellPos const *frozen,
                 GnmCellPos const *unfrozen)
 {
-       g_return_if_fail (IS_SHEET_VIEW (sv));
+       g_return_if_fail (GNM_IS_SV (sv));
 
        if (gnm_debug_flag ("frozen-panes")) {
                g_printerr ("Frozen: %-10s",
@@ -854,7 +854,7 @@ sv_panes_insdel_colrow (SheetView *sv, gboolean is_cols,
        GnmCellPos tl;
        GnmCellPos br;
 
-       g_return_if_fail (IS_SHEET_VIEW (sv));
+       g_return_if_fail (GNM_IS_SV (sv));
 
        tl = sv->frozen_top_left;       /* _copy_ them */
        br = sv->unfrozen_top_left;
@@ -900,7 +900,7 @@ sv_panes_insdel_colrow (SheetView *sv, gboolean is_cols,
 gboolean
 sv_is_frozen (SheetView const *sv)
 {
-       g_return_val_if_fail (IS_SHEET_VIEW (sv), FALSE);
+       g_return_val_if_fail (GNM_IS_SV (sv), FALSE);
 
        /* be flexible, in the future we will support 2 way splits too */
        return  sv->unfrozen_top_left.col >= 0 ||
@@ -923,7 +923,7 @@ sv_is_frozen (SheetView const *sv)
 void
 sv_set_initial_top_left (SheetView *sv, int col, int row)
 {
-       g_return_if_fail (IS_SHEET_VIEW (sv));
+       g_return_if_fail (GNM_IS_SV (sv));
        g_return_if_fail (0 <= col && col < gnm_sheet_get_max_cols (sv->sheet));
        g_return_if_fail (0 <= row && row < gnm_sheet_get_max_rows (sv->sheet));
        g_return_if_fail (!sv_is_frozen (sv) ||
diff --git a/src/sheet-view.h b/src/sheet-view.h
index bc3e42c..f659f03 100644
--- a/src/sheet-view.h
+++ b/src/sheet-view.h
@@ -66,10 +66,10 @@ struct _SheetView {
 
 typedef GObjectClass SheetViewClass;
 
-#define SHEET_VIEW_TYPE     (sheet_view_get_type ())
-#define SHEET_VIEW(obj)     (G_TYPE_CHECK_INSTANCE_CAST ((obj), SHEET_VIEW_TYPE, SheetView))
-#define IS_SHEET_VIEW(o)    (G_TYPE_CHECK_INSTANCE_TYPE ((o), SHEET_VIEW_TYPE))
-#define SHEET_VIEW_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), SHEET_VIEW_TYPE, SheetViewClass))
+#define GNM_SV_TYPE     (sheet_view_get_type ())
+#define GNM_SV(obj)     (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNM_SV_TYPE, SheetView))
+#define GNM_IS_SV(o)    (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNM_SV_TYPE))
+#define GNM_SV_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GNM_SV_TYPE, SheetViewClass))
 
 /* Lifecycle */
 GType        sheet_view_get_type (void);
diff --git a/src/sheet.c b/src/sheet.c
index 0fb7297..ec16b3b 100644
--- a/src/sheet.c
+++ b/src/sheet.c
@@ -870,7 +870,7 @@ gnm_sheet_class_init (GObjectClass *gobject_class)
                g_param_spec_object ("workbook",
                                     P_("Parent workbook"),
                                     P_("The workbook in which this sheet lives"),
-                                    WORKBOOK_TYPE,
+                                    GNM_WORKBOOK_TYPE,
                                     GSF_PARAM_STATIC |
                                     G_PARAM_READWRITE |
                                     G_PARAM_CONSTRUCT_ONLY));
@@ -1093,7 +1093,7 @@ gnm_sheet_class_init (GObjectClass *gobject_class)
                 G_STRUCT_OFFSET (GnmSheetClass, detached_from_workbook),
                 NULL, NULL,
                 g_cclosure_marshal_VOID__OBJECT,
-                G_TYPE_NONE, 1, WORKBOOK_TYPE);
+                G_TYPE_NONE, 1, GNM_WORKBOOK_TYPE);
 
 }
 
@@ -1827,7 +1827,7 @@ sheet_reposition_objects (Sheet const *sheet, GnmCellPos const *pos)
 {
        GSList *ptr;
        for (ptr = sheet->sheet_objects; ptr != NULL ; ptr = ptr->next )
-               sheet_object_update_bounds (SHEET_OBJECT (ptr->data), pos);
+               sheet_object_update_bounds (GNM_SO (ptr->data), pos);
 }
 
 /**
@@ -2292,7 +2292,7 @@ sheet_get_extent (Sheet const *sheet, gboolean spans_and_merges_extend, gboolean
        sheet_cell_foreach (sheet, &cb_sheet_get_extent, &closure);
 
        for (ptr = sheet->sheet_objects; ptr; ptr = ptr->next) {
-               SheetObject *so = SHEET_OBJECT (ptr->data);
+               SheetObject *so = GNM_SO (ptr->data);
 
                closure.range.start.col = MIN (so->anchor.cell_bound.start.col,
                                               closure.range.start.col);
@@ -4133,10 +4133,10 @@ sheet_cell_positions (Sheet *sheet, gboolean comments)
                GSList *scomments, *ptr;
 
                range_init_full_sheet (&r, sheet);
-               scomments = sheet_objects_get (sheet, &r, CELL_COMMENT_TYPE);
+               scomments = sheet_objects_get (sheet, &r, GNM_CELL_COMMENT_TYPE);
                for (ptr = scomments; ptr; ptr = ptr->next) {
                        GnmComment *c = ptr->data;
-                       GnmRange const *loc = sheet_object_get_range (SHEET_OBJECT (c));
+                       GnmRange const *loc = sheet_object_get_range (GNM_SO (c));
                        GnmCell *cell = sheet_cell_get (sheet, loc->start.col, loc->start.row);
                        if (!cell) {
                                /* If cell does not exist, we haven't seen it...  */
@@ -4525,7 +4525,7 @@ sheet_destroy_contents (Sheet *sheet)
                GSList *objs = g_slist_copy (sheet->sheet_objects);
                GSList *ptr;
                for (ptr = objs; ptr != NULL ; ptr = ptr->next) {
-                       SheetObject *so = SHEET_OBJECT (ptr->data);
+                       SheetObject *so = GNM_SO (ptr->data);
                        if (so != NULL)
                                sheet_object_clear_sheet (so);
                }
@@ -4740,7 +4740,7 @@ sheet_clear_region (Sheet *sheet,
        if (clear_flags & CLEAR_OBJECTS)
                sheet_objects_clear (sheet, &r, G_TYPE_NONE, NULL);
        else if (clear_flags & CLEAR_COMMENTS)
-               sheet_objects_clear (sheet, &r, CELL_COMMENT_TYPE, NULL);
+               sheet_objects_clear (sheet, &r, GNM_CELL_COMMENT_TYPE, NULL);
 
        /* TODO : how to handle objects ? */
        if (clear_flags & CLEAR_VALUES) {
@@ -6130,10 +6130,10 @@ sheet_get_comment (Sheet const *sheet, GnmCellPos const *pos)
        mr = gnm_sheet_merge_contains_pos (sheet, pos);
 
        if (mr)
-               comments = sheet_objects_get (sheet, mr, CELL_COMMENT_TYPE);
+               comments = sheet_objects_get (sheet, mr, GNM_CELL_COMMENT_TYPE);
        else {
                r.start = r.end = *pos;
-               comments = sheet_objects_get (sheet, &r, CELL_COMMENT_TYPE);
+               comments = sheet_objects_get (sheet, &r, GNM_CELL_COMMENT_TYPE);
        }
        if (!comments)
                return NULL;
diff --git a/src/ssindex.c b/src/ssindex.c
index cc76e00..ab5b383 100644
--- a/src/ssindex.c
+++ b/src/ssindex.c
@@ -213,7 +213,7 @@ ssindex (char const *file, GOIOContext *ioc)
                                g_free (str);
                        } else if (GNM_IS_SO_GRAPH (obj))
                                ssindex_chart (&state,
-                                              (GogObject *)sheet_object_graph_get_gog (SHEET_OBJECT (obj)));
+                                              (GogObject *)sheet_object_graph_get_gog (GNM_SO (obj)));
                }
                g_slist_free (objs);
 
diff --git a/src/stf-export.c b/src/stf-export.c
index f545e70..fe90800 100644
--- a/src/stf-export.c
+++ b/src/stf-export.c
@@ -661,7 +661,7 @@ static void
 gnm_stf_file_saver_save (G_GNUC_UNUSED GOFileSaver const *fs, GOIOContext *context,
                         GoView const *view, GsfOutput *output)
 {
-       WorkbookView *wbv = WORKBOOK_VIEW (view);
+       WorkbookView *wbv = GNM_WORKBOOK_VIEW (view);
        Workbook *wb = wb_view_get_workbook (wbv);
        GnmStfExport *stfe = gnm_stf_get_stfe (G_OBJECT (wb));
        GsfOutput *dummy_sink;
diff --git a/src/stf.c b/src/stf.c
index 98570d2..5c58c12 100644
--- a/src/stf.c
+++ b/src/stf.c
@@ -223,7 +223,7 @@ stf_read_workbook (G_GNUC_UNUSED GOFileOpener const *fo,  gchar const *enc,
        char *name, *nameutf8 = NULL;
        char *data = NULL;
        size_t data_len;
-       WorkbookView *wbv = WORKBOOK_VIEW (view);
+       WorkbookView *wbv = GNM_WORKBOOK_VIEW (view);
 
        if (!GNM_IS_WBC_GTK (context->impl)) {
                go_io_error_string (context, _("This importer can only be used with a GUI."));
@@ -434,7 +434,7 @@ stf_read_workbook_auto_csvtab (G_GNUC_UNUSED GOFileOpener const *fo, gchar const
        int cols, rows, i;
        GStringChunk *lines_chunk;
        GPtrArray *lines;
-       WorkbookView *wbv = WORKBOOK_VIEW (view);
+       WorkbookView *wbv = GNM_WORKBOOK_VIEW (view);
 
        g_return_if_fail (context != NULL);
        g_return_if_fail (wbv != NULL);
@@ -523,7 +523,7 @@ stf_write_csv (G_GNUC_UNUSED GOFileSaver const *fs, GOIOContext *context,
 {
        Sheet *sheet;
        GnmRangeRef const *range;
-       WorkbookView *wbv = WORKBOOK_VIEW (view);
+       WorkbookView *wbv = GNM_WORKBOOK_VIEW (view);
 
        GnmStfExport *config = g_object_new
                (GNM_STF_EXPORT_TYPE,
diff --git a/src/tools/gnm-solver.h b/src/tools/gnm-solver.h
index 3fb1281..73e6eaf 100644
--- a/src/tools/gnm-solver.h
+++ b/src/tools/gnm-solver.h
@@ -189,7 +189,6 @@ GType gnm_solver_result_get_type (void);
 
 #define GNM_SOLVER_TYPE        (gnm_solver_get_type ())
 #define GNM_SOLVER(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), GNM_SOLVER_TYPE, GnmSolver))
-#define GNM_SOLVER_CLASS(k)    (G_TYPE_CHECK_CLASS_CAST ((k), GNM_SOLVER_TYPE, GnmSolverClass))
 #define GNM_IS_SOLVER(o)       (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNM_SOLVER_TYPE))
 
 typedef struct {
@@ -254,7 +253,6 @@ gboolean gnm_solver_debug (void);
 
 #define GNM_SUB_SOLVER_TYPE     (gnm_sub_solver_get_type ())
 #define GNM_SUB_SOLVER(o)       (G_TYPE_CHECK_INSTANCE_CAST ((o), GNM_SUB_SOLVER_TYPE, GnmSubSolver))
-#define GNM_SUB_SOLVER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GNM_SUB_SOLVER_TYPE, GnmSubSolverClass))
 #define GNM_IS_SUB_SOLVER(o)    (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNM_SUB_SOLVER_TYPE))
 
 typedef struct {
diff --git a/src/validation-combo.h b/src/validation-combo.h
index cb12c6d..cc49be9 100644
--- a/src/validation-combo.h
+++ b/src/validation-combo.h
@@ -13,7 +13,7 @@ typedef struct {
 } GnmValidationCombo;
 
 #define GNM_VALIDATION_COMBO_TYPE     (gnm_validation_combo_get_type ())
-#define IS_GNM_VALIDATION_COMBO(obj)  (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNM_VALIDATION_COMBO_TYPE))
+#define GNM_IS_VALIDATION_COMBO(obj)  (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNM_VALIDATION_COMBO_TYPE))
 #define GNM_VALIDATION_COMBO(obj)     (G_TYPE_CHECK_INSTANCE_CAST((obj), GNM_VALIDATION_COMBO_TYPE, 
GnmValidationCombo))
 
 GType gnm_validation_combo_get_type (void);
diff --git a/src/validation.c b/src/validation.c
index f0d9f9a..215d9f2 100644
--- a/src/validation.c
+++ b/src/validation.c
@@ -136,7 +136,7 @@ gnm_validation_combo_new (GnmValidation const *val, SheetView *sv)
 
        vcombo = g_object_new (GNM_VALIDATION_COMBO_TYPE, "sheet-view", sv, NULL);
        gnm_validation_ref (vcombo->validation = val);
-       return SHEET_OBJECT (vcombo);
+       return GNM_SO (vcombo);
 }
 
 /***************************************************************************/
diff --git a/src/wbc-gtk-actions.c b/src/wbc-gtk-actions.c
index f8d1575..199bf52 100644
--- a/src/wbc-gtk-actions.c
+++ b/src/wbc-gtk-actions.c
@@ -1159,9 +1159,9 @@ static GNM_ACTION_DEF (cb_insert_image)
                if (input != NULL) {
                        unsigned len = gsf_input_size (input);
                        guint8 const *data = gsf_input_read (input, len, NULL);
-                       SheetObjectImage *soi = g_object_new (SHEET_OBJECT_IMAGE_TYPE, NULL);
+                       SheetObjectImage *soi = g_object_new (GNM_SO_IMAGE_TYPE, NULL);
                        sheet_object_image_set_image (soi, "", (guint8 *)data, len, TRUE);
-                       wbcg_insert_object (wbcg, SHEET_OBJECT (soi));
+                       wbcg_insert_object (wbcg, GNM_SO (soi));
                        g_object_unref (input);
                } else
                        go_cmd_context_error (GO_CMD_CONTEXT (wbcg), err);
@@ -1170,7 +1170,7 @@ static GNM_ACTION_DEF (cb_insert_image)
        }
 }
 
-static GNM_ACTION_DEF (cb_insert_hyperlink)    { dialog_hyperlink (wbcg, SHEET_CONTROL (wbcg_cur_scg 
(wbcg))); }
+static GNM_ACTION_DEF (cb_insert_hyperlink)    { dialog_hyperlink (wbcg, GNM_SC (wbcg_cur_scg (wbcg))); }
 static GNM_ACTION_DEF (cb_formula_guru)                { dialog_formula_guru (wbcg, NULL); }
 static GNM_ACTION_DEF (cb_insert_sort_ascending) { workbook_cmd_wrap_sort (GNM_WBC (wbcg), 1);}
 static GNM_ACTION_DEF (cb_insert_sort_descending){ workbook_cmd_wrap_sort (GNM_WBC (wbcg), 0);}
diff --git a/src/wbc-gtk-edit.c b/src/wbc-gtk-edit.c
index ed5b9b0..a81e2fd 100644
--- a/src/wbc-gtk-edit.c
+++ b/src/wbc-gtk-edit.c
@@ -1044,7 +1044,7 @@ wbcg_insert_object (WBCGtk *wbcg, SheetObject *so)
                        scg_object_unselect (scg, NULL);
                        scg_cursor_visible (scg, FALSE);
                        scg_set_display_cursor (scg);
-                       sc_unant (SHEET_CONTROL (scg));
+                       sc_unant (GNM_SC (scg));
                }
        }
        /* we can't set wbcg->new_object before now because if one sheet has a
@@ -1187,7 +1187,7 @@ cb_guru_set_focus (G_GNUC_UNUSED GtkWidget *window,
 {
        GnmExprEntry *gee = NULL;
        if (focus_widget != NULL &&
-           IS_GNM_EXPR_ENTRY (gtk_widget_get_parent (focus_widget)))
+           GNM_EXPR_ENTRY_IS (gtk_widget_get_parent (focus_widget)))
                gee = GNM_EXPR_ENTRY (gtk_widget_get_parent (focus_widget));
        wbcg_set_entry (wbcg, gee);
 }
diff --git a/src/wbc-gtk-impl.h b/src/wbc-gtk-impl.h
index ee8abd6..b1b44ee 100644
--- a/src/wbc-gtk-impl.h
+++ b/src/wbc-gtk-impl.h
@@ -151,8 +151,6 @@ typedef struct {
        void (*markup_changed)          (WBCGtk const *wbcg);
 } WBCGtkClass;
 
-#define WORKBOOK_CONTROL_GUI_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GNM_WBC_GTK_TYPE, WBCGtkClass))
-
 #define GNM_RESPONSE_SAVE_ALL -1000
 #define GNM_RESPONSE_DISCARD_ALL -1001
 
@@ -168,7 +166,7 @@ void         wbc_gtk_markup_changer (WBCGtk *wbcg);
 
 gboolean wbc_gtk_load_templates (WBCGtk *gtk);
 
-       G_MODULE_EXPORT void set_uifilename (char const *name, GtkActionEntry const *actions, int nb);
+G_MODULE_EXPORT void set_uifilename (char const *name, GtkActionEntry const *actions, int nb);
 
 G_END_DECLS
 
diff --git a/src/wbc-gtk.c b/src/wbc-gtk.c
index 27b8104..328b14b 100644
--- a/src/wbc-gtk.c
+++ b/src/wbc-gtk.c
@@ -615,7 +615,7 @@ cb_sheet_label_drag_data_get (GtkWidget *widget, GdkDragContext *context,
                              guint info, guint time)
 {
        SheetControlGUI *scg = get_scg (widget);
-       g_return_if_fail (IS_SHEET_CONTROL_GUI (scg));
+       g_return_if_fail (GNM_IS_SCG (scg));
 
        scg_drag_data_get (scg, selection_data);
 }
@@ -659,7 +659,7 @@ cb_sheet_label_drag_data_received (GtkWidget *widget, GdkDragContext *context,
                                       old_state,
                                       s_src);
        } else {
-               g_return_if_fail (IS_SHEET_CONTROL_GUI (gtk_selection_data_get_data (data)));
+               g_return_if_fail (GNM_IS_SCG (gtk_selection_data_get_data (data)));
 
                /* Different workbook, same process */
                g_warning ("Not yet implemented!");
@@ -1023,7 +1023,7 @@ cb_sheet_tab_change (Sheet *sheet,
        GdkRGBA cfore, cback;
        SheetControlGUI *scg = get_scg (widget);
 
-       g_return_if_fail (IS_SHEET_CONTROL_GUI (scg));
+       g_return_if_fail (GNM_IS_SCG (scg));
 
        /* We're lazy and just set all relevant attributes.  */
        g_object_set (widget,
@@ -1057,7 +1057,7 @@ cb_sheet_visibility_change (Sheet *sheet,
 {
        gboolean viz;
 
-       g_return_if_fail (IS_SHEET_CONTROL_GUI (scg));
+       g_return_if_fail (GNM_IS_SCG (scg));
 
        viz = sheet_is_visible (sheet);
        gtk_widget_set_visible (GTK_WIDGET (scg->grid), viz);
@@ -1672,7 +1672,7 @@ wbcg_menu_state_update (WorkbookControl *wbc, int flags)
                        }
                        if (!has_comments) {
                                objs = sheet_objects_get
-                                       (sheet, r, CELL_COMMENT_TYPE);
+                                       (sheet, r, GNM_CELL_COMMENT_TYPE);
                                has_comments = (objs != NULL);
                                g_slist_free (objs);
                        }
@@ -1811,7 +1811,7 @@ wbcg_close_if_user_permits (WBCGtk *wbcg, WorkbookView *wb_view)
        Workbook  *wb = wb_view_get_workbook (wb_view);
        static int in_can_close;
 
-       g_return_val_if_fail (IS_WORKBOOK (wb), 0);
+       g_return_val_if_fail (GNM_IS_WORKBOOK (wb), 0);
 
        if (in_can_close)
                return 0;
@@ -1875,7 +1875,7 @@ wbc_gtk_close (WBCGtk *wbcg)
 {
        WorkbookView *wb_view = wb_control_view (GNM_WBC (wbcg));
 
-       g_return_val_if_fail (IS_WORKBOOK_VIEW (wb_view), TRUE);
+       g_return_val_if_fail (GNM_IS_WORKBOOK_VIEW (wb_view), TRUE);
        g_return_val_if_fail (wb_view->wb_controls != NULL, TRUE);
 
        /* If we were editing when the quit request came make sure we don't
@@ -1893,7 +1893,7 @@ wbc_gtk_close (WBCGtk *wbcg)
        if (wb_view->wb_controls->len <= 1) {
                Workbook *wb = wb_view_get_workbook (wb_view);
 
-               g_return_val_if_fail (IS_WORKBOOK (wb), TRUE);
+               g_return_val_if_fail (GNM_IS_WORKBOOK (wb), TRUE);
                g_return_val_if_fail (wb->wb_views != NULL, TRUE);
 
                /* This is the last view */
@@ -5354,7 +5354,7 @@ cb_graph_dim_entry_changed (GraphDimEditor *editor)
 static void
 set_entry_contents (GnmExprEntry *entry, GOData *val)
 {
-       if (IS_GNM_GO_DATA_SCALAR (val)) {
+       if (GNM_IS_GO_DATA_SCALAR (val)) {
                GnmValue const *v = gnm_expr_top_get_constant (gnm_go_data_get_expr (val));
                if (v && VALUE_IS_NUMBER (v)) {
                        double d = go_data_get_scalar_value (val);
@@ -6015,7 +6015,7 @@ wbcg_find_for_workbook (Workbook *wb,
 {
        gboolean has_screen, has_display;
 
-       g_return_val_if_fail (IS_WORKBOOK (wb), NULL);
+       g_return_val_if_fail (GNM_IS_WORKBOOK (wb), NULL);
        g_return_val_if_fail (candidate == NULL || GNM_IS_WBC_GTK (candidate), NULL);
 
        if (candidate && wb_control_get_workbook (GNM_WBC (candidate)) == wb)
diff --git a/src/widgets/gnm-cell-combo-view-impl.h b/src/widgets/gnm-cell-combo-view-impl.h
index db06705..775ee7c 100644
--- a/src/widgets/gnm-cell-combo-view-impl.h
+++ b/src/widgets/gnm-cell-combo-view-impl.h
@@ -18,9 +18,8 @@ typedef struct {
 
 #define GNM_CCOMBO_VIEW_TYPE    (gnm_ccombo_view_get_type ())
 #define GNM_CCOMBO_VIEW(o)              (G_TYPE_CHECK_INSTANCE_CAST((o), GNM_CCOMBO_VIEW_TYPE, 
GnmCComboView))
-#define IS_GNM_CCOMBO_VIEW(o)   (G_TYPE_CHECK_INSTANCE_TYPE((o), GNM_CCOMBO_VIEW_TYPE))
+#define GNM_IS_CCOMBO_VIEW(o)   (G_TYPE_CHECK_INSTANCE_TYPE((o), GNM_CCOMBO_VIEW_TYPE))
 #define GNM_CCOMBO_VIEW_CLASS(k)        (G_TYPE_CHECK_CLASS_CAST((k), GNM_CCOMBO_CComboViewClass))
-#define IS_GNM_CCOMBO_VIEW_CLASS(k)     (G_TYPE_CHECK_CLASS_TYPE((k), GNM_CCOMBO_VIEW_TYPE))
 #define GNM_CCOMBO_VIEW_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GNM_CCOMBO_VIEW_TYPE, 
GnmCComboViewClass))
 
 GType gnm_ccombo_view_get_type (void);
diff --git a/src/widgets/gnm-dao.h b/src/widgets/gnm-dao.h
index 32394e5..36e1c3d 100644
--- a/src/widgets/gnm-dao.h
+++ b/src/widgets/gnm-dao.h
@@ -27,7 +27,7 @@
 
 #define GNM_DAO_TYPE        (gnm_dao_get_type ())
 #define GNM_DAO(obj)        (G_TYPE_CHECK_INSTANCE_CAST((obj), GNM_DAO_TYPE, GnmDao))
-#define IS_GNM_DAO(obj)     (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNM_DAO_TYPE))
+#define GNM_IS_DAO(obj)     (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNM_DAO_TYPE))
 
 typedef struct _GnmDao GnmDao;
 
diff --git a/src/widgets/gnumeric-cell-renderer-expr-entry.c b/src/widgets/gnumeric-cell-renderer-expr-entry.c
index 01e6d06..ca39a51 100644
--- a/src/widgets/gnumeric-cell-renderer-expr-entry.c
+++ b/src/widgets/gnumeric-cell-renderer-expr-entry.c
@@ -58,7 +58,7 @@ gnumeric_cell_renderer_expr_entry_get_type (void)
                                (GInstanceInitFunc) NULL,
                        };
 
-               cell_expr_entry_type = g_type_register_static (GNUMERIC_TYPE_CELL_RENDERER_TEXT,
+               cell_expr_entry_type = g_type_register_static (GNM_CELL_RENDERER_TEXT_TYPE,
                                                               "GnumericCellRendererExprEntry",
                                                               &cell_expr_entry_info, 0);
        }
@@ -83,8 +83,8 @@ GtkCellRenderer *
 gnumeric_cell_renderer_expr_entry_new (WBCGtk *wbcg)
 {
        GnumericCellRendererExprEntry *this =
-               GNUMERIC_CELL_RENDERER_EXPR_ENTRY(g_object_new
-                                                 (GNUMERIC_TYPE_CELL_RENDERER_EXPR_ENTRY, NULL));
+               GNM_CELL_RENDERER_EXPR_ENTRY(g_object_new
+                                                 (GNM_CELL_RENDERER_EXPR_ENTRY_TYPE, NULL));
        this->wbcg = wbcg;
        return GTK_CELL_RENDERER (this);
 }
@@ -121,7 +121,7 @@ gnumeric_cell_renderer_expr_entry_start_editing (GtkCellRenderer      *cell,
   GnmExprEntry *gentry;
   char *text;
 
-  celltext = GNUMERIC_CELL_RENDERER_EXPR_ENTRY (cell);
+  celltext = GNM_CELL_RENDERER_EXPR_ENTRY (cell);
 
   /* If the cell isn't editable we return NULL. */
   if (gtk_cell_renderer_text_get_editable (celltext) == FALSE)
diff --git a/src/widgets/gnumeric-cell-renderer-expr-entry.h b/src/widgets/gnumeric-cell-renderer-expr-entry.h
index 5fc6f26..fd3a35f 100644
--- a/src/widgets/gnumeric-cell-renderer-expr-entry.h
+++ b/src/widgets/gnumeric-cell-renderer-expr-entry.h
@@ -25,12 +25,9 @@
 
 G_BEGIN_DECLS
 
-#define GNUMERIC_TYPE_CELL_RENDERER_EXPR_ENTRY         (gnumeric_cell_renderer_expr_entry_get_type ())
-#define GNUMERIC_CELL_RENDERER_EXPR_ENTRY(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), 
GNUMERIC_TYPE_CELL_RENDERER_EXPR_ENTRY, GnumericCellRendererExprEntry))
-#define GNUMERIC_CELL_RENDERER_EXPR_ENTRY_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST ((k), 
GNUMERIC_TYPE_CELL_RENDERER_EXPR_ENTRY, GnumericCellRendererExprEntryClass))
-#define GNUMERIC_IS_CELL_RENDERER_EXPR_ENTRY(o)                (G_TYPE_CHECK_INSTANCE_TYPE ((o), 
GNUMERIC_TYPE_CELL_RENDERER_EXPR_ENTRY))
-#define GNUMERIC_IS_CELL_RENDERER_EXPR_ENTRY_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), 
GNUMERIC_TYPE_CELL_RENDERER_EXPR_ENTRY))
-#define GNUMERIC_CELL_RENDERER_EXPR_ENTRY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), 
GNUMERIC_TYPE_CELL_RENDERER_EXPR_ENTRY, GnumericCellRendererExprEntryClass))
+#define GNM_CELL_RENDERER_EXPR_ENTRY_TYPE              (gnumeric_cell_renderer_expr_entry_get_type ())
+#define GNM_CELL_RENDERER_EXPR_ENTRY(o)                (G_TYPE_CHECK_INSTANCE_CAST ((o), 
GNM_CELL_RENDERER_EXPR_ENTRY_TYPE, GnumericCellRendererExprEntry))
+#define GNM_IS_CELL_RENDERER_EXPR_ENTRY(o)             (G_TYPE_CHECK_INSTANCE_TYPE ((o), 
GNM_CELL_RENDERER_EXPR_ENTRY_TYPE))
 
 typedef struct _GnumericCellRendererExprEntry      GnumericCellRendererExprEntry;
 typedef struct _GnumericCellRendererExprEntryClass GnumericCellRendererExprEntryClass;
diff --git a/src/widgets/gnumeric-cell-renderer-text.c b/src/widgets/gnumeric-cell-renderer-text.c
index d10e769..c09d629 100644
--- a/src/widgets/gnumeric-cell-renderer-text.c
+++ b/src/widgets/gnumeric-cell-renderer-text.c
@@ -124,5 +124,5 @@ gnumeric_cell_renderer_text_class_init (GnumericCellRendererTextClass *class)
 GtkCellRenderer *
 gnumeric_cell_renderer_text_new (void)
 {
-       return GTK_CELL_RENDERER (g_object_new (GNUMERIC_TYPE_CELL_RENDERER_TEXT, NULL));
+       return GTK_CELL_RENDERER (g_object_new (GNM_CELL_RENDERER_TEXT_TYPE, NULL));
 }
diff --git a/src/widgets/gnumeric-cell-renderer-text.h b/src/widgets/gnumeric-cell-renderer-text.h
index 6c23ae1..c52d4a2 100644
--- a/src/widgets/gnumeric-cell-renderer-text.h
+++ b/src/widgets/gnumeric-cell-renderer-text.h
@@ -23,12 +23,9 @@
 
 G_BEGIN_DECLS
 
-#define GNUMERIC_TYPE_CELL_RENDERER_TEXT        (gnumeric_cell_renderer_text_get_type ())
-#define GNUMERIC_CELL_RENDERER_TEXT(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), 
GNUMERIC_TYPE_CELL_RENDERER_TEXT, GnumericCellRendererText))
-#define GNUMERIC_CELL_RENDERER_TEXT_CLASS(k)    (G_TYPE_CHECK_CLASS_CAST ((k), 
GNUMERIC_TYPE_CELL_RENDERER_TEXT, GnumericCellRendererTextClass))
-#define GNUMERIC_IS_CELL_RENDERER_TEXT(o)       (G_TYPE_CHECK_INSTANCE_TYPE ((o), 
GNUMERIC_TYPE_CELL_RENDERER_TEXT))
-#define GNUMERIC_IS_CELL_RENDERER_TEXT_CLASS(k)         (G_TYPE_CHECK_CLASS_TYPE ((k), 
GNUMERIC_TYPE_CELL_RENDERER_TEXT))
-#define GNUMERIC_CELL_RENDERER_TEXT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), 
GNUMERIC_TYPE_CELL_RENDERER_TEXT, GnumericCellRendererTextClass))
+#define GNM_CELL_RENDERER_TEXT_TYPE     (gnumeric_cell_renderer_text_get_type ())
+#define GNM_CELL_RENDERER_TEXT(o)               (G_TYPE_CHECK_INSTANCE_CAST ((o), 
GNM_CELL_RENDERER_TEXT_TYPE, GnumericCellRendererText))
+#define GNM_IS_CELL_RENDERER_TEXT(o)    (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNM_CELL_RENDERER_TEXT_TYPE))
 
 typedef struct _GnumericCellRendererText      GnumericCellRendererText;
 typedef struct _GnumericCellRendererTextClass GnumericCellRendererTextClass;
diff --git a/src/widgets/gnumeric-cell-renderer-toggle.c b/src/widgets/gnumeric-cell-renderer-toggle.c
index a5e0b33..f0dc5c5 100644
--- a/src/widgets/gnumeric-cell-renderer-toggle.c
+++ b/src/widgets/gnumeric-cell-renderer-toggle.c
@@ -90,7 +90,7 @@ gnumeric_cell_renderer_toggle_get_type (void)
 static void
 gnumeric_cell_renderer_toggle_dispose (GObject *obj)
 {
-       GnumericCellRendererToggle *celltoggle = GNUMERIC_CELL_RENDERER_TOGGLE (obj);
+       GnumericCellRendererToggle *celltoggle = GNM_CELL_RENDERER_TOGGLE (obj);
        g_clear_object (&celltoggle->pixbuf);
        G_OBJECT_CLASS (parent_class)->dispose (obj);
 }
@@ -123,7 +123,7 @@ gnumeric_cell_renderer_toggle_class_init (GnumericCellRendererToggleClass *class
 GtkCellRenderer *
 gnumeric_cell_renderer_toggle_new (void)
 {
-       return GTK_CELL_RENDERER (g_object_new (GNUMERIC_TYPE_CELL_RENDERER_TOGGLE, NULL));
+       return GTK_CELL_RENDERER (g_object_new (GNM_CELL_RENDERER_TOGGLE_TYPE, NULL));
 }
 
 static void
@@ -132,7 +132,7 @@ gnumeric_cell_renderer_toggle_get_property (GObject     *object,
                                            GValue      *value,
                                            GParamSpec  *pspec)
 {
-       GnumericCellRendererToggle *celltoggle = GNUMERIC_CELL_RENDERER_TOGGLE (object);
+       GnumericCellRendererToggle *celltoggle = GNM_CELL_RENDERER_TOGGLE (object);
 
        switch (param_id) {
        case PROP_PIXBUF:
@@ -151,7 +151,7 @@ gnumeric_cell_renderer_toggle_set_property (GObject      *object,
                                            const GValue *value,
                                            GParamSpec   *pspec)
 {
-       GnumericCellRendererToggle *celltoggle = GNUMERIC_CELL_RENDERER_TOGGLE (object);
+       GnumericCellRendererToggle *celltoggle = GNM_CELL_RENDERER_TOGGLE (object);
        GdkPixbuf *pixbuf;
 
        switch (param_id) {
diff --git a/src/widgets/gnumeric-cell-renderer-toggle.h b/src/widgets/gnumeric-cell-renderer-toggle.h
index c916a37..3be150d 100644
--- a/src/widgets/gnumeric-cell-renderer-toggle.h
+++ b/src/widgets/gnumeric-cell-renderer-toggle.h
@@ -27,12 +27,9 @@
 
 G_BEGIN_DECLS
 
-#define GNUMERIC_TYPE_CELL_RENDERER_TOGGLE             (gnumeric_cell_renderer_toggle_get_type ())
-#define GNUMERIC_CELL_RENDERER_TOGGLE(o)               (G_TYPE_CHECK_INSTANCE_CAST ((o), 
GNUMERIC_TYPE_CELL_RENDERER_TOGGLE, GnumericCellRendererToggle))
-#define GNUMERIC_CELL_RENDERER_TOGGLE_CLASS(k)         (G_TYPE_CHECK_CLASS_CAST ((k), 
GNUMERIC_TYPE_CELL_RENDERER_TOGGLE, GnumericCellRendererToggleClass))
-#define GNUMERIC_IS_CELL_RENDERER_TOGGLE(o)            (G_TYPE_CHECK_INSTANCE_TYPE ((o), 
GNUMERIC_TYPE_CELL_RENDERER_TOGGLE))
-#define GNUMERIC_IS_CELL_RENDERER_TOGGLE_CLASS(k)      (G_TYPE_CHECK_CLASS_TYPE ((k), 
GNUMERIC_TYPE_CELL_RENDERER_TOGGLE))
-#define GNUMERIC_CELL_RENDERER_TOGGLE_GET_CLASS(o)i    (G_TYPE_INSTANCE_GET_CLASS ((o), 
GNUMERIC_TYPE_CELL_RENDERER_TOGGLE, GnumericCellRendererToggleClass))
+#define GNM_CELL_RENDERER_TOGGLE_TYPE          (gnumeric_cell_renderer_toggle_get_type ())
+#define GNM_CELL_RENDERER_TOGGLE(o)            (G_TYPE_CHECK_INSTANCE_CAST ((o), 
GNM_CELL_RENDERER_TOGGLE_TYPE, GnumericCellRendererToggle))
+#define GNM_IS_CELL_RENDERER_TOGGLE(o)         (G_TYPE_CHECK_INSTANCE_TYPE ((o), 
GNM_CELL_RENDERER_TOGGLE_TYPE))
 
 typedef struct _GnumericCellRendererToggle      GnumericCellRendererToggle;
 typedef struct _GnumericCellRendererToggleClass GnumericCellRendererToggleClass;
diff --git a/src/widgets/gnumeric-dashed-canvas-line.c b/src/widgets/gnumeric-dashed-canvas-line.c
index f5a6d84..cf96f8a 100644
--- a/src/widgets/gnumeric-dashed-canvas-line.c
+++ b/src/widgets/gnumeric-dashed-canvas-line.c
@@ -142,7 +142,7 @@ double_line_draw (GocItem const *item, GnmStyleBorderType const i, cairo_t *cr)
 static void
 gnumeric_dashed_canvas_line_draw (GocItem const *item, cairo_t *cr)
 {
-       GnumericDashedCanvasLine *line = GNUMERIC_DASHED_CANVAS_LINE (item);
+       GnumericDashedCanvasLine *line = GNM_DASHED_CANVAS_LINE (item);
 
        if (line->dash_style_index == GNM_STYLE_BORDER_DOUBLE)
                double_line_draw (item, line->dash_style_index, cr);
diff --git a/src/widgets/gnumeric-dashed-canvas-line.h b/src/widgets/gnumeric-dashed-canvas-line.h
index 8be223b..c348565 100644
--- a/src/widgets/gnumeric-dashed-canvas-line.h
+++ b/src/widgets/gnumeric-dashed-canvas-line.h
@@ -5,16 +5,12 @@
 #include <goffice/goffice.h>
 #include "style-border.h"
 
-#define GNUMERIC_TYPE_DASHED_CANVAS_LINE\
+#define GNM_DASHED_CANVAS_LINE_TYPE\
     (gnumeric_dashed_canvas_line_get_type ())
-#define GNUMERIC_DASHED_CANVAS_LINE(obj)\
-    (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNUMERIC_TYPE_DASHED_CANVAS_LINE, GnumericDashedCanvasLine))
-#define GNUMERIC_DASHED_CANVAS_LINE_CLASS(klass)\
-    (G_TYPE_CHECK_CLASS_CAST ((klass), GNUMERIC_TYPE_DASHED_CANVAS_LINE, GnumericDashedCanvasLineClass))
-#define GNUMERIC_IS_DASHED_CANVAS_LINE(obj)\
-    (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNUMERIC_TYPE_DASHED_CANVAS_LINE))
-#define GNUMERIC_IS_DASHED_CANVAS_LINE_CLASS(klass)\
-    (G_TYPE_CHECK_CLASS_TYPE ((klass), GNUMERIC_TYPE_DASHED_CANVAS_LINE))
+#define GNM_DASHED_CANVAS_LINE(obj)\
+    (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNM_DASHED_CANVAS_LINE_TYPE, GnumericDashedCanvasLine))
+#define GNM_IS_DASHED_CANVAS_LINE(obj)\
+    (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNM_DASHED_CANVAS_LINE_TYPE))
 
 
 typedef struct _GnumericDashedCanvasLine GnumericDashedCanvasLine;
diff --git a/src/widgets/gnumeric-expr-entry.c b/src/widgets/gnumeric-expr-entry.c
index 09dbaf2..228220e 100644
--- a/src/widgets/gnumeric-expr-entry.c
+++ b/src/widgets/gnumeric-expr-entry.c
@@ -504,7 +504,7 @@ gee_set_property (GObject      *object,
                break;
        case PROP_SCG:
                gnm_expr_entry_set_scg (gee,
-                       SHEET_CONTROL_GUI (g_value_get_object (value)));
+                       GNM_SCG (g_value_get_object (value)));
                break;
        case PROP_WBCG:
                g_return_if_fail (gee->wbcg == NULL);
@@ -1520,7 +1520,7 @@ cb_gee_button_press_event (G_GNUC_UNUSED GtkEntry *entry,
                           G_GNUC_UNUSED GdkEventButton *event,
                           GnmExprEntry *gee)
 {
-       g_return_val_if_fail (IS_GNM_EXPR_ENTRY (gee), FALSE);
+       g_return_val_if_fail (GNM_EXPR_ENTRY_IS (gee), FALSE);
 
        if (gee->scg) {
                scg_rangesel_stop (gee->scg, FALSE);
@@ -1729,7 +1729,7 @@ gee_class_init (GObjectClass *gobject_class)
                 g_param_spec_object ("scg",
                                      P_("SheetControlGUI"),
                                      P_("The GUI container associated with the entry."),
-                                     SHEET_CONTROL_GUI_TYPE,
+                                     GNM_SCG_TYPE,
                                      GSF_PARAM_STATIC | G_PARAM_READWRITE));
 
        g_object_class_install_property
@@ -2122,7 +2122,7 @@ gnm_expr_entry_rangesel_stop (GnmExprEntry *gee,
 {
        Rangesel *rs;
 
-       g_return_if_fail (IS_GNM_EXPR_ENTRY (gee));
+       g_return_if_fail (GNM_EXPR_ENTRY_IS (gee));
 
        rs = &gee->rangesel;
        if (clear_string && rs->text_end > rs->text_start)
@@ -2224,7 +2224,7 @@ void
 gnm_expr_entry_set_update_policy (GnmExprEntry *gee,
                                       GnmUpdateType  policy)
 {
-       g_return_if_fail (IS_GNM_EXPR_ENTRY (gee));
+       g_return_if_fail (GNM_EXPR_ENTRY_IS (gee));
 
        if (gee->update_policy == policy)
                return;
@@ -2256,7 +2256,7 @@ gnm_expr_entry_new (WBCGtk *wbcg, gboolean with_icon)
 void
 gnm_expr_entry_freeze (GnmExprEntry *gee)
 {
-       g_return_if_fail (IS_GNM_EXPR_ENTRY (gee));
+       g_return_if_fail (GNM_EXPR_ENTRY_IS (gee));
 
        gee->freeze_count++;
 }
@@ -2264,7 +2264,7 @@ gnm_expr_entry_freeze (GnmExprEntry *gee)
 void
 gnm_expr_entry_thaw (GnmExprEntry *gee)
 {
-       g_return_if_fail (IS_GNM_EXPR_ENTRY (gee));
+       g_return_if_fail (GNM_EXPR_ENTRY_IS (gee));
 
        if (gee->freeze_count > 0 && (--gee->freeze_count) == 0) {
                gee_rangesel_update_text (gee);
@@ -2305,7 +2305,7 @@ gnm_expr_entry_set_flags (GnmExprEntry *gee,
                          GnmExprEntryFlags mask)
 {
        GnmExprEntryFlags newflags;
-       g_return_if_fail (IS_GNM_EXPR_ENTRY (gee));
+       g_return_if_fail (GNM_EXPR_ENTRY_IS (gee));
 
        newflags = (gee->flags & ~mask) | (flags & mask);
        if (gee->flags == newflags)
@@ -2327,8 +2327,8 @@ gnm_expr_entry_set_flags (GnmExprEntry *gee,
 void
 gnm_expr_entry_set_scg (GnmExprEntry *gee, SheetControlGUI *scg)
 {
-       g_return_if_fail (IS_GNM_EXPR_ENTRY (gee));
-       g_return_if_fail (scg == NULL || IS_SHEET_CONTROL_GUI (scg));
+       g_return_if_fail (GNM_EXPR_ENTRY_IS (gee));
+       g_return_if_fail (scg == NULL || GNM_IS_SCG (scg));
 
        if ((gee->flags & GNM_EE_SINGLE_RANGE) || scg != gee->scg)
                gee_rangesel_reset (gee);
@@ -2338,7 +2338,7 @@ gnm_expr_entry_set_scg (GnmExprEntry *gee, SheetControlGUI *scg)
        if (scg) {
                g_object_weak_ref (G_OBJECT (gee->scg),
                                   (GWeakNotify) cb_scg_destroy, gee);
-               gee->sheet = sc_sheet (SHEET_CONTROL (scg));
+               gee->sheet = sc_sheet (GNM_SC (scg));
                parse_pos_init_editpos (&gee->pp, scg_view (gee->scg));
                gee->wbcg = scg_wbcg (gee->scg);
        } else
@@ -2369,7 +2369,7 @@ gnm_expr_entry_get_scg (GnmExprEntry *gee)
 void
 gnm_expr_entry_load_from_text (GnmExprEntry *gee, char const *txt)
 {
-       g_return_if_fail (IS_GNM_EXPR_ENTRY (gee));
+       g_return_if_fail (GNM_EXPR_ENTRY_IS (gee));
        /* We have nowhere to store the text while frozen. */
        g_return_if_fail (gee->freeze_count == 0);
 
@@ -2393,7 +2393,7 @@ gnm_expr_entry_load_from_text (GnmExprEntry *gee, char const *txt)
 void
 gnm_expr_entry_load_from_dep (GnmExprEntry *gee, GnmDependent const *dep)
 {
-       g_return_if_fail (IS_GNM_EXPR_ENTRY (gee));
+       g_return_if_fail (GNM_EXPR_ENTRY_IS (gee));
        g_return_if_fail (dep != NULL);
        /* We have nowhere to store the text while frozen. */
        g_return_if_fail (gee->freeze_count == 0);
@@ -2430,7 +2430,7 @@ gnm_expr_entry_load_from_expr (GnmExprEntry *gee,
                               GnmExprTop const *texpr,
                               GnmParsePos const *pp)
 {
-       g_return_if_fail (IS_GNM_EXPR_ENTRY (gee));
+       g_return_if_fail (GNM_EXPR_ENTRY_IS (gee));
        /* We have nowhere to store the text while frozen. */
        g_return_if_fail (gee->freeze_count == 0);
 
@@ -2469,7 +2469,7 @@ gnm_expr_entry_load_from_range (GnmExprEntry *gee,
        GnmRangeRef ref;
        gboolean needs_change = FALSE;
 
-       g_return_val_if_fail (IS_GNM_EXPR_ENTRY (gee), FALSE);
+       g_return_val_if_fail (GNM_EXPR_ENTRY_IS (gee), FALSE);
        g_return_val_if_fail (IS_SHEET (sheet), FALSE);
        g_return_val_if_fail (r != NULL, FALSE);
 
@@ -2527,7 +2527,7 @@ gnm_expr_entry_get_rangesel (GnmExprEntry const *gee,
        GnmRangeRef ref;
        Rangesel const *rs = &gee->rangesel;
 
-       g_return_val_if_fail (IS_GNM_EXPR_ENTRY (gee), FALSE);
+       g_return_val_if_fail (GNM_EXPR_ENTRY_IS (gee), FALSE);
 
        gee_prepare_range (gee, &ref);
 
@@ -2561,7 +2561,7 @@ gnm_expr_entry_can_rangesel (GnmExprEntry *gee)
 {
        char const *text;
 
-       g_return_val_if_fail (IS_GNM_EXPR_ENTRY (gee), FALSE);
+       g_return_val_if_fail (GNM_EXPR_ENTRY_IS (gee), FALSE);
 
        if (wbc_gtk_get_guru (gee->wbcg) != NULL &&
            gee == gee->wbcg->edit_line.entry)
@@ -2596,7 +2596,7 @@ gnm_expr_entry_parse (GnmExprEntry *gee, GnmParsePos const *pp,
        char *str;
        GnmExprTop const *texpr;
 
-       g_return_val_if_fail (IS_GNM_EXPR_ENTRY (gee), NULL);
+       g_return_val_if_fail (GNM_EXPR_ENTRY_IS (gee), NULL);
 
        text = gtk_entry_get_text (gee->entry);
 
@@ -2656,7 +2656,7 @@ gnm_expr_entry_parse (GnmExprEntry *gee, GnmParsePos const *pp,
                SheetControlGUI *scg = wbcg_cur_scg (gee->wbcg);
                Rangesel const *rs = &gee->rangesel;
                if (gee == wbcg_get_entry_logical (gee->wbcg) &&
-                   start_sel && sc_sheet (SHEET_CONTROL (scg)) == rs->ref.a.sheet) {
+                   start_sel && sc_sheet (GNM_SC (scg)) == rs->ref.a.sheet) {
                        scg_rangesel_bound (scg,
                                rs->ref.a.col, rs->ref.a.row,
                                rs->ref.b.col, rs->ref.b.row);
@@ -2683,7 +2683,7 @@ gnm_expr_entry_parse (GnmExprEntry *gee, GnmParsePos const *pp,
 char const *
 gnm_expr_entry_get_text        (GnmExprEntry const *gee)
 {
-       g_return_val_if_fail (IS_GNM_EXPR_ENTRY (gee), NULL);
+       g_return_val_if_fail (GNM_EXPR_ENTRY_IS (gee), NULL);
        return gtk_entry_get_text (gee->entry);
 }
 
@@ -2703,7 +2703,7 @@ gnm_expr_entry_parse_as_value (GnmExprEntry *gee, Sheet *sheet)
        GnmValue *v;
        const char *txt;
 
-       g_return_val_if_fail (IS_GNM_EXPR_ENTRY (gee), NULL);
+       g_return_val_if_fail (GNM_EXPR_ENTRY_IS (gee), NULL);
 
        if ((gee->flags & GNM_EE_FORCE_ABS_REF))
                flags |= GNM_EXPR_PARSE_FORCE_ABSOLUTE_REFERENCES;
@@ -2738,7 +2738,7 @@ gnm_expr_entry_parse_as_value (GnmExprEntry *gee, Sheet *sheet)
 GSList *
 gnm_expr_entry_parse_as_list (GnmExprEntry *gee, Sheet *sheet)
 {
-       g_return_val_if_fail (IS_GNM_EXPR_ENTRY (gee), NULL);
+       g_return_val_if_fail (GNM_EXPR_ENTRY_IS (gee), NULL);
 
        return global_range_list_parse (sheet,
                gtk_entry_get_text (gnm_expr_entry_get_entry (gee)));
@@ -2753,7 +2753,7 @@ gnm_expr_entry_parse_as_list (GnmExprEntry *gee, Sheet *sheet)
 GtkEntry *
 gnm_expr_entry_get_entry (GnmExprEntry *gee)
 {
-       g_return_val_if_fail (IS_GNM_EXPR_ENTRY (gee), NULL);
+       g_return_val_if_fail (GNM_EXPR_ENTRY_IS (gee), NULL);
 
        return gee->entry;
 }
@@ -2765,7 +2765,7 @@ gnm_expr_entry_is_cell_ref (GnmExprEntry *gee, Sheet *sheet,
         GnmValue *val;
        gboolean res;
 
-       g_return_val_if_fail (IS_GNM_EXPR_ENTRY (gee), FALSE);
+       g_return_val_if_fail (GNM_EXPR_ENTRY_IS (gee), FALSE);
 
        val = gnm_expr_entry_parse_as_value (gee, sheet);
         if (val == NULL)
@@ -2786,7 +2786,7 @@ gnm_expr_entry_is_blank   (GnmExprEntry *gee)
        GtkEntry *entry;
        char const *text;
 
-       g_return_val_if_fail (IS_GNM_EXPR_ENTRY (gee), FALSE);
+       g_return_val_if_fail (GNM_EXPR_ENTRY_IS (gee), FALSE);
 
        entry = gnm_expr_entry_get_entry (gee);
 
@@ -2809,7 +2809,7 @@ gnm_expr_entry_global_range_name (GnmExprEntry *gee, Sheet *sheet)
        GnmValue *val;
        char *text = NULL;
 
-       g_return_val_if_fail (IS_GNM_EXPR_ENTRY (gee), NULL);
+       g_return_val_if_fail (GNM_EXPR_ENTRY_IS (gee), NULL);
 
        val = gnm_expr_entry_parse_as_value (gee, sheet);
        if (val != NULL) {
@@ -2824,7 +2824,7 @@ gnm_expr_entry_global_range_name (GnmExprEntry *gee, Sheet *sheet)
 void
 gnm_expr_entry_grab_focus (GnmExprEntry *gee, gboolean select_all)
 {
-       g_return_if_fail (IS_GNM_EXPR_ENTRY (gee));
+       g_return_if_fail (GNM_EXPR_ENTRY_IS (gee));
 
        gtk_widget_grab_focus (GTK_WIDGET (gee->entry));
        if (select_all) {
@@ -2836,7 +2836,7 @@ gnm_expr_entry_grab_focus (GnmExprEntry *gee, gboolean select_all)
 gboolean
 gnm_expr_entry_editing_canceled (GnmExprEntry *gee)
 {
-       g_return_val_if_fail (IS_GNM_EXPR_ENTRY (gee), TRUE);
+       g_return_val_if_fail (GNM_EXPR_ENTRY_IS (gee), TRUE);
 
        return gee->editing_canceled;
 }
diff --git a/src/widgets/gnumeric-expr-entry.h b/src/widgets/gnumeric-expr-entry.h
index 9f87b71..864dd6b 100644
--- a/src/widgets/gnumeric-expr-entry.h
+++ b/src/widgets/gnumeric-expr-entry.h
@@ -7,7 +7,7 @@
 
 #define GNM_EXPR_ENTRY_TYPE    (gnm_expr_entry_get_type ())
 #define GNM_EXPR_ENTRY(o)      (G_TYPE_CHECK_INSTANCE_CAST ((o), GNM_EXPR_ENTRY_TYPE, GnmExprEntry))
-#define IS_GNM_EXPR_ENTRY(o)   (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNM_EXPR_ENTRY_TYPE))
+#define GNM_EXPR_ENTRY_IS(o)   (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNM_EXPR_ENTRY_TYPE))
 
 typedef struct _GnmExprEntry GnmExprEntry;
 
diff --git a/src/widgets/gnumeric-lazy-list.c b/src/widgets/gnumeric-lazy-list.c
index 7a33e3f..b6b9795 100644
--- a/src/widgets/gnumeric-lazy-list.c
+++ b/src/widgets/gnumeric-lazy-list.c
@@ -10,7 +10,7 @@ static GObjectClass *lazy_list_parent_class = NULL;
 static void
 lazy_list_finalize (GObject *object)
 {
-       GnumericLazyList *ll = GNUMERIC_LAZY_LIST (object);
+       GnumericLazyList *ll = GNM_LAZY_LIST (object);
 
        g_free (ll->column_headers);
 
@@ -45,7 +45,7 @@ lazy_list_class_init (GnumericLazyListClass *class)
 static GtkTreeModelFlags
 lazy_list_get_flags (GtkTreeModel *tree_model)
 {
-       g_return_val_if_fail (GNUMERIC_IS_LAZY_LIST (tree_model), 0);
+       g_return_val_if_fail (GNM_IS_LAZY_LIST (tree_model), 0);
 
        return GTK_TREE_MODEL_ITERS_PERSIST | GTK_TREE_MODEL_LIST_ONLY;
 }
@@ -55,7 +55,7 @@ lazy_list_get_n_columns (GtkTreeModel *tree_model)
 {
        GnumericLazyList *ll = (GnumericLazyList *) tree_model;
 
-       g_return_val_if_fail (GNUMERIC_IS_LAZY_LIST (tree_model), 0);
+       g_return_val_if_fail (GNM_IS_LAZY_LIST (tree_model), 0);
 
        return ll->cols;
 }
@@ -66,7 +66,7 @@ lazy_list_get_column_type (GtkTreeModel *tree_model,
 {
        GnumericLazyList *ll = (GnumericLazyList *) tree_model;
 
-       g_return_val_if_fail (GNUMERIC_IS_LAZY_LIST (tree_model), G_TYPE_INVALID);
+       g_return_val_if_fail (GNM_IS_LAZY_LIST (tree_model), G_TYPE_INVALID);
        g_return_val_if_fail (index >= 0 && index < ll->cols, G_TYPE_INVALID);
 
        return ll->column_headers[index];
@@ -80,7 +80,7 @@ lazy_list_get_iter (GtkTreeModel *tree_model,
        GnumericLazyList *ll = (GnumericLazyList *) tree_model;
        gint i;
 
-       g_return_val_if_fail (GNUMERIC_IS_LAZY_LIST (tree_model), FALSE);
+       g_return_val_if_fail (GNM_IS_LAZY_LIST (tree_model), FALSE);
        g_return_val_if_fail (gtk_tree_path_get_depth (path) > 0, FALSE);
 
        i = gtk_tree_path_get_indices (path)[0];
@@ -111,7 +111,7 @@ lazy_list_get_value (GtkTreeModel *tree_model,
        gint row;
        GnumericLazyList *ll = (GnumericLazyList *) tree_model;
 
-       g_return_if_fail (GNUMERIC_IS_LAZY_LIST (tree_model));
+       g_return_if_fail (GNM_IS_LAZY_LIST (tree_model));
        row = GPOINTER_TO_INT (iter->user_data);
 
        if (ll->get_value)
@@ -127,7 +127,7 @@ lazy_list_iter_next (GtkTreeModel  *tree_model,
        gint row;
        GnumericLazyList *ll = (GnumericLazyList *) tree_model;
 
-       g_return_val_if_fail (GNUMERIC_IS_LAZY_LIST (tree_model), FALSE);
+       g_return_val_if_fail (GNM_IS_LAZY_LIST (tree_model), FALSE);
        row = GPOINTER_TO_INT (iter->user_data);
        row++;
        iter->user_data = GINT_TO_POINTER (row);
@@ -166,9 +166,9 @@ static gint
 lazy_list_iter_n_children (GtkTreeModel *tree_model,
                           GtkTreeIter  *iter)
 {
-       g_return_val_if_fail (GNUMERIC_IS_LAZY_LIST (tree_model), -1);
+       g_return_val_if_fail (GNM_IS_LAZY_LIST (tree_model), -1);
        if (iter == NULL)
-               return GNUMERIC_LAZY_LIST (tree_model)->rows;
+               return GNM_LAZY_LIST (tree_model)->rows;
 
        return 0;
 }
@@ -181,7 +181,7 @@ lazy_list_iter_nth_child (GtkTreeModel *tree_model,
 {
        GnumericLazyList *ll = (GnumericLazyList *) tree_model;
 
-       g_return_val_if_fail (GNUMERIC_IS_LAZY_LIST (tree_model), FALSE);
+       g_return_val_if_fail (GNM_IS_LAZY_LIST (tree_model), FALSE);
 
        if (parent)
                return FALSE;
@@ -266,7 +266,7 @@ gnumeric_lazy_list_new (GnumericLazyListValueGetFunc get_value,
        g_return_val_if_fail (n_rows >= 0, NULL);
        g_return_val_if_fail (n_columns >= 0, NULL);
 
-       retval = GNUMERIC_LAZY_LIST (g_object_new (gnumeric_lazy_list_get_type (), NULL));
+       retval = GNM_LAZY_LIST (g_object_new (gnumeric_lazy_list_get_type (), NULL));
        retval->get_value = get_value;
        retval->user_data = user_data;
        retval->rows = n_rows;
@@ -286,7 +286,7 @@ gnumeric_lazy_list_add_column (GnumericLazyList *ll, int count, GType typ)
 {
        int i;
 
-       g_return_if_fail (GNUMERIC_IS_LAZY_LIST (ll));
+       g_return_if_fail (GNM_IS_LAZY_LIST (ll));
        g_return_if_fail (count >= 0);
 
        ll->column_headers = g_renew (GType, ll->column_headers,
diff --git a/src/widgets/gnumeric-lazy-list.h b/src/widgets/gnumeric-lazy-list.h
index af60135..c1c2504 100644
--- a/src/widgets/gnumeric-lazy-list.h
+++ b/src/widgets/gnumeric-lazy-list.h
@@ -37,12 +37,9 @@
 
 G_BEGIN_DECLS
 
-#define GNUMERIC_TYPE_LAZY_LIST              (gnumeric_lazy_list_get_type ())
-#define GNUMERIC_LAZY_LIST(obj)              (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNUMERIC_TYPE_LAZY_LIST, 
GnumericLazyList))
-#define GNUMERIC_LAZY_LIST_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GNUMERIC_TYPE_LAZY_LIST, 
GnumericLazyListClass))
-#define GNUMERIC_IS_LAZY_LIST(obj)           (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNUMERIC_TYPE_LAZY_LIST))
-#define GNUMERIC_IS_LAZY_LIST_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GNUMERIC_TYPE_LAZY_LIST))
-#define GNUMERIC_LAZY_LIST_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GNUMERIC_TYPE_LAZY_LIST, 
GnumericLazyListClass))
+#define GNM_LAZY_LIST_TYPE              (gnumeric_lazy_list_get_type ())
+#define GNM_LAZY_LIST(obj)              (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNM_LAZY_LIST_TYPE, 
GnumericLazyList))
+#define GNM_IS_LAZY_LIST(obj)           (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNM_LAZY_LIST_TYPE))
 
 
 typedef struct _GnumericLazyList       GnumericLazyList;
diff --git a/src/widgets/gnumeric-text-view.h b/src/widgets/gnumeric-text-view.h
index 5d29e40..bbf6dc0 100644
--- a/src/widgets/gnumeric-text-view.h
+++ b/src/widgets/gnumeric-text-view.h
@@ -27,7 +27,7 @@
 
 #define GNM_TEXT_VIEW_TYPE     (gnm_text_view_get_type ())
 #define GNM_TEXT_VIEW(o)       (G_TYPE_CHECK_INSTANCE_CAST ((o), GNM_TEXT_VIEW_TYPE, GnmTextView))
-#define IS_GNM_TEXT_VIEW(o)    (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNM_TEXT_VIEW_TYPE))
+#define GNM_IS_TEXT_VIEW(o)    (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNM_TEXT_VIEW_TYPE))
 
 typedef struct _GnmTextView GnmTextView;
 
diff --git a/src/workbook-control.c b/src/workbook-control.c
index 6eaf661..3469a53 100644
--- a/src/workbook-control.c
+++ b/src/workbook-control.c
@@ -498,7 +498,7 @@ workbook_control_class_init (GObjectClass *object_class)
                 g_param_spec_object ("view",
                                      P_("View"),
                                      P_("The workbook view being controlled."),
-                                     WORKBOOK_VIEW_TYPE,
+                                     GNM_WORKBOOK_VIEW_TYPE,
                                      GSF_PARAM_STATIC |
                                      G_PARAM_READWRITE));
 }
diff --git a/src/workbook-priv.h b/src/workbook-priv.h
index 2d8a4ba..0ff9cfd 100644
--- a/src/workbook-priv.h
+++ b/src/workbook-priv.h
@@ -53,9 +53,6 @@ typedef struct {
        void (*sheet_deleted)       (Workbook *wb);
 } WorkbookClass;
 
-#define WORKBOOK_CLASS(k)    (G_TYPE_CHECK_CLASS_CAST((k), WORKBOOK_TYPE, WorkbookClass))
-#define IS_WORKBOOK_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), WORKBOOK_TYPE))
-
 #define WORKBOOK_FOREACH_VIEW(wb, view, code)                                  \
 do {                                                                           \
        int InD;                                                                \
diff --git a/src/workbook-view.c b/src/workbook-view.c
index 9ba6f7b..196c732 100644
--- a/src/workbook-view.c
+++ b/src/workbook-view.c
@@ -103,7 +103,7 @@ enum {
 Workbook *
 wb_view_get_workbook (WorkbookView const *wbv)
 {
-       g_return_val_if_fail (IS_WORKBOOK_VIEW (wbv), NULL);
+       g_return_val_if_fail (GNM_IS_WORKBOOK_VIEW (wbv), NULL);
        return wbv->wb;
 }
 
@@ -116,7 +116,7 @@ wb_view_get_workbook (WorkbookView const *wbv)
 GODoc *
 wb_view_get_doc (WorkbookView const *wbv)
 {
-       g_return_val_if_fail (IS_WORKBOOK_VIEW (wbv), NULL);
+       g_return_val_if_fail (GNM_IS_WORKBOOK_VIEW (wbv), NULL);
        return GO_DOC (wbv->wb);
 }
 
@@ -129,7 +129,7 @@ wb_view_get_doc (WorkbookView const *wbv)
 int
 wb_view_get_index_in_wb (WorkbookView const *wbv)
 {
-       g_return_val_if_fail (IS_WORKBOOK_VIEW (wbv), -1);
+       g_return_val_if_fail (GNM_IS_WORKBOOK_VIEW (wbv), -1);
        if (NULL != wbv->wb) {
                unsigned i = wbv->wb->wb_views->len;
                while (i-- > 0)
@@ -148,7 +148,7 @@ wb_view_get_index_in_wb (WorkbookView const *wbv)
 Sheet *
 wb_view_cur_sheet (WorkbookView const *wbv)
 {
-       g_return_val_if_fail (IS_WORKBOOK_VIEW (wbv), NULL);
+       g_return_val_if_fail (GNM_IS_WORKBOOK_VIEW (wbv), NULL);
        return wbv->current_sheet;
 }
 
@@ -161,7 +161,7 @@ wb_view_cur_sheet (WorkbookView const *wbv)
 SheetView *
 wb_view_cur_sheet_view (WorkbookView const *wbv)
 {
-       g_return_val_if_fail (IS_WORKBOOK_VIEW (wbv), NULL);
+       g_return_val_if_fail (GNM_IS_WORKBOOK_VIEW (wbv), NULL);
        return wbv->current_sheet_view;
 }
 
@@ -195,7 +195,7 @@ wb_view_sheet_add (WorkbookView *wbv, Sheet *new_sheet)
 {
        SheetView *new_view;
 
-       g_return_if_fail (IS_WORKBOOK_VIEW (wbv));
+       g_return_if_fail (GNM_IS_WORKBOOK_VIEW (wbv));
 
        new_view = sheet_view_new (new_sheet, wbv);
 
@@ -211,7 +211,7 @@ wb_view_sheet_add (WorkbookView *wbv, Sheet *new_sheet)
 gboolean
 wb_view_is_protected (WorkbookView *wbv, gboolean check_sheet)
 {
-       g_return_val_if_fail (IS_WORKBOOK_VIEW (wbv), FALSE);
+       g_return_val_if_fail (GNM_IS_WORKBOOK_VIEW (wbv), FALSE);
 
        return wbv->is_protected || (check_sheet &&
                wbv->current_sheet != NULL && wbv->current_sheet->is_protected);
@@ -224,7 +224,7 @@ wb_view_set_attribute (WorkbookView *wbv, char const *name, char const *value)
        GObject *obj;
        const char *tname;
 
-       g_return_if_fail (IS_WORKBOOK_VIEW (wbv));
+       g_return_if_fail (GNM_IS_WORKBOOK_VIEW (wbv));
        g_return_if_fail (name != NULL);
        g_return_if_fail (value != NULL);
 
@@ -260,7 +260,7 @@ wb_view_set_attribute (WorkbookView *wbv, char const *name, char const *value)
 void
 wb_view_preferred_size (WorkbookView *wbv, int w, int h)
 {
-       g_return_if_fail (IS_WORKBOOK_VIEW (wbv));
+       g_return_if_fail (GNM_IS_WORKBOOK_VIEW (wbv));
 
        if (w <= 0)
                w = 768; /* use default */
@@ -285,7 +285,7 @@ wb_view_style_feedback (WorkbookView *wbv)
        GnmCell *cell;
        gboolean update_controls = TRUE;
 
-       g_return_if_fail (IS_WORKBOOK_VIEW (wbv));
+       g_return_if_fail (GNM_IS_WORKBOOK_VIEW (wbv));
 
        sv = wbv->current_sheet_view;
        if (sv == NULL)
@@ -357,7 +357,7 @@ wb_view_menus_update (WorkbookView *wbv)
 {
        Sheet *sheet;
 
-       g_return_if_fail (IS_WORKBOOK_VIEW (wbv));
+       g_return_if_fail (GNM_IS_WORKBOOK_VIEW (wbv));
 
        sheet = wbv->current_sheet;
        if (sheet != NULL) {
@@ -374,7 +374,7 @@ wb_view_selection_desc (WorkbookView *wbv, gboolean use_pos,
 {
        SheetView *sv;
 
-       g_return_if_fail (IS_WORKBOOK_VIEW (wbv));
+       g_return_if_fail (GNM_IS_WORKBOOK_VIEW (wbv));
 
        sv = wbv->current_sheet_view;
        if (sv != NULL) {
@@ -382,7 +382,7 @@ wb_view_selection_desc (WorkbookView *wbv, gboolean use_pos,
                char const *sel_descr = buffer;
                GnmRange const *r, *m;
 
-               g_return_if_fail (IS_SHEET_VIEW (sv));
+               g_return_if_fail (GNM_IS_SV (sv));
                g_return_if_fail (sv->selections);
 
                r = selection_first_range (sv, NULL, NULL);
@@ -435,7 +435,7 @@ wb_view_edit_line_set (WorkbookView *wbv, WorkbookControl *optional_wbc)
 {
        SheetView *sv;
 
-       g_return_if_fail (IS_WORKBOOK_VIEW (wbv));
+       g_return_if_fail (GNM_IS_WORKBOOK_VIEW (wbv));
 
        sv = wbv->current_sheet_view;
        if (sv != NULL) {
@@ -521,7 +521,7 @@ wb_view_auto_expr_recalc (WorkbookView *wbv)
        GnmExprTop const *texpr;
        GnmEvalPos      ep;
 
-       g_return_if_fail (IS_WORKBOOK_VIEW (wbv));
+       g_return_if_fail (GNM_IS_WORKBOOK_VIEW (wbv));
 
        sv = wb_view_cur_sheet_view (wbv);
        if (wbv->current_sheet == NULL ||
@@ -567,7 +567,7 @@ wb_view_init_control (G_GNUC_UNUSED WorkbookControl *wbc)
 void
 wb_view_attach_control (WorkbookView *wbv, WorkbookControl *wbc)
 {
-       g_return_if_fail (IS_WORKBOOK_VIEW (wbv));
+       g_return_if_fail (GNM_IS_WORKBOOK_VIEW (wbv));
        g_return_if_fail (GNM_IS_WBC (wbc));
        g_return_if_fail (wb_control_view (wbc) == NULL);
 
@@ -584,7 +584,7 @@ void
 wb_view_detach_control (WorkbookControl *wbc)
 {
        g_return_if_fail (GNM_IS_WBC (wbc));
-       g_return_if_fail (IS_WORKBOOK_VIEW (wb_control_view (wbc)));
+       g_return_if_fail (GNM_IS_WORKBOOK_VIEW (wb_control_view (wbc)));
 
        g_ptr_array_remove (wbc->wb_view->wb_controls, wbc);
        if (wbc->wb_view->wb_controls->len == 0) {
@@ -803,7 +803,7 @@ wb_view_get_property (GObject *object, guint property_id,
 void
 wb_view_detach_from_workbook (WorkbookView *wbv)
 {
-       g_return_if_fail (IS_WORKBOOK_VIEW (wbv));
+       g_return_if_fail (GNM_IS_WORKBOOK_VIEW (wbv));
 
        if (wbv->wb) {
                workbook_detach_view (wbv);
@@ -815,7 +815,7 @@ wb_view_detach_from_workbook (WorkbookView *wbv)
 static void
 wb_view_dispose (GObject *object)
 {
-       WorkbookView *wbv = WORKBOOK_VIEW (object);
+       WorkbookView *wbv = GNM_WORKBOOK_VIEW (object);
 
        if (wbv->wb_controls != NULL) {
                WORKBOOK_VIEW_FOREACH_CONTROL (wbv, control, {
@@ -1002,7 +1002,7 @@ workbook_view_new (Workbook *wb)
        g_return_val_if_fail (wb != NULL, NULL);
 
        wbv = g_object_new
-               (WORKBOOK_VIEW_TYPE,
+               (GNM_WORKBOOK_VIEW_TYPE,
                 "show-horizontal-scrollbar", TRUE,
                 "show-vertical-scrollbar", TRUE,
                 "show-notebook-tabs", TRUE,
@@ -1116,7 +1116,7 @@ wb_view_save_as (WorkbookView *wbv, GOFileSaver *fs, char const *uri,
        Workbook  *wb;
        gboolean has_error, has_warning;
 
-       g_return_val_if_fail (IS_WORKBOOK_VIEW (wbv), FALSE);
+       g_return_val_if_fail (GNM_IS_WORKBOOK_VIEW (wbv), FALSE);
        g_return_val_if_fail (GO_IS_FILE_SAVER (fs), FALSE);
        g_return_val_if_fail (uri != NULL, FALSE);
        g_return_val_if_fail (GO_IS_CMD_CONTEXT (cc), FALSE);
@@ -1169,7 +1169,7 @@ wb_view_save (WorkbookView *wbv, GOCmdContext *context)
        GOFileSaver     *fs;
        gboolean has_error, has_warning;
 
-       g_return_val_if_fail (IS_WORKBOOK_VIEW (wbv), FALSE);
+       g_return_val_if_fail (GNM_IS_WORKBOOK_VIEW (wbv), FALSE);
        g_return_val_if_fail (GO_IS_CMD_CONTEXT (context), FALSE);
 
        wb = wb_view_get_workbook (wbv);
diff --git a/src/workbook-view.h b/src/workbook-view.h
index 48e3595..11959bc 100644
--- a/src/workbook-view.h
+++ b/src/workbook-view.h
@@ -52,10 +52,9 @@ typedef struct {
        void (*sheet_entered) (Sheet *sheet);
 } WorkbookViewClass;
 
-#define WORKBOOK_VIEW_TYPE     (workbook_view_get_type ())
-#define WORKBOOK_VIEW(obj)     (G_TYPE_CHECK_INSTANCE_CAST ((obj), WORKBOOK_VIEW_TYPE, WorkbookView))
-#define WORKBOOK_VIEW_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), WORKBOOK_VIEW_TYPE, WorkbookViewClass))
-#define IS_WORKBOOK_VIEW(o)    (G_TYPE_CHECK_INSTANCE_TYPE ((o), WORKBOOK_VIEW_TYPE))
+#define GNM_WORKBOOK_VIEW_TYPE     (workbook_view_get_type ())
+#define GNM_WORKBOOK_VIEW(obj)     (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNM_WORKBOOK_VIEW_TYPE, WorkbookView))
+#define GNM_IS_WORKBOOK_VIEW(o)    (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNM_WORKBOOK_VIEW_TYPE))
 
 /* Lifecycle */
 GType           workbook_view_get_type   (void);
diff --git a/src/workbook.c b/src/workbook.c
index 07a068b..f2b1385 100644
--- a/src/workbook.c
+++ b/src/workbook.c
@@ -71,7 +71,7 @@ static void
 cb_saver_finalize (Workbook *wb, GOFileSaver *saver)
 {
        g_return_if_fail (GO_IS_FILE_SAVER (saver));
-       g_return_if_fail (IS_WORKBOOK (wb));
+       g_return_if_fail (GNM_IS_WORKBOOK (wb));
        g_return_if_fail (wb->file_saver == saver);
        wb->file_saver = NULL;
 }
@@ -79,7 +79,7 @@ static void
 cb_exporter_finalize (Workbook *wb, GOFileSaver *saver)
 {
        g_return_if_fail (GO_IS_FILE_SAVER (saver));
-       g_return_if_fail (IS_WORKBOOK (wb));
+       g_return_if_fail (GNM_IS_WORKBOOK (wb));
        g_return_if_fail (wb->file_exporter == saver);
        workbook_set_file_exporter (wb, NULL);
 }
@@ -87,7 +87,7 @@ cb_exporter_finalize (Workbook *wb, GOFileSaver *saver)
 void
 workbook_update_history (Workbook *wb, GnmFileSaveAsStyle type)
 {
-       g_return_if_fail (IS_WORKBOOK (wb));
+       g_return_if_fail (GNM_IS_WORKBOOK (wb));
 
        switch (type) {
        case GNM_FILE_SAVE_AS_STYLE_SAVE:
@@ -115,7 +115,7 @@ void
 workbook_update_graphs (Workbook *wb)
 {
        WORKBOOK_FOREACH_SHEET (wb, sheet, ({
-               GSList *l, *graphs = sheet_objects_get (sheet, NULL, SHEET_OBJECT_GRAPH_TYPE);
+               GSList *l, *graphs = sheet_objects_get (sheet, NULL, GNM_SO_GRAPH_TYPE);
                for (l = graphs; l; l = l->next) {
                        SheetObject *sog = l->data;
                        gog_graph_force_update (sheet_object_graph_get_gog (sog));
@@ -293,7 +293,7 @@ workbook_class_init (GObjectClass *gobject_class)
                                       G_PARAM_READWRITE));
 
        signals [SHEET_ORDER_CHANGED] = g_signal_new ("sheet_order_changed",
-               WORKBOOK_TYPE,
+               GNM_WORKBOOK_TYPE,
                G_SIGNAL_RUN_LAST,
                G_STRUCT_OFFSET (WorkbookClass, sheet_order_changed),
                NULL, NULL,
@@ -302,7 +302,7 @@ workbook_class_init (GObjectClass *gobject_class)
                0, G_TYPE_NONE);
 
        signals [SHEET_ADDED] = g_signal_new ("sheet_added",
-               WORKBOOK_TYPE,
+               GNM_WORKBOOK_TYPE,
                G_SIGNAL_RUN_LAST,
                G_STRUCT_OFFSET (WorkbookClass, sheet_added),
                NULL, NULL,
@@ -311,7 +311,7 @@ workbook_class_init (GObjectClass *gobject_class)
                0, G_TYPE_NONE);
 
        signals [SHEET_DELETED] = g_signal_new ("sheet_deleted",
-               WORKBOOK_TYPE,
+               GNM_WORKBOOK_TYPE,
                G_SIGNAL_RUN_LAST,
                G_STRUCT_OFFSET (WorkbookClass, sheet_deleted),
                NULL, NULL,
@@ -340,7 +340,7 @@ workbook_new (void)
        if (extension == NULL)
                extension = "gnumeric";
 
-       wb = g_object_new (WORKBOOK_TYPE, NULL);
+       wb = g_object_new (GNM_WORKBOOK_TYPE, NULL);
 
        /* Assign a default name */
        do {
@@ -479,7 +479,7 @@ workbook_set_saveinfo (Workbook *wb, GOFileFormatLevel level, GOFileSaver *fs)
 GOFileSaver *
 workbook_get_file_saver (Workbook *wb)
 {
-       g_return_val_if_fail (IS_WORKBOOK (wb), NULL);
+       g_return_val_if_fail (GNM_IS_WORKBOOK (wb), NULL);
 
        return wb->file_saver;
 }
@@ -493,7 +493,7 @@ workbook_get_file_saver (Workbook *wb)
 GOFileSaver *
 workbook_get_file_exporter (Workbook *wb)
 {
-       g_return_val_if_fail (IS_WORKBOOK (wb), NULL);
+       g_return_val_if_fail (GNM_IS_WORKBOOK (wb), NULL);
 
        return wb->file_exporter;
 }
@@ -507,7 +507,7 @@ workbook_get_file_exporter (Workbook *wb)
 gchar const *
 workbook_get_last_export_uri (Workbook *wb)
 {
-       g_return_val_if_fail (IS_WORKBOOK (wb), NULL);
+       g_return_val_if_fail (GNM_IS_WORKBOOK (wb), NULL);
 
        return wb->last_export_uri;
 }
@@ -677,7 +677,7 @@ void
 workbook_foreach_name (Workbook const *wb, gboolean globals_only,
                       GHFunc func, gpointer data)
 {
-       g_return_if_fail (IS_WORKBOOK (wb));
+       g_return_if_fail (GNM_IS_WORKBOOK (wb));
 
        if (wb->names)
                gnm_named_expr_collection_foreach (wb->names, func, data);
@@ -695,7 +695,7 @@ workbook_enable_recursive_dirty (Workbook *wb, gboolean enable)
 {
        gboolean old;
 
-       g_return_val_if_fail (IS_WORKBOOK (wb), FALSE);
+       g_return_val_if_fail (GNM_IS_WORKBOOK (wb), FALSE);
 
        old = wb->recursive_dirty_enabled;
        wb->recursive_dirty_enabled = enable;
@@ -705,28 +705,28 @@ workbook_enable_recursive_dirty (Workbook *wb, gboolean enable)
 void
 workbook_set_recalcmode (Workbook *wb, gboolean is_auto)
 {
-       g_return_if_fail (IS_WORKBOOK (wb));
+       g_return_if_fail (GNM_IS_WORKBOOK (wb));
        wb->recalc_auto = is_auto;
 }
 
 gboolean
 workbook_get_recalcmode (Workbook const *wb)
 {
-       g_return_val_if_fail (IS_WORKBOOK (wb), FALSE);
+       g_return_val_if_fail (GNM_IS_WORKBOOK (wb), FALSE);
        return wb->recalc_auto;
 }
 
 void
 workbook_iteration_enabled (Workbook *wb, gboolean enable)
 {
-       g_return_if_fail (IS_WORKBOOK (wb));
+       g_return_if_fail (GNM_IS_WORKBOOK (wb));
        wb->iteration.enabled = enable;
 }
 
 void
 workbook_iteration_max_number (Workbook *wb, int max_number)
 {
-       g_return_if_fail (IS_WORKBOOK (wb));
+       g_return_if_fail (GNM_IS_WORKBOOK (wb));
        g_return_if_fail (max_number >= 0);
        wb->iteration.max_number = max_number;
 }
@@ -734,7 +734,7 @@ workbook_iteration_max_number (Workbook *wb, int max_number)
 void
 workbook_iteration_tolerance (Workbook *wb, double tolerance)
 {
-       g_return_if_fail (IS_WORKBOOK (wb));
+       g_return_if_fail (GNM_IS_WORKBOOK (wb));
        g_return_if_fail (tolerance >= 0);
 
        wb->iteration.tolerance = tolerance;
@@ -745,10 +745,10 @@ workbook_attach_view (WorkbookView *wbv)
 {
        Workbook *wb;
 
-       g_return_if_fail (IS_WORKBOOK_VIEW (wbv));
+       g_return_if_fail (GNM_IS_WORKBOOK_VIEW (wbv));
 
        wb = wb_view_get_workbook (wbv);
-       g_return_if_fail (IS_WORKBOOK (wb));
+       g_return_if_fail (GNM_IS_WORKBOOK (wb));
 
        if (wb->wb_views == NULL)
                wb->wb_views = g_ptr_array_new ();
@@ -758,8 +758,8 @@ workbook_attach_view (WorkbookView *wbv)
 void
 workbook_detach_view (WorkbookView *wbv)
 {
-       g_return_if_fail (IS_WORKBOOK_VIEW (wbv));
-       g_return_if_fail (IS_WORKBOOK (wbv->wb));
+       g_return_if_fail (GNM_IS_WORKBOOK_VIEW (wbv));
+       g_return_if_fail (GNM_IS_WORKBOOK (wbv->wb));
 
        WORKBOOK_FOREACH_SHEET (wbv->wb, sheet, {
                SheetView *sv = sheet_get_view (sheet, wbv);
@@ -788,7 +788,7 @@ workbook_sheets (Workbook const *wb)
 {
        GSList *list = NULL;
 
-       g_return_val_if_fail (IS_WORKBOOK (wb), NULL);
+       g_return_val_if_fail (GNM_IS_WORKBOOK (wb), NULL);
 
        if (wb->sheets) {
                int i = wb->sheets->len;
@@ -803,7 +803,7 @@ workbook_sheets (Workbook const *wb)
 int
 workbook_sheet_count (Workbook const *wb)
 {
-       g_return_val_if_fail (IS_WORKBOOK (wb), 0);
+       g_return_val_if_fail (GNM_IS_WORKBOOK (wb), 0);
 
        return wb->sheets ? wb->sheets->len : 0;
 }
@@ -861,7 +861,7 @@ workbook_sheet_index_update (Workbook *wb, int start)
 Sheet *
 workbook_sheet_by_index (Workbook const *wb, int i)
 {
-       g_return_val_if_fail (IS_WORKBOOK (wb), NULL);
+       g_return_val_if_fail (GNM_IS_WORKBOOK (wb), NULL);
        g_return_val_if_fail (i < (int)wb->sheets->len, NULL);
        g_return_val_if_fail (i >= -1, NULL);
 
@@ -887,7 +887,7 @@ workbook_sheet_by_name (Workbook const *wb, char const *name)
        Sheet *sheet;
        char *tmp;
 
-       g_return_val_if_fail (IS_WORKBOOK (wb), NULL);
+       g_return_val_if_fail (GNM_IS_WORKBOOK (wb), NULL);
        g_return_val_if_fail (name != NULL, NULL);
 
        tmp = g_utf8_casefold (name, -1);
@@ -941,7 +941,7 @@ workbook_sheet_remove_controls (Workbook *wb, Sheet *sheet)
 {
        Sheet *focus = NULL;
 
-       g_return_val_if_fail (IS_WORKBOOK (wb), TRUE);
+       g_return_val_if_fail (GNM_IS_WORKBOOK (wb), TRUE);
        g_return_val_if_fail (IS_SHEET (sheet), TRUE);
        g_return_val_if_fail (sheet->workbook == wb, TRUE);
        g_return_val_if_fail (workbook_sheet_by_name (wb, sheet->name_unquoted) == sheet, TRUE);
@@ -973,7 +973,7 @@ workbook_sheet_remove_controls (Workbook *wb, Sheet *sheet)
 void
 workbook_sheet_attach_at_pos (Workbook *wb, Sheet *new_sheet, int pos)
 {
-       g_return_if_fail (IS_WORKBOOK (wb));
+       g_return_if_fail (GNM_IS_WORKBOOK (wb));
        g_return_if_fail (IS_SHEET (new_sheet));
        g_return_if_fail (new_sheet->workbook == wb);
        g_return_if_fail (pos >= 0 && pos <= (int)wb->sheets->len);
@@ -1090,7 +1090,7 @@ workbook_sheet_delete (Sheet *sheet)
        int sheet_index;
 
         g_return_if_fail (IS_SHEET (sheet));
-        g_return_if_fail (IS_WORKBOOK (sheet->workbook));
+        g_return_if_fail (GNM_IS_WORKBOOK (sheet->workbook));
 
        wb = sheet->workbook;
        sheet_index = sheet->index_in_wb;
@@ -1282,7 +1282,7 @@ workbook_find_command (Workbook *wb, gboolean is_undo, gpointer cmd)
        GSList *ptr;
        unsigned n = 1;
 
-       g_return_val_if_fail (IS_WORKBOOK (wb), 0);
+       g_return_val_if_fail (GNM_IS_WORKBOOK (wb), 0);
 
        ptr = is_undo ? wb->undo_commands : wb->redo_commands;
        for ( ; ptr != NULL ; ptr = ptr->next, n++)
@@ -1308,7 +1308,7 @@ workbook_sheet_reorder (Workbook *wb, GSList *new_order)
        Sheet    *sheet;
        unsigned  pos = 0;
 
-       g_return_val_if_fail (IS_WORKBOOK (wb), FALSE);
+       g_return_val_if_fail (GNM_IS_WORKBOOK (wb), FALSE);
        g_return_val_if_fail (g_slist_length (new_order) == wb->sheets->len, FALSE);
 
        pre_sheet_index_change (wb);
@@ -1349,7 +1349,7 @@ workbook_date_conv (Workbook const *wb)
 void
 workbook_set_date_conv (Workbook *wb, GODateConventions const *date_conv)
 {
-       g_return_if_fail (IS_WORKBOOK (wb));
+       g_return_if_fail (GNM_IS_WORKBOOK (wb));
        g_return_if_fail (date_conv != NULL);
 
        wb->date_conv = date_conv;
diff --git a/src/workbook.h b/src/workbook.h
index 139c19d..985bf62 100644
--- a/src/workbook.h
+++ b/src/workbook.h
@@ -9,9 +9,9 @@
 
 G_BEGIN_DECLS
 
-#define WORKBOOK_TYPE        (workbook_get_type ())
-#define WORKBOOK(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), WORKBOOK_TYPE, Workbook))
-#define IS_WORKBOOK(o)       (G_TYPE_CHECK_INSTANCE_TYPE ((o), WORKBOOK_TYPE))
+#define GNM_WORKBOOK_TYPE        (workbook_get_type ())
+#define WORKBOOK(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), GNM_WORKBOOK_TYPE, Workbook))
+#define GNM_IS_WORKBOOK(o)       (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNM_WORKBOOK_TYPE))
 
 GType       workbook_get_type            (void);
 Workbook   *workbook_new                 (void);
diff --git a/src/xml-sax-read.c b/src/xml-sax-read.c
index c9d4015..f71d0b6 100644
--- a/src/xml-sax-read.c
+++ b/src/xml-sax-read.c
@@ -2394,7 +2394,7 @@ xml_sax_read_obj (GsfXMLIn *xin, gboolean needs_cleanup,
        /* Patch problems introduced in some 1.7.x versions that stored
         * comments in merged cells with the full rectangle of the merged cell
         * rather than just the top left corner */
-       if (G_OBJECT_TYPE (so) == CELL_COMMENT_TYPE)
+       if (G_OBJECT_TYPE (so) == GNM_CELL_COMMENT_TYPE)
                anchor_r.end = anchor_r.start;
 
        sheet_object_anchor_init (&anchor, &anchor_r, anchor_offset, anchor_dir);
@@ -3307,7 +3307,7 @@ read_file_common (ReadFileWhat what, XMLSaxParseState *state,
        GnmLocale       *locale;
        gboolean         ok;
 
-       g_return_val_if_fail (IS_WORKBOOK_VIEW (wb_view), FALSE);
+       g_return_val_if_fail (GNM_IS_WORKBOOK_VIEW (wb_view), FALSE);
        g_return_val_if_fail (GSF_IS_INPUT (input), FALSE);
 
        read_file_init_state (state, io_context, wb_view, sheet);
@@ -3486,7 +3486,7 @@ gnm_xml_file_open (G_GNUC_UNUSED GOFileOpener const *fo, GOIOContext *io_context
        input = maybe_convert (input, FALSE);
 
        ok = read_file_common (READ_FULL_FILE, &state,
-                              io_context, WORKBOOK_VIEW (view), NULL,
+                              io_context, GNM_WORKBOOK_VIEW (view), NULL,
                               input);
 
        g_object_unref (input);
diff --git a/src/xml-sax-write.c b/src/xml-sax-write.c
index 664f6dc..a578b54 100644
--- a/src/xml-sax-write.c
+++ b/src/xml-sax-write.c
@@ -1445,7 +1445,7 @@ gnm_xml_file_save_full (G_GNUC_UNUSED GOFileSaver const *fs,
        GnmOutputXML state;
        GsfOutput   *gzout = NULL;
        GnmLocale   *locale;
-       WorkbookView *wb_view = WORKBOOK_VIEW (view);
+       WorkbookView *wb_view = GNM_WORKBOOK_VIEW (view);
 
        if (compress) {
                gzout  = gsf_output_gzip_new (output, NULL);


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