Commit 07c591e1 authored by Morten Welinder's avatar Morten Welinder

Namespace

parent 4ca3ba0a
......@@ -242,7 +242,7 @@ do_af_suggest_list (int argc, GnmExprConstPtr const *argv,
GNM_BEGIN_KILL_SWITCH_WARNING
GOFormat const *
auto_style_format_suggest (GnmExprTop const *texpr, GnmEvalPos const *epos)
gnm_auto_style_format_suggest (GnmExprTop const *texpr, GnmEvalPos const *epos)
{
GOFormat const *explicit = NULL;
......
......@@ -6,7 +6,7 @@
G_BEGIN_DECLS
GOFormat const *auto_style_format_suggest (GnmExprTop const *texpr,
GOFormat const *gnm_auto_style_format_suggest (GnmExprTop const *texpr,
GnmEvalPos const *epos);
G_END_DECLS
......
......@@ -15,40 +15,37 @@
#include <goffice/goffice.h>
#include "ranges.h"
struct _CmdContextStderr {
struct GnmCmdContextStderr_ {
GObject base;
int status;
};
typedef GObjectClass CmdContextStderrClass;
#define COMMAND_CONTEXT_STDERR_CLASS(k) \
(G_TYPE_CHECK_CLASS_CAST ((k), CMD_CONTEXT_STDERR_TYPE, CmdContextStderrClass))
typedef GObjectClass GnmCmdContextStderrClass;
/**
* cmd_context_stderr_new:
* gnm_cmd_context_stderr_new:
*
* Returns: (transfer full): the newly allocated #GOCmdContext.
**/
GOCmdContext *
cmd_context_stderr_new (void)
gnm_cmd_context_stderr_new (void)
{
return g_object_new (CMD_CONTEXT_STDERR_TYPE, NULL);
return g_object_new (GNM_CMD_CONTEXT_STDERR_TYPE, NULL);
}
void
cmd_context_stderr_set_status (CmdContextStderr *ccs, int status)
gnm_cmd_context_stderr_set_status (GnmCmdContextStderr *ccs, int status)
{
g_return_if_fail (ccs != NULL);
g_return_if_fail (GNM_IS_COMMAND_CONTEXT_STDERR (ccs));
g_return_if_fail (GNM_IS_CMD_CONTEXT_STDERR (ccs));
ccs->status = status;
}
int
cmd_context_stderr_get_status (CmdContextStderr *ccs)
gnm_cmd_context_stderr_get_status (GnmCmdContextStderr *ccs)
{
g_return_val_if_fail (ccs != NULL, -1);
g_return_val_if_fail (GNM_IS_COMMAND_CONTEXT_STDERR (ccs), -1);
g_return_val_if_fail (GNM_IS_CMD_CONTEXT_STDERR (ccs), -1);
return ccs->status;
}
......@@ -56,7 +53,7 @@ cmd_context_stderr_get_status (CmdContextStderr *ccs)
static void
ccs_error_error (GOCmdContext *cc, GError *error)
{
CmdContextStderr *ccs = COMMAND_CONTEXT_STDERR (cc);
GnmCmdContextStderr *ccs = GNM_CMD_CONTEXT_STDERR (cc);
g_printerr ("Error: %s\n", error->message);
ccs->status = -1;
......@@ -64,7 +61,7 @@ ccs_error_error (GOCmdContext *cc, GError *error)
static void
ccs_error_info (GOCmdContext *cc, GOErrorInfo *error)
{
CmdContextStderr *ccs = COMMAND_CONTEXT_STDERR (cc);
GnmCmdContextStderr *ccs = GNM_CMD_CONTEXT_STDERR (cc);
go_error_info_print (error);
ccs->status = -1;
......@@ -93,7 +90,7 @@ ccs_progress_message_set (GOCmdContext *cc, gchar const *msg)
}
static void
ccs_init (CmdContextStderr *ccs)
ccs_init (GnmCmdContextStderr *ccs)
{
ccs->status = 0;
}
......@@ -109,7 +106,7 @@ ccs_gnm_cmd_context_init (GOCmdContextClass *cc_class)
cc_class->error.error_info = ccs_error_info;
}
GSF_CLASS_FULL (CmdContextStderr, cmd_context_stderr,
GSF_CLASS_FULL (GnmCmdContextStderr, gnm_cmd_context_stderr,
NULL, NULL, NULL, NULL,
ccs_init, G_TYPE_OBJECT, 0,
GSF_INTERFACE (ccs_gnm_cmd_context_init, GO_TYPE_CMD_CONTEXT))
......@@ -7,16 +7,16 @@
G_BEGIN_DECLS
#define CMD_CONTEXT_STDERR_TYPE (cmd_context_stderr_get_type ())
#define COMMAND_CONTEXT_STDERR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), CMD_CONTEXT_STDERR_TYPE, CmdContextStderr))
#define GNM_IS_COMMAND_CONTEXT_STDERR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), CMD_CONTEXT_STDERR_TYPE))
#define GNM_CMD_CONTEXT_STDERR_TYPE (gnm_cmd_context_stderr_get_type ())
#define GNM_CMD_CONTEXT_STDERR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GNM_CMD_CONTEXT_STDERR_TYPE, GnmCmdContextStderr))
#define GNM_IS_CMD_CONTEXT_STDERR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNM_CMD_CONTEXT_STDERR_TYPE))
typedef struct _CmdContextStderr CmdContextStderr;
typedef struct GnmCmdContextStderr_ GnmCmdContextStderr;
GType cmd_context_stderr_get_type (void);
GOCmdContext *cmd_context_stderr_new (void);
void cmd_context_stderr_set_status (CmdContextStderr *ccs, int status);
int cmd_context_stderr_get_status (CmdContextStderr *ccs);
GType gnm_cmd_context_stderr_get_type (void);
GOCmdContext *gnm_cmd_context_stderr_new (void);
void gnm_cmd_context_stderr_set_status (GnmCmdContextStderr *ccs, int status);
int gnm_cmd_context_stderr_get_status (GnmCmdContextStderr *ccs);
G_END_DECLS
......
......@@ -884,7 +884,7 @@ cmd_set_text_full (WorkbookControl *wbc, GSList *selection, GnmEvalPos *ep,
text = g_strdup_printf (_("Inserting expression in %s"), name);
if (go_format_is_general (format)) {
sf = auto_style_format_suggest (texpr, ep);
sf = gnm_auto_style_format_suggest (texpr, ep);
if (sf != NULL) {
new_style = gnm_style_new ();
gnm_style_set_format (new_style, sf);
......@@ -3619,14 +3619,14 @@ typedef struct {
GSList *selection; /* Selections on the sheet */
GSList *old_styles; /* Older styles, one style_list per selection range*/
GnmFormatTemplate *ft; /* Template that has been applied */
GnmFT *ft; /* Template that has been applied */
} CmdAutoFormat;
static void
cmd_autoformat_repeat (GnmCommand const *cmd, WorkbookControl *wbc)
{
CmdAutoFormat const *orig = (CmdAutoFormat const *) cmd;
cmd_selection_autoformat (wbc, format_template_clone (orig->ft));
cmd_selection_autoformat (wbc, gnm_ft_clone (orig->ft));
}
MAKE_GNM_COMMAND (CmdAutoFormat, cmd_autoformat, cmd_autoformat_repeat)
......@@ -3668,7 +3668,7 @@ cmd_autoformat_redo (GnmCommand *cmd,
g_return_val_if_fail (me != NULL, TRUE);
format_template_apply_to_sheet_regions (me->ft,
gnm_ft_apply_to_sheet_regions (me->ft,
me->cmd.sheet, me->selection);
return FALSE;
......@@ -3697,7 +3697,7 @@ cmd_autoformat_finalize (GObject *cmd)
range_fragment_free (me->selection);
me->selection = NULL;
format_template_free (me->ft);
gnm_ft_free (me->ft);
gnm_command_finalize (cmd);
}
......@@ -3710,7 +3710,7 @@ cmd_autoformat_finalize (GObject *cmd)
* Return value: TRUE if there was a problem
**/
gboolean
cmd_selection_autoformat (WorkbookControl *wbc, GnmFormatTemplate *ft)
cmd_selection_autoformat (WorkbookControl *wbc, GnmFT *ft)
{
CmdAutoFormat *me;
char *names;
......@@ -3724,7 +3724,7 @@ cmd_selection_autoformat (WorkbookControl *wbc, GnmFormatTemplate *ft)
me->cmd.sheet = sv_sheet (sv);
me->cmd.size = 1; /* FIXME? */
if (!format_template_check_valid (ft, me->selection, GO_CMD_CONTEXT (wbc))) {
if (!gnm_ft_check_valid (ft, me->selection, GO_CMD_CONTEXT (wbc))) {
g_object_unref (me);
return TRUE;
}
......
......@@ -95,7 +95,7 @@ gboolean cmd_selection_outline_change (WorkbookControl *wbc,
gboolean is_cols, int index, int depth);
gboolean cmd_selection_group (WorkbookControl *wbc,
gboolean is_cols, gboolean group);
gboolean cmd_selection_autoformat (WorkbookControl *wbc, GnmFormatTemplate *ft);
gboolean cmd_selection_autoformat (WorkbookControl *wbc, GnmFT *ft);
gboolean cmd_selection_hyperlink (WorkbookControl *wbc,
GnmStyle *style,
char const *opt_translated_name,
......
......@@ -56,7 +56,7 @@ search_strategy_next (GnmCompleteSheet *cs)
static void
complete_sheet_finalize (GObject *object)
{
GnmCompleteSheet *cs = COMPLETE_SHEET (object);
GnmCompleteSheet *cs = GNM_COMPLETE_SHEET (object);
g_free (cs->current_text);
parent_class->finalize (object);
}
......@@ -83,7 +83,7 @@ text_matches (GnmCompleteSheet const *cs)
static gboolean
complete_sheet_search_iteration (GnmComplete *complete)
{
GnmCompleteSheet *cs = COMPLETE_SHEET (complete);
GnmCompleteSheet *cs = GNM_COMPLETE_SHEET (complete);
int i;
if ((int)strlen (complete->text) <
......@@ -115,7 +115,7 @@ complete_sheet_class_init (GObjectClass *object_class)
}
/**
* complete_sheet_new:
* gnm_complete_sheet_new:
* @sheet: #Sheet
* @col: column
* @row: row
......@@ -125,15 +125,15 @@ complete_sheet_class_init (GObjectClass *object_class)
* Returns: (transfer full): the new #GnmComplete.
**/
GnmComplete *
complete_sheet_new (Sheet *sheet, int col, int row, GnmCompleteMatchNotifyFn notify, void *notify_closure)
gnm_complete_sheet_new (Sheet *sheet, int col, int row, GnmCompleteMatchNotifyFn notify, void *notify_closure)
{
/*
* Somehow every time I pronounce this, I feel like something is not quite right.
*/
GnmCompleteSheet *cs;
cs = g_object_new (COMPLETE_SHEET_TYPE, NULL);
complete_construct (GNM_COMPLETE (cs), notify, notify_closure);
cs = g_object_new (GNM_COMPLETE_SHEET_TYPE, NULL);
gnm_complete_construct (GNM_COMPLETE (cs), notify, notify_closure);
cs->sheet = sheet;
cs->entry.col = col;
......@@ -144,5 +144,5 @@ complete_sheet_new (Sheet *sheet, int col, int row, GnmCompleteMatchNotifyFn not
return GNM_COMPLETE (cs);
}
GSF_CLASS (GnmCompleteSheet, complete_sheet,
GSF_CLASS (GnmCompleteSheet, gnm_complete_sheet,
complete_sheet_class_init, NULL, PARENT_TYPE)
......@@ -7,11 +7,9 @@
G_BEGIN_DECLS
#define COMPLETE_SHEET_TYPE (complete_sheet_get_type ())
#define COMPLETE_SHEET(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), COMPLETE_SHEET_TYPE, GnmCompleteSheet))
#define COMPLETE_SHEET_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), COMPLETE_SHEET_TYPE, GnmCompleteSheetClass))
#define GNM_IS_COMPLETE_SHEET(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), COMPLETE_SHEET_TYPE))
#define IS_COMPLETE_SHEET_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), COMPLETE_SHEET_TYPE))
#define GNM_COMPLETE_SHEET_TYPE (gnm_complete_sheet_get_type ())
#define GNM_COMPLETE_SHEET(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GNM_COMPLETE_SHEET_TYPE, GnmCompleteSheet))
#define GNM_IS_COMPLETE_SHEET(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNM_COMPLETE_SHEET_TYPE))
typedef struct {
GnmComplete parent;
......@@ -31,10 +29,10 @@ typedef struct {
GnmCompleteClass parent_class;
} GnmCompleteSheetClass;
GType complete_sheet_get_type (void);
GnmComplete *complete_sheet_new (Sheet *sheet, int col, int row,
GnmCompleteMatchNotifyFn notify,
void *notify_closure);
GType gnm_complete_sheet_get_type (void);
GnmComplete *gnm_complete_sheet_new (Sheet *sheet, int col, int row,
GnmCompleteMatchNotifyFn notify,
void *notify_closure);
G_END_DECLS
......
......@@ -31,13 +31,13 @@
#define ACC(o) (GNM_COMPLETE_CLASS (G_OBJECT_GET_CLASS (o)))
/**
* complete_construct:
* gnm_complete_construct:
* @complete: #GnmComplete
* @notify: (scope async): #GnmCompleteMatchNotifyFn
* @notify_closure: user data
**/
void
complete_construct (GnmComplete *complete,
gnm_complete_construct (GnmComplete *complete,
GnmCompleteMatchNotifyFn notify,
void *notify_closure)
{
......@@ -79,7 +79,7 @@ complete_idle (gpointer data)
}
void
complete_start (GnmComplete *complete, char const *text)
gnm_complete_start (GnmComplete *complete, char const *text)
{
g_return_if_fail (complete != NULL);
g_return_if_fail (GNM_IS_COMPLETE (complete));
......@@ -112,5 +112,5 @@ complete_class_init (GObjectClass *object_class)
complete_class->search_iteration = default_search_iteration;
}
GSF_CLASS (GnmComplete, complete,
&complete_class_init, NULL, PARENT_TYPE)
GSF_CLASS (GnmComplete, gnm_complete,
complete_class_init, NULL, PARENT_TYPE)
......@@ -7,7 +7,7 @@
G_BEGIN_DECLS
#define GNM_COMPLETE_TYPE (complete_get_type ())
#define GNM_COMPLETE_TYPE (gnm_complete_get_type ())
#define GNM_COMPLETE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GNM_COMPLETE_TYPE, GnmComplete))
#define GNM_COMPLETE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GNM_COMPLETE_TYPE, GnmCompleteClass))
#define GNM_IS_COMPLETE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNM_COMPLETE_TYPE))
......@@ -32,11 +32,11 @@ typedef struct {
gboolean (*search_iteration) (GnmComplete *complete);
} GnmCompleteClass;
void complete_construct (GnmComplete *complete,
GnmCompleteMatchNotifyFn notify,
void *notify_closure);
void complete_start (GnmComplete *complete, char const *text);
GType complete_get_type (void);
void gnm_complete_construct (GnmComplete *complete,
GnmCompleteMatchNotifyFn notify,
void *notify_closure);
void gnm_complete_start (GnmComplete *complete, char const *text);
GType gnm_complete_get_type (void);
G_END_DECLS
......
......@@ -101,7 +101,7 @@ cb_value_compare (GnmValue const *a, GnmValue const *b)
/**********************************************************************************/
GnmConsolidate *
consolidate_new (void)
gnm_consolidate_new (void)
{
GnmConsolidate *cs;
......@@ -115,7 +115,7 @@ consolidate_new (void)
}
void
consolidate_free (GnmConsolidate *cs, gboolean content_only)
gnm_consolidate_free (GnmConsolidate *cs, gboolean content_only)
{
GSList *l;
......@@ -149,7 +149,7 @@ gnm_consolidate_unref (GnmConsolidate *cs)
{
cs->ref_count--;
if (cs->ref_count == 0)
consolidate_free (cs, TRUE);
gnm_consolidate_free (cs, TRUE);
}
GType
......@@ -166,7 +166,7 @@ gnm_consolidate_get_type (void)
}
void
consolidate_set_function (GnmConsolidate *cs, GnmFunc *fd)
gnm_consolidate_set_function (GnmConsolidate *cs, GnmFunc *fd)
{
g_return_if_fail (cs != NULL);
g_return_if_fail (fd != NULL);
......@@ -179,7 +179,7 @@ consolidate_set_function (GnmConsolidate *cs, GnmFunc *fd)
}
void
consolidate_set_mode (GnmConsolidate *cs, GnmConsolidateMode mode)
gnm_consolidate_set_mode (GnmConsolidate *cs, GnmConsolidateMode mode)
{
g_return_if_fail (cs != NULL);
......@@ -187,7 +187,7 @@ consolidate_set_mode (GnmConsolidate *cs, GnmConsolidateMode mode)
}
gboolean
consolidate_check_destination (GnmConsolidate *cs, data_analysis_output_t *dao)
gnm_consolidate_check_destination (GnmConsolidate *cs, data_analysis_output_t *dao)
{
GnmSheetRange *new;
GnmRange r;
......@@ -218,7 +218,7 @@ consolidate_check_destination (GnmConsolidate *cs, data_analysis_output_t *dao)
}
gboolean
consolidate_add_source (GnmConsolidate *cs, GnmValue *range)
gnm_consolidate_add_source (GnmConsolidate *cs, GnmValue *range)
{
GnmSheetRange *new;
......@@ -776,7 +776,7 @@ consolidate_apply (GnmConsolidate *cs,
gboolean
tool_consolidate_engine (G_GNUC_UNUSED GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
gnm_tool_consolidate_engine (G_GNUC_UNUSED GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result)
{
GnmConsolidate *cs = specs;
......@@ -817,7 +817,7 @@ tool_consolidate_engine (G_GNUC_UNUSED GOCmdContext *gcc, data_analysis_output_t
return FALSE;
}
case TOOL_ENGINE_CLEAN_UP:
consolidate_free (cs, TRUE);
gnm_consolidate_free (cs, TRUE);
return FALSE;
case TOOL_ENGINE_LAST_VALIDITY_CHECK:
return FALSE;
......
......@@ -43,18 +43,18 @@ struct _GnmConsolidate {
};
GType gnm_consolidate_get_type (void);
GnmConsolidate *consolidate_new (void);
void consolidate_free (GnmConsolidate *cs, gboolean content_only);
GnmConsolidate *gnm_consolidate_new (void);
void gnm_consolidate_free (GnmConsolidate *cs, gboolean content_only);
void consolidate_set_function (GnmConsolidate *cs, GnmFunc *fd);
void consolidate_set_mode (GnmConsolidate *cs,
void gnm_consolidate_set_function (GnmConsolidate *cs, GnmFunc *fd);
void gnm_consolidate_set_mode (GnmConsolidate *cs,
GnmConsolidateMode mode);
gboolean consolidate_add_source (GnmConsolidate *cs, GnmValue *range);
gboolean consolidate_check_destination (GnmConsolidate *cs,
gboolean gnm_consolidate_add_source (GnmConsolidate *cs, GnmValue *range);
gboolean gnm_consolidate_check_destination (GnmConsolidate *cs,
data_analysis_output_t *dao);
gboolean tool_consolidate_engine (GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
gboolean gnm_tool_consolidate_engine (GOCmdContext *gcc, data_analysis_output_t *dao, gpointer specs,
analysis_tool_engine_t selector, gpointer result);
G_END_DECLS
......
......@@ -80,11 +80,11 @@ typedef struct {
WBCGtk *wbcg;
GocItem *grid[NUM_PREVIEWS]; /* Previewgrid's */
GocItem *selrect; /* Selection rectangle */
GSList *templates; /* List of GnmFormatTemplate's */
GnmFormatTemplate *selected_template; /* The currently selected template */
GSList *templates; /* List of GnmFT's */
GnmFT *selected_template; /* The currently selected template */
GList *category_groups; /* List of groups of categories */
FormatTemplateCategoryGroup *current_category_group; /* Currently selected category group */
GnmFTCategoryGroup *current_category_group; /* Currently selected category group */
int preview_top; /* Top index of the previewlist */
int preview_index; /* Selected canvas in previewlist */
......@@ -122,7 +122,7 @@ typedef struct {
typedef struct {
GnmPreviewGrid base;
GnmFormatTemplate *ft;
GnmFT *ft;
} AutoFormatGrid;
typedef GnmPreviewGridClass AutoFormatGridClass;
......@@ -132,7 +132,7 @@ afg_get_cell_style (GnmPreviewGrid *pg, int col, int row)
/* If this happens to be NULL the default style
* will automatically be used. */
AutoFormatGrid *ag = (AutoFormatGrid *) pg;
return format_template_get_style (ag->ft, row, col);
return gnm_ft_get_style (ag->ft, row, col);
}
static GnmValue *
......@@ -165,7 +165,7 @@ static GSF_CLASS (AutoFormatGrid, auto_format_grid,
gnm_preview_grid_get_type())
static GocItem *
auto_format_grid_new (AutoFormatState *state, int i, GnmFormatTemplate *ft)
auto_format_grid_new (AutoFormatState *state, int i, GnmFT *ft)
{
GocItem *item = goc_item_new (
goc_canvas_get_root (state->canvas[i]),
......@@ -191,7 +191,7 @@ templates_free (AutoFormatState *state)
g_return_if_fail (state != NULL);
for (ptr = state->templates; ptr != NULL ; ptr = ptr->next)
format_template_free (ptr->data);
gnm_ft_free (ptr->data);
g_slist_free (state->templates);
state->templates = NULL;
}
......@@ -216,10 +216,10 @@ templates_load (AutoFormatState *state)
if (state->category_groups == NULL)
return FALSE;
state->templates = category_group_get_templates_list (
state->templates = gnm_ft_category_group_get_templates_list (
state->current_category_group, GO_CMD_CONTEXT (state->wbcg));
for (l = state->templates; l != NULL; l = l->next) {
GnmFormatTemplate *ft = l->data;
GnmFT *ft = l->data;
range_init (&ft->dimension,
0, 0, PREVIEW_COLS - 1, PREVIEW_ROWS - 1);
ft->invalidate_hash = TRUE;
......@@ -312,7 +312,7 @@ previews_load (AutoFormatState *state, int topindex)
gtk_widget_hide (GTK_WIDGET (state->canvas[i]));
gtk_frame_set_shadow_type (state->frame[i], GTK_SHADOW_NONE);
} else {
GnmFormatTemplate *ft = start->data;
GnmFT *ft = start->data;
state->grid[i] = auto_format_grid_new (state, i, ft);
......@@ -362,7 +362,7 @@ cb_ok_clicked (G_GNUC_UNUSED GtkButton *button,
{
if (state->selected_template)
cmd_selection_autoformat (GNM_WBC (state->wbcg),
format_template_clone (state->selected_template));
gnm_ft_clone (state->selected_template));
gtk_widget_destroy (GTK_WIDGET (state->dialog));
}
......@@ -371,7 +371,7 @@ static void
cb_autoformat_destroy (AutoFormatState *state)
{
templates_free (state);
category_group_list_free (state->category_groups);
gnm_ft_category_group_list_free (state->category_groups);
g_free (state);
}
......@@ -387,7 +387,7 @@ cb_canvas_button_press (GocCanvas *canvas,
G_GNUC_UNUSED GdkEventButton *event,
AutoFormatState *state)
{
GnmFormatTemplate *ft;
GnmFT *ft;
GSList *ptr;
int index = 0;
......@@ -427,7 +427,7 @@ cb_check_item_toggled (G_GNUC_UNUSED GtkCheckMenuItem *item,
int i;
for (ptr = state->templates; ptr != NULL ; ptr = ptr->next) {
GnmFormatTemplate *ft = ptr->data;
GnmFT *ft = ptr->data;
ft->number = gtk_check_menu_item_get_active (state->number);
ft->border = gtk_check_menu_item_get_active (state->border);
......@@ -601,7 +601,7 @@ dialog_autoformat (WBCGtk *wbcg)
/* Fill category list */
state->category_groups =
g_list_sort (category_group_list_get (), category_group_cmp);
g_list_sort (gnm_ft_category_group_list_get (), gnm_ft_category_group_cmp);
if (state->category_groups == NULL) {
GtkWidget *dialog;
......@@ -626,7 +626,7 @@ dialog_autoformat (WBCGtk *wbcg)
NULL);
for (i = 0 ; ptr != NULL ; ptr = ptr->next, i++) {
FormatTemplateCategoryGroup *group = ptr->data;
GnmFTCategoryGroup *group = ptr->data;
if (!strcmp (group->name, "General" ))
select = i;
gtk_list_store_append (store, &iter);
......
......@@ -132,7 +132,7 @@ adjust_source_areas (ConsolidateState *state)
static GnmConsolidate *
construct_consolidate (ConsolidateState *state, data_analysis_output_t *dao)
{
GnmConsolidate *cs = consolidate_new ();
GnmConsolidate *cs = gnm_consolidate_new ();
GnmConsolidateMode mode = 0;
char const *func;
GnmValue *range_value;
......@@ -155,7 +155,7 @@ construct_consolidate (ConsolidateState *state, data_analysis_output_t *dao)
g_warning ("Unknown function index!");
}
consolidate_set_function (cs, gnm_func_lookup (func, NULL));
gnm_consolidate_set_function (cs, gnm_func_lookup (func, NULL));
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (state->labels_row)))
mode |= CONSOLIDATE_COL_LABELS;
......@@ -167,7 +167,7 @@ construct_consolidate (ConsolidateState *state, data_analysis_output_t *dao)
if (!dao_put_formulas (dao))
mode |= CONSOLIDATE_PUT_VALUES;
consolidate_set_mode (cs, mode);
gnm_consolidate_set_mode (cs, mode);
g_return_val_if_fail (gtk_tree_model_iter_n_children
(state->source_areas,
......@@ -192,16 +192,16 @@ construct_consolidate (ConsolidateState *state, data_analysis_output_t *dao)
"does not define a region"),
source);
g_free (source);
consolidate_free (cs, FALSE);
gnm_consolidate_free (cs, FALSE);
return NULL;
}
if (!consolidate_add_source (cs, range_value)) {
if (!gnm_consolidate_add_source (cs, range_value)) {
state->construct_error = g_strdup_printf (
_("Source region %s overlaps "
"with the destination region"),
source);
g_free (source);
consolidate_free (cs, FALSE);
gnm_consolidate_free (cs, FALSE);
return NULL;
}
}
......@@ -311,10 +311,10 @@ cb_consolidate_ok_clicked (GtkWidget *button, ConsolidateState *state)
return;
}
if (consolidate_check_destination (cs, dao)) {
if (gnm_consolidate_check_destination (cs, dao)) {
if (!cmd_analysis_tool (GNM_WBC (state->base.wbcg),
state->base.sheet,
dao, cs, tool_consolidate_engine,
dao, cs, gnm_tool_consolidate_engine,
FALSE) &&
(button == state->base.ok_button))
gtk_widget_destroy (state->base.dialog);
......@@ -325,7 +325,7 @@ cb_consolidate_ok_clicked (GtkWidget *button, ConsolidateState *state)
_("The output range overlaps "
"with the input ranges."));
g_free (dao);
consolidate_free (cs, FALSE);
gnm_consolidate_free (cs, FALSE);
}
}
......
......@@ -662,7 +662,7 @@ make_expr_example (Sheet *sheet, const char *text, gboolean localized)
char *etxt = gnm_expr_top_as_string (texpr, &pp, convs);
GnmValue *val = gnm_expr_top_eval
(texpr, &ep, GNM_EXPR_EVAL_PERMIT_NON_SCALAR);
GOFormat const *format = auto_style_format_suggest (texpr, &ep);
GOFormat const *format = gnm_auto_style_format_suggest (texpr, &ep);
char *vtxt = format_value (format, val, -1,
workbook_date_conv
(sheet->workbook));
......
......@@ -3382,7 +3382,7 @@ typedef union {
#endif
void
expr_init (void)
_gnm_expr_init (void)
{
#if 0
GnmExpr e;
......@@ -3432,7 +3432,7 @@ cb_expression_pool_leak (gpointer data, G_GNUC_UNUSED gpointer user)
#endif
void
expr_shutdown (void)
_gnm_expr_shutdown (void)
{
#if USE_EXPR_POOLS
go_mem_chunk_foreach_leak (expression_pool_small, cb_expression_pool_leak, NULL);
......
......@@ -220,8 +220,8 @@ void gnm_expr_sharer_report (GnmExprSharer *es);
/*****************************************************************************/
void expr_init (void);
void expr_shutdown (void);
void _gnm_expr_init (void);
void _gnm_expr_shutdown (void);
G_END_DECLS
......
......@@ -40,9 +40,9 @@
#define CXML2C(s) ((char const *)(s))
static gint
category_compare_name_and_dir (gconstpointer a, gconstpointer b)
gnm_ft_category_compare_name_and_dir (gconstpointer a, gconstpointer b)
{
FormatTemplateCategory const *cat_a = a, *cat_b = b;
GnmFTCategory const *cat_a = a, *cat_b = b;
int res;
res = strcmp (cat_a->name, cat_b->name);
......@@ -50,7 +50,7 @@ category_compare_name_and_dir (gconstpointer a, gconstpointer b)
}
static void
category_free (FormatTemplateCategory *category)
gnm_ft_category_free (GnmFTCategory *category)
{
g_free (category->directory);
g_free (category->name);
......@@ -59,8 +59,8 @@ category_free (FormatTemplateCategory *category)
}
static GSList *
category_get_templates_list (FormatTemplateCategory *category,
GOCmdContext *cc)
gnm_ft_category_get_templates_list (GnmFTCategory *category,
GOCmdContext *cc)
{
GSList *templates = NULL;
GDir *dir;
......@@ -79,10 +79,10 @@ category_get_templates_list (FormatTemplateCategory *category,
name_len = strlen (d_name);
if (name_len > 4 && strcmp (d_name + name_len - 4, ".xml") == 0) {
gchar *full_entry_name;
GnmFormatTemplate *ft;
GnmFT *ft;
full_entry_name = g_build_filename (category->directory, d_name, NULL);
ft = format_template_new_from_file (full_entry_name, cc);
ft = gnm_ft_new_from_file (full_entry_name, cc);
if (ft == NULL) {
g_warning (_("Invalid template file: %s"), full_entry_name);
} else {
......@@ -95,20 +95,20 @@ category_get_templates_list (FormatTemplateCategory *category,
g_dir_close (dir);
return g_slist_sort (templates, format_template_compare_name);
return g_slist_sort (templates, gnm_ft_compare_name);
}
/**
* gnumeric_xml_read_format_template_category :
* Open an XML file and read a FormatTemplateCategory
* gnm_ft_xml_read_category :
* Open an XML file and read a GnmFTCategory
*/
static FormatTemplateCategory *
gnumeric_xml_read_format_template_category (char const *dir_name)
static GnmFTCategory *
gnm_ft_xml_read_category (char const *dir_name)
{
gchar *file_name;
xmlDocPtr doc;
xmlNodePtr node;
FormatTemplateCategory *category = NULL;
GnmFTCategory *category = NULL;