diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-05-27 22:29:19 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-05-27 22:29:19 +0800 |
commit | 948235c3d1076dbe6ed2e57a24c16a083bbd9f01 (patch) | |
tree | 4133b1adfd94d8f889ca7ad4ad851346518f4171 /widgets | |
parent | cc3a98fc1ad5bb87aa7335f3de404ee7feee1541 (diff) | |
download | gsoc2013-evolution-948235c3d1076dbe6ed2e57a24c16a083bbd9f01.tar.gz gsoc2013-evolution-948235c3d1076dbe6ed2e57a24c16a083bbd9f01.tar.zst gsoc2013-evolution-948235c3d1076dbe6ed2e57a24c16a083bbd9f01.zip |
Prefer GLib basic types over C types.
Diffstat (limited to 'widgets')
200 files changed, 3371 insertions, 3371 deletions
diff --git a/widgets/e-timezone-dialog/e-timezone-dialog.c b/widgets/e-timezone-dialog/e-timezone-dialog.c index 80a4485739..33b7eeb68d 100644 --- a/widgets/e-timezone-dialog/e-timezone-dialog.c +++ b/widgets/e-timezone-dialog/e-timezone-dialog.c @@ -102,9 +102,9 @@ static void on_combo_changed (GtkComboBox *combo, ETimezoneDialog *etd); static void timezone_combo_get_active_text (GtkComboBox *combo, - const char **zone_name); + const gchar **zone_name); static gboolean timezone_combo_set_active_text (GtkComboBox *combo, - const char *zone_name); + const gchar *zone_name); static void map_destroy_cb (gpointer data, GObject *where_object_was); @@ -198,7 +198,7 @@ e_timezone_dialog_add_timezones (ETimezoneDialog *etd) GtkTreeIter iter; GtkCellRenderer *cell; GHashTable *index; - int i; + gint i; priv = etd->priv; @@ -328,7 +328,7 @@ get_local_offset (void) { time_t now = time(NULL), t_gmt, t_local; struct tm gmt, local; - int diff; + gint diff; gmtime_r (&now, &gmt); localtime_r (&now, &local); @@ -400,7 +400,7 @@ format_utc_offset (int utc_offset, char *buffer) { const gchar *sign = "+"; - int hours, minutes, seconds; + gint hours, minutes, seconds; if (utc_offset < 0) { utc_offset = -utc_offset; @@ -429,14 +429,14 @@ format_utc_offset (int utc_offset, } -static char * +static gchar * zone_display_name_with_offset (icaltimezone *zone) { - const char *display_name; + const gchar *display_name; struct tm local; struct icaltimetype tt; - int offset; - char buffer [100]; + gint offset; + gchar buffer [100]; time_t now = time(NULL); gmtime_r ((const time_t *) &now, &local); @@ -452,10 +452,10 @@ zone_display_name_with_offset (icaltimezone *zone) return g_strdup_printf("%s (%s)\n", display_name, buffer);; } -static const char * +static const gchar * zone_display_name (icaltimezone *zone) { - const char *display_name; + const gchar *display_name; display_name = icaltimezone_get_display_name (zone); if (icaltimezone_get_builtin_timezone (display_name)) @@ -496,7 +496,7 @@ on_map_motion (GtkWidget *widget, GdkEventMotion *event, gpointer data) ETimezoneDialogPrivate *priv; double longitude, latitude; icaltimezone *new_zone; - char *display=NULL; + gchar *display=NULL; etd = E_TIMEZONE_DIALOG (data); priv = etd->priv; @@ -625,7 +625,7 @@ get_zone_from_point (ETimezoneDialog *etd, { icalarray *zones; double longitude, latitude; - int i; + gint i; if (point == NULL) return NULL; @@ -690,7 +690,7 @@ e_timezone_dialog_set_timezone (ETimezoneDialog *etd, icaltimezone *zone) { ETimezoneDialogPrivate *priv; - char *display = NULL; + gchar *display = NULL; g_return_if_fail (E_IS_TIMEZONE_DIALOG (etd)); @@ -762,11 +762,11 @@ static void on_combo_changed (GtkComboBox *combo_box, ETimezoneDialog *etd) { ETimezoneDialogPrivate *priv; - const char *new_zone_name; + const gchar *new_zone_name; icalarray *zones; icaltimezone *map_zone = NULL; - char *location; - int i; + gchar *location; + gint i; priv = etd->priv; @@ -794,7 +794,7 @@ on_combo_changed (GtkComboBox *combo_box, ETimezoneDialog *etd) } static void -timezone_combo_get_active_text (GtkComboBox *combo, const char **zone_name) +timezone_combo_get_active_text (GtkComboBox *combo, const gchar **zone_name) { GtkTreeModel *list_store; GtkTreeIter iter; @@ -809,7 +809,7 @@ timezone_combo_get_active_text (GtkComboBox *combo, const char **zone_name) } static gboolean -timezone_combo_set_active_text (GtkComboBox *combo, const char *zone_name) +timezone_combo_set_active_text (GtkComboBox *combo, const gchar *zone_name) { GtkTreeModel *list_store; GHashTable *index; diff --git a/widgets/menus/gal-define-views-dialog.c b/widgets/menus/gal-define-views-dialog.c index e820a51a6a..8ecbcba061 100644 --- a/widgets/menus/gal-define-views-dialog.c +++ b/widgets/menus/gal-define-views-dialog.c @@ -48,7 +48,7 @@ enum { }; typedef struct { - char *title; + gchar *title; GtkTreeView *treeview; GtkTreeModel *model; @@ -80,7 +80,7 @@ gal_define_views_dialog_class_init (GalDefineViewsDialogClass *klass) /* Button callbacks */ static void -gdvd_button_new_dialog_callback (GtkWidget *widget, int id, GalDefineViewsDialog *dialog) +gdvd_button_new_dialog_callback (GtkWidget *widget, gint id, GalDefineViewsDialog *dialog) { gchar *name; GtkTreeIter iter; @@ -146,7 +146,7 @@ gdvd_button_modify_callback(GtkWidget *widget, GalDefineViewsDialog *dialog) static void gdvd_button_delete_callback(GtkWidget *widget, GalDefineViewsDialog *dialog) { - int row; + gint row; GtkTreeIter iter; GtkTreePath *path; GtkTreeSelection *selection; @@ -182,7 +182,7 @@ gdvd_button_delete_callback(GtkWidget *widget, GalDefineViewsDialog *dialog) static void gdvd_button_copy_callback(GtkWidget *widget, GalDefineViewsDialog *dialog) { - int row; + gint row; GtkWidget *scrolled; ETable *etable; @@ -219,7 +219,7 @@ gdvd_cursor_changed_callback (GtkWidget *widget, GalDefineViewsDialog *dialog) } static void -gdvd_connect_signal(GalDefineViewsDialog *dialog, const char *widget_name, const char *signal, GCallback handler) +gdvd_connect_signal(GalDefineViewsDialog *dialog, const gchar *widget_name, const gchar *signal, GCallback handler) { GtkWidget *widget; @@ -230,7 +230,7 @@ gdvd_connect_signal(GalDefineViewsDialog *dialog, const char *widget_name, const } static void -dialog_response (GalDefineViewsDialog *dialog, int response_id, gpointer data) +dialog_response (GalDefineViewsDialog *dialog, gint response_id, gpointer data) { gal_view_collection_save (dialog->collection); } @@ -303,7 +303,7 @@ static void gal_define_views_dialog_set_collection(GalDefineViewsDialog *dialog, GalViewCollection *collection) { - int i; + gint i; GtkListStore *store; GtkCellRenderer *renderer; dialog->collection = collection; @@ -318,7 +318,7 @@ gal_define_views_dialog_set_collection(GalDefineViewsDialog *dialog, /*if (item->built_in == 1) continue;*/ - char *title = NULL; + gchar *title = NULL; title = e_str_without_underscores (item->title); gtk_list_store_append (store, &iter); @@ -353,7 +353,7 @@ gal_define_views_dialog_set_collection(GalDefineViewsDialog *dialog, GtkWidget *widget = glade_xml_get_widget(dialog->gui, "label-views"); if (widget && GTK_IS_LABEL (widget)) { if (collection->title) { - char *text = g_strdup_printf (_("Define Views for %s"), + gchar *text = g_strdup_printf (_("Define Views for %s"), collection->title); gtk_label_set_text (GTK_LABEL (widget), text); diff --git a/widgets/menus/gal-define-views-model.c b/widgets/menus/gal-define-views-model.c index 9f67473c32..82ab22eedc 100644 --- a/widgets/menus/gal-define-views-model.c +++ b/widgets/menus/gal-define-views-model.c @@ -78,20 +78,20 @@ gdvm_row_count (ETableModel *etc) } /* This function returns the value at a particular point in our ETableModel. */ -static void * -gdvm_value_at (ETableModel *etc, int col, int row) +static gpointer +gdvm_value_at (ETableModel *etc, gint col, gint row) { GalDefineViewsModel *views = GAL_DEFINE_VIEWS_MODEL(etc); - const char *value; + const gchar *value; value = gal_view_get_title (gal_view_collection_get_view(views->collection, row)); - return (void *)(value ? value : ""); + return (gpointer)(value ? value : ""); } /* This function sets the value at a particular point in our ETableModel. */ static void -gdvm_set_value_at (ETableModel *etc, int col, int row, const void *val) +gdvm_set_value_at (ETableModel *etc, gint col, gint row, gconstpointer val) { GalDefineViewsModel *views = GAL_DEFINE_VIEWS_MODEL(etc); if (views->editable) { @@ -103,7 +103,7 @@ gdvm_set_value_at (ETableModel *etc, int col, int row, const void *val) /* This function returns whether a particular cell is editable. */ static gboolean -gdvm_is_cell_editable (ETableModel *etc, int col, int row) +gdvm_is_cell_editable (ETableModel *etc, gint col, gint row) { return GAL_DEFINE_VIEWS_MODEL(etc)->editable; } @@ -114,33 +114,33 @@ gdvm_append_row (ETableModel *etm, ETableModel *source, gint row) } /* This function duplicates the value passed to it. */ -static void * -gdvm_duplicate_value (ETableModel *etc, int col, const void *value) +static gpointer +gdvm_duplicate_value (ETableModel *etc, gint col, gconstpointer value) { return g_strdup(value); } /* This function frees the value passed to it. */ static void -gdvm_free_value (ETableModel *etc, int col, void *value) +gdvm_free_value (ETableModel *etc, gint col, gpointer value) { g_free(value); } -static void * -gdvm_initialize_value (ETableModel *etc, int col) +static gpointer +gdvm_initialize_value (ETableModel *etc, gint col) { return g_strdup(""); } static gboolean -gdvm_value_is_empty (ETableModel *etc, int col, const void *value) +gdvm_value_is_empty (ETableModel *etc, gint col, gconstpointer value) { - return !(value && *(char *)value); + return !(value && *(gchar *)value); } -static char * -gdvm_value_to_string (ETableModel *etc, int col, const void *value) +static gchar * +gdvm_value_to_string (ETableModel *etc, gint col, gconstpointer value) { return g_strdup(value); } @@ -279,7 +279,7 @@ gal_define_views_model_new (void) */ GalView * gal_define_views_model_get_view (GalDefineViewsModel *model, - int n) + gint n) { return gal_view_collection_get_view(model->collection, n); } @@ -293,7 +293,7 @@ gal_define_views_model_get_view (GalDefineViewsModel *model, */ void gal_define_views_model_delete_view (GalDefineViewsModel *model, - int n) + gint n) { e_table_model_pre_change(E_TABLE_MODEL(model)); gal_view_collection_delete_view(model->collection, n); @@ -309,7 +309,7 @@ gal_define_views_model_delete_view (GalDefineViewsModel *model, */ void gal_define_views_model_copy_view (GalDefineViewsModel *model, - int n) + gint n) { ETableModel *etm = E_TABLE_MODEL(model); e_table_model_pre_change(etm); diff --git a/widgets/menus/gal-define-views-model.h b/widgets/menus/gal-define-views-model.h index d0ccfb16b9..2441cf7654 100644 --- a/widgets/menus/gal-define-views-model.h +++ b/widgets/menus/gal-define-views-model.h @@ -59,11 +59,11 @@ ETableModel *gal_define_views_model_new (void); void gal_define_views_model_append (GalDefineViewsModel *model, GalView *view); GalView *gal_define_views_model_get_view (GalDefineViewsModel *model, - int i); + gint i); void gal_define_views_model_delete_view (GalDefineViewsModel *model, - int i); + gint i); void gal_define_views_model_copy_view (GalDefineViewsModel *model, - int i); + gint i); #ifdef __cplusplus } diff --git a/widgets/menus/gal-view-collection.c b/widgets/menus/gal-view-collection.c index fae91fce7e..a854d4bffa 100644 --- a/widgets/menus/gal-view-collection.c +++ b/widgets/menus/gal-view-collection.c @@ -92,13 +92,13 @@ gal_view_collection_item_free (GalViewCollectionItem *item) g_free(item); } -static char * +static gchar * gal_view_generate_string (GalViewCollection *collection, GalView *view, - int which) + gint which) { - char *ret_val; - char *pointer; + gchar *ret_val; + gchar *pointer; if (which == 1) ret_val = g_strdup(gal_view_get_title(view)); @@ -106,7 +106,7 @@ gal_view_generate_string (GalViewCollection *collection, ret_val = g_strdup_printf("%s_%d", gal_view_get_title(view), which); for (pointer = ret_val; *pointer; pointer = g_utf8_next_char(pointer)) { if (!g_unichar_isalnum(g_utf8_get_char(pointer))) { - char *ptr = pointer; + gchar *ptr = pointer; for (; ptr < g_utf8_next_char(pointer); *ptr = '_', ptr++) ; } @@ -116,9 +116,9 @@ gal_view_generate_string (GalViewCollection *collection, static gint gal_view_check_string (GalViewCollection *collection, - char *string) + gchar *string) { - int i; + gint i; if (!strcmp (string, "current_view")) return FALSE; @@ -134,13 +134,13 @@ gal_view_check_string (GalViewCollection *collection, return TRUE; } -static char * +static gchar * gal_view_generate_id (GalViewCollection *collection, GalView *view) { - int i; + gint i; for (i = 1; TRUE; i++) { - char *try; + gchar *try; try = gal_view_generate_string(collection, view, i); if (gal_view_check_string(collection, try)) @@ -153,7 +153,7 @@ static void gal_view_collection_dispose (GObject *object) { GalViewCollection *collection = GAL_VIEW_COLLECTION(object); - int i; + gint i; for (i = 0; i < collection->view_count; i++) { gal_view_collection_item_free (collection->view_data[i]); @@ -253,7 +253,7 @@ gal_view_collection_new (void) void gal_view_collection_set_title (GalViewCollection *collection, - const char *title) + const gchar *title) { g_free (collection->title); collection->title = g_strdup (title); @@ -269,8 +269,8 @@ gal_view_collection_set_title (GalViewCollection *collection, */ void gal_view_collection_set_storage_directories (GalViewCollection *collection, - const char *system_dir, - const char *local_dir) + const gchar *system_dir, + const gchar *local_dir) { g_return_if_fail (collection != NULL); g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection)); @@ -322,7 +322,7 @@ view_changed (GalView *view, /* Use factory list to load a GalView file. */ static GalView * -gal_view_collection_real_load_view_from_file (GalViewCollection *collection, const char *type, const char *title, const char *dir, const char *filename) +gal_view_collection_real_load_view_from_file (GalViewCollection *collection, const gchar *type, const gchar *title, const gchar *dir, const gchar *filename) { GalViewFactory *factory; GList *factories; @@ -346,7 +346,7 @@ gal_view_collection_real_load_view_from_file (GalViewCollection *collection, con } GalView * -gal_view_collection_load_view_from_file (GalViewCollection *collection, const char *type, const char *filename) +gal_view_collection_load_view_from_file (GalViewCollection *collection, const gchar *type, const gchar *filename) { return gal_view_collection_real_load_view_from_file (collection, type, "", collection->local_dir, filename); } @@ -362,15 +362,15 @@ load_single_file (GalViewCollection *collection, item->ever_changed = local; item->changed = FALSE; item->built_in = !local; - item->id = e_xml_get_string_prop_by_name(node, (const unsigned char *)"id"); - item->filename = e_xml_get_string_prop_by_name(node, (const unsigned char *)"filename"); - item->title = e_xml_get_translated_utf8_string_prop_by_name(node, (const unsigned char *)"title"); - item->type = e_xml_get_string_prop_by_name(node, (const unsigned char *)"type"); + item->id = e_xml_get_string_prop_by_name(node, (const guchar *)"id"); + item->filename = e_xml_get_string_prop_by_name(node, (const guchar *)"filename"); + item->title = e_xml_get_translated_utf8_string_prop_by_name(node, (const guchar *)"title"); + item->type = e_xml_get_string_prop_by_name(node, (const guchar *)"type"); item->collection = collection; item->view_changed_id = 0; if (item->filename) { - char *fullpath; + gchar *fullpath; fullpath = g_build_filename(dir, item->filename, NULL); item->view = gal_view_collection_real_load_view_from_file (collection, item->type, item->title, dir, fullpath); g_free(fullpath); @@ -385,14 +385,14 @@ load_single_file (GalViewCollection *collection, static void load_single_dir (GalViewCollection *collection, - char *dir, + gchar *dir, gboolean local) { xmlDoc *doc = NULL; xmlNode *root; xmlNode *child; - char *filename = g_build_filename(dir, "galview.xml", NULL); - char *default_view; + gchar *filename = g_build_filename(dir, "galview.xml", NULL); + gchar *default_view; if (g_file_test (filename, G_FILE_TEST_IS_REGULAR)) { #ifdef G_OS_WIN32 @@ -413,12 +413,12 @@ load_single_dir (GalViewCollection *collection, for (child = root->xmlChildrenNode; child; child = child->next) { gchar *id; gboolean found = FALSE; - int i; + gint i; - if (!strcmp ((char *)child->name, "text")) + if (!strcmp ((gchar *)child->name, "text")) continue; - id = e_xml_get_string_prop_by_name(child, (const unsigned char *)"id"); + id = e_xml_get_string_prop_by_name(child, (const guchar *)"id"); for (i = 0; i < collection->view_count; i++) { if (!strcmp(id, collection->view_data[i]->id)) { if (!local) @@ -453,7 +453,7 @@ load_single_dir (GalViewCollection *collection, g_free(id); } - default_view = e_xml_get_string_prop_by_name (root, (const unsigned char *)"default-view"); + default_view = e_xml_get_string_prop_by_name (root, (const guchar *)"default-view"); if (default_view) { if (local) collection->default_view_built_in = FALSE; @@ -505,21 +505,21 @@ gal_view_collection_load (GalViewCollection *collection) void gal_view_collection_save (GalViewCollection *collection) { - int i; + gint i; xmlDoc *doc; xmlNode *root; - char *filename; + gchar *filename; g_return_if_fail (collection != NULL); g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection)); g_return_if_fail (collection->local_dir != NULL); - doc = xmlNewDoc((const unsigned char *)"1.0"); - root = xmlNewNode(NULL, (const unsigned char *)"GalViewCollection"); + doc = xmlNewDoc((const guchar *)"1.0"); + root = xmlNewNode(NULL, (const guchar *)"GalViewCollection"); xmlDocSetRootElement(doc, root); if (collection->default_view && !collection->default_view_built_in) { - e_xml_set_string_prop_by_name(root, (const unsigned char *)"default-view", collection->default_view); + e_xml_set_string_prop_by_name(root, (const guchar *)"default-view", collection->default_view); } for (i = 0; i < collection->view_count; i++) { @@ -528,11 +528,11 @@ gal_view_collection_save (GalViewCollection *collection) item = collection->view_data[i]; if (item->ever_changed) { - child = xmlNewChild(root, NULL, (const unsigned char *)"GalView", NULL); - e_xml_set_string_prop_by_name(child, (const unsigned char *)"id", item->id); - e_xml_set_string_prop_by_name(child, (const unsigned char *)"title", item->title); - e_xml_set_string_prop_by_name(child, (const unsigned char *)"filename", item->filename); - e_xml_set_string_prop_by_name(child, (const unsigned char *)"type", item->type); + child = xmlNewChild(root, NULL, (const guchar *)"GalView", NULL); + e_xml_set_string_prop_by_name(child, (const guchar *)"id", item->id); + e_xml_set_string_prop_by_name(child, (const guchar *)"title", item->title); + e_xml_set_string_prop_by_name(child, (const guchar *)"filename", item->filename); + e_xml_set_string_prop_by_name(child, (const guchar *)"type", item->type); if (item->changed) { filename = g_build_filename(collection->local_dir, item->filename, NULL); @@ -547,10 +547,10 @@ gal_view_collection_save (GalViewCollection *collection) item = collection->removed_view_data[i]; - child = xmlNewChild(root, NULL, (const unsigned char *)"GalView", NULL); - e_xml_set_string_prop_by_name(child, (const unsigned char *)"id", item->id); - e_xml_set_string_prop_by_name(child, (const unsigned char *)"title", item->title); - e_xml_set_string_prop_by_name(child, (const unsigned char *)"type", item->type); + child = xmlNewChild(root, NULL, (const guchar *)"GalView", NULL); + e_xml_set_string_prop_by_name(child, (const guchar *)"id", item->id); + e_xml_set_string_prop_by_name(child, (const guchar *)"title", item->title); + e_xml_set_string_prop_by_name(child, (const guchar *)"type", item->type); } filename = g_build_filename(collection->local_dir, "galview.xml", NULL); if (e_xml_save_file (filename, doc) == -1) @@ -585,7 +585,7 @@ gal_view_collection_get_count (GalViewCollection *collection) */ GalView * gal_view_collection_get_view (GalViewCollection *collection, - int n) + gint n) { g_return_val_if_fail (collection != NULL, NULL); g_return_val_if_fail (GAL_IS_VIEW_COLLECTION (collection), NULL); @@ -604,7 +604,7 @@ gal_view_collection_get_view (GalViewCollection *collection, */ GalViewCollectionItem * gal_view_collection_get_view_item (GalViewCollection *collection, - int n) + gint n) { g_return_val_if_fail (collection != NULL, NULL); g_return_val_if_fail (GAL_IS_VIEW_COLLECTION (collection), NULL); @@ -614,10 +614,10 @@ gal_view_collection_get_view_item (GalViewCollection *collection, return collection->view_data[n]; } -int -gal_view_collection_get_view_index_by_id (GalViewCollection *collection, const char *view_id) +gint +gal_view_collection_get_view_index_by_id (GalViewCollection *collection, const gchar *view_id) { - int i; + gint i; for (i = 0; i < collection->view_count; i++) { if (!strcmp (collection->view_data[i]->id, view_id)) return i; @@ -625,8 +625,8 @@ gal_view_collection_get_view_index_by_id (GalViewCollection *collection, con return -1; } -char * -gal_view_collection_get_view_id_by_index (GalViewCollection *collection, int n) +gchar * +gal_view_collection_get_view_id_by_index (GalViewCollection *collection, gint n) { g_return_val_if_fail (collection != NULL, NULL); g_return_val_if_fail (GAL_IS_VIEW_COLLECTION (collection), NULL); @@ -673,7 +673,7 @@ gal_view_collection_append (GalViewCollection *collection, void gal_view_collection_delete_view (GalViewCollection *collection, - int i) + gint i) { GalViewCollectionItem *item; @@ -700,7 +700,7 @@ gal_view_collection_delete_view (GalViewCollection *collection, void gal_view_collection_copy_view (GalViewCollection *collection, - int i) + gint i) { GalViewCollectionItem *item; GalView *view; @@ -739,8 +739,8 @@ gal_view_collection_loaded (GalViewCollection *collection) return collection->loaded; } -const char * -gal_view_collection_append_with_title (GalViewCollection *collection, const char *title, GalView *view) +const gchar * +gal_view_collection_append_with_title (GalViewCollection *collection, const gchar *title, GalView *view) { GalViewCollectionItem *item; @@ -777,8 +777,8 @@ gal_view_collection_append_with_title (GalViewCollection *collection, const char return item->id; } -const char * -gal_view_collection_set_nth_view (GalViewCollection *collection, int i, GalView *view) +const gchar * +gal_view_collection_set_nth_view (GalViewCollection *collection, gint i, GalView *view) { GalViewCollectionItem *item; @@ -814,14 +814,14 @@ gal_view_collection_set_nth_view (GalViewCollection *collection, int i, GalView return item->id; } -const char * +const gchar * gal_view_collection_get_default_view (GalViewCollection *collection) { return collection->default_view; } void -gal_view_collection_set_default_view (GalViewCollection *collection, const char *id) +gal_view_collection_set_default_view (GalViewCollection *collection, const gchar *id) { g_free (collection->default_view); collection->default_view = g_strdup (id); diff --git a/widgets/menus/gal-view-collection.h b/widgets/menus/gal-view-collection.h index 83e5217131..d443aa9bc2 100644 --- a/widgets/menus/gal-view-collection.h +++ b/widgets/menus/gal-view-collection.h @@ -41,22 +41,22 @@ typedef struct { GObject base; GalViewCollectionItem **view_data; - int view_count; + gint view_count; GList *factory_list; GalViewCollectionItem **removed_view_data; - int removed_view_count; + gint removed_view_count; guint loaded : 1; guint default_view_built_in : 1; - char *system_dir; - char *local_dir; + gchar *system_dir; + gchar *local_dir; - char *default_view; + gchar *default_view; - char *title; + gchar *title; } GalViewCollection; typedef struct { @@ -72,13 +72,13 @@ typedef struct { struct GalViewCollectionItem { GalView *view; - char *id; + gchar *id; guint changed : 1; guint ever_changed : 1; guint built_in : 1; - char *filename; - char *title; - char *type; + gchar *filename; + gchar *title; + gchar *type; GalViewCollection *collection; guint view_changed_id; }; @@ -88,11 +88,11 @@ GType gal_view_collection_get_type (void); GalViewCollection *gal_view_collection_new (void); void gal_view_collection_set_title (GalViewCollection *collection, - const char *title); + const gchar *title); /* Set up the view collection. Call these two functions before ever doing load or save and never call them again. */ void gal_view_collection_set_storage_directories (GalViewCollection *collection, - const char *system_dir, - const char *local_dir); + const gchar *system_dir, + const gchar *local_dir); void gal_view_collection_add_factory (GalViewCollection *collection, GalViewFactory *factory); @@ -104,21 +104,21 @@ void gal_view_collection_display_view (GalViewColl /* Query the view collection. */ gint gal_view_collection_get_count (GalViewCollection *collection); GalView *gal_view_collection_get_view (GalViewCollection *collection, - int n); + gint n); GalViewCollectionItem *gal_view_collection_get_view_item (GalViewCollection *collection, - int n); -int gal_view_collection_get_view_index_by_id (GalViewCollection *collection, - const char *view_id); -char *gal_view_collection_get_view_id_by_index (GalViewCollection *collection, - int n); + gint n); +gint gal_view_collection_get_view_index_by_id (GalViewCollection *collection, + const gchar *view_id); +gchar *gal_view_collection_get_view_id_by_index (GalViewCollection *collection, + gint n); /* Manipulate the view collection */ void gal_view_collection_append (GalViewCollection *collection, GalView *view); void gal_view_collection_delete_view (GalViewCollection *collection, - int i); + gint i); void gal_view_collection_copy_view (GalViewCollection *collection, - int i); + gint i); /* Call set_storage_directories and add factories for anything that * might be found there before doing either of these. */ void gal_view_collection_load (GalViewCollection *collection); @@ -127,21 +127,21 @@ gboolean gal_view_collection_loaded (GalViewColl /* Use factory list to load a GalView file. */ GalView *gal_view_collection_load_view_from_file (GalViewCollection *collection, - const char *type, - const char *filename); + const gchar *type, + const gchar *filename); /* Returns id of the new view. These functions are used for GalViewInstanceSaveAsDialog. */ -const char *gal_view_collection_append_with_title (GalViewCollection *collection, - const char *title, +const gchar *gal_view_collection_append_with_title (GalViewCollection *collection, + const gchar *title, GalView *view); -const char *gal_view_collection_set_nth_view (GalViewCollection *collection, - int i, +const gchar *gal_view_collection_set_nth_view (GalViewCollection *collection, + gint i, GalView *view); -const char *gal_view_collection_get_default_view (GalViewCollection *collection); +const gchar *gal_view_collection_get_default_view (GalViewCollection *collection); void gal_view_collection_set_default_view (GalViewCollection *collection, - const char *id); + const gchar *id); G_END_DECLS diff --git a/widgets/menus/gal-view-etable.c b/widgets/menus/gal-view-etable.c index 89ce837686..688e833aeb 100644 --- a/widgets/menus/gal-view-etable.c +++ b/widgets/menus/gal-view-etable.c @@ -88,19 +88,19 @@ gal_view_etable_edit (GalView *view, GtkWindow *parent) static void gal_view_etable_load (GalView *view, - const char *filename) + const gchar *filename) { e_table_state_load_from_file(GAL_VIEW_ETABLE(view)->state, filename); } static void gal_view_etable_save (GalView *view, - const char *filename) + const gchar *filename) { e_table_state_save_to_file(GAL_VIEW_ETABLE(view)->state, filename); } -static const char * +static const gchar * gal_view_etable_get_title (GalView *view) { return GAL_VIEW_ETABLE(view)->title; @@ -108,13 +108,13 @@ gal_view_etable_get_title (GalView *view) static void gal_view_etable_set_title (GalView *view, - const char *title) + const gchar *title) { g_free(GAL_VIEW_ETABLE(view)->title); GAL_VIEW_ETABLE(view)->title = g_strdup(title); } -static const char * +static const gchar * gal_view_etable_get_type_code (GalView *view) { return "etable"; diff --git a/widgets/menus/gal-view-etable.h b/widgets/menus/gal-view-etable.h index fdc34b2710..201c1573ef 100644 --- a/widgets/menus/gal-view-etable.h +++ b/widgets/menus/gal-view-etable.h @@ -44,7 +44,7 @@ typedef struct { ETableSpecification *spec; ETableState *state; - char *title; + gchar *title; ETable *table; guint table_state_changed_id; diff --git a/widgets/menus/gal-view-factory-etable.c b/widgets/menus/gal-view-factory-etable.c index 52f759ab37..def35a82b4 100644 --- a/widgets/menus/gal-view-factory-etable.c +++ b/widgets/menus/gal-view-factory-etable.c @@ -31,7 +31,7 @@ G_DEFINE_TYPE (GalViewFactoryEtable, gal_view_factory_etable, GAL_VIEW_FACTORY_TYPE) -static const char * +static const gchar * gal_view_factory_etable_get_title (GalViewFactory *factory) { return _("Table"); @@ -39,12 +39,12 @@ gal_view_factory_etable_get_title (GalViewFactory *factory) static GalView * gal_view_factory_etable_new_view (GalViewFactory *factory, - const char *name) + const gchar *name) { return gal_view_etable_new(GAL_VIEW_FACTORY_ETABLE(factory)->spec, name); } -static const char * +static const gchar * gal_view_factory_etable_get_type_code (GalViewFactory *factory) { return "etable"; diff --git a/widgets/menus/gal-view-factory.c b/widgets/menus/gal-view-factory.c index 5b100654de..d58a1545d0 100644 --- a/widgets/menus/gal-view-factory.c +++ b/widgets/menus/gal-view-factory.c @@ -38,7 +38,7 @@ d(static gint depth = 0;) * * Returns: The title of the factory. */ -const char * +const gchar * gal_view_factory_get_title (GalViewFactory *factory) { g_return_val_if_fail (factory != NULL, NULL); @@ -59,7 +59,7 @@ gal_view_factory_get_title (GalViewFactory *factory) */ GalView * gal_view_factory_new_view (GalViewFactory *factory, - const char *name) + const gchar *name) { g_return_val_if_fail (factory != NULL, NULL); g_return_val_if_fail (GAL_IS_VIEW_FACTORY (factory), NULL); @@ -76,7 +76,7 @@ gal_view_factory_new_view (GalViewFactory *factory, * * Returns: The type code */ -const char * +const gchar * gal_view_factory_get_type_code (GalViewFactory *factory) { g_return_val_if_fail (factory != NULL, NULL); diff --git a/widgets/menus/gal-view-factory.h b/widgets/menus/gal-view-factory.h index d2c4b4aa45..59f46a20e9 100644 --- a/widgets/menus/gal-view-factory.h +++ b/widgets/menus/gal-view-factory.h @@ -48,10 +48,10 @@ typedef struct { /* * Virtual methods */ - const char *(*get_title) (GalViewFactory *factory); - const char *(*get_type_code) (GalViewFactory *factory); + const gchar *(*get_title) (GalViewFactory *factory); + const gchar *(*get_type_code) (GalViewFactory *factory); GalView *(*new_view) (GalViewFactory *factory, - const char *name); + const gchar *name); } GalViewFactoryClass; /* Standard functions */ @@ -59,17 +59,17 @@ GType gal_view_factory_get_type (void); /* Query functions */ /* Returns already translated title. */ -const char *gal_view_factory_get_title (GalViewFactory *factory); +const gchar *gal_view_factory_get_title (GalViewFactory *factory); /* Returns the code for use in identifying this type of object in the * view list. This identifier should identify this as being the * unique factory for xml files which were written out with this * identifier. Thus each factory should have a unique type code. */ -const char *gal_view_factory_get_type_code (GalViewFactory *factory); +const gchar *gal_view_factory_get_type_code (GalViewFactory *factory); /* Create a new view */ GalView *gal_view_factory_new_view (GalViewFactory *factory, - const char *name); + const gchar *name); #ifdef __cplusplus } diff --git a/widgets/menus/gal-view-instance-save-as-dialog.c b/widgets/menus/gal-view-instance-save-as-dialog.c index 02283c630e..610c03a663 100644 --- a/widgets/menus/gal-view-instance-save-as-dialog.c +++ b/widgets/menus/gal-view-instance-save-as-dialog.c @@ -48,7 +48,7 @@ static void gal_view_instance_save_as_dialog_set_instance (GalViewInstanceSaveAsDialog *dialog, GalViewInstance *instance) { - int i; + gint i; GtkListStore *store; GtkCellRenderer *renderer; dialog->instance = instance; @@ -58,7 +58,7 @@ gal_view_instance_save_as_dialog_set_instance (GalViewInstanceSaveAsDialog *dial for (i=0; i<instance->collection->view_count; i++) { GalViewCollectionItem *item = instance->collection->view_data[i]; GtkTreeIter iter; - char *title = NULL; + gchar *title = NULL; /* hide built in views */ /*if (item->built_in == 1) @@ -304,9 +304,9 @@ void gal_view_instance_save_as_dialog_save (GalViewInstanceSaveAsDialog *dialog) { GalView *view = gal_view_instance_get_current_view (dialog->instance); - const char *title; - int n; - const char *id = NULL; + const gchar *title; + gint n; + const gchar *id = NULL; GalViewCollectionItem *item; view = gal_view_clone (view); diff --git a/widgets/menus/gal-view-instance.c b/widgets/menus/gal-view-instance.c index 07dab81336..bd93b64034 100644 --- a/widgets/menus/gal-view-instance.c +++ b/widgets/menus/gal-view-instance.c @@ -83,14 +83,14 @@ save_current_view (GalViewInstance *instance) xmlDoc *doc; xmlNode *root; - doc = xmlNewDoc((const unsigned char *)"1.0"); - root = xmlNewNode (NULL, (const unsigned char *)"GalViewCurrentView"); + doc = xmlNewDoc((const guchar *)"1.0"); + root = xmlNewNode (NULL, (const guchar *)"GalViewCurrentView"); xmlDocSetRootElement(doc, root); if (instance->current_id) - e_xml_set_string_prop_by_name (root, (const unsigned char *)"current_view", instance->current_id); + e_xml_set_string_prop_by_name (root, (const guchar *)"current_view", instance->current_id); if (instance->current_type) - e_xml_set_string_prop_by_name (root, (const unsigned char *)"current_view_type", instance->current_type); + e_xml_set_string_prop_by_name (root, (const guchar *)"current_view_type", instance->current_type); if (e_xml_save_file (instance->current_view_filename, doc) == -1) g_warning ("Unable to save view to %s - %s", instance->current_view_filename, g_strerror(errno)); @@ -225,7 +225,7 @@ static void collection_changed (GalView *view, GalViewInstance *instance) { if (instance->current_id) { - char *view_id = instance->current_id; + gchar *view_id = instance->current_id; instance->current_id = NULL; gal_view_instance_set_current_view_id (instance, view_id); g_free (view_id); @@ -254,7 +254,7 @@ load_current_view (GalViewInstance *instance) instance->current_id = g_strdup (gal_view_instance_get_default_view (instance)); if (instance->current_id) { - int index = gal_view_collection_get_view_index_by_id (instance->collection, + gint index = gal_view_collection_get_view_index_by_id (instance->collection, instance->current_id); if (index != -1) { @@ -268,10 +268,10 @@ load_current_view (GalViewInstance *instance) } root = xmlDocGetRootElement(doc); - instance->current_id = e_xml_get_string_prop_by_name_with_default (root, (const unsigned char *)"current_view", NULL); + instance->current_id = e_xml_get_string_prop_by_name_with_default (root, (const guchar *)"current_view", NULL); if (instance->current_id != NULL) { - int index = gal_view_collection_get_view_index_by_id (instance->collection, + gint index = gal_view_collection_get_view_index_by_id (instance->collection, instance->current_id); if (index != -1) { @@ -281,8 +281,8 @@ load_current_view (GalViewInstance *instance) } } if (view == NULL) { - char *type; - type = e_xml_get_string_prop_by_name_with_default (root, (const unsigned char *)"current_view_type", NULL); + gchar *type; + type = e_xml_get_string_prop_by_name_with_default (root, (const guchar *)"current_view_type", NULL); view = gal_view_collection_load_view_from_file (instance->collection, type, instance->custom_filename); @@ -304,7 +304,7 @@ load_current_view (GalViewInstance *instance) * Return value: The new %GalViewInstance. **/ GalViewInstance * -gal_view_instance_new (GalViewCollection *collection, const char *instance_id) +gal_view_instance_new (GalViewCollection *collection, const gchar *instance_id) { GalViewInstance *instance = g_object_new (GAL_VIEW_INSTANCE_TYPE, NULL); if (gal_view_instance_construct (instance, collection, instance_id)) @@ -316,10 +316,10 @@ gal_view_instance_new (GalViewCollection *collection, const char *instance_id) } GalViewInstance * -gal_view_instance_construct (GalViewInstance *instance, GalViewCollection *collection, const char *instance_id) +gal_view_instance_construct (GalViewInstance *instance, GalViewCollection *collection, const gchar *instance_id) { - char *filename; - char *safe_id; + gchar *filename; + gchar *safe_id; g_return_val_if_fail (gal_view_collection_loaded (collection), NULL); @@ -352,7 +352,7 @@ gal_view_instance_construct (GalViewInstance *instance, GalViewCollection *colle } /* Manipulate the current view. */ -char * +gchar * gal_view_instance_get_current_view_id (GalViewInstance *instance) { if (instance->current_id && gal_view_collection_get_view_index_by_id (instance->collection, instance->current_id) != -1) @@ -362,10 +362,10 @@ gal_view_instance_get_current_view_id (GalViewInstance *instance) } void -gal_view_instance_set_current_view_id (GalViewInstance *instance, const char *view_id) +gal_view_instance_set_current_view_id (GalViewInstance *instance, const gchar *view_id) { GalView *view; - int index; + gint index; g_return_if_fail (instance != NULL); g_return_if_fail (GAL_IS_VIEW_INSTANCE (instance)); @@ -408,7 +408,7 @@ gal_view_instance_set_custom_view (GalViewInstance *instance, GalView *view) } static void -dialog_response(GtkWidget *dialog, int id, GalViewInstance *instance) +dialog_response(GtkWidget *dialog, gint id, GalViewInstance *instance) { if (id == GTK_RESPONSE_OK) { gal_view_instance_save_as_dialog_save (GAL_VIEW_INSTANCE_SAVE_AS_DIALOG (dialog)); @@ -436,7 +436,7 @@ gal_view_instance_load (GalViewInstance *instance) } /* These only mean anything before gal_view_instance_load is called the first time. */ -const char * +const gchar * gal_view_instance_get_default_view (GalViewInstance *instance) { if (instance->default_view) @@ -446,7 +446,7 @@ gal_view_instance_get_default_view (GalViewInstance *instance) } void -gal_view_instance_set_default_view (GalViewInstance *instance, const char *id) +gal_view_instance_set_default_view (GalViewInstance *instance, const gchar *id) { g_free (instance->default_view); instance->default_view = g_strdup (id); diff --git a/widgets/menus/gal-view-instance.h b/widgets/menus/gal-view-instance.h index 88c2c3c39d..960bf940c6 100644 --- a/widgets/menus/gal-view-instance.h +++ b/widgets/menus/gal-view-instance.h @@ -40,13 +40,13 @@ typedef struct { GalViewCollection *collection; - char *instance_id; - char *current_view_filename; - char *custom_filename; + gchar *instance_id; + gchar *current_view_filename; + gchar *custom_filename; - char *current_title; - char *current_type; - char *current_id; + gchar *current_title; + gchar *current_type; + gchar *current_id; GalView *current_view; @@ -54,7 +54,7 @@ typedef struct { guint collection_changed_id; guint loaded : 1; - char *default_view; + gchar *default_view; } GalViewInstance; typedef struct { @@ -75,15 +75,15 @@ GType gal_view_instance_get_type (void); /*collection should be loaded when you call this. instance_id: Which instance of this type of object is this (for most of evo, this is the folder id.) */ GalViewInstance *gal_view_instance_new (GalViewCollection *collection, - const char *instance_id); + const gchar *instance_id); GalViewInstance *gal_view_instance_construct (GalViewInstance *instance, GalViewCollection *collection, - const char *instance_id); + const gchar *instance_id); /* Manipulate the current view. */ -char *gal_view_instance_get_current_view_id (GalViewInstance *instance); +gchar *gal_view_instance_get_current_view_id (GalViewInstance *instance); void gal_view_instance_set_current_view_id (GalViewInstance *instance, - const char *view_id); + const gchar *view_id); GalView *gal_view_instance_get_current_view (GalViewInstance *instance); /* Sets the current view to the given custom view. */ @@ -102,9 +102,9 @@ void gal_view_instance_save_as (GalViewInstance *inst void gal_view_instance_load (GalViewInstance *instance); /* These only mean anything before gal_view_instance_load is called the first time. */ -const char *gal_view_instance_get_default_view (GalViewInstance *instance); +const gchar *gal_view_instance_get_default_view (GalViewInstance *instance); void gal_view_instance_set_default_view (GalViewInstance *instance, - const char *id); + const gchar *id); G_END_DECLS diff --git a/widgets/menus/gal-view-new-dialog.c b/widgets/menus/gal-view-new-dialog.c index 39c5411dfb..b61f1ac155 100644 --- a/widgets/menus/gal-view-new-dialog.c +++ b/widgets/menus/gal-view-new-dialog.c @@ -132,7 +132,7 @@ static void sensitize_ok_response (GalViewNewDialog *dialog) { gboolean ok = TRUE; - const char *text; + const gchar *text; text = gtk_entry_get_text (GTK_ENTRY (dialog->entry)); if (!text || !text[0]) diff --git a/widgets/menus/gal-view.c b/widgets/menus/gal-view.c index fd3cdc2a5e..7b52d74864 100644 --- a/widgets/menus/gal-view.c +++ b/widgets/menus/gal-view.c @@ -65,7 +65,7 @@ gal_view_edit (GalView *view, */ void gal_view_load (GalView *view, - const char *filename) + const gchar *filename) { g_return_if_fail (view != NULL); g_return_if_fail (GAL_IS_VIEW (view)); @@ -81,7 +81,7 @@ gal_view_load (GalView *view, */ void gal_view_save (GalView *view, - const char *filename) + const gchar *filename) { g_return_if_fail (view != NULL); g_return_if_fail (GAL_IS_VIEW (view)); @@ -96,7 +96,7 @@ gal_view_save (GalView *view, * * Returns: The title of the view. */ -const char * +const gchar * gal_view_get_title (GalView *view) { g_return_val_if_fail (view != NULL, NULL); @@ -115,7 +115,7 @@ gal_view_get_title (GalView *view) */ void gal_view_set_title (GalView *view, - const char *title) + const gchar *title) { g_return_if_fail (view != NULL); g_return_if_fail (GAL_IS_VIEW (view)); @@ -130,7 +130,7 @@ gal_view_set_title (GalView *view, * * Returns: The type of the view. */ -const char * +const gchar * gal_view_get_type_code (GalView *view) { g_return_val_if_fail (view != NULL, NULL); diff --git a/widgets/menus/gal-view.h b/widgets/menus/gal-view.h index b0ac4f3176..ce73400033 100644 --- a/widgets/menus/gal-view.h +++ b/widgets/menus/gal-view.h @@ -50,13 +50,13 @@ typedef struct { */ void (*edit) (GalView *view, GtkWindow *parent_window); void (*load) (GalView *view, - const char *filename); + const gchar *filename); void (*save) (GalView *view, - const char *filename); - const char *(*get_title) (GalView *view); + const gchar *filename); + const gchar *(*get_title) (GalView *view); void (*set_title) (GalView *view, - const char *title); - const char *(*get_type_code) (GalView *view); + const gchar *title); + const gchar *(*get_type_code) (GalView *view); GalView *(*clone) (GalView *view); /* Signals */ @@ -72,17 +72,17 @@ void gal_view_edit (GalView *view, /* xml load and save functions */ void gal_view_load (GalView *view, - const char *filename); + const gchar *filename); void gal_view_save (GalView *view, - const char *filename); + const gchar *filename); /* Title functions */ -const char *gal_view_get_title (GalView *view); +const gchar *gal_view_get_title (GalView *view); void gal_view_set_title (GalView *view, - const char *title); + const gchar *title); /* View type. */ -const char *gal_view_get_type_code (GalView *view); +const gchar *gal_view_get_type_code (GalView *view); /* Cloning the view */ GalView *gal_view_clone (GalView *view); diff --git a/widgets/misc/a11y/ea-calendar-cell.c b/widgets/misc/a11y/ea-calendar-cell.c index 2d2a92de62..af9471c5af 100644 --- a/widgets/misc/a11y/ea-calendar-cell.c +++ b/widgets/misc/a11y/ea-calendar-cell.c @@ -80,7 +80,7 @@ e_calendar_cell_new (ECalendarItem *calitem, gint row, gint column) cell->column = column; #ifdef ACC_DEBUG - g_print ("EvoAcc: e_calendar_cell created %p\n", (void *)cell); + g_print ("EvoAcc: e_calendar_cell created %p\n", (gpointer)cell); #endif return cell; @@ -91,8 +91,8 @@ e_calendar_cell_new (ECalendarItem *calitem, gint row, gint column) static void ea_calendar_cell_class_init (EaCalendarCellClass *klass); static void ea_calendar_cell_init (EaCalendarCell *a11y); -static G_CONST_RETURN gchar* ea_calendar_cell_get_name (AtkObject *accessible); -static G_CONST_RETURN gchar* ea_calendar_cell_get_description (AtkObject *accessible); +static G_CONST_RETURN gchar * ea_calendar_cell_get_name (AtkObject *accessible); +static G_CONST_RETURN gchar * ea_calendar_cell_get_description (AtkObject *accessible); static AtkObject * ea_calendar_cell_get_parent (AtkObject *accessible); static gint ea_calendar_cell_get_index_in_parent (AtkObject *accessible); static AtkStateSet *ea_calendar_cell_ref_state_set (AtkObject *accessible); @@ -209,7 +209,7 @@ static void ea_calendar_cell_finalize (GObject *object) } #endif -static G_CONST_RETURN gchar* +static G_CONST_RETURN gchar * ea_calendar_cell_get_name (AtkObject *accessible) { GObject *g_obj; @@ -243,7 +243,7 @@ ea_calendar_cell_get_name (AtkObject *accessible) return accessible->name; } -static G_CONST_RETURN gchar* +static G_CONST_RETURN gchar * ea_calendar_cell_get_description (AtkObject *accessible) { return ea_calendar_cell_get_name (accessible); diff --git a/widgets/misc/a11y/ea-calendar-item.c b/widgets/misc/a11y/ea-calendar-item.c index 34db081692..e1fb365aff 100644 --- a/widgets/misc/a11y/ea-calendar-item.c +++ b/widgets/misc/a11y/ea-calendar-item.c @@ -38,8 +38,8 @@ static void ea_calendar_item_class_init (EaCalendarItemClass *klass); static void ea_calendar_item_finalize (GObject *object); -static G_CONST_RETURN gchar* ea_calendar_item_get_name (AtkObject *accessible); -static G_CONST_RETURN gchar* ea_calendar_item_get_description (AtkObject *accessible); +static G_CONST_RETURN gchar * ea_calendar_item_get_name (AtkObject *accessible); +static G_CONST_RETURN gchar * ea_calendar_item_get_description (AtkObject *accessible); static gint ea_calendar_item_get_n_children (AtkObject *accessible); static AtkObject *ea_calendar_item_ref_child (AtkObject *accessible, gint index); static AtkStateSet* ea_calendar_item_ref_state_set (AtkObject *accessible); @@ -88,10 +88,10 @@ static AtkObject* table_interface_get_column_header (AtkTable *table, gint in_col); static AtkObject* table_interface_get_caption (AtkTable *table); -static G_CONST_RETURN gchar* +static G_CONST_RETURN gchar * table_interface_get_column_description (AtkTable *table, gint in_col); -static G_CONST_RETURN gchar* +static G_CONST_RETURN gchar * table_interface_get_row_description (AtkTable *table, gint row); static AtkObject* table_interface_get_summary (AtkTable *table); @@ -263,7 +263,7 @@ ea_calendar_item_finalize (GObject *object) #endif } -static G_CONST_RETURN gchar* +static G_CONST_RETURN gchar * ea_calendar_item_get_name (AtkObject *accessible) { GObject *g_obj; @@ -329,7 +329,7 @@ ea_calendar_item_get_name (AtkObject *accessible) return accessible->name; } -static G_CONST_RETURN gchar* +static G_CONST_RETURN gchar * ea_calendar_item_get_description (AtkObject *accessible) { if (accessible->description) @@ -782,7 +782,7 @@ table_interface_get_caption (AtkTable *table) return NULL; } -static G_CONST_RETURN gchar* +static G_CONST_RETURN gchar * table_interface_get_column_description (AtkTable *table, gint in_col) { AtkGObjectAccessible *atk_gobj; @@ -816,7 +816,7 @@ table_interface_get_column_description (AtkTable *table, gint in_col) return description; } -static G_CONST_RETURN gchar* +static G_CONST_RETURN gchar * table_interface_get_row_description (AtkTable *table, gint row) { AtkGObjectAccessible *atk_gobj; diff --git a/widgets/misc/e-calendar-item.c b/widgets/misc/e-calendar-item.c index bd6ff35cf7..c1d599e879 100644 --- a/widgets/misc/e-calendar-item.c +++ b/widgets/misc/e-calendar-item.c @@ -36,7 +36,7 @@ #include <libedataserver/e-data-server-util.h> #include <e-util/e-util.h> -static const int e_calendar_item_days_in_month[12] = { +static const gint e_calendar_item_days_in_month[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; @@ -1139,7 +1139,7 @@ e_calendar_item_draw (GnomeCanvasItem *canvas_item, static void -layout_set_day_text (ECalendarItem *calitem, PangoLayout *layout, int day_index) +layout_set_day_text (ECalendarItem *calitem, PangoLayout *layout, gint day_index) { const gchar *abbr_name; @@ -1364,18 +1364,18 @@ e_calendar_item_draw_month (ECalendarItem *calitem, cairo_destroy (cr); } -static const char * +static const gchar * get_digit_fomat () { #ifdef HAVE_GNU_GET_LIBC_VERSION #include <gnu/libc-version.h> - const char *libc_version = gnu_get_libc_version (); - char **split = g_strsplit (libc_version, ".", -1); - int major = 0; - int minor = 0; - int revision = 0; + const gchar *libc_version = gnu_get_libc_version (); + gchar **split = g_strsplit (libc_version, ".", -1); + gint major = 0; + gint minor = 0; + gint revision = 0; major = atoi (split [0]); minor = atoi (split [1]); @@ -1716,7 +1716,7 @@ e_calendar_item_get_week_number (ECalendarItem *calitem, { GDate date; guint weekday, yearday; - int offset, week_num; + gint offset, week_num; /* FIXME: check what happens at year boundaries. */ @@ -1757,7 +1757,7 @@ e_calendar_item_get_week_number (ECalendarItem *calitem, This is needed so that we get button/motion events. */ static double e_calendar_item_point (GnomeCanvasItem *item, double x, double y, - int cx, int cy, + gint cx, gint cy, GnomeCanvasItem **actual_item) { *actual_item = item; @@ -1983,7 +1983,7 @@ e_calendar_item_recalc_sizes (ECalendarItem *calitem) max_week_number_digit_width = 0; for (digit = 0; digit < 10; digit++) { gchar locale_digit[5]; - int locale_digit_len; + gint locale_digit_len; locale_digit_len = sprintf (locale_digit, get_digit_fomat (), digit); diff --git a/widgets/misc/e-calendar-item.h b/widgets/misc/e-calendar-item.h index c0ee9a43bc..926ba1c077 100644 --- a/widgets/misc/e-calendar-item.h +++ b/widgets/misc/e-calendar-item.h @@ -126,7 +126,7 @@ struct _ECalendarItem gint year; gint month; /* 0 to 11 */ - /* Points to an array of styles, one char for each day. We use 32 + /* Points to an array of styles, one gchar for each day. We use 32 chars for each month, with n + 2 months, where n is the number of complete months shown (since we show some days before the first month and after the last month grayes out). diff --git a/widgets/misc/e-canvas-background.c b/widgets/misc/e-canvas-background.c index 181d7887d4..41b03d7f65 100644 --- a/widgets/misc/e-canvas-background.c +++ b/widgets/misc/e-canvas-background.c @@ -127,7 +127,7 @@ ecb_bounds (GnomeCanvasItem *item, double *x1, double *y1, double *x2, double *y * GnomeCanvasItem::update method */ static void -ecb_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, int flags) +ecb_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, gint flags) { ArtPoint o1, o2; ECanvasBackground *ecb = E_CANVAS_BACKGROUND (item); @@ -158,7 +158,7 @@ ecb_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, int flags) /* Sets the stipple pattern for the text */ static void -set_stipple (ECanvasBackground *ecb, GdkBitmap *stipple, int use_value) +set_stipple (ECanvasBackground *ecb, GdkBitmap *stipple, gint use_value) { if (use_value) { if (ecb->priv->stipple) @@ -365,10 +365,10 @@ ecb_unrealize (GnomeCanvasItem *item) } static void -ecb_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int width, int height) +ecb_draw (GnomeCanvasItem *item, GdkDrawable *drawable, gint x, gint y, gint width, gint height) { ECanvasBackground *ecb = E_CANVAS_BACKGROUND (item); - int x1, x2, y1, y2; + gint x1, x2, y1, y2; double i2c [6]; ArtPoint upper_left, lower_right, ecb_base_point; @@ -402,7 +402,7 @@ ecb_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int width, } static double -ecb_point (GnomeCanvasItem *item, double x, double y, int cx, int cy, +ecb_point (GnomeCanvasItem *item, double x, double y, gint cx, gint cy, GnomeCanvasItem **actual_item) { ECanvasBackground *ecb = E_CANVAS_BACKGROUND (item); diff --git a/widgets/misc/e-canvas-utils.c b/widgets/misc/e-canvas-utils.c index 62ea6c54ef..cae41d859f 100644 --- a/widgets/misc/e-canvas-utils.c +++ b/widgets/misc/e-canvas-utils.c @@ -37,10 +37,10 @@ e_canvas_item_move_absolute (GnomeCanvasItem *item, double dx, double dy) } static double -compute_offset(int top, int bottom, int page_top, int page_bottom) +compute_offset(gint top, gint bottom, gint page_top, gint page_bottom) { - int size = bottom - top; - int offset = 0; + gint size = bottom - top; + gint offset = 0; if (top <= page_top && bottom >= page_bottom) return 0; @@ -68,7 +68,7 @@ static void e_canvas_show_area (GnomeCanvas *canvas, double x1, double y1, double x2, double y2) { GtkAdjustment *h, *v; - int dx = 0, dy = 0; + gint dx = 0, dy = 0; g_return_if_fail (canvas != NULL); g_return_if_fail (GNOME_IS_CANVAS (canvas)); @@ -101,7 +101,7 @@ static gboolean e_canvas_area_shown (GnomeCanvas *canvas, double x1, double y1, double x2, double y2) { GtkAdjustment *h, *v; - int dx = 0, dy = 0; + gint dx = 0, dy = 0; g_return_val_if_fail (canvas != NULL, FALSE); g_return_val_if_fail (GNOME_IS_CANVAS (canvas), FALSE); diff --git a/widgets/misc/e-canvas-vbox.c b/widgets/misc/e-canvas-vbox.c index 3d4e879c0c..1eb0ddec12 100644 --- a/widgets/misc/e-canvas-vbox.c +++ b/widgets/misc/e-canvas-vbox.c @@ -41,7 +41,7 @@ static void e_canvas_vbox_dispose (GObject *object); static gint e_canvas_vbox_event (GnomeCanvasItem *item, GdkEvent *event); static void e_canvas_vbox_realize (GnomeCanvasItem *item); -static void e_canvas_vbox_reflow (GnomeCanvasItem *item, int flags); +static void e_canvas_vbox_reflow (GnomeCanvasItem *item, gint flags); static void e_canvas_vbox_real_add_item(ECanvasVbox *e_canvas_vbox, GnomeCanvasItem *item); static void e_canvas_vbox_real_add_item_start(ECanvasVbox *e_canvas_vbox, GnomeCanvasItem *item); @@ -295,7 +295,7 @@ e_canvas_vbox_resize_children (GnomeCanvasItem *item) } static void -e_canvas_vbox_reflow( GnomeCanvasItem *item, int flags ) +e_canvas_vbox_reflow( GnomeCanvasItem *item, gint flags ) { ECanvasVbox *e_canvas_vbox = E_CANVAS_VBOX(item); if ( GTK_OBJECT_FLAGS( e_canvas_vbox ) & GNOME_CANVAS_ITEM_REALIZED ) { diff --git a/widgets/misc/e-canvas.c b/widgets/misc/e-canvas.c index 055f0311f4..39b89d2675 100644 --- a/widgets/misc/e-canvas.c +++ b/widgets/misc/e-canvas.c @@ -48,7 +48,7 @@ static gint e_canvas_focus_out (GtkWidget *widget, static void e_canvas_style_set (GtkWidget *widget, GtkStyle *previous_style); -static int emit_event (GnomeCanvas *canvas, GdkEvent *event); +static gint emit_event (GnomeCanvas *canvas, GdkEvent *event); #define d(x) @@ -287,7 +287,7 @@ e_canvas_key (GtkWidget *widget, GdkEventKey *event) #define HACKISH_AFFINE static double -gnome_canvas_item_invoke_point (GnomeCanvasItem *item, double x, double y, int cx, int cy, +gnome_canvas_item_invoke_point (GnomeCanvasItem *item, double x, double y, gint cx, gint cy, GnomeCanvasItem **actual_item) { #ifdef HACKISH_AFFINE @@ -319,10 +319,10 @@ gnome_canvas_item_invoke_point (GnomeCanvasItem *item, double x, double y, int c static int pick_current_item (GnomeCanvas *canvas, GdkEvent *event) { - int button_down; + gint button_down; double x, y; - int cx, cy; - int retval; + gint cx, cy; + gint retval; retval = FALSE; @@ -460,8 +460,8 @@ static gint e_canvas_button (GtkWidget *widget, GdkEventButton *event) { GnomeCanvas *canvas; - int mask; - int retval; + gint mask; + gint retval; g_return_val_if_fail (widget != NULL, FALSE); g_return_val_if_fail (GNOME_IS_CANVAS (widget), FALSE); @@ -695,7 +695,7 @@ e_canvas_unrealize (GtkWidget *widget) } static void -e_canvas_item_invoke_reflow (GnomeCanvasItem *item, int flags) +e_canvas_item_invoke_reflow (GnomeCanvasItem *item, gint flags) { GnomeCanvasGroup *group; GList *list; @@ -814,7 +814,7 @@ void e_canvas_item_set_cursor (GnomeCanvasItem *item, gpointer id) { GList *list; - int flags; + gint flags; ECanvas *canvas; ECanvasSelectionInfo *info; ECanvasItemSelectionFunc func; @@ -869,7 +869,7 @@ e_canvas_item_set_cursor_end (GnomeCanvasItem *item, gpointer id) void e_canvas_item_add_selection (GnomeCanvasItem *item, gpointer id) { - int flags; + gint flags; ECanvas *canvas; ECanvasSelectionInfo *info; ECanvasItemSelectionFunc func; @@ -932,7 +932,7 @@ e_canvas_item_add_selection (GnomeCanvasItem *item, gpointer id) void e_canvas_item_remove_selection (GnomeCanvasItem *item, gpointer id) { - int flags; + gint flags; ECanvas *canvas; ECanvasSelectionInfo *info; GList *list; @@ -975,7 +975,7 @@ e_canvas_item_remove_selection (GnomeCanvasItem *item, gpointer id) } } -void e_canvas_popup_tooltip (ECanvas *canvas, GtkWidget *widget, int x, int y) +void e_canvas_popup_tooltip (ECanvas *canvas, GtkWidget *widget, gint x, gint y) { if (canvas->tooltip_window && canvas->tooltip_window != widget) { e_canvas_hide_tooltip(canvas); @@ -1034,7 +1034,7 @@ grab_cancelled_check (gpointer data) return TRUE; } -int +gint e_canvas_item_grab (ECanvas *canvas, GnomeCanvasItem *item, guint event_mask, @@ -1046,7 +1046,7 @@ e_canvas_item_grab (ECanvas *canvas, if (gtk_grab_get_current ()) { return GDK_GRAB_ALREADY_GRABBED; } else { - int ret_val = gnome_canvas_item_grab (item, event_mask, cursor, etime); + gint ret_val = gnome_canvas_item_grab (item, event_mask, cursor, etime); if (ret_val == GDK_GRAB_SUCCESS) { canvas->grab_cancelled_cb = cancelled_cb; canvas->grab_cancelled_check_id = diff --git a/widgets/misc/e-canvas.h b/widgets/misc/e-canvas.h index 00692c457a..e23d29f057 100644 --- a/widgets/misc/e-canvas.h +++ b/widgets/misc/e-canvas.h @@ -79,12 +79,12 @@ typedef void (*ECanvasItemGrabCancelled) (ECanvas *canvas, GnomeCanvasItem *item struct _ECanvas { GnomeCanvas parent; - int idle_id; + gint idle_id; GList *selection; ECanvasSelectionInfo *cursor; GtkWidget *tooltip_window; - int visibility_notify_id; + gint visibility_notify_id; GtkWidget *toplevel; guint visibility_first : 1; @@ -128,7 +128,7 @@ void e_canvas_item_add_selection (GnomeCanvasItem void e_canvas_item_remove_selection (GnomeCanvasItem *item, gpointer id); -int e_canvas_item_grab (ECanvas *canvas, +gint e_canvas_item_grab (ECanvas *canvas, GnomeCanvasItem *item, guint event_mask, GdkCursor *cursor, @@ -144,8 +144,8 @@ void e_canvas_item_set_cursor_end (GnomeCanvasItem gpointer id); void e_canvas_popup_tooltip (ECanvas *canvas, GtkWidget *widget, - int x, - int y); + gint x, + gint y); void e_canvas_hide_tooltip (ECanvas *canvas); #ifdef __cplusplus diff --git a/widgets/misc/e-charset-picker.c b/widgets/misc/e-charset-picker.c index d140fe9a5c..34e9c63545 100644 --- a/widgets/misc/e-charset-picker.c +++ b/widgets/misc/e-charset-picker.c @@ -49,7 +49,7 @@ typedef enum { E_CHARSET_WESTERN_EUROPEAN_NEW } ECharsetClass; -static const char *classnames[] = { +static const gchar *classnames[] = { N_("Unknown"), N_("Arabic"), N_("Baltic"), @@ -107,7 +107,7 @@ static ECharset charsets[] = { { "ISO-8859-1", E_CHARSET_WESTERN_EUROPEAN, NULL }, { "ISO-8859-15", E_CHARSET_WESTERN_EUROPEAN_NEW, NULL }, }; -static const int num_charsets = sizeof (charsets) / sizeof (charsets[0]); +static const gint num_charsets = sizeof (charsets) / sizeof (charsets[0]); static void select_item (GtkMenuShell *menu_shell, GtkWidget *item) @@ -126,7 +126,7 @@ static GtkWidget * add_charset (GtkWidget *menu, ECharset *charset, gboolean free_name) { GtkWidget *item; - char *label; + gchar *label; if (charset->subclass) { label = g_strdup_printf ("%s, %s (%s)", @@ -154,7 +154,7 @@ add_charset (GtkWidget *menu, ECharset *charset, gboolean free_name) } static gboolean -add_other_charset (GtkWidget *menu, GtkWidget *other, const char *new_charset) +add_other_charset (GtkWidget *menu, GtkWidget *other, const gchar *new_charset) { ECharset charset = { NULL, E_CHARSET_UNKNOWN, NULL }; GtkWidget *item; @@ -200,7 +200,7 @@ static void activate_other (GtkWidget *item, gpointer menu) { GtkWidget *window, *entry, *label, *vbox, *hbox; - char *old_charset, *new_charset; + gchar *old_charset, *new_charset; GtkDialog *dialog; window = gtk_widget_get_toplevel (menu); @@ -254,7 +254,7 @@ activate_other (GtkWidget *item, gpointer menu) g_object_ref (dialog); if (gtk_dialog_run (dialog) == GTK_RESPONSE_OK) { - new_charset = (char *)gtk_entry_get_text (GTK_ENTRY (entry)); + new_charset = (gchar *)gtk_entry_get_text (GTK_ENTRY (entry)); if (*new_charset) { if (add_other_charset (menu, item, new_charset)) { @@ -289,11 +289,11 @@ activate_other (GtkWidget *item, gpointer menu) * attached. */ GtkWidget * -e_charset_picker_new (const char *default_charset) +e_charset_picker_new (const gchar *default_charset) { GtkWidget *menu, *item; - int def, i; - const char *locale_charset; + gint def, i; + const gchar *locale_charset; g_get_charset (&locale_charset); if (!g_ascii_strcasecmp (locale_charset, "US-ASCII")) @@ -347,11 +347,11 @@ e_charset_picker_new (const char *default_charset) * Return value: the currently-selected character set in @picker, * which must be freed with g_free(). **/ -char * +gchar * e_charset_picker_get_charset (GtkWidget *menu) { GtkWidget *item; - char *charset; + gchar *charset; g_return_val_if_fail (GTK_IS_MENU (menu), NULL); @@ -375,13 +375,13 @@ e_charset_picker_get_charset (GtkWidget *menu) * Return value: the selected character set (which must be freed with * g_free()), or %NULL. **/ -char * -e_charset_picker_dialog (const char *title, const char *prompt, - const char *default_charset, GtkWindow *parent) +gchar * +e_charset_picker_dialog (const gchar *title, const gchar *prompt, + const gchar *default_charset, GtkWindow *parent) { GtkDialog *dialog; GtkWidget *label, *omenu, *picker, *vbox, *hbox; - char *charset = NULL; + gchar *charset = NULL; dialog = GTK_DIALOG (gtk_dialog_new_with_buttons (title, parent, diff --git a/widgets/misc/e-charset-picker.h b/widgets/misc/e-charset-picker.h index 4f701679a5..e399cf788c 100644 --- a/widgets/misc/e-charset-picker.h +++ b/widgets/misc/e-charset-picker.h @@ -25,11 +25,11 @@ G_BEGIN_DECLS -GtkWidget * e_charset_picker_new (const char *default_charset); -char * e_charset_picker_get_charset (GtkWidget *picker); -char * e_charset_picker_dialog (const char *title, - const char *prompt, - const char *default_charset, +GtkWidget * e_charset_picker_new (const gchar *default_charset); +gchar * e_charset_picker_get_charset (GtkWidget *picker); +gchar * e_charset_picker_dialog (const gchar *title, + const gchar *prompt, + const gchar *default_charset, GtkWindow *parent); GSList * e_charset_add_radio_actions (GtkActionGroup *action_group, diff --git a/widgets/misc/e-colors.c b/widgets/misc/e-colors.c index 74fbdbf58c..5e2fddabc8 100644 --- a/widgets/misc/e-colors.c +++ b/widgets/misc/e-colors.c @@ -48,7 +48,7 @@ e_color_alloc_gdk (GtkWidget *widget, GdkColor *c) } void -e_color_alloc_name (GtkWidget *widget, const char *name, GdkColor *c) +e_color_alloc_name (GtkWidget *widget, const gchar *name, GdkColor *c) { GdkColormap *map; diff --git a/widgets/misc/e-colors.h b/widgets/misc/e-colors.h index 710ee59f59..c867d6425c 100644 --- a/widgets/misc/e-colors.h +++ b/widgets/misc/e-colors.h @@ -31,7 +31,7 @@ void e_color_init (void); /* Return the pixel value for the given red, green and blue */ gulong e_color_alloc (gushort red, gushort green, gushort blue); -void e_color_alloc_name (GtkWidget *widget, const char *name, GdkColor *color); +void e_color_alloc_name (GtkWidget *widget, const gchar *name, GdkColor *color); void e_color_alloc_gdk (GtkWidget *widget, GdkColor *color); extern GdkColor e_white, e_dark_gray, e_black; diff --git a/widgets/misc/e-combo-cell-editable.c b/widgets/misc/e-combo-cell-editable.c index 8cee128619..3d3c777986 100644 --- a/widgets/misc/e-combo-cell-editable.c +++ b/widgets/misc/e-combo-cell-editable.c @@ -170,7 +170,7 @@ lookup_row (GList *list, const gchar *text) gint result = 0; for (l = list; l; l = l->next, result++) - if (!g_utf8_collate (text, (char *) l->data)) + if (!g_utf8_collate (text, (gchar *) l->data)) break; return result; diff --git a/widgets/misc/e-cursors.c b/widgets/misc/e-cursors.c index ebc2f9bd78..ddf5f1ac26 100644 --- a/widgets/misc/e-cursors.c +++ b/widgets/misc/e-cursors.c @@ -65,11 +65,11 @@ static CursorDef cursors [] = { static void create_bitmap_and_mask_from_xpm (GdkBitmap **bitmap, GdkBitmap **mask, const gchar **xpm) { - int height, width, colors; - char pixmap_buffer [(32 * 32)/8]; - char mask_buffer [(32 * 32)/8]; - int x, y, pix, yofs; - int transparent_color, black_color; + gint height, width, colors; + gchar pixmap_buffer [(32 * 32)/8]; + gchar mask_buffer [(32 * 32)/8]; + gint x, y, pix, yofs; + gint transparent_color, black_color; sscanf (xpm [0], "%d %d %d %d", &height, &width, &colors, &pix); @@ -83,7 +83,7 @@ create_bitmap_and_mask_from_xpm (GdkBitmap **bitmap, GdkBitmap **mask, const gch yofs = colors + 1; for (y = 0; y < 32; y++){ for (x = 0; x < 32;){ - char value = 0, maskv = 0; + gchar value = 0, maskv = 0; for (pix = 0; pix < 8; pix++, x++){ if (xpm [y + yofs][x] != transparent_color){ @@ -111,7 +111,7 @@ create_bitmap_and_mask_from_xpm (GdkBitmap **bitmap, GdkBitmap **mask, const gch void e_cursors_init (void) { - int i; + gint i; e_color_init (); @@ -144,7 +144,7 @@ e_cursors_init (void) void e_cursors_shutdown (void) { - int i; + gint i; for (i = 0; cursors [i].hot_x; i++) gdk_cursor_unref (cursors [i].cursor); diff --git a/widgets/misc/e-dateedit.c b/widgets/misc/e-dateedit.c index 701cf69444..e8034eb487 100644 --- a/widgets/misc/e-dateedit.c +++ b/widgets/misc/e-dateedit.c @@ -1403,7 +1403,7 @@ rebuild_time_popup (EDateEdit *dedit) { EDateEditPrivate *priv; GtkComboBox *combo; - char buffer[40]; + gchar buffer[40]; struct tm tmp_tm; gint hour, min; @@ -1497,11 +1497,11 @@ e_date_edit_parse_time (EDateEdit *dedit, /* Returns TRUE if the string is empty or is "None" in the current locale. It ignores whitespace. */ static gboolean -field_set_to_none (const char *text) +field_set_to_none (const gchar *text) { - const char *pos; - const char *none_string; - int n; + const gchar *pos; + const gchar *none_string; + gint n; pos = text; while (n = (int)((unsigned char)*pos), isspace (n)) @@ -1717,7 +1717,7 @@ static void e_date_edit_update_date_entry (EDateEdit *dedit) { EDateEditPrivate *priv; - char buffer[100]; + gchar buffer[100]; struct tm tmp_tm = { 0 }; priv = dedit->priv; @@ -1728,7 +1728,7 @@ e_date_edit_update_date_entry (EDateEdit *dedit) /* This is a strftime() format for a short date. %x the preferred date representation for the current locale without the time, but has forced to use 4 digit year */ - char *format = e_time_get_d_fmt_with_4digit_year (); + gchar *format = e_time_get_d_fmt_with_4digit_year (); tmp_tm.tm_year = priv->year; tmp_tm.tm_mon = priv->month; @@ -1750,7 +1750,7 @@ static void e_date_edit_update_time_entry (EDateEdit *dedit) { EDateEditPrivate *priv; - char buffer[40]; + gchar buffer[40]; struct tm tmp_tm = { 0 }; priv = dedit->priv; @@ -1761,7 +1761,7 @@ e_date_edit_update_time_entry (EDateEdit *dedit) } else { GtkTreeModel *model; GtkTreeIter iter; - char *b; + gchar *b; /* Set these to reasonable values just in case. */ tmp_tm.tm_year = 2000; @@ -1797,11 +1797,11 @@ e_date_edit_update_time_entry (EDateEdit *dedit) model = gtk_combo_box_get_model (GTK_COMBO_BOX (priv->time_combo)); if (gtk_tree_model_get_iter_first (model, &iter)) { do { - char *text = NULL; + gchar *text = NULL; gtk_tree_model_get (model, &iter, 0, &text, -1); if (text) { - char *t = text; + gchar *t = text; /* truncate left spaces */ while (*t == ' ') diff --git a/widgets/misc/e-filter-bar.c b/widgets/misc/e-filter-bar.c index a113d1f101..77c20d506b 100644 --- a/widgets/misc/e-filter-bar.c +++ b/widgets/misc/e-filter-bar.c @@ -55,7 +55,7 @@ rule_editor_destroyed (EFilterBar *filter_bar, GObject *deadbeef) } static void -rule_advanced_response (GtkWidget *dialog, int response, void *data) +rule_advanced_response (GtkWidget *dialog, gint response, gpointer data) { EFilterBar *filter_bar = data; /* the below generates a compiler warning about incompatible pointer types */ @@ -163,7 +163,7 @@ save_search_dialog (ESearchBar *search_bar) } static void -menubar_activated (ESearchBar *search_bar, int id, void *data) +menubar_activated (ESearchBar *search_bar, gint id, gpointer data) { EFilterBar *filter_bar = (EFilterBar *)search_bar; GtkWidget *dialog; @@ -208,11 +208,11 @@ menubar_activated (ESearchBar *search_bar, int id, void *data) } static void -option_changed (ESearchBar *search_bar, void *data) +option_changed (ESearchBar *search_bar, gpointer data) { EFilterBar *filter_bar = (EFilterBar *)search_bar; - int id = e_search_bar_get_item_id (search_bar); - char *query; + gint id = e_search_bar_get_item_id (search_bar); + gchar *query; d(printf("option changed, id = %d, setquery = %s %d\n", id, efb->setquery ? "true" : "false", esb->block_search)); @@ -256,16 +256,16 @@ dup_item_no_subitems (ESearchBarItem *dest, } static GArray * -build_items (ESearchBar *search_bar, ESearchBarItem *items, int type, int *start, GPtrArray *rules) +build_items (ESearchBar *search_bar, ESearchBarItem *items, gint type, gint *start, GPtrArray *rules) { FilterRule *rule = NULL; EFilterBar *filter_bar = (EFilterBar *)search_bar; - int id = 0, i; + gint id = 0, i; GArray *menu = g_array_new (FALSE, FALSE, sizeof (ESearchBarItem)); ESearchBarItem item = { NULL, -1, 2 }; const gchar *source; GSList *gtksux = NULL; - int num; + gint num; for (i=0;i<rules->len;i++) gtksux = g_slist_prepend(gtksux, rules->pdata[i]); @@ -357,7 +357,7 @@ build_items (ESearchBar *search_bar, ESearchBarItem *items, int type, int *start static void free_built_items (GArray *menu) { - int i; + gint i; for (i = 0; i < menu->len; i ++) { ESearchBarItem *item; @@ -383,7 +383,7 @@ generate_menu (ESearchBar *search_bar, ESearchBarItem *items) static void free_items (ESearchBarItem *items) { - int i; + gint i; for (i = 0; items[i].id != -1; i++) g_free (items[i].text); @@ -398,7 +398,7 @@ set_menu (ESearchBar *search_bar, ESearchBarItem *items) { EFilterBar *filter_bar = E_FILTER_BAR (search_bar); ESearchBarItem *default_items; - int i, num; + gint i, num; if (filter_bar->default_items) free_items (filter_bar->default_items); @@ -472,7 +472,7 @@ filter_bar_get_property (GObject *object, switch (property_id) { case PROP_QUERY: { - char *text = e_search_bar_get_text (E_SEARCH_BAR (filter_bar)); + gchar *text = e_search_bar_get_text (E_SEARCH_BAR (filter_bar)); /* empty search text means searching turned off */ if (filter_bar->current_query && text && *text) { @@ -490,15 +490,15 @@ filter_bar_get_property (GObject *object, case PROP_STATE: { /* FIXME: we should have ESearchBar save its own state to the xmlDocPtr */ xmlChar *xmlbuf; - char *text, buf[12]; - int searchscope, item_id, n, view_id; + gchar *text, buf[12]; + gint searchscope, item_id, n, view_id; xmlNodePtr root, node; xmlDocPtr doc; item_id = e_search_bar_get_item_id ((ESearchBar *) filter_bar); - doc = xmlNewDoc ((const unsigned char *)"1.0"); - root = xmlNewDocNode (doc, NULL, (const unsigned char *)"state", NULL); + doc = xmlNewDoc ((const guchar *)"1.0"); + root = xmlNewDocNode (doc, NULL, (const guchar *)"state", NULL); xmlDocSetRootElement (doc, root); searchscope = e_search_bar_get_search_scope ((ESearchBar *) filter_bar); view_id = e_search_bar_get_viewitem_id ((ESearchBar *) filter_bar); @@ -508,28 +508,28 @@ filter_bar_get_property (GObject *object, if (item_id == E_FILTERBAR_ADVANCED_ID) { /* advanced query, save the filterbar state */ - node = xmlNewChild (root, NULL, (const unsigned char *)"filter-bar", NULL); + node = xmlNewChild (root, NULL, (const guchar *)"filter-bar", NULL); sprintf (buf, "%d", search_bar->last_search_option); - xmlSetProp (node, (const unsigned char *)"item_id", (unsigned char *)buf); + xmlSetProp (node, (const guchar *)"item_id", (guchar *)buf); sprintf (buf, "%d", searchscope); - xmlSetProp (node, (const unsigned char *)"searchscope", (unsigned char *)buf); + xmlSetProp (node, (const guchar *)"searchscope", (guchar *)buf); sprintf (buf, "%d", view_id); - xmlSetProp (node, (const unsigned char *)"view_id", (unsigned char *)buf); + xmlSetProp (node, (const guchar *)"view_id", (guchar *)buf); xmlAddChild (node, filter_rule_xml_encode (filter_bar->current_query)); } else { /* simple query, save the searchbar state */ text = e_search_bar_get_text ((ESearchBar *) filter_bar); - node = xmlNewChild (root, NULL, (const unsigned char *)"search-bar", NULL); - xmlSetProp (node, (const unsigned char *)"text", (unsigned char *)(text ? text : "")); + node = xmlNewChild (root, NULL, (const guchar *)"search-bar", NULL); + xmlSetProp (node, (const guchar *)"text", (guchar *)(text ? text : "")); sprintf (buf, "%d", item_id); - xmlSetProp (node, (const unsigned char *)"item_id", (unsigned char *)buf); + xmlSetProp (node, (const guchar *)"item_id", (guchar *)buf); sprintf (buf, "%d", searchscope); - xmlSetProp (node, (const unsigned char *)"searchscope", (unsigned char *)buf); + xmlSetProp (node, (const guchar *)"searchscope", (guchar *)buf); sprintf (buf, "%d", view_id); - xmlSetProp (node, (const unsigned char *)"view_id", (unsigned char *)buf); + xmlSetProp (node, (const guchar *)"view_id", (guchar *)buf); g_free (text); } @@ -538,7 +538,7 @@ filter_bar_get_property (GObject *object, /* remap to glib memory */ text = g_malloc (n + 1); - memcpy (text, (char *)xmlbuf, n); + memcpy (text, (gchar *)xmlbuf, n); text[n] = '\0'; xmlFree (xmlbuf); @@ -552,12 +552,12 @@ filter_bar_get_property (GObject *object, } static int -xml_get_prop_int (xmlNodePtr node, const char *prop) +xml_get_prop_int (xmlNodePtr node, const gchar *prop) { - char *buf; - int ret; + gchar *buf; + gint ret; - if ((buf = (char *)xmlGetProp (node, (unsigned char *)prop))) { + if ((buf = (gchar *)xmlGetProp (node, (guchar *)prop))) { ret = strtol (buf, NULL, 10); xmlFree (buf); } else { @@ -576,26 +576,26 @@ filter_bar_set_property (GObject *object, EFilterBar *filter_bar = (EFilterBar *) object; ESearchBar *search_bar = E_SEARCH_BAR (object); xmlNodePtr root, node; - const char *state; + const gchar *state; xmlDocPtr doc; gboolean rule_set = FALSE, is_cur_folder=FALSE; - int view_id, scope, item_id; + gint view_id, scope, item_id; switch (property_id) { case PROP_STATE: if ((state = g_value_get_string (value))) { - if (!(doc = xmlParseDoc ((unsigned char *) state))) + if (!(doc = xmlParseDoc ((guchar *) state))) return; root = doc->children; - if (strcmp ((char *)root->name, "state") != 0) { + if (strcmp ((gchar *)root->name, "state") != 0) { xmlFreeDoc (doc); return; } node = root->children; while (node != NULL) { - if (!strcmp ((char *)node->name, "filter-bar")) { + if (!strcmp ((gchar *)node->name, "filter-bar")) { FilterRule *rule = NULL; @@ -638,7 +638,7 @@ filter_bar_set_property (GObject *object, search_bar->block_search = FALSE; filter_bar->current_query = (FilterRule *)filter_bar->option_rules->pdata[item_id - filter_bar->option_base]; if (filter_bar->config && filter_bar->current_query) { - char *query = e_search_bar_get_text (search_bar); + gchar *query = e_search_bar_get_text (search_bar); filter_bar->config (filter_bar, filter_bar->current_query, item_id, query, filter_bar->config_data); g_free (query); @@ -651,9 +651,9 @@ filter_bar_set_property (GObject *object, filter_bar->setquery = FALSE; break; - } else if (!strcmp ((char *)node->name, "search-bar")) { - int subitem_id, item_id, scope, view_id; - char *text; + } else if (!strcmp ((gchar *)node->name, "search-bar")) { + gint subitem_id, item_id, scope, view_id; + gchar *text; GtkStyle *style = gtk_widget_get_default_style (); /* set the text first (it doesn't emit a signal) */ @@ -674,7 +674,7 @@ filter_bar_set_property (GObject *object, scope = xml_get_prop_int (node, "searchscope"); e_search_bar_set_search_scope (E_SEARCH_BAR (filter_bar), scope); - text = (char *)xmlGetProp (node, (const unsigned char *)"text"); + text = (gchar *)xmlGetProp (node, (const guchar *)"text"); e_search_bar_set_text (E_SEARCH_BAR (filter_bar), text); if (text && *text) { filter_bar->current_query = (FilterRule *)filter_bar->option_rules->pdata[item_id - filter_bar->option_base]; @@ -866,10 +866,10 @@ e_filter_bar_get_type (void) EFilterBar * e_filter_bar_lite_new (RuleContext *context, - const char *systemrules, - const char *userrules, + const gchar *systemrules, + const gchar *userrules, EFilterBarConfigRule config, - void *data) + gpointer data) { EFilterBar *bar; @@ -882,8 +882,8 @@ e_filter_bar_lite_new (RuleContext *context, void e_filter_bar_new_construct (RuleContext *context, - const char *systemrules, - const char *userrules, + const gchar *systemrules, + const gchar *userrules, EFilterBarConfigRule config, gpointer data) { diff --git a/widgets/misc/e-filter-bar.h b/widgets/misc/e-filter-bar.h index 350a990890..859a21b6c9 100644 --- a/widgets/misc/e-filter-bar.h +++ b/widgets/misc/e-filter-bar.h @@ -66,11 +66,11 @@ G_BEGIN_DECLS typedef struct _EFilterBar EFilterBar; typedef struct _EFilterBarClass EFilterBarClass; -typedef void (*EFilterBarConfigRule)(EFilterBar *, FilterRule *rule, int id, const char *query, void *data); +typedef void (*EFilterBarConfigRule)(EFilterBar *, FilterRule *rule, gint id, const gchar *query, gpointer data); struct _EFilterBar { ESearchBar parent; - int menu_base, option_base; + gint menu_base, option_base; GPtrArray *menu_rules, *option_rules; ESearchBarItem *default_items; @@ -78,14 +78,14 @@ struct _EFilterBar { GtkWidget *save_dialog; /* current save dialogue (so we dont pop up multiple ones) */ FilterRule *current_query; /* as it says */ - int setquery; /* true when we're setting a query directly to advanced, so dont popup the dialog */ + gint setquery; /* true when we're setting a query directly to advanced, so dont popup the dialog */ RuleContext *context; - char *systemrules; - char *userrules; + gchar *systemrules; + gchar *userrules; EFilterBarConfigRule config; - void *config_data; + gpointer config_data; CamelVeeFolder *all_account_search_vf; CamelVeeFolder *account_search_vf; @@ -118,7 +118,7 @@ enum { #define E_FILTERBAR_SEPARATOR { NULL, 0, 0 } #ifdef JUST_FOR_TRANSLATORS -const char * strings[] = { +const gchar * strings[] = { N_("_Save Search..."), N_("_Edit Saved Searches..."), N_("_Advanced Search...") @@ -129,22 +129,22 @@ const char * strings[] = { GType e_filter_bar_get_type (void); EFilterBar *e_filter_bar_new (RuleContext *context, - const char *systemrules, - const char *userrules, + const gchar *systemrules, + const gchar *userrules, EFilterBarConfigRule config, - void *data); + gpointer data); EFilterBar *e_filter_bar_lite_new (RuleContext *context, - const char *systemrules, - const char *userrules, + const gchar *systemrules, + const gchar *userrules, EFilterBarConfigRule config, - void *data); + gpointer data); void e_filter_bar_new_construct (RuleContext *context, - const char *systemrules, - const char *userrules, + const gchar *systemrules, + const gchar *userrules, EFilterBarConfigRule config, - void *data ,EFilterBar *bar ); + gpointer data ,EFilterBar *bar ); #ifdef __cplusplus } diff --git a/widgets/misc/e-gui-utils.c b/widgets/misc/e-gui-utils.c index 6acbe920ef..9110e14257 100644 --- a/widgets/misc/e-gui-utils.c +++ b/widgets/misc/e-gui-utils.c @@ -172,7 +172,7 @@ e_container_change_tab_order(GtkContainer *container, GList *widgets) struct widgetandint { GtkWidget *widget; - int count; + gint count; }; static void @@ -191,7 +191,7 @@ nth_entry_callback(GtkWidget *widget, struct widgetandint *data) } void -e_container_focus_nth_entry(GtkContainer *container, int n) +e_container_focus_nth_entry(GtkContainer *container, gint n) { struct widgetandint data; data.widget = NULL; @@ -202,7 +202,7 @@ e_container_focus_nth_entry(GtkContainer *container, int n) } gboolean -e_glade_xml_connect_widget (GladeXML *gui, char *name, char *signal, GCallback cb, gpointer closure) +e_glade_xml_connect_widget (GladeXML *gui, gchar *name, gchar *signal, GCallback cb, gpointer closure) { GtkWidget *widget; @@ -218,7 +218,7 @@ e_glade_xml_connect_widget (GladeXML *gui, char *name, char *signal, GCallback c } gboolean -e_glade_xml_set_sensitive (GladeXML *gui, char *name, gboolean sensitive) +e_glade_xml_set_sensitive (GladeXML *gui, gchar *name, gboolean sensitive) { GtkWidget *widget; diff --git a/widgets/misc/e-gui-utils.h b/widgets/misc/e-gui-utils.h index 840a55289b..b66160c2d1 100644 --- a/widgets/misc/e-gui-utils.h +++ b/widgets/misc/e-gui-utils.h @@ -36,18 +36,18 @@ void e_container_foreach_leaf (GtkContainer *container, GtkCallback callback, gpointer closure); void e_container_focus_nth_entry (GtkContainer *container, - int n); + gint n); gint e_container_change_tab_order (GtkContainer *container, GList *widgets); /* Returns TRUE on success. */ gboolean e_glade_xml_connect_widget (GladeXML *gui, - char *name, - char *signal, + gchar *name, + gchar *signal, GCallback cb, gpointer closure); gboolean e_glade_xml_set_sensitive (GladeXML *gui, - char *name, + gchar *name, gboolean sensitive); G_END_DECLS diff --git a/widgets/misc/e-icon-entry.c b/widgets/misc/e-icon-entry.c index cfcce8f8c5..fb11c98323 100644 --- a/widgets/misc/e-icon-entry.c +++ b/widgets/misc/e-icon-entry.c @@ -137,7 +137,7 @@ icon_entry_paint (GtkWidget *widget, { EIconEntry *entry = E_ICON_ENTRY (widget); GtkWidget *entry_widget = entry->priv->entry; - int x = 0, y = 0, width, height, focus_width; + gint x = 0, y = 0, width, height, focus_width; gboolean interior_focus; gtk_widget_style_get ( diff --git a/widgets/misc/e-image-chooser.c b/widgets/misc/e-image-chooser.c index d3b5a1ac07..e11439eb26 100644 --- a/widgets/misc/e-image-chooser.c +++ b/widgets/misc/e-image-chooser.c @@ -37,10 +37,10 @@ struct _EImageChooserPrivate { GtkWidget *image; GtkWidget *browse_button; - char *image_buf; - int image_buf_size; - int image_width; - int image_height; + gchar *image_buf; + gint image_buf_size; + gint image_width; + gint image_height; gboolean editable; }; @@ -87,7 +87,7 @@ enum DndTargetType { static GtkTargetEntry image_drag_types[] = { { (gchar *) URI_LIST_TYPE, 0, DND_TARGET_TYPE_URI_LIST }, }; -static const int num_image_drag_types = sizeof (image_drag_types) / sizeof (image_drag_types[0]); +static const gint num_image_drag_types = sizeof (image_drag_types) / sizeof (image_drag_types[0]); GtkWidget * e_image_chooser_new (void) @@ -222,13 +222,13 @@ e_image_chooser_dispose (GObject *object) static gboolean set_image_from_data (EImageChooser *chooser, - char *data, int length) + gchar *data, gint length) { gboolean rv = FALSE; GdkPixbufLoader *loader = gdk_pixbuf_loader_new (); GdkPixbuf *pixbuf; - gdk_pixbuf_loader_write (loader, (unsigned char *)data, length, NULL); + gdk_pixbuf_loader_write (loader, (guchar *)data, length, NULL); gdk_pixbuf_loader_close (loader, NULL); pixbuf = gdk_pixbuf_loader_get_pixbuf (loader); @@ -242,7 +242,7 @@ set_image_from_data (EImageChooser *chooser, GdkPixbuf *composite; float scale; - int new_height, new_width; + gint new_height, new_width; new_height = gdk_pixbuf_get_height (pixbuf); new_width = gdk_pixbuf_get_width (pixbuf); @@ -331,7 +331,7 @@ image_drag_motion_cb (GtkWidget *widget, return FALSE; for (p = context->targets; p != NULL; p = p->next) { - char *possible_type; + gchar *possible_type; possible_type = gdk_atom_name (GDK_POINTER_TO_ATOM (p->data)); if (!strcmp (possible_type, URI_LIST_TYPE)) { @@ -372,7 +372,7 @@ image_drag_drop_cb (GtkWidget *widget, } for (p = context->targets; p != NULL; p = p->next) { - char *possible_type; + gchar *possible_type; possible_type = gdk_atom_name (GDK_POINTER_TO_ATOM (p->data)); if (!strcmp (possible_type, URI_LIST_TYPE)) { @@ -398,22 +398,22 @@ image_drag_data_received_cb (GtkWidget *widget, GtkSelectionData *selection_data, guint info, guint time, EImageChooser *chooser) { - char *target_type; + gchar *target_type; gboolean handled = FALSE; target_type = gdk_atom_name (selection_data->target); if (!strcmp (target_type, URI_LIST_TYPE)) { GError *error = NULL; - char *uri; - char *nl = strstr ((char *)selection_data->data, "\r\n"); - char *buf = NULL; + gchar *uri; + gchar *nl = strstr ((gchar *)selection_data->data, "\r\n"); + gchar *buf = NULL; gsize read = 0; if (nl) - uri = g_strndup ((char *)selection_data->data, nl - (char*)selection_data->data); + uri = g_strndup ((gchar *)selection_data->data, nl - (gchar *)selection_data->data); else - uri = g_strdup ((char *)selection_data->data); + uri = g_strdup ((gchar *)selection_data->data); if (e_util_read_file (uri, TRUE, &buf, &read, &error) && read > 0 && buf) { if (set_image_from_data (chooser, buf, read)) { @@ -436,7 +436,7 @@ image_drag_data_received_cb (GtkWidget *widget, gboolean -e_image_chooser_set_from_file (EImageChooser *chooser, const char *filename) +e_image_chooser_set_from_file (EImageChooser *chooser, const gchar *filename) { gchar *data; gsize data_length; @@ -465,7 +465,7 @@ e_image_chooser_set_editable (EImageChooser *chooser, gboolean editable) } gboolean -e_image_chooser_get_image_data (EImageChooser *chooser, char **data, gsize *data_length) +e_image_chooser_get_image_data (EImageChooser *chooser, gchar **data, gsize *data_length) { g_return_val_if_fail (E_IS_IMAGE_CHOOSER (chooser), FALSE); g_return_val_if_fail (data != NULL, FALSE); @@ -479,9 +479,9 @@ e_image_chooser_get_image_data (EImageChooser *chooser, char **data, gsize *data } gboolean -e_image_chooser_set_image_data (EImageChooser *chooser, char *data, gsize data_length) +e_image_chooser_set_image_data (EImageChooser *chooser, gchar *data, gsize data_length) { - char *buf; + gchar *buf; g_return_val_if_fail (E_IS_IMAGE_CHOOSER (chooser), FALSE); g_return_val_if_fail (data != NULL, FALSE); diff --git a/widgets/misc/e-image-chooser.h b/widgets/misc/e-image-chooser.h index b7f599f0c1..a3972bd26d 100644 --- a/widgets/misc/e-image-chooser.h +++ b/widgets/misc/e-image-chooser.h @@ -58,10 +58,10 @@ struct _EImageChooserClass GtkWidget *e_image_chooser_new (void); GType e_image_chooser_get_type (void); -gboolean e_image_chooser_set_from_file (EImageChooser *chooser, const char *filename); -gboolean e_image_chooser_set_image_data (EImageChooser *chooser, char *data, gsize data_length); +gboolean e_image_chooser_set_from_file (EImageChooser *chooser, const gchar *filename); +gboolean e_image_chooser_set_image_data (EImageChooser *chooser, gchar *data, gsize data_length); void e_image_chooser_set_editable (EImageChooser *chooser, gboolean editable); -gboolean e_image_chooser_get_image_data (EImageChooser *chooser, char **data, gsize *data_length); +gboolean e_image_chooser_get_image_data (EImageChooser *chooser, gchar **data, gsize *data_length); #endif /* _E_IMAGE_CHOOSER_H_ */ diff --git a/widgets/misc/e-map.c b/widgets/misc/e-map.c index c2c0806178..c44e75886b 100644 --- a/widgets/misc/e-map.c +++ b/widgets/misc/e-map.c @@ -71,7 +71,7 @@ typedef struct GtkAdjustment *vadj; /* Current scrolling offsets */ - int xofs, yofs; + gint xofs, yofs; /* Realtime zoom data */ EMapZoomState zoom_state; @@ -104,9 +104,9 @@ static void e_map_set_scroll_adjustments (GtkWidget *widget, GtkAdjustment *hadj static void update_render_pixbuf (EMap *map, GdkInterpType interp, gboolean render_overlays); static void set_scroll_area (EMap *view); static void request_paint_area (EMap *view, GdkRectangle *area); -static void center_at (EMap *map, int x, int y, gboolean scroll); -static void smooth_center_at (EMap *map, int x, int y); -static void scroll_to (EMap *view, int x, int y); +static void center_at (EMap *map, gint x, gint y, gboolean scroll); +static void smooth_center_at (EMap *map, gint x, gint y); +static void scroll_to (EMap *view, gint x, gint y); static void zoom_do (EMap *map); static gint load_map_background (EMap *view, gchar *name); static void adjustment_changed_cb (GtkAdjustment *adj, gpointer data); @@ -207,7 +207,7 @@ static void e_map_init (EMap *view) { EMapPrivate *priv; - char *map_file_name = g_build_filename (EVOLUTION_IMAGES, "world_map-960.png", NULL); + gchar *map_file_name = g_build_filename (EVOLUTION_IMAGES, "world_map-960.png", NULL); priv = g_new0 (EMapPrivate, 1); view->priv = priv; @@ -305,7 +305,7 @@ static void e_map_realize (GtkWidget *widget) { GdkWindowAttr attr; - int attr_mask; + gint attr_mask; g_return_if_fail (widget != NULL); g_return_if_fail (IS_E_MAP (widget)); @@ -538,7 +538,7 @@ e_map_key_press (GtkWidget *widget, GdkEventKey *event) EMap *view; EMapPrivate *priv; gboolean do_scroll; - int xofs, yofs; + gint xofs, yofs; view = E_MAP (widget); priv = view->priv; @@ -578,7 +578,7 @@ e_map_key_press (GtkWidget *widget, GdkEventKey *event) if (do_scroll) { - int x, y; + gint x, y; x = CLAMP (priv->xofs + xofs, 0, priv->hadj->upper - priv->hadj->page_size); y = CLAMP (priv->yofs + yofs, 0, priv->vadj->upper - priv->vadj->page_size); @@ -644,7 +644,7 @@ void e_map_window_to_world (EMap *map, double win_x, double win_y, double *world_longitude, double *world_latitude) { EMapPrivate *priv; - int width, height; + gint width, height; g_return_if_fail (map); @@ -665,7 +665,7 @@ void e_map_world_to_window (EMap *map, double world_longitude, double world_latitude, double *win_x, double *win_y) { EMapPrivate *priv; - int width, height; + gint width, height; g_return_if_fail (map); @@ -895,7 +895,7 @@ e_map_get_closest_point (EMap *map, double longitude, double latitude, gboolean EMapPoint *point_chosen = NULL, *point; double min_dist = 0.0, dist; double dx, dy; - int i; + gint i; priv = map->priv; @@ -971,9 +971,9 @@ update_render_pixbuf (EMap *map, GdkInterpType interp, gboolean render_overlays) { EMapPrivate *priv; EMapPoint *point; - int width, height, orig_width, orig_height; + gint width, height, orig_width, orig_height; double zoom; - int i; + gint i; if (!GTK_WIDGET_REALIZED (GTK_WIDGET (map))) return; @@ -1039,7 +1039,7 @@ static void request_paint_area (EMap *view, GdkRectangle *area) { EMapPrivate *priv; - int width, height; + gint width, height; if (!GTK_WIDGET_DRAWABLE (GTK_WIDGET (view)) || !GTK_WIDGET_REALIZED (GTK_WIDGET (view))) return; @@ -1065,7 +1065,7 @@ request_paint_area (EMap *view, GdkRectangle *area) gdk_pixbuf_get_bits_per_sample (priv->map_render_pixbuf) == 8) { guchar *pixels; - int rowstride; + gint rowstride; rowstride = gdk_pixbuf_get_rowstride (priv->map_render_pixbuf); pixels = gdk_pixbuf_get_pixels (priv->map_render_pixbuf) + (area->y + priv->yofs) * rowstride + 3 * (area->x + priv->xofs); @@ -1162,10 +1162,10 @@ repaint_point (EMap *map, EMapPoint *point) static void -center_at (EMap *map, int x, int y, gboolean scroll) +center_at (EMap *map, gint x, gint y, gboolean scroll) { EMapPrivate *priv; - int pb_width, pb_height, + gint pb_width, pb_height, view_width, view_height; priv = map->priv; @@ -1189,12 +1189,12 @@ center_at (EMap *map, int x, int y, gboolean scroll) static void -smooth_center_at (EMap *map, int x, int y) +smooth_center_at (EMap *map, gint x, gint y) { EMapPrivate *priv; - int pb_width, pb_height, + gint pb_width, pb_height, view_width, view_height; - int dx, dy; + gint dx, dy; priv = map->priv; @@ -1222,15 +1222,15 @@ smooth_center_at (EMap *map, int x, int y) /* Scrolls the view to the specified offsets. Does not perform range checking! */ static void -scroll_to (EMap *view, int x, int y) +scroll_to (EMap *view, gint x, gint y) { EMapPrivate *priv; - int xofs, yofs; + gint xofs, yofs; GdkWindow *window; GdkGC *gc; - int width, height; - int src_x, src_y; - int dest_x, dest_y; + gint width, height; + gint src_x, src_y; + gint dest_x, dest_y; GdkEvent *event; priv = view->priv; @@ -1322,7 +1322,7 @@ scroll_to (EMap *view, int x, int y) } -static int divide_seq[] = +static gint divide_seq[] = { /* Dividends for divisor of 2 */ @@ -1417,7 +1417,7 @@ blowup_window_area (GdkWindow *window, gint area_x, gint area_y, gint target_x, gint divide_width_index, divide_height_index; gint area_width, area_height; gint i, j; - int line; + gint line; /* Set up the GC we'll be using */ @@ -1548,7 +1548,7 @@ zoom_in_smooth (EMap *map) GdkRectangle area; EMapPrivate *priv; GdkWindow *window; - int width, height; + gint width, height; double x, y; g_return_if_fail (map); diff --git a/widgets/misc/e-popup-menu.c b/widgets/misc/e-popup-menu.c index 143eaff327..20b570df24 100644 --- a/widgets/misc/e-popup-menu.c +++ b/widgets/misc/e-popup-menu.c @@ -37,7 +37,7 @@ * Creates an item with an optional icon */ static void -make_item (GtkMenu *menu, GtkMenuItem *item, const char *name, GtkWidget *pixmap) +make_item (GtkMenu *menu, GtkMenuItem *item, const gchar *name, GtkWidget *pixmap) { GtkWidget *label; @@ -63,7 +63,7 @@ GtkMenu * e_popup_menu_create (EPopupMenu *menu_list, guint32 disable_mask, guint32 hide_mask, - void *default_closure) + gpointer default_closure) { return e_popup_menu_create_with_domain (menu_list, disable_mask, @@ -77,14 +77,14 @@ GtkMenu * e_popup_menu_create_with_domain (EPopupMenu *menu_list, guint32 disable_mask, guint32 hide_mask, - void *default_closure, - const char *domain) + gpointer default_closure, + const gchar *domain) { GtkMenu *menu = GTK_MENU (gtk_menu_new ()); GSList *group = NULL; gboolean last_item_separator = TRUE; - int last_non_separator = -1; - int i; + gint last_non_separator = -1; + gint i; for (i = 0; menu_list[i].name; i++) { if (strcmp ("", menu_list[i].name) && !(menu_list [i].disable_mask & hide_mask)) { @@ -147,7 +147,7 @@ e_popup_menu_create_with_domain (EPopupMenu *menu_list, } void -e_popup_menu_run (EPopupMenu *menu_list, GdkEvent *event, guint32 disable_mask, guint32 hide_mask, void *default_closure) +e_popup_menu_run (EPopupMenu *menu_list, GdkEvent *event, guint32 disable_mask, guint32 hide_mask, gpointer default_closure) { GtkMenu *menu; @@ -195,7 +195,7 @@ e_popup_menu_free_1 (EPopupMenu *menu_item) EPopupMenu * e_popup_menu_copy (const EPopupMenu *menu_list) { - int i; + gint i; EPopupMenu *ret_val; if (menu_list == NULL) @@ -220,7 +220,7 @@ e_popup_menu_copy (const EPopupMenu *menu_list) void e_popup_menu_free (EPopupMenu *menu_list) { - int i; + gint i; if (menu_list == NULL) return; diff --git a/widgets/misc/e-popup-menu.h b/widgets/misc/e-popup-menu.h index ddf6ed04a9..75246ebda6 100644 --- a/widgets/misc/e-popup-menu.h +++ b/widgets/misc/e-popup-menu.h @@ -71,8 +71,8 @@ G_BEGIN_DECLS typedef struct _EPopupMenu EPopupMenu; struct _EPopupMenu { - char *name; - char *pixname; + gchar *name; + gchar *pixname; GCallback fn; EPopupMenu *submenu; @@ -80,7 +80,7 @@ struct _EPopupMenu { /* Added post 0.19 */ GtkWidget *pixmap_widget; - void *closure; + gpointer closure; guint is_toggle : 1; guint is_radio : 1; @@ -97,7 +97,7 @@ GtkMenu *e_popup_menu_create_with_domain (EPopupMenu *menu_list, guint32 disable_mask, guint32 hide_mask, void *default_closure, - const char *domain); + const gchar *domain); void e_popup_menu_run (EPopupMenu *menu_list, GdkEvent *event, guint32 disable_mask, diff --git a/widgets/misc/e-search-bar.c b/widgets/misc/e-search-bar.c index 9abc60442a..849825e160 100644 --- a/widgets/misc/e-search-bar.c +++ b/widgets/misc/e-search-bar.c @@ -99,8 +99,8 @@ clear_button_state_changed (GtkWidget *clear_button, GtkStateType state, ESearch update_clear_menuitem_sensitive (search_bar); } -static char * -verb_name_from_id (int id) +static gchar * +verb_name_from_id (gint id) { return g_strdup_printf ("ESearchBar:Activate:%d", id); } @@ -268,7 +268,7 @@ static void entry_activated_cb (GtkWidget *widget, ESearchBar *esb) { - const char *text = gtk_entry_get_text (GTK_ENTRY (esb->entry)); + const gchar *text = gtk_entry_get_text (GTK_ENTRY (esb->entry)); GtkStyle *style = gtk_widget_get_default_style (); if (text && *text) { @@ -607,7 +607,7 @@ search_bar_dispose (GObject *object) /* /\* Callback used when an option item is destroyed. We have to destroy its */ /* * suboption items. */ /* *\/ */ -/* static void */ +/* static gpointer / /* option_item_destroy_cb (GtkObject *object, gpointer data) */ /* { */ /* /\* ESearchBarSubitem *subitems; *\/ */ @@ -624,7 +624,7 @@ set_option (ESearchBar *esb, ESearchBarItem *items) { GtkWidget *menu; GSList *group = NULL; - int i; + gint i; if (esb->option_menu) gtk_widget_destroy (esb->option_menu); @@ -638,7 +638,7 @@ set_option (ESearchBar *esb, ESearchBarItem *items) group = NULL; if (items[i].text) { - char *str; + gchar *str; str = e_str_without_underscores (_(items[i].text)); switch (items[i].type) { case ESB_ITEMTYPE_NORMAL: diff --git a/widgets/misc/e-search-bar.h b/widgets/misc/e-search-bar.h index aadfc42ab5..41bebf96fd 100644 --- a/widgets/misc/e-search-bar.h +++ b/widgets/misc/e-search-bar.h @@ -88,10 +88,10 @@ struct _ESearchBar { guint pending_activate; /* The currently-selected item & subitem */ - int item_id; - int viewitem_id; /* Current View Id */ - int scopeitem_id; /* Scope of search */ - int last_search_option; + gint item_id; + gint viewitem_id; /* Current View Id */ + gint scopeitem_id; /* Scope of search */ + gint last_search_option; gboolean block_search; gboolean lite; @@ -123,18 +123,18 @@ void e_search_bar_set_option (ESearchBar *search_bar, ESearchBarItem *option_items); void e_search_bar_paint (ESearchBar *search_bar); void e_search_bar_set_viewoption (ESearchBar *search_bar, - int option_id, + gint option_id, ESearchBarItem *subitems); void e_search_bar_set_menu_sensitive (ESearchBar *search_bar, - int id, + gint id, gboolean state); void e_search_bar_set_item_id (ESearchBar *search_bar, - int id); + gint id); void e_search_bar_set_item_menu (ESearchBar *search_bar, - int id); -int e_search_bar_get_item_id (ESearchBar *search_bar); + gint id); +gint e_search_bar_get_item_id (ESearchBar *search_bar); G_END_DECLS diff --git a/widgets/misc/e-selection-model-array.c b/widgets/misc/e-selection-model-array.c index 7e82039d6e..dde69a7e06 100644 --- a/widgets/misc/e-selection-model-array.c +++ b/widgets/misc/e-selection-model-array.c @@ -42,7 +42,7 @@ void e_selection_model_array_confirm_row_count(ESelectionModelArray *esma) { if (esma->eba == NULL) { - int row_count = e_selection_model_array_get_row_count(esma); + gint row_count = e_selection_model_array_get_row_count(esma); esma->eba = e_bit_array_new(row_count); esma->selected_row = -1; esma->selected_range_end = -1; @@ -69,7 +69,7 @@ es_row_sorted_to_model (ESelectionModelArray *esma, gint sorted_row) /* FIXME: Should this deal with moving the selection if it's in single mode? */ void -e_selection_model_array_delete_rows(ESelectionModelArray *esma, int row, int count) +e_selection_model_array_delete_rows(ESelectionModelArray *esma, gint row, gint count) { if (esma->eba) { if (E_SELECTION_MODEL(esma)->mode == GTK_SELECTION_SINGLE) @@ -119,7 +119,7 @@ e_selection_model_array_delete_rows(ESelectionModelArray *esma, int row, int cou } void -e_selection_model_array_insert_rows(ESelectionModelArray *esma, int row, int count) +e_selection_model_array_insert_rows(ESelectionModelArray *esma, gint row, gint count) { if (esma->eba) { e_bit_array_insert(esma->eba, row, count); @@ -135,7 +135,7 @@ e_selection_model_array_insert_rows(ESelectionModelArray *esma, int row, int cou } void -e_selection_model_array_move_row(ESelectionModelArray *esma, int old_row, int new_row) +e_selection_model_array_move_row(ESelectionModelArray *esma, gint old_row, gint new_row) { ESelectionModel *esm = E_SELECTION_MODEL(esma); @@ -366,7 +366,7 @@ esma_row_count (ESelectionModel *selection) } static void -esma_change_one_row(ESelectionModel *selection, int row, gboolean grow) +esma_change_one_row(ESelectionModel *selection, gint row, gboolean grow) { ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY(selection); e_selection_model_array_confirm_row_count(esma); @@ -374,7 +374,7 @@ esma_change_one_row(ESelectionModel *selection, int row, gboolean grow) } static void -esma_change_cursor (ESelectionModel *selection, int row, int col) +esma_change_cursor (ESelectionModel *selection, gint row, gint col) { ESelectionModelArray *esma; @@ -389,9 +389,9 @@ esma_change_cursor (ESelectionModel *selection, int row, int col) } static void -esma_change_range(ESelectionModel *selection, int start, int end, gboolean grow) +esma_change_range(ESelectionModel *selection, gint start, gint end, gboolean grow) { - int i; + gint i; ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY(selection); if (start != end) { if (selection->sorter && e_sorter_needs_sorting(selection->sorter)) { @@ -420,7 +420,7 @@ esma_cursor_col (ESelectionModel *selection) } static void -esma_real_select_single_row (ESelectionModel *selection, int row) +esma_real_select_single_row (ESelectionModel *selection, gint row) { ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY(selection); @@ -434,10 +434,10 @@ esma_real_select_single_row (ESelectionModel *selection, int row) } static void -esma_select_single_row (ESelectionModel *selection, int row) +esma_select_single_row (ESelectionModel *selection, gint row) { ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY(selection); - int selected_row = esma->selected_row; + gint selected_row = esma->selected_row; esma_real_select_single_row (selection, row); if (selected_row != -1 && esma->eba && selected_row < e_bit_array_bit_count (esma->eba)) { @@ -451,7 +451,7 @@ esma_select_single_row (ESelectionModel *selection, int row) } static void -esma_toggle_single_row (ESelectionModel *selection, int row) +esma_toggle_single_row (ESelectionModel *selection, gint row) { ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY(selection); @@ -465,13 +465,13 @@ esma_toggle_single_row (ESelectionModel *selection, int row) } static void -esma_real_move_selection_end (ESelectionModel *selection, int row) +esma_real_move_selection_end (ESelectionModel *selection, gint row) { ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY(selection); - int old_start; - int old_end; - int new_start; - int new_end; + gint old_start; + gint old_end; + gint new_start; + gint new_end; if (selection->sorter && e_sorter_needs_sorting(selection->sorter)) { old_start = MIN (e_sorter_model_to_sorted(selection->sorter, esma->selection_start_row), e_sorter_model_to_sorted(selection->sorter, esma->cursor_row)); @@ -501,18 +501,18 @@ esma_real_move_selection_end (ESelectionModel *selection, int row) } static void -esma_move_selection_end (ESelectionModel *selection, int row) +esma_move_selection_end (ESelectionModel *selection, gint row) { esma_real_move_selection_end (selection, row); e_selection_model_selection_changed(selection); } static void -esma_set_selection_end (ESelectionModel *selection, int row) +esma_set_selection_end (ESelectionModel *selection, gint row) { ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY(selection); - int selected_range_end = esma->selected_range_end; - int view_row = e_sorter_model_to_sorted(selection->sorter, row); + gint selected_range_end = esma->selected_range_end; + gint view_row = e_sorter_model_to_sorted(selection->sorter, row); esma_real_select_single_row(selection, esma->selection_start_row); esma->cursor_row = esma->selection_start_row; @@ -530,7 +530,7 @@ esma_set_selection_end (ESelectionModel *selection, int row) e_selection_model_selection_changed(selection); } -int +gint e_selection_model_array_get_row_count (ESelectionModelArray *esma) { g_return_val_if_fail(esma != NULL, 0); diff --git a/widgets/misc/e-selection-model-array.h b/widgets/misc/e-selection-model-array.h index 9f297c1fed..be21a5557e 100644 --- a/widgets/misc/e-selection-model-array.h +++ b/widgets/misc/e-selection-model-array.h @@ -76,14 +76,14 @@ GType e_selection_model_array_get_type (void); /* Protected Functions */ void e_selection_model_array_insert_rows (ESelectionModelArray *esm, - int row, - int count); + gint row, + gint count); void e_selection_model_array_delete_rows (ESelectionModelArray *esm, - int row, - int count); + gint row, + gint count); void e_selection_model_array_move_row (ESelectionModelArray *esm, - int old_row, - int new_row); + gint old_row, + gint new_row); void e_selection_model_array_confirm_row_count (ESelectionModelArray *esm); /* Protected Virtual Function */ diff --git a/widgets/misc/e-selection-model-simple.c b/widgets/misc/e-selection-model-simple.c index b9f1d33bfe..b0b151dd6d 100644 --- a/widgets/misc/e-selection-model-simple.c +++ b/widgets/misc/e-selection-model-simple.c @@ -63,7 +63,7 @@ e_selection_model_simple_new (void) void e_selection_model_simple_set_row_count (ESelectionModelSimple *esms, - int row_count) + gint row_count) { if (esms->row_count != row_count) { ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY(esms); @@ -85,8 +85,8 @@ esms_get_row_count (ESelectionModelArray *esma) } void e_selection_model_simple_insert_rows (ESelectionModelSimple *esms, - int row, - int count) + gint row, + gint count) { esms->row_count += count; e_selection_model_array_insert_rows (E_SELECTION_MODEL_ARRAY(esms), row, count); @@ -94,8 +94,8 @@ void e_selection_model_simple_insert_rows (ESelectionModelSimple *e void e_selection_model_simple_delete_rows (ESelectionModelSimple *esms, - int row, - int count) + gint row, + gint count) { esms->row_count -= count; e_selection_model_array_delete_rows (E_SELECTION_MODEL_ARRAY(esms), row, count); @@ -103,8 +103,8 @@ e_selection_model_simple_delete_rows (ESelectionModelSimple *esms, void e_selection_model_simple_move_row (ESelectionModelSimple *esms, - int old_row, - int new_row) + gint old_row, + gint new_row) { e_selection_model_array_move_row (E_SELECTION_MODEL_ARRAY(esms), old_row, new_row); } diff --git a/widgets/misc/e-selection-model-simple.h b/widgets/misc/e-selection-model-simple.h index 7f11d3ac0e..8db463b32f 100644 --- a/widgets/misc/e-selection-model-simple.h +++ b/widgets/misc/e-selection-model-simple.h @@ -39,7 +39,7 @@ extern "C" { typedef struct { ESelectionModelArray parent; - int row_count; + gint row_count; } ESelectionModelSimple; typedef struct { @@ -50,17 +50,17 @@ GType e_selection_model_simple_get_type (void); ESelectionModelSimple *e_selection_model_simple_new (void); void e_selection_model_simple_insert_rows (ESelectionModelSimple *esms, - int row, - int count); + gint row, + gint count); void e_selection_model_simple_delete_rows (ESelectionModelSimple *esms, - int row, - int count); + gint row, + gint count); void e_selection_model_simple_move_row (ESelectionModelSimple *esms, - int old_row, - int new_row); + gint old_row, + gint new_row); void e_selection_model_simple_set_row_count (ESelectionModelSimple *selection, - int row_count); + gint row_count); #ifdef __cplusplus } diff --git a/widgets/misc/e-selection-model.c b/widgets/misc/e-selection-model.c index 66187e6e7c..cc1d3b3780 100644 --- a/widgets/misc/e-selection-model.c +++ b/widgets/misc/e-selection-model.c @@ -113,8 +113,8 @@ esm_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpe case PROP_SELECTION_MODE: esm->mode = g_value_get_int (value); if (esm->mode == GTK_SELECTION_SINGLE) { - int cursor_row = e_selection_model_cursor_row(esm); - int cursor_col = e_selection_model_cursor_col(esm); + gint cursor_row = e_selection_model_cursor_row(esm); + gint cursor_col = e_selection_model_cursor_col(esm); e_selection_model_do_something(esm, cursor_row, cursor_col, 0); } break; @@ -322,7 +322,7 @@ e_selection_model_invert_selection (ESelectionModel *selection) E_SELECTION_MODEL_GET_CLASS(selection)->invert_selection (selection); } -int +gint e_selection_model_row_count (ESelectionModel *selection) { if (E_SELECTION_MODEL_GET_CLASS(selection)->row_count) @@ -332,20 +332,20 @@ e_selection_model_row_count (ESelectionModel *selection) } void -e_selection_model_change_one_row(ESelectionModel *selection, int row, gboolean grow) +e_selection_model_change_one_row(ESelectionModel *selection, gint row, gboolean grow) { if (E_SELECTION_MODEL_GET_CLASS(selection)->change_one_row) E_SELECTION_MODEL_GET_CLASS(selection)->change_one_row (selection, row, grow); } void -e_selection_model_change_cursor (ESelectionModel *selection, int row, int col) +e_selection_model_change_cursor (ESelectionModel *selection, gint row, gint col) { if (E_SELECTION_MODEL_GET_CLASS(selection)->change_cursor) E_SELECTION_MODEL_GET_CLASS(selection)->change_cursor (selection, row, col); } -int +gint e_selection_model_cursor_row (ESelectionModel *selection) { if (E_SELECTION_MODEL_GET_CLASS(selection)->cursor_row) @@ -354,7 +354,7 @@ e_selection_model_cursor_row (ESelectionModel *selection) return -1; } -int +gint e_selection_model_cursor_col (ESelectionModel *selection) { if (E_SELECTION_MODEL_GET_CLASS(selection)->cursor_col) @@ -364,28 +364,28 @@ e_selection_model_cursor_col (ESelectionModel *selection) } void -e_selection_model_select_single_row (ESelectionModel *selection, int row) +e_selection_model_select_single_row (ESelectionModel *selection, gint row) { if (E_SELECTION_MODEL_GET_CLASS(selection)->select_single_row) E_SELECTION_MODEL_GET_CLASS(selection)->select_single_row (selection, row); } void -e_selection_model_toggle_single_row (ESelectionModel *selection, int row) +e_selection_model_toggle_single_row (ESelectionModel *selection, gint row) { if (E_SELECTION_MODEL_GET_CLASS(selection)->toggle_single_row) E_SELECTION_MODEL_GET_CLASS(selection)->toggle_single_row (selection, row); } void -e_selection_model_move_selection_end (ESelectionModel *selection, int row) +e_selection_model_move_selection_end (ESelectionModel *selection, gint row) { if (E_SELECTION_MODEL_GET_CLASS(selection)->move_selection_end) E_SELECTION_MODEL_GET_CLASS(selection)->move_selection_end (selection, row); } void -e_selection_model_set_selection_end (ESelectionModel *selection, int row) +e_selection_model_set_selection_end (ESelectionModel *selection, gint row) { if (E_SELECTION_MODEL_GET_CLASS(selection)->set_selection_end) E_SELECTION_MODEL_GET_CLASS(selection)->set_selection_end (selection, row); @@ -409,7 +409,7 @@ e_selection_model_do_something (ESelectionModel *selection, { gint shift_p = state & GDK_SHIFT_MASK; gint ctrl_p = state & GDK_CONTROL_MASK; - int row_count; + gint row_count; selection->old_selection = -1; @@ -511,7 +511,7 @@ e_selection_model_select_as_key_press (ESelectionModel *selection, guint col, GdkModifierType state) { - int cursor_activated = TRUE; + gint cursor_activated = TRUE; gint shift_p = state & GDK_SHIFT_MASK; gint ctrl_p = state & GDK_CONTROL_MASK; @@ -552,9 +552,9 @@ move_selection (ESelectionModel *selection, gboolean up, GdkModifierType state) { - int row = e_selection_model_cursor_row(selection); - int col = e_selection_model_cursor_col(selection); - int row_count; + gint row = e_selection_model_cursor_row(selection); + gint col = e_selection_model_cursor_col(selection); + gint row_count; /* there is no selected row when row is -1 */ if (row != -1) @@ -601,8 +601,8 @@ e_selection_model_key_press (ESelectionModel *selection, case GDK_space: case GDK_KP_Space: if (selection->mode != GTK_SELECTION_SINGLE) { - int row = e_selection_model_cursor_row(selection); - int col = e_selection_model_cursor_col(selection); + gint row = e_selection_model_cursor_row(selection); + gint col = e_selection_model_cursor_col(selection); if (row == -1) break; @@ -616,8 +616,8 @@ e_selection_model_key_press (ESelectionModel *selection, case GDK_Return: case GDK_KP_Enter: if (selection->mode != GTK_SELECTION_SINGLE) { - int row = e_selection_model_cursor_row(selection); - int col = e_selection_model_cursor_col(selection); + gint row = e_selection_model_cursor_row(selection); + gint col = e_selection_model_cursor_col(selection); e_selection_model_select_single_row (selection, row); g_signal_emit(selection, e_selection_model_signals[CURSOR_ACTIVATED], 0, @@ -628,8 +628,8 @@ e_selection_model_key_press (ESelectionModel *selection, case GDK_Home: case GDK_KP_Home: if (selection->cursor_mode == E_CURSOR_LINE) { - int row = 0; - int cursor_col = e_selection_model_cursor_col(selection); + gint row = 0; + gint cursor_col = e_selection_model_cursor_col(selection); row = e_sorter_sorted_to_model(selection->sorter, row); e_selection_model_select_as_key_press (selection, row, cursor_col, key->state); @@ -639,8 +639,8 @@ e_selection_model_key_press (ESelectionModel *selection, case GDK_End: case GDK_KP_End: if (selection->cursor_mode == E_CURSOR_LINE) { - int row = e_selection_model_row_count(selection) - 1; - int cursor_col = e_selection_model_cursor_col(selection); + gint row = e_selection_model_row_count(selection) - 1; + gint cursor_col = e_selection_model_cursor_col(selection); row = e_sorter_sorted_to_model(selection->sorter, row); e_selection_model_select_as_key_press (selection, row, cursor_col, key->state); @@ -653,8 +653,8 @@ e_selection_model_key_press (ESelectionModel *selection, void e_selection_model_cursor_changed (ESelectionModel *selection, - int row, - int col) + gint row, + gint col) { g_signal_emit(selection, e_selection_model_signals[CURSOR_CHANGED], 0, @@ -663,8 +663,8 @@ e_selection_model_cursor_changed (ESelectionModel *selection, void e_selection_model_cursor_activated (ESelectionModel *selection, - int row, - int col) + gint row, + gint col) { g_signal_emit(selection, e_selection_model_signals[CURSOR_ACTIVATED], 0, @@ -680,7 +680,7 @@ e_selection_model_selection_changed (ESelectionModel *selection) void e_selection_model_selection_row_changed (ESelectionModel *selection, - int row) + gint row) { g_signal_emit(selection, e_selection_model_signals[SELECTION_ROW_CHANGED], 0, diff --git a/widgets/misc/e-selection-model.h b/widgets/misc/e-selection-model.h index 24eccd304f..16194000a5 100644 --- a/widgets/misc/e-selection-model.h +++ b/widgets/misc/e-selection-model.h @@ -40,7 +40,7 @@ extern "C" { #ifndef _E_FOREACH_FUNC_H_ #define _E_FOREACH_FUNC_H_ -typedef void (*EForeachFunc) (int model_row, +typedef void (*EForeachFunc) (gint model_row, gpointer closure); #endif @@ -59,39 +59,39 @@ typedef struct { GtkSelectionMode mode; ECursorMode cursor_mode; - int old_selection; + gint old_selection; } ESelectionModel; typedef struct { GObjectClass parent_class; /* Virtual methods */ - gboolean (*is_row_selected) (ESelectionModel *esm, int row); + gboolean (*is_row_selected) (ESelectionModel *esm, gint row); void (*foreach) (ESelectionModel *esm, EForeachFunc callback, gpointer closure); void (*clear) (ESelectionModel *esm); gint (*selected_count) (ESelectionModel *esm); void (*select_all) (ESelectionModel *esm); void (*invert_selection) (ESelectionModel *esm); - int (*row_count) (ESelectionModel *esm); + gint (*row_count) (ESelectionModel *esm); /* Protected virtual methods. */ - void (*change_one_row) (ESelectionModel *esm, int row, gboolean on); - void (*change_cursor) (ESelectionModel *esm, int row, int col); - int (*cursor_row) (ESelectionModel *esm); - int (*cursor_col) (ESelectionModel *esm); + void (*change_one_row) (ESelectionModel *esm, gint row, gboolean on); + void (*change_cursor) (ESelectionModel *esm, gint row, gint col); + gint (*cursor_row) (ESelectionModel *esm); + gint (*cursor_col) (ESelectionModel *esm); - void (*select_single_row) (ESelectionModel *selection, int row); - void (*toggle_single_row) (ESelectionModel *selection, int row); - void (*move_selection_end) (ESelectionModel *selection, int row); - void (*set_selection_end) (ESelectionModel *selection, int row); + void (*select_single_row) (ESelectionModel *selection, gint row); + void (*toggle_single_row) (ESelectionModel *selection, gint row); + void (*move_selection_end) (ESelectionModel *selection, gint row); + void (*set_selection_end) (ESelectionModel *selection, gint row); /* * Signals */ - void (*cursor_changed) (ESelectionModel *esm, int row, int col); - void (*cursor_activated) (ESelectionModel *esm, int row, int col); - void (*selection_row_changed) (ESelectionModel *esm, int row); + void (*cursor_changed) (ESelectionModel *esm, gint row, gint col); + void (*cursor_activated) (ESelectionModel *esm, gint row, gint col); + void (*selection_row_changed) (ESelectionModel *esm, gint row); void (*selection_changed) (ESelectionModel *esm); } ESelectionModelClass; @@ -128,36 +128,36 @@ void e_selection_model_clear (ESelectionModel *esm); gint e_selection_model_selected_count (ESelectionModel *esm); void e_selection_model_select_all (ESelectionModel *esm); void e_selection_model_invert_selection (ESelectionModel *esm); -int e_selection_model_row_count (ESelectionModel *esm); +gint e_selection_model_row_count (ESelectionModel *esm); /* Private virtual Functions */ void e_selection_model_change_one_row (ESelectionModel *esm, - int row, + gint row, gboolean on); void e_selection_model_change_cursor (ESelectionModel *esm, - int row, - int col); -int e_selection_model_cursor_row (ESelectionModel *esm); -int e_selection_model_cursor_col (ESelectionModel *esm); + gint row, + gint col); +gint e_selection_model_cursor_row (ESelectionModel *esm); +gint e_selection_model_cursor_col (ESelectionModel *esm); void e_selection_model_select_single_row (ESelectionModel *selection, - int row); + gint row); void e_selection_model_toggle_single_row (ESelectionModel *selection, - int row); + gint row); void e_selection_model_move_selection_end (ESelectionModel *selection, - int row); + gint row); void e_selection_model_set_selection_end (ESelectionModel *selection, - int row); + gint row); /* Signals */ void e_selection_model_cursor_changed (ESelectionModel *selection, - int row, - int col); + gint row, + gint col); void e_selection_model_cursor_activated (ESelectionModel *selection, - int row, - int col); + gint row, + gint col); void e_selection_model_selection_row_changed (ESelectionModel *selection, - int row); + gint row); void e_selection_model_selection_changed (ESelectionModel *selection); #ifdef __cplusplus diff --git a/widgets/misc/e-send-options.c b/widgets/misc/e-send-options.c index 8740f2d02e..b42630ebae 100644 --- a/widgets/misc/e-send-options.c +++ b/widgets/misc/e-send-options.c @@ -97,7 +97,7 @@ struct _ESendOptionsDialogPrivate { GtkWidget *accepted_label; GtkWidget *completed_label; GtkWidget *until_label; - char *help_section; + gchar *help_section; }; static void e_sendoptions_dialog_class_init (GObjectClass *object_class); @@ -345,7 +345,7 @@ delay_until_date_changed_cb (GtkWidget *dedit, gpointer data) } static void -page_changed_cb (GtkNotebook *notebook, GtkNotebookPage *page, int num, gpointer data) +page_changed_cb (GtkNotebook *notebook, GtkNotebookPage *page, gint num, gpointer data) { ESendOptionsDialog *sod = data; ESendOptionsDialogPrivate *priv = sod->priv; diff --git a/widgets/misc/e-spinner.c b/widgets/misc/e-spinner.c index 6e18410018..87e53dce8f 100644 --- a/widgets/misc/e-spinner.c +++ b/widgets/misc/e-spinner.c @@ -100,8 +100,8 @@ typedef struct { guint ref_count; GtkIconSize size; - int width; - int height; + gint width; + gint height; GdkPixbuf **animation_pixbufs; guint n_animation_pixbufs; } ESpinnerImages; @@ -208,9 +208,9 @@ e_spinner_cache_data_unload (ESpinnerCacheData *data) static GdkPixbuf * extract_frame (GdkPixbuf *grid_pixbuf, - int x, - int y, - int size) + gint x, + gint y, + gint size) { GdkPixbuf *pixbuf; @@ -230,11 +230,11 @@ extract_frame (GdkPixbuf *grid_pixbuf, static GdkPixbuf * scale_to_size (GdkPixbuf *pixbuf, - int dw, - int dh) + gint dw, + gint dh) { GdkPixbuf *result; - int pw, ph; + gint pw, ph; g_return_val_if_fail (pixbuf != NULL, NULL); @@ -259,8 +259,8 @@ e_spinner_images_load (GdkScreen *screen, ESpinnerImages *images; GdkPixbuf *icon_pixbuf, *pixbuf; GtkIconInfo *icon_info = NULL; - int grid_width, grid_height, x, y, requested_size, size, isw, ish, n; - const char *icon; + gint grid_width, grid_height, x, y, requested_size, size, isw, ish, n; + const gchar *icon; GSList *list = NULL, *l; LOG ("ESpinnerCacheData loading for screen %p at size %d", screen, icon_size); @@ -642,7 +642,7 @@ e_spinner_expose (GtkWidget *widget, ESpinnerImages *images; GdkPixbuf *pixbuf; GdkGC *gc; - int x_offset, y_offset, width, height; + gint x_offset, y_offset, width, height; GdkRectangle pix_area, dest; if (!GTK_WIDGET_DRAWABLE (spinner)) diff --git a/widgets/misc/e-url-entry.c b/widgets/misc/e-url-entry.c index 6c8eab7c8b..2dd47ebb8f 100644 --- a/widgets/misc/e-url-entry.c +++ b/widgets/misc/e-url-entry.c @@ -186,7 +186,7 @@ entry_changed_cb (GtkEditable *editable, gpointer data) { EUrlEntry *url_entry; EUrlEntryPrivate *priv; - const char *url; + const gchar *url; url_entry = E_URL_ENTRY (data); priv = url_entry->priv; diff --git a/widgets/misc/test-calendar.c b/widgets/misc/test-calendar.c index 20f34d8ba8..7b2d59056d 100644 --- a/widgets/misc/test-calendar.c +++ b/widgets/misc/test-calendar.c @@ -55,8 +55,8 @@ delete_event_cb (GtkWidget *widget, gtk_main_quit (); } -int -main (int argc, char **argv) +gint +main (gint argc, gchar **argv) { GtkWidget *window; GtkWidget *cal; diff --git a/widgets/misc/test-dateedit.c b/widgets/misc/test-dateedit.c index 7468053f31..745c982b8d 100644 --- a/widgets/misc/test-dateedit.c +++ b/widgets/misc/test-dateedit.c @@ -47,8 +47,8 @@ static void on_time_changed (EDateEdit *dedit, gchar *name); #endif -int -main (int argc, char **argv) +gint +main (gint argc, gchar **argv) { GtkWidget *window; EDateEdit *dedit; diff --git a/widgets/misc/test-preferences-window.c b/widgets/misc/test-preferences-window.c index c0f13f5845..4e4d9894fa 100644 --- a/widgets/misc/test-preferences-window.c +++ b/widgets/misc/test-preferences-window.c @@ -28,12 +28,12 @@ static void add_pages (EPreferencesWindow *preferences_window) { - int i; + gint i; for (i = 0; i < NUM_PAGES; i ++) { GtkWidget *widget; - char *caption; - char *page_name; + gchar *caption; + gchar *page_name; caption = g_strdup_printf ("Title of page %d", i); page_name = g_strdup_printf ("page-%d", i); @@ -53,15 +53,15 @@ add_pages (EPreferencesWindow *preferences_window) static int delete_event_callback (GtkWidget *widget, GdkEventAny *event, - void *data) + gpointer data) { gtk_main_quit (); return TRUE; } -int -main (int argc, char **argv) +gint +main (gint argc, gchar **argv) { GtkWidget *window; diff --git a/widgets/table/a11y/gal-a11y-e-cell-popup.c b/widgets/table/a11y/gal-a11y-e-cell-popup.c index 5ae3cef686..f76b2431b0 100644 --- a/widgets/table/a11y/gal-a11y-e-cell-popup.c +++ b/widgets/table/a11y/gal-a11y-e-cell-popup.c @@ -83,9 +83,9 @@ AtkObject * gal_a11y_e_cell_popup_new (ETableItem *item, ECellView *cell_view, AtkObject *parent, - int model_col, - int view_col, - int row) + gint model_col, + gint view_col, + gint row) { AtkObject *a11y; GalA11yECell *cell; diff --git a/widgets/table/a11y/gal-a11y-e-cell-popup.h b/widgets/table/a11y/gal-a11y-e-cell-popup.h index 52e0066d19..76ad0ffec9 100644 --- a/widgets/table/a11y/gal-a11y-e-cell-popup.h +++ b/widgets/table/a11y/gal-a11y-e-cell-popup.h @@ -55,8 +55,8 @@ GType gal_a11y_e_cell_popup_get_type (void); AtkObject *gal_a11y_e_cell_popup_new (ETableItem *item, ECellView *cell_view, AtkObject *parent, - int model_col, - int view_col, - int row); + gint model_col, + gint view_col, + gint row); #endif /* ! __GAL_A11Y_E_CELL_POPUP_H__ */ diff --git a/widgets/table/a11y/gal-a11y-e-cell-registry.c b/widgets/table/a11y/gal-a11y-e-cell-registry.c index 1da241fea9..9dc9598608 100644 --- a/widgets/table/a11y/gal-a11y-e-cell-registry.c +++ b/widgets/table/a11y/gal-a11y-e-cell-registry.c @@ -111,9 +111,9 @@ gal_a11y_e_cell_registry_get_object (GalA11yECellRegistry *registry, ETableItem *item, ECellView *cell_view, AtkObject *parent, - int model_col, - int view_col, - int row) + gint model_col, + gint view_col, + gint row) { GalA11yECellRegistryFunc func = NULL; GType type; diff --git a/widgets/table/a11y/gal-a11y-e-cell-registry.h b/widgets/table/a11y/gal-a11y-e-cell-registry.h index bc43a662cc..0620fd1b9c 100644 --- a/widgets/table/a11y/gal-a11y-e-cell-registry.h +++ b/widgets/table/a11y/gal-a11y-e-cell-registry.h @@ -41,9 +41,9 @@ typedef struct _GalA11yECellRegistryPrivate GalA11yECellRegistryPrivate; typedef AtkObject *(*GalA11yECellRegistryFunc) (ETableItem *item, ECellView *cell_view, AtkObject *parent, - int model_col, - int view_col, - int row); + gint model_col, + gint view_col, + gint row); struct _GalA11yECellRegistry { GObject object; @@ -62,9 +62,9 @@ AtkObject *gal_a11y_e_cell_registry_get_object (GalA11yECellRegistry *re ETableItem *item, ECellView *cell_view, AtkObject *parent, - int model_col, - int view_col, - int row); + gint model_col, + gint view_col, + gint row); void gal_a11y_e_cell_registry_add_cell_type (GalA11yECellRegistry *registry, GType type, GalA11yECellRegistryFunc func); diff --git a/widgets/table/a11y/gal-a11y-e-cell-text.c b/widgets/table/a11y/gal-a11y-e-cell-text.c index a2b9f715f8..77823b0a7c 100644 --- a/widgets/table/a11y/gal-a11y-e-cell-text.c +++ b/widgets/table/a11y/gal-a11y-e-cell-text.c @@ -86,11 +86,11 @@ ect_check (gpointer a11y) return TRUE; } -static G_CONST_RETURN gchar* +static G_CONST_RETURN gchar * ect_get_name (AtkObject * a11y) { GalA11yECell *gaec; - char *name; + gchar *name; if (!ect_check (a11y)) return NULL; @@ -180,7 +180,7 @@ ect_get_character_at_offset (AtkText *text, } -static gchar* +static gchar * ect_get_text_before_offset (AtkText *text, gint offset, AtkTextBoundary boundary_type, @@ -294,7 +294,7 @@ ect_get_n_selections (AtkText *text) } -static gchar* +static gchar * ect_get_selection (AtkText *text, gint selection_num, gint *start_offset, @@ -543,7 +543,7 @@ ect_do_action_edit (AtkAction *action) /* text signal handlers */ static void -ect_text_inserted_cb (ECellText *text, ECellView *cell_view, int pos, int len, int row, int model_col, gpointer data) +ect_text_inserted_cb (ECellText *text, ECellView *cell_view, gint pos, gint len, gint row, gint model_col, gpointer data) { GalA11yECellText *gaet; GalA11yECell *gaec; @@ -560,7 +560,7 @@ ect_text_inserted_cb (ECellText *text, ECellView *cell_view, int pos, int len, i } static void -ect_text_deleted_cb (ECellText *text, ECellView *cell_view, int pos, int len, int row, int model_col, gpointer data) +ect_text_deleted_cb (ECellText *text, ECellView *cell_view, gint pos, gint len, gint row, gint model_col, gpointer data) { GalA11yECellText *gaet; GalA11yECell *gaec; @@ -692,9 +692,9 @@ AtkObject * gal_a11y_e_cell_text_new (ETableItem *item, ECellView *cell_view, AtkObject *parent, - int model_col, - int view_col, - int row) + gint model_col, + gint view_col, + gint row) { AtkObject *a11y; GalA11yECell *gaec; diff --git a/widgets/table/a11y/gal-a11y-e-cell-text.h b/widgets/table/a11y/gal-a11y-e-cell-text.h index 32fce8771c..1a378a459c 100644 --- a/widgets/table/a11y/gal-a11y-e-cell-text.h +++ b/widgets/table/a11y/gal-a11y-e-cell-text.h @@ -57,8 +57,8 @@ GType gal_a11y_e_cell_text_get_type (void); AtkObject *gal_a11y_e_cell_text_new (ETableItem *item, ECellView *cell_view, AtkObject *parent, - int model_col, - int view_col, - int row); + gint model_col, + gint view_col, + gint row); #endif /* ! __GAL_A11Y_E_CELL_TEXT_H__ */ diff --git a/widgets/table/a11y/gal-a11y-e-cell-toggle.c b/widgets/table/a11y/gal-a11y-e-cell-toggle.c index c0425a0cbb..1101bac7ee 100644 --- a/widgets/table/a11y/gal-a11y-e-cell-toggle.c +++ b/widgets/table/a11y/gal-a11y-e-cell-toggle.c @@ -143,9 +143,9 @@ AtkObject* gal_a11y_e_cell_toggle_new (ETableItem *item, ECellView *cell_view, AtkObject *parent, - int model_col, - int view_col, - int row) + gint model_col, + gint view_col, + gint row) { AtkObject *a11y; GalA11yECell *cell; diff --git a/widgets/table/a11y/gal-a11y-e-cell-toggle.h b/widgets/table/a11y/gal-a11y-e-cell-toggle.h index 769e0b4200..1f41ae1623 100644 --- a/widgets/table/a11y/gal-a11y-e-cell-toggle.h +++ b/widgets/table/a11y/gal-a11y-e-cell-toggle.h @@ -56,9 +56,9 @@ struct _GalA11yECellToggleClass AtkObject *gal_a11y_e_cell_toggle_new (ETableItem *item, ECellView *cell_view, AtkObject *parent, - int model_col, - int view_col, - int row); + gint model_col, + gint view_col, + gint row); #ifdef __cplusplus } diff --git a/widgets/table/a11y/gal-a11y-e-cell-tree.c b/widgets/table/a11y/gal-a11y-e-cell-tree.c index 0a5f8e2019..aaf490c726 100644 --- a/widgets/table/a11y/gal-a11y-e-cell-tree.c +++ b/widgets/table/a11y/gal-a11y-e-cell-tree.c @@ -184,9 +184,9 @@ AtkObject * gal_a11y_e_cell_tree_new (ETableItem *item, ECellView *cell_view, AtkObject *parent, - int model_col, - int view_col, - int row) + gint model_col, + gint view_col, + gint row) { AtkObject *subcell_a11y; GalA11yECellTree *a11y; diff --git a/widgets/table/a11y/gal-a11y-e-cell-tree.h b/widgets/table/a11y/gal-a11y-e-cell-tree.h index 43169c2f28..497590b351 100644 --- a/widgets/table/a11y/gal-a11y-e-cell-tree.h +++ b/widgets/table/a11y/gal-a11y-e-cell-tree.h @@ -44,7 +44,7 @@ typedef struct _GalA11yECellTreePrivate GalA11yECellTreePrivate; struct _GalA11yECellTree { GalA11yECell object; - int model_row_changed_id; + gint model_row_changed_id; }; struct _GalA11yECellTreeClass { @@ -57,8 +57,8 @@ GType gal_a11y_e_cell_tree_get_type (void); AtkObject *gal_a11y_e_cell_tree_new (ETableItem *item, ECellView *cell_view, AtkObject *parent, - int model_col, - int view_col, - int row); + gint model_col, + gint view_col, + gint row); #endif /* ! __GAL_A11Y_E_CELL_TREE_H__ */ diff --git a/widgets/table/a11y/gal-a11y-e-cell-vbox.c b/widgets/table/a11y/gal-a11y-e-cell-vbox.c index 7a5eadba52..b3f92a695a 100644 --- a/widgets/table/a11y/gal-a11y-e-cell-vbox.c +++ b/widgets/table/a11y/gal-a11y-e-cell-vbox.c @@ -120,7 +120,7 @@ ecv_ref_accessible_at_point (AtkComponent *component, AtkCoordType coord_type) { gint x0, y0, width, height; - int subcell_height, i; + gint subcell_height, i; GalA11yECell *gaec = GAL_A11Y_E_CELL (component); ECellVboxView *ecvv = (ECellVboxView *) (gaec->cell_view); @@ -203,9 +203,9 @@ gal_a11y_e_cell_vbox_get_type (void) AtkObject *gal_a11y_e_cell_vbox_new (ETableItem *item, ECellView *cell_view, AtkObject *parent, - int model_col, - int view_col, - int row) + gint model_col, + gint view_col, + gint row) { AtkObject *a11y; GalA11yECell *gaec; diff --git a/widgets/table/a11y/gal-a11y-e-cell-vbox.h b/widgets/table/a11y/gal-a11y-e-cell-vbox.h index 2055ac3195..cf6375a2be 100644 --- a/widgets/table/a11y/gal-a11y-e-cell-vbox.h +++ b/widgets/table/a11y/gal-a11y-e-cell-vbox.h @@ -44,7 +44,7 @@ typedef struct _GalA11yECellVboxClass GalA11yECellVboxClass; struct _GalA11yECellVbox { GalA11yECell object; - int a11y_subcell_count; + gint a11y_subcell_count; gpointer *a11y_subcells; }; @@ -57,9 +57,9 @@ GType gal_a11y_e_cell_vbox_get_type (void); AtkObject *gal_a11y_e_cell_vbox_new (ETableItem *item, ECellView *cell_view, AtkObject *parent, - int model_col, - int view_col, - int row); + gint model_col, + gint view_col, + gint row); #ifdef __cplusplus } diff --git a/widgets/table/a11y/gal-a11y-e-cell.c b/widgets/table/a11y/gal-a11y-e-cell.c index 3b74675ae5..a316500af7 100644 --- a/widgets/table/a11y/gal-a11y-e-cell.c +++ b/widgets/table/a11y/gal-a11y-e-cell.c @@ -103,7 +103,7 @@ gal_a11y_e_cell_dispose (GObject *object) } /* Static functions */ -static G_CONST_RETURN gchar* +static G_CONST_RETURN gchar * gal_a11y_e_cell_get_name (AtkObject * a11y) { GalA11yECell *cell = GAL_A11Y_E_CELL (a11y); @@ -163,10 +163,10 @@ gal_a11y_e_cell_get_extents (AtkComponent *component, { GalA11yECell *a11y = GAL_A11Y_E_CELL (component); GtkWidget *tableOrTree; - int row; - int col; - int xval; - int yval; + gint row; + gint col; + gint xval; + gint yval; row = a11y->row; col = a11y->view_col; @@ -593,9 +593,9 @@ AtkObject * gal_a11y_e_cell_new (ETableItem *item, ECellView *cell_view, AtkObject *parent, - int model_col, - int view_col, - int row) + gint model_col, + gint view_col, + gint row) { AtkObject *a11y; @@ -616,9 +616,9 @@ gal_a11y_e_cell_construct (AtkObject *object, ETableItem *item, ECellView *cell_view, AtkObject *parent, - int model_col, - int view_col, - int row) + gint model_col, + gint view_col, + gint row) { GalA11yECell *a11y = GAL_A11Y_E_CELL (object); a11y->item = item; diff --git a/widgets/table/a11y/gal-a11y-e-cell.h b/widgets/table/a11y/gal-a11y-e-cell.h index af96c69d47..3ec3070a9b 100644 --- a/widgets/table/a11y/gal-a11y-e-cell.h +++ b/widgets/table/a11y/gal-a11y-e-cell.h @@ -49,9 +49,9 @@ struct _GalA11yECell { ETableItem *item; ECellView *cell_view; AtkObject *parent; - int model_col; - int view_col; - int row; + gint model_col; + gint view_col; + gint row; AtkStateSet *state_set; GList *action_list; gint action_idle_handler; @@ -76,16 +76,16 @@ GType gal_a11y_e_cell_get_type (void); AtkObject *gal_a11y_e_cell_new (ETableItem *item, ECellView *cell_view, AtkObject *parent, - int model_col, - int view_col, - int row); + gint model_col, + gint view_col, + gint row); void gal_a11y_e_cell_construct (AtkObject *object, ETableItem *item, ECellView *cell_view, AtkObject *parent, - int model_col, - int view_col, - int row); + gint model_col, + gint view_col, + gint row); void gal_a11y_e_cell_type_add_action_interface (GType type); diff --git a/widgets/table/a11y/gal-a11y-e-table-click-to-add.c b/widgets/table/a11y/gal-a11y-e-table-click-to-add.c index ed417e1601..e36fe51a00 100644 --- a/widgets/table/a11y/gal-a11y-e-table-click-to-add.c +++ b/widgets/table/a11y/gal-a11y-e-table-click-to-add.c @@ -36,7 +36,7 @@ static AtkObjectClass *parent_class; static GType parent_type; static gint priv_offset; -#define GET_PRIVATE(object) ((GalA11yETableClickToAddPrivate *) (((char *) object) + priv_offset)) +#define GET_PRIVATE(object) ((GalA11yETableClickToAddPrivate *) (((gchar *) object) + priv_offset)) #define PARENT_TYPE (parent_type) struct _GalA11yETableClickToAddPrivate { @@ -51,7 +51,7 @@ etcta_get_n_actions (AtkAction *action) return 1; } -static G_CONST_RETURN gchar* +static G_CONST_RETURN gchar * etcta_get_description (AtkAction *action, gint i) { @@ -61,7 +61,7 @@ etcta_get_description (AtkAction *action, return NULL; } -static G_CONST_RETURN gchar* +static G_CONST_RETURN gchar * etcta_action_get_name (AtkAction *action, gint i) { if (i == 0) diff --git a/widgets/table/a11y/gal-a11y-e-table-column-header.c b/widgets/table/a11y/gal-a11y-e-table-column-header.c index 4df75cc564..41e6ab0fca 100644 --- a/widgets/table/a11y/gal-a11y-e-table-column-header.c +++ b/widgets/table/a11y/gal-a11y-e-table-column-header.c @@ -32,7 +32,7 @@ static GObjectClass *parent_class; static gint priv_offset; -#define GET_PRIVATE(object) ((GalA11yETableColumnHeaderPrivate *) (((char *) object) + priv_offset)) +#define GET_PRIVATE(object) ((GalA11yETableColumnHeaderPrivate *) (((gchar *) object) + priv_offset)) #define PARENT_TYPE (atk_gobject_accessible_get_type ()) struct _GalA11yETableColumnHeaderPrivate { @@ -141,7 +141,7 @@ gal_a11y_e_table_column_header_get_n_actions (AtkAction *action) return 1; } -static G_CONST_RETURN gchar* +static G_CONST_RETURN gchar * gal_a11y_e_table_column_header_action_get_name (AtkAction *action, gint i) { diff --git a/widgets/table/a11y/gal-a11y-e-table-item.c b/widgets/table/a11y/gal-a11y-e-table-item.c index 935f53b83b..912d055964 100644 --- a/widgets/table/a11y/gal-a11y-e-table-item.c +++ b/widgets/table/a11y/gal-a11y-e-table-item.c @@ -48,14 +48,14 @@ static AtkComponentIface *component_parent_iface; static GType parent_type; static gint priv_offset; static GQuark quark_accessible_object = 0; -#define GET_PRIVATE(object) ((GalA11yETableItemPrivate *) (((char *) object) + priv_offset)) +#define GET_PRIVATE(object) ((GalA11yETableItemPrivate *) (((gchar *) object) + priv_offset)) #define PARENT_TYPE (parent_type) struct _GalA11yETableItemPrivate { gint cols; gint rows; - int selection_change_id; - int cursor_change_id; + gint selection_change_id; + gint cursor_change_id; ETableCol ** columns; ESelectionModel *selection; AtkStateSet *state_set; @@ -93,7 +93,7 @@ eti_ref_state_set (AtkObject *accessible) } inline static gint -view_to_model_row(ETableItem *eti, int row) +view_to_model_row(ETableItem *eti, gint row) { if (eti->uses_source_model) { ETableSubset *etss = E_TABLE_SUBSET(eti->table_model); @@ -107,16 +107,16 @@ view_to_model_row(ETableItem *eti, int row) } inline static gint -view_to_model_col(ETableItem *eti, int col) +view_to_model_col(ETableItem *eti, gint col) { ETableCol *ecol = e_table_header_get_column (eti->header, col); return ecol ? ecol->col_idx : -1; } inline static gint -model_to_view_row(ETableItem *eti, int row) +model_to_view_row(ETableItem *eti, gint row) { - int i; + gint i; if (row == -1) return -1; if (eti->uses_source_model) { @@ -136,9 +136,9 @@ model_to_view_row(ETableItem *eti, int row) } inline static gint -model_to_view_col(ETableItem *eti, int col) +model_to_view_col(ETableItem *eti, gint col) { - int i; + gint i; if (col == -1) return -1; for (i = 0; i < eti->cols; i++) { @@ -159,7 +159,7 @@ static void eti_a11y_reset_focus_object (GalA11yETableItem *a11y, ETableItem *item, gboolean notify) { ESelectionModel * esm; - int cursor_row, cursor_col, view_row, view_col; + gint cursor_row, cursor_col, view_row, view_col; AtkObject *cell, *old_cell; esm = item->selection; @@ -284,9 +284,9 @@ eti_ref_accessible_at_point (AtkComponent *component, gint y, AtkCoordType coord_type) { - int row = -1; - int col = -1; - int x_origin, y_origin; + gint row = -1; + gint col = -1; + gint x_origin, y_origin; ETableItem *item; GtkWidget *tableOrTree; @@ -446,7 +446,7 @@ eti_get_column_extent_at (AtkTable *table, gint column) { ETableItem *item; - int width; + gint width; item = E_TABLE_ITEM (eti_a11y_get_gobject (ATK_OBJECT (table))); if (!item) @@ -469,7 +469,7 @@ eti_get_row_extent_at (AtkTable *table, gint column) { ETableItem *item; - int height; + gint height; item = E_TABLE_ITEM (eti_a11y_get_gobject (ATK_OBJECT (table))); if (!item) @@ -676,7 +676,7 @@ eti_atk_component_iface_init (AtkComponentIface *iface) } static void -eti_rows_inserted (ETableModel * model, int row, int count, +eti_rows_inserted (ETableModel * model, gint row, gint count, AtkObject * table_item) { gint n_cols,n_rows,i,j; @@ -711,7 +711,7 @@ eti_rows_inserted (ETableModel * model, int row, int count, } static void -eti_rows_deleted (ETableModel * model, int row, int count, +eti_rows_deleted (ETableModel * model, gint row, gint count, AtkObject * table_item) { gint i,j, n_rows, n_cols, old_nrows; @@ -949,7 +949,7 @@ static void eti_a11y_selection_model_added_cb (ETableItem *eti, static void eti_a11y_selection_changed_cb (ESelectionModel *selection, GalA11yETableItem *a11y); static void eti_a11y_cursor_changed_cb (ESelectionModel *selection, - int row, int col, + gint row, gint col, GalA11yETableItem *a11y); /** @@ -1021,7 +1021,7 @@ gal_a11y_e_table_item_new (ETableItem *item) AtkObject *accessible; ESelectionModel * esm; AtkObject *parent; - const char *name; + const gchar *name; g_return_val_if_fail (item && item->cols >= 0 && item->rows >= 0, NULL); a11y = g_object_new (gal_a11y_e_table_item_get_type (), NULL); @@ -1188,7 +1188,7 @@ eti_a11y_selection_changed_cb (ESelectionModel *selection, GalA11yETableItem *a1 static void eti_a11y_cursor_changed_cb (ESelectionModel *selection, - int row, int col, GalA11yETableItem *a11y) + gint row, gint col, GalA11yETableItem *a11y) { ETableItem *item; GalA11yETableItemPrivate *priv = GET_PRIVATE (a11y); diff --git a/widgets/table/a11y/gal-a11y-e-table.c b/widgets/table/a11y/gal-a11y-e-table.c index 1966fb29ee..bf75227af4 100644 --- a/widgets/table/a11y/gal-a11y-e-table.c +++ b/widgets/table/a11y/gal-a11y-e-table.c @@ -37,7 +37,7 @@ static AtkObjectClass *parent_class; static GType parent_type; static gint priv_offset; -#define GET_PRIVATE(object) ((GalA11yETablePrivate *) (((char *) object) + priv_offset)) +#define GET_PRIVATE(object) ((GalA11yETablePrivate *) (((gchar *) object) + priv_offset)) #define PARENT_TYPE (parent_type) struct _GalA11yETablePrivate { @@ -125,7 +125,7 @@ et_get_n_children (AtkObject *accessible) { GalA11yETable *a11y = GAL_A11Y_E_TABLE (accessible); ETable * et; - int n = 0; + gint n = 0; et = E_TABLE(GTK_ACCESSIBLE (a11y)->widget); diff --git a/widgets/table/a11y/gal-a11y-e-tree.c b/widgets/table/a11y/gal-a11y-e-tree.c index 4ecce81501..879b517aab 100644 --- a/widgets/table/a11y/gal-a11y-e-tree.c +++ b/widgets/table/a11y/gal-a11y-e-tree.c @@ -34,7 +34,7 @@ static AtkObjectClass *parent_class; static GType parent_type; static gint priv_offset; -#define GET_PRIVATE(object) ((GalA11yETreePrivate *) (((char *) object) + priv_offset)) +#define GET_PRIVATE(object) ((GalA11yETreePrivate *) (((gchar *) object) + priv_offset)) #define PARENT_TYPE (parent_type) struct _GalA11yETreePrivate { diff --git a/widgets/table/e-cell-checkbox.c b/widgets/table/e-cell-checkbox.c index 09e2187b82..583793e85f 100644 --- a/widgets/table/e-cell-checkbox.c +++ b/widgets/table/e-cell-checkbox.c @@ -41,11 +41,11 @@ static GdkPixbuf *checks [2]; static void ecc_print (ECellView *ecell_view, GtkPrintContext *context, - int model_col, int view_col, int row, + gint model_col, gint view_col, gint row, double width, double height) { cairo_t *cr = gtk_print_context_get_cairo_context (context); - const int value = GPOINTER_TO_INT ( + const gint value = GPOINTER_TO_INT ( e_table_model_value_at (ecell_view->e_table_model, model_col, row)); cairo_save (cr); diff --git a/widgets/table/e-cell-combo.c b/widgets/table/e-cell-combo.c index 688bb1a508..e171080610 100644 --- a/widgets/table/e-cell-combo.c +++ b/widgets/table/e-cell-combo.c @@ -78,15 +78,15 @@ static void e_cell_combo_dispose (GObject *object); static gint e_cell_combo_do_popup (ECellPopup *ecp, GdkEvent *event, - int row, - int view_col); + gint row, + gint view_col); static void e_cell_combo_select_matching_item (ECellCombo *ecc); static void e_cell_combo_show_popup (ECellCombo *ecc, - int row, - int view_col); + gint row, + gint view_col); static void e_cell_combo_get_popup_pos (ECellCombo *ecc, - int row, - int view_col, + gint row, + gint view_col, gint *x, gint *y, gint *height, @@ -100,7 +100,7 @@ static gint e_cell_combo_button_press (GtkWidget *popup_window, static gint e_cell_combo_button_release (GtkWidget *popup_window, GdkEventButton *event, ECellCombo *ecc); -static int e_cell_combo_key_press (GtkWidget *popup_window, +static gint e_cell_combo_key_press (GtkWidget *popup_window, GdkEventKey *event, ECellCombo *ecc); @@ -240,7 +240,7 @@ e_cell_combo_set_popdown_strings (ECellCombo *ecc, for (elem = strings; elem; elem = elem->next) { GtkTreeIter iter; - char *utf8_text = elem->data; + gchar *utf8_text = elem->data; gtk_list_store_append (store, &iter); gtk_list_store_set (store, &iter, 0, utf8_text, -1); @@ -251,8 +251,8 @@ e_cell_combo_set_popdown_strings (ECellCombo *ecc, static gint e_cell_combo_do_popup (ECellPopup *ecp, GdkEvent *event, - int row, - int view_col) + gint row, + gint view_col) { ECellCombo *ecc = E_CELL_COMBO (ecp); guint32 time; @@ -297,7 +297,7 @@ e_cell_combo_select_matching_item (ECellCombo *ecc) ETableItem *eti = E_TABLE_ITEM (ecp->popup_cell_view->cell_view.e_table_item_view); ETableCol *ecol; gboolean found = FALSE; - char *cell_text; + gchar *cell_text; gboolean valid; GtkTreeSelection *selection; GtkTreeIter iter; @@ -313,7 +313,7 @@ e_cell_combo_select_matching_item (ECellCombo *ecc) for (valid = gtk_tree_model_get_iter_first (model, &iter); valid && !found; valid = gtk_tree_model_iter_next (model, &iter)) { - char *str = NULL; + gchar *str = NULL; gtk_tree_model_get (model, &iter, 0, &str, -1); @@ -336,7 +336,7 @@ e_cell_combo_select_matching_item (ECellCombo *ecc) } static void -e_cell_combo_show_popup (ECellCombo *ecc, int row, int view_col) +e_cell_combo_show_popup (ECellCombo *ecc, gint row, gint view_col) { gint x, y, width, height, old_width, old_height; @@ -366,8 +366,8 @@ e_cell_combo_show_popup (ECellCombo *ecc, int row, int view_col) /* Calculates the size and position of the popup window (like GtkCombo). */ static void e_cell_combo_get_popup_pos (ECellCombo *ecc, - int row, - int view_col, + gint row, + gint view_col, gint *x, gint *y, gint *height, diff --git a/widgets/table/e-cell-date-edit.c b/widgets/table/e-cell-date-edit.c index 2bee6f54a8..c488a4a7bb 100644 --- a/widgets/table/e-cell-date-edit.c +++ b/widgets/table/e-cell-date-edit.c @@ -61,17 +61,17 @@ static void e_cell_date_edit_set_property (GObject *object, static gint e_cell_date_edit_do_popup (ECellPopup *ecp, GdkEvent *event, - int row, - int view_col); + gint row, + gint view_col); static void e_cell_date_edit_set_popup_values (ECellDateEdit *ecde); static void e_cell_date_edit_select_matching_time(ECellDateEdit *ecde, char *time); static void e_cell_date_edit_show_popup (ECellDateEdit *ecde, - int row, - int view_col); + gint row, + gint view_col); static void e_cell_date_edit_get_popup_pos (ECellDateEdit *ecde, - int row, - int view_col, + gint row, + gint view_col, gint *x, gint *y, gint *height, @@ -79,10 +79,10 @@ static void e_cell_date_edit_get_popup_pos (ECellDateEdit *ecde, static void e_cell_date_edit_rebuild_time_list (ECellDateEdit *ecde); -static int e_cell_date_edit_key_press (GtkWidget *popup_window, +static gint e_cell_date_edit_key_press (GtkWidget *popup_window, GdkEventKey *event, ECellDateEdit *ecde); -static int e_cell_date_edit_button_press (GtkWidget *popup_window, +static gint e_cell_date_edit_button_press (GtkWidget *popup_window, GdkEventButton *event, ECellDateEdit *ecde); static void e_cell_date_edit_on_ok_clicked (GtkWidget *button, @@ -485,8 +485,8 @@ e_cell_date_edit_set_property (GObject *object, static gint e_cell_date_edit_do_popup (ECellPopup *ecp, GdkEvent *event, - int row, - int view_col) + gint row, + gint view_col) { ECellDateEdit *ecde = E_CELL_DATE_EDIT (ecp); @@ -511,12 +511,12 @@ e_cell_date_edit_set_popup_values (ECellDateEdit *ecde) ECellView *ecv = (ECellView*) ecp->popup_cell_view; ETableItem *eti = E_TABLE_ITEM (ecp->popup_cell_view->cell_view.e_table_item_view); ETableCol *ecol; - char *cell_text; + gchar *cell_text; ETimeParseStatus status; struct tm date_tm; GDate date; ECalendarItem *calitem; - char buffer[64]; + gchar buffer[64]; gboolean is_date = TRUE; ecol = e_table_header_get_column (eti->header, ecp->popup_view_col); @@ -579,7 +579,7 @@ e_cell_date_edit_select_matching_time (ECellDateEdit *ecde, for (valid = gtk_tree_model_get_iter_first (model, &iter); valid && !found; valid = gtk_tree_model_iter_next (model, &iter)) { - char *str = NULL; + gchar *str = NULL; gtk_tree_model_get (model, &iter, 0, &str, -1); @@ -605,8 +605,8 @@ e_cell_date_edit_select_matching_time (ECellDateEdit *ecde, static void e_cell_date_edit_show_popup (ECellDateEdit *ecde, - int row, - int view_col) + gint row, + gint view_col) { gint x, y, width, height; @@ -630,8 +630,8 @@ e_cell_date_edit_show_popup (ECellDateEdit *ecde, /* Calculates the size and position of the popup window (like GtkCombo). */ static void e_cell_date_edit_get_popup_pos (ECellDateEdit *ecde, - int row, - int view_col, + gint row, + gint view_col, gint *x, gint *y, gint *height, @@ -753,7 +753,7 @@ static void e_cell_date_edit_rebuild_time_list (ECellDateEdit *ecde) { GtkListStore *store; - char buffer[40]; + gchar buffer[40]; struct tm tmp_tm; gint hour, min; @@ -801,8 +801,8 @@ e_cell_date_edit_on_ok_clicked (GtkWidget *button, GDate start_date, end_date; gboolean day_selected; struct tm date_tm; - char buffer[64]; - const char *text; + gchar buffer[64]; + const gchar *text; ETimeParseStatus status; gboolean is_date = FALSE; @@ -843,7 +843,7 @@ e_cell_date_edit_show_time_invalid_warning (ECellDateEdit *ecde) { GtkWidget *dialog; struct tm date_tm; - char buffer[64]; + gchar buffer[64]; /* Create a useful error message showing the correct format. */ date_tm.tm_year = 100; @@ -875,7 +875,7 @@ e_cell_date_edit_on_now_clicked (GtkWidget *button, { struct tm tmp_tm; time_t t; - char buffer[64]; + gchar buffer[64]; if (ecde->time_callback) { tmp_tm = (*ecde->time_callback) (ecde, ecde->time_callback_data); @@ -908,7 +908,7 @@ e_cell_date_edit_on_today_clicked (GtkWidget *button, { struct tm tmp_tm; time_t t; - char buffer[64]; + gchar buffer[64]; if (ecde->time_callback) { tmp_tm = (*ecde->time_callback) (ecde, ecde->time_callback_data); diff --git a/widgets/table/e-cell-date.c b/widgets/table/e-cell-date.c index 53bceb557d..d9dcbbea3b 100644 --- a/widgets/table/e-cell-date.c +++ b/widgets/table/e-cell-date.c @@ -40,15 +40,15 @@ G_DEFINE_TYPE (ECellDate, e_cell_date, E_CELL_TEXT_TYPE) #define localtime_r(timep, result) (localtime (timep) ? memcpy ((result), localtime (timep), sizeof (*(result))) : 0) #endif -static char * -ecd_get_text(ECellText *cell, ETableModel *model, int col, int row) +static gchar * +ecd_get_text(ECellText *cell, ETableModel *model, gint col, gint row) { time_t date = GPOINTER_TO_INT (e_table_model_value_at(model, col, row)); time_t nowdate = time(NULL); time_t yesdate; struct tm then, now, yesterday; - char buf[100]; - char *temp; + gchar buf[100]; + gchar *temp; gboolean done = FALSE; if (date == 0) { @@ -83,7 +83,7 @@ ecd_get_text(ECellText *cell, ETableModel *model, int col, int row) } } if (!done) { - int i; + gint i; for (i = 2; i < 7; i++) { yesdate = nowdate - 60 * 60 * 24 * i; localtime_r (&yesdate, &yesterday); @@ -111,7 +111,7 @@ ecd_get_text(ECellText *cell, ETableModel *model, int col, int row) } static void -ecd_free_text(ECellText *cell, char *text) +ecd_free_text(ECellText *cell, gchar *text) { g_free(text); } @@ -156,7 +156,7 @@ e_cell_date_init (ECellDate *ecd) * Returns: an ECell object that can be used to render dates. */ ECell * -e_cell_date_new (const char *fontname, GtkJustification justify) +e_cell_date_new (const gchar *fontname, GtkJustification justify) { ECellDate *ecd = g_object_new (E_CELL_DATE_TYPE, NULL); diff --git a/widgets/table/e-cell-date.h b/widgets/table/e-cell-date.h index fece501726..968e387198 100644 --- a/widgets/table/e-cell-date.h +++ b/widgets/table/e-cell-date.h @@ -43,7 +43,7 @@ typedef struct { } ECellDateClass; GType e_cell_date_get_type (void); -ECell *e_cell_date_new (const char *fontname, GtkJustification justify); +ECell *e_cell_date_new (const gchar *fontname, GtkJustification justify); G_END_DECLS diff --git a/widgets/table/e-cell-hbox.c b/widgets/table/e-cell-hbox.c index 963e446738..2cb36b6f52 100644 --- a/widgets/table/e-cell-hbox.c +++ b/widgets/table/e-cell-hbox.c @@ -48,11 +48,11 @@ G_DEFINE_TYPE (ECellHbox, e_cell_hbox, E_CELL_TYPE) * ECell::new_view method */ static ECellView * -ecv_new_view (ECell *ecell, ETableModel *table_model, void *e_table_item_view) +ecv_new_view (ECell *ecell, ETableModel *table_model, gpointer e_table_item_view) { ECellHbox *ecv = E_CELL_HBOX (ecell); ECellHboxView *hbox_view = g_new0 (ECellHboxView, 1); - int i; + gint i; hbox_view->cell_view.ecell = ecell; hbox_view->cell_view.e_table_model = table_model; @@ -82,7 +82,7 @@ static void ecv_kill_view (ECellView *ecv) { ECellHboxView *hbox_view = (ECellHboxView *) ecv; - int i; + gint i; if (hbox_view->cell_view.kill_view_cb) (hbox_view->cell_view.kill_view_cb)(ecv, hbox_view->cell_view.kill_view_cb_data); @@ -107,7 +107,7 @@ static void ecv_realize (ECellView *ecell_view) { ECellHboxView *hbox_view = (ECellHboxView *) ecell_view; - int i; + gint i; /* realize our subcell view */ for (i = 0; i < hbox_view->subcell_view_count; i++) @@ -124,7 +124,7 @@ static void ecv_unrealize (ECellView *ecv) { ECellHboxView *hbox_view = (ECellHboxView *) ecv; - int i; + gint i; /* unrealize our subcell view. */ for (i = 0; i < hbox_view->subcell_view_count; i++) @@ -139,19 +139,19 @@ ecv_unrealize (ECellView *ecv) */ static void ecv_draw (ECellView *ecell_view, GdkDrawable *drawable, - int model_col, int view_col, int row, ECellFlags flags, - int x1, int y1, int x2, int y2) + gint model_col, gint view_col, gint row, ECellFlags flags, + gint x1, gint y1, gint x2, gint y2) { ECellHboxView *hbox_view = (ECellHboxView *)ecell_view; - int subcell_offset = 0; - int i; - int allotted_width = x2-x1; + gint subcell_offset = 0; + gint i; + gint allotted_width = x2-x1; for (i = 0; i < hbox_view->subcell_view_count; i++) { /* Now cause our subcells to draw their contents, shifted by subcell_offset pixels */ - int width = allotted_width * hbox_view->def_size_cols[i] / 100; + gint width = allotted_width * hbox_view->def_size_cols[i] / 100; /* e_cell_max_width_by_row (hbox_view->subcell_views[i], hbox_view->model_cols[i], view_col, row); if (width < hbox_view->def_size_cols[i]) width = hbox_view->def_size_cols[i]; @@ -168,12 +168,12 @@ ecv_draw (ECellView *ecell_view, GdkDrawable *drawable, * ECell::event method */ static gint -ecv_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, int row, ECellFlags flags, ECellActions *actions) +ecv_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col, gint row, ECellFlags flags, ECellActions *actions) { ECellHboxView *hbox_view = (ECellHboxView *)ecell_view; - int y = 0; - int i; - int subcell_offset = 0; + gint y = 0; + gint i; + gint subcell_offset = 0; switch (event->type) { case GDK_BUTTON_PRESS: @@ -191,7 +191,7 @@ ecv_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, } for (i = 0; i < hbox_view->subcell_view_count; i++) { - int width = e_cell_max_width_by_row (hbox_view->subcell_views[i], hbox_view->model_cols[i], view_col, row); + gint width = e_cell_max_width_by_row (hbox_view->subcell_views[i], hbox_view->model_cols[i], view_col, row); if (width < hbox_view->def_size_cols[i]) width = hbox_view->def_size_cols[i]; if (y < subcell_offset + width) @@ -205,11 +205,11 @@ ecv_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, * ECell::height method */ static int -ecv_height (ECellView *ecell_view, int model_col, int view_col, int row) +ecv_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) { ECellHboxView *hbox_view = (ECellHboxView *)ecell_view; - int height = 0, max_height = 0; - int i; + gint height = 0, max_height = 0; + gint i; for (i = 0; i < hbox_view->subcell_view_count; i++) { height = e_cell_height (hbox_view->subcell_views[i], hbox_view->model_cols[i], view_col, row); @@ -222,14 +222,14 @@ ecv_height (ECellView *ecell_view, int model_col, int view_col, int row) * ECell::max_width method */ static int -ecv_max_width (ECellView *ecell_view, int model_col, int view_col) +ecv_max_width (ECellView *ecell_view, gint model_col, gint view_col) { ECellHboxView *hbox_view = (ECellHboxView *)ecell_view; - int width = 0; - int i; + gint width = 0; + gint i; for (i = 0; i < hbox_view->subcell_view_count; i++) { - int cell_width = e_cell_max_width (hbox_view->subcell_views[i], hbox_view->model_cols[i], view_col); + gint cell_width = e_cell_max_width (hbox_view->subcell_views[i], hbox_view->model_cols[i], view_col); if (cell_width < hbox_view->def_size_cols[i]) cell_width = hbox_view->def_size_cols[i]; @@ -246,7 +246,7 @@ static void ecv_dispose (GObject *object) { ECellHbox *ecv = E_CELL_HBOX (object); - int i; + gint i; /* destroy our subcell */ for (i = 0; i < ecv->subcell_count; i++) @@ -305,7 +305,7 @@ e_cell_hbox_new (void) } void -e_cell_hbox_append (ECellHbox *hbox, ECell *subcell, int model_col, int size) +e_cell_hbox_append (ECellHbox *hbox, ECell *subcell, gint model_col, gint size) { hbox->subcell_count ++; diff --git a/widgets/table/e-cell-hbox.h b/widgets/table/e-cell-hbox.h index dc726960fa..366d01fffe 100644 --- a/widgets/table/e-cell-hbox.h +++ b/widgets/table/e-cell-hbox.h @@ -38,18 +38,18 @@ G_BEGIN_DECLS typedef struct { ECell parent; - int subcell_count; + gint subcell_count; ECell **subcells; - int *model_cols; - int *def_size_cols; + gint *model_cols; + gint *def_size_cols; } ECellHbox; typedef struct { ECellView cell_view; - int subcell_view_count; + gint subcell_view_count; ECellView **subcell_views; - int *model_cols; - int *def_size_cols; + gint *model_cols; + gint *def_size_cols; } ECellHboxView; typedef struct { @@ -60,8 +60,8 @@ GType e_cell_hbox_get_type (void); ECell *e_cell_hbox_new (void); void e_cell_hbox_append (ECellHbox *vbox, ECell *subcell, - int model_col, - int size); + gint model_col, + gint size); G_END_DECLS diff --git a/widgets/table/e-cell-number.c b/widgets/table/e-cell-number.c index 56754a05e5..63f55eb1c4 100644 --- a/widgets/table/e-cell-number.c +++ b/widgets/table/e-cell-number.c @@ -32,14 +32,14 @@ G_DEFINE_TYPE (ECellNumber, e_cell_number, E_CELL_TEXT_TYPE) -static char * -ecn_get_text(ECellText *cell, ETableModel *model, int col, int row) +static gchar * +ecn_get_text(ECellText *cell, ETableModel *model, gint col, gint row) { return e_format_number(GPOINTER_TO_INT (e_table_model_value_at(model, col, row))); } static void -ecn_free_text(ECellText *cell, char *text) +ecn_free_text(ECellText *cell, gchar *text) { g_free(text); } @@ -72,7 +72,7 @@ e_cell_number_init (ECellNumber *cell_number) * Returns: an ECell object that can be used to render numbers. */ ECell * -e_cell_number_new (const char *fontname, GtkJustification justify) +e_cell_number_new (const gchar *fontname, GtkJustification justify) { ECellNumber *ecn = g_object_new (E_CELL_NUMBER_TYPE, NULL); diff --git a/widgets/table/e-cell-number.h b/widgets/table/e-cell-number.h index 75471f7a2c..fcba9f517a 100644 --- a/widgets/table/e-cell-number.h +++ b/widgets/table/e-cell-number.h @@ -43,7 +43,7 @@ typedef struct { } ECellNumberClass; GType e_cell_number_get_type (void); -ECell *e_cell_number_new (const char *fontname, GtkJustification justify); +ECell *e_cell_number_new (const gchar *fontname, GtkJustification justify); G_END_DECLS diff --git a/widgets/table/e-cell-percent.c b/widgets/table/e-cell-percent.c index 194a7bd6b6..378bb8ab55 100644 --- a/widgets/table/e-cell-percent.c +++ b/widgets/table/e-cell-percent.c @@ -41,11 +41,11 @@ G_DEFINE_TYPE (ECellPercent, e_cell_percent, E_CELL_TEXT_TYPE) -static char * -ecp_get_text (ECellText *cell, ETableModel *model, int col, int row) +static gchar * +ecp_get_text (ECellText *cell, ETableModel *model, gint col, gint row) { - int percent; - static char buffer[8]; + gint percent; + static gchar buffer[8]; percent = GPOINTER_TO_INT (e_table_model_value_at (model, col, row)); @@ -60,7 +60,7 @@ ecp_get_text (ECellText *cell, ETableModel *model, int col, int row) } static void -ecp_free_text(ECellText *cell, char *text) +ecp_free_text(ECellText *cell, gchar *text) { /* Do Nothing. */ } @@ -80,12 +80,12 @@ show_percent_warning (void) } static void -ecp_set_value (ECellText *cell, ETableModel *model, int col, int row, - const char *text) +ecp_set_value (ECellText *cell, ETableModel *model, gint col, gint row, + const gchar *text) { - int matched, percent; + gint matched, percent; gboolean empty = TRUE; - const char *p; + const gchar *p; if (text) { p = text; @@ -142,7 +142,7 @@ e_cell_percent_init (ECellPercent *ecp) * Returns: an ECell object that can be used to render numbers. */ ECell * -e_cell_percent_new (const char *fontname, GtkJustification justify) +e_cell_percent_new (const gchar *fontname, GtkJustification justify) { ECellPercent *ecn = g_object_new (E_CELL_PERCENT_TYPE, NULL); diff --git a/widgets/table/e-cell-percent.h b/widgets/table/e-cell-percent.h index 5e202dfa82..3ac15afab7 100644 --- a/widgets/table/e-cell-percent.h +++ b/widgets/table/e-cell-percent.h @@ -46,6 +46,6 @@ typedef struct { } ECellPercentClass; GType e_cell_percent_get_type (void); -ECell *e_cell_percent_new (const char *fontname, GtkJustification justify); +ECell *e_cell_percent_new (const gchar *fontname, GtkJustification justify); #endif /* _E_CELL_PERCENT_H_ */ diff --git a/widgets/table/e-cell-pixbuf.c b/widgets/table/e-cell-pixbuf.c index ea141305b9..cf90909d6f 100644 --- a/widgets/table/e-cell-pixbuf.c +++ b/widgets/table/e-cell-pixbuf.c @@ -76,7 +76,7 @@ e_cell_pixbuf_construct (ECellPixbuf *ecp) */ static ECellView * -pixbuf_new_view (ECell *ecell, ETableModel *table_model, void *e_table_item_view) +pixbuf_new_view (ECell *ecell, ETableModel *table_model, gpointer e_table_item_view) { ECellPixbufView *pixbuf_view = g_new0 (ECellPixbufView, 1); ETableItem *eti = E_TABLE_ITEM (e_table_item_view); @@ -109,12 +109,12 @@ pixbuf_kill_view (ECellView *ecell_view) static void pixbuf_draw (ECellView *ecell_view, GdkDrawable *drawable, - int model_col, int view_col, int row, ECellFlags flags, - int x1, int y1, int x2, int y2) + gint model_col, gint view_col, gint row, ECellFlags flags, + gint x1, gint y1, gint x2, gint y2) { GdkPixbuf *cell_pixbuf; - int real_x, real_y, real_w, real_h; - int pix_w, pix_h; + gint real_x, real_y, real_w, real_h; + gint pix_w, pix_h; cairo_t *cr; cell_pixbuf = e_table_model_value_at (ecell_view->e_table_model, @@ -133,7 +133,7 @@ pixbuf_draw (ECellView *ecell_view, GdkDrawable *drawable, /* We center the pixbuf within our allocated space */ if (x2 - x1 > pix_w) { - int diff = (x2 - x1) - pix_w; + gint diff = (x2 - x1) - pix_w; real_x = x1 + diff/2; real_w = pix_w; } else { @@ -142,7 +142,7 @@ pixbuf_draw (ECellView *ecell_view, GdkDrawable *drawable, } if (y2 - y1 > pix_h) { - int diff = (y2 - y1) - pix_h; + gint diff = (y2 - y1) - pix_h; real_y = y1 + diff/2; real_h = pix_h; } else { @@ -160,7 +160,7 @@ pixbuf_draw (ECellView *ecell_view, GdkDrawable *drawable, static gint pixbuf_event (ECellView *ecell_view, GdkEvent *event, - int model_col, int view_col, int row, + gint model_col, gint view_col, gint row, ECellFlags flags, ECellActions *actions) { /* noop */ @@ -169,7 +169,7 @@ pixbuf_event (ECellView *ecell_view, GdkEvent *event, } static gint -pixbuf_height (ECellView *ecell_view, int model_col, int view_col, int row) +pixbuf_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) { GdkPixbuf *pixbuf; if (row == -1) { @@ -193,11 +193,11 @@ pixbuf_height (ECellView *ecell_view, int model_col, int view_col, int row) */ static void pixbuf_print (ECellView *ecell_view, GtkPrintContext *context, - int model_col, int view_col, int row, + gint model_col, gint view_col, gint row, double width, double height) { GdkPixbuf *pixbuf; - int scale; + gint scale; cairo_t *cr = gtk_print_context_get_cairo_context (context); pixbuf = (GdkPixbuf *) e_table_model_value_at (ecell_view->e_table_model, 1, row); @@ -214,7 +214,7 @@ pixbuf_print (ECellView *ecell_view, GtkPrintContext *context, static gdouble pixbuf_print_height (ECellView *ecell_view, GtkPrintContext *context, - int model_col, int view_col, int row, + gint model_col, gint view_col, gint row, double width) { GdkPixbuf *pixbuf; @@ -236,9 +236,9 @@ pixbuf_print_height (ECellView *ecell_view, GtkPrintContext *context, } static gint -pixbuf_max_width (ECellView *ecell_view, int model_col, int view_col) +pixbuf_max_width (ECellView *ecell_view, gint model_col, gint view_col) { - int pw; + gint pw; gint num_rows, i; gint max_width = -1; diff --git a/widgets/table/e-cell-pixbuf.h b/widgets/table/e-cell-pixbuf.h index 850e9d535d..f6d3c5173d 100644 --- a/widgets/table/e-cell-pixbuf.h +++ b/widgets/table/e-cell-pixbuf.h @@ -39,9 +39,9 @@ typedef struct _ECellPixbufClass ECellPixbufClass; struct _ECellPixbuf { ECell parent; - int selected_column; - int focused_column; - int unselected_column; + gint selected_column; + gint focused_column; + gint unselected_column; }; struct _ECellPixbufClass { diff --git a/widgets/table/e-cell-popup.c b/widgets/table/e-cell-popup.c index 83fe9cb087..ae85752612 100644 --- a/widgets/table/e-cell-popup.c +++ b/widgets/table/e-cell-popup.c @@ -76,7 +76,7 @@ static int ecp_height (ECellView *ecv, int model_col, int view_col, int row); -static void* ecp_enter_edit (ECellView *ecv, +static gpointer ecp_enter_edit (ECellView *ecv, int model_col, int view_col, int row); @@ -107,12 +107,12 @@ static void ecp_show_tooltip (ECellView *ecv, int row, int col_width, ETableTooltip *tooltip); -static char *ecp_get_bg_color (ECellView *ecell_view, int row); +static gchar *ecp_get_bg_color (ECellView *ecell_view, gint row); static gint e_cell_popup_do_popup (ECellPopupView *ecp_view, GdkEvent *event, - int row, - int model_col); + gint row, + gint model_col); G_DEFINE_TYPE (ECellPopup, e_cell_popup, E_CELL_TYPE) @@ -189,7 +189,7 @@ e_cell_popup_dispose (GObject *object) * ECell::new_view method */ static ECellView * -ecp_new_view (ECell *ecell, ETableModel *table_model, void *e_table_item_view) +ecp_new_view (ECell *ecell, ETableModel *table_model, gpointer e_table_item_view) { ECellPopup *ecp = E_CELL_POPUP (ecell); ECellPopupView *ecp_view; @@ -267,8 +267,8 @@ ecp_unrealize (ECellView *ecv) */ static void ecp_draw (ECellView *ecv, GdkDrawable *drawable, - int model_col, int view_col, int row, ECellFlags flags, - int x1, int y1, int x2, int y2) + gint model_col, gint view_col, gint row, ECellFlags flags, + gint x1, gint y1, gint x2, gint y2) { ECellPopup *ecp = E_CELL_POPUP (ecv->ecell); ECellPopupView *ecp_view = (ECellPopupView *) ecv; @@ -326,13 +326,13 @@ ecp_draw (ECellView *ecv, GdkDrawable *drawable, * ECell::event method */ static gint -ecp_event (ECellView *ecv, GdkEvent *event, int model_col, int view_col, - int row, ECellFlags flags, ECellActions *actions) +ecp_event (ECellView *ecv, GdkEvent *event, gint model_col, gint view_col, + gint row, ECellFlags flags, ECellActions *actions) { ECellPopupView *ecp_view = (ECellPopupView *) ecv; ECellPopup *ecp = E_CELL_POPUP (ecp_view->cell_view.ecell); ETableItem *eti = E_TABLE_ITEM (ecv->e_table_item_view); - int width; + gint width; switch (event->type) { case GDK_BUTTON_PRESS: @@ -369,7 +369,7 @@ ecp_event (ECellView *ecv, GdkEvent *event, int model_col, int view_col, * ECell::height method */ static int -ecp_height (ECellView *ecv, int model_col, int view_col, int row) +ecp_height (ECellView *ecv, gint model_col, gint view_col, gint row) { ECellPopupView *ecp_view = (ECellPopupView *) ecv; @@ -380,8 +380,8 @@ ecp_height (ECellView *ecv, int model_col, int view_col, int row) /* * ECellView::enter_edit method */ -static void * -ecp_enter_edit (ECellView *ecv, int model_col, int view_col, int row) +static gpointer +ecp_enter_edit (ECellView *ecv, gint model_col, gint view_col, gint row) { ECellPopupView *ecp_view = (ECellPopupView *) ecv; @@ -393,8 +393,8 @@ ecp_enter_edit (ECellView *ecv, int model_col, int view_col, int row) * ECellView::leave_edit method */ static void -ecp_leave_edit (ECellView *ecv, int model_col, int view_col, int row, - void *edit_context) +ecp_leave_edit (ECellView *ecv, gint model_col, gint view_col, gint row, + gpointer edit_context) { ECellPopupView *ecp_view = (ECellPopupView *) ecv; @@ -405,7 +405,7 @@ ecp_leave_edit (ECellView *ecv, int model_col, int view_col, int row, static void ecp_print (ECellView *ecv, GtkPrintContext *context, - int model_col, int view_col, int row, double width, double height) + gint model_col, gint view_col, gint row, double width, double height) { ECellPopupView *ecp_view = (ECellPopupView *) ecv; @@ -416,7 +416,7 @@ ecp_print (ECellView *ecv, GtkPrintContext *context, static gdouble ecp_print_height (ECellView *ecv, GtkPrintContext *context, - int model_col, int view_col, int row, + gint model_col, gint view_col, gint row, double width) { ECellPopupView *ecp_view = (ECellPopupView *) ecv; @@ -428,8 +428,8 @@ ecp_print_height (ECellView *ecv, GtkPrintContext *context, static int ecp_max_width (ECellView *ecv, - int model_col, - int view_col) + gint model_col, + gint view_col) { ECellPopupView *ecp_view = (ECellPopupView *) ecv; @@ -439,10 +439,10 @@ ecp_max_width (ECellView *ecv, static void ecp_show_tooltip (ECellView *ecv, - int model_col, - int view_col, - int row, - int col_width, + gint model_col, + gint view_col, + gint row, + gint col_width, ETableTooltip *tooltip) { ECellPopupView *ecp_view = (ECellPopupView *) ecv; @@ -451,8 +451,8 @@ ecp_show_tooltip (ECellView *ecv, col_width, tooltip); } -static char * -ecp_get_bg_color (ECellView *ecell_view, int row) +static gchar * +ecp_get_bg_color (ECellView *ecell_view, gint row) { ECellPopupView *ecp_view = (ECellPopupView *) ecell_view; @@ -487,11 +487,11 @@ e_cell_popup_set_child (ECellPopup *ecp, static gint e_cell_popup_do_popup (ECellPopupView *ecp_view, GdkEvent *event, - int row, - int view_col) + gint row, + gint view_col) { ECellPopup *ecp = E_CELL_POPUP (ecp_view->cell_view.ecell); - gint (*popup_func) (ECellPopup *ecp, GdkEvent *event, int row, int view_col); + gint (*popup_func) (ECellPopup *ecp, GdkEvent *event, gint row, gint view_col); ecp->popup_cell_view = ecp_view; diff --git a/widgets/table/e-cell-popup.h b/widgets/table/e-cell-popup.h index c1262a1234..b1e40a9845 100644 --- a/widgets/table/e-cell-popup.h +++ b/widgets/table/e-cell-popup.h @@ -71,7 +71,7 @@ typedef struct { ECellClass parent_class; /* Virtual function for subclasses to override. */ - gint (*popup) (ECellPopup *ecp, GdkEvent *event, int row, int view_col); + gint (*popup) (ECellPopup *ecp, GdkEvent *event, gint row, gint view_col); } ECellPopupClass; diff --git a/widgets/table/e-cell-size.c b/widgets/table/e-cell-size.c index ca4078512f..1fa949ec6a 100644 --- a/widgets/table/e-cell-size.c +++ b/widgets/table/e-cell-size.c @@ -31,8 +31,8 @@ G_DEFINE_TYPE (ECellSize, e_cell_size, E_CELL_TEXT_TYPE) -static char * -ecd_get_text(ECellText *cell, ETableModel *model, int col, int row) +static gchar * +ecd_get_text(ECellText *cell, ETableModel *model, gint col, gint row) { gint size = GPOINTER_TO_INT(e_table_model_value_at(model, col, row)); gfloat fsize; @@ -51,7 +51,7 @@ ecd_get_text(ECellText *cell, ETableModel *model, int col, int row) } static void -ecd_free_text(ECellText *cell, char *text) +ecd_free_text(ECellText *cell, gchar *text) { g_free(text); } @@ -96,7 +96,7 @@ e_cell_size_init (ECellSize *e_cell_size) * * Returns: an ECell object that can be used to render file sizes. */ ECell * -e_cell_size_new (const char *fontname, GtkJustification justify) +e_cell_size_new (const gchar *fontname, GtkJustification justify) { ECellSize *ecd = g_object_new (E_CELL_SIZE_TYPE, NULL); diff --git a/widgets/table/e-cell-size.h b/widgets/table/e-cell-size.h index ed0d279f6b..2b335d7717 100644 --- a/widgets/table/e-cell-size.h +++ b/widgets/table/e-cell-size.h @@ -44,7 +44,7 @@ typedef struct { } ECellSizeClass; GType e_cell_size_get_type (void); -ECell *e_cell_size_new (const char *fontname, GtkJustification justify); +ECell *e_cell_size_new (const gchar *fontname, GtkJustification justify); G_END_DECLS diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c index f330d64392..d4f61b2ae4 100644 --- a/widgets/table/e-cell-text.c +++ b/widgets/table/e-cell-text.c @@ -73,10 +73,10 @@ /* This defines a line of text */ struct line { - char *text; /* Line's text UTF-8, it is a pointer into the text->text string */ - int length; /* Line's length in BYTES */ - int width; /* Line's width in pixels */ - int ellipsis_length; /* Length before adding ellipsis in BYTES */ + gchar *text; /* Line's text UTF-8, it is a pointer into the text->text string */ + gint length; /* Line's length in BYTES */ + gint width; /* Line's width in pixels */ + gint ellipsis_length; /* Length before adding ellipsis in BYTES */ }; /* Object argument IDs */ @@ -116,9 +116,9 @@ G_DEFINE_TYPE (ECellText, e_cell_text, E_CELL_TYPE) typedef struct { gpointer lines; /* Text split into lines (private field) */ - int num_lines; /* Number of lines of text */ - int max_width; - int ref_count; + gint num_lines; /* Number of lines of text */ + gint max_width; + gint ref_count; } ECellTextLineBreaks; @@ -138,7 +138,7 @@ typedef struct { CellEdit *edit; - int xofs, yofs; /* This gets added to the x + gint xofs, yofs; /* This gets added to the x and y for the cell text. */ double ellipsis_width[2]; /* The width of the ellipsis. */ } ECellTextView; @@ -147,26 +147,26 @@ struct _CellEdit { ECellTextView *text_view; - int model_col, view_col, row; - int cell_width; + gint model_col, view_col, row; + gint cell_width; PangoLayout *layout; - char *text; + gchar *text; - char *old_text; + gchar *old_text; /* * Where the editing is taking place */ - int xofs_edit, yofs_edit; /* Offset because of editing. + gint xofs_edit, yofs_edit; /* Offset because of editing. This is negative compared to the other offsets. */ /* This needs to be reworked a bit once we get line wrapping. */ - int selection_start; /* Start of selection - IN BYTES */ - int selection_end; /* End of selection - IN BYTES */ + gint selection_start; /* Start of selection - IN BYTES */ + gint selection_end; /* End of selection - IN BYTES */ gboolean select_by_word; /* Current selection is by word */ /* This section is for drag scrolling and blinking cursor. */ @@ -200,7 +200,7 @@ struct _CellEdit { static void e_cell_text_view_command (ETextEventProcessor *tep, ETextEventProcessorCommand *command, gpointer data); static void e_cell_text_view_get_selection (CellEdit *edit, GdkAtom selection, guint32 time); -static void e_cell_text_view_supply_selection (CellEdit *edit, guint time, GdkAtom selection, char *data, gint length); +static void e_cell_text_view_supply_selection (CellEdit *edit, guint time, GdkAtom selection, gchar *data, gint length); static void _get_tep (CellEdit *edit); @@ -213,13 +213,13 @@ static void e_cell_text_preedit_changed_cb (GtkIMContext *context, ECellTextView static void e_cell_text_commit_cb (GtkIMContext *context, const gchar *str, ECellTextView *text_view); static gboolean e_cell_text_retrieve_surrounding_cb (GtkIMContext *context, ECellTextView *text_view); static gboolean e_cell_text_delete_surrounding_cb (GtkIMContext *context, gint offset, gint n_chars, ECellTextView *text_view); -static void _insert (ECellTextView *text_view, const gchar *string, int value); +static void _insert (ECellTextView *text_view, const gchar *string, gint value); static void _delete_selection (ECellTextView *text_view); -static PangoAttrList* build_attr_list (ECellTextView *text_view, int row, int text_length); +static PangoAttrList* build_attr_list (ECellTextView *text_view, gint row, gint text_length); static void update_im_cursor_location (ECellTextView *tv); -char * -e_cell_text_get_text (ECellText *cell, ETableModel *model, int col, int row) +gchar * +e_cell_text_get_text (ECellText *cell, ETableModel *model, gint col, gint row) { if (ECT_CLASS(cell)->get_text) return ECT_CLASS(cell)->get_text (cell, model, col, row); @@ -228,44 +228,44 @@ e_cell_text_get_text (ECellText *cell, ETableModel *model, int col, int row) } void -e_cell_text_free_text (ECellText *cell, char *text) +e_cell_text_free_text (ECellText *cell, gchar *text) { if (ECT_CLASS(cell)->free_text) ECT_CLASS(cell)->free_text (cell, text); } void -e_cell_text_set_value (ECellText *cell, ETableModel *model, int col, int row, - const char *text) +e_cell_text_set_value (ECellText *cell, ETableModel *model, gint col, gint row, + const gchar *text) { if (ECT_CLASS(cell)->set_value) ECT_CLASS(cell)->set_value (cell, model, col, row, text); } -static char * -ect_real_get_text (ECellText *cell, ETableModel *model, int col, int row) +static gchar * +ect_real_get_text (ECellText *cell, ETableModel *model, gint col, gint row) { return e_table_model_value_at(model, col, row); } static void -ect_real_free_text (ECellText *cell, char *text) +ect_real_free_text (ECellText *cell, gchar *text) { } /* This is the default method for setting the ETableModel value based on the text in the ECellText. This simply uses the text as it is - it assumes - the value in the model is a char*. Subclasses may parse the text into + the value in the model is a gchar *. Subclasses may parse the text into data structures to pass to the model. */ static void -ect_real_set_value (ECellText *cell, ETableModel *model, int col, int row, - const char *text) +ect_real_set_value (ECellText *cell, ETableModel *model, gint col, gint row, + const gchar *text) { e_table_model_set_value_at (model, col, row, text); } static void -ect_queue_redraw (ECellTextView *text_view, int view_col, int view_row) +ect_queue_redraw (ECellTextView *text_view, gint view_col, gint view_row) { e_table_item_redraw_range ( text_view->cell_view.e_table_item_view, @@ -279,8 +279,8 @@ static void ect_stop_editing (ECellTextView *text_view, gboolean commit) { CellEdit *edit = text_view->edit; - int row, view_col, model_col; - char *old_text, *text; + gint row, view_col, model_col; + gchar *old_text, *text; if (!edit) return; @@ -350,7 +350,7 @@ ect_cancel_edit (ECellTextView *text_view) * ECell::new_view method */ static ECellView * -ect_new_view (ECell *ecell, ETableModel *table_model, void *e_table_item_view) +ect_new_view (ECell *ecell, ETableModel *table_model, gpointer e_table_item_view) { ECellTextView *text_view = g_new0 (ECellTextView, 1); GnomeCanvas *canvas = GNOME_CANVAS_ITEM (e_table_item_view)->canvas; @@ -456,7 +456,7 @@ ect_free_color (gchar *color_spec, GdkColor *color, GdkColormap *colormap) static PangoAttrList* -build_attr_list (ECellTextView *text_view, int row, int text_length) +build_attr_list (ECellTextView *text_view, gint row, gint text_length) { ECellView *ecell_view = (ECellView *) text_view; @@ -501,7 +501,7 @@ build_attr_list (ECellTextView *text_view, int row, int text_length) } static PangoLayout * -layout_with_preedit (ECellTextView *text_view, int row, const char *text, gint width) +layout_with_preedit (ECellTextView *text_view, gint row, const gchar *text, gint width) { CellEdit *edit = text_view->edit; PangoAttrList *attrs ; @@ -563,7 +563,7 @@ layout_with_preedit (ECellTextView *text_view, int row, const char *text, gint w } static PangoLayout * -build_layout (ECellTextView *text_view, int row, const char *text, gint width) +build_layout (ECellTextView *text_view, gint row, const gchar *text, gint width) { ECellView *ecell_view = (ECellView *) text_view; ECellText *ect = E_CELL_TEXT (ecell_view->ecell); @@ -592,13 +592,13 @@ build_layout (ECellTextView *text_view, int row, const char *text, gint width) if (ect->font_name) { PangoFontDescription *desc = NULL, *fixed_desc = NULL; - char *fixed_family = NULL; + gchar *fixed_family = NULL; gint fixed_size = 0; gboolean fixed_points = TRUE; fixed_desc = pango_font_description_from_string (ect->font_name); if (fixed_desc) { - fixed_family = (char *)pango_font_description_get_family (fixed_desc); + fixed_family = (gchar *)pango_font_description_get_family (fixed_desc); fixed_size = pango_font_description_get_size (fixed_desc); fixed_points = !pango_font_description_get_size_is_absolute (fixed_desc); } @@ -637,7 +637,7 @@ build_layout (ECellTextView *text_view, int row, const char *text, gint width) } static PangoLayout * -generate_layout (ECellTextView *text_view, int model_col, int view_col, int row, int width) +generate_layout (ECellTextView *text_view, gint model_col, gint view_col, gint row, gint width) { ECellView *ecell_view = (ECellView *) text_view; ECellText *ect = E_CELL_TEXT (ecell_view->ecell); @@ -650,7 +650,7 @@ generate_layout (ECellTextView *text_view, int model_col, int view_col, int row, } if (row >= 0) { - char *temp = e_cell_text_get_text(ect, ecell_view->e_table_model, model_col, row); + gchar *temp = e_cell_text_get_text(ect, ecell_view->e_table_model, model_col, row); layout = build_layout (text_view, row, temp ? temp : "?", width); e_cell_text_free_text(ect, temp); } else @@ -661,10 +661,10 @@ generate_layout (ECellTextView *text_view, int model_col, int view_col, int row, static void -draw_pango_rectangle (GdkDrawable *drawable, GdkGC *gc, int x1, int y1, PangoRectangle rect) +draw_pango_rectangle (GdkDrawable *drawable, GdkGC *gc, gint x1, gint y1, PangoRectangle rect) { - int width = rect.width / PANGO_SCALE; - int height = rect.height / PANGO_SCALE; + gint width = rect.width / PANGO_SCALE; + gint height = rect.height / PANGO_SCALE; if (width <= 0) width = 1; if (height <= 0) @@ -676,15 +676,15 @@ draw_pango_rectangle (GdkDrawable *drawable, GdkGC *gc, int x1, int y1, PangoRec static gboolean show_pango_rectangle (CellEdit *edit, PangoRectangle rect) { - int x1 = rect.x / PANGO_SCALE; - int x2 = (rect.x + rect.width) / PANGO_SCALE; + gint x1 = rect.x / PANGO_SCALE; + gint x2 = (rect.x + rect.width) / PANGO_SCALE; #if 0 - int y1 = rect.y / PANGO_SCALE; - int y2 = (rect.y + rect.height) / PANGO_SCALE; + gint y1 = rect.y / PANGO_SCALE; + gint y2 = (rect.y + rect.height) / PANGO_SCALE; #endif - int new_xofs_edit = edit->xofs_edit; - int new_yofs_edit = edit->yofs_edit; + gint new_xofs_edit = edit->xofs_edit; + gint new_yofs_edit = edit->yofs_edit; if (x1 < new_xofs_edit) new_xofs_edit = x1; @@ -717,8 +717,8 @@ show_pango_rectangle (CellEdit *edit, PangoRectangle rect) */ static void ect_draw (ECellView *ecell_view, GdkDrawable *drawable, - int model_col, int view_col, int row, ECellFlags flags, - int x1, int y1, int x2, int y2) + gint model_col, gint view_col, gint row, ECellFlags flags, + gint x1, gint y1, gint x2, gint y2) { PangoLayout *layout; ECellTextView *text_view = (ECellTextView *) ecell_view; @@ -728,7 +728,7 @@ ect_draw (ECellView *ecell_view, GdkDrawable *drawable, GdkColor *foreground; GtkWidget *canvas = GTK_WIDGET (text_view->canvas); GdkRectangle clip_rect; - int x_origin, y_origin; + gint x_origin, y_origin; selected = flags & E_CELL_SELECTED; @@ -741,7 +741,7 @@ ect_draw (ECellView *ecell_view, GdkDrawable *drawable, foreground = &canvas->style->text [GTK_STATE_NORMAL]; if (ect->color_column != -1) { - char *color_spec; + gchar *color_spec; GdkColor *cell_foreground; color_spec = e_table_model_value_at (ecell_view->e_table_model, @@ -783,7 +783,7 @@ ect_draw (ECellView *ecell_view, GdkDrawable *drawable, if (edit && edit->view_col == view_col && edit->row == row) { if (edit->selection_start != edit->selection_end) { - int start_index, end_index; + gint start_index, end_index; PangoLayoutLine *line; gint *ranges; gint n_ranges, i; @@ -861,7 +861,7 @@ ect_draw (ECellView *ecell_view, GdkDrawable *drawable, * Get the background color */ static gchar * -ect_get_bg_color(ECellView *ecell_view, int row) +ect_get_bg_color(ECellView *ecell_view, gint row) { ECellText *ect = E_CELL_TEXT (ecell_view->ecell); gchar *color_spec; @@ -902,7 +902,7 @@ key_begins_editing (GdkEventKey *event) * ECell::event method */ static gint -ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, int row, ECellFlags flags, ECellActions *actions) +ect_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col, gint row, ECellFlags flags, ECellActions *actions) { ECellTextView *text_view = (ECellTextView *) ecell_view; ETextEventProcessorEvent e_tep_event; @@ -1146,7 +1146,7 @@ ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, * ECell::height method */ static int -ect_height (ECellView *ecell_view, int model_col, int view_col, int row) +ect_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) { ECellTextView *text_view = (ECellTextView *) ecell_view; gint height; @@ -1161,13 +1161,13 @@ ect_height (ECellView *ecell_view, int model_col, int view_col, int row) /* * ECellView::enter_edit method */ -static void * -ect_enter_edit (ECellView *ecell_view, int model_col, int view_col, int row) +static gpointer +ect_enter_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row) { ECellTextView *text_view = (ECellTextView *) ecell_view; CellEdit *edit; ECellText *ect = E_CELL_TEXT(ecell_view->ecell); - char *temp; + gchar *temp; edit = g_new0 (CellEdit, 1); text_view->edit = edit; @@ -1238,7 +1238,7 @@ ect_enter_edit (ECellView *ecell_view, int model_col, int view_col, int row) * ECellView::leave_edit method */ static void -ect_leave_edit (ECellView *ecell_view, int model_col, int view_col, int row, void *edit_context) +ect_leave_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer edit_context) { ECellTextView *text_view = (ECellTextView *) ecell_view; CellEdit *edit = text_view->edit; @@ -1255,13 +1255,13 @@ ect_leave_edit (ECellView *ecell_view, int model_col, int view_col, int row, voi /* * ECellView::save_state method */ -static void * -ect_save_state (ECellView *ecell_view, int model_col, int view_col, int row, void *edit_context) +static gpointer +ect_save_state (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer edit_context) { ECellTextView *text_view = (ECellTextView *) ecell_view; CellEdit *edit = text_view->edit; - int *save_state = g_new (int, 2); + gint *save_state = g_new (int, 2); save_state[0] = edit->selection_start; save_state[1] = edit->selection_end; @@ -1272,12 +1272,12 @@ ect_save_state (ECellView *ecell_view, int model_col, int view_col, int row, voi * ECellView::load_state method */ static void -ect_load_state (ECellView *ecell_view, int model_col, int view_col, int row, void *edit_context, void *save_state) +ect_load_state (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer edit_context, gpointer save_state) { ECellTextView *text_view = (ECellTextView *) ecell_view; CellEdit *edit = text_view->edit; - int length; - int *selection = save_state; + gint length; + gint *selection = save_state; length = strlen (edit->text); @@ -1291,7 +1291,7 @@ ect_load_state (ECellView *ecell_view, int model_col, int view_col, int row, voi * ECellView::free_state method */ static void -ect_free_state (ECellView *ecell_view, int model_col, int view_col, int row, void *save_state) +ect_free_state (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer save_state) { g_free (save_state); } @@ -1308,11 +1308,11 @@ get_font_description_for_size (double h) } static void -get_font_size (PangoLayout *layout, PangoFontDescription *font, const char *text, +get_font_size (PangoLayout *layout, PangoFontDescription *font, const gchar *text, double *width, double *height) { - int w; - int h; + gint w; + gint h; g_return_if_fail (layout != NULL); pango_layout_set_font_description (layout, font); @@ -1328,7 +1328,7 @@ get_font_size (PangoLayout *layout, PangoFontDescription *font, const char *text static void ect_print (ECellView *ecell_view, GtkPrintContext *context, - int model_col, int view_col, int row, + gint model_col, gint view_col, gint row, double width, double height) { PangoFontDescription *font_des = get_font_description_for_size (12); @@ -1341,7 +1341,7 @@ ect_print (ECellView *ecell_view, GtkPrintContext *context, PangoDirection dir; gboolean strikeout, underline; cairo_t *cr; - char *string; + gchar *string; double ty, ly, text_width = 0.0, text_height = 0.0; @@ -1417,7 +1417,7 @@ ect_print (ECellView *ecell_view, GtkPrintContext *context, static gdouble ect_print_height (ECellView *ecell_view, GtkPrintContext *context, - int model_col, int view_col, int row, + gint model_col, gint view_col, gint row, double width) { /* @@ -1432,20 +1432,20 @@ ect_print_height (ECellView *ecell_view, GtkPrintContext *context, static int ect_max_width (ECellView *ecell_view, - int model_col, - int view_col) + gint model_col, + gint view_col) { /* New ECellText */ ECellTextView *text_view = (ECellTextView *) ecell_view; - int row; - int number_of_rows; - int max_width = 0; + gint row; + gint number_of_rows; + gint max_width = 0; number_of_rows = e_table_model_row_count (ecell_view->e_table_model); for (row = 0; row < number_of_rows; row++) { PangoLayout *layout = generate_layout (text_view, model_col, view_col, row, 0); - int width; + gint width; pango_layout_get_pixel_size (layout, &width, NULL); @@ -1458,13 +1458,13 @@ ect_max_width (ECellView *ecell_view, static int ect_max_width_by_row (ECellView *ecell_view, - int model_col, - int view_col, - int row) + gint model_col, + gint view_col, + gint row) { /* New ECellText */ ECellTextView *text_view = (ECellTextView *) ecell_view; - int width; + gint width; PangoLayout *layout; if (row >= e_table_model_row_count (ecell_view->e_table_model)) @@ -1519,10 +1519,10 @@ tooltip_event (GtkWidget *window, static void ect_show_tooltip (ECellView *ecell_view, - int model_col, - int view_col, - int row, - int col_width, + gint model_col, + gint view_col, + gint row, + gint col_width, ETableTooltip *tooltip) { ECellTextView *text_view = (ECellTextView *) ecell_view; @@ -1530,7 +1530,7 @@ ect_show_tooltip (ECellView *ecell_view, double i2c[6]; ArtPoint origin = {0, 0}; ArtPoint pixel_origin; - int canvas_x, canvas_y; + gint canvas_x, canvas_y; GnomeCanvasItem *tooltip_text; double tooltip_width; double tooltip_height; @@ -1540,7 +1540,7 @@ ect_show_tooltip (ECellView *ecell_view, ECellText *ect = E_CELL_TEXT(ecell_view->ecell); GtkWidget *window; PangoLayout *layout; - int width, height; + gint width, height; tooltip->timer = 0; @@ -1733,7 +1733,7 @@ ect_get_property (GObject *object, } } -static char *ellipsis_default = NULL; +static gchar *ellipsis_default = NULL; static gboolean use_ellipsis_default = TRUE; static void @@ -1741,7 +1741,7 @@ e_cell_text_class_init (ECellTextClass *klass) { ECellClass *ecc = E_CELL_CLASS (klass); GObjectClass *object_class = G_OBJECT_CLASS (klass); - const char *ellipsis_env; + const gchar *ellipsis_env; object_class->finalize = ect_finalize; @@ -1972,7 +1972,7 @@ e_cell_text_delete_surrounding_cb (GtkIMContext *context, gint n_chars, ECellTextView *tv) { - int begin_pos, end_pos; + gint begin_pos, end_pos; glong text_len; CellEdit *edit = tv->edit; @@ -2020,7 +2020,7 @@ e_cell_text_init (ECellText *ect) * Returns: The ECellText. */ ECell * -e_cell_text_construct (ECellText *cell, const char *fontname, GtkJustification justify) +e_cell_text_construct (ECellText *cell, const gchar *fontname, GtkJustification justify) { if(!cell) return E_CELL(NULL); @@ -2037,7 +2037,7 @@ e_cell_text_construct (ECellText *cell, const char *fontname, GtkJustification j * * Creates a new ECell renderer that can be used to render strings that * that come from the model. The value returned from the model is - * interpreted as being a char *. + * interpreted as being a gchar *. * * The ECellText object support a large set of properties that can be * configured through the Gtk argument system and allows the user to have @@ -2056,7 +2056,7 @@ e_cell_text_construct (ECellText *cell, const char *fontname, GtkJustification j * Returns: an ECell object that can be used to render strings. */ ECell * -e_cell_text_new (const char *fontname, GtkJustification justify) +e_cell_text_new (const gchar *fontname, GtkJustification justify) { ECellText *ect = g_object_new (E_CELL_TEXT_TYPE, NULL); @@ -2072,9 +2072,9 @@ e_cell_text_new (const char *fontname, GtkJustification justify) static gint get_position_from_xy (CellEdit *edit, gint x, gint y) { - int index; - int trailing; - const char *text; + gint index; + gint trailing; + const gchar *text; PangoLayout *layout = generate_layout (edit->text_view, edit->model_col, edit->view_col, edit->row, edit->cell_width); ECellTextView *text_view = edit->text_view; @@ -2102,7 +2102,7 @@ _blink_scroll_timeout (gpointer data) gulong current_time; gboolean scroll = FALSE; gboolean redraw = FALSE; - int width, height; + gint width, height; g_timer_elapsed (edit->timer, ¤t_time); @@ -2164,10 +2164,10 @@ _blink_scroll_timeout (gpointer data) } static int -next_word (CellEdit *edit, int start) +next_word (CellEdit *edit, gint start) { - char *p; - int length; + gchar *p; + gint length; length = strlen (edit->text); if (start >= length) @@ -2188,12 +2188,12 @@ next_word (CellEdit *edit, int start) static int _get_position (ECellTextView *text_view, ETextEventProcessorCommand *command) { - int length; + gint length; CellEdit *edit = text_view->edit; gchar *p; - int unival; - int index; - int trailing; + gint unival; + gint index; + gint trailing; switch (command->position) { @@ -2360,10 +2360,10 @@ _delete_selection (ECellTextView *text_view) /* NB! We expect value to be length IN BYTES */ static void -_insert (ECellTextView *text_view, const gchar *string, int value) +_insert (ECellTextView *text_view, const gchar *string, gint value) { CellEdit *edit = text_view->edit; - char *temp; + gchar *temp; if (value <= 0) return; @@ -2386,16 +2386,16 @@ _insert (ECellTextView *text_view, const gchar *string, int value) } static void -capitalize (CellEdit *edit, int start, int end, ETextEventProcessorCaps type) +capitalize (CellEdit *edit, gint start, gint end, ETextEventProcessorCaps type) { ECellTextView *text_view = edit->text_view; gboolean first = TRUE; - int character_length = g_utf8_strlen (edit->text + start, start - end); - const char *p = edit->text + start; - const char *text_end = edit->text + end; - char *new_text = g_new0 (char, character_length * 6 + 1); - char *output = new_text; + gint character_length = g_utf8_strlen (edit->text + start, start - end); + const gchar *p = edit->text + start; + const gchar *text_end = edit->text + end; + gchar *new_text = g_new0 (char, character_length * 6 + 1); + gchar *output = new_text; while (p && *p && p < text_end && g_unichar_validate (g_utf8_get_char (p))) { gunichar unival = g_utf8_get_char (p); @@ -2446,7 +2446,7 @@ e_cell_text_view_command (ETextEventProcessor *tep, ETextEventProcessorCommand * gboolean change = FALSE; gboolean redraw = FALSE; - int sel_start, sel_end; + gint sel_start, sel_end; /* If the EText isn't editable, then ignore any commands that would modify the text. */ @@ -2540,8 +2540,8 @@ e_cell_text_view_command (ETextEventProcessor *tep, ETextEventProcessorCommand * if (edit->selection_start == edit->selection_end) { capitalize (edit, edit->selection_start, next_word (edit, edit->selection_start), command->value); } else { - int selection_start = MIN (edit->selection_start, edit->selection_end); - int selection_end = edit->selection_start + edit->selection_end - selection_start; /* Slightly faster than MAX */ + gint selection_start = MIN (edit->selection_start, edit->selection_end); + gint selection_end = edit->selection_start + edit->selection_end - selection_start; /* Slightly faster than MAX */ capitalize (edit, selection_start, selection_end, command->value); } if (edit->timer) { @@ -2581,7 +2581,7 @@ e_cell_text_view_command (ETextEventProcessor *tep, ETextEventProcessorCommand * } static void -e_cell_text_view_supply_selection (CellEdit *edit, guint time, GdkAtom selection, char *data, gint length) +e_cell_text_view_supply_selection (CellEdit *edit, guint time, GdkAtom selection, gchar *data, gint length) { #if DO_SELECTION GtkClipboard *clipboard; @@ -2612,7 +2612,7 @@ paste_received (GtkClipboard *clipboard, ETextEventProcessorCommand command; command.action = E_TEP_INSERT; command.position = E_TEP_SELECTION; - command.string = (char *)text; + command.string = (gchar *)text; command.value = strlen (text); command.time = GDK_CURRENT_TIME; e_cell_text_view_command (edit->tep, &command, edit); @@ -2736,8 +2736,8 @@ e_cell_text_set_selection (ECellView *cell_view, * @cell_view: the given cell view * @col: column of the given cell in the view * @row: row of the given cell in the view - * @start: a pointer to an int value indicates the start offset of the selection - * @end: a pointer to an int value indicates the end offset of the selection + * @start: a pointer to an gint value indicates the start offset of the selection + * @end: a pointer to an gint value indicates the end offset of the selection * * Gets the selection of given text cell. * If the current editing cell is not the given cell, this function @@ -2875,7 +2875,7 @@ e_cell_text_delete_selection (ECellView *cell_view, gint col, gint row) * * This API is most likely to be used by a11y implementations. */ -char * +gchar * e_cell_text_get_text_by_view (ECellView *cell_view, gint col, gint row) { ECellTextView *ectv; diff --git a/widgets/table/e-cell-text.h b/widgets/table/e-cell-text.h index d92b025aa5..df4a6f827c 100644 --- a/widgets/table/e-cell-text.h +++ b/widgets/table/e-cell-text.h @@ -54,27 +54,27 @@ typedef struct { ECell parent; GtkJustification justify; - char *font_name; + gchar *font_name; double x, y; /* Position at anchor */ gulong pixel; /* Fill color */ /* Clip handling */ - char *ellipsis; /* The ellipsis characters. NULL = "...". */ + gchar *ellipsis; /* The ellipsis characters. NULL = "...". */ guint use_ellipsis : 1; /* Whether to use the ellipsis. */ guint editable : 1; /* Whether the text can be edited. */ - int strikeout_column; - int underline_column; - int bold_column; + gint strikeout_column; + gint underline_column; + gint bold_column; /* This column in the ETable should return a string specifying a color, either a color name like "red" or a color spec like "rgb:F/0/0". See the XParseColor man page for the formats available. */ - int color_column; - int bg_color_column; + gint color_column; + gint bg_color_column; /* This stores the colors we have allocated. */ GHashTable *colors; @@ -83,28 +83,28 @@ typedef struct { typedef struct { ECellClass parent_class; - char *(*get_text) (ECellText *cell, ETableModel *model, int col, int row); - void (*free_text) (ECellText *cell, char *text); - void (*set_value) (ECellText *cell, ETableModel *model, int col, int row, const char *text); + gchar *(*get_text) (ECellText *cell, ETableModel *model, gint col, gint row); + void (*free_text) (ECellText *cell, gchar *text); + void (*set_value) (ECellText *cell, ETableModel *model, gint col, gint row, const gchar *text); /* signal handlers */ - void (*text_inserted) (ECellText *cell, ECellView *cell_view, int pos, int len, int row, int model_col); - void (*text_deleted) (ECellText *cell, ECellView *cell_view, int pos, int len, int row, int model_col); + void (*text_inserted) (ECellText *cell, ECellView *cell_view, gint pos, gint len, gint row, gint model_col); + void (*text_deleted) (ECellText *cell, ECellView *cell_view, gint pos, gint len, gint row, gint model_col); } ECellTextClass; GType e_cell_text_get_type (void); -ECell *e_cell_text_new (const char *fontname, GtkJustification justify); -ECell *e_cell_text_construct(ECellText *cell, const char *fontname, GtkJustification justify); +ECell *e_cell_text_new (const gchar *fontname, GtkJustification justify); +ECell *e_cell_text_construct(ECellText *cell, const gchar *fontname, GtkJustification justify); /* Gets the value from the model and converts it into a string. In ECellText - itself, the value is assumed to be a char* and so needs no conversion. + itself, the value is assumed to be a gchar * and so needs no conversion. In subclasses the ETableModel value may be a more complicated datatype. */ -char *e_cell_text_get_text (ECellText *cell, ETableModel *model, int col, int row); +char *e_cell_text_get_text (ECellText *cell, ETableModel *model, gint col, gint row); /* Frees the value returned by e_cell_text_get_text(). */ -void e_cell_text_free_text (ECellText *cell, char *text); +void e_cell_text_free_text (ECellText *cell, gchar *text); /* Sets the ETableModel value, based on the given string. */ -void e_cell_text_set_value (ECellText *cell, ETableModel *model, int col, int row, const char *text); +void e_cell_text_set_value (ECellText *cell, ETableModel *model, gint col, gint row, const gchar *text); /* Sets the selection of given text cell */ gboolean e_cell_text_set_selection (ECellView *cell_view, gint col, gint row, gint start, gint end); @@ -122,7 +122,7 @@ void e_cell_text_paste_clipboard (ECellView *cell_view, gint col, gint row); void e_cell_text_delete_selection (ECellView *cell_view, gint col, gint row); /* get text directly from view, both col and row are model format */ -char *e_cell_text_get_text_by_view (ECellView *cell_view, gint col, gint row); +gchar *e_cell_text_get_text_by_view (ECellView *cell_view, gint col, gint row); G_END_DECLS diff --git a/widgets/table/e-cell-toggle.c b/widgets/table/e-cell-toggle.c index f441d5ea17..11a9ea4ffc 100644 --- a/widgets/table/e-cell-toggle.c +++ b/widgets/table/e-cell-toggle.c @@ -50,7 +50,7 @@ typedef struct { * ECell::realize method */ static ECellView * -etog_new_view (ECell *ecell, ETableModel *table_model, void *e_table_item_view) +etog_new_view (ECell *ecell, ETableModel *table_model, gpointer e_table_item_view) { ECellToggleView *toggle_view = g_new0 (ECellToggleView, 1); ETableItem *eti = E_TABLE_ITEM (e_table_item_view); @@ -109,17 +109,17 @@ etog_unrealize (ECellView *ecv) */ static void etog_draw (ECellView *ecell_view, GdkDrawable *drawable, - int model_col, int view_col, int row, ECellFlags flags, - int x1, int y1, int x2, int y2) + gint model_col, gint view_col, gint row, ECellFlags flags, + gint x1, gint y1, gint x2, gint y2) { ECellToggle *toggle = E_CELL_TOGGLE (ecell_view->ecell); ECellToggleView *toggle_view = (ECellToggleView *) ecell_view; GdkPixbuf *image; - int x, y, width, height; - int cache_seq; + gint x, y, width, height; + gint cache_seq; cairo_t *cr; - const int value = GPOINTER_TO_INT ( + const gint value = GPOINTER_TO_INT ( e_table_model_value_at (ecell_view->e_table_model, model_col, row)); if (value < 0 || value >= toggle->n_states){ @@ -168,7 +168,7 @@ etog_draw (ECellView *ecell_view, GdkDrawable *drawable, } static void -etog_set_value (ECellToggleView *toggle_view, int model_col, int view_col, int row, int value) +etog_set_value (ECellToggleView *toggle_view, gint model_col, gint view_col, gint row, gint value) { ECell *ecell = toggle_view->cell_view.ecell; ECellToggle *toggle = E_CELL_TOGGLE (ecell); @@ -184,11 +184,11 @@ etog_set_value (ECellToggleView *toggle_view, int model_col, int view_col, int r * ECell::event method */ static gint -etog_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, int row, ECellFlags flags, ECellActions *actions) +etog_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col, gint row, ECellFlags flags, ECellActions *actions) { ECellToggleView *toggle_view = (ECellToggleView *) ecell_view; - void *_value = e_table_model_value_at (ecell_view->e_table_model, model_col, row); - const int value = GPOINTER_TO_INT (_value); + gpointer _value = e_table_model_value_at (ecell_view->e_table_model, model_col, row); + const gint value = GPOINTER_TO_INT (_value); #if 0 if (!(flags & E_CELL_EDITING)) @@ -216,7 +216,7 @@ etog_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, * ECell::height method */ static int -etog_height (ECellView *ecell_view, int model_col, int view_col, int row) +etog_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) { ECellToggle *toggle = E_CELL_TOGGLE (ecell_view->ecell); @@ -228,13 +228,13 @@ etog_height (ECellView *ecell_view, int model_col, int view_col, int row) */ static void etog_print (ECellView *ecell_view, GtkPrintContext *context, - int model_col, int view_col, int row, + gint model_col, gint view_col, gint row, double width, double height) { ECellToggle *toggle = E_CELL_TOGGLE(ecell_view->ecell); GdkPixbuf *image; double image_width, image_height; - const int value = GPOINTER_TO_INT ( + const gint value = GPOINTER_TO_INT ( e_table_model_value_at (ecell_view->e_table_model, model_col, row)); cairo_t *cr; @@ -264,7 +264,7 @@ etog_print (ECellView *ecell_view, GtkPrintContext *context, static gdouble etog_print_height (ECellView *ecell_view, GtkPrintContext *context, - int model_col, int view_col, int row, + gint model_col, gint view_col, gint row, double width) { ECellToggle *toggle = E_CELL_TOGGLE (ecell_view->ecell); @@ -276,16 +276,16 @@ etog_print_height (ECellView *ecell_view, GtkPrintContext *context, * ECell::max_width method */ static int -etog_max_width (ECellView *ecell_view, int model_col, int view_col) +etog_max_width (ECellView *ecell_view, gint model_col, gint view_col) { ECellToggle *toggle = E_CELL_TOGGLE (ecell_view->ecell); - int max_width = 0; - int number_of_rows; - int row; + gint max_width = 0; + gint number_of_rows; + gint row; number_of_rows = e_table_model_row_count (ecell_view->e_table_model); for (row = 0; row < number_of_rows; row++) { - void *value = e_table_model_value_at (ecell_view->e_table_model, + gpointer value = e_table_model_value_at (ecell_view->e_table_model, model_col, row); max_width = MAX (max_width, gdk_pixbuf_get_width (toggle->images[GPOINTER_TO_INT (value)])); } @@ -297,7 +297,7 @@ static void etog_finalize (GObject *object) { ECellToggle *etog = E_CELL_TOGGLE (object); - int i; + gint i; for (i = 0; i < etog->n_states; i++) g_object_unref (etog->images [i]); @@ -351,10 +351,10 @@ e_cell_toggle_init (ECellToggle *etog) * arguments. */ void -e_cell_toggle_construct (ECellToggle *etog, int border, int n_states, GdkPixbuf **images) +e_cell_toggle_construct (ECellToggle *etog, gint border, gint n_states, GdkPixbuf **images) { - int max_height = 0; - int i; + gint max_height = 0; + gint i; etog->border = border; etog->n_states = n_states; @@ -389,7 +389,7 @@ e_cell_toggle_construct (ECellToggle *etog, int border, int n_states, GdkPixbuf * toggle cells. */ ECell * -e_cell_toggle_new (int border, int n_states, GdkPixbuf **images) +e_cell_toggle_new (gint border, gint n_states, GdkPixbuf **images) { ECellToggle *etog = g_object_new (E_CELL_TOGGLE_TYPE, NULL); diff --git a/widgets/table/e-cell-toggle.h b/widgets/table/e-cell-toggle.h index 97d16dc659..96e3d01a55 100644 --- a/widgets/table/e-cell-toggle.h +++ b/widgets/table/e-cell-toggle.h @@ -41,11 +41,11 @@ G_BEGIN_DECLS typedef struct { ECell parent; - int border; - int n_states; + gint border; + gint n_states; GdkPixbuf **images; - int height; + gint height; } ECellToggle; typedef struct { @@ -53,9 +53,9 @@ typedef struct { } ECellToggleClass; GType e_cell_toggle_get_type (void); -ECell *e_cell_toggle_new (int border, int n_states, GdkPixbuf **images); -void e_cell_toggle_construct (ECellToggle *etog, int border, - int n_states, GdkPixbuf **images); +ECell *e_cell_toggle_new (gint border, gint n_states, GdkPixbuf **images); +void e_cell_toggle_construct (ECellToggle *etog, gint border, + gint n_states, GdkPixbuf **images); G_END_DECLS diff --git a/widgets/table/e-cell-tree.c b/widgets/table/e-cell-tree.c index e9cb30bb23..759fd6f70b 100644 --- a/widgets/table/e-cell-tree.c +++ b/widgets/table/e-cell-tree.c @@ -76,25 +76,25 @@ e_cell_tree_view_get_subcell_view (ECellView *ect) } static ETreePath -e_cell_tree_get_node (ETableModel *table_model, int row) +e_cell_tree_get_node (ETableModel *table_model, gint row) { return e_table_model_value_at (table_model, -1, row); } static ETreeModel* -e_cell_tree_get_tree_model (ETableModel *table_model, int row) +e_cell_tree_get_tree_model (ETableModel *table_model, gint row) { return e_table_model_value_at (table_model, -2, row); } static ETreeTableAdapter * -e_cell_tree_get_tree_table_adapter (ETableModel *table_model, int row) +e_cell_tree_get_tree_table_adapter (ETableModel *table_model, gint row) { return e_table_model_value_at (table_model, -3, row); } static int -visible_depth_of_node (ETableModel *model, int row) +visible_depth_of_node (ETableModel *model, gint row) { ETreeModel *tree_model = e_cell_tree_get_tree_model(model, row); ETreeTableAdapter *adapter = e_cell_tree_get_tree_table_adapter(model, row); @@ -107,7 +107,7 @@ visible_depth_of_node (ETableModel *model, int row) if the path is not expandable, then max_width needs to change as well. */ static gint -offset_of_node (ETableModel *table_model, int row) +offset_of_node (ETableModel *table_model, gint row) { ETreeModel *tree_model = e_cell_tree_get_tree_model(table_model, row); ETreePath path = e_cell_tree_get_node(table_model, row); @@ -124,7 +124,7 @@ offset_of_node (ETableModel *table_model, int row) * ECell::new_view method */ static ECellView * -ect_new_view (ECell *ecell, ETableModel *table_model, void *e_table_item_view) +ect_new_view (ECell *ecell, ETableModel *table_model, gpointer e_table_item_view) { ECellTree *ect = E_CELL_TREE (ecell); ECellTreeView *tree_view = g_new0 (ECellTreeView, 1); @@ -209,7 +209,7 @@ static void draw_retro_expander (ECellTreeView *ectv, GdkDrawable *drawable, gboolean expanded, GdkRectangle *rect) { GdkPixbuf *image; - int image_width, image_height; + gint image_width, image_height; ECellTree *ect = E_CELL_TREE(ectv->cell_view.ecell); image = expanded ? ect->open_pixbuf : ect->closed_pixbuf; @@ -243,8 +243,8 @@ draw_expander (ECellTreeView *ectv, GdkDrawable *drawable, GtkExpanderStyle expa */ static void ect_draw (ECellView *ecell_view, GdkDrawable *drawable, - int model_col, int view_col, int row, ECellFlags flags, - int x1, int y1, int x2, int y2) + gint model_col, gint view_col, gint row, ECellFlags flags, + gint x1, gint y1, gint x2, gint y2) { ECellTreeView *tree_view = (ECellTreeView *)ecell_view; ETreeModel *tree_model = e_cell_tree_get_tree_model(ecell_view->e_table_model, row); @@ -256,14 +256,14 @@ ect_draw (ECellView *ecell_view, GdkDrawable *drawable, GdkColor *foreground; gboolean selected; - int offset, subcell_offset; + gint offset, subcell_offset; selected = flags & E_CELL_SELECTED; /* only draw the tree effects if we're the active sort */ if (/* XXX */ TRUE) { GdkPixbuf *node_image; - int node_image_width = 0, node_image_height = 0; + gint node_image_width = 0, node_image_height = 0; ETreePath parent_node; ETree *tree = E_TREE (canvas->parent); @@ -307,7 +307,7 @@ ect_draw (ECellView *ecell_view, GdkDrawable *drawable, /* draw our lines */ if (tree_view->retro_look && E_CELL_TREE(tree_view->cell_view.ecell)->draw_lines) { - int depth; + gint depth; if (visible_depth_of_node (ecell_view->e_table_model, row) > 0 || e_tree_model_node_get_children (tree_model, node, NULL) > 0) @@ -428,7 +428,7 @@ event_in_expander (GdkEvent *event, gint offset, gint height) * ECell::height method */ static int -ect_height (ECellView *ecell_view, int model_col, int view_col, int row) +ect_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) { ECellTreeView *tree_view = (ECellTreeView *) ecell_view; @@ -468,13 +468,13 @@ animate_expander (gpointer data) * ECell::event method */ static gint -ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, int row, ECellFlags flags, ECellActions *actions) +ect_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col, gint row, ECellFlags flags, ECellActions *actions) { ECellTreeView *tree_view = (ECellTreeView *) ecell_view; ETreeModel *tree_model = e_cell_tree_get_tree_model (ecell_view->e_table_model, row); ETreeTableAdapter *etta = e_cell_tree_get_tree_table_adapter(ecell_view->e_table_model, row); ETreePath node = e_cell_tree_get_node (ecell_view->e_table_model, row); - int offset = offset_of_node (ecell_view->e_table_model, row); + gint offset = offset_of_node (ecell_view->e_table_model, row); gint result; switch (event->type) { @@ -489,7 +489,7 @@ ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, gint tmp_row = row; GdkRectangle area; animate_closure_t *closure = g_new0 (animate_closure_t, 1); - int hgt; + gint hgt; e_table_item_get_cell_geometry (tree_view->cell_view.e_table_item_view, &tmp_row, &view_col, &area.x, &area.y, NULL, &area.height); @@ -568,14 +568,14 @@ ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, * ECell::max_width method */ static int -ect_max_width (ECellView *ecell_view, int model_col, int view_col) +ect_max_width (ECellView *ecell_view, gint model_col, gint view_col) { ECellTreeView *tree_view = (ECellTreeView *) ecell_view; - int row; - int number_of_rows; - int max_width = 0; - int width = 0; - int subcell_max_width = 0; + gint row; + gint number_of_rows; + gint max_width = 0; + gint width = 0; + gint subcell_max_width = 0; gboolean per_row = e_cell_max_width_by_row_implemented (tree_view->subcell_view); number_of_rows = e_table_model_row_count (ecell_view->e_table_model); @@ -587,9 +587,9 @@ ect_max_width (ECellView *ecell_view, int model_col, int view_col) ETreeModel *tree_model = e_cell_tree_get_tree_model(ecell_view->e_table_model, row); ETreePath node; GdkPixbuf *node_image; - int node_image_width = 0; + gint node_image_width = 0; - int offset, subcell_offset; + gint offset, subcell_offset; #if 0 gboolean expanded, expandable; ETreeTableAdapter *tree_table_adapter = e_cell_tree_get_tree_table_adapter(ecell_view->e_table_model, row); @@ -642,13 +642,13 @@ ect_max_width (ECellView *ecell_view, int model_col, int view_col) * ECellView::show_tooltip method */ static void -ect_show_tooltip (ECellView *ecell_view, int model_col, int view_col, int row, - int col_width, ETableTooltip *tooltip) +ect_show_tooltip (ECellView *ecell_view, gint model_col, gint view_col, gint row, + gint col_width, ETableTooltip *tooltip) { ECellTreeView *tree_view = (ECellTreeView *) ecell_view; ETreeModel *tree_model = e_cell_tree_get_tree_model (ecell_view->e_table_model, row); ETreePath node = e_cell_tree_get_node (ecell_view->e_table_model, row); - int offset = offset_of_node (ecell_view->e_table_model, row); + gint offset = offset_of_node (ecell_view->e_table_model, row); GdkPixbuf *node_image; node_image = e_tree_model_icon_at (tree_model, node); @@ -662,8 +662,8 @@ ect_show_tooltip (ECellView *ecell_view, int model_col, int view_col, int row, /* * ECellView::get_bg_color method */ -static char * -ect_get_bg_color (ECellView *ecell_view, int row) +static gchar * +ect_get_bg_color (ECellView *ecell_view, gint row) { ECellTreeView *tree_view = (ECellTreeView *) ecell_view; @@ -673,8 +673,8 @@ ect_get_bg_color (ECellView *ecell_view, int row) /* * ECellView::enter_edit method */ -static void * -ect_enter_edit (ECellView *ecell_view, int model_col, int view_col, int row) +static gpointer +ect_enter_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row) { /* just defer to our subcell's view */ ECellTreeView *tree_view = (ECellTreeView *) ecell_view; @@ -686,7 +686,7 @@ ect_enter_edit (ECellView *ecell_view, int model_col, int view_col, int row) * ECellView::leave_edit method */ static void -ect_leave_edit (ECellView *ecell_view, int model_col, int view_col, int row, void *edit_context) +ect_leave_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer edit_context) { /* just defer to our subcell's view */ ECellTreeView *tree_view = (ECellTreeView *) ecell_view; @@ -696,7 +696,7 @@ ect_leave_edit (ECellView *ecell_view, int model_col, int view_col, int row, voi static void ect_print (ECellView *ecell_view, GtkPrintContext *context, - int model_col, int view_col, int row, + gint model_col, gint view_col, gint row, double width, double height) { ECellTreeView *tree_view = (ECellTreeView *) ecell_view; @@ -708,14 +708,14 @@ ect_print (ECellView *ecell_view, GtkPrintContext *context, ETreeModel *tree_model = e_cell_tree_get_tree_model (ecell_view->e_table_model, row); ETreeTableAdapter *tree_table_adapter = e_cell_tree_get_tree_table_adapter(ecell_view->e_table_model, row); ETreePath node = e_cell_tree_get_node (ecell_view->e_table_model, row); - int offset = offset_of_node (ecell_view->e_table_model, row); - int subcell_offset = offset; + gint offset = offset_of_node (ecell_view->e_table_model, row); + gint subcell_offset = offset; gboolean expandable = e_tree_model_node_is_expandable (tree_model, node); gboolean expanded = e_tree_table_adapter_node_is_expanded (tree_table_adapter, node); /* draw our lines */ if (E_CELL_TREE(tree_view->cell_view.ecell)->draw_lines) { - int depth; + gint depth; if (!e_tree_model_node_is_root (tree_model, node) || e_tree_model_node_get_children (tree_model, node, NULL) > 0) { @@ -791,7 +791,7 @@ ect_print (ECellView *ecell_view, GtkPrintContext *context, static gdouble ect_print_height (ECellView *ecell_view, GtkPrintContext *context, - int model_col, int view_col, int row, + gint model_col, gint view_col, gint row, double width) { return 12; /* XXX */ @@ -878,11 +878,11 @@ e_cell_tree_construct (ECellTree *ect, if (open_pixbuf) ect->open_pixbuf = open_pixbuf; else - ect->open_pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **)tree_expanded_xpm); + ect->open_pixbuf = gdk_pixbuf_new_from_xpm_data ((const gchar **)tree_expanded_xpm); if (closed_pixbuf) ect->closed_pixbuf = closed_pixbuf; else - ect->closed_pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **)tree_unexpanded_xpm); + ect->closed_pixbuf = gdk_pixbuf_new_from_xpm_data ((const gchar **)tree_unexpanded_xpm); ect->draw_lines = draw_lines; } diff --git a/widgets/table/e-cell-vbox.c b/widgets/table/e-cell-vbox.c index 7fb74c9ae1..1f3dc32087 100644 --- a/widgets/table/e-cell-vbox.c +++ b/widgets/table/e-cell-vbox.c @@ -44,11 +44,11 @@ G_DEFINE_TYPE (ECellVbox, e_cell_vbox, E_CELL_TYPE) * ECell::new_view method */ static ECellView * -ecv_new_view (ECell *ecell, ETableModel *table_model, void *e_table_item_view) +ecv_new_view (ECell *ecell, ETableModel *table_model, gpointer e_table_item_view) { ECellVbox *ecv = E_CELL_VBOX (ecell); ECellVboxView *vbox_view = g_new0 (ECellVboxView, 1); - int i; + gint i; vbox_view->cell_view.ecell = ecell; vbox_view->cell_view.e_table_model = table_model; @@ -76,7 +76,7 @@ static void ecv_kill_view (ECellView *ecv) { ECellVboxView *vbox_view = (ECellVboxView *) ecv; - int i; + gint i; if (vbox_view->cell_view.kill_view_cb) (vbox_view->cell_view.kill_view_cb)(ecv, vbox_view->cell_view.kill_view_cb_data); @@ -100,7 +100,7 @@ static void ecv_realize (ECellView *ecell_view) { ECellVboxView *vbox_view = (ECellVboxView *) ecell_view; - int i; + gint i; /* realize our subcell view */ for (i = 0; i < vbox_view->subcell_view_count; i++) @@ -117,7 +117,7 @@ static void ecv_unrealize (ECellView *ecv) { ECellVboxView *vbox_view = (ECellVboxView *) ecv; - int i; + gint i; /* unrealize our subcell view. */ for (i = 0; i < vbox_view->subcell_view_count; i++) @@ -132,18 +132,18 @@ ecv_unrealize (ECellView *ecv) */ static void ecv_draw (ECellView *ecell_view, GdkDrawable *drawable, - int model_col, int view_col, int row, ECellFlags flags, - int x1, int y1, int x2, int y2) + gint model_col, gint view_col, gint row, ECellFlags flags, + gint x1, gint y1, gint x2, gint y2) { ECellVboxView *vbox_view = (ECellVboxView *)ecell_view; - int subcell_offset = 0; - int i; + gint subcell_offset = 0; + gint i; for (i = 0; i < vbox_view->subcell_view_count; i++) { /* Now cause our subcells to draw their contents, shifted by subcell_offset pixels */ - int height = e_cell_height (vbox_view->subcell_views[i], vbox_view->model_cols[i], view_col, row); + gint height = e_cell_height (vbox_view->subcell_views[i], vbox_view->model_cols[i], view_col, row); e_cell_draw (vbox_view->subcell_views[i], drawable, vbox_view->model_cols[i], view_col, row, flags, x1, y1 + subcell_offset, x2, y1 + subcell_offset + height); @@ -156,12 +156,12 @@ ecv_draw (ECellView *ecell_view, GdkDrawable *drawable, * ECell::event method */ static gint -ecv_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, int row, ECellFlags flags, ECellActions *actions) +ecv_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col, gint row, ECellFlags flags, ECellActions *actions) { ECellVboxView *vbox_view = (ECellVboxView *)ecell_view; - int y = 0; - int i; - int subcell_offset = 0; + gint y = 0; + gint i; + gint subcell_offset = 0; switch (event->type) { case GDK_BUTTON_PRESS: @@ -180,7 +180,7 @@ ecv_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, for (i = 0; i < vbox_view->subcell_view_count; i++) { - int height = e_cell_height (vbox_view->subcell_views[i], vbox_view->model_cols[i], view_col, row); + gint height = e_cell_height (vbox_view->subcell_views[i], vbox_view->model_cols[i], view_col, row); if (y < subcell_offset + height) return e_cell_event(vbox_view->subcell_views[i], event, vbox_view->model_cols[i], view_col, row, flags, actions); subcell_offset += height; @@ -192,11 +192,11 @@ ecv_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, * ECell::height method */ static int -ecv_height (ECellView *ecell_view, int model_col, int view_col, int row) +ecv_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) { ECellVboxView *vbox_view = (ECellVboxView *)ecell_view; - int height = 0; - int i; + gint height = 0; + gint i; for (i = 0; i < vbox_view->subcell_view_count; i++) { height += e_cell_height (vbox_view->subcell_views[i], vbox_view->model_cols[i], view_col, row); @@ -208,14 +208,14 @@ ecv_height (ECellView *ecell_view, int model_col, int view_col, int row) * ECell::max_width method */ static int -ecv_max_width (ECellView *ecell_view, int model_col, int view_col) +ecv_max_width (ECellView *ecell_view, gint model_col, gint view_col) { ECellVboxView *vbox_view = (ECellVboxView *)ecell_view; - int max_width = 0; - int i; + gint max_width = 0; + gint i; for (i = 0; i < vbox_view->subcell_view_count; i++) { - int width = e_cell_max_width (vbox_view->subcell_views[i], vbox_view->model_cols[i], view_col); + gint width = e_cell_max_width (vbox_view->subcell_views[i], vbox_view->model_cols[i], view_col); max_width = MAX(width, max_width); } @@ -227,13 +227,13 @@ ecv_max_width (ECellView *ecell_view, int model_col, int view_col) * ECellView::show_tooltip method */ static void -ecv_show_tooltip (ECellView *ecell_view, int model_col, int view_col, int row, - int col_width, ETableTooltip *tooltip) +ecv_show_tooltip (ECellView *ecell_view, gint model_col, gint view_col, gint row, + gint col_width, ETableTooltip *tooltip) { ECellVboxView *vbox_view = (ECellVboxView *) ecell_view; EVboxModel *vbox_model = e_cell_vbox_get_vbox_model (ecell_view->e_table_model, row); EVboxPath node = e_cell_vbox_get_node (ecell_view->e_table_model, row); - int offset = offset_of_node (ecell_view->e_table_model, row); + gint offset = offset_of_node (ecell_view->e_table_model, row); GdkPixbuf *node_image; node_image = e_vbox_model_icon_at (vbox_model, node); @@ -247,8 +247,8 @@ ecv_show_tooltip (ECellView *ecell_view, int model_col, int view_col, int row, /* * ECellView::get_bg_color method */ -static char * -ecv_get_bg_color (ECellView *ecell_view, int row) +static gchar * +ecv_get_bg_color (ECellView *ecell_view, gint row) { ECellVboxView *vbox_view = (ECellVboxView *) ecell_view; @@ -258,8 +258,8 @@ ecv_get_bg_color (ECellView *ecell_view, int row) /* * ECellView::enter_edit method */ -static void * -ecv_enter_edit (ECellView *ecell_view, int model_col, int view_col, int row) +static gpointer +ecv_enter_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row) { /* just defer to our subcell's view */ ECellVboxView *vbox_view = (ECellVboxView *) ecell_view; @@ -271,7 +271,7 @@ ecv_enter_edit (ECellView *ecell_view, int model_col, int view_col, int row) * ECellView::leave_edit method */ static void -ecv_leave_edit (ECellView *ecell_view, int model_col, int view_col, int row, void *edit_context) +ecv_leave_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer edit_context) { /* just defer to our subcell's view */ ECellVboxView *vbox_view = (ECellVboxView *) ecell_view; @@ -281,7 +281,7 @@ ecv_leave_edit (ECellView *ecell_view, int model_col, int view_col, int row, voi static void ecv_print (ECellView *ecell_view, GnomePrintContext *context, - int model_col, int view_col, int row, + gint model_col, gint view_col, gint row, double width, double height) { ECellVboxView *vbox_view = (ECellVboxView *) ecell_view; @@ -290,14 +290,14 @@ ecv_print (ECellView *ecell_view, GnomePrintContext *context, EVboxModel *vbox_model = e_cell_vbox_get_vbox_model (ecell_view->e_table_model, row); EVboxTableAdapter *vbox_table_adapter = e_cell_vbox_get_vbox_table_adapter(ecell_view->e_table_model, row); EVboxPath node = e_cell_vbox_get_node (ecell_view->e_table_model, row); - int offset = offset_of_node (ecell_view->e_table_model, row); - int subcell_offset = offset; + gint offset = offset_of_node (ecell_view->e_table_model, row); + gint subcell_offset = offset; gboolean expandable = e_vbox_model_node_is_expandable (vbox_model, node); gboolean expanded = e_vbox_table_adapter_node_is_expanded (vbox_table_adapter, node); /* draw our lines */ if (E_CELL_VBOX(vbox_view->cell_view.ecell)->draw_lines) { - int depth; + gint depth; if (!e_vbox_model_node_is_root (vbox_model, node) || e_vbox_model_node_get_children (vbox_model, node, NULL) > 0) { @@ -348,7 +348,7 @@ ecv_print (ECellView *ecell_view, GnomePrintContext *context, GdkPixbuf *image = (expanded ? E_CELL_VBOX(vbox_view->cell_view.ecell)->open_pixbuf : E_CELL_VBOX(vbox_view->cell_view.ecell)->closed_pixbuf); - int image_width, image_height, image_rowstride; + gint image_width, image_height, image_rowstride; guchar *image_pixels; image_width = gdk_pixbuf_get_width(image); @@ -379,7 +379,7 @@ ecv_print (ECellView *ecell_view, GnomePrintContext *context, static gdouble ecv_print_height (ECellView *ecell_view, GnomePrintContext *context, - int model_col, int view_col, int row, + gint model_col, gint view_col, gint row, double width) { return 12; /* XXX */ @@ -393,7 +393,7 @@ static void ecv_dispose (GObject *object) { ECellVbox *ecv = E_CELL_VBOX (object); - int i; + gint i; /* destroy our subcell */ for (i = 0; i < ecv->subcell_count; i++) @@ -473,7 +473,7 @@ e_cell_vbox_new (void) } void -e_cell_vbox_append (ECellVbox *vbox, ECell *subcell, int model_col) +e_cell_vbox_append (ECellVbox *vbox, ECell *subcell, gint model_col) { vbox->subcell_count ++; diff --git a/widgets/table/e-cell-vbox.h b/widgets/table/e-cell-vbox.h index ae774dbb7c..58aa523c58 100644 --- a/widgets/table/e-cell-vbox.h +++ b/widgets/table/e-cell-vbox.h @@ -43,16 +43,16 @@ G_BEGIN_DECLS typedef struct { ECell parent; - int subcell_count; + gint subcell_count; ECell **subcells; - int *model_cols; + gint *model_cols; } ECellVbox; typedef struct { ECellView cell_view; - int subcell_view_count; + gint subcell_view_count; ECellView **subcell_views; - int *model_cols; + gint *model_cols; } ECellVboxView; typedef struct { @@ -63,7 +63,7 @@ GType e_cell_vbox_get_type (void); ECell *e_cell_vbox_new (void); void e_cell_vbox_append (ECellVbox *vbox, ECell *subcell, - int model_col); + gint model_col); G_END_DECLS diff --git a/widgets/table/e-cell.c b/widgets/table/e-cell.c index 41ffe86685..1152a42e1a 100644 --- a/widgets/table/e-cell.c +++ b/widgets/table/e-cell.c @@ -33,7 +33,7 @@ G_DEFINE_TYPE (ECell, e_cell, GTK_TYPE_OBJECT) #define ECVIEW_EC_CLASS(v) (E_CELL_GET_CLASS (v->ecell)) static ECellView * -ec_new_view (ECell *ecell, ETableModel *table_model, void *e_table_item_view) +ec_new_view (ECell *ecell, ETableModel *table_model, gpointer e_table_item_view) { return NULL; } @@ -55,14 +55,14 @@ ec_unrealize (ECellView *e_cell) static void ec_draw (ECellView *ecell_view, GdkDrawable *drawable, - int model_col, int view_col, int row, ECellFlags flags, - int x1, int y1, int x2, int y2) + gint model_col, gint view_col, gint row, ECellFlags flags, + gint x1, gint y1, gint x2, gint y2) { g_critical ("e-cell-draw invoked"); } static gint -ec_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, int row, ECellFlags flags, ECellActions *actions) +ec_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col, gint row, ECellFlags flags, ECellActions *actions) { g_critical ("e-cell-event invoked"); @@ -70,7 +70,7 @@ ec_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, i } static gint -ec_height (ECellView *ecell_view, int model_col, int view_col, int row) +ec_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) { g_critical ("e-cell-height invoked"); @@ -78,7 +78,7 @@ ec_height (ECellView *ecell_view, int model_col, int view_col, int row) } static void -ec_focus (ECellView *ecell_view, int model_col, int view_col, int row, int x1, int y1, int x2, int y2) +ec_focus (ECellView *ecell_view, gint model_col, gint view_col, gint row, gint x1, gint y1, gint x2, gint y2) { ecell_view->focus_col = view_col; ecell_view->focus_row = row; @@ -99,35 +99,35 @@ ec_unfocus (ECellView *ecell_view) ecell_view->focus_y2 = -1; } -static void * -ec_enter_edit (ECellView *ecell_view, int model_col, int view_col, int row) +static gpointer +ec_enter_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row) { return NULL; } static void -ec_leave_edit (ECellView *ecell_view, int model_col, int view_col, int row, void *context) +ec_leave_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer context) { } -static void * -ec_save_state (ECellView *ecell_view, int model_col, int view_col, int row, void *context) +static gpointer +ec_save_state (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer context) { return NULL; } static void -ec_load_state (ECellView *ecell_view, int model_col, int view_col, int row, void *context, void *save_state) +ec_load_state (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer context, gpointer save_state) { } static void -ec_free_state (ECellView *ecell_view, int model_col, int view_col, int row, void *save_state) +ec_free_state (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer save_state) { } static void -ec_show_tooltip (ECellView *ecell_view, int model_col, int view_col, int row, int col_width, ETableTooltip *tooltip) +ec_show_tooltip (ECellView *ecell_view, gint model_col, gint view_col, gint row, gint col_width, ETableTooltip *tooltip) { /* Do nothing */ } @@ -176,7 +176,7 @@ e_cell_init (ECell *cell) * Returns: processing state from the GdkEvent handling. */ gint -e_cell_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, int row, ECellFlags flags, ECellActions *actions) +e_cell_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col, gint row, ECellFlags flags, ECellActions *actions) { return ECVIEW_EC_CLASS(ecell_view)->event ( ecell_view, event, model_col, view_col, row, flags, actions); @@ -198,7 +198,7 @@ e_cell_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_co * Returns: a new ECellView for this @ecell on the @table_model displayed on the @e_table_item_view. */ ECellView * -e_cell_new_view (ECell *ecell, ETableModel *table_model, void *e_table_item_view) +e_cell_new_view (ECell *ecell, ETableModel *table_model, gpointer e_table_item_view) { return E_CELL_GET_CLASS (ecell)->new_view ( ecell, table_model, e_table_item_view); @@ -265,8 +265,8 @@ e_cell_unrealize (ECellView *ecell_view) */ void e_cell_draw (ECellView *ecell_view, GdkDrawable *drawable, - int model_col, int view_col, int row, ECellFlags flags, - int x1, int y1, int x2, int y2) + gint model_col, gint view_col, gint row, ECellFlags flags, + gint x1, gint y1, gint x2, gint y2) { g_return_if_fail (ecell_view != NULL); g_return_if_fail (row >= 0); @@ -289,7 +289,7 @@ e_cell_draw (ECellView *ecell_view, GdkDrawable *drawable, */ void e_cell_print (ECellView *ecell_view, GtkPrintContext *context, - int model_col, int view_col, int row, + gint model_col, gint view_col, gint row, double width, double height) { if (ECVIEW_EC_CLASS(ecell_view)->print) @@ -303,7 +303,7 @@ e_cell_print (ECellView *ecell_view, GtkPrintContext *context, */ gdouble e_cell_print_height (ECellView *ecell_view, GtkPrintContext *context, - int model_col, int view_col, int row, + gint model_col, gint view_col, gint row, double width) { if (ECVIEW_EC_CLASS(ecell_view)->print_height) @@ -323,8 +323,8 @@ e_cell_print_height (ECellView *ecell_view, GtkPrintContext *context, * Returns: the height of the cell at @model_col, @row rendered at * @view_col, @row. */ -int -e_cell_height (ECellView *ecell_view, int model_col, int view_col, int row) +gint +e_cell_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) { return ECVIEW_EC_CLASS(ecell_view)->height (ecell_view, model_col, view_col, row); } @@ -339,8 +339,8 @@ e_cell_height (ECellView *ecell_view, int model_col, int view_col, int row) * Notifies the ECellView that it is about to enter editing mode for * @model_col, @row rendered at @view_col, @row. */ -void * -e_cell_enter_edit (ECellView *ecell_view, int model_col, int view_col, int row) +gpointer +e_cell_enter_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row) { return ECVIEW_EC_CLASS(ecell_view)->enter_edit (ecell_view, model_col, view_col, row); } @@ -357,7 +357,7 @@ e_cell_enter_edit (ECellView *ecell_view, int model_col, int view_col, int row) * rendered at @view_col, @row. */ void -e_cell_leave_edit (ECellView *ecell_view, int model_col, int view_col, int row, void *edit_context) +e_cell_leave_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer edit_context) { ECVIEW_EC_CLASS(ecell_view)->leave_edit (ecell_view, model_col, view_col, row, edit_context); } @@ -372,12 +372,12 @@ e_cell_leave_edit (ECellView *ecell_view, int model_col, int view_col, int row, * * Returns: The save state. * - * Requests that the ECellView return a void * representing the state + * Requests that the ECellView return a gpointer representing the state * of the ECell. This is primarily intended for things like selection * or scrolling. */ -void * -e_cell_save_state (ECellView *ecell_view, int model_col, int view_col, int row, void *edit_context) +gpointer +e_cell_save_state (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer edit_context) { if (ECVIEW_EC_CLASS(ecell_view)->save_state) return ECVIEW_EC_CLASS(ecell_view)->save_state (ecell_view, model_col, view_col, row, edit_context); @@ -397,7 +397,7 @@ e_cell_save_state (ECellView *ecell_view, int model_col, int view_col, int row, * Requests that the ECellView load from the given save state. */ void -e_cell_load_state (ECellView *ecell_view, int model_col, int view_col, int row, void *edit_context, void *save_state) +e_cell_load_state (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer edit_context, gpointer save_state) { if (ECVIEW_EC_CLASS(ecell_view)->load_state) ECVIEW_EC_CLASS(ecell_view)->load_state (ecell_view, model_col, view_col, row, edit_context, save_state); @@ -415,7 +415,7 @@ e_cell_load_state (ECellView *ecell_view, int model_col, int view_col, int row, * Requests that the ECellView free the given save state. */ void -e_cell_free_state (ECellView *ecell_view, int model_col, int view_col, int row, void *save_state) +e_cell_free_state (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer save_state) { if (ECVIEW_EC_CLASS(ecell_view)->free_state) ECVIEW_EC_CLASS(ecell_view)->free_state (ecell_view, model_col, view_col, row, save_state); @@ -430,8 +430,8 @@ e_cell_free_state (ECellView *ecell_view, int model_col, int view_col, int row, * Returns: the maximum width for the ECellview at @model_col which * is being rendered as @view_col */ -int -e_cell_max_width (ECellView *ecell_view, int model_col, int view_col) +gint +e_cell_max_width (ECellView *ecell_view, gint model_col, gint view_col) { return ECVIEW_EC_CLASS(ecell_view)->max_width (ecell_view, model_col, view_col); @@ -447,8 +447,8 @@ e_cell_max_width (ECellView *ecell_view, int model_col, int view_col) * Returns: the maximum width for the ECellview at @model_col which * is being rendered as @view_col for the data in @row. */ -int -e_cell_max_width_by_row (ECellView *ecell_view, int model_col, int view_col, int row) +gint +e_cell_max_width_by_row (ECellView *ecell_view, gint model_col, gint view_col, gint row) { if (ECVIEW_EC_CLASS(ecell_view)->max_width_by_row) return ECVIEW_EC_CLASS(ecell_view)->max_width_by_row @@ -474,15 +474,15 @@ e_cell_max_width_by_row_implemented (ECellView *ecell_view) } void -e_cell_show_tooltip (ECellView *ecell_view, int model_col, int view_col, - int row, int col_width, ETableTooltip *tooltip) +e_cell_show_tooltip (ECellView *ecell_view, gint model_col, gint view_col, + gint row, gint col_width, ETableTooltip *tooltip) { ECVIEW_EC_CLASS(ecell_view)->show_tooltip (ecell_view, model_col, view_col, row, col_width, tooltip); } gchar * -e_cell_get_bg_color(ECellView *ecell_view, int row) +e_cell_get_bg_color(ECellView *ecell_view, gint row) { if (ECVIEW_EC_CLASS(ecell_view)->get_bg_color) return ECVIEW_EC_CLASS(ecell_view)->get_bg_color (ecell_view, row); diff --git a/widgets/table/e-cell.h b/widgets/table/e-cell.h index 5a0005095e..614e1ebe0e 100644 --- a/widgets/table/e-cell.h +++ b/widgets/table/e-cell.h @@ -38,7 +38,7 @@ G_BEGIN_DECLS #define E_IS_CELL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_CELL_TYPE)) typedef gboolean (*ETableSearchFunc) (gconstpointer haystack, - const char *needle); + const gchar *needle); typedef enum { E_CELL_SELECTED = 1 << 0, @@ -87,35 +87,35 @@ typedef struct _ECellView { typedef struct { GtkObjectClass parent_class; - ECellView *(*new_view) (ECell *ecell, ETableModel *table_model, void *e_table_item_view); + ECellView *(*new_view) (ECell *ecell, ETableModel *table_model, gpointer e_table_item_view); void (*kill_view) (ECellView *ecell_view); void (*realize) (ECellView *ecell_view); void (*unrealize) (ECellView *ecell_view); void (*draw) (ECellView *ecell_view, GdkDrawable *drawable, - int model_col, int view_col, int row, - ECellFlags flags, int x1, int y1, int x2, int y2); - gint (*event) (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, int row, ECellFlags flags, ECellActions *actions); - void (*focus) (ECellView *ecell_view, int model_col, int view_col, - int row, int x1, int y1, int x2, int y2); + gint model_col, gint view_col, gint row, + ECellFlags flags, gint x1, gint y1, gint x2, gint y2); + gint (*event) (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col, gint row, ECellFlags flags, ECellActions *actions); + void (*focus) (ECellView *ecell_view, gint model_col, gint view_col, + gint row, gint x1, gint y1, gint x2, gint y2); void (*unfocus) (ECellView *ecell_view); - int (*height) (ECellView *ecell_view, int model_col, int view_col, int row); + gint (*height) (ECellView *ecell_view, gint model_col, gint view_col, gint row); - void *(*enter_edit) (ECellView *ecell_view, int model_col, int view_col, int row); - void (*leave_edit) (ECellView *ecell_view, int model_col, int view_col, int row, void *context); - void *(*save_state) (ECellView *ecell_view, int model_col, int view_col, int row, void *context); - void (*load_state) (ECellView *ecell_view, int model_col, int view_col, int row, void *context, void *save_state); - void (*free_state) (ECellView *ecell_view, int model_col, int view_col, int row, void *save_state); + void *(*enter_edit) (ECellView *ecell_view, gint model_col, gint view_col, gint row); + void (*leave_edit) (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer context); + void *(*save_state) (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer context); + void (*load_state) (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer context, gpointer save_state); + void (*free_state) (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer save_state); void (*print) (ECellView *ecell_view, GtkPrintContext *context, - int model_col, int view_col, int row, + gint model_col, gint view_col, gint row, gdouble width, gdouble height); gdouble (*print_height) (ECellView *ecell_view,GtkPrintContext *context, - int model_col, int view_col, int row, gdouble width); - int (*max_width) (ECellView *ecell_view, int model_col, int view_col); - int (*max_width_by_row) (ECellView *ecell_view, int model_col, int view_col, int row); - void (*show_tooltip) (ECellView *ecell_view, int model_col, int view_col, int row, int col_width, ETableTooltip *tooltip); - gchar *(*get_bg_color) (ECellView *ecell_view, int row); + gint model_col, gint view_col, gint row, gdouble width); + gint (*max_width) (ECellView *ecell_view, gint model_col, gint view_col); + gint (*max_width_by_row) (ECellView *ecell_view, gint model_col, gint view_col, gint row); + void (*show_tooltip) (ECellView *ecell_view, gint model_col, gint view_col, gint row, gint col_width, ETableTooltip *tooltip); + gchar *(*get_bg_color) (ECellView *ecell_view, gint row); void (*style_set) (ECellView *ecell_view, GtkStyle *previous_style); } ECellClass; @@ -131,92 +131,92 @@ void e_cell_kill_view (ECellView *ecell_view); /* Cell View methods. */ gint e_cell_event (ECellView *ecell_view, GdkEvent *event, - int model_col, - int view_col, - int row, + gint model_col, + gint view_col, + gint row, ECellFlags flags, ECellActions *actions); void e_cell_realize (ECellView *ecell_view); void e_cell_unrealize (ECellView *ecell_view); void e_cell_draw (ECellView *ecell_view, GdkDrawable *drawable, - int model_col, - int view_col, - int row, + gint model_col, + gint view_col, + gint row, ECellFlags flags, - int x1, - int y1, - int x2, - int y2); + gint x1, + gint y1, + gint x2, + gint y2); void e_cell_print (ECellView *ecell_view, GtkPrintContext *context, - int model_col, - int view_col, - int row, + gint model_col, + gint view_col, + gint row, double width, double height); gdouble e_cell_print_height (ECellView *ecell_view, GtkPrintContext *context, - int model_col, - int view_col, - int row, + gint model_col, + gint view_col, + gint row, gdouble width); -int e_cell_max_width (ECellView *ecell_view, - int model_col, - int view_col); -int e_cell_max_width_by_row (ECellView *ecell_view, - int model_col, - int view_col, - int row); +gint e_cell_max_width (ECellView *ecell_view, + gint model_col, + gint view_col); +gint e_cell_max_width_by_row (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row); gboolean e_cell_max_width_by_row_implemented (ECellView *ecell_view); void e_cell_show_tooltip (ECellView *ecell_view, - int model_col, - int view_col, - int row, - int col_width, + gint model_col, + gint view_col, + gint row, + gint col_width, ETableTooltip *tooltip); gchar *e_cell_get_bg_color (ECellView *ecell_view, - int row); + gint row); void e_cell_style_set (ECellView *ecell_view, GtkStyle *previous_style); void e_cell_focus (ECellView *ecell_view, - int model_col, - int view_col, - int row, - int x1, - int y1, - int x2, - int y2); + gint model_col, + gint view_col, + gint row, + gint x1, + gint y1, + gint x2, + gint y2); void e_cell_unfocus (ECellView *ecell_view); -int e_cell_height (ECellView *ecell_view, - int model_col, - int view_col, - int row); +gint e_cell_height (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row); void *e_cell_enter_edit (ECellView *ecell_view, - int model_col, - int view_col, - int row); + gint model_col, + gint view_col, + gint row); void e_cell_leave_edit (ECellView *ecell_view, - int model_col, - int view_col, - int row, + gint model_col, + gint view_col, + gint row, void *edit_context); void *e_cell_save_state (ECellView *ecell_view, - int model_col, - int view_col, - int row, + gint model_col, + gint view_col, + gint row, void *edit_context); void e_cell_load_state (ECellView *ecell_view, - int model_col, - int view_col, - int row, + gint model_col, + gint view_col, + gint row, void *edit_context, void *state); void e_cell_free_state (ECellView *ecell_view, - int model_col, - int view_col, - int row, + gint model_col, + gint view_col, + gint row, void *state); G_END_DECLS diff --git a/widgets/table/e-table-click-to-add.c b/widgets/table/e-table-click-to-add.c index 1c608bd607..13d55db84c 100644 --- a/widgets/table/e-table-click-to-add.c +++ b/widgets/table/e-table-click-to-add.c @@ -314,7 +314,7 @@ etcta_unrealize (GnomeCanvasItem *item) static void finish_editing (ETableClickToAdd *etcta); static int -item_key_press (ETableItem *item, int row, int col, GdkEvent *event, ETableClickToAdd *etcta) +item_key_press (ETableItem *item, gint row, gint col, GdkEvent *event, ETableClickToAdd *etcta) { switch (event->key.keyval) { case GDK_Return: @@ -451,7 +451,7 @@ etcta_event (GnomeCanvasItem *item, GdkEvent *e) } static void -etcta_reflow (GnomeCanvasItem *item, int flags) +etcta_reflow (GnomeCanvasItem *item, gint flags) { ETableClickToAdd *etcta = E_TABLE_CLICK_TO_ADD (item); diff --git a/widgets/table/e-table-click-to-add.h b/widgets/table/e-table-click-to-add.h index 31dded1989..17ac7f7fe3 100644 --- a/widgets/table/e-table-click-to-add.h +++ b/widgets/table/e-table-click-to-add.h @@ -46,7 +46,7 @@ typedef struct { ETableModel *model; /* The backend model. */ ETableHeader *eth; /* This is just to give to the ETableItem. */ - char *message; + gchar *message; GnomeCanvasItem *row; /* If row is NULL, we're sitting with no data and a "Click here" message. */ GnomeCanvasItem *text; /* If text is NULL, row shouldn't be. */ diff --git a/widgets/table/e-table-col.c b/widgets/table/e-table-col.c index d844f53c45..de1cc48b18 100644 --- a/widgets/table/e-table-col.c +++ b/widgets/table/e-table-col.c @@ -139,8 +139,8 @@ e_table_col_init (ETableCol *etc) * Returns: the newly created ETableCol object. */ ETableCol * -e_table_col_new (int col_idx, const char *text, double expansion, int min_width, - ECell *ecell, GCompareFunc compare, gboolean resizable, gboolean disabled, int priority) +e_table_col_new (gint col_idx, const gchar *text, double expansion, gint min_width, + ECell *ecell, GCompareFunc compare, gboolean resizable, gboolean disabled, gint priority) { ETableCol *etc; @@ -200,8 +200,8 @@ e_table_col_new (int col_idx, const char *text, double expansion, int min_width, * Returns: the newly created ETableCol object. */ ETableCol * -e_table_col_new_with_pixbuf (int col_idx, const char *text, GdkPixbuf *pixbuf, double expansion, int min_width, - ECell *ecell, GCompareFunc compare, gboolean resizable, gboolean disabled, int priority) +e_table_col_new_with_pixbuf (gint col_idx, const gchar *text, GdkPixbuf *pixbuf, double expansion, gint min_width, + ECell *ecell, GCompareFunc compare, gboolean resizable, gboolean disabled, gint priority) { ETableCol *etc; diff --git a/widgets/table/e-table-col.h b/widgets/table/e-table-col.h index f7d892d317..8e514675d5 100644 --- a/widgets/table/e-table-col.h +++ b/widgets/table/e-table-col.h @@ -47,23 +47,23 @@ typedef enum { */ typedef struct { GObject base; - char *text; + gchar *text; GdkPixbuf *pixbuf; - int min_width; - int width; + gint min_width; + gint width; double expansion; short x; GCompareFunc compare; ETableSearchFunc search; - unsigned int is_pixbuf:1; - unsigned int selected:1; - unsigned int resizable:1; - unsigned int disabled:1; - unsigned int sortable:1; - unsigned int groupable:1; - int col_idx; - int compare_col; - int priority; + guint is_pixbuf:1; + guint selected:1; + guint resizable:1; + guint disabled:1; + guint sortable:1; + guint groupable:1; + gint col_idx; + gint compare_col; + gint priority; GtkJustification justification; @@ -75,25 +75,25 @@ typedef struct { } ETableColClass; GType e_table_col_get_type (void); -ETableCol *e_table_col_new (int col_idx, - const char *text, +ETableCol *e_table_col_new (gint col_idx, + const gchar *text, double expansion, - int min_width, + gint min_width, ECell *ecell, GCompareFunc compare, gboolean resizable, gboolean disabled, - int priority); -ETableCol *e_table_col_new_with_pixbuf (int col_idx, - const char *text, + gint priority); +ETableCol *e_table_col_new_with_pixbuf (gint col_idx, + const gchar *text, GdkPixbuf *pixbuf, double expansion, - int min_width, + gint min_width, ECell *ecell, GCompareFunc compare, gboolean resizable, gboolean disabled, - int priority); + gint priority); G_END_DECLS diff --git a/widgets/table/e-table-column-specification.c b/widgets/table/e-table-column-specification.c index c48451587f..0f6acd7fc6 100644 --- a/widgets/table/e-table-column-specification.c +++ b/widgets/table/e-table-column-specification.c @@ -106,21 +106,21 @@ e_table_column_specification_load_from_node (ETableColumnSpecification *etcs, { free_strings(etcs); - etcs->model_col = e_xml_get_integer_prop_by_name (node, (const unsigned char *)"model_col"); - etcs->compare_col = e_xml_get_integer_prop_by_name_with_default (node, (const unsigned char *)"compare_col", etcs->model_col); - etcs->title = e_xml_get_string_prop_by_name (node, (const unsigned char *)"_title"); - etcs->pixbuf = e_xml_get_string_prop_by_name (node, (const unsigned char *)"pixbuf"); - - etcs->expansion = e_xml_get_double_prop_by_name (node, (const unsigned char *)"expansion"); - etcs->minimum_width = e_xml_get_integer_prop_by_name (node, (const unsigned char *)"minimum_width"); - etcs->resizable = e_xml_get_bool_prop_by_name (node, (const unsigned char *)"resizable"); - etcs->disabled = e_xml_get_bool_prop_by_name (node, (const unsigned char *)"disabled"); - - etcs->cell = e_xml_get_string_prop_by_name (node, (const unsigned char *)"cell"); - etcs->compare = e_xml_get_string_prop_by_name (node, (const unsigned char *)"compare"); - etcs->search = e_xml_get_string_prop_by_name (node, (const unsigned char *)"search"); - etcs->sortable = e_xml_get_string_prop_by_name (node, (const unsigned char *)"sortable"); - etcs->priority = e_xml_get_integer_prop_by_name_with_default (node, (const unsigned char *)"priority", 0); + etcs->model_col = e_xml_get_integer_prop_by_name (node, (const guchar *)"model_col"); + etcs->compare_col = e_xml_get_integer_prop_by_name_with_default (node, (const guchar *)"compare_col", etcs->model_col); + etcs->title = e_xml_get_string_prop_by_name (node, (const guchar *)"_title"); + etcs->pixbuf = e_xml_get_string_prop_by_name (node, (const guchar *)"pixbuf"); + + etcs->expansion = e_xml_get_double_prop_by_name (node, (const guchar *)"expansion"); + etcs->minimum_width = e_xml_get_integer_prop_by_name (node, (const guchar *)"minimum_width"); + etcs->resizable = e_xml_get_bool_prop_by_name (node, (const guchar *)"resizable"); + etcs->disabled = e_xml_get_bool_prop_by_name (node, (const guchar *)"disabled"); + + etcs->cell = e_xml_get_string_prop_by_name (node, (const guchar *)"cell"); + etcs->compare = e_xml_get_string_prop_by_name (node, (const guchar *)"compare"); + etcs->search = e_xml_get_string_prop_by_name (node, (const guchar *)"search"); + etcs->sortable = e_xml_get_string_prop_by_name (node, (const guchar *)"sortable"); + etcs->priority = e_xml_get_integer_prop_by_name_with_default (node, (const guchar *)"priority", 0); if (etcs->title == NULL) etcs->title = g_strdup(""); @@ -132,26 +132,26 @@ e_table_column_specification_save_to_node (ETableColumnSpecification *specificat { xmlNode *node; if (parent) - node = xmlNewChild(parent, NULL, (const unsigned char *)"ETableColumn", NULL); + node = xmlNewChild(parent, NULL, (const guchar *)"ETableColumn", NULL); else - node = xmlNewNode(NULL, (const unsigned char *)"ETableColumn"); + node = xmlNewNode(NULL, (const guchar *)"ETableColumn"); - e_xml_set_integer_prop_by_name(node, (const unsigned char *)"model_col", specification->model_col); + e_xml_set_integer_prop_by_name(node, (const guchar *)"model_col", specification->model_col); if (specification->compare_col != specification->model_col) - e_xml_set_integer_prop_by_name(node, (const unsigned char *)"compare_col", specification->compare_col); - e_xml_set_string_prop_by_name(node, (const unsigned char *)"_title", specification->title); - e_xml_set_string_prop_by_name(node, (const unsigned char *)"pixbuf", specification->pixbuf); - - e_xml_set_double_prop_by_name(node, (const unsigned char *)"expansion", specification->expansion); - e_xml_set_integer_prop_by_name(node, (const unsigned char *)"minimum_width", specification->minimum_width); - e_xml_set_bool_prop_by_name(node, (const unsigned char *)"resizable", specification->resizable); - e_xml_set_bool_prop_by_name(node, (const unsigned char *)"disabled", specification->disabled); - - e_xml_set_string_prop_by_name(node, (const unsigned char *)"cell", specification->cell); - e_xml_set_string_prop_by_name(node, (const unsigned char *)"compare", specification->compare); - e_xml_set_string_prop_by_name(node, (const unsigned char *)"search", specification->search); + e_xml_set_integer_prop_by_name(node, (const guchar *)"compare_col", specification->compare_col); + e_xml_set_string_prop_by_name(node, (const guchar *)"_title", specification->title); + e_xml_set_string_prop_by_name(node, (const guchar *)"pixbuf", specification->pixbuf); + + e_xml_set_double_prop_by_name(node, (const guchar *)"expansion", specification->expansion); + e_xml_set_integer_prop_by_name(node, (const guchar *)"minimum_width", specification->minimum_width); + e_xml_set_bool_prop_by_name(node, (const guchar *)"resizable", specification->resizable); + e_xml_set_bool_prop_by_name(node, (const guchar *)"disabled", specification->disabled); + + e_xml_set_string_prop_by_name(node, (const guchar *)"cell", specification->cell); + e_xml_set_string_prop_by_name(node, (const guchar *)"compare", specification->compare); + e_xml_set_string_prop_by_name(node, (const guchar *)"search", specification->search); if (specification->priority != 0) - e_xml_set_integer_prop_by_name (node, (const unsigned char *)"priority", specification->priority); + e_xml_set_integer_prop_by_name (node, (const guchar *)"priority", specification->priority); return node; } diff --git a/widgets/table/e-table-column-specification.h b/widgets/table/e-table-column-specification.h index 688e194825..7ea6f23dc4 100644 --- a/widgets/table/e-table-column-specification.h +++ b/widgets/table/e-table-column-specification.h @@ -38,21 +38,21 @@ G_BEGIN_DECLS typedef struct { GObject base; - int model_col; - int compare_col; - char *title; - char *pixbuf; + gint model_col; + gint compare_col; + gchar *title; + gchar *pixbuf; double expansion; - int minimum_width; + gint minimum_width; guint resizable : 1; guint disabled : 1; - char *cell; - char *compare; - char *search; - char *sortable; - int priority; + gchar *cell; + gchar *compare; + gchar *search; + gchar *sortable; + gint priority; } ETableColumnSpecification; typedef struct { diff --git a/widgets/table/e-table-column.c b/widgets/table/e-table-column.c index d2180d88e5..0969a79410 100644 --- a/widgets/table/e-table-column.c +++ b/widgets/table/e-table-column.c @@ -38,7 +38,7 @@ static void e_table_column_finalize (GObject *object) { ETableColumn *etc = E_TABLE_COLUMN (object); - const int cols = etc->col_count; + const gint cols = etc->col_count; /* * Destroy listeners @@ -82,7 +82,7 @@ e_table_column_class_init (GtkObjectClass *object_class) } static void -etc_do_insert (ETableColumn *etc, int pos, ETableCol *val) +etc_do_insert (ETableColumn *etc, gint pos, ETableCol *val) { memcpy (&etc->columns [pos+1], &etc->columns [pos], sizeof (ETableCol *) * (etc->col_count - pos)); @@ -90,7 +90,7 @@ etc_do_insert (ETableColumn *etc, int pos, ETableCol *val) } void -e_table_column_add_column (ETableColumn *etc, ETableCol *tc, int pos) +e_table_column_add_column (ETableColumn *etc, ETableCol *tc, gint pos) { ETableCol **new_ptr; @@ -109,7 +109,7 @@ e_table_column_add_column (ETableColumn *etc, ETableCol *tc, int pos) } ETableCol * -e_table_column_get_column (ETableColumn *etc, int column) +e_table_column_get_column (ETableColumn *etc, gint column) { g_return_val_if_fail (etc != NULL, NULL); g_return_val_if_fail (E_IS_TABLE_COLUMN (etc), NULL); @@ -123,7 +123,7 @@ e_table_column_get_column (ETableColumn *etc, int column) return etc->columns [column]; } -int +gint e_table_column_count (ETableColumn *etc) { g_return_val_if_fail (etc != NULL, 0); @@ -132,10 +132,10 @@ e_table_column_count (ETableColumn *etc) return etc->col_count; } -int -e_table_column_index (ETableColumn *etc, const char *identifier) +gint +e_table_column_index (ETableColumn *etc, const gchar *identifier) { - int i; + gint i; g_return_val_if_fail (etc != NULL, 0); g_return_val_if_fail (E_IS_TABLE_COLUMN (etc), 0); @@ -151,10 +151,10 @@ e_table_column_index (ETableColumn *etc, const char *identifier) return -1; } -int -e_table_column_get_index_at (ETableColumn *etc, int x_offset) +gint +e_table_column_get_index_at (ETableColumn *etc, gint x_offset) { - int i, total; + gint i, total; g_return_val_if_fail (etc != NULL, 0); g_return_val_if_fail (E_IS_TABLE_COLUMN (etc), 0); @@ -175,7 +175,7 @@ ETableCol ** e_table_column_get_columns (ETableColumn *etc) { ETableCol **ret; - int i; + gint i; g_return_val_if_fail (etc != NULL, 0); g_return_val_if_fail (E_IS_TABLE_COLUMN (etc), 0); @@ -196,11 +196,11 @@ e_table_column_selection_ok (ETableColumn *etc) return etc->selectable; } -int +gint ve_table_column_get_selected (ETableColumn *etc) { - int i; - int selected = 0; + gint i; + gint selected = 0; g_return_val_if_fail (etc != NULL, 0); g_return_val_if_fail (E_IS_TABLE_COLUMN (etc), 0); @@ -213,10 +213,10 @@ ve_table_column_get_selected (ETableColumn *etc) return selected; } -int +gint e_table_column_total_width (ETableColumn *etc) { - int total; + gint total; g_return_val_if_fail (etc != NULL, 0); g_return_val_if_fail (E_IS_TABLE_COLUMN (etc), 0); @@ -229,7 +229,7 @@ e_table_column_total_width (ETableColumn *etc) } static void -etc_do_remove (ETableColumn *etc, int idx) +etc_do_remove (ETableColumn *etc, gint idx) { memcpy (&etc->columns [idx], &etc->columns [idx+1], sizeof (ETableCol *) * etc->col_count - idx); @@ -237,7 +237,7 @@ etc_do_remove (ETableColumn *etc, int idx) } void -e_table_column_move (ETableColumn *etc, int source_index, int target_index) +e_table_column_move (ETableColumn *etc, gint source_index, gint target_index) { g_return_if_fail (etc != NULL); g_return_if_fail (E_IS_TABLE_COLUMN (etc)); @@ -253,7 +253,7 @@ e_table_column_move (ETableColumn *etc, int source_index, int target_index) } void -e_table_column_remove (ETableColumn *etc, int idx) +e_table_column_remove (ETableColumn *etc, gint idx) { g_return_if_fail (etc != NULL); g_return_if_fail (E_IS_TABLE_COLUMN (etc)); @@ -270,7 +270,7 @@ e_table_column_set_selection (ETableColumn *etc, gboolean allow_selection); } void -e_table_column_set_size (ETableColumn *etc, int idx, int size) +e_table_column_set_size (ETableColumn *etc, gint idx, gint size) { g_return_if_fail (etc != NULL); g_return_if_fail (E_IS_TABLE_COLUMN (etc)); diff --git a/widgets/table/e-table-config-field.c b/widgets/table/e-table-config-field.c index 6d3e5611da..0fd82bf0ed 100644 --- a/widgets/table/e-table-config-field.c +++ b/widgets/table/e-table-config-field.c @@ -120,7 +120,7 @@ etcf_truncate (ETableConfigField *etcf) static void etcf_set_sensitivity(ETableConfigField *etcf) { - int count = etcf_get_count(etcf); + gint count = etcf_get_count(etcf); if (etcf->n >= count) { gtk_widget_set_sensitive(etcf->radio_ascending, FALSE); @@ -138,7 +138,7 @@ etcf_set_sensitivity(ETableConfigField *etcf) static void toggled(GtkWidget *widget, ETableConfigField *etcf) { - int count; + gint count; count = etcf_get_count(etcf); if (count > etcf->n) { @@ -176,11 +176,11 @@ changed(GtkWidget *widget, ETableConfigField *etcf) static void etcf_setup(ETableConfigField *etcf) { - int count; + gint count; GList *list = NULL; ETableColumnSpecification **column; ETableColumnSpecification *chosen_column = NULL; - int model_col = -1; + gint model_col = -1; etcf_set_sensitivity(etcf); @@ -228,7 +228,7 @@ e_table_config_field_construct_nth (ETableConfigField *etcf, ETableSpecification *spec, ETableSortInfo *sort_info, gboolean grouping, - int n) + gint n) { GtkWidget *frame; GtkWidget *internal_hbox; diff --git a/widgets/table/e-table-config-field.h b/widgets/table/e-table-config-field.h index 9fbd21d694..eb13da90ab 100644 --- a/widgets/table/e-table-config-field.h +++ b/widgets/table/e-table-config-field.h @@ -41,7 +41,7 @@ typedef struct { ETableSpecification *spec; ETableSortInfo *sort_info; guint grouping : 1; - int n; + gint n; GtkWidget *combo; GtkWidget *radio_ascending; diff --git a/widgets/table/e-table-config.c b/widgets/table/e-table-config.c index d9506d0a9f..1fba29f580 100644 --- a/widgets/table/e-table-config.c +++ b/widgets/table/e-table-config.c @@ -233,7 +233,7 @@ configure_combo_box_set_active (GtkComboBox *combo_box, const gchar *value) } static ETableColumnSpecification * -find_column_in_spec (ETableSpecification *spec, int model_col) +find_column_in_spec (ETableSpecification *spec, gint model_col) { ETableColumnSpecification **column; @@ -250,7 +250,7 @@ find_column_in_spec (ETableSpecification *spec, int model_col) } static int -find_model_column_by_name (ETableSpecification *spec, const char *s) +find_model_column_by_name (ETableSpecification *spec, const gchar *s) { ETableColumnSpecification **column; @@ -268,7 +268,7 @@ static void update_sort_and_group_config_dialog (ETableConfig *config, gboolean is_sort) { ETableConfigSortWidgets *widgets; - int count, i; + gint count, i; if (is_sort){ count = e_table_sort_info_sorting_get_count ( @@ -362,7 +362,7 @@ config_sort_info_update (ETableConfig *config) { ETableSortInfo *info = config->state->sort_info; GString *res; - int count, i; + gint count, i; count = e_table_sort_info_sorting_get_count (info); res = g_string_new (""); @@ -401,7 +401,7 @@ config_group_info_update (ETableConfig *config) { ETableSortInfo *info = config->state->sort_info; GString *res; - int count, i; + gint count, i; if (!e_table_sort_info_get_can_group (info)) return; @@ -439,7 +439,7 @@ config_group_info_update (ETableConfig *config) static void setup_fields (ETableConfig *config) { - int i; + gint i; e_table_model_freeze ((ETableModel *)config->available_model); e_table_model_freeze ((ETableModel *)config->shown_model); @@ -466,7 +466,7 @@ config_fields_info_update (ETableConfig *config) { ETableColumnSpecification **column; GString *res = g_string_new (""); - int i, j; + gint i, j; for (i = 0; i < config->state->col_count; i++){ for (j = 0, column = config->source_spec->columns; *column; column++, j++){ @@ -493,7 +493,7 @@ static void do_sort_and_group_config_dialog (ETableConfig *config, gboolean is_sort) { GtkDialog *dialog; - int response, running = 1; + gint response, running = 1; config->temp_state = e_table_state_duplicate (config->state); @@ -554,7 +554,7 @@ do_sort_and_group_config_dialog (ETableConfig *config, gboolean is_sort) static void do_fields_config_dialog (ETableConfig *config) { - int response, running = 1; + gint response, running = 1; gtk_widget_ensure_style (config->dialog_show_fields); gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (config->dialog_show_fields)->vbox), 0); @@ -604,12 +604,12 @@ static ETableModel *global_store; /* Glade better not be reentrant any time soo static void create_global_store (ETableConfig *config) { - int i; + gint i; global_store = e_table_memory_store_new (store_columns); for (i = 0; config->source_spec->columns[i]; i++) { - char *text; + gchar *text; if (config->source_spec->columns[i]->disabled) continue; @@ -693,7 +693,7 @@ dialog_destroyed (gpointer data, GObject *where_object_was) } static void -dialog_response (GtkWidget *dialog, int response_id, ETableConfig *config) +dialog_response (GtkWidget *dialog, gint response_id, ETableConfig *config) { if (response_id == GTK_RESPONSE_APPLY || response_id == GTK_RESPONSE_OK) { @@ -741,7 +741,7 @@ e_table_proxy_gtk_combo_text_new (void) #if 0 static GtkWidget * -configure_dialog (GladeXML *gui, const char *widget_name, ETableConfig *config) +configure_dialog (GladeXML *gui, const gchar *widget_name, ETableConfig *config) { GtkWidget *w; @@ -752,7 +752,7 @@ configure_dialog (GladeXML *gui, const char *widget_name, ETableConfig *config) #endif static void -connect_button (ETableConfig *config, GladeXML *gui, const char *widget_name, GCallback cback) +connect_button (ETableConfig *config, GladeXML *gui, const gchar *widget_name, GCallback cback) { GtkWidget *button = glade_xml_get_widget (gui, widget_name); @@ -779,14 +779,14 @@ sort_combo_changed (GtkComboBox *combo_box, ETableConfigSortWidgets *sort) ETableConfig *config = sort->e_table_config; ETableSortInfo *sort_info = config->temp_state->sort_info; ETableConfigSortWidgets *base = &config->sort[0]; - int idx = sort - base; + gint idx = sort - base; gchar *s; s = configure_combo_box_get_active (combo_box); if (s != NULL) { ETableSortColumn c; - int col; + gint col; col = find_model_column_by_name (config->source_spec, s); if (col == -1){ @@ -815,7 +815,7 @@ sort_ascending_toggled (GtkToggleButton *t, ETableConfigSortWidgets *sort) ETableConfig *config = sort->e_table_config; ETableSortInfo *si = config->temp_state->sort_info; ETableConfigSortWidgets *base = &config->sort[0]; - int idx = sort - base; + gint idx = sort - base; ETableSortColumn c; c = e_table_sort_info_sorting_get_nth (si, idx); @@ -827,10 +827,10 @@ static void configure_sort_dialog (ETableConfig *config, GladeXML *gui) { GSList *l; - int i; + gint i; for (i = 0; i < 4; i++){ - char buffer [80]; + gchar buffer [80]; snprintf (buffer, sizeof (buffer), "sort-combo-%d", i + 1); config->sort [i].combo = glade_xml_get_widget (gui, buffer); @@ -858,7 +858,7 @@ configure_sort_dialog (ETableConfig *config, GladeXML *gui) } for (l = config->column_names; l; l = l->next){ - char *label = l->data; + gchar *label = l->data; for (i = 0; i < 4; i++){ configure_combo_box_add ( @@ -889,14 +889,14 @@ group_combo_changed (GtkComboBox *combo_box, ETableConfigSortWidgets *group) ETableConfig *config = group->e_table_config; ETableSortInfo *sort_info = config->temp_state->sort_info; ETableConfigSortWidgets *base = &config->group[0]; - int idx = group - base; + gint idx = group - base; gchar *s; s = configure_combo_box_get_active (combo_box); if (s != NULL) { ETableSortColumn c; - int col; + gint col; col = find_model_column_by_name (config->source_spec, s); if (col == -1){ @@ -925,7 +925,7 @@ group_ascending_toggled (GtkToggleButton *t, ETableConfigSortWidgets *group) ETableConfig *config = group->e_table_config; ETableSortInfo *si = config->temp_state->sort_info; ETableConfigSortWidgets *base = &config->group[0]; - int idx = group - base; + gint idx = group - base; ETableSortColumn c; c = e_table_sort_info_grouping_get_nth (si, idx); @@ -937,10 +937,10 @@ static void configure_group_dialog (ETableConfig *config, GladeXML *gui) { GSList *l; - int i; + gint i; for (i = 0; i < 4; i++){ - char buffer [80]; + gchar buffer [80]; snprintf (buffer, sizeof (buffer), "group-combo-%d", i + 1); config->group [i].combo = glade_xml_get_widget (gui, buffer); @@ -976,7 +976,7 @@ configure_group_dialog (ETableConfig *config, GladeXML *gui) for (l = config->column_names; l; l = l->next){ - char *label = l->data; + gchar *label = l->data; for (i = 0; i < 4; i++){ configure_combo_box_add ( @@ -1002,7 +1002,7 @@ configure_group_dialog (ETableConfig *config, GladeXML *gui) } static void -add_column (int model_row, gpointer closure) +add_column (gint model_row, gpointer closure) { GList **columns = closure; *columns = g_list_prepend (*columns, GINT_TO_POINTER (model_row)); @@ -1013,8 +1013,8 @@ config_button_add (GtkWidget *widget, ETableConfig *config) { GList *columns = NULL; GList *column; - int count; - int i; + gint count; + gint i; e_table_selected_row_foreach (config->available, add_column, &columns); columns = g_list_reverse (columns); @@ -1045,7 +1045,7 @@ config_button_remove (GtkWidget *widget, ETableConfig *config) e_table_selected_row_foreach (config->shown, add_column, &columns); for (column = columns; column; column = column->next) { - int row = GPOINTER_TO_INT (column->data); + gint row = GPOINTER_TO_INT (column->data); memmove (config->temp_state->columns + row, config->temp_state->columns + row + 1, sizeof (int) * (config->temp_state->col_count - row - 1)); memmove (config->temp_state->expansions + row, config->temp_state->expansions + row + 1, sizeof (double) * (config->temp_state->col_count - row - 1)); @@ -1064,11 +1064,11 @@ config_button_up (GtkWidget *widget, ETableConfig *config) { GList *columns = NULL; GList *column; - int *new_shown; + gint *new_shown; double *new_expansions; - int next_col; + gint next_col; double next_expansion; - int i; + gint i; e_table_selected_row_foreach (config->shown, add_column, &columns); @@ -1119,11 +1119,11 @@ config_button_down (GtkWidget *widget, ETableConfig *config) { GList *columns = NULL; GList *column; - int *new_shown; + gint *new_shown; double *new_expansions; - int next_col; + gint next_col; double next_expansion; - int i; + gint i; e_table_selected_row_foreach (config->shown, add_column, &columns); @@ -1274,7 +1274,7 @@ e_table_config_init (ETableConfig *config) ETableConfig * e_table_config_construct (ETableConfig *config, - const char *header, + const gchar *header, ETableSpecification *spec, ETableState *state, GtkWindow *parent_window) @@ -1298,7 +1298,7 @@ e_table_config_construct (ETableConfig *config, config->domain = g_strdup (spec->domain); for (column = config->source_spec->columns; *column; column++){ - char *label = (*column)->title; + gchar *label = (*column)->title; if ((*column)->disabled) continue; @@ -1330,7 +1330,7 @@ e_table_config_construct (ETableConfig *config, * Returns: The config object. */ ETableConfig * -e_table_config_new (const char *header, +e_table_config_new (const gchar *header, ETableSpecification *spec, ETableState *state, GtkWindow *parent_window) diff --git a/widgets/table/e-table-config.h b/widgets/table/e-table-config.h index d5366bf999..72357fb8f6 100644 --- a/widgets/table/e-table-config.h +++ b/widgets/table/e-table-config.h @@ -47,14 +47,14 @@ typedef struct { GtkWidget *radio_descending; GtkWidget *view_check; /* Only for group dialog */ guint changed_id, toggled_id; - void *e_table_config; + gpointer e_table_config; } ETableConfigSortWidgets; typedef struct { GObject parent; - char *header; + gchar *header; /* * Our various dialog boxes @@ -81,7 +81,7 @@ typedef struct { ETableWithout *available_model; ETable *shown; ETableSubsetVariable *shown_model; - char *domain; + gchar *domain; /* * List of valid column names @@ -97,12 +97,12 @@ typedef struct { } ETableConfigClass; GType e_table_config_get_type (void); -ETableConfig *e_table_config_new (const char *header, +ETableConfig *e_table_config_new (const gchar *header, ETableSpecification *spec, ETableState *state, GtkWindow *parent_window); ETableConfig *e_table_config_construct (ETableConfig *etco, - const char *header, + const gchar *header, ETableSpecification *spec, ETableState *state, GtkWindow *parent_window); diff --git a/widgets/table/e-table-example-2.c b/widgets/table/e-table-example-2.c index ac12886813..ca4128590c 100644 --- a/widgets/table/e-table-example-2.c +++ b/widgets/table/e-table-example-2.c @@ -43,10 +43,10 @@ the ETableSimple class. Instead of creating your own ETableModel class, you simply create a new object of the ETableSimple class. You give it a bunch of functions that act as callbacks. -You also get to pass a void * to ETableSimple and it gets passed to +You also get to pass a gpointer to ETableSimple and it gets passed to your callbacks. This would be for having multiple models of the same type. This is just an example though, so we statically define all the -data and ignore the void *data parameter. +data and ignore the gpointer data parameter. In our example we will be creating a table model with 6 columns and 10 rows. This corresponds to having 6 different types of information and @@ -100,7 +100,7 @@ The headers will be hard coded, as will be the example data. <grouping> <leaf column=\"1\" ascending=\"true\"/> </grouping> \ </ETableSpecification>" -char *headers[VIEW_COLS] = { +gchar *headers[VIEW_COLS] = { "Email", "Full Name", "Address", @@ -119,7 +119,7 @@ char *headers[VIEW_COLS] = { Importance field. */ -char *table_data[ROWS][VIEW_COLS]; +gchar *table_data[ROWS][VIEW_COLS]; gboolean importance_data[ROWS]; /* @@ -134,19 +134,19 @@ static GdkColor *color1; static GdkColor *color2; static int -my_col_count (ETableModel *etc, void *data) +my_col_count (ETableModel *etc, gpointer data) { return VIRTUAL_COLS; } static int -my_row_count (ETableModel *etc, void *data) +my_row_count (ETableModel *etc, gpointer data) { return ROWS; } -static void * -my_value_at (ETableModel *etc, int col, int row, void *data) +static gpointer +my_value_at (ETableModel *etc, gint col, gint row, gpointer data) { if (col == COLOR_COLUMN){ if (importance_data[row]){ @@ -157,12 +157,12 @@ my_value_at (ETableModel *etc, int col, int row, void *data) } else if (col == IMPORTANCE_COLUMN){ return (gpointer) importance_data[row]; } else { - return (void *) table_data [row][col]; + return (gpointer) table_data [row][col]; } } static void -my_set_value_at (ETableModel *etc, int col, int row, const void *val, void *data) +my_set_value_at (ETableModel *etc, gint col, gint row, gconstpointer val, gpointer data) { if (col == COLOR_COLUMN){ } else if (col == IMPORTANCE_COLUMN){ @@ -174,7 +174,7 @@ my_set_value_at (ETableModel *etc, int col, int row, const void *val, void *data } static gboolean -my_is_cell_editable (ETableModel *etc, int col, int row, void *data) +my_is_cell_editable (ETableModel *etc, gint col, gint row, gpointer data) { if (col == IMPORTANCE_COLUMN) return FALSE; @@ -182,20 +182,20 @@ my_is_cell_editable (ETableModel *etc, int col, int row, void *data) return TRUE; } -static void * -my_duplicate_value (ETableModel *etc, int col, const void *value, void *data) +static gpointer +my_duplicate_value (ETableModel *etc, gint col, gconstpointer value, gpointer data) { if (col == COLOR_COLUMN){ - return (void *) value; + return (gpointer) value; } else if (col == IMPORTANCE_COLUMN){ - return (void *) value; + return (gpointer) value; } else { return g_strdup (value); } } static void -my_free_value (ETableModel *etc, int col, void *value, void *data) +my_free_value (ETableModel *etc, gint col, gpointer value, gpointer data) { if (col == COLOR_COLUMN){ } else if (col == IMPORTANCE_COLUMN){ @@ -204,8 +204,8 @@ my_free_value (ETableModel *etc, int col, void *value, void *data) } } -static void * -my_initialize_value (ETableModel *etc, int col, void *data) +static gpointer +my_initialize_value (ETableModel *etc, gint col, gpointer data) { if (col == COLOR_COLUMN){ return NULL; @@ -217,19 +217,19 @@ my_initialize_value (ETableModel *etc, int col, void *data) } static gboolean -my_value_is_empty (ETableModel *etc, int col, const void *value, void *data) +my_value_is_empty (ETableModel *etc, gint col, gconstpointer value, gpointer data) { if (col == COLOR_COLUMN){ return value == NULL; } else if (col == IMPORTANCE_COLUMN){ return value == NULL; } else { - return !(value && *(char *)value); + return !(value && *(gchar *)value); } } -static char * -my_value_to_string (ETableModel *etc, int col, const void *value, void *data) +static gchar * +my_value_to_string (ETableModel *etc, gint col, gconstpointer value, gpointer data) { if (col == COLOR_COLUMN){ return g_strdup_printf("%d", (int) value); @@ -248,7 +248,7 @@ create_table () ECell *cell_left_just; ECell *cell_checkbox; ETableHeader *e_table_header; - int i, j; + gint i, j; ETableModel *e_table_model = NULL; ETableCol *ecol; GdkPixbuf *pixbuf; @@ -333,8 +333,8 @@ create_table () -int -main (int argc, char *argv []) +gint +main (gint argc, gchar *argv []) { gnome_init ("TableExample", "TableExample", argc, argv); e_cursors_init (); diff --git a/widgets/table/e-table-extras.c b/widgets/table/e-table-extras.c index 0099b23656..78513792f8 100644 --- a/widgets/table/e-table-extras.c +++ b/widgets/table/e-table-extras.c @@ -83,8 +83,8 @@ ete_class_init (ETableExtrasClass *klass) static gint e_strint_compare(gconstpointer data1, gconstpointer data2) { - int int1 = atoi(data1); - int int2 = atoi(data2); + gint int1 = atoi(data1); + gint int2 = atoi(data2); return e_int_compare(GINT_TO_POINTER(int1), GINT_TO_POINTER(int2)); } @@ -124,9 +124,9 @@ g_utf8_strncasecmp (const gchar *s1, } static gboolean -e_string_search(gconstpointer haystack, const char *needle) +e_string_search(gconstpointer haystack, const gchar *needle) { - int length; + gint length; if (haystack == NULL) return FALSE; diff --git a/widgets/table/e-table-field-chooser-dialog.c b/widgets/table/e-table-field-chooser-dialog.c index 61dedd4e12..e3c059d748 100644 --- a/widgets/table/e-table-field-chooser-dialog.c +++ b/widgets/table/e-table-field-chooser-dialog.c @@ -208,7 +208,7 @@ e_table_field_chooser_dialog_get_property (GObject *object, guint prop_id, GValu } static void -e_table_field_chooser_dialog_response (GtkDialog *dialog, int id) +e_table_field_chooser_dialog_response (GtkDialog *dialog, gint id) { if (id == GTK_RESPONSE_OK) gtk_widget_destroy (GTK_WIDGET (dialog)); diff --git a/widgets/table/e-table-field-chooser-item.c b/widgets/table/e-table-field-chooser-item.c index 99b61f9ffa..9c62064b27 100644 --- a/widgets/table/e-table-field-chooser-item.c +++ b/widgets/table/e-table-field-chooser-item.c @@ -94,8 +94,8 @@ etfci_dispose (GObject *object) static gint etfci_find_button (ETableFieldChooserItem *etfci, double loc) { - int i; - int count; + gint i; + gint count; double height = 0; count = e_table_header_count(etfci->combined_header); @@ -115,9 +115,9 @@ etfci_find_button (ETableFieldChooserItem *etfci, double loc) static void etfci_rebuild_combined (ETableFieldChooserItem *etfci) { - int count; + gint count; GHashTable *hash; - int i; + gint i; if (etfci->combined_header != NULL) g_object_unref (etfci->combined_header); @@ -151,8 +151,8 @@ etfci_reflow (GnomeCanvasItem *item, gint flags) { ETableFieldChooserItem *etfci = E_TABLE_FIELD_CHOOSER_ITEM (item); double old_height; - int i; - int count; + gint i; + gint count; double height = 0; etfci_rebuild_combined (etfci); @@ -178,7 +178,7 @@ etfci_reflow (GnomeCanvasItem *item, gint flags) } static void -etfci_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, int flags) +etfci_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, gint flags) { ETableFieldChooserItem *etfci = E_TABLE_FIELD_CHOOSER_ITEM (item); double i2c [6]; @@ -255,7 +255,7 @@ full_header_structure_changed (ETableHeader *header, ETableFieldChooserItem *etf } static void -full_header_dimension_changed (ETableHeader *header, int col, ETableFieldChooserItem *etfci) +full_header_dimension_changed (ETableHeader *header, gint col, ETableFieldChooserItem *etfci) { e_canvas_item_request_reflow(GNOME_CANVAS_ITEM(etfci)); } @@ -305,7 +305,7 @@ table_header_structure_changed (ETableHeader *header, ETableFieldChooserItem *et } static void -table_header_dimension_changed (ETableHeader *header, int col, ETableFieldChooserItem *etfci) +table_header_dimension_changed (ETableHeader *header, gint col, ETableFieldChooserItem *etfci) { e_canvas_item_request_reflow(GNOME_CANVAS_ITEM(etfci)); } @@ -396,7 +396,7 @@ etfci_drag_data_get (GtkWidget *widget, gtk_selection_data_set(selection_data, GDK_SELECTION_TYPE_STRING, sizeof(string[0]), - (unsigned char *)string, + (guchar *)string, strlen(string)); g_free(string); } @@ -449,13 +449,13 @@ etfci_unrealize (GnomeCanvasItem *item) } static void -etfci_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int width, int height) +etfci_draw (GnomeCanvasItem *item, GdkDrawable *drawable, gint x, gint y, gint width, gint height) { ETableFieldChooserItem *etfci = E_TABLE_FIELD_CHOOSER_ITEM (item); GnomeCanvas *canvas = item->canvas; - int rows; - int y1, y2; - int row; + gint rows; + gint y1, y2; + gint row; GtkStyle *style; GtkStateType state; @@ -495,7 +495,7 @@ etfci_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int widt } static double -etfci_point (GnomeCanvasItem *item, double x, double y, int cx, int cy, +etfci_point (GnomeCanvasItem *item, double x, double y, gint cx, gint cy, GnomeCanvasItem **actual_item) { *actual_item = item; @@ -503,7 +503,7 @@ etfci_point (GnomeCanvasItem *item, double x, double y, int cx, int cy, } static gboolean -etfci_maybe_start_drag (ETableFieldChooserItem *etfci, int x, int y) +etfci_maybe_start_drag (ETableFieldChooserItem *etfci, gint x, gint y) { if (!etfci->maybe_drag) return FALSE; @@ -523,8 +523,8 @@ etfci_start_drag (ETableFieldChooserItem *etfci, GdkEvent *event, double x, doub GdkDragContext *context; ETableCol *ecol; GdkPixmap *pixmap; - int drag_col; - int button_height; + gint drag_col; + gint button_height; GtkTargetEntry etfci_drag_types [] = { { (gchar *) TARGET_ETABLE_COL_TYPE, 0, TARGET_ETABLE_COL_HEADER }, @@ -580,7 +580,7 @@ etfci_event (GnomeCanvasItem *item, GdkEvent *e) { ETableFieldChooserItem *etfci = E_TABLE_FIELD_CHOOSER_ITEM (item); GnomeCanvas *canvas = item->canvas; - int x, y; + gint x, y; switch (e->type){ case GDK_MOTION_NOTIFY: diff --git a/widgets/table/e-table-field-chooser-item.h b/widgets/table/e-table-field-chooser-item.h index 3b9937bf3c..d0cbbd9f75 100644 --- a/widgets/table/e-table-field-chooser-item.h +++ b/widgets/table/e-table-field-chooser-item.h @@ -49,8 +49,8 @@ typedef struct { /* * Ids */ - int full_header_structure_change_id, full_header_dimension_change_id; - int table_header_structure_change_id, table_header_dimension_change_id; + gint full_header_structure_change_id, full_header_dimension_change_id; + gint table_header_structure_change_id, table_header_dimension_change_id; gchar *dnd_code; @@ -58,8 +58,8 @@ typedef struct { * For dragging columns */ guint maybe_drag:1; - int click_x, click_y; - int drag_col; + gint click_x, click_y; + gint drag_col; guint drag_data_get_id; guint drag_end_id; } ETableFieldChooserItem; diff --git a/widgets/table/e-table-group-container.c b/widgets/table/e-table-group-container.c index 2d3d32e138..4975d6dee5 100644 --- a/widgets/table/e-table-group-container.c +++ b/widgets/table/e-table-group-container.c @@ -142,7 +142,7 @@ void e_table_group_container_construct (GnomeCanvasGroup *parent, ETableGroupContainer *etgc, ETableHeader *full_header, ETableHeader *header, - ETableModel *model, ETableSortInfo *sort_info, int n) + ETableModel *model, ETableSortInfo *sort_info, gint n) { ETableCol *col; ETableSortColumn column = e_table_sort_info_grouping_get_nth(sort_info, n); @@ -184,7 +184,7 @@ e_table_group_container_construct (GnomeCanvasGroup *parent, ETableGroupContaine ETableGroup * e_table_group_container_new (GnomeCanvasGroup *parent, ETableHeader *full_header, ETableHeader *header, - ETableModel *model, ETableSortInfo *sort_info, int n) + ETableModel *model, ETableSortInfo *sort_info, gint n) { ETableGroupContainer *etgc; @@ -359,56 +359,56 @@ compute_text (ETableGroupContainer *etgc, ETableGroupContainerChildNode *child_n } static void -child_cursor_change (ETableGroup *etg, int row, +child_cursor_change (ETableGroup *etg, gint row, ETableGroupContainer *etgc) { e_table_group_cursor_change (E_TABLE_GROUP (etgc), row); } static void -child_cursor_activated (ETableGroup *etg, int row, +child_cursor_activated (ETableGroup *etg, gint row, ETableGroupContainer *etgc) { e_table_group_cursor_activated (E_TABLE_GROUP (etgc), row); } static void -child_double_click (ETableGroup *etg, int row, int col, GdkEvent *event, +child_double_click (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETableGroupContainer *etgc) { e_table_group_double_click (E_TABLE_GROUP (etgc), row, col, event); } static gint -child_right_click (ETableGroup *etg, int row, int col, GdkEvent *event, +child_right_click (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETableGroupContainer *etgc) { return e_table_group_right_click (E_TABLE_GROUP (etgc), row, col, event); } static gint -child_click (ETableGroup *etg, int row, int col, GdkEvent *event, +child_click (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETableGroupContainer *etgc) { return e_table_group_click (E_TABLE_GROUP (etgc), row, col, event); } static gint -child_key_press (ETableGroup *etg, int row, int col, GdkEvent *event, +child_key_press (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETableGroupContainer *etgc) { return e_table_group_key_press (E_TABLE_GROUP (etgc), row, col, event); } static gint -child_start_drag (ETableGroup *etg, int row, int col, GdkEvent *event, +child_start_drag (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETableGroupContainer *etgc) { return e_table_group_start_drag (E_TABLE_GROUP (etgc), row, col, event); } static ETableGroupContainerChildNode * -create_child_node (ETableGroupContainer *etgc, void *val) +create_child_node (ETableGroupContainer *etgc, gpointer val) { ETableGroup *child; ETableGroupContainerChildNode *child_node; @@ -466,15 +466,15 @@ static void etgc_add (ETableGroup *etg, gint row) { ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); - void *val = e_table_model_value_at (etg->model, etgc->ecol->col_idx, row); + gpointer val = e_table_model_value_at (etg->model, etgc->ecol->col_idx, row); GCompareFunc comp = etgc->ecol->compare; GList *list = etgc->children; ETableGroup *child; ETableGroupContainerChildNode *child_node; - int i = 0; + gint i = 0; for (; list; list = g_list_next (list), i++){ - int comp_val; + gint comp_val; child_node = list->data; comp_val = (*comp)(child_node->key, val); @@ -504,12 +504,12 @@ etgc_add (ETableGroup *etg, gint row) } static void -etgc_add_array (ETableGroup *etg, const int *array, int count) +etgc_add_array (ETableGroup *etg, const gint *array, gint count) { - int i; + gint i; ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); - void *lastval = NULL; - int laststart = 0; + gpointer lastval = NULL; + gint laststart = 0; GCompareFunc comp = etgc->ecol->compare; ETableGroupContainerChildNode *child_node; ETableGroup *child; @@ -523,8 +523,8 @@ etgc_add_array (ETableGroup *etg, const int *array, int count) lastval = e_table_model_value_at (etg->model, etgc->ecol->col_idx, array[0]); for (i = 1; i < count; i++) { - void *val = e_table_model_value_at (etg->model, etgc->ecol->col_idx, array[i]); - int comp_val; + gpointer val = e_table_model_value_at (etg->model, etgc->ecol->col_idx, array[i]); + gint comp_val; comp_val = (*comp)(lastval, val); if (comp_val != 0) { @@ -558,8 +558,8 @@ etgc_add_all (ETableGroup *etg) { ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); ESorter *sorter = etgc->selection_model->sorter; - int *array; - int count; + gint *array; + gint count; e_sorter_get_sorted_to_model_array(sorter, &array, &count); @@ -661,7 +661,7 @@ etgc_get_focus_column (ETableGroup *etg) } static void -etgc_compute_location (ETableGroup *etg, int *x, int *y, int *row, int *col) +etgc_compute_location (ETableGroup *etg, gint *x, gint *y, gint *row, gint *col) { ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER(etg); @@ -687,7 +687,7 @@ etgc_compute_location (ETableGroup *etg, int *x, int *y, int *row, int *col) } static void -etgc_get_mouse_over (ETableGroup *etg, int *row, int *col) +etgc_get_mouse_over (ETableGroup *etg, gint *row, gint *col) { ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER(etg); @@ -697,7 +697,7 @@ etgc_get_mouse_over (ETableGroup *etg, int *row, int *col) *col = -1; if (etgc->children) { - int row_plus = 0; + gint row_plus = 0; GList *list; for (list = etgc->children; list; list = list->next) { @@ -718,11 +718,11 @@ etgc_get_mouse_over (ETableGroup *etg, int *row, int *col) } static void -etgc_get_cell_geometry (ETableGroup *etg, int *row, int *col, int *x, int *y, int *width, int *height) +etgc_get_cell_geometry (ETableGroup *etg, gint *row, gint *col, gint *x, gint *y, gint *width, gint *height) { ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER(etg); - int ypos; + gint ypos; ypos = 0; @@ -731,7 +731,7 @@ etgc_get_cell_geometry (ETableGroup *etg, int *row, int *col, int *x, int *y, in for (list = etgc->children; list; list = list->next) { ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *)list->data; ETableGroup *child = child_node->child; - int thisy; + gint thisy; e_table_group_get_cell_geometry (child, row, col, x, &thisy, width, height); ypos += thisy; @@ -1115,7 +1115,7 @@ etgc_init (ETableGroupContainer *container) } void -e_table_group_apply_to_leafs (ETableGroup *etg, ETableGroupLeafFn fn, void *closure) +e_table_group_apply_to_leafs (ETableGroup *etg, ETableGroupLeafFn fn, gpointer closure) { if (E_IS_TABLE_GROUP_CONTAINER (etg)){ ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); diff --git a/widgets/table/e-table-group-container.h b/widgets/table/e-table-group-container.h index 69791e376b..168b2f8a5a 100644 --- a/widgets/table/e-table-group-container.h +++ b/widgets/table/e-table-group-container.h @@ -62,8 +62,8 @@ typedef struct { gdouble width, height, minimum_width; ETableSortInfo *sort_info; - int n; - int length_threshold; + gint n; + gint length_threshold; ESelectionModel *selection_model; @@ -86,8 +86,8 @@ typedef struct { typedef struct { ETableGroup *child; - void *key; - char *string; + gpointer key; + gchar *string; GnomeCanvasItem *text; GnomeCanvasItem *rect; gint count; @@ -95,11 +95,11 @@ typedef struct { ETableGroup *e_table_group_container_new (GnomeCanvasGroup *parent, ETableHeader *full_header, ETableHeader *header, - ETableModel *model, ETableSortInfo *sort_info, int n); + ETableModel *model, ETableSortInfo *sort_info, gint n); void e_table_group_container_construct (GnomeCanvasGroup *parent, ETableGroupContainer *etgc, ETableHeader *full_header, ETableHeader *header, - ETableModel *model, ETableSortInfo *sort_info, int n); + ETableModel *model, ETableSortInfo *sort_info, gint n); GType e_table_group_container_get_type (void); diff --git a/widgets/table/e-table-group-leaf.c b/widgets/table/e-table-group-leaf.c index 6076030737..5e269e284e 100644 --- a/widgets/table/e-table-group-leaf.c +++ b/widgets/table/e-table-group-leaf.c @@ -400,7 +400,7 @@ etgl_get_printable (ETableGroup *etg) } static void -etgl_compute_location (ETableGroup *etg, int *x, int *y, int *row, int *col) +etgl_compute_location (ETableGroup *etg, gint *x, gint *y, gint *row, gint *col) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg); @@ -408,7 +408,7 @@ etgl_compute_location (ETableGroup *etg, int *x, int *y, int *row, int *col) } static void -etgl_get_mouse_over (ETableGroup *etg, int *row, int *col) +etgl_get_mouse_over (ETableGroup *etg, gint *row, gint *col) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg); @@ -421,7 +421,7 @@ etgl_get_mouse_over (ETableGroup *etg, int *row, int *col) } static void -etgl_get_cell_geometry (ETableGroup *etg, int *row, int *col, int *x, int *y, int *width, int *height) +etgl_get_cell_geometry (ETableGroup *etg, gint *row, gint *col, gint *x, gint *y, gint *width, gint *height) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg); diff --git a/widgets/table/e-table-group-leaf.h b/widgets/table/e-table-group-leaf.h index e19bf8cdb8..8d05874c01 100644 --- a/widgets/table/e-table-group-leaf.h +++ b/widgets/table/e-table-group-leaf.h @@ -49,7 +49,7 @@ typedef struct { gdouble width; gdouble minimum_width; - int length_threshold; + gint length_threshold; ETableSubset *ets; guint is_grouped : 1; @@ -61,13 +61,13 @@ typedef struct { guint uniform_row_height : 1; ECursorMode cursor_mode; - int etgl_cursor_change_id; - int etgl_cursor_activated_id; - int etgl_double_click_id; - int etgl_right_click_id; - int etgl_click_id; - int etgl_key_press_id; - int etgl_start_drag_id; + gint etgl_cursor_change_id; + gint etgl_cursor_activated_id; + gint etgl_double_click_id; + gint etgl_right_click_id; + gint etgl_click_id; + gint etgl_key_press_id; + gint etgl_start_drag_id; ESelectionModel *selection_model; } ETableGroupLeaf; diff --git a/widgets/table/e-table-group.c b/widgets/table/e-table-group.c index 5cc03e90fc..a1d965b57a 100644 --- a/widgets/table/e-table-group.c +++ b/widgets/table/e-table-group.c @@ -101,7 +101,7 @@ e_table_group_new (GnomeCanvasGroup *parent, ETableHeader *header, ETableModel *model, ETableSortInfo *sort_info, - int n) + gint n) { g_return_val_if_fail (model != NULL, NULL); @@ -170,8 +170,8 @@ e_table_group_add (ETableGroup *etg, */ void e_table_group_add_array (ETableGroup *etg, - const int *array, - int count) + const gint *array, + gint count) { g_return_if_fail (etg != NULL); g_return_if_fail (E_IS_TABLE_GROUP (etg)); @@ -372,7 +372,7 @@ e_table_group_get_printable (ETableGroup *etg) * %ETableGroup is removed from the value y points to. */ void -e_table_group_compute_location (ETableGroup *etg, int *x, int *y, int *row, int *col) +e_table_group_compute_location (ETableGroup *etg, gint *x, gint *y, gint *row, gint *col) { g_return_if_fail (etg != NULL); g_return_if_fail (E_IS_TABLE_GROUP (etg)); @@ -382,7 +382,7 @@ e_table_group_compute_location (ETableGroup *etg, int *x, int *y, int *row, int } void -e_table_group_get_mouse_over (ETableGroup *etg, int *row, int *col) +e_table_group_get_mouse_over (ETableGroup *etg, gint *row, gint *col) { g_return_if_fail (etg != NULL); g_return_if_fail (E_IS_TABLE_GROUP (etg)); @@ -407,12 +407,12 @@ e_table_group_get_mouse_over (ETableGroup *etg, int *row, int *col) */ void e_table_group_get_cell_geometry (ETableGroup *etg, - int *row, - int *col, - int *x, - int *y, - int *width, - int *height) + gint *row, + gint *col, + gint *x, + gint *y, + gint *width, + gint *height) { g_return_if_fail (etg != NULL); g_return_if_fail (E_IS_TABLE_GROUP (etg)); diff --git a/widgets/table/e-table-group.h b/widgets/table/e-table-group.h index 36868f7d35..7bf139e666 100644 --- a/widgets/table/e-table-group.h +++ b/widgets/table/e-table-group.h @@ -69,17 +69,17 @@ typedef struct { GnomeCanvasGroupClass parent_class; /* Signals */ - void (*cursor_change) (ETableGroup *etg, int row); - void (*cursor_activated) (ETableGroup *etg, int row); - void (*double_click) (ETableGroup *etg, int row, int col, GdkEvent *event); - gint (*right_click) (ETableGroup *etg, int row, int col, GdkEvent *event); - gint (*click) (ETableGroup *etg, int row, int col, GdkEvent *event); - gint (*key_press) (ETableGroup *etg, int row, int col, GdkEvent *event); - gint (*start_drag) (ETableGroup *etg, int row, int col, GdkEvent *event); + void (*cursor_change) (ETableGroup *etg, gint row); + void (*cursor_activated) (ETableGroup *etg, gint row); + void (*double_click) (ETableGroup *etg, gint row, gint col, GdkEvent *event); + gint (*right_click) (ETableGroup *etg, gint row, gint col, GdkEvent *event); + gint (*click) (ETableGroup *etg, gint row, gint col, GdkEvent *event); + gint (*key_press) (ETableGroup *etg, gint row, gint col, GdkEvent *event); + gint (*start_drag) (ETableGroup *etg, gint row, gint col, GdkEvent *event); /* Virtual functions. */ void (*add) (ETableGroup *etg, gint row); - void (*add_array) (ETableGroup *etg, const int *array, int count); + void (*add_array) (ETableGroup *etg, const gint *array, gint count); void (*add_all) (ETableGroup *etg); gboolean (*remove) (ETableGroup *etg, gint row); gint (*row_count) (ETableGroup *etg); @@ -89,9 +89,9 @@ typedef struct { gboolean (*get_focus) (ETableGroup *etg); gint (*get_focus_column) (ETableGroup *etg); EPrintable *(*get_printable) (ETableGroup *etg); - void (*compute_location) (ETableGroup *etg, int *x, int *y, int *row, int *col); - void (*get_mouse_over) (ETableGroup *etg, int *row, int *col); - void (*get_cell_geometry) (ETableGroup *etg, int *row, int *col, int *x, int *y, int *width, int *height); + void (*compute_location) (ETableGroup *etg, gint *x, gint *y, gint *row, gint *col); + void (*get_mouse_over) (ETableGroup *etg, gint *row, gint *col); + void (*get_cell_geometry) (ETableGroup *etg, gint *row, gint *col, gint *x, gint *y, gint *width, gint *height); } ETableGroupClass; @@ -99,8 +99,8 @@ typedef struct { void e_table_group_add (ETableGroup *etg, gint row); void e_table_group_add_array (ETableGroup *etg, - const int *array, - int count); + const gint *array, + gint count); void e_table_group_add_all (ETableGroup *etg); gboolean e_table_group_remove (ETableGroup *etg, gint row); @@ -119,26 +119,26 @@ gint e_table_group_get_focus_column (ETableGroup *etg); ETableHeader *e_table_group_get_header (ETableGroup *etg); EPrintable *e_table_group_get_printable (ETableGroup *etg); void e_table_group_compute_location (ETableGroup *etg, - int *x, - int *y, - int *row, - int *col); + gint *x, + gint *y, + gint *row, + gint *col); void e_table_group_get_mouse_over(ETableGroup *etg, - int *row, - int *col); + gint *row, + gint *col); void e_table_group_get_cell_geometry (ETableGroup *etg, - int *row, - int *col, - int *x, - int *y, - int *width, - int *height); + gint *row, + gint *col, + gint *x, + gint *y, + gint *width, + gint *height); ETableGroup *e_table_group_new (GnomeCanvasGroup *parent, ETableHeader *full_header, ETableHeader *header, ETableModel *model, ETableSortInfo *sort_info, - int n); + gint n); void e_table_group_construct (GnomeCanvasGroup *parent, ETableGroup *etg, ETableHeader *full_header, @@ -172,7 +172,7 @@ gint e_table_group_start_drag (ETableGroup *etg, GdkEvent *event); GType e_table_group_get_type (void); -typedef void (*ETableGroupLeafFn) (void *e_table_item, void *closure); +typedef void (*ETableGroupLeafFn) (gpointer e_table_item, gpointer closure); void e_table_group_apply_to_leafs (ETableGroup *etg, ETableGroupLeafFn fn, void *closure); diff --git a/widgets/table/e-table-header-item.c b/widgets/table/e-table-header-item.c index e25e8da79f..629252f9f8 100644 --- a/widgets/table/e-table-header-item.c +++ b/widgets/table/e-table-header-item.c @@ -155,8 +155,8 @@ static int e_table_header_item_get_height (ETableHeaderItem *ethi) { ETableHeader *eth; - int numcols, col; - int maxheight; + gint numcols, col; + gint maxheight; g_return_val_if_fail (ethi != NULL, 0); g_return_val_if_fail (E_IS_TABLE_HEADER_ITEM (ethi), 0); @@ -168,7 +168,7 @@ e_table_header_item_get_height (ETableHeaderItem *ethi) for (col = 0; col < numcols; col++) { ETableCol *ecol = e_table_header_get_column (eth, col); - int height; + gint height; height = e_table_header_compute_height (ecol, GTK_WIDGET (GNOME_CANVAS_ITEM (ethi)->canvas)); @@ -181,7 +181,7 @@ e_table_header_item_get_height (ETableHeaderItem *ethi) } static void -ethi_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, int flags) +ethi_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, gint flags) { ETableHeaderItem *ethi = E_TABLE_HEADER_ITEM (item); @@ -260,7 +260,7 @@ structure_changed (ETableHeader *header, ETableHeaderItem *ethi) } static void -dimension_changed (ETableHeader *header, int col, ETableHeaderItem *ethi) +dimension_changed (ETableHeader *header, gint col, ETableHeaderItem *ethi) { gnome_canvas_item_request_update(GNOME_CANVAS_ITEM(ethi)); } @@ -388,11 +388,11 @@ ethi_get_property (GObject *object, } static int -ethi_find_col_by_x (ETableHeaderItem *ethi, int x) +ethi_find_col_by_x (ETableHeaderItem *ethi, gint x) { - const int cols = e_table_header_count (ethi->eth); - int x1 = 0; - int col; + const gint cols = e_table_header_count (ethi->eth); + gint x1 = 0; + gint col; d(g_print ("%s:%d: x = %d, x1 = %d\n", __FUNCTION__, __LINE__, x, x1)); @@ -418,11 +418,11 @@ ethi_find_col_by_x (ETableHeaderItem *ethi, int x) } static int -ethi_find_col_by_x_nearest (ETableHeaderItem *ethi, int x) +ethi_find_col_by_x_nearest (ETableHeaderItem *ethi, gint x) { - const int cols = e_table_header_count (ethi->eth); - int x1 = 0; - int col; + const gint cols = e_table_header_count (ethi->eth); + gint x1 = 0; + gint col; x1 += ethi->group_indent_width; @@ -455,7 +455,7 @@ ethi_remove_drop_marker (ETableHeaderItem *ethi) } static GtkWidget * -make_shaped_window_from_xpm (const char **xpm) +make_shaped_window_from_xpm (const gchar **xpm) { GdkPixbuf *pixbuf; GdkPixmap *pixmap; @@ -483,10 +483,10 @@ make_shaped_window_from_xpm (const char **xpm) } static void -ethi_add_drop_marker (ETableHeaderItem *ethi, int col, gboolean recreate) +ethi_add_drop_marker (ETableHeaderItem *ethi, gint col, gboolean recreate) { - int rx, ry; - int x; + gint rx, ry; + gint x; if (!recreate && ethi->drag_mark == col) return; @@ -518,7 +518,7 @@ ethi_add_drop_marker (ETableHeaderItem *ethi, int col, gboolean recreate) #define gray50_width 2 #define gray50_height 2 -static char gray50_bits [] = { +static gchar gray50_bits [] = { 0x02, 0x01, }; static void @@ -592,7 +592,7 @@ do_drag_motion(ETableHeaderItem *ethi, if ((x >= 0) && (x <= (ethi->width)) && (y >= 0) && (y <= (ethi->height))){ - int col; + gint col; d(g_print("In header\n")); col = ethi_find_col_by_x_nearest (ethi, x); @@ -626,7 +626,7 @@ static gboolean scroll_timeout (gpointer data) { ETableHeaderItem *ethi = data; - int dx = 0; + gint dx = 0; GtkAdjustment *h, *v; double value; @@ -701,7 +701,7 @@ ethi_drag_motion (GtkWidget *widget, GdkDragContext *context, gint x, gint y, guint time, ETableHeaderItem *ethi) { - char *droptype, *headertype; + gchar *droptype, *headertype; guint direction = 0; gdk_drag_status (context, 0, time); @@ -768,15 +768,15 @@ ethi_drag_data_received (GtkWidget *canvas, guint time, ETableHeaderItem *ethi) { - int found = FALSE; - int count; - int column; - int drop_col; - int i; + gint found = FALSE; + gint count; + gint column; + gint drop_col; + gint i; if (data->data) { count = e_table_header_count(ethi->eth); - column = atoi((char *)data->data); + column = atoi((gchar *)data->data); drop_col = ethi->drop_col; ethi->drop_col = -1; @@ -820,7 +820,7 @@ ethi_drag_data_get (GtkWidget *canvas, gtk_selection_data_set(selection_data, GDK_SELECTION_TYPE_STRING, sizeof(string[0]), - (unsigned char *)string, + (guchar *)string, strlen(string)); g_free(string); } @@ -838,7 +838,7 @@ ethi_drag_drop (GtkWidget *canvas, if ((x >= 0) && (x <= (ethi->width)) && (y >= 0) && (y <= (ethi->height))){ - int col; + gint col; col = ethi_find_col_by_x_nearest (ethi, x); @@ -847,7 +847,7 @@ ethi_drag_drop (GtkWidget *canvas, ethi->drop_col = col; if (col != -1) { - char *target = g_strdup_printf ("%s-%s", TARGET_ETABLE_COL_TYPE, ethi->dnd_code); + gchar *target = g_strdup_printf ("%s-%s", TARGET_ETABLE_COL_TYPE, ethi->dnd_code); d(g_print ("ethi - %s\n", target)); gtk_drag_get_data (canvas, context, gdk_atom_intern(target, FALSE), time); g_free (target); @@ -938,19 +938,19 @@ ethi_unrealize (GnomeCanvasItem *item) } static void -ethi_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int width, int height) +ethi_draw (GnomeCanvasItem *item, GdkDrawable *drawable, gint x, gint y, gint width, gint height) { ETableHeaderItem *ethi = E_TABLE_HEADER_ITEM (item); GnomeCanvas *canvas = item->canvas; - const int cols = e_table_header_count (ethi->eth); - int x1, x2; - int col; + const gint cols = e_table_header_count (ethi->eth); + gint x1, x2; + gint col; GHashTable *arrows = g_hash_table_new (NULL, NULL); if (ethi->sort_info) { - int length = e_table_sort_info_grouping_get_count(ethi->sort_info); - int i; + gint length = e_table_sort_info_grouping_get_count(ethi->sort_info); + gint i; for (i = 0; i < length; i++) { ETableSortColumn column = e_table_sort_info_grouping_get_nth(ethi->sort_info, i); g_hash_table_insert (arrows, @@ -975,7 +975,7 @@ ethi_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int width x2 += ethi->group_indent_width; for (col = 0; col < cols; col++, x1 = x2){ ETableCol *ecol = e_table_header_get_column (ethi->eth, col); - int col_width; + gint col_width; col_width = ecol->width; @@ -1005,7 +1005,7 @@ ethi_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int width } static double -ethi_point (GnomeCanvasItem *item, double x, double y, int cx, int cy, +ethi_point (GnomeCanvasItem *item, double x, double y, gint cx, gint cy, GnomeCanvasItem **actual_item) { *actual_item = item; @@ -1020,10 +1020,10 @@ ethi_point (GnomeCanvasItem *item, double x, double y, int cx, int cy, * then the ETableCol that actually contains this point is returned here */ static gboolean -is_pointer_on_division (ETableHeaderItem *ethi, int pos, int *the_total, int *return_col) +is_pointer_on_division (ETableHeaderItem *ethi, gint pos, gint *the_total, gint *return_col) { - const int cols = e_table_header_count (ethi->eth); - int col, total; + const gint cols = e_table_header_count (ethi->eth); + gint col, total; total = 0; for (col = 0; col < cols; col++){ @@ -1055,9 +1055,9 @@ is_pointer_on_division (ETableHeaderItem *ethi, int pos, int *the_total, int *re #define convert(c,sx,sy,x,y) gnome_canvas_w2c (c,sx,sy,x,y) static void -set_cursor (ETableHeaderItem *ethi, int pos) +set_cursor (ETableHeaderItem *ethi, gint pos) { - int col; + gint col; GtkWidget *canvas = GTK_WIDGET (GNOME_CANVAS_ITEM (ethi)->canvas); gboolean resizable = FALSE; @@ -1066,12 +1066,12 @@ set_cursor (ETableHeaderItem *ethi, int pos) return; if (is_pointer_on_division (ethi, pos, NULL, &col)) { - int last_col = ethi->eth->col_count - 1; + gint last_col = ethi->eth->col_count - 1; ETableCol *ecol = e_table_header_get_column (ethi->eth, col); /* Last column is not resizable */ if (ecol->resizable && col != last_col) { - int c = col + 1; + gint c = col + 1; /* Column is not resizable if all columns after it are also not resizable */ @@ -1128,9 +1128,9 @@ ethi_start_drag (ETableHeaderItem *ethi, GdkEvent *event) GtkTargetList *list; GdkDragContext *context; ETableCol *ecol; - int col_width; + gint col_width; GdkPixmap *pixmap; - int group_indent = 0; + gint group_indent = 0; GHashTable *arrows = g_hash_table_new (NULL, NULL); GtkTargetEntry ethi_drag_types [] = { @@ -1143,8 +1143,8 @@ ethi_start_drag (ETableHeaderItem *ethi, GdkEvent *event) return; if (ethi->sort_info) { - int length = e_table_sort_info_grouping_get_count(ethi->sort_info); - int i; + gint length = e_table_sort_info_grouping_get_count(ethi->sort_info); + gint i; for (i = 0; i < length; i++) { ETableSortColumn column = e_table_sort_info_grouping_get_nth( @@ -1208,17 +1208,17 @@ ethi_start_drag (ETableHeaderItem *ethi, GdkEvent *event) typedef struct { ETableHeaderItem *ethi; - int col; + gint col; } EthiHeaderInfo; static void ethi_popup_sort_ascending(GtkWidget *widget, EthiHeaderInfo *info) { ETableCol *col; - int model_col = -1; - int length; - int i; - int found = FALSE; + gint model_col = -1; + gint length; + gint i; + gint found = FALSE; ETableHeaderItem *ethi = info->ethi; col = e_table_header_get_column (ethi->eth, info->col); @@ -1270,10 +1270,10 @@ static void ethi_popup_sort_descending(GtkWidget *widget, EthiHeaderInfo *info) { ETableCol *col; - int model_col=-1; - int length; - int i; - int found = FALSE; + gint model_col=-1; + gint length; + gint i; + gint found = FALSE; ETableHeaderItem *ethi = info->ethi; col = e_table_header_get_column (ethi->eth, info->col); @@ -1334,7 +1334,7 @@ static void ethi_popup_group_field(GtkWidget *widget, EthiHeaderInfo *info) { ETableCol *col; - int model_col; + gint model_col; ETableHeaderItem *ethi = info->ethi; ETableSortColumn column; @@ -1392,7 +1392,7 @@ static void ethi_popup_best_fit(GtkWidget *widget, EthiHeaderInfo *info) { ETableHeaderItem *ethi = info->ethi; - int width; + gint width; g_signal_emit_by_name (ethi->eth, "request_width", @@ -1419,7 +1419,7 @@ config_destroyed (gpointer data, GObject *where_object_was) static void apply_changes (ETableConfig *config, ETableHeaderItem *ethi) { - char *state = e_table_state_save_to_string (config->state); + gchar *state = e_table_state_save_to_string (config->state); if (ethi->table) e_table_set_state (ethi->table, state); @@ -1492,7 +1492,7 @@ static EPopupMenu ethi_context_menu [] = { static void sort_by_id (GtkWidget *menu_item, ETableHeaderItem *ethi) { - int col = GPOINTER_TO_INT (g_object_get_data(G_OBJECT (menu_item), "col-number")); + gint col = GPOINTER_TO_INT (g_object_get_data(G_OBJECT (menu_item), "col-number")); ETableCol *ecol; gboolean clearfirst; @@ -1523,7 +1523,7 @@ ethi_header_context_menu (ETableHeaderItem *ethi, GdkEventButton *event) EthiHeaderInfo *info = g_new (EthiHeaderInfo, 1); ETableCol *col; GtkMenu *popup; - int ncol, sort_count, sort_col; + gint ncol, sort_count, sort_col; GtkWidget *menu_item, *sub_menu; ETableSortColumn column; gboolean ascending = TRUE; @@ -1574,7 +1574,7 @@ ethi_header_context_menu (ETableHeaderItem *ethi, GdkEventButton *event) /* Headers */ for (ncol = 0; ncol<ethi->full_header->col_count; ncol++) { - char *text=NULL; + gchar *text=NULL; if (!ethi->full_header->columns[ncol]->sortable || ethi->full_header->columns[ncol]->disabled) @@ -1613,9 +1613,9 @@ ethi_button_pressed (ETableHeaderItem *ethi, GdkEventButton *event) void ethi_change_sort_state (ETableHeaderItem *ethi, ETableCol *col) { - int model_col = -1; - int length; - int i; + gint model_col = -1; + gint length; + gint i; gboolean found = FALSE; if (col == NULL) @@ -1628,7 +1628,7 @@ ethi_change_sort_state (ETableHeaderItem *ethi, ETableCol *col) for (i = 0; i < length; i++) { ETableSortColumn column = e_table_sort_info_grouping_get_nth(ethi->sort_info, i); if (model_col == column.column || model_col == -1){ - int ascending = column.ascending; + gint ascending = column.ascending; ascending = ! ascending; column.ascending = ascending; e_table_sort_info_grouping_set_nth(ethi->sort_info, i, column); @@ -1644,14 +1644,14 @@ ethi_change_sort_state (ETableHeaderItem *ethi, ETableCol *col) ETableSortColumn column = e_table_sort_info_sorting_get_nth(ethi->sort_info, i); if (model_col == column.column || model_col == -1){ - int ascending = column.ascending; + gint ascending = column.ascending; if (ascending == 0 && model_col != -1){ /* * This means the user has clicked twice * already, lets kill sorting of this column now. */ - int j; + gint j; for (j = i + 1; j < length; j++) e_table_sort_info_sorting_set_nth (ethi->sort_info, @@ -1691,8 +1691,8 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) ETableHeaderItem *ethi = E_TABLE_HEADER_ITEM (item); GnomeCanvas *canvas = item->canvas; const gboolean resizing = ETHI_RESIZING (ethi); - int x, y, start, col; - int was_maybe_drag = 0; + gint x, y, start, col; + gint was_maybe_drag = 0; switch (e->type){ case GDK_ENTER_NOTIFY: @@ -1709,7 +1709,7 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) convert (canvas, e->motion.x, e->motion.y, &x, &y); if (resizing){ - int new_width; + gint new_width; if (ethi->resize_guide == NULL){ /* Quick hack until I actually bind the views */ @@ -1779,7 +1779,7 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) if (e->button.button != 1) break; else { - int width = 0; + gint width = 0; g_signal_emit_by_name (ethi->eth, "request_width", (int)ethi->resize_col, &width); diff --git a/widgets/table/e-table-header-item.h b/widgets/table/e-table-header-item.h index 24a86939d8..db2aeb3508 100644 --- a/widgets/table/e-table-header-item.h +++ b/widgets/table/e-table-header-item.h @@ -51,26 +51,26 @@ typedef struct { /* * Used during resizing; Could be shorts */ - int resize_col; - int resize_start_pos; - int resize_min_width; + gint resize_col; + gint resize_start_pos; + gint resize_min_width; GtkObject *resize_guide; - int group_indent_width; + gint group_indent_width; /* * Ids */ - int structure_change_id, dimension_change_id; + gint structure_change_id, dimension_change_id; /* * For dragging columns */ guint maybe_drag:1; guint dnd_ready:1; - int click_x, click_y; - int drag_col, drop_col, drag_mark; + gint click_x, click_y; + gint drag_col, drop_col, drag_mark; guint drag_motion_id, drag_end_id, drag_leave_id, drag_drop_id, drag_data_received_id, drag_data_get_id; guint sort_info_changed_id, group_info_changed_id; GnomeCanvasItem *remove_item; @@ -84,11 +84,11 @@ typedef struct { ETableSortInfo *sort_info; guint scroll_direction : 4; - int last_drop_x; - int last_drop_y; - int last_drop_time; + gint last_drop_x; + gint last_drop_y; + gint last_drop_time; GdkDragContext *last_drop_context; - int scroll_idle_id; + gint scroll_idle_id; /* For adding fields. */ ETableHeader *full_header; @@ -102,7 +102,7 @@ typedef struct { } etfcd; /* For keyboard navigation*/ - int selected_col; + gint selected_col; } ETableHeaderItem; diff --git a/widgets/table/e-table-header-utils.c b/widgets/table/e-table-header-utils.c index a8a533f35d..84b547c6c8 100644 --- a/widgets/table/e-table-header-utils.c +++ b/widgets/table/e-table-header-utils.c @@ -35,7 +35,7 @@ #include "e-table-header-utils.h" static PangoLayout* -build_header_layout (GtkWidget *widget, const char *str) +build_header_layout (GtkWidget *widget, const gchar *str) { PangoLayout *layout; @@ -70,8 +70,8 @@ build_header_layout (GtkWidget *widget, const char *str) double e_table_header_compute_height (ETableCol *ecol, GtkWidget *widget) { - int ythick; - int height; + gint ythick; + gint height; PangoLayout *layout; g_return_val_if_fail (ecol != NULL, -1); @@ -111,13 +111,13 @@ e_table_header_width_extras (GtkStyle *style) */ static GdkPixmap * make_composite_pixmap (GdkDrawable *drawable, GdkGC *gc, - GdkPixbuf *pixbuf, GdkColor *bg, int width, int height, - int dither_xofs, int dither_yofs) + GdkPixbuf *pixbuf, GdkColor *bg, gint width, gint height, + gint dither_xofs, gint dither_yofs) { - int pwidth, pheight; + gint pwidth, pheight; GdkPixmap *pixmap; GdkPixbuf *tmp; - int color; + gint color; pwidth = gdk_pixbuf_get_width (pixbuf); pheight = gdk_pixbuf_get_height (pixbuf); @@ -141,7 +141,7 @@ make_composite_pixmap (GdkDrawable *drawable, GdkGC *gc, 16, color, color); } else { - int x, y, rowstride; + gint x, y, rowstride; GdkPixbuf *fade; guchar *pixels; @@ -162,7 +162,7 @@ make_composite_pixmap (GdkDrawable *drawable, GdkGC *gc, for (y = 0; y < height; y++) { guchar *p; - int yfactor; + gint yfactor; p = pixels + y * rowstride; @@ -172,7 +172,7 @@ make_composite_pixmap (GdkDrawable *drawable, GdkGC *gc, yfactor = height; for (x = 0; x < width; x++) { - int xfactor; + gint xfactor; if (width < pwidth) xfactor = width - x; @@ -238,12 +238,12 @@ make_composite_pixmap (GdkDrawable *drawable, GdkGC *gc, **/ static void e_table_draw_elided_string (GdkDrawable *drawable, GdkGC *gc, GtkWidget *widget, - int x, int y, PangoLayout *layout, char *str, - int max_width, gboolean center) + gint x, gint y, PangoLayout *layout, gchar *str, + gint max_width, gboolean center) { - int width; - int height; - int index; + gint width; + gint height; + gint index; GSList *lines; PangoLayoutLine *line; @@ -257,7 +257,7 @@ e_table_draw_elided_string (GdkDrawable *drawable, GdkGC *gc, GtkWidget *widget, gdk_gc_set_clip_rectangle (gc, NULL); if (width <= max_width) { - int xpos; + gint xpos; if (center) xpos = x + (max_width - width) / 2; @@ -268,8 +268,8 @@ e_table_draw_elided_string (GdkDrawable *drawable, GdkGC *gc, GtkWidget *widget, xpos, y, layout); } else { - int arrow_width; - int i; + gint arrow_width; + gint i; if (max_width < ARROW_WIDTH + 1) arrow_width = max_width - 1; @@ -323,13 +323,13 @@ void e_table_header_draw_button (GdkDrawable *drawable, ETableCol *ecol, GtkStyle *style, GtkStateType state, GtkWidget *widget, - int x, int y, int width, int height, - int button_width, int button_height, + gint x, gint y, gint width, gint height, + gint button_width, gint button_height, ETableColArrow arrow) { - int xthick, ythick; - int inner_x, inner_y; - int inner_width, inner_height; + gint xthick, ythick; + gint inner_x, inner_y; + gint inner_width, inner_height; GdkGC *gc; PangoLayout *layout; static gpointer g_label = NULL; @@ -385,7 +385,7 @@ e_table_header_draw_button (GdkDrawable *drawable, ETableCol *ecol, case E_TABLE_COL_ARROW_UP: case E_TABLE_COL_ARROW_DOWN: { - int arrow_width, arrow_height; + gint arrow_width, arrow_height; arrow_width = MIN (MIN_ARROW_SIZE, inner_width); arrow_height = MIN (MIN_ARROW_SIZE, inner_height); @@ -413,9 +413,9 @@ e_table_header_draw_button (GdkDrawable *drawable, ETableCol *ecol, /* Pixbuf or label */ if (ecol->is_pixbuf) { - int pwidth, pheight; - int clip_width, clip_height; - int xpos; + gint pwidth, pheight; + gint clip_width, clip_height; + gint xpos; GdkPixmap *pixmap; g_return_if_fail (ecol->pixbuf != NULL); @@ -429,7 +429,7 @@ e_table_header_draw_button (GdkDrawable *drawable, ETableCol *ecol, xpos = inner_x; if (inner_width - pwidth > 11) { - int ypos; + gint ypos; pango_layout_get_pixel_size (layout, &width, NULL); diff --git a/widgets/table/e-table-header-utils.h b/widgets/table/e-table-header-utils.h index 2ae1f79b1b..7804bd12c5 100644 --- a/widgets/table/e-table-header-utils.h +++ b/widgets/table/e-table-header-utils.h @@ -40,12 +40,12 @@ void e_table_header_draw_button (GdkDrawable *drawable, GtkStyle *style, GtkStateType state, GtkWidget *widget, - int x, - int y, - int width, - int height, - int button_width, - int button_height, + gint x, + gint y, + gint width, + gint height, + gint button_width, + gint button_height, ETableColArrow arrow); #ifdef __cplusplus diff --git a/widgets/table/e-table-header.c b/widgets/table/e-table-header.c index 6fd40ae0fa..b931f48e20 100644 --- a/widgets/table/e-table-header.c +++ b/widgets/table/e-table-header.c @@ -49,7 +49,7 @@ enum { LAST_SIGNAL }; -static void eth_set_size (ETableHeader *eth, int idx, int size); +static void eth_set_size (ETableHeader *eth, gint idx, gint size); static void eth_calc_widths (ETableHeader *eth); static guint eth_signals [LAST_SIGNAL] = { 0, }; @@ -57,18 +57,18 @@ static guint eth_signals [LAST_SIGNAL] = { 0, }; G_DEFINE_TYPE (ETableHeader, e_table_header, G_TYPE_OBJECT) struct two_ints { - int column; - int width; + gint column; + gint width; }; static void -eth_set_width (ETableHeader *eth, int width) +eth_set_width (ETableHeader *eth, gint width) { eth->width = width; } static void -dequeue (ETableHeader *eth, int *column, int *width) +dequeue (ETableHeader *eth, gint *column, gint *width) { GSList *head; struct two_ints *store; @@ -88,7 +88,7 @@ dequeue (ETableHeader *eth, int *column, int *width) static gboolean dequeue_idle (ETableHeader *eth) { - int column, width; + gint column, width; dequeue (eth, &column, &width); while (eth->change_queue && ((struct two_ints *) eth->change_queue->data)->column == column) @@ -108,7 +108,7 @@ dequeue_idle (ETableHeader *eth) } static void -enqueue (ETableHeader *eth, int column, int width) +enqueue (ETableHeader *eth, gint column, gint width) { struct two_ints *store; store = g_new(struct two_ints, 1); @@ -125,7 +125,7 @@ enqueue (ETableHeader *eth, int column, int width) } void -e_table_header_set_size (ETableHeader *eth, int idx, int size) +e_table_header_set_size (ETableHeader *eth, gint idx, gint size) { g_return_if_fail (eth != NULL); g_return_if_fail (E_IS_TABLE_HEADER (eth)); @@ -134,7 +134,7 @@ e_table_header_set_size (ETableHeader *eth, int idx, int size) } static void -eth_do_remove (ETableHeader *eth, int idx, gboolean do_unref) +eth_do_remove (ETableHeader *eth, gint idx, gboolean do_unref) { if (do_unref) g_object_unref (eth->columns [idx]); @@ -148,8 +148,8 @@ static void eth_finalize (GObject *object) { ETableHeader *eth = E_TABLE_HEADER (object); - const int cols = eth->col_count; - int i; + const gint cols = eth->col_count; + gint i; if (eth->sort_info) { if (eth->sort_info_group_change_id) @@ -345,8 +345,8 @@ e_table_header_new (void) static void eth_update_offsets (ETableHeader *eth) { - int i; - int x = 0; + gint i; + gint x = 0; for (i = 0; i < eth->col_count; i++){ ETableCol *etc = eth->columns [i]; @@ -357,7 +357,7 @@ eth_update_offsets (ETableHeader *eth) } static void -eth_do_insert (ETableHeader *eth, int pos, ETableCol *val) +eth_do_insert (ETableHeader *eth, gint pos, ETableCol *val) { memmove (ð->columns [pos+1], ð->columns [pos], sizeof (ETableCol *) * (eth->col_count - pos)); @@ -380,7 +380,7 @@ eth_do_insert (ETableHeader *eth, int pos, ETableCol *val) * The ETableCol is assumed */ void -e_table_header_add_column (ETableHeader *eth, ETableCol *tc, int pos) +e_table_header_add_column (ETableHeader *eth, ETableCol *tc, gint pos) { g_return_if_fail (eth != NULL); g_return_if_fail (E_IS_TABLE_HEADER (eth)); @@ -411,7 +411,7 @@ e_table_header_add_column (ETableHeader *eth, ETableCol *tc, int pos) * Returns: The ETableCol at @column in the @eth object */ ETableCol * -e_table_header_get_column (ETableHeader *eth, int column) +e_table_header_get_column (ETableHeader *eth, gint column) { g_return_val_if_fail (eth != NULL, NULL); g_return_val_if_fail (E_IS_TABLE_HEADER (eth), NULL); @@ -433,9 +433,9 @@ e_table_header_get_column (ETableHeader *eth, int column) * Returns: The ETableCol with col_idx = @col_idx in the @eth object */ ETableCol * -e_table_header_get_column_by_col_idx (ETableHeader *eth, int col_idx) +e_table_header_get_column_by_col_idx (ETableHeader *eth, gint col_idx) { - int i; + gint i; g_return_val_if_fail (eth != NULL, NULL); g_return_val_if_fail (E_IS_TABLE_HEADER (eth), NULL); @@ -454,7 +454,7 @@ e_table_header_get_column_by_col_idx (ETableHeader *eth, int col_idx) * * Returns: the number of columns in this ETableHeader. */ -int +gint e_table_header_count (ETableHeader *eth) { g_return_val_if_fail (eth != NULL, 0); @@ -475,8 +475,8 @@ e_table_header_count (ETableHeader *eth) * * Returns: the column in the model that the @col column * in the ETableHeader points to. */ -int -e_table_header_index (ETableHeader *eth, int col) +gint +e_table_header_index (ETableHeader *eth, gint col) { g_return_val_if_fail (eth != NULL, -1); g_return_val_if_fail (E_IS_TABLE_HEADER (eth), -1); @@ -496,10 +496,10 @@ e_table_header_index (ETableHeader *eth, int col) * Returns: the column that contains pixel @x_offset, or -1 * if no column inside this ETableHeader contains that pixel. */ -int -e_table_header_get_index_at (ETableHeader *eth, int x_offset) +gint +e_table_header_get_index_at (ETableHeader *eth, gint x_offset) { - int i, total; + gint i, total; g_return_val_if_fail (eth != NULL, 0); g_return_val_if_fail (E_IS_TABLE_HEADER (eth), 0); @@ -529,7 +529,7 @@ ETableCol ** e_table_header_get_columns (ETableHeader *eth) { ETableCol **ret; - int i; + gint i; g_return_val_if_fail (eth != NULL, NULL); g_return_val_if_fail (E_IS_TABLE_HEADER (eth), NULL); @@ -551,11 +551,11 @@ e_table_header_get_columns (ETableHeader *eth) * * Returns: The number of selected columns in the @eth object. */ -int +gint e_table_header_get_selected (ETableHeader *eth) { - int i; - int selected = 0; + gint i; + gint selected = 0; g_return_val_if_fail (eth != NULL, 0); g_return_val_if_fail (E_IS_TABLE_HEADER (eth), 0); @@ -575,10 +575,10 @@ e_table_header_get_selected (ETableHeader *eth) * Returns: the number of pixels used by the @eth object * when rendered on screen */ -int +gint e_table_header_total_width (ETableHeader *eth) { - int total, i; + gint total, i; g_return_val_if_fail (eth != NULL, 0); g_return_val_if_fail (E_IS_TABLE_HEADER (eth), 0); @@ -596,10 +596,10 @@ e_table_header_total_width (ETableHeader *eth) * * Returns: the minimum number of pixels required by the @eth object. **/ -int +gint e_table_header_min_width (ETableHeader *eth) { - int total, i; + gint total, i; g_return_val_if_fail (eth != NULL, 0); g_return_val_if_fail (E_IS_TABLE_HEADER (eth), 0); @@ -622,7 +622,7 @@ e_table_header_min_width (ETableHeader *eth) * and "structure_change" will be emmited */ void -e_table_header_move (ETableHeader *eth, int source_index, int target_index) +e_table_header_move (ETableHeader *eth, gint source_index, gint target_index) { ETableCol *old; @@ -654,7 +654,7 @@ e_table_header_move (ETableHeader *eth, int source_index, int target_index) * This emmits the "structure_change" signal on the @eth object. */ void -e_table_header_remove (ETableHeader *eth, int idx) +e_table_header_remove (ETableHeader *eth, gint idx) { g_return_if_fail (eth != NULL); g_return_if_fail (E_IS_TABLE_HEADER (eth)); @@ -677,16 +677,16 @@ e_table_header_set_selection (ETableHeader *eth, gboolean allow_selection) } static void -eth_set_size (ETableHeader *eth, int idx, int size) +eth_set_size (ETableHeader *eth, gint idx, gint size) { double expansion; double old_expansion; - int min_width; - int left_width; - int total_extra; - int expandable_count; - int usable_width; - int i; + gint min_width; + gint left_width; + gint total_extra; + gint expandable_count; + gint usable_width; + gint i; g_return_if_fail (eth != NULL); g_return_if_fail (E_IS_TABLE_HEADER (eth)); g_return_if_fail (idx >= 0); @@ -813,10 +813,10 @@ eth_set_size (ETableHeader *eth, int idx, int size) * Returns: the number of pixels between @start_col and @end_col on the * @eth ETableHeader object */ -int -e_table_header_col_diff (ETableHeader *eth, int start_col, int end_col) +gint +e_table_header_col_diff (ETableHeader *eth, gint start_col, gint end_col) { - int total, col; + gint total, col; g_return_val_if_fail (eth != NULL, 0); g_return_val_if_fail (E_IS_TABLE_HEADER (eth), 0); @@ -838,13 +838,13 @@ e_table_header_col_diff (ETableHeader *eth, int start_col, int end_col) static void eth_calc_widths (ETableHeader *eth) { - int i; - int extra; + gint i; + gint extra; double expansion; - int last_position = 0; + gint last_position = 0; double next_position = 0; - int last_resizable = -1; - int *widths; + gint last_resizable = -1; + gint *widths; gboolean changed; widths = g_new (int, eth->col_count); @@ -887,13 +887,13 @@ eth_calc_widths (ETableHeader *eth) void e_table_header_update_horizontal (ETableHeader *eth) { - int i; - int cols; + gint i; + gint cols; cols = eth->col_count; for (i = 0; i < cols; i++) { - int width = 0; + gint width = 0; g_signal_emit_by_name (G_OBJECT (eth), "request_width", @@ -905,13 +905,13 @@ e_table_header_update_horizontal (ETableHeader *eth) g_signal_emit (G_OBJECT (eth), eth_signals [EXPANSION_CHANGE], 0); } -int +gint e_table_header_prioritized_column (ETableHeader *eth) { - int best_model_col = 0; - int best_priority; - int i; - int count; + gint best_model_col = 0; + gint best_priority; + gint i; + gint count; count = e_table_header_count (eth); if (count == 0) @@ -919,7 +919,7 @@ e_table_header_prioritized_column (ETableHeader *eth) best_priority = e_table_header_get_column (eth, 0)->priority; best_model_col = e_table_header_get_column (eth, 0)->col_idx; for (i = 1; i < count; i++) { - int priority = e_table_header_get_column (eth, i)->priority; + gint priority = e_table_header_get_column (eth, i)->priority; if (priority > best_priority) { best_priority = priority; best_model_col = e_table_header_get_column (eth, i)->col_idx; @@ -932,9 +932,9 @@ ETableCol * e_table_header_prioritized_column_selected (ETableHeader *eth, ETableColCheckFunc check_func, gpointer user_data) { ETableCol *best_col = NULL; - int best_priority = G_MININT; - int i; - int count; + gint best_priority = G_MININT; + gint i; + gint count; count = e_table_header_count (eth); if (count == 0) diff --git a/widgets/table/e-table-header.h b/widgets/table/e-table-header.h index 00b145ef87..d724c2710f 100644 --- a/widgets/table/e-table-header.h +++ b/widgets/table/e-table-header.h @@ -49,13 +49,13 @@ typedef gboolean (*ETableColCheckFunc) (ETableCol *col, gpointer user_data); struct _ETableHeader { GObject base; - int col_count; - int width; - int nominal_width; - int width_extras; + gint col_count; + gint width; + gint nominal_width; + gint width_extras; ETableSortInfo *sort_info; - int sort_info_group_change_id; + gint sort_info_group_change_id; ETableCol **columns; @@ -67,9 +67,9 @@ typedef struct { GObjectClass parent_class; void (*structure_change) (ETableHeader *eth); - void (*dimension_change) (ETableHeader *eth, int width); + void (*dimension_change) (ETableHeader *eth, gint width); void (*expansion_change) (ETableHeader *eth); - int (*request_width) (ETableHeader *eth, int col); + gint (*request_width) (ETableHeader *eth, gint col); } ETableHeaderClass; GType e_table_header_get_type (void); @@ -77,39 +77,39 @@ ETableHeader *e_table_header_new (void); void e_table_header_add_column (ETableHeader *eth, ETableCol *tc, - int pos); + gint pos); ETableCol *e_table_header_get_column (ETableHeader *eth, - int column); + gint column); ETableCol *e_table_header_get_column_by_col_idx (ETableHeader *eth, - int col_idx); -int e_table_header_count (ETableHeader *eth); -int e_table_header_index (ETableHeader *eth, - int col); -int e_table_header_get_index_at (ETableHeader *eth, - int x_offset); + gint col_idx); +gint e_table_header_count (ETableHeader *eth); +gint e_table_header_index (ETableHeader *eth, + gint col); +gint e_table_header_get_index_at (ETableHeader *eth, + gint x_offset); ETableCol **e_table_header_get_columns (ETableHeader *eth); -int e_table_header_get_selected (ETableHeader *eth); +gint e_table_header_get_selected (ETableHeader *eth); -int e_table_header_total_width (ETableHeader *eth); -int e_table_header_min_width (ETableHeader *eth); +gint e_table_header_total_width (ETableHeader *eth); +gint e_table_header_min_width (ETableHeader *eth); void e_table_header_move (ETableHeader *eth, - int source_index, - int target_index); + gint source_index, + gint target_index); void e_table_header_remove (ETableHeader *eth, - int idx); + gint idx); void e_table_header_set_size (ETableHeader *eth, - int idx, - int size); + gint idx, + gint size); void e_table_header_set_selection (ETableHeader *eth, gboolean allow_selection); -int e_table_header_col_diff (ETableHeader *eth, - int start_col, - int end_col); +gint e_table_header_col_diff (ETableHeader *eth, + gint start_col, + gint end_col); void e_table_header_calc_widths (ETableHeader *eth); GList *e_table_header_get_selected_indexes (ETableHeader *eth); void e_table_header_update_horizontal (ETableHeader *eth); -int e_table_header_prioritized_column (ETableHeader *eth); +gint e_table_header_prioritized_column (ETableHeader *eth); ETableCol *e_table_header_prioritized_column_selected (ETableHeader *eth, ETableColCheckFunc check_func, gpointer user_data); diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c index f423e75c2a..485007cdd3 100644 --- a/widgets/table/e-table-item.c +++ b/widgets/table/e-table-item.c @@ -108,23 +108,23 @@ enum { #define TRIPLE_CLICK_TIME 500 -static int eti_get_height (ETableItem *eti); -static int eti_row_height (ETableItem *eti, int row); -static void e_table_item_focus (ETableItem *eti, int col, int row, GdkModifierType state); -static void eti_cursor_change (ESelectionModel *selection, int row, int col, ETableItem *eti); -static void eti_cursor_activated (ESelectionModel *selection, int row, int col, ETableItem *eti); +static gint eti_get_height (ETableItem *eti); +static gint eti_row_height (ETableItem *eti, gint row); +static void e_table_item_focus (ETableItem *eti, gint col, gint row, GdkModifierType state); +static void eti_cursor_change (ESelectionModel *selection, gint row, gint col, ETableItem *eti); +static void eti_cursor_activated (ESelectionModel *selection, gint row, gint col, ETableItem *eti); static void eti_selection_change (ESelectionModel *selection, ETableItem *eti); -static void eti_selection_row_change (ESelectionModel *selection, int row, ETableItem *eti); -static void e_table_item_redraw_row (ETableItem *eti, int row); +static void eti_selection_row_change (ESelectionModel *selection, gint row, ETableItem *eti); +static void e_table_item_redraw_row (ETableItem *eti, gint row); #define ETI_SINGLE_ROW_HEIGHT(eti) ((eti)->uniform_row_height_cache != -1 ? (eti)->uniform_row_height_cache : eti_row_height((eti), -1)) #define ETI_MULTIPLE_ROW_HEIGHT(eti,row) ((eti)->height_cache && (eti)->height_cache[(row)] != -1 ? (eti)->height_cache[(row)] : eti_row_height((eti),(row))) #define ETI_ROW_HEIGHT(eti,row) ((eti)->uniform_row_height ? ETI_SINGLE_ROW_HEIGHT ((eti)) : ETI_MULTIPLE_ROW_HEIGHT((eti),(row))) inline static gint -model_to_view_row(ETableItem *eti, int row) +model_to_view_row(ETableItem *eti, gint row) { - int i; + gint i; if (row == -1) return -1; if (eti->uses_source_model) { @@ -144,7 +144,7 @@ model_to_view_row(ETableItem *eti, int row) } inline static gint -view_to_model_row(ETableItem *eti, int row) +view_to_model_row(ETableItem *eti, gint row) { if (eti->uses_source_model) { ETableSubset *etss = E_TABLE_SUBSET(eti->table_model); @@ -158,9 +158,9 @@ view_to_model_row(ETableItem *eti, int row) } inline static gint -model_to_view_col(ETableItem *eti, int col) +model_to_view_col(ETableItem *eti, gint col) { - int i; + gint i; if (col == -1) return -1; for (i = 0; i < eti->cols; i++) { @@ -172,7 +172,7 @@ model_to_view_col(ETableItem *eti, int col) } inline static gint -view_to_model_col(ETableItem *eti, int col) +view_to_model_col(ETableItem *eti, gint col) { ETableCol *ecol = e_table_header_get_column (eti->header, col); return ecol ? ecol->col_idx : -1; @@ -243,7 +243,7 @@ eti_editing (ETableItem *eti) } inline static GdkColor * -eti_get_cell_background_color (ETableItem *eti, int row, int col, gboolean selected, gboolean *allocatedp) +eti_get_cell_background_color (ETableItem *eti, gint row, gint col, gboolean selected, gboolean *allocatedp) { ECellView *ecell_view = eti->cell_views [col]; GtkWidget *canvas = GTK_WIDGET(GNOME_CANVAS_ITEM(eti)->canvas); @@ -291,7 +291,7 @@ eti_get_cell_background_color (ETableItem *eti, int row, int col, gboolean selec } inline static GdkColor * -eti_get_cell_foreground_color (ETableItem *eti, int row, int col, gboolean selected, gboolean *allocated) +eti_get_cell_foreground_color (ETableItem *eti, gint row, gint col, gboolean selected, gboolean *allocated) { GtkWidget *canvas = GTK_WIDGET(GNOME_CANVAS_ITEM(eti)->canvas); GdkColor *foreground; @@ -336,7 +336,7 @@ eti_free_save_state (ETableItem *eti) static void eti_realize_cell_views ( ETableItem *eti) { - int i; + gint i; if (eti->cell_views_realized) return; @@ -352,7 +352,7 @@ eti_realize_cell_views ( ETableItem *eti) static void eti_attach_cell_views (ETableItem *eti) { - int i; + gint i; g_return_if_fail (eti->header); g_return_if_fail (eti->table_model); @@ -390,7 +390,7 @@ eti_attach_cell_views (ETableItem *eti) static void eti_unrealize_cell_views (ETableItem *eti) { - int i; + gint i; if (eti->cell_views_realized == 0) return; @@ -405,7 +405,7 @@ eti_unrealize_cell_views (ETableItem *eti) static void eti_detach_cell_views (ETableItem *eti) { - int i; + gint i; eti_free_save_state (eti); @@ -449,7 +449,7 @@ eti_reflow (GnomeCanvasItem *item, gint flags) ETableItem *eti = E_TABLE_ITEM (item); if (eti->needs_compute_height) { - int new_height = eti_get_height (eti); + gint new_height = eti_get_height (eti); if (new_height != eti->height) { eti->height = new_height; @@ -460,7 +460,7 @@ eti_reflow (GnomeCanvasItem *item, gint flags) eti->needs_compute_height = 0; } if (eti->needs_compute_width) { - int new_width = e_table_header_total_width(eti->header); + gint new_width = e_table_header_total_width(eti->header); if (new_width != eti->width) { eti->width = new_width; e_canvas_item_request_parent_reflow (GNOME_CANVAS_ITEM (eti)); @@ -475,7 +475,7 @@ eti_reflow (GnomeCanvasItem *item, gint flags) * GnomeCanvasItem::update method */ static void -eti_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, int flags) +eti_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, gint flags) { ArtPoint o1, o2; ETableItem *eti = E_TABLE_ITEM (item); @@ -610,11 +610,11 @@ eti_remove_header_model (ETableItem *eti) * used as a separator between rows */ static int -eti_row_height_real (ETableItem *eti, int row) +eti_row_height_real (ETableItem *eti, gint row) { - const int cols = e_table_header_count (eti->header); - int col; - int h, max_h; + const gint cols = e_table_header_count (eti->header); + gint col; + gint h, max_h; g_return_val_if_fail (cols == 0 || eti->cell_views, 0); @@ -632,7 +632,7 @@ eti_row_height_real (ETableItem *eti, int row) static void confirm_height_cache (ETableItem *eti) { - int i; + gint i; if (eti->uniform_row_height || eti->height_cache) return; @@ -645,8 +645,8 @@ confirm_height_cache (ETableItem *eti) static gboolean height_cache_idle(ETableItem *eti) { - int changed = 0; - int i; + gint changed = 0; + gint i; confirm_height_cache(eti); for (i = eti->height_cache_idle_count; i < eti->rows; i++) { if (eti->height_cache[i] == -1) { @@ -699,7 +699,7 @@ calculate_height_cache (ETableItem *eti) * used as a separator between rows */ static int -eti_row_height (ETableItem *eti, int row) +eti_row_height (ETableItem *eti, gint row) { if (eti->uniform_row_height) { eti->uniform_row_height_cache = eti_row_height_real (eti, -1); @@ -737,21 +737,21 @@ eti_row_height (ETableItem *eti, int row) static int eti_get_height (ETableItem *eti) { - const int rows = eti->rows; - int height_extra = eti->horizontal_draw_grid ? 1 : 0; + const gint rows = eti->rows; + gint height_extra = eti->horizontal_draw_grid ? 1 : 0; if (rows == 0) return 0; if (eti->uniform_row_height) { - int row_height = eti_row_height(eti, -1); + gint row_height = eti_row_height(eti, -1); return ((row_height + height_extra) * rows + height_extra); } else { - int height; - int row; + gint height; + gint row; if (eti->length_threshold != -1){ if (rows > eti->length_threshold){ - int row_height = eti_row_height(eti, 0); + gint row_height = eti_row_height(eti, 0); if (eti->height_cache) { height = 0; for (row = 0; row < rows; row++) { @@ -781,7 +781,7 @@ eti_get_height (ETableItem *eti) } static void -eti_item_region_redraw (ETableItem *eti, int x0, int y0, int x1, int y1) +eti_item_region_redraw (ETableItem *eti, gint x0, gint y0, gint x1, gint y1) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti); ArtDRect rect; @@ -801,10 +801,10 @@ eti_item_region_redraw (ETableItem *eti, int x0, int y0, int x1, int y1) /* * Computes the distance between @start_row and @end_row in pixels */ -int -e_table_item_row_diff (ETableItem *eti, int start_row, int end_row) +gint +e_table_item_row_diff (ETableItem *eti, gint start_row, gint end_row) { - int height_extra = eti->horizontal_draw_grid ? 1 : 0; + gint height_extra = eti->horizontal_draw_grid ? 1 : 0; if (start_row < 0) start_row = 0; @@ -814,7 +814,7 @@ e_table_item_row_diff (ETableItem *eti, int start_row, int end_row) if (eti->uniform_row_height) { return ((end_row - start_row) * (eti_row_height(eti, -1) + height_extra)); } else { - int row, total; + gint row, total; total = 0; for (row = start_row; row < end_row; row++) total += eti_row_height (eti, row) + height_extra; @@ -825,12 +825,12 @@ e_table_item_row_diff (ETableItem *eti, int start_row, int end_row) static void eti_get_region (ETableItem *eti, - int start_col, int start_row, - int end_col, int end_row, - int *x1p, int *y1p, - int *x2p, int *y2p) + gint start_col, gint start_row, + gint end_col, gint end_row, + gint *x1p, gint *y1p, + gint *x2p, gint *y2p) { - int x1, y1, x2, y2; + gint x1, y1, x2, y2; x1 = e_table_header_col_diff (eti->header, 0, start_col); y1 = e_table_item_row_diff (eti, 0, start_row); @@ -858,10 +858,10 @@ eti_get_region (ETableItem *eti, */ static void eti_request_region_redraw (ETableItem *eti, - int start_col, int start_row, - int end_col, int end_row, int border) + gint start_col, gint start_row, + gint end_col, gint end_row, gint border) { - int x1, y1, x2, y2; + gint x1, y1, x2, y2; if (eti->rows > 0) { @@ -885,10 +885,10 @@ eti_request_region_redraw (ETableItem *eti, */ static void eti_request_region_show (ETableItem *eti, - int start_col, int start_row, - int end_col, int end_row, int delay) + gint start_col, gint start_row, + gint end_col, gint end_row, gint delay) { - int x1, y1, x2, y2; + gint x1, y1, x2, y2; eti_get_region (eti, start_col, start_row, @@ -902,9 +902,9 @@ eti_request_region_show (ETableItem *eti, } static void -eti_show_cursor (ETableItem *eti, int delay) +eti_show_cursor (ETableItem *eti, gint delay) { - int cursor_row; + gint cursor_row; if (!((GTK_OBJECT_FLAGS(eti) & GNOME_CANVAS_ITEM_REALIZED) && eti->cell_views_realized)) return; @@ -953,8 +953,8 @@ eti_check_cursor_on_screen (ETableItem *eti) static void eti_check_cursor_bounds (ETableItem *eti) { - int x1, y1, x2, y2; - int cursor_row; + gint x1, y1, x2, y2; + gint cursor_row; if (!((GTK_OBJECT_FLAGS(eti) & GNOME_CANVAS_ITEM_REALIZED) && eti->cell_views_realized)) return; @@ -1002,7 +1002,7 @@ eti_check_cursor_bounds (ETableItem *eti) } static void -eti_maybe_show_cursor(ETableItem *eti, int delay) +eti_maybe_show_cursor(ETableItem *eti, gint delay) { d(g_print ("%s: cursor on screen: %s\n", __FUNCTION__, eti->cursor_on_screen ? "TRUE" : "FALSE")); if (eti->cursor_on_screen) @@ -1122,7 +1122,7 @@ eti_table_model_changed (ETableModel *table_model, ETableItem *eti) } static void -eti_table_model_row_changed (ETableModel *table_model, int row, ETableItem *eti) +eti_table_model_row_changed (ETableModel *table_model, gint row, ETableItem *eti) { if (!(GTK_OBJECT_FLAGS(eti) & GNOME_CANVAS_ITEM_REALIZED)) { eti_unfreeze (eti); @@ -1140,7 +1140,7 @@ eti_table_model_row_changed (ETableModel *table_model, int row, ETableItem *eti) } static void -eti_table_model_cell_changed (ETableModel *table_model, int col, int row, ETableItem *eti) +eti_table_model_cell_changed (ETableModel *table_model, gint col, gint row, ETableItem *eti) { if (!(GTK_OBJECT_FLAGS(eti) & GNOME_CANVAS_ITEM_REALIZED)) { eti_unfreeze (eti); @@ -1158,7 +1158,7 @@ eti_table_model_cell_changed (ETableModel *table_model, int col, int row, ETable } static void -eti_table_model_rows_inserted (ETableModel *table_model, int row, int count, ETableItem *eti) +eti_table_model_rows_inserted (ETableModel *table_model, gint row, gint count, ETableItem *eti) { if (!(GTK_OBJECT_FLAGS(eti) & GNOME_CANVAS_ITEM_REALIZED)) { eti_unfreeze (eti); @@ -1167,7 +1167,7 @@ eti_table_model_rows_inserted (ETableModel *table_model, int row, int count, ETa eti->rows = e_table_model_row_count (eti->table_model); if (eti->height_cache) { - int i; + gint i; eti->height_cache = g_renew(int, eti->height_cache, eti->rows); memmove(eti->height_cache + row + count, eti->height_cache + row, (eti->rows - count - row) * sizeof(int)); for (i = row; i < row + count; i++) @@ -1185,7 +1185,7 @@ eti_table_model_rows_inserted (ETableModel *table_model, int row, int count, ETa } static void -eti_table_model_rows_deleted (ETableModel *table_model, int row, int count, ETableItem *eti) +eti_table_model_rows_deleted (ETableModel *table_model, gint row, gint count, ETableItem *eti) { if (!(GTK_OBJECT_FLAGS(eti) & GNOME_CANVAS_ITEM_REALIZED)) { eti_unfreeze (eti); @@ -1221,11 +1221,11 @@ eti_table_model_rows_deleted (ETableModel *table_model, int row, int count, ETab */ void e_table_item_redraw_range (ETableItem *eti, - int start_col, int start_row, - int end_col, int end_row) + gint start_col, gint start_row, + gint end_col, gint end_row) { - int border; - int cursor_col, cursor_row; + gint border; + gint cursor_col, cursor_row; g_return_if_fail (eti != NULL); g_return_if_fail (E_IS_TABLE_ITEM (eti)); @@ -1248,7 +1248,7 @@ e_table_item_redraw_range (ETableItem *eti, static void e_table_item_redraw_row (ETableItem *eti, - int row) + gint row) { if (row != -1) e_table_item_redraw_range (eti, 0, row, eti->cols - 1, row); @@ -1337,7 +1337,7 @@ eti_add_selection_model (ETableItem *eti, ESelectionModel *selection) } static void -eti_header_dim_changed (ETableHeader *eth, int col, ETableItem *eti) +eti_header_dim_changed (ETableHeader *eth, gint col, ETableItem *eti) { eti->needs_compute_width = 1; e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (eti)); @@ -1373,9 +1373,9 @@ eti_header_structure_changed (ETableHeader *eth, ETableItem *eti) } static int -eti_request_column_width (ETableHeader *eth, int col, ETableItem *eti) +eti_request_column_width (ETableHeader *eth, gint col, ETableItem *eti) { - int width = 0; + gint width = 0; if (eti->cell_views && eti->cell_views_realized) { width = e_cell_max_width (eti->cell_views[col], view_to_model_col(eti, col), col); @@ -1462,7 +1462,7 @@ static void eti_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { ETableItem *eti; - int cursor_col; + gint cursor_col; eti = E_TABLE_ITEM (object); @@ -1546,7 +1546,7 @@ static void eti_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { ETableItem *eti; - int row; + gint row; eti = E_TABLE_ITEM (object); @@ -1653,7 +1653,7 @@ eti_init (ETableItem *eti) #define gray50_width 2 #define gray50_height 2 -static const char gray50_bits[] = { +static const gchar gray50_bits[] = { 0x02, 0x01, }; static void @@ -1729,7 +1729,7 @@ eti_realize (GnomeCanvasItem *item) free_height_cache(eti); if (item->canvas->focused_item == NULL && eti->selection) { - int row; + gint row; row = e_selection_model_cursor_row (E_SELECTION_MODEL (eti->selection)); row = model_to_view_row(eti, row); @@ -1815,21 +1815,21 @@ eti_unrealize (GnomeCanvasItem *item) static void -eti_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int width, int height) +eti_draw (GnomeCanvasItem *item, GdkDrawable *drawable, gint x, gint y, gint width, gint height) { ETableItem *eti = E_TABLE_ITEM (item); - const int rows = eti->rows; - const int cols = eti->cols; - int row, col; - int first_col, last_col, x_offset; - int first_row, last_row, y_offset, yd; - int x1, x2; - int f_x1, f_x2, f_y1, f_y2; + const gint rows = eti->rows; + const gint cols = eti->cols; + gint row, col; + gint first_col, last_col, x_offset; + gint first_row, last_row, y_offset, yd; + gint x1, x2; + gint f_x1, f_x2, f_y1, f_y2; gboolean f_found; double i2c [6]; ArtPoint eti_base, eti_base_item, lower_right; GtkWidget *canvas = GTK_WIDGET(item->canvas); - int height_extra = eti->horizontal_draw_grid ? 1 : 0; + gint height_extra = eti->horizontal_draw_grid ? 1 : 0; cairo_t *cr; cr = gdk_cairo_create (drawable); @@ -1888,7 +1888,7 @@ eti_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int width, if (last_row > eti->rows) last_row = eti->rows; } else { - int y1, y2; + gint y1, y2; y_offset = 0; first_row = -1; @@ -1934,7 +1934,7 @@ eti_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int width, yd += height_extra; for (row = first_row; row < last_row; row++){ - int xd; + gint xd; gboolean selected; gint cursor_col, cursor_row; @@ -1957,7 +1957,7 @@ eti_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int width, ECellFlags flags; gboolean free_background; GdkColor *background; - int x1, x2, y1, y2; + gint x1, x2, y1, y2; cairo_pattern_t *pat; switch (eti->cursor_mode) { @@ -2082,7 +2082,7 @@ eti_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int width, } if (eti->vertical_draw_grid){ - int xd = x_offset; + gint xd = x_offset; for (col = first_col; col <= last_col; col++){ ETableCol *ecol = e_table_header_get_column (eti->header, col); @@ -2113,7 +2113,7 @@ exit: } static double -eti_point (GnomeCanvasItem *item, double x, double y, int cx, int cy, +eti_point (GnomeCanvasItem *item, double x, double y, gint cx, gint cy, GnomeCanvasItem **actual_item) { *actual_item = item; @@ -2122,14 +2122,14 @@ eti_point (GnomeCanvasItem *item, double x, double y, int cx, int cy, } static gboolean -find_cell (ETableItem *eti, double x, double y, int *view_col_res, int *view_row_res, double *x1_res, double *y1_res) +find_cell (ETableItem *eti, double x, double y, gint *view_col_res, gint *view_row_res, double *x1_res, double *y1_res) { - const int cols = eti->cols; - const int rows = eti->rows; + const gint cols = eti->cols; + const gint rows = eti->rows; gdouble x1, y1, x2, y2; - int col, row; + gint col, row; - int height_extra = eti->horizontal_draw_grid ? 1 : 0; + gint height_extra = eti->horizontal_draw_grid ? 1 : 0; /* FIXME: this routine is inneficient, fix later */ @@ -2200,7 +2200,7 @@ eti_cursor_move (ETableItem *eti, gint row, gint column) static void eti_cursor_move_left (ETableItem *eti) { - int cursor_col, cursor_row; + gint cursor_col, cursor_row; g_object_get(eti->selection, "cursor_col", &cursor_col, "cursor_row", &cursor_row, @@ -2212,7 +2212,7 @@ eti_cursor_move_left (ETableItem *eti) static void eti_cursor_move_right (ETableItem *eti) { - int cursor_col, cursor_row; + gint cursor_col, cursor_row; g_object_get(eti->selection, "cursor_col", &cursor_col, "cursor_row", &cursor_row, @@ -2229,7 +2229,7 @@ _do_tooltip (ETableItem *eti) gboolean free_color; ETableCol *ecol; gboolean selected; - int cursor_row, cursor_col; + gint cursor_row, cursor_col; e_canvas_hide_tooltip (E_CANVAS(GNOME_CANVAS_ITEM(eti)->canvas)); @@ -2287,7 +2287,7 @@ _do_tooltip (ETableItem *eti) #endif static gint -eti_e_cell_event (ETableItem *item, ECellView *ecell_view, GdkEvent *event, int time, int model_col, int view_col, int row, ECellFlags flags) +eti_e_cell_event (ETableItem *item, ECellView *ecell_view, GdkEvent *event, gint time, gint model_col, gint view_col, gint row, ECellFlags flags) { ECellActions actions = 0; gint ret_val; @@ -2330,7 +2330,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) double x1, y1; double realx, realy; GdkEventButton button; - int col, row; + gint col, row; gint cursor_row, cursor_col; gint new_cursor_row, new_cursor_col; ECellFlags flags = 0; @@ -2457,7 +2457,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) case GDK_BUTTON_RELEASE: { double x1, y1; - int col, row; + gint col, row; gint cursor_row, cursor_col; d(g_print("%s: GDK_BUTTON_RELEASE received, button %d\n", __FUNCTION__, e->button.button)); @@ -2540,7 +2540,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) } case GDK_2BUTTON_PRESS: { - int model_col, model_row; + gint model_col, model_row; #if 0 double x1, y1; #endif @@ -2596,7 +2596,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) break; } case GDK_MOTION_NOTIFY: { - int col, row, flags; + gint col, row, flags; double x1, y1; gint cursor_col, cursor_row; @@ -2956,8 +2956,8 @@ eti_style_set (ETableItem *eti, GtkStyle *previous_style) return; if (eti->cell_views_realized) { - int i; - int n_cells = eti->n_cells; + gint i; + gint n_cells = eti->n_cells; for (i = 0; i < n_cells; i++) { e_cell_style_set (eti->cell_views[i], previous_style); @@ -3209,13 +3209,13 @@ eti_class_init (ETableItemClass *klass) * This routine sets the cursor of the %ETableItem canvas item. */ void -e_table_item_set_cursor (ETableItem *eti, int col, int row) +e_table_item_set_cursor (ETableItem *eti, gint col, gint row) { e_table_item_focus(eti, col, view_to_model_row(eti, row), 0); } static void -e_table_item_focus (ETableItem *eti, int col, int row, GdkModifierType state) +e_table_item_focus (ETableItem *eti, gint col, gint row, GdkModifierType state) { g_return_if_fail (eti != NULL); g_return_if_fail (E_IS_TABLE_ITEM (eti)); @@ -3246,7 +3246,7 @@ e_table_item_focus (ETableItem *eti, int col, int row, GdkModifierType state) gint e_table_item_get_focused_column (ETableItem *eti) { - int cursor_col; + gint cursor_col; g_return_val_if_fail (eti != NULL, -1); g_return_val_if_fail (E_IS_TABLE_ITEM (eti), -1); @@ -3259,9 +3259,9 @@ e_table_item_get_focused_column (ETableItem *eti) } static void -eti_cursor_change (ESelectionModel *selection, int row, int col, ETableItem *eti) +eti_cursor_change (ESelectionModel *selection, gint row, gint col, ETableItem *eti) { - int view_row; + gint view_row; if (!(GTK_OBJECT_FLAGS(eti) & GNOME_CANVAS_ITEM_REALIZED)) return; @@ -3297,10 +3297,10 @@ eti_cursor_change (ESelectionModel *selection, int row, int col, ETableItem *eti } static void -eti_cursor_activated (ESelectionModel *selection, int row, int col, ETableItem *eti) +eti_cursor_activated (ESelectionModel *selection, gint row, gint col, ETableItem *eti) { - int view_row; - int view_col; + gint view_row; + gint view_col; if (!(GTK_OBJECT_FLAGS(eti) & GNOME_CANVAS_ITEM_REALIZED)) return; @@ -3338,7 +3338,7 @@ eti_selection_change (ESelectionModel *selection, ETableItem *eti) } static void -eti_selection_row_change (ESelectionModel *selection, int row, ETableItem *eti) +eti_selection_row_change (ESelectionModel *selection, gint row, ETableItem *eti) { if (!(GTK_OBJECT_FLAGS(eti) & GNOME_CANVAS_ITEM_REALIZED)) return; @@ -3359,7 +3359,7 @@ eti_selection_row_change (ESelectionModel *selection, int row, ETableItem *eti) * column and row. */ void -e_table_item_enter_edit (ETableItem *eti, int col, int row) +e_table_item_enter_edit (ETableItem *eti, gint col, gint row) { g_return_if_fail (eti != NULL); g_return_if_fail (E_IS_TABLE_ITEM (eti)); @@ -3384,8 +3384,8 @@ e_table_item_enter_edit (ETableItem *eti, int col, int row) void e_table_item_leave_edit (ETableItem *eti) { - int col, row; - void *edit_ctx; + gint col, row; + gpointer edit_ctx; g_return_if_fail (eti != NULL); g_return_if_fail (E_IS_TABLE_ITEM (eti)); @@ -3424,14 +3424,14 @@ e_table_item_leave_edit (ETableItem *eti) */ void e_table_item_compute_location (ETableItem *eti, - int *x, - int *y, - int *row, - int *col) + gint *x, + gint *y, + gint *row, + gint *col) { /* Save the grabbed row but make sure that we don't get flawed results because the cursor is grabbed. */ - int grabbed_row = eti->grabbed_row; + gint grabbed_row = eti->grabbed_row; eti->grabbed_row = -1; if (!find_cell (eti, *x, *y, col, row, NULL, NULL)) { @@ -3448,15 +3448,15 @@ e_table_item_compute_location (ETableItem *eti, **/ void e_table_item_compute_mouse_over (ETableItem *eti, - int x, - int y, - int *row, - int *col) + gint x, + gint y, + gint *row, + gint *col) { double realx, realy; /* Save the grabbed row but make sure that we don't get flawed results because the cursor is grabbed. */ - int grabbed_row = eti->grabbed_row; + gint grabbed_row = eti->grabbed_row; eti->grabbed_row = -1; realx = x; @@ -3474,12 +3474,12 @@ e_table_item_compute_mouse_over (ETableItem *eti, void e_table_item_get_cell_geometry (ETableItem *eti, - int *row, - int *col, - int *x, - int *y, - int *width, - int *height) + gint *row, + gint *col, + gint *x, + gint *y, + gint *width, + gint *height) { if (eti->rows > *row) { if (x) @@ -3499,16 +3499,16 @@ e_table_item_get_cell_geometry (ETableItem *eti, typedef struct { ETableItem *item; - int rows_printed; + gint rows_printed; } ETableItemPrintContext; static gdouble * e_table_item_calculate_print_widths (ETableHeader *eth, gdouble width) { - int i; + gint i; double extra; double expansion; - int last_resizable = -1; + gint last_resizable = -1; gdouble scale = 1.0L; gdouble *widths = g_new(gdouble, e_table_header_count(eth)); /* - 1 to account for the last pixel border. */ @@ -3531,8 +3531,8 @@ e_table_item_calculate_print_widths (ETableHeader *eth, gdouble width) static gdouble eti_printed_row_height (ETableItem *eti, gdouble *widths, GtkPrintContext *context, gint row) { - int col; - int cols = eti->cols; + gint col; + gint cols = eti->cols; gdouble height = 0; for (col = 0; col < cols; col++) { ECellView *ecell_view = eti->cell_views [col]; @@ -3568,11 +3568,11 @@ e_table_item_print_page (EPrintable *ep, ETableItemPrintContext *itemcontext) { ETableItem *eti = itemcontext->item; - const int rows = eti->rows; - const int cols = eti->cols; + const gint rows = eti->rows; + const gint cols = eti->cols; gdouble max_height; - int rows_printed = itemcontext->rows_printed; - int row, col, next_page = 0; + gint rows_printed = itemcontext->rows_printed; + gint row, col, next_page = 0; double yd = height; cairo_t *cr; gdouble *widths; @@ -3655,7 +3655,7 @@ e_table_item_data_left (EPrintable *ep, ETableItemPrintContext *itemcontext) { ETableItem *item = itemcontext->item; - int rows_printed = itemcontext->rows_printed; + gint rows_printed = itemcontext->rows_printed; g_signal_stop_emission_by_name(ep, "data_left"); return rows_printed < item->rows; @@ -3677,10 +3677,10 @@ e_table_item_height (EPrintable *ep, ETableItemPrintContext *itemcontext) { ETableItem *item = itemcontext->item; - const int rows = item->rows; - int rows_printed = itemcontext->rows_printed; + const gint rows = item->rows; + gint rows_printed = itemcontext->rows_printed; gdouble *widths; - int row; + gint row; gdouble yd = 0; widths = e_table_item_calculate_print_widths (itemcontext->item->header, width); @@ -3727,10 +3727,10 @@ e_table_item_will_fit (EPrintable *ep, ETableItemPrintContext *itemcontext) { ETableItem *item = itemcontext->item; - const int rows = item->rows; - int rows_printed = itemcontext->rows_printed; + const gint rows = item->rows; + gint rows_printed = itemcontext->rows_printed; gdouble *widths; - int row; + gint row; gdouble yd = 0; gboolean ret_val = TRUE; diff --git a/widgets/table/e-table-item.h b/widgets/table/e-table-item.h index befadb77ca..0536367c99 100644 --- a/widgets/table/e-table-item.h +++ b/widgets/table/e-table-item.h @@ -49,41 +49,41 @@ typedef struct { ETableModel *source_model; ESelectionModel *selection; - int x1, y1; - int minimum_width, width, height; + gint x1, y1; + gint minimum_width, width, height; - int cols, rows; + gint cols, rows; - int click_count; + gint click_count; /* * Ids for the signals we connect to */ - int header_dim_change_id; - int header_structure_change_id; - int header_request_width_id; - int table_model_pre_change_id; - int table_model_no_change_id; - int table_model_change_id; - int table_model_row_change_id; - int table_model_cell_change_id; - int table_model_rows_inserted_id; - int table_model_rows_deleted_id; - - int selection_change_id; - int selection_row_change_id; - int cursor_change_id; - int cursor_activated_id; + gint header_dim_change_id; + gint header_structure_change_id; + gint header_request_width_id; + gint table_model_pre_change_id; + gint table_model_no_change_id; + gint table_model_change_id; + gint table_model_row_change_id; + gint table_model_cell_change_id; + gint table_model_rows_inserted_id; + gint table_model_rows_deleted_id; + + gint selection_change_id; + gint selection_row_change_id; + gint cursor_change_id; + gint cursor_activated_id; guint cursor_idle_id; /* View row, -1 means unknown */ - int old_cursor_row; + gint old_cursor_row; - int hadjustment_change_id; - int hadjustment_value_change_id; - int vadjustment_change_id; - int vadjustment_value_change_id; + gint hadjustment_change_id; + gint hadjustment_value_change_id; + gint vadjustment_change_id; + gint vadjustment_value_change_id; GdkGC *fill_gc; GdkGC *grid_gc; @@ -117,52 +117,52 @@ typedef struct { guint queue_show_cursor : 1; guint grab_cancelled : 1; - int frozen_count; + gint frozen_count; - int cursor_x1; - int cursor_y1; - int cursor_x2; - int cursor_y2; + gint cursor_x1; + gint cursor_y1; + gint cursor_x2; + gint cursor_y2; - int drag_col; - int drag_row; - int drag_x; - int drag_y; + gint drag_col; + gint drag_row; + gint drag_x; + gint drag_y; guint drag_state; /* * Realized views, per column */ ECellView **cell_views; - int n_cells; + gint n_cells; - int *height_cache; - int uniform_row_height_cache; - int height_cache_idle_id; - int height_cache_idle_count; + gint *height_cache; + gint uniform_row_height_cache; + gint height_cache_idle_id; + gint height_cache_idle_count; /* * Lengh Threshold: above this, we stop computing correctly * the size */ - int length_threshold; + gint length_threshold; gint row_guess; ECursorMode cursor_mode; - int motion_col, motion_row; + gint motion_col, motion_row; /* * During editing */ - int editing_col, editing_row; + gint editing_col, editing_row; void *edit_ctx; - int save_col, save_row; + gint save_col, save_row; void *save_state; - int grabbed_col, grabbed_row; - int grabbed_count; + gint grabbed_col, grabbed_row; + gint grabbed_count; /* * Tooltip @@ -174,13 +174,13 @@ typedef struct { typedef struct { GnomeCanvasItemClass parent_class; - void (*cursor_change) (ETableItem *eti, int row); - void (*cursor_activated) (ETableItem *eti, int row); - void (*double_click) (ETableItem *eti, int row, int col, GdkEvent *event); - gint (*right_click) (ETableItem *eti, int row, int col, GdkEvent *event); - gint (*click) (ETableItem *eti, int row, int col, GdkEvent *event); - gint (*key_press) (ETableItem *eti, int row, int col, GdkEvent *event); - gint (*start_drag) (ETableItem *eti, int row, int col, GdkEvent *event); + void (*cursor_change) (ETableItem *eti, gint row); + void (*cursor_activated) (ETableItem *eti, gint row); + void (*double_click) (ETableItem *eti, gint row, gint col, GdkEvent *event); + gint (*right_click) (ETableItem *eti, gint row, gint col, GdkEvent *event); + gint (*click) (ETableItem *eti, gint row, gint col, GdkEvent *event); + gint (*key_press) (ETableItem *eti, gint row, gint col, GdkEvent *event); + gint (*start_drag) (ETableItem *eti, gint row, gint col, GdkEvent *event); void (*style_set) (ETableItem *eti, GtkStyle *previous_style); void (*selection_model_removed) (ETableItem *eti, ESelectionModel *selection); void (*selection_model_added) (ETableItem *eti, ESelectionModel *selection); @@ -192,40 +192,40 @@ GType e_table_item_get_type (void); * Focus */ void e_table_item_set_cursor (ETableItem *eti, - int col, - int row); + gint col, + gint row); gint e_table_item_get_focused_column (ETableItem *eti); void e_table_item_leave_edit (ETableItem *eti); void e_table_item_enter_edit (ETableItem *eti, - int col, - int row); + gint col, + gint row); void e_table_item_redraw_range (ETableItem *eti, - int start_col, - int start_row, - int end_col, - int end_row); + gint start_col, + gint start_row, + gint end_col, + gint end_row); EPrintable *e_table_item_get_printable (ETableItem *eti); void e_table_item_compute_location (ETableItem *eti, - int *x, - int *y, - int *row, - int *col); + gint *x, + gint *y, + gint *row, + gint *col); void e_table_item_compute_mouse_over (ETableItem *eti, - int x, - int y, - int *row, - int *col); + gint x, + gint y, + gint *row, + gint *col); void e_table_item_get_cell_geometry (ETableItem *eti, - int *row, - int *col, - int *x, - int *y, - int *width, - int *height); + gint *row, + gint *col, + gint *x, + gint *y, + gint *width, + gint *height); int e_table_item_row_diff (ETableItem *eti, int start_row, diff --git a/widgets/table/e-table-memory-callbacks.c b/widgets/table/e-table-memory-callbacks.c index b1833aa2e1..c06303ca4b 100644 --- a/widgets/table/e-table-memory-callbacks.c +++ b/widgets/table/e-table-memory-callbacks.c @@ -40,8 +40,8 @@ etmc_column_count (ETableModel *etm) return 0; } -static void * -etmc_value_at (ETableModel *etm, int col, int row) +static gpointer +etmc_value_at (ETableModel *etm, gint col, gint row) { ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS(etm); @@ -52,7 +52,7 @@ etmc_value_at (ETableModel *etm, int col, int row) } static void -etmc_set_value_at (ETableModel *etm, int col, int row, const void *val) +etmc_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) { ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS(etm); @@ -61,7 +61,7 @@ etmc_set_value_at (ETableModel *etm, int col, int row, const void *val) } static gboolean -etmc_is_cell_editable (ETableModel *etm, int col, int row) +etmc_is_cell_editable (ETableModel *etm, gint col, gint row) { ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS(etm); @@ -72,19 +72,19 @@ etmc_is_cell_editable (ETableModel *etm, int col, int row) } /* The default for etmc_duplicate_value is to return the raw value. */ -static void * -etmc_duplicate_value (ETableModel *etm, int col, const void *value) +static gpointer +etmc_duplicate_value (ETableModel *etm, gint col, gconstpointer value) { ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS(etm); if (etmc->duplicate_value) return etmc->duplicate_value (etm, col, value, etmc->data); else - return (void *)value; + return (gpointer)value; } static void -etmc_free_value (ETableModel *etm, int col, void *value) +etmc_free_value (ETableModel *etm, gint col, gpointer value) { ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS(etm); @@ -92,8 +92,8 @@ etmc_free_value (ETableModel *etm, int col, void *value) etmc->free_value (etm, col, value, etmc->data); } -static void * -etmc_initialize_value (ETableModel *etm, int col) +static gpointer +etmc_initialize_value (ETableModel *etm, gint col) { ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS(etm); @@ -104,7 +104,7 @@ etmc_initialize_value (ETableModel *etm, int col) } static gboolean -etmc_value_is_empty (ETableModel *etm, int col, const void *value) +etmc_value_is_empty (ETableModel *etm, gint col, gconstpointer value) { ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS(etm); @@ -114,8 +114,8 @@ etmc_value_is_empty (ETableModel *etm, int col, const void *value) return FALSE; } -static char * -etmc_value_to_string (ETableModel *etm, int col, const void *value) +static gchar * +etmc_value_to_string (ETableModel *etm, gint col, gconstpointer value) { ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS(etm); @@ -126,7 +126,7 @@ etmc_value_to_string (ETableModel *etm, int col, const void *value) } static void -etmc_append_row (ETableModel *etm, ETableModel *source, int row) +etmc_append_row (ETableModel *etm, ETableModel *source, gint row) { ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS(etm); @@ -194,7 +194,7 @@ e_table_memory_callbacks_new (ETableMemoryCalbacksColumnCountFn col_count, ETableMemoryCalbacksInitializeValueFn initialize_value, ETableMemoryCalbacksValueIsEmptyFn value_is_empty, ETableMemoryCalbacksValueToStringFn value_to_string, - void *data) + gpointer data) { ETableMemoryCalbacks *et; diff --git a/widgets/table/e-table-memory-callbacks.h b/widgets/table/e-table-memory-callbacks.h index bfeacb284c..97e2e53421 100644 --- a/widgets/table/e-table-memory-callbacks.h +++ b/widgets/table/e-table-memory-callbacks.h @@ -34,18 +34,18 @@ G_BEGIN_DECLS #define E_IS_TABLE_MEMORY_CALLBACKS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_MEMORY_CALLBACKS_TYPE)) #define E_TABLE_MEMORY_CALLBACKS_GET_CLASS(k) (G_TYPE_INSTANCE_GET_CLASS((k), E_TABLE_MEMORY_CALLBACKS_TYPE, ETableMemoryCalbacksClass)) -typedef int (*ETableMemoryCalbacksColumnCountFn) (ETableModel *etm, void *data); -typedef void (*ETableMemoryCalbacksAppendRowFn) (ETableModel *etm, ETableModel *model, int row, void *data); +typedef gint (*ETableMemoryCalbacksColumnCountFn) (ETableModel *etm, gpointer data); +typedef void (*ETableMemoryCalbacksAppendRowFn) (ETableModel *etm, ETableModel *model, gint row, gpointer data); -typedef void *(*ETableMemoryCalbacksValueAtFn) (ETableModel *etm, int col, int row, void *data); -typedef void (*ETableMemoryCalbacksSetValueAtFn) (ETableModel *etm, int col, int row, const void *val, void *data); -typedef gboolean (*ETableMemoryCalbacksIsCellEditableFn) (ETableModel *etm, int col, int row, void *data); +typedef void *(*ETableMemoryCalbacksValueAtFn) (ETableModel *etm, gint col, gint row, gpointer data); +typedef void (*ETableMemoryCalbacksSetValueAtFn) (ETableModel *etm, gint col, gint row, gconstpointer val, gpointer data); +typedef gboolean (*ETableMemoryCalbacksIsCellEditableFn) (ETableModel *etm, gint col, gint row, gpointer data); -typedef void *(*ETableMemoryCalbacksDuplicateValueFn) (ETableModel *etm, int col, const void *val, void *data); -typedef void (*ETableMemoryCalbacksFreeValueFn) (ETableModel *etm, int col, void *val, void *data); -typedef void *(*ETableMemoryCalbacksInitializeValueFn) (ETableModel *etm, int col, void *data); -typedef gboolean (*ETableMemoryCalbacksValueIsEmptyFn) (ETableModel *etm, int col, const void *val, void *data); -typedef char *(*ETableMemoryCalbacksValueToStringFn) (ETableModel *etm, int col, const void *val, void *data); +typedef void *(*ETableMemoryCalbacksDuplicateValueFn) (ETableModel *etm, gint col, gconstpointer val, gpointer data); +typedef void (*ETableMemoryCalbacksFreeValueFn) (ETableModel *etm, gint col, gpointer val, gpointer data); +typedef void *(*ETableMemoryCalbacksInitializeValueFn) (ETableModel *etm, gint col, gpointer data); +typedef gboolean (*ETableMemoryCalbacksValueIsEmptyFn) (ETableModel *etm, gint col, gconstpointer val, gpointer data); +typedef gchar *(*ETableMemoryCalbacksValueToStringFn) (ETableModel *etm, gint col, gconstpointer val, gpointer data); typedef struct { ETableMemory parent; @@ -62,7 +62,7 @@ typedef struct { ETableMemoryCalbacksInitializeValueFn initialize_value; ETableMemoryCalbacksValueIsEmptyFn value_is_empty; ETableMemoryCalbacksValueToStringFn value_to_string; - void *data; + gpointer data; } ETableMemoryCalbacks; typedef struct { @@ -82,7 +82,7 @@ ETableModel *e_table_memory_callbacks_new (ETableMemoryCalbacksColumnCountFn col ETableMemoryCalbacksInitializeValueFn initialize_value, ETableMemoryCalbacksValueIsEmptyFn value_is_empty, ETableMemoryCalbacksValueToStringFn value_to_string, - void *data); + gpointer data); G_END_DECLS diff --git a/widgets/table/e-table-memory-store.c b/widgets/table/e-table-memory-store.c index 284823bc3d..622de851c0 100644 --- a/widgets/table/e-table-memory-store.c +++ b/widgets/table/e-table-memory-store.c @@ -31,27 +31,27 @@ #define STORE_LOCATOR(etms, col, row) (*((etms)->priv->store + (row) * (etms)->priv->col_count + (col))) struct _ETableMemoryStorePrivate { - int col_count; + gint col_count; ETableMemoryStoreColumnInfo *columns; - void **store; + gpointer *store; }; G_DEFINE_TYPE (ETableMemoryStore, e_table_memory_store, E_TABLE_MEMORY_TYPE) -static void * -duplicate_value (ETableMemoryStore *etms, int col, const void *val) +static gpointer +duplicate_value (ETableMemoryStore *etms, gint col, gconstpointer val) { switch (etms->priv->columns[col].type) { case E_TABLE_MEMORY_STORE_COLUMN_TYPE_STRING: return g_strdup (val); case E_TABLE_MEMORY_STORE_COLUMN_TYPE_PIXBUF: if (val) - g_object_ref ((void *) val); - return (void *) val; + g_object_ref ((gpointer) val); + return (gpointer) val; case E_TABLE_MEMORY_STORE_COLUMN_TYPE_OBJECT: if (val) - g_object_ref ((void *) val); - return (void *) val; + g_object_ref ((gpointer) val); + return (gpointer) val; case E_TABLE_MEMORY_STORE_COLUMN_TYPE_CUSTOM: if (etms->priv->columns[col].custom.duplicate_value) return etms->priv->columns[col].custom.duplicate_value (E_TABLE_MODEL (etms), col, val, NULL); @@ -59,11 +59,11 @@ duplicate_value (ETableMemoryStore *etms, int col, const void *val) default: break; } - return (void *) val; + return (gpointer) val; } static void -free_value (ETableMemoryStore *etms, int col, void *value) +free_value (ETableMemoryStore *etms, gint col, gpointer value) { switch (etms->priv->columns[col].type) { case E_TABLE_MEMORY_STORE_COLUMN_TYPE_STRING: @@ -95,8 +95,8 @@ etms_column_count (ETableModel *etm) return etms->priv->col_count; } -static void * -etms_value_at (ETableModel *etm, int col, int row) +static gpointer +etms_value_at (ETableModel *etm, gint col, gint row) { ETableMemoryStore *etms = E_TABLE_MEMORY_STORE(etm); @@ -104,7 +104,7 @@ etms_value_at (ETableModel *etm, int col, int row) } static void -etms_set_value_at (ETableModel *etm, int col, int row, const void *val) +etms_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) { ETableMemoryStore *etms = E_TABLE_MEMORY_STORE(etm); @@ -116,7 +116,7 @@ etms_set_value_at (ETableModel *etm, int col, int row, const void *val) } static gboolean -etms_is_cell_editable (ETableModel *etm, int col, int row) +etms_is_cell_editable (ETableModel *etm, gint col, gint row) { ETableMemoryStore *etms = E_TABLE_MEMORY_STORE(etm); @@ -124,8 +124,8 @@ etms_is_cell_editable (ETableModel *etm, int col, int row) } /* The default for etms_duplicate_value is to return the raw value. */ -static void * -etms_duplicate_value (ETableModel *etm, int col, const void *value) +static gpointer +etms_duplicate_value (ETableModel *etm, gint col, gconstpointer value) { ETableMemoryStore *etms = E_TABLE_MEMORY_STORE(etm); @@ -133,15 +133,15 @@ etms_duplicate_value (ETableModel *etm, int col, const void *value) } static void -etms_free_value (ETableModel *etm, int col, void *value) +etms_free_value (ETableModel *etm, gint col, gpointer value) { ETableMemoryStore *etms = E_TABLE_MEMORY_STORE(etm); free_value (etms, col, value); } -static void * -etms_initialize_value (ETableModel *etm, int col) +static gpointer +etms_initialize_value (ETableModel *etm, gint col) { ETableMemoryStore *etms = E_TABLE_MEMORY_STORE(etm); @@ -162,13 +162,13 @@ etms_initialize_value (ETableModel *etm, int col) } static gboolean -etms_value_is_empty (ETableModel *etm, int col, const void *value) +etms_value_is_empty (ETableModel *etm, gint col, gconstpointer value) { ETableMemoryStore *etms = E_TABLE_MEMORY_STORE(etm); switch (etms->priv->columns[col].type) { case E_TABLE_MEMORY_STORE_COLUMN_TYPE_STRING: - return !(value && *(char *) value); + return !(value && *(gchar *) value); case E_TABLE_MEMORY_STORE_COLUMN_TYPE_PIXBUF: return value == NULL; case E_TABLE_MEMORY_STORE_COLUMN_TYPE_CUSTOM: @@ -182,8 +182,8 @@ etms_value_is_empty (ETableModel *etm, int col, const void *value) return value == NULL; } -static char * -etms_value_to_string (ETableModel *etm, int col, const void *value) +static gchar * +etms_value_to_string (ETableModel *etm, gint col, gconstpointer value) { ETableMemoryStore *etms = E_TABLE_MEMORY_STORE(etm); @@ -204,14 +204,14 @@ etms_value_to_string (ETableModel *etm, int col, const void *value) } static void -etms_append_row (ETableModel *etm, ETableModel *source, int row) +etms_append_row (ETableModel *etm, ETableModel *source, gint row) { ETableMemoryStore *etms = E_TABLE_MEMORY_STORE(etm); - void **new_data; - int i; - int row_count; + gpointer *new_data; + gint i; + gint row_count; - new_data = g_new (void *, etms->priv->col_count); + new_data = g_new (gpointer , etms->priv->col_count); for (i = 0; i < etms->priv->col_count; i++) { new_data[i] = e_table_model_value_at (source, i, row); @@ -311,7 +311,7 @@ e_table_memory_store_new (ETableMemoryStoreColumnInfo *columns) ETableModel * e_table_memory_store_construct (ETableMemoryStore *etms, ETableMemoryStoreColumnInfo *columns) { - int i; + gint i; for (i = 0; columns[i].type != E_TABLE_MEMORY_STORE_COLUMN_TYPE_TERMINATOR; i++) /* Intentionally blank */; etms->priv->col_count = i; @@ -325,7 +325,7 @@ e_table_memory_store_construct (ETableMemoryStore *etms, ETableMemoryStoreColumn void -e_table_memory_store_adopt_value_at (ETableMemoryStore *etms, int col, int row, void *value) +e_table_memory_store_adopt_value_at (ETableMemoryStore *etms, gint col, gint row, gpointer value) { e_table_model_pre_change (E_TABLE_MODEL (etms)); @@ -336,18 +336,18 @@ e_table_memory_store_adopt_value_at (ETableMemoryStore *etms, int col, int row, /* The size of these arrays is the number of columns. */ void -e_table_memory_store_insert_array (ETableMemoryStore *etms, int row, void **store, gpointer data) +e_table_memory_store_insert_array (ETableMemoryStore *etms, gint row, gpointer *store, gpointer data) { - int row_count; - int i; + gint row_count; + gint i; row_count = e_table_model_row_count (E_TABLE_MODEL (etms)) + 1; if (row == -1) row = row_count - 1; - etms->priv->store = g_realloc (etms->priv->store, etms->priv->col_count * row_count * sizeof (void *)); + etms->priv->store = g_realloc (etms->priv->store, etms->priv->col_count * row_count * sizeof (gpointer)); memmove (etms->priv->store + etms->priv->col_count * (row + 1), etms->priv->store + etms->priv->col_count * row, - etms->priv->col_count * (row_count - row - 1) * sizeof (void *)); + etms->priv->col_count * (row_count - row - 1) * sizeof (gpointer)); for (i = 0; i < etms->priv->col_count; i++) { STORE_LOCATOR(etms, i, row) = duplicate_value(etms, i, store[i]); @@ -357,17 +357,17 @@ e_table_memory_store_insert_array (ETableMemoryStore *etms, int row, void **stor } void -e_table_memory_store_insert (ETableMemoryStore *etms, int row, gpointer data, ...) +e_table_memory_store_insert (ETableMemoryStore *etms, gint row, gpointer data, ...) { - void **store; + gpointer *store; va_list args; - int i; + gint i; - store = g_new (void *, etms->priv->col_count + 1); + store = g_new (gpointer , etms->priv->col_count + 1); va_start (args, data); for (i = 0; i < etms->priv->col_count; i++) { - store[i] = va_arg (args, void *); + store[i] = va_arg (args, gpointer ); } va_end (args); @@ -377,18 +377,18 @@ e_table_memory_store_insert (ETableMemoryStore *etms, int row, gpointer data, .. } void -e_table_memory_store_insert_adopt_array (ETableMemoryStore *etms, int row, void **store, gpointer data) +e_table_memory_store_insert_adopt_array (ETableMemoryStore *etms, gint row, gpointer *store, gpointer data) { - int row_count; - int i; + gint row_count; + gint i; row_count = e_table_model_row_count (E_TABLE_MODEL (etms)) + 1; if (row == -1) row = row_count - 1; - etms->priv->store = g_realloc (etms->priv->store, etms->priv->col_count * row_count * sizeof (void *)); + etms->priv->store = g_realloc (etms->priv->store, etms->priv->col_count * row_count * sizeof (gpointer)); memmove (etms->priv->store + etms->priv->col_count * (row + 1), etms->priv->store + etms->priv->col_count * row, - etms->priv->col_count * (row_count - row - 1) * sizeof (void *)); + etms->priv->col_count * (row_count - row - 1) * sizeof (gpointer)); for (i = 0; i < etms->priv->col_count; i++) { STORE_LOCATOR(etms, i, row) = store[i]; @@ -398,17 +398,17 @@ e_table_memory_store_insert_adopt_array (ETableMemoryStore *etms, int row, void } void -e_table_memory_store_insert_adopt (ETableMemoryStore *etms, int row, gpointer data, ...) +e_table_memory_store_insert_adopt (ETableMemoryStore *etms, gint row, gpointer data, ...) { - void **store; + gpointer *store; va_list args; - int i; + gint i; - store = g_new (void *, etms->priv->col_count + 1); + store = g_new (gpointer , etms->priv->col_count + 1); va_start (args, data); for (i = 0; i < etms->priv->col_count; i++) { - store[i] = va_arg (args, void *); + store[i] = va_arg (args, gpointer ); } va_end (args); @@ -429,9 +429,9 @@ e_table_memory_store_insert_adopt (ETableMemoryStore *etms, int row, gpointer da * */ void -e_table_memory_store_change_array (ETableMemoryStore *etms, int row, void **store, gpointer data) +e_table_memory_store_change_array (ETableMemoryStore *etms, gint row, gpointer *store, gpointer data) { - int i; + gint i; g_return_if_fail (row >= 0 && row < e_table_model_row_count (E_TABLE_MODEL (etms))); @@ -456,19 +456,19 @@ e_table_memory_store_change_array (ETableMemoryStore *etms, int row, void **stor * pass in etms->col_count args. */ void -e_table_memory_store_change (ETableMemoryStore *etms, int row, gpointer data, ...) +e_table_memory_store_change (ETableMemoryStore *etms, gint row, gpointer data, ...) { - void **store; + gpointer *store; va_list args; - int i; + gint i; g_return_if_fail (row >= 0 && row < e_table_model_row_count (E_TABLE_MODEL (etms))); - store = g_new0 (void *, etms->priv->col_count + 1); + store = g_new0 (gpointer , etms->priv->col_count + 1); va_start (args, data); for (i = 0; i < etms->priv->col_count; i++) { - store[i] = va_arg (args, void *); + store[i] = va_arg (args, gpointer ); } va_end (args); @@ -490,9 +490,9 @@ e_table_memory_store_change (ETableMemoryStore *etms, int row, gpointer data, .. * duplicate the data. */ void -e_table_memory_store_change_adopt_array (ETableMemoryStore *etms, int row, void **store, gpointer data) +e_table_memory_store_change_adopt_array (ETableMemoryStore *etms, gint row, gpointer *store, gpointer data) { - int i; + gint i; g_return_if_fail (row >= 0 && row < e_table_model_row_count (E_TABLE_MODEL (etms))); @@ -515,19 +515,19 @@ e_table_memory_store_change_adopt_array (ETableMemoryStore *etms, int row, void * must pass in etms->col_count args. */ void -e_table_memory_store_change_adopt (ETableMemoryStore *etms, int row, gpointer data, ...) +e_table_memory_store_change_adopt (ETableMemoryStore *etms, gint row, gpointer data, ...) { - void **store; + gpointer *store; va_list args; - int i; + gint i; g_return_if_fail (row >= 0 && row < e_table_model_row_count (E_TABLE_MODEL (etms))); - store = g_new0 (void *, etms->priv->col_count + 1); + store = g_new0 (gpointer , etms->priv->col_count + 1); va_start (args, data); for (i = 0; i < etms->priv->col_count; i++) { - store[i] = va_arg (args, void *); + store[i] = va_arg (args, gpointer ); } va_end (args); @@ -537,11 +537,11 @@ e_table_memory_store_change_adopt (ETableMemoryStore *etms, int row, gpointer da } void -e_table_memory_store_remove (ETableMemoryStore *etms, int row) +e_table_memory_store_remove (ETableMemoryStore *etms, gint row) { ETableModel *model; - int column_count, row_count; - int i; + gint column_count, row_count; + gint i; model = E_TABLE_MODEL (etms); column_count = e_table_model_column_count (model); @@ -552,8 +552,8 @@ e_table_memory_store_remove (ETableMemoryStore *etms, int row) row_count = e_table_model_row_count (E_TABLE_MODEL (etms)) - 1; memmove (etms->priv->store + etms->priv->col_count * row, etms->priv->store + etms->priv->col_count * (row + 1), - etms->priv->col_count * (row_count - row) * sizeof (void *)); - etms->priv->store = g_realloc (etms->priv->store, etms->priv->col_count * row_count * sizeof (void *)); + etms->priv->col_count * (row_count - row) * sizeof (gpointer)); + etms->priv->store = g_realloc (etms->priv->store, etms->priv->col_count * row_count * sizeof (gpointer)); e_table_memory_remove (E_TABLE_MEMORY (etms), row); } @@ -562,8 +562,8 @@ void e_table_memory_store_clear (ETableMemoryStore *etms) { ETableModel *model; - int row_count, column_count; - int i, j; + gint row_count, column_count; + gint i, j; model = E_TABLE_MODEL (etms); row_count = e_table_model_row_count (model); diff --git a/widgets/table/e-table-memory-store.h b/widgets/table/e-table-memory-store.h index f197e11fe6..96da50f71c 100644 --- a/widgets/table/e-table-memory-store.h +++ b/widgets/table/e-table-memory-store.h @@ -92,45 +92,45 @@ ETableModel *e_table_memory_store_construct (ETableMemoryStore /* Adopt a value instead of copying it. */ void e_table_memory_store_adopt_value_at (ETableMemoryStore *etms, - int col, - int row, + gint col, + gint row, void *value); /* The size of these arrays is the number of columns. */ void e_table_memory_store_insert_array (ETableMemoryStore *etms, - int row, + gint row, void **store, gpointer data); void e_table_memory_store_insert (ETableMemoryStore *etms, - int row, + gint row, gpointer data, ...); void e_table_memory_store_insert_adopt (ETableMemoryStore *etms, - int row, + gint row, gpointer data, ...); void e_table_memory_store_insert_adopt_array (ETableMemoryStore *etms, - int row, + gint row, void **store, gpointer data); void e_table_memory_store_change_array (ETableMemoryStore *etms, - int row, + gint row, void **store, gpointer data); void e_table_memory_store_change (ETableMemoryStore *etms, - int row, + gint row, gpointer data, ...); void e_table_memory_store_change_adopt (ETableMemoryStore *etms, - int row, + gint row, gpointer data, ...); void e_table_memory_store_change_adopt_array (ETableMemoryStore *etms, - int row, + gint row, void **store, gpointer data); void e_table_memory_store_remove (ETableMemoryStore *etms, - int row); + gint row); void e_table_memory_store_clear (ETableMemoryStore *etms); G_END_DECLS diff --git a/widgets/table/e-table-memory.c b/widgets/table/e-table-memory.c index 3fb85a9553..98fd65c460 100644 --- a/widgets/table/e-table-memory.c +++ b/widgets/table/e-table-memory.c @@ -41,7 +41,7 @@ G_DEFINE_TYPE (ETableMemory, e_table_memory, E_TABLE_MODEL_TYPE) struct ETableMemoryPriv { gpointer *data; - int num_rows; + gint num_rows; gint frozen; }; @@ -120,7 +120,7 @@ e_table_memory_new (void) * Return value: **/ gpointer -e_table_memory_get_data (ETableMemory *etmm, int row) +e_table_memory_get_data (ETableMemory *etmm, gint row) { g_return_val_if_fail(row >= 0, NULL); g_return_val_if_fail(row < etmm->priv->num_rows, NULL); @@ -137,7 +137,7 @@ e_table_memory_get_data (ETableMemory *etmm, int row) * **/ void -e_table_memory_set_data (ETableMemory *etmm, int row, gpointer data) +e_table_memory_set_data (ETableMemory *etmm, gint row, gpointer data) { g_return_if_fail(row >= 0); g_return_if_fail(row < etmm->priv->num_rows); @@ -158,7 +158,7 @@ e_table_memory_set_data (ETableMemory *etmm, int row, gpointer data) **/ void e_table_memory_insert (ETableMemory *etmm, - int row, + gint row, gpointer data) { g_return_if_fail(row >= -1); @@ -189,7 +189,7 @@ e_table_memory_insert (ETableMemory *etmm, * Return value: **/ gpointer -e_table_memory_remove (ETableMemory *etmm, int row) +e_table_memory_remove (ETableMemory *etmm, gint row) { gpointer ret; diff --git a/widgets/table/e-table-memory.h b/widgets/table/e-table-memory.h index 889eec5d33..07a79b6856 100644 --- a/widgets/table/e-table-memory.h +++ b/widgets/table/e-table-memory.h @@ -55,19 +55,19 @@ ETableMemory *e_table_memory_new (void); /* row operations */ void e_table_memory_insert (ETableMemory *etable, - int row, + gint row, gpointer data); gpointer e_table_memory_remove (ETableMemory *etable, - int row); + gint row); void e_table_memory_clear (ETableMemory *etable); /* Freeze and thaw */ void e_table_memory_freeze (ETableMemory *etable); void e_table_memory_thaw (ETableMemory *etable); gpointer e_table_memory_get_data (ETableMemory *etm, - int row); + gint row); void e_table_memory_set_data (ETableMemory *etm, - int row, + gint row, gpointer data); G_END_DECLS diff --git a/widgets/table/e-table-model.c b/widgets/table/e-table-model.c index efe097c4e1..2badb768c9 100644 --- a/widgets/table/e-table-model.c +++ b/widgets/table/e-table-model.c @@ -59,7 +59,7 @@ static guint e_table_model_signals [LAST_SIGNAL] = { 0, }; * * Returns: the number of columns in the table model. */ -int +gint e_table_model_column_count (ETableModel *e_table_model) { g_return_val_if_fail (e_table_model != NULL, 0); @@ -75,7 +75,7 @@ e_table_model_column_count (ETableModel *e_table_model) * * Returns: the number of rows in the Table model. */ -int +gint e_table_model_row_count (ETableModel *e_table_model) { g_return_val_if_fail (e_table_model != NULL, 0); @@ -92,7 +92,7 @@ e_table_model_row_count (ETableModel *e_table_model) * */ void -e_table_model_append_row (ETableModel *e_table_model, ETableModel *source, int row) +e_table_model_append_row (ETableModel *e_table_model, ETableModel *source, gint row) { g_return_if_fail (e_table_model != NULL); g_return_if_fail (E_IS_TABLE_MODEL (e_table_model)); @@ -120,8 +120,8 @@ e_table_model_append_row (ETableModel *e_table_model, ETableModel *source, int r * data in that cell. rows_deleted affects all data in those rows. * rows_inserted and no_change don't affect any data in this way. **/ -void * -e_table_model_value_at (ETableModel *e_table_model, int col, int row) +gpointer +e_table_model_value_at (ETableModel *e_table_model, gint col, gint row) { g_return_val_if_fail (e_table_model != NULL, NULL); g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), NULL); @@ -142,10 +142,10 @@ e_table_model_value_at (ETableModel *e_table_model, int col, int row) * * There should be an agreement between the Table Model and the user * of this function about the data being stored. Typically it will - * be a pointer to a set of data, or a datum that fits inside a void *. + * be a pointer to a set of data, or a datum that fits inside a gpointer . */ void -e_table_model_set_value_at (ETableModel *e_table_model, int col, int row, const void *value) +e_table_model_set_value_at (ETableModel *e_table_model, gint col, gint row, gconstpointer value) { g_return_if_fail (e_table_model != NULL); g_return_if_fail (E_IS_TABLE_MODEL (e_table_model)); @@ -163,7 +163,7 @@ e_table_model_set_value_at (ETableModel *e_table_model, int col, int row, const * edited, %FALSE otherwise */ gboolean -e_table_model_is_cell_editable (ETableModel *e_table_model, int col, int row) +e_table_model_is_cell_editable (ETableModel *e_table_model, gint col, gint row) { g_return_val_if_fail (e_table_model != NULL, FALSE); g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), FALSE); @@ -172,8 +172,8 @@ e_table_model_is_cell_editable (ETableModel *e_table_model, int col, int row) } -void * -e_table_model_duplicate_value (ETableModel *e_table_model, int col, const void *value) +gpointer +e_table_model_duplicate_value (ETableModel *e_table_model, gint col, gconstpointer value) { g_return_val_if_fail (e_table_model != NULL, NULL); g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), NULL); @@ -185,7 +185,7 @@ e_table_model_duplicate_value (ETableModel *e_table_model, int col, const void * } void -e_table_model_free_value (ETableModel *e_table_model, int col, void *value) +e_table_model_free_value (ETableModel *e_table_model, gint col, gpointer value) { g_return_if_fail (e_table_model != NULL); g_return_if_fail (E_IS_TABLE_MODEL (e_table_model)); @@ -206,8 +206,8 @@ e_table_model_has_save_id (ETableModel *e_table_model) return FALSE; } -char * -e_table_model_get_save_id (ETableModel *e_table_model, int row) +gchar * +e_table_model_get_save_id (ETableModel *e_table_model, gint row) { g_return_val_if_fail (e_table_model != NULL, NULL); g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), NULL); @@ -230,8 +230,8 @@ e_table_model_has_change_pending(ETableModel *e_table_model) return FALSE; } -void * -e_table_model_initialize_value (ETableModel *e_table_model, int col) +gpointer +e_table_model_initialize_value (ETableModel *e_table_model, gint col) { g_return_val_if_fail (e_table_model != NULL, NULL); g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), NULL); @@ -243,7 +243,7 @@ e_table_model_initialize_value (ETableModel *e_table_model, int col) } gboolean -e_table_model_value_is_empty (ETableModel *e_table_model, int col, const void *value) +e_table_model_value_is_empty (ETableModel *e_table_model, gint col, gconstpointer value) { g_return_val_if_fail (e_table_model != NULL, FALSE); g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), FALSE); @@ -254,8 +254,8 @@ e_table_model_value_is_empty (ETableModel *e_table_model, int col, const void *v return FALSE; } -char * -e_table_model_value_to_string (ETableModel *e_table_model, int col, const void *value) +gchar * +e_table_model_value_to_string (ETableModel *e_table_model, gint col, gconstpointer value) { g_return_val_if_fail (e_table_model != NULL, NULL); g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), NULL); @@ -381,7 +381,7 @@ e_table_model_init (ETableModel *e_table_model) static void print_tabs (void) { - int i; + gint i; for (i = 0; i < depth; i++) g_print("\t"); } @@ -475,7 +475,7 @@ e_table_model_changed (ETableModel *e_table_model) * object */ void -e_table_model_row_changed (ETableModel *e_table_model, int row) +e_table_model_row_changed (ETableModel *e_table_model, gint row) { g_return_if_fail (e_table_model != NULL); g_return_if_fail (E_IS_TABLE_MODEL (e_table_model)); @@ -503,7 +503,7 @@ e_table_model_row_changed (ETableModel *e_table_model, int row) * object */ void -e_table_model_cell_changed (ETableModel *e_table_model, int col, int row) +e_table_model_cell_changed (ETableModel *e_table_model, gint col, gint row) { g_return_if_fail (e_table_model != NULL); g_return_if_fail (E_IS_TABLE_MODEL (e_table_model)); @@ -531,7 +531,7 @@ e_table_model_cell_changed (ETableModel *e_table_model, int col, int row) * @e_table_model object */ void -e_table_model_rows_inserted (ETableModel *e_table_model, int row, int count) +e_table_model_rows_inserted (ETableModel *e_table_model, gint row, gint count) { g_return_if_fail (e_table_model != NULL); g_return_if_fail (E_IS_TABLE_MODEL (e_table_model)); @@ -557,7 +557,7 @@ e_table_model_rows_inserted (ETableModel *e_table_model, int row, int count) * the "model_rows_inserted" signal on the @e_table_model object */ void -e_table_model_row_inserted (ETableModel *e_table_model, int row) +e_table_model_row_inserted (ETableModel *e_table_model, gint row) { e_table_model_rows_inserted(e_table_model, row, 1); } @@ -574,7 +574,7 @@ e_table_model_row_inserted (ETableModel *e_table_model, int row) * @e_table_model object */ void -e_table_model_rows_deleted (ETableModel *e_table_model, int row, int count) +e_table_model_rows_deleted (ETableModel *e_table_model, gint row, gint count) { g_return_if_fail (e_table_model != NULL); g_return_if_fail (E_IS_TABLE_MODEL (e_table_model)); @@ -600,7 +600,7 @@ e_table_model_rows_deleted (ETableModel *e_table_model, int row, int count) * the "model_rows_deleted" signal on the @e_table_model object */ void -e_table_model_row_deleted (ETableModel *e_table_model, int row) +e_table_model_row_deleted (ETableModel *e_table_model, gint row) { e_table_model_rows_deleted(e_table_model, row, 1); } diff --git a/widgets/table/e-table-model.h b/widgets/table/e-table-model.h index d647eee4e1..571c2f8a12 100644 --- a/widgets/table/e-table-model.h +++ b/widgets/table/e-table-model.h @@ -45,29 +45,29 @@ typedef struct { /* * Virtual methods */ - int (*column_count) (ETableModel *etm); - int (*row_count) (ETableModel *etm); - void (*append_row) (ETableModel *etm, ETableModel *source, int row); + gint (*column_count) (ETableModel *etm); + gint (*row_count) (ETableModel *etm); + void (*append_row) (ETableModel *etm, ETableModel *source, gint row); - void *(*value_at) (ETableModel *etm, int col, int row); - void (*set_value_at) (ETableModel *etm, int col, int row, const void *value); - gboolean (*is_cell_editable) (ETableModel *etm, int col, int row); + void *(*value_at) (ETableModel *etm, gint col, gint row); + void (*set_value_at) (ETableModel *etm, gint col, gint row, gconstpointer value); + gboolean (*is_cell_editable) (ETableModel *etm, gint col, gint row); gboolean (*has_save_id) (ETableModel *etm); - gchar *(*get_save_id) (ETableModel *etm, int row); + gchar *(*get_save_id) (ETableModel *etm, gint row); gboolean (*has_change_pending) (ETableModel *etm); /* Allocate a copy of the given value. */ - void *(*duplicate_value) (ETableModel *etm, int col, const void *value); + void *(*duplicate_value) (ETableModel *etm, gint col, gconstpointer value); /* Free an allocated value. */ - void (*free_value) (ETableModel *etm, int col, void *value); + void (*free_value) (ETableModel *etm, gint col, gpointer value); /* Return an allocated empty value. */ - void *(*initialize_value) (ETableModel *etm, int col); + void *(*initialize_value) (ETableModel *etm, gint col); /* Return TRUE if value is equivalent to an empty cell. */ - gboolean (*value_is_empty) (ETableModel *etm, int col, const void *value); + gboolean (*value_is_empty) (ETableModel *etm, gint col, gconstpointer value); /* Return an allocated string. */ - char *(*value_to_string) (ETableModel *etm, int col, const void *value); + gchar *(*value_to_string) (ETableModel *etm, gint col, gconstpointer value); /* @@ -87,39 +87,39 @@ typedef struct { void (*model_no_change) (ETableModel *etm); void (*model_changed) (ETableModel *etm); - void (*model_row_changed) (ETableModel *etm, int row); - void (*model_cell_changed) (ETableModel *etm, int col, int row); - void (*model_rows_inserted) (ETableModel *etm, int row, int count); - void (*model_rows_deleted) (ETableModel *etm, int row, int count); + void (*model_row_changed) (ETableModel *etm, gint row); + void (*model_cell_changed) (ETableModel *etm, gint col, gint row); + void (*model_rows_inserted) (ETableModel *etm, gint row, gint count); + void (*model_rows_deleted) (ETableModel *etm, gint row, gint count); } ETableModelClass; GType e_table_model_get_type (void); /**/ -int e_table_model_column_count (ETableModel *e_table_model); -const char *e_table_model_column_name (ETableModel *e_table_model, - int col); -int e_table_model_row_count (ETableModel *e_table_model); +gint e_table_model_column_count (ETableModel *e_table_model); +const gchar *e_table_model_column_name (ETableModel *e_table_model, + gint col); +gint e_table_model_row_count (ETableModel *e_table_model); void e_table_model_append_row (ETableModel *e_table_model, ETableModel *source, - int row); + gint row); /**/ void *e_table_model_value_at (ETableModel *e_table_model, - int col, - int row); + gint col, + gint row); void e_table_model_set_value_at (ETableModel *e_table_model, - int col, - int row, + gint col, + gint row, const void *value); gboolean e_table_model_is_cell_editable (ETableModel *e_table_model, - int col, - int row); + gint col, + gint row); /**/ gboolean e_table_model_has_save_id (ETableModel *etm); -char *e_table_model_get_save_id (ETableModel *etm, - int row); +gchar *e_table_model_get_save_id (ETableModel *etm, + gint row); /**/ gboolean e_table_model_has_change_pending (ETableModel *etm); @@ -127,18 +127,18 @@ gboolean e_table_model_has_change_pending (ETableModel *etm); /**/ void *e_table_model_duplicate_value (ETableModel *e_table_model, - int col, + gint col, const void *value); void e_table_model_free_value (ETableModel *e_table_model, - int col, + gint col, void *value); void *e_table_model_initialize_value (ETableModel *e_table_model, - int col); + gint col); gboolean e_table_model_value_is_empty (ETableModel *e_table_model, - int col, + gint col, const void *value); -char *e_table_model_value_to_string (ETableModel *e_table_model, - int col, +gchar *e_table_model_value_to_string (ETableModel *e_table_model, + gint col, const void *value); /* @@ -148,22 +148,22 @@ void e_table_model_pre_change (ETableModel *e_table_model); void e_table_model_no_change (ETableModel *e_table_model); void e_table_model_changed (ETableModel *e_table_model); void e_table_model_row_changed (ETableModel *e_table_model, - int row); + gint row); void e_table_model_cell_changed (ETableModel *e_table_model, - int col, - int row); + gint col, + gint row); void e_table_model_rows_inserted (ETableModel *e_table_model, -int row, -int count); +gint row, +gint count); void e_table_model_rows_deleted (ETableModel *e_table_model, -int row, -int count); +gint row, +gint count); /**/ void e_table_model_row_inserted (ETableModel *e_table_model, -int row); +gint row); void e_table_model_row_deleted (ETableModel *e_table_model, -int row); +gint row); void e_table_model_freeze (ETableModel *e_table_model); void e_table_model_thaw (ETableModel *e_table_model); diff --git a/widgets/table/e-table-one.c b/widgets/table/e-table-one.c index 56cd8b6549..c8cea32963 100644 --- a/widgets/table/e-table-one.c +++ b/widgets/table/e-table-one.c @@ -46,8 +46,8 @@ one_row_count (ETableModel *etm) return 1; } -static void * -one_value_at (ETableModel *etm, int col, int row) +static gpointer +one_value_at (ETableModel *etm, gint col, gint row) { ETableOne *one = E_TABLE_ONE(etm); @@ -58,7 +58,7 @@ one_value_at (ETableModel *etm, int col, int row) } static void -one_set_value_at (ETableModel *etm, int col, int row, const void *val) +one_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) { ETableOne *one = E_TABLE_ONE(etm); @@ -69,7 +69,7 @@ one_set_value_at (ETableModel *etm, int col, int row, const void *val) } static gboolean -one_is_cell_editable (ETableModel *etm, int col, int row) +one_is_cell_editable (ETableModel *etm, gint col, gint row) { ETableOne *one = E_TABLE_ONE(etm); @@ -80,19 +80,19 @@ one_is_cell_editable (ETableModel *etm, int col, int row) } /* The default for one_duplicate_value is to return the raw value. */ -static void * -one_duplicate_value (ETableModel *etm, int col, const void *value) +static gpointer +one_duplicate_value (ETableModel *etm, gint col, gconstpointer value) { ETableOne *one = E_TABLE_ONE(etm); if (one->source) return e_table_model_duplicate_value(one->source, col, value); else - return (void *)value; + return (gpointer)value; } static void -one_free_value (ETableModel *etm, int col, void *value) +one_free_value (ETableModel *etm, gint col, gpointer value) { ETableOne *one = E_TABLE_ONE(etm); @@ -100,8 +100,8 @@ one_free_value (ETableModel *etm, int col, void *value) e_table_model_free_value(one->source, col, value); } -static void * -one_initialize_value (ETableModel *etm, int col) +static gpointer +one_initialize_value (ETableModel *etm, gint col) { ETableOne *one = E_TABLE_ONE(etm); @@ -112,7 +112,7 @@ one_initialize_value (ETableModel *etm, int col) } static gboolean -one_value_is_empty (ETableModel *etm, int col, const void *value) +one_value_is_empty (ETableModel *etm, gint col, gconstpointer value) { ETableOne *one = E_TABLE_ONE(etm); @@ -122,8 +122,8 @@ one_value_is_empty (ETableModel *etm, int col, const void *value) return FALSE; } -static char * -one_value_to_string (ETableModel *etm, int col, const void *value) +static gchar * +one_value_to_string (ETableModel *etm, gint col, gconstpointer value) { ETableOne *one = E_TABLE_ONE(etm); @@ -146,8 +146,8 @@ one_dispose (GObject *object) if (one->data) { - int i; - int col_count; + gint i; + gint col_count; if (one->source) { col_count = e_table_model_column_count(one->source); @@ -199,14 +199,14 @@ ETableModel * e_table_one_new (ETableModel *source) { ETableOne *eto; - int col_count; - int i; + gint col_count; + gint i; eto = g_object_new (E_TABLE_ONE_TYPE, NULL); eto->source = source; col_count = e_table_model_column_count(source); - eto->data = g_new(void *, col_count); + eto->data = g_new(gpointer , col_count); for (i = 0; i < col_count; i++) { eto->data[i] = e_table_model_initialize_value(source, i); } @@ -221,9 +221,9 @@ void e_table_one_commit (ETableOne *one) { if (one->source) { - int empty = TRUE; - int col; - int cols = e_table_model_column_count(one->source); + gint empty = TRUE; + gint col; + gint cols = e_table_model_column_count(one->source); for (col = 0; col < cols; col++) { if (!e_table_model_value_is_empty(one->source, col, one->data[col])) { empty = FALSE; diff --git a/widgets/table/e-table-scrolled.c b/widgets/table/e-table-scrolled.c index 42425efd9a..778041d73c 100644 --- a/widgets/table/e-table-scrolled.c +++ b/widgets/table/e-table-scrolled.c @@ -71,8 +71,8 @@ e_table_scrolled_real_construct (ETableScrolled *ets) ETableScrolled *e_table_scrolled_construct (ETableScrolled *ets, ETableModel *etm, ETableExtras *ete, - const char *spec, - const char *state) + const gchar *spec, + const gchar *state) { g_return_val_if_fail(ets != NULL, NULL); g_return_val_if_fail(E_IS_TABLE_SCROLLED(ets), NULL); @@ -90,8 +90,8 @@ ETableScrolled *e_table_scrolled_construct (ETableScrolled *e GtkWidget *e_table_scrolled_new (ETableModel *etm, ETableExtras *ete, - const char *spec, - const char *state) + const gchar *spec, + const gchar *state) { ETableScrolled *ets; @@ -113,8 +113,8 @@ GtkWidget *e_table_scrolled_new (ETableModel *e ETableScrolled *e_table_scrolled_construct_from_spec_file (ETableScrolled *ets, ETableModel *etm, ETableExtras *ete, - const char *spec_fn, - const char *state_fn) + const gchar *spec_fn, + const gchar *state_fn) { g_return_val_if_fail(ets != NULL, NULL); g_return_val_if_fail(E_IS_TABLE_SCROLLED(ets), NULL); @@ -132,8 +132,8 @@ ETableScrolled *e_table_scrolled_construct_from_spec_file (ETableScrolled *e GtkWidget *e_table_scrolled_new_from_spec_file (ETableModel *etm, ETableExtras *ete, - const char *spec_fn, - const char *state_fn) + const gchar *spec_fn, + const gchar *state_fn) { ETableScrolled *ets; diff --git a/widgets/table/e-table-scrolled.h b/widgets/table/e-table-scrolled.h index d2f5024495..71e50b8cdd 100644 --- a/widgets/table/e-table-scrolled.h +++ b/widgets/table/e-table-scrolled.h @@ -51,22 +51,22 @@ GType e_table_scrolled_get_type (void); ETableScrolled *e_table_scrolled_construct (ETableScrolled *ets, ETableModel *etm, ETableExtras *ete, - const char *spec, - const char *state); + const gchar *spec, + const gchar *state); GtkWidget *e_table_scrolled_new (ETableModel *etm, ETableExtras *ete, - const char *spec, - const char *state); + const gchar *spec, + const gchar *state); ETableScrolled *e_table_scrolled_construct_from_spec_file (ETableScrolled *ets, ETableModel *etm, ETableExtras *ete, - const char *spec_fn, - const char *state_fn); + const gchar *spec_fn, + const gchar *state_fn); GtkWidget *e_table_scrolled_new_from_spec_file (ETableModel *etm, ETableExtras *ete, - const char *spec_fn, - const char *state_fn); + const gchar *spec_fn, + const gchar *state_fn); ETable *e_table_scrolled_get_table (ETableScrolled *ets); diff --git a/widgets/table/e-table-search.c b/widgets/table/e-table-search.c index 401e0fd33f..e11510371a 100644 --- a/widgets/table/e-table-search.c +++ b/widgets/table/e-table-search.c @@ -35,7 +35,7 @@ d(static gint depth = 0) struct _ETableSearchPrivate { guint timeout_id; - char *search_string; + gchar *search_string; gunichar last_character; }; @@ -50,7 +50,7 @@ enum { static guint e_table_search_signals [LAST_SIGNAL] = { 0, }; static gboolean -e_table_search_search (ETableSearch *e_table_search, char *string, ETableSearchFlags flags) +e_table_search_search (ETableSearch *e_table_search, gchar *string, ETableSearchFlags flags) { gboolean ret_val; g_return_val_if_fail (e_table_search != NULL, FALSE); @@ -172,8 +172,8 @@ e_table_search_new (void) void e_table_search_input_character (ETableSearch *ets, gunichar character) { - char character_utf8[7]; - char *temp_string; + gchar character_utf8[7]; + gchar *temp_string; g_return_if_fail (ets != NULL); g_return_if_fail (E_IS_TABLE_SEARCH (ets)); @@ -202,7 +202,7 @@ e_table_search_input_character (ETableSearch *ets, gunichar character) gboolean e_table_search_backspace (ETableSearch *ets) { - char *end; + gchar *end; g_return_val_if_fail (ets != NULL, FALSE); g_return_val_if_fail (E_IS_TABLE_SEARCH (ets), FALSE); diff --git a/widgets/table/e-table-search.h b/widgets/table/e-table-search.h index 9866d07f94..798d81bd2d 100644 --- a/widgets/table/e-table-search.h +++ b/widgets/table/e-table-search.h @@ -53,7 +53,7 @@ typedef struct { /* * Signals */ - gboolean (*search) (ETableSearch *ets, char *string /* utf8 */, ETableSearchFlags flags); + gboolean (*search) (ETableSearch *ets, gchar *string /* utf8 */, ETableSearchFlags flags); void (*accept) (ETableSearch *ets); } ETableSearchClass; diff --git a/widgets/table/e-table-selection-model.c b/widgets/table/e-table-selection-model.c index 7f6ab4d782..22ec5af7d5 100644 --- a/widgets/table/e-table-selection-model.c +++ b/widgets/table/e-table-selection-model.c @@ -42,7 +42,7 @@ enum { }; static void -save_to_hash(int model_row, gpointer closure) +save_to_hash(gint model_row, gpointer closure) { ETableSelectionModel *etsm = closure; const gchar *key = e_table_model_get_save_id(etsm->model, model_row); @@ -95,10 +95,10 @@ model_changed_idle(ETableSelectionModel *etsm) e_selection_model_clear(E_SELECTION_MODEL(etsm)); if (etsm->cursor_id && etm && e_table_model_has_save_id(etm)) { - int row_count = e_table_model_row_count(etm); - int cursor_row = -1; - int cursor_col = -1; - int i; + gint row_count = e_table_model_row_count(etm); + gint cursor_row = -1; + gint cursor_col = -1; + gint i; e_selection_model_array_confirm_row_count(E_SELECTION_MODEL_ARRAY(etsm)); for (i = 0; i < row_count; i++) { gchar *save_id = e_table_model_get_save_id(etm, i); @@ -138,27 +138,27 @@ model_changed(ETableModel *etm, ETableSelectionModel *etsm) } static void -model_row_changed(ETableModel *etm, int row, ETableSelectionModel *etsm) +model_row_changed(ETableModel *etm, gint row, ETableSelectionModel *etsm) { free_hash(etsm); } static void -model_cell_changed(ETableModel *etm, int col, int row, ETableSelectionModel *etsm) +model_cell_changed(ETableModel *etm, gint col, gint row, ETableSelectionModel *etsm) { free_hash(etsm); } #if 1 static void -model_rows_inserted(ETableModel *etm, int row, int count, ETableSelectionModel *etsm) +model_rows_inserted(ETableModel *etm, gint row, gint count, ETableSelectionModel *etsm) { e_selection_model_array_insert_rows(E_SELECTION_MODEL_ARRAY(etsm), row, count); free_hash(etsm); } static void -model_rows_deleted(ETableModel *etm, int row, int count, ETableSelectionModel *etsm) +model_rows_deleted(ETableModel *etm, gint row, gint count, ETableSelectionModel *etsm) { e_selection_model_array_delete_rows(E_SELECTION_MODEL_ARRAY(etsm), row, count); free_hash(etsm); @@ -167,13 +167,13 @@ model_rows_deleted(ETableModel *etm, int row, int count, ETableSelectionModel *e #else static void -model_rows_inserted(ETableModel *etm, int row, int count, ETableSelectionModel *etsm) +model_rows_inserted(ETableModel *etm, gint row, gint count, ETableSelectionModel *etsm) { model_changed(etm, etsm); } static void -model_rows_deleted(ETableModel *etm, int row, int count, ETableSelectionModel *etsm) +model_rows_deleted(ETableModel *etm, gint row, gint count, ETableSelectionModel *etsm) { model_changed(etm, etsm); } diff --git a/widgets/table/e-table-simple.c b/widgets/table/e-table-simple.c index a220769ded..f2eceb9314 100644 --- a/widgets/table/e-table-simple.c +++ b/widgets/table/e-table-simple.c @@ -53,7 +53,7 @@ simple_row_count (ETableModel *etm) } static void -simple_append_row (ETableModel *etm, ETableModel *source, int row) +simple_append_row (ETableModel *etm, ETableModel *source, gint row) { ETableSimple *simple = E_TABLE_SIMPLE(etm); @@ -61,8 +61,8 @@ simple_append_row (ETableModel *etm, ETableModel *source, int row) simple->append_row (etm, source, row, simple->data); } -static void * -simple_value_at (ETableModel *etm, int col, int row) +static gpointer +simple_value_at (ETableModel *etm, gint col, gint row) { ETableSimple *simple = E_TABLE_SIMPLE(etm); @@ -73,7 +73,7 @@ simple_value_at (ETableModel *etm, int col, int row) } static void -simple_set_value_at (ETableModel *etm, int col, int row, const void *val) +simple_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) { ETableSimple *simple = E_TABLE_SIMPLE(etm); @@ -82,7 +82,7 @@ simple_set_value_at (ETableModel *etm, int col, int row, const void *val) } static gboolean -simple_is_cell_editable (ETableModel *etm, int col, int row) +simple_is_cell_editable (ETableModel *etm, gint col, gint row) { ETableSimple *simple = E_TABLE_SIMPLE(etm); @@ -103,8 +103,8 @@ simple_has_save_id (ETableModel *etm) return FALSE; } -static char * -simple_get_save_id (ETableModel *etm, int row) +static gchar * +simple_get_save_id (ETableModel *etm, gint row) { ETableSimple *simple = E_TABLE_SIMPLE(etm); @@ -115,19 +115,19 @@ simple_get_save_id (ETableModel *etm, int row) } /* The default for simple_duplicate_value is to return the raw value. */ -static void * -simple_duplicate_value (ETableModel *etm, int col, const void *value) +static gpointer +simple_duplicate_value (ETableModel *etm, gint col, gconstpointer value) { ETableSimple *simple = E_TABLE_SIMPLE(etm); if (simple->duplicate_value) return simple->duplicate_value (etm, col, value, simple->data); else - return (void *)value; + return (gpointer)value; } static void -simple_free_value (ETableModel *etm, int col, void *value) +simple_free_value (ETableModel *etm, gint col, gpointer value) { ETableSimple *simple = E_TABLE_SIMPLE(etm); @@ -135,8 +135,8 @@ simple_free_value (ETableModel *etm, int col, void *value) simple->free_value (etm, col, value, simple->data); } -static void * -simple_initialize_value (ETableModel *etm, int col) +static gpointer +simple_initialize_value (ETableModel *etm, gint col) { ETableSimple *simple = E_TABLE_SIMPLE(etm); @@ -147,7 +147,7 @@ simple_initialize_value (ETableModel *etm, int col) } static gboolean -simple_value_is_empty (ETableModel *etm, int col, const void *value) +simple_value_is_empty (ETableModel *etm, gint col, gconstpointer value) { ETableSimple *simple = E_TABLE_SIMPLE(etm); @@ -157,8 +157,8 @@ simple_value_is_empty (ETableModel *etm, int col, const void *value) return FALSE; } -static char * -simple_value_to_string (ETableModel *etm, int col, const void *value) +static gchar * +simple_value_to_string (ETableModel *etm, gint col, gconstpointer value) { ETableSimple *simple = E_TABLE_SIMPLE(etm); @@ -266,32 +266,32 @@ e_table_simple_new (ETableSimpleColumnCountFn col_count, return (ETableModel *) et; } -void * -e_table_simple_string_duplicate_value (ETableModel *etm, int col, const void *val, void *data) +gpointer +e_table_simple_string_duplicate_value (ETableModel *etm, gint col, gconstpointer val, gpointer data) { return g_strdup (val); } void -e_table_simple_string_free_value (ETableModel *etm, int col, void *val, void *data) +e_table_simple_string_free_value (ETableModel *etm, gint col, gpointer val, gpointer data) { g_free (val); } -void * -e_table_simple_string_initialize_value (ETableModel *etm, int col, void *data) +gpointer +e_table_simple_string_initialize_value (ETableModel *etm, gint col, gpointer data) { return g_strdup (""); } gboolean -e_table_simple_string_value_is_empty (ETableModel *etm, int col, const void *val, void *data) +e_table_simple_string_value_is_empty (ETableModel *etm, gint col, gconstpointer val, gpointer data) { - return !(val && * (char *) val); + return !(val && * (gchar *) val); } -char * -e_table_simple_string_value_to_string (ETableModel *etm, int col, const void *val, void *data) +gchar * +e_table_simple_string_value_to_string (ETableModel *etm, gint col, gconstpointer val, gpointer data) { return g_strdup (val); } diff --git a/widgets/table/e-table-simple.h b/widgets/table/e-table-simple.h index 453a90a54d..c93b313a82 100644 --- a/widgets/table/e-table-simple.h +++ b/widgets/table/e-table-simple.h @@ -36,22 +36,22 @@ G_BEGIN_DECLS #define E_IS_TABLE_SIMPLE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_SIMPLE_TYPE)) #define E_TABLE_SIMPLE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), E_TABLE_SIMPLE_TYPE, ETableSimpleClass)) -typedef int (*ETableSimpleColumnCountFn) (ETableModel *etm, void *data); -typedef int (*ETableSimpleRowCountFn) (ETableModel *etm, void *data); -typedef void (*ETableSimpleAppendRowFn) (ETableModel *etm, ETableModel *model, int row, void *data); +typedef gint (*ETableSimpleColumnCountFn) (ETableModel *etm, gpointer data); +typedef gint (*ETableSimpleRowCountFn) (ETableModel *etm, gpointer data); +typedef void (*ETableSimpleAppendRowFn) (ETableModel *etm, ETableModel *model, gint row, gpointer data); -typedef void *(*ETableSimpleValueAtFn) (ETableModel *etm, int col, int row, void *data); -typedef void (*ETableSimpleSetValueAtFn) (ETableModel *etm, int col, int row, const void *val, void *data); -typedef gboolean (*ETableSimpleIsCellEditableFn) (ETableModel *etm, int col, int row, void *data); +typedef void *(*ETableSimpleValueAtFn) (ETableModel *etm, gint col, gint row, gpointer data); +typedef void (*ETableSimpleSetValueAtFn) (ETableModel *etm, gint col, gint row, gconstpointer val, gpointer data); +typedef gboolean (*ETableSimpleIsCellEditableFn) (ETableModel *etm, gint col, gint row, gpointer data); -typedef gboolean (*ETableSimpleHasSaveIdFn) (ETableModel *etm, void *data); -typedef char *(*ETableSimpleGetSaveIdFn) (ETableModel *etm, int row, void *data); +typedef gboolean (*ETableSimpleHasSaveIdFn) (ETableModel *etm, gpointer data); +typedef gchar *(*ETableSimpleGetSaveIdFn) (ETableModel *etm, gint row, gpointer data); -typedef void *(*ETableSimpleDuplicateValueFn) (ETableModel *etm, int col, const void *val, void *data); -typedef void (*ETableSimpleFreeValueFn) (ETableModel *etm, int col, void *val, void *data); -typedef void *(*ETableSimpleInitializeValueFn) (ETableModel *etm, int col, void *data); -typedef gboolean (*ETableSimpleValueIsEmptyFn) (ETableModel *etm, int col, const void *val, void *data); -typedef char *(*ETableSimpleValueToStringFn) (ETableModel *etm, int col, const void *val, void *data); +typedef void *(*ETableSimpleDuplicateValueFn) (ETableModel *etm, gint col, gconstpointer val, gpointer data); +typedef void (*ETableSimpleFreeValueFn) (ETableModel *etm, gint col, gpointer val, gpointer data); +typedef void *(*ETableSimpleInitializeValueFn) (ETableModel *etm, gint col, gpointer data); +typedef gboolean (*ETableSimpleValueIsEmptyFn) (ETableModel *etm, gint col, gconstpointer val, gpointer data); +typedef gchar *(*ETableSimpleValueToStringFn) (ETableModel *etm, gint col, gconstpointer val, gpointer data); typedef struct { ETableModel parent; @@ -72,7 +72,7 @@ typedef struct { ETableSimpleInitializeValueFn initialize_value; ETableSimpleValueIsEmptyFn value_is_empty; ETableSimpleValueToStringFn value_to_string; - void *data; + gpointer data; } ETableSimple; typedef struct { @@ -98,22 +98,22 @@ ETableModel *e_table_simple_new (ETableSimpleColumnCountFn /* Helper functions for if your values are all just strings. */ void *e_table_simple_string_duplicate_value (ETableModel *etm, - int col, + gint col, const void *val, void *data); void e_table_simple_string_free_value (ETableModel *etm, - int col, + gint col, void *val, void *data); void *e_table_simple_string_initialize_value (ETableModel *etm, - int col, + gint col, void *data); gboolean e_table_simple_string_value_is_empty (ETableModel *etm, - int col, + gint col, const void *val, void *data); -char *e_table_simple_string_value_to_string (ETableModel *etm, - int col, +gchar *e_table_simple_string_value_to_string (ETableModel *etm, + gint col, const void *val, void *data); diff --git a/widgets/table/e-table-sort-info.c b/widgets/table/e-table-sort-info.c index 8d722038e3..bed0c5d679 100644 --- a/widgets/table/e-table-sort-info.c +++ b/widgets/table/e-table-sort-info.c @@ -188,7 +188,7 @@ e_table_sort_info_grouping_get_count (ETableSortInfo *info) } static void -e_table_sort_info_grouping_real_truncate (ETableSortInfo *info, int length) +e_table_sort_info_grouping_real_truncate (ETableSortInfo *info, gint length) { if (length < info->group_count) { info->group_count = length; @@ -208,7 +208,7 @@ e_table_sort_info_grouping_real_truncate (ETableSortInfo *info, int length) * criteria in the object. */ void -e_table_sort_info_grouping_truncate (ETableSortInfo *info, int length) +e_table_sort_info_grouping_truncate (ETableSortInfo *info, gint length) { e_table_sort_info_grouping_real_truncate(info, length); e_table_sort_info_group_info_changed(info); @@ -222,7 +222,7 @@ e_table_sort_info_grouping_truncate (ETableSortInfo *info, int length) * Returns: the description of the @n-th grouping criteria in the @info object. */ ETableSortColumn -e_table_sort_info_grouping_get_nth (ETableSortInfo *info, int n) +e_table_sort_info_grouping_get_nth (ETableSortInfo *info, gint n) { if (info->can_group && n < info->group_count) { return info->groupings[n]; @@ -242,7 +242,7 @@ e_table_sort_info_grouping_get_nth (ETableSortInfo *info, int n) * whether it is ascending or descending). */ void -e_table_sort_info_grouping_set_nth (ETableSortInfo *info, int n, ETableSortColumn column) +e_table_sort_info_grouping_set_nth (ETableSortInfo *info, gint n, ETableSortColumn column) { if (n >= info->group_count) { e_table_sort_info_grouping_real_truncate(info, n + 1); @@ -265,7 +265,7 @@ e_table_sort_info_sorting_get_count (ETableSortInfo *info) } static void -e_table_sort_info_sorting_real_truncate (ETableSortInfo *info, int length) +e_table_sort_info_sorting_real_truncate (ETableSortInfo *info, gint length) { if (length < info->sort_count) { info->sort_count = length; @@ -285,7 +285,7 @@ e_table_sort_info_sorting_real_truncate (ETableSortInfo *info, int length) * criteria in the object. */ void -e_table_sort_info_sorting_truncate (ETableSortInfo *info, int length) +e_table_sort_info_sorting_truncate (ETableSortInfo *info, gint length) { e_table_sort_info_sorting_real_truncate (info, length); e_table_sort_info_sort_info_changed(info); @@ -299,7 +299,7 @@ e_table_sort_info_sorting_truncate (ETableSortInfo *info, int length) * Returns: the description of the @n-th grouping criteria in the @info object. */ ETableSortColumn -e_table_sort_info_sorting_get_nth (ETableSortInfo *info, int n) +e_table_sort_info_sorting_get_nth (ETableSortInfo *info, gint n) { if (n < info->sort_count) { return info->sortings[n]; @@ -319,7 +319,7 @@ e_table_sort_info_sorting_get_nth (ETableSortInfo *info, int n) * column number and whether it is ascending or descending). */ void -e_table_sort_info_sorting_set_nth (ETableSortInfo *info, int n, ETableSortColumn column) +e_table_sort_info_sorting_set_nth (ETableSortInfo *info, gint n, ETableSortColumn column) { if (n >= info->sort_count) { e_table_sort_info_sorting_real_truncate(info, n + 1); @@ -358,22 +358,22 @@ e_table_sort_info_load_from_node (ETableSortInfo *info, xmlNode *node, gdouble state_version) { - int i; + gint i; xmlNode *grouping; if (state_version <= 0.05) { i = 0; - for (grouping = node->xmlChildrenNode; grouping && !strcmp ((char *)grouping->name, "group"); grouping = grouping->xmlChildrenNode) { + for (grouping = node->xmlChildrenNode; grouping && !strcmp ((gchar *)grouping->name, "group"); grouping = grouping->xmlChildrenNode) { ETableSortColumn column; - column.column = e_xml_get_integer_prop_by_name (grouping, (const unsigned char *)"column"); - column.ascending = e_xml_get_bool_prop_by_name (grouping, (const unsigned char *)"ascending"); + column.column = e_xml_get_integer_prop_by_name (grouping, (const guchar *)"column"); + column.ascending = e_xml_get_bool_prop_by_name (grouping, (const guchar *)"ascending"); e_table_sort_info_grouping_set_nth(info, i++, column); } i = 0; - for (; grouping && !strcmp ((char *)grouping->name, "leaf"); grouping = grouping->xmlChildrenNode) { + for (; grouping && !strcmp ((gchar *)grouping->name, "leaf"); grouping = grouping->xmlChildrenNode) { ETableSortColumn column; - column.column = e_xml_get_integer_prop_by_name (grouping, (const unsigned char *)"column"); - column.ascending = e_xml_get_bool_prop_by_name (grouping, (const unsigned char *)"ascending"); + column.column = e_xml_get_integer_prop_by_name (grouping, (const guchar *)"column"); + column.ascending = e_xml_get_bool_prop_by_name (grouping, (const guchar *)"ascending"); e_table_sort_info_sorting_set_nth(info, i++, column); } } else { @@ -385,13 +385,13 @@ e_table_sort_info_load_from_node (ETableSortInfo *info, if (grouping->type != XML_ELEMENT_NODE) continue; - if (!strcmp ((char *)grouping->name, "group")) { - column.column = e_xml_get_integer_prop_by_name (grouping, (const unsigned char *)"column"); - column.ascending = e_xml_get_bool_prop_by_name (grouping, (const unsigned char *)"ascending"); + if (!strcmp ((gchar *)grouping->name, "group")) { + column.column = e_xml_get_integer_prop_by_name (grouping, (const guchar *)"column"); + column.ascending = e_xml_get_bool_prop_by_name (grouping, (const guchar *)"ascending"); e_table_sort_info_grouping_set_nth(info, gcnt++, column); - } else if (!strcmp ((char *)grouping->name, "leaf")) { - column.column = e_xml_get_integer_prop_by_name (grouping, (const unsigned char *)"column"); - column.ascending = e_xml_get_bool_prop_by_name (grouping, (const unsigned char *)"ascending"); + } else if (!strcmp ((gchar *)grouping->name, "leaf")) { + column.column = e_xml_get_integer_prop_by_name (grouping, (const guchar *)"column"); + column.ascending = e_xml_get_bool_prop_by_name (grouping, (const guchar *)"ascending"); e_table_sort_info_sorting_set_nth(info, scnt++, column); } } @@ -414,26 +414,26 @@ e_table_sort_info_save_to_node (ETableSortInfo *info, xmlNode *parent) { xmlNode *grouping; - int i; - const int sort_count = e_table_sort_info_sorting_get_count (info); - const int group_count = e_table_sort_info_grouping_get_count (info); + gint i; + const gint sort_count = e_table_sort_info_sorting_get_count (info); + const gint group_count = e_table_sort_info_grouping_get_count (info); - grouping = xmlNewChild (parent, NULL, (const unsigned char *)"grouping", NULL); + grouping = xmlNewChild (parent, NULL, (const guchar *)"grouping", NULL); for (i = 0; i < group_count; i++) { ETableSortColumn column = e_table_sort_info_grouping_get_nth(info, i); - xmlNode *new_node = xmlNewChild(grouping, NULL, (const unsigned char *)"group", NULL); + xmlNode *new_node = xmlNewChild(grouping, NULL, (const guchar *)"group", NULL); - e_xml_set_integer_prop_by_name (new_node, (const unsigned char *)"column", column.column); - e_xml_set_bool_prop_by_name (new_node, (const unsigned char *)"ascending", column.ascending); + e_xml_set_integer_prop_by_name (new_node, (const guchar *)"column", column.column); + e_xml_set_bool_prop_by_name (new_node, (const guchar *)"ascending", column.ascending); } for (i = 0; i < sort_count; i++) { ETableSortColumn column = e_table_sort_info_sorting_get_nth(info, i); - xmlNode *new_node = xmlNewChild(grouping, NULL, (const unsigned char *)"leaf", NULL); + xmlNode *new_node = xmlNewChild(grouping, NULL, (const guchar *)"leaf", NULL); - e_xml_set_integer_prop_by_name (new_node, (const unsigned char *)"column", column.column); - e_xml_set_bool_prop_by_name (new_node, (const unsigned char *)"ascending", column.ascending); + e_xml_set_integer_prop_by_name (new_node, (const guchar *)"column", column.column); + e_xml_set_bool_prop_by_name (new_node, (const guchar *)"ascending", column.ascending); } return grouping; diff --git a/widgets/table/e-table-sort-info.h b/widgets/table/e-table-sort-info.h index 4a0dde4d88..d9ffec9be2 100644 --- a/widgets/table/e-table-sort-info.h +++ b/widgets/table/e-table-sort-info.h @@ -74,20 +74,20 @@ void e_table_sort_info_thaw (ETableSortInfo *info) guint e_table_sort_info_grouping_get_count (ETableSortInfo *info); void e_table_sort_info_grouping_truncate (ETableSortInfo *info, - int length); + gint length); ETableSortColumn e_table_sort_info_grouping_get_nth (ETableSortInfo *info, - int n); + gint n); void e_table_sort_info_grouping_set_nth (ETableSortInfo *info, - int n, + gint n, ETableSortColumn column); guint e_table_sort_info_sorting_get_count (ETableSortInfo *info); void e_table_sort_info_sorting_truncate (ETableSortInfo *info, - int length); + gint length); ETableSortColumn e_table_sort_info_sorting_get_nth (ETableSortInfo *info, - int n); + gint n); void e_table_sort_info_sorting_set_nth (ETableSortInfo *info, - int n, + gint n, ETableSortColumn column); ETableSortInfo *e_table_sort_info_new (void); diff --git a/widgets/table/e-table-sorted-variable.c b/widgets/table/e-table-sorted-variable.c index 02a2e8bf26..82b2d5b37d 100644 --- a/widgets/table/e-table-sorted-variable.c +++ b/widgets/table/e-table-sorted-variable.c @@ -127,7 +127,7 @@ etsv_add (ETableSubsetVariable *etssv, ETableModel *etm = E_TABLE_MODEL(etssv); ETableSubset *etss = E_TABLE_SUBSET(etssv); ETableSortedVariable *etsv = E_TABLE_SORTED_VARIABLE (etssv); - int i; + gint i; e_table_model_pre_change (etm); @@ -164,8 +164,8 @@ etsv_add_all (ETableSubsetVariable *etssv) ETableModel *etm = E_TABLE_MODEL(etssv); ETableSubset *etss = E_TABLE_SUBSET(etssv); ETableSortedVariable *etsv = E_TABLE_SORTED_VARIABLE (etssv); - int rows; - int i; + gint rows; + gint i; e_table_model_pre_change(etm); @@ -217,7 +217,7 @@ static void etsv_sort(ETableSortedVariable *etsv) { ETableSubset *etss = E_TABLE_SUBSET(etsv); - static int reentering = 0; + static gint reentering = 0; if (reentering) return; reentering = 1; diff --git a/widgets/table/e-table-sorted-variable.h b/widgets/table/e-table-sorted-variable.h index 53744dce72..48bb0e3aa0 100644 --- a/widgets/table/e-table-sorted-variable.h +++ b/widgets/table/e-table-sorted-variable.h @@ -46,8 +46,8 @@ typedef struct { ETableHeader *full_header; - int sort_info_changed_id; - int sort_idle_id; + gint sort_info_changed_id; + gint sort_idle_id; int insert_idle_id; int insert_count; diff --git a/widgets/table/e-table-sorted.c b/widgets/table/e-table-sorted.c index 076863adfb..7eceeb875f 100644 --- a/widgets/table/e-table-sorted.c +++ b/widgets/table/e-table-sorted.c @@ -44,10 +44,10 @@ G_DEFINE_TYPE (ETableSorted, ets, E_TABLE_SUBSET_TYPE) static void ets_sort_info_changed (ETableSortInfo *info, ETableSorted *ets); static void ets_sort (ETableSorted *ets); static void ets_proxy_model_changed (ETableSubset *etss, ETableModel *source); -static void ets_proxy_model_row_changed (ETableSubset *etss, ETableModel *source, int row); -static void ets_proxy_model_cell_changed (ETableSubset *etss, ETableModel *source, int col, int row); -static void ets_proxy_model_rows_inserted (ETableSubset *etss, ETableModel *source, int row, int count); -static void ets_proxy_model_rows_deleted (ETableSubset *etss, ETableModel *source, int row, int count); +static void ets_proxy_model_row_changed (ETableSubset *etss, ETableModel *source, gint row); +static void ets_proxy_model_cell_changed (ETableSubset *etss, ETableModel *source, gint col, gint row); +static void ets_proxy_model_rows_inserted (ETableSubset *etss, ETableModel *source, gint row, gint count); +static void ets_proxy_model_rows_deleted (ETableSubset *etss, ETableModel *source, gint row, gint count); static void ets_dispose (GObject *object) @@ -158,7 +158,7 @@ ets_sort_info_changed (ETableSortInfo *info, ETableSorted *ets) static void ets_proxy_model_changed (ETableSubset *subset, ETableModel *source) { - int rows, i; + gint rows, i; rows = e_table_model_row_count(source); @@ -177,7 +177,7 @@ ets_proxy_model_changed (ETableSubset *subset, ETableModel *source) } static void -ets_proxy_model_row_changed (ETableSubset *subset, ETableModel *source, int row) +ets_proxy_model_row_changed (ETableSubset *subset, ETableModel *source, gint row) { if (!E_TABLE_SORTED(subset)->sort_idle_id) E_TABLE_SORTED(subset)->sort_idle_id = g_idle_add_full(50, (GSourceFunc) ets_sort_idle, subset, NULL); @@ -187,7 +187,7 @@ ets_proxy_model_row_changed (ETableSubset *subset, ETableModel *source, int row) } static void -ets_proxy_model_cell_changed (ETableSubset *subset, ETableModel *source, int col, int row) +ets_proxy_model_cell_changed (ETableSubset *subset, ETableModel *source, gint col, gint row) { ETableSorted *ets = E_TABLE_SORTED(subset); if (e_table_sorting_utils_affects_sort(ets->sort_info, ets->full_header, col)) @@ -197,11 +197,11 @@ ets_proxy_model_cell_changed (ETableSubset *subset, ETableModel *source, int col } static void -ets_proxy_model_rows_inserted (ETableSubset *etss, ETableModel *source, int row, int count) +ets_proxy_model_rows_inserted (ETableSubset *etss, ETableModel *source, gint row, gint count) { ETableModel *etm = E_TABLE_MODEL(etss); ETableSorted *ets = E_TABLE_SORTED(etss); - int i; + gint i; gboolean full_change = FALSE; if (count == 0) { @@ -257,12 +257,12 @@ ets_proxy_model_rows_inserted (ETableSubset *etss, ETableModel *source, int row, } static void -ets_proxy_model_rows_deleted (ETableSubset *etss, ETableModel *source, int row, int count) +ets_proxy_model_rows_deleted (ETableSubset *etss, ETableModel *source, gint row, gint count) { ETableModel *etm = E_TABLE_MODEL(etss); - int i; + gint i; gboolean shift; - int j; + gint j; shift = row == etss->n_map - count; @@ -297,7 +297,7 @@ static void ets_sort(ETableSorted *ets) { ETableSubset *etss = E_TABLE_SUBSET(ets); - static int reentering = 0; + static gint reentering = 0; if (reentering) return; reentering = 1; diff --git a/widgets/table/e-table-sorted.h b/widgets/table/e-table-sorted.h index 031d9c9647..cb802768d8 100644 --- a/widgets/table/e-table-sorted.h +++ b/widgets/table/e-table-sorted.h @@ -46,8 +46,8 @@ typedef struct { ETableHeader *full_header; - int sort_info_changed_id; - int sort_idle_id; + gint sort_info_changed_id; + gint sort_idle_id; int insert_idle_id; int insert_count; diff --git a/widgets/table/e-table-sorter.c b/widgets/table/e-table-sorter.c index 154d5a2581..8851f31209 100644 --- a/widgets/table/e-table-sorter.c +++ b/widgets/table/e-table-sorter.c @@ -45,19 +45,19 @@ G_DEFINE_TYPE (ETableSorter, ets, E_SORTER_TYPE) #define INCREMENT_AMOUNT 100 static void ets_model_changed (ETableModel *etm, ETableSorter *ets); -static void ets_model_row_changed (ETableModel *etm, int row, ETableSorter *ets); -static void ets_model_cell_changed (ETableModel *etm, int col, int row, ETableSorter *ets); -static void ets_model_rows_inserted (ETableModel *etm, int row, int count, ETableSorter *ets); -static void ets_model_rows_deleted (ETableModel *etm, int row, int count, ETableSorter *ets); +static void ets_model_row_changed (ETableModel *etm, gint row, ETableSorter *ets); +static void ets_model_cell_changed (ETableModel *etm, gint col, gint row, ETableSorter *ets); +static void ets_model_rows_inserted (ETableModel *etm, gint row, gint count, ETableSorter *ets); +static void ets_model_rows_deleted (ETableModel *etm, gint row, gint count, ETableSorter *ets); static void ets_sort_info_changed (ETableSortInfo *info, ETableSorter *ets); static void ets_clean (ETableSorter *ets); static void ets_sort (ETableSorter *ets); static void ets_backsort (ETableSorter *ets); -static gint ets_model_to_sorted (ESorter *sorter, int row); -static gint ets_sorted_to_model (ESorter *sorter, int row); -static void ets_get_model_to_sorted_array (ESorter *sorter, int **array, int *count); -static void ets_get_sorted_to_model_array (ESorter *sorter, int **array, int *count); +static gint ets_model_to_sorted (ESorter *sorter, gint row); +static gint ets_sorted_to_model (ESorter *sorter, gint row); +static void ets_get_model_to_sorted_array (ESorter *sorter, gint **array, gint *count); +static void ets_get_sorted_to_model_array (ESorter *sorter, gint **array, gint *count); static gboolean ets_needs_sorting (ESorter *ets); static void @@ -230,25 +230,25 @@ ets_model_changed (ETableModel *etm, ETableSorter *ets) } static void -ets_model_row_changed (ETableModel *etm, int row, ETableSorter *ets) +ets_model_row_changed (ETableModel *etm, gint row, ETableSorter *ets) { ets_clean(ets); } static void -ets_model_cell_changed (ETableModel *etm, int col, int row, ETableSorter *ets) +ets_model_cell_changed (ETableModel *etm, gint col, gint row, ETableSorter *ets) { ets_clean(ets); } static void -ets_model_rows_inserted (ETableModel *etm, int row, int count, ETableSorter *ets) +ets_model_rows_inserted (ETableModel *etm, gint row, gint count, ETableSorter *ets) { ets_clean(ets); } static void -ets_model_rows_deleted (ETableModel *etm, int row, int count, ETableSorter *ets) +ets_model_rows_deleted (ETableModel *etm, gint row, gint count, ETableSorter *ets) { ets_clean(ets); } @@ -261,22 +261,22 @@ ets_sort_info_changed (ETableSortInfo *info, ETableSorter *ets) } static ETableSorter *ets_closure; -static void **vals_closure; -static int cols_closure; -static int *ascending_closure; +static gpointer *vals_closure; +static gint cols_closure; +static gint *ascending_closure; static GCompareFunc *compare_closure; /* FIXME: Make it not cache the second and later columns (as if anyone cares.) */ static int -qsort_callback(const void *data1, const void *data2) +qsort_callback(gconstpointer data1, gconstpointer data2) { - gint row1 = *(int *)data1; - gint row2 = *(int *)data2; - int j; - int sort_count = e_table_sort_info_sorting_get_count(ets_closure->sort_info) + e_table_sort_info_grouping_get_count(ets_closure->sort_info); - int comp_val = 0; - int ascending = 1; + gint row1 = *(gint *)data1; + gint row2 = *(gint *)data2; + gint j; + gint sort_count = e_table_sort_info_sorting_get_count(ets_closure->sort_info) + e_table_sort_info_grouping_get_count(ets_closure->sort_info); + gint comp_val = 0; + gint ascending = 1; for (j = 0; j < sort_count; j++) { comp_val = (*(compare_closure[j]))(vals_closure[cols_closure * row1 + j], vals_closure[cols_closure * row2 + j]); ascending = ascending_closure[j]; @@ -310,11 +310,11 @@ ets_clean(ETableSorter *ets) static void ets_sort(ETableSorter *ets) { - int rows; - int i; - int j; - int cols; - int group_cols; + gint rows; + gint i; + gint j; + gint cols; + gint group_cols; if (ets->sorted) return; @@ -330,7 +330,7 @@ ets_sort(ETableSorter *ets) cols_closure = cols; ets_closure = ets; - vals_closure = g_new(void *, rows * cols); + vals_closure = g_new(gpointer , rows * cols); ascending_closure = g_new(int, cols); compare_closure = g_new(GCompareFunc, cols); @@ -365,7 +365,7 @@ ets_sort(ETableSorter *ets) static void ets_backsort(ETableSorter *ets) { - int i, rows; + gint i, rows; if (ets->backsorted) return; @@ -382,10 +382,10 @@ ets_backsort(ETableSorter *ets) static gint -ets_model_to_sorted (ESorter *es, int row) +ets_model_to_sorted (ESorter *es, gint row) { ETableSorter *ets = E_TABLE_SORTER(es); - int rows = e_table_model_row_count(ets->source); + gint rows = e_table_model_row_count(ets->source); g_return_val_if_fail(row >= 0, -1); g_return_val_if_fail(row < rows, -1); @@ -400,10 +400,10 @@ ets_model_to_sorted (ESorter *es, int row) } static gint -ets_sorted_to_model (ESorter *es, int row) +ets_sorted_to_model (ESorter *es, gint row) { ETableSorter *ets = E_TABLE_SORTER(es); - int rows = e_table_model_row_count(ets->source); + gint rows = e_table_model_row_count(ets->source); g_return_val_if_fail(row >= 0, -1); g_return_val_if_fail(row < rows, -1); @@ -418,7 +418,7 @@ ets_sorted_to_model (ESorter *es, int row) } static void -ets_get_model_to_sorted_array (ESorter *es, int **array, int *count) +ets_get_model_to_sorted_array (ESorter *es, gint **array, gint *count) { ETableSorter *ets = E_TABLE_SORTER(es); if (array || count) { @@ -432,7 +432,7 @@ ets_get_model_to_sorted_array (ESorter *es, int **array, int *count) } static void -ets_get_sorted_to_model_array (ESorter *es, int **array, int *count) +ets_get_sorted_to_model_array (ESorter *es, gint **array, gint *count) { ETableSorter *ets = E_TABLE_SORTER(es); if (array || count) { diff --git a/widgets/table/e-table-sorter.h b/widgets/table/e-table-sorter.h index 245539e36f..067da103f9 100644 --- a/widgets/table/e-table-sorter.h +++ b/widgets/table/e-table-sorter.h @@ -46,18 +46,18 @@ typedef struct { ETableSortInfo *sort_info; /* If needs_sorting is 0, then model_to_sorted and sorted_to_model are no-ops. */ - int needs_sorting; + gint needs_sorting; - int *sorted; - int *backsorted; + gint *sorted; + gint *backsorted; - int table_model_changed_id; - int table_model_row_changed_id; - int table_model_cell_changed_id; - int table_model_rows_inserted_id; - int table_model_rows_deleted_id; - int sort_info_changed_id; - int group_info_changed_id; + gint table_model_changed_id; + gint table_model_row_changed_id; + gint table_model_cell_changed_id; + gint table_model_rows_inserted_id; + gint table_model_rows_deleted_id; + gint sort_info_changed_id; + gint group_info_changed_id; } ETableSorter; typedef struct { diff --git a/widgets/table/e-table-sorting-utils.c b/widgets/table/e-table-sorting-utils.c index d04144d5ad..a8ab92bf94 100644 --- a/widgets/table/e-table-sorting-utils.c +++ b/widgets/table/e-table-sorting-utils.c @@ -32,12 +32,12 @@ /* This takes source rows. */ static int -etsu_compare(ETableModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, int row1, int row2) +etsu_compare(ETableModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, gint row1, gint row2) { - int j; - int sort_count = e_table_sort_info_sorting_get_count(sort_info); - int comp_val = 0; - int ascending = 1; + gint j; + gint sort_count = e_table_sort_info_sorting_get_count(sort_info); + gint comp_val = 0; + gint ascending = 1; for (j = 0; j < sort_count; j++) { ETableSortColumn column = e_table_sort_info_sorting_get_nth(sort_info, j); @@ -63,9 +63,9 @@ etsu_compare(ETableModel *source, ETableSortInfo *sort_info, ETableHeader *full_ } typedef struct { - int cols; - void **vals; - int *ascending; + gint cols; + gpointer *vals; + gint *ascending; GCompareFunc *compare; } ETableSortClosure; @@ -78,15 +78,15 @@ typedef struct { /* FIXME: Make it not cache the second and later columns (as if anyone cares.) */ static int -e_sort_callback(const void *data1, const void *data2, gpointer user_data) +e_sort_callback(gconstpointer data1, gconstpointer data2, gpointer user_data) { - gint row1 = *(int *)data1; - gint row2 = *(int *)data2; + gint row1 = *(gint *)data1; + gint row2 = *(gint *)data2; ETableSortClosure *closure = user_data; - int j; - int sort_count = closure->cols; - int comp_val = 0; - int ascending = 1; + gint j; + gint sort_count = closure->cols; + gint comp_val = 0; + gint ascending = 1; for (j = 0; j < sort_count; j++) { comp_val = (*(closure->compare[j]))(closure->vals[closure->cols * row1 + j], closure->vals[closure->cols * row2 + j]); ascending = closure->ascending[j]; @@ -105,12 +105,12 @@ e_sort_callback(const void *data1, const void *data2, gpointer user_data) } void -e_table_sorting_utils_sort(ETableModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, int *map_table, int rows) +e_table_sorting_utils_sort(ETableModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, gint *map_table, gint rows) { - int total_rows; - int i; - int j; - int cols; + gint total_rows; + gint i; + gint j; + gint cols; ETableSortClosure closure; g_return_if_fail(source != NULL); @@ -124,7 +124,7 @@ e_table_sorting_utils_sort(ETableModel *source, ETableSortInfo *sort_info, ETabl cols = e_table_sort_info_sorting_get_count(sort_info); closure.cols = cols; - closure.vals = g_new(void *, total_rows * cols); + closure.vals = g_new(gpointer , total_rows * cols); closure.ascending = g_new(int, cols); closure.compare = g_new(GCompareFunc, cols); @@ -152,10 +152,10 @@ e_table_sorting_utils_sort(ETableModel *source, ETableSortInfo *sort_info, ETabl gboolean e_table_sorting_utils_affects_sort (ETableSortInfo *sort_info, ETableHeader *full_header, - int col) + gint col) { - int j; - int cols; + gint j; + gint cols; g_return_val_if_fail(sort_info != NULL, TRUE); g_return_val_if_fail(E_IS_TABLE_SORT_INFO(sort_info), TRUE); @@ -178,10 +178,10 @@ e_table_sorting_utils_affects_sort (ETableSortInfo *sort_info, /* FIXME: This could be done in time log n instead of time n with a binary search. */ -int -e_table_sorting_utils_insert(ETableModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, int *map_table, int rows, int row) +gint +e_table_sorting_utils_insert(ETableModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, gint *map_table, gint rows, gint row) { - int i; + gint i; i = 0; /* handle insertions when we have a 'sort group' */ @@ -192,11 +192,11 @@ e_table_sorting_utils_insert(ETableModel *source, ETableSortInfo *sort_info, ETa } /* FIXME: This could be done in time log n instead of time n with a binary search. */ -int -e_table_sorting_utils_check_position (ETableModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, int *map_table, int rows, int view_row) +gint +e_table_sorting_utils_check_position (ETableModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, gint *map_table, gint rows, gint view_row) { - int i; - int row; + gint i; + gint row; i = view_row; row = map_table[i]; @@ -221,10 +221,10 @@ e_table_sorting_utils_check_position (ETableModel *source, ETableSortInfo *sort_ static int etsu_tree_compare(ETreeModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, ETreePath path1, ETreePath path2) { - int j; - int sort_count = e_table_sort_info_sorting_get_count(sort_info); - int comp_val = 0; - int ascending = 1; + gint j; + gint sort_count = e_table_sort_info_sorting_get_count(sort_info); + gint comp_val = 0; + gint ascending = 1; for (j = 0; j < sort_count; j++) { ETableSortColumn column = e_table_sort_info_sorting_get_nth(sort_info, j); @@ -244,7 +244,7 @@ etsu_tree_compare(ETreeModel *source, ETableSortInfo *sort_info, ETableHeader *f } static int -e_sort_tree_callback(const void *data1, const void *data2, gpointer user_data) +e_sort_tree_callback(gconstpointer data1, gconstpointer data2, gpointer user_data) { ETreePath *path1 = *(ETreePath *)data1; ETreePath *path2 = *(ETreePath *)data2; @@ -254,12 +254,12 @@ e_sort_tree_callback(const void *data1, const void *data2, gpointer user_data) } void -e_table_sorting_utils_tree_sort(ETreeModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, ETreePath *map_table, int count) +e_table_sorting_utils_tree_sort(ETreeModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, ETreePath *map_table, gint count) { ETableSortClosure closure; - int cols; - int i, j; - int *map; + gint cols; + gint i, j; + gint *map; ETreePath *map_copy; g_return_if_fail(source != NULL); g_return_if_fail(E_IS_TREE_MODEL(source)); @@ -271,7 +271,7 @@ e_table_sorting_utils_tree_sort(ETreeModel *source, ETableSortInfo *sort_info, E cols = e_table_sort_info_sorting_get_count(sort_info); closure.cols = cols; - closure.vals = g_new(void *, count * cols); + closure.vals = g_new(gpointer , count * cols); closure.ascending = g_new(int, cols); closure.compare = g_new(GCompareFunc, cols); @@ -315,10 +315,10 @@ e_table_sorting_utils_tree_sort(ETreeModel *source, ETableSortInfo *sort_info, E } /* FIXME: This could be done in time log n instead of time n with a binary search. */ -int -e_table_sorting_utils_tree_check_position (ETreeModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, ETreePath *map_table, int count, int old_index) +gint +e_table_sorting_utils_tree_check_position (ETreeModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, ETreePath *map_table, gint count, gint old_index) { - int i; + gint i; ETreePath path; i = old_index; @@ -337,8 +337,8 @@ e_table_sorting_utils_tree_check_position (ETreeModel *source, ETableSortInfo *s } /* FIXME: This does not pay attention to making sure that it's a stable insert. This needs to be fixed. */ -int -e_table_sorting_utils_tree_insert(ETreeModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, ETreePath *map_table, int count, ETreePath path) +gint +e_table_sorting_utils_tree_insert(ETreeModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, ETreePath *map_table, gint count, ETreePath path) { size_t start; size_t end; diff --git a/widgets/table/e-table-sorting-utils.h b/widgets/table/e-table-sorting-utils.h index a0f43fb232..d348d4b6b1 100644 --- a/widgets/table/e-table-sorting-utils.h +++ b/widgets/table/e-table-sorting-utils.h @@ -31,27 +31,27 @@ G_BEGIN_DECLS #include <table/e-table-header.h> gboolean e_table_sorting_utils_affects_sort (ETableSortInfo *sort_info, ETableHeader *full_header, - int col); + gint col); void e_table_sorting_utils_sort (ETableModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, - int *map_table, - int rows); -int e_table_sorting_utils_insert (ETableModel *source, + gint *map_table, + gint rows); +gint e_table_sorting_utils_insert (ETableModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, - int *map_table, - int rows, - int row); -int e_table_sorting_utils_check_position (ETableModel *source, + gint *map_table, + gint rows, + gint row); +gint e_table_sorting_utils_check_position (ETableModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, - int *map_table, - int rows, - int view_row); + gint *map_table, + gint rows, + gint view_row); @@ -59,18 +59,18 @@ void e_table_sorting_utils_tree_sort (ETreeModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, ETreePath *map_table, - int count); -int e_table_sorting_utils_tree_check_position (ETreeModel *source, + gint count); +gint e_table_sorting_utils_tree_check_position (ETreeModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, ETreePath *map_table, - int count, - int old_index); -int e_table_sorting_utils_tree_insert (ETreeModel *source, + gint count, + gint old_index); +gint e_table_sorting_utils_tree_insert (ETreeModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, ETreePath *map_table, - int count, + gint count, ETreePath path); G_END_DECLS diff --git a/widgets/table/e-table-specification.c b/widgets/table/e-table-specification.c index f966b3ca6f..fd57f5b130 100644 --- a/widgets/table/e-table-specification.c +++ b/widgets/table/e-table-specification.c @@ -45,7 +45,7 @@ static void etsp_finalize (GObject *object) { ETableSpecification *etsp = E_TABLE_SPECIFICATION (object); - int i; + gint i; if (etsp->columns) { for (i = 0; etsp->columns[i]; i++) { @@ -128,7 +128,7 @@ e_table_specification_new (void) */ gboolean e_table_specification_load_from_file (ETableSpecification *specification, - const char *filename) + const gchar *filename) { xmlDoc *doc; @@ -155,10 +155,10 @@ e_table_specification_load_from_file (ETableSpecification *specification, */ gboolean e_table_specification_load_from_string (ETableSpecification *specification, - const char *xml) + const gchar *xml) { xmlDoc *doc; - doc = xmlParseMemory ( (char *) xml, strlen (xml)); + doc = xmlParseMemory ( (gchar *) xml, strlen (xml)); if (doc) { xmlNode *node = xmlDocGetRootElement (doc); e_table_specification_load_from_node (specification, node); @@ -181,29 +181,29 @@ void e_table_specification_load_from_node (ETableSpecification *specification, const xmlNode *node) { - char *temp; + gchar *temp; xmlNode *children; GList *list = NULL, *list2; - int i; - - specification->no_headers = e_xml_get_bool_prop_by_name (node, (const unsigned char *)"no-headers"); - specification->click_to_add = e_xml_get_bool_prop_by_name (node, (const unsigned char *)"click-to-add"); - specification->click_to_add_end = e_xml_get_bool_prop_by_name (node, (const unsigned char *)"click-to-add-end") && specification->click_to_add; - specification->alternating_row_colors = e_xml_get_bool_prop_by_name_with_default (node, (const unsigned char *)"alternating-row-colors", TRUE); - specification->horizontal_draw_grid = e_xml_get_bool_prop_by_name (node, (const unsigned char *)"horizontal-draw-grid"); - specification->vertical_draw_grid = e_xml_get_bool_prop_by_name (node, (const unsigned char *)"vertical-draw-grid"); - if (e_xml_get_bool_prop_by_name_with_default(node, (const unsigned char *)"draw-grid", TRUE) == - e_xml_get_bool_prop_by_name_with_default(node, (const unsigned char *)"draw-grid", FALSE)) { + gint i; + + specification->no_headers = e_xml_get_bool_prop_by_name (node, (const guchar *)"no-headers"); + specification->click_to_add = e_xml_get_bool_prop_by_name (node, (const guchar *)"click-to-add"); + specification->click_to_add_end = e_xml_get_bool_prop_by_name (node, (const guchar *)"click-to-add-end") && specification->click_to_add; + specification->alternating_row_colors = e_xml_get_bool_prop_by_name_with_default (node, (const guchar *)"alternating-row-colors", TRUE); + specification->horizontal_draw_grid = e_xml_get_bool_prop_by_name (node, (const guchar *)"horizontal-draw-grid"); + specification->vertical_draw_grid = e_xml_get_bool_prop_by_name (node, (const guchar *)"vertical-draw-grid"); + if (e_xml_get_bool_prop_by_name_with_default(node, (const guchar *)"draw-grid", TRUE) == + e_xml_get_bool_prop_by_name_with_default(node, (const guchar *)"draw-grid", FALSE)) { specification->horizontal_draw_grid = - specification->vertical_draw_grid = e_xml_get_bool_prop_by_name (node, (const unsigned char *)"draw-grid"); + specification->vertical_draw_grid = e_xml_get_bool_prop_by_name (node, (const guchar *)"draw-grid"); } - specification->draw_focus = e_xml_get_bool_prop_by_name_with_default (node, (const unsigned char *)"draw-focus", TRUE); - specification->horizontal_scrolling = e_xml_get_bool_prop_by_name_with_default (node, (const unsigned char *)"horizontal-scrolling", FALSE); - specification->horizontal_resize = e_xml_get_bool_prop_by_name_with_default (node, (const unsigned char *)"horizontal-resize", FALSE); - specification->allow_grouping = e_xml_get_bool_prop_by_name_with_default (node, (const unsigned char *)"allow-grouping", TRUE); + specification->draw_focus = e_xml_get_bool_prop_by_name_with_default (node, (const guchar *)"draw-focus", TRUE); + specification->horizontal_scrolling = e_xml_get_bool_prop_by_name_with_default (node, (const guchar *)"horizontal-scrolling", FALSE); + specification->horizontal_resize = e_xml_get_bool_prop_by_name_with_default (node, (const guchar *)"horizontal-resize", FALSE); + specification->allow_grouping = e_xml_get_bool_prop_by_name_with_default (node, (const guchar *)"allow-grouping", TRUE); specification->selection_mode = GTK_SELECTION_MULTIPLE; - temp = e_xml_get_string_prop_by_name (node, (const unsigned char *)"selection-mode"); + temp = e_xml_get_string_prop_by_name (node, (const guchar *)"selection-mode"); if (temp && !g_ascii_strcasecmp (temp, "single")) { specification->selection_mode = GTK_SELECTION_SINGLE; } else if (temp && !g_ascii_strcasecmp (temp, "browse")) { @@ -214,7 +214,7 @@ e_table_specification_load_from_node (ETableSpecification *specification, g_free (temp); specification->cursor_mode = E_CURSOR_SIMPLE; - temp = e_xml_get_string_prop_by_name (node, (const unsigned char *)"cursor-mode"); + temp = e_xml_get_string_prop_by_name (node, (const guchar *)"cursor-mode"); if (temp && !g_ascii_strcasecmp (temp, "line")) { specification->cursor_mode = E_CURSOR_LINE; } else if (temp && !g_ascii_strcasecmp (temp, "spreadsheet")) { @@ -225,12 +225,12 @@ e_table_specification_load_from_node (ETableSpecification *specification, g_free (specification->click_to_add_message); specification->click_to_add_message = e_xml_get_string_prop_by_name ( - node, (const unsigned char *)"_click-to-add-message"); + node, (const guchar *)"_click-to-add-message"); g_free (specification->domain); specification->domain = e_xml_get_string_prop_by_name ( - node, (const unsigned char *)"gettext-domain"); + node, (const guchar *)"gettext-domain"); if (specification->domain && !*specification->domain) { g_free (specification->domain); specification->domain = NULL; @@ -248,12 +248,12 @@ e_table_specification_load_from_node (ETableSpecification *specification, specification->columns = NULL; for (children = node->xmlChildrenNode; children; children = children->next) { - if (!strcmp ((char *)children->name, "ETableColumn")) { + if (!strcmp ((gchar *)children->name, "ETableColumn")) { ETableColumnSpecification *col_spec = e_table_column_specification_new (); e_table_column_specification_load_from_node (col_spec, children); list = g_list_append (list, col_spec); - } else if (specification->state == NULL && !strcmp ((char *)children->name, "ETableState")) { + } else if (specification->state == NULL && !strcmp ((gchar *)children->name, "ETableState")) { specification->state = e_table_state_new (); e_table_state_load_from_node (specification->state, children); e_table_sort_info_set_can_group (specification->state->sort_info, specification->allow_grouping); @@ -282,18 +282,18 @@ e_table_specification_load_from_node (ETableSpecification *specification, * * Returns: 0 on success or -1 on error. */ -int +gint e_table_specification_save_to_file (ETableSpecification *specification, - const char *filename) + const gchar *filename) { xmlDoc *doc; - int ret; + gint ret; g_return_val_if_fail (specification != NULL, -1); g_return_val_if_fail (filename != NULL, -1); g_return_val_if_fail (E_IS_TABLE_SPECIFICATION (specification), -1); - if ((doc = xmlNewDoc ((const unsigned char *)"1.0")) == NULL) + if ((doc = xmlNewDoc ((const guchar *)"1.0")) == NULL) return -1; xmlDocSetRootElement (doc, e_table_specification_save_to_node (specification, doc)); @@ -315,18 +315,18 @@ e_table_specification_save_to_file (ETableSpecification *specification, * representation of @specification. This stringified representation * uses XML as a convenience. */ -char * +gchar * e_table_specification_save_to_string (ETableSpecification *specification) { - char *ret_val; + gchar *ret_val; xmlChar *string; - int length; + gint length; xmlDoc *doc; g_return_val_if_fail (specification != NULL, NULL); g_return_val_if_fail (E_IS_TABLE_SPECIFICATION (specification), NULL); - doc = xmlNewDoc ((const unsigned char *)"1.0"); + doc = xmlNewDoc ((const guchar *)"1.0"); xmlDocSetRootElement (doc, e_table_specification_save_to_node (specification, doc)); xmlDocDumpMemory (doc, &string, &length); @@ -357,17 +357,17 @@ e_table_specification_save_to_node (ETableSpecification *specification, g_return_val_if_fail (specification != NULL, NULL); g_return_val_if_fail (E_IS_TABLE_SPECIFICATION (specification), NULL); - node = xmlNewNode (NULL, (const unsigned char *)"ETableSpecification"); - e_xml_set_bool_prop_by_name (node, (const unsigned char *)"no-headers", specification->no_headers); - e_xml_set_bool_prop_by_name (node, (const unsigned char *)"click-to-add", specification->click_to_add); - e_xml_set_bool_prop_by_name (node, (const unsigned char *)"click-to-add-end", specification->click_to_add_end && specification->click_to_add); - e_xml_set_bool_prop_by_name (node, (const unsigned char *)"alternating-row-colors", specification->alternating_row_colors); - e_xml_set_bool_prop_by_name (node, (const unsigned char *)"horizontal-draw-grid", specification->horizontal_draw_grid); - e_xml_set_bool_prop_by_name (node, (const unsigned char *)"vertical-draw-grid", specification->vertical_draw_grid); - e_xml_set_bool_prop_by_name (node, (const unsigned char *)"draw-focus", specification->draw_focus); - e_xml_set_bool_prop_by_name (node, (const unsigned char *)"horizontal-scrolling", specification->horizontal_scrolling); - e_xml_set_bool_prop_by_name (node, (const unsigned char *)"horizontal-resize", specification->horizontal_resize); - e_xml_set_bool_prop_by_name (node, (const unsigned char *)"allow-grouping", specification->allow_grouping); + node = xmlNewNode (NULL, (const guchar *)"ETableSpecification"); + e_xml_set_bool_prop_by_name (node, (const guchar *)"no-headers", specification->no_headers); + e_xml_set_bool_prop_by_name (node, (const guchar *)"click-to-add", specification->click_to_add); + e_xml_set_bool_prop_by_name (node, (const guchar *)"click-to-add-end", specification->click_to_add_end && specification->click_to_add); + e_xml_set_bool_prop_by_name (node, (const guchar *)"alternating-row-colors", specification->alternating_row_colors); + e_xml_set_bool_prop_by_name (node, (const guchar *)"horizontal-draw-grid", specification->horizontal_draw_grid); + e_xml_set_bool_prop_by_name (node, (const guchar *)"vertical-draw-grid", specification->vertical_draw_grid); + e_xml_set_bool_prop_by_name (node, (const guchar *)"draw-focus", specification->draw_focus); + e_xml_set_bool_prop_by_name (node, (const guchar *)"horizontal-scrolling", specification->horizontal_scrolling); + e_xml_set_bool_prop_by_name (node, (const guchar *)"horizontal-resize", specification->horizontal_resize); + e_xml_set_bool_prop_by_name (node, (const guchar *)"allow-grouping", specification->allow_grouping); switch (specification->selection_mode){ case GTK_SELECTION_SINGLE: @@ -380,18 +380,18 @@ e_table_specification_save_to_node (ETableSpecification *specification, case GTK_SELECTION_EXTENDED: s = "extended"; } - xmlSetProp (node, (const unsigned char *)"selection-mode", (unsigned char *)s); + xmlSetProp (node, (const guchar *)"selection-mode", (guchar *)s); if (specification->cursor_mode == E_CURSOR_LINE) s = "line"; else s = "cell"; - xmlSetProp (node, (const unsigned char *)"cursor-mode", (unsigned char *)s); + xmlSetProp (node, (const guchar *)"cursor-mode", (guchar *)s); - xmlSetProp (node, (const unsigned char *)"_click-to-add-message", (unsigned char *)specification->click_to_add_message); - xmlSetProp (node, (const unsigned char *)"gettext-domain", (unsigned char *)specification->domain); + xmlSetProp (node, (const guchar *)"_click-to-add-message", (guchar *)specification->click_to_add_message); + xmlSetProp (node, (const guchar *)"gettext-domain", (guchar *)specification->domain); if (specification->columns){ - int i; + gint i; for (i = 0; specification->columns [i]; i++) e_table_column_specification_save_to_node ( @@ -417,7 +417,7 @@ ETableSpecification * e_table_specification_duplicate (ETableSpecification *spec) { ETableSpecification *new_spec; - char *spec_str; + gchar *spec_str; g_return_val_if_fail (spec != NULL, NULL); g_return_val_if_fail (E_IS_TABLE_SPECIFICATION (spec), NULL); diff --git a/widgets/table/e-table-specification.h b/widgets/table/e-table-specification.h index 580cbc6ba3..c2ca7a018d 100644 --- a/widgets/table/e-table-specification.h +++ b/widgets/table/e-table-specification.h @@ -59,8 +59,8 @@ typedef struct { GtkSelectionMode selection_mode; ECursorMode cursor_mode; - char *click_to_add_message; - char *domain; + gchar *click_to_add_message; + gchar *domain; } ETableSpecification; typedef struct { @@ -71,15 +71,15 @@ GType e_table_specification_get_type (void); ETableSpecification *e_table_specification_new (void); gboolean e_table_specification_load_from_file (ETableSpecification *specification, - const char *filename); + const gchar *filename); gboolean e_table_specification_load_from_string (ETableSpecification *specification, - const char *xml); + const gchar *xml); void e_table_specification_load_from_node (ETableSpecification *specification, const xmlNode *node); -int e_table_specification_save_to_file (ETableSpecification *specification, - const char *filename); -char *e_table_specification_save_to_string (ETableSpecification *specification); +gint e_table_specification_save_to_file (ETableSpecification *specification, + const gchar *filename); +gchar *e_table_specification_save_to_string (ETableSpecification *specification); xmlNode *e_table_specification_save_to_node (ETableSpecification *specification, xmlDoc *doc); ETableSpecification *e_table_specification_duplicate (ETableSpecification *spec); diff --git a/widgets/table/e-table-state.c b/widgets/table/e-table-state.c index e9440ecd55..6cbdcbacb9 100644 --- a/widgets/table/e-table-state.c +++ b/widgets/table/e-table-state.c @@ -94,10 +94,10 @@ e_table_state_new (void) } ETableState * -e_table_state_vanilla (int col_count) +e_table_state_vanilla (gint col_count) { GString *str; - int i; + gint i; ETableState *res; str = g_string_new ("<ETableState>\n"); @@ -115,7 +115,7 @@ e_table_state_vanilla (int col_count) gboolean e_table_state_load_from_file (ETableState *state, - const char *filename) + const gchar *filename) { xmlDoc *doc; @@ -131,11 +131,11 @@ e_table_state_load_from_file (ETableState *state, void e_table_state_load_from_string (ETableState *state, - const char *xml) + const gchar *xml) { xmlDoc *doc; - doc = xmlParseMemory ((char *) xml, strlen(xml)); + doc = xmlParseMemory ((gchar *) xml, strlen(xml)); if (doc) { xmlNode *node = xmlDocGetRootElement(doc); e_table_state_load_from_node(state, node); @@ -144,7 +144,7 @@ e_table_state_load_from_string (ETableState *state, } typedef struct { - int column; + gint column; double expansion; } int_and_double; @@ -155,10 +155,10 @@ e_table_state_load_from_node (ETableState *state, xmlNode *children; GList *list = NULL, *iterator; gdouble state_version; - int i; + gint i; state_version = e_xml_get_double_prop_by_name_with_default ( - node, (const unsigned char *)"state-version", STATE_VERSION); + node, (const guchar *)"state-version", STATE_VERSION); if (state->sort_info) g_object_unref (state->sort_info); @@ -166,18 +166,18 @@ e_table_state_load_from_node (ETableState *state, state->sort_info = NULL; children = node->xmlChildrenNode; for (; children; children = children->next) { - if (!strcmp ((char *)children->name, "column")) { + if (!strcmp ((gchar *)children->name, "column")) { int_and_double *column_info = g_new(int_and_double, 1); column_info->column = e_xml_get_integer_prop_by_name( - children, (const unsigned char *)"source"); + children, (const guchar *)"source"); column_info->expansion = e_xml_get_double_prop_by_name_with_default( - children, (const unsigned char *)"expansion", 1); + children, (const guchar *)"expansion", 1); list = g_list_append (list, column_info); } else if (state->sort_info == NULL && - !strcmp ((char *)children->name, "grouping")) { + !strcmp ((gchar *)children->name, "grouping")) { state->sort_info = e_table_sort_info_new(); e_table_sort_info_load_from_node( state->sort_info, children, state_version); @@ -205,11 +205,11 @@ e_table_state_load_from_node (ETableState *state, void e_table_state_save_to_file (ETableState *state, - const char *filename) + const gchar *filename) { xmlDoc *doc; - if ((doc = xmlNewDoc ((const unsigned char *)"1.0")) == NULL) + if ((doc = xmlNewDoc ((const guchar *)"1.0")) == NULL) return; xmlDocSetRootElement (doc, e_table_state_save_to_node (state, NULL)); @@ -219,15 +219,15 @@ e_table_state_save_to_file (ETableState *state, xmlFreeDoc (doc); } -char * +gchar * e_table_state_save_to_string (ETableState *state) { - char *ret_val; + gchar *ret_val; xmlChar *string; - int length; + gint length; xmlDoc *doc; - doc = xmlNewDoc((const unsigned char *)"1.0"); + doc = xmlNewDoc((const guchar *)"1.0"); xmlDocSetRootElement(doc, e_table_state_save_to_node(state, NULL)); xmlDocDumpMemory(doc, &string, &length); xmlFreeDoc(doc); @@ -241,25 +241,25 @@ xmlNode * e_table_state_save_to_node (ETableState *state, xmlNode *parent) { - int i; + gint i; xmlNode *node; if (parent) - node = xmlNewChild (parent, NULL, (const unsigned char *)"ETableState", NULL); + node = xmlNewChild (parent, NULL, (const guchar *)"ETableState", NULL); else - node = xmlNewNode (NULL, (const unsigned char *)"ETableState"); + node = xmlNewNode (NULL, (const guchar *)"ETableState"); - e_xml_set_double_prop_by_name(node, (const unsigned char *)"state-version", STATE_VERSION); + e_xml_set_double_prop_by_name(node, (const guchar *)"state-version", STATE_VERSION); for (i = 0; i < state->col_count; i++) { - int column = state->columns[i]; + gint column = state->columns[i]; double expansion = state->expansions[i]; xmlNode *new_node; - new_node = xmlNewChild(node, NULL, (const unsigned char *)"column", NULL); - e_xml_set_integer_prop_by_name (new_node, (const unsigned char *)"source", column); + new_node = xmlNewChild(node, NULL, (const guchar *)"column", NULL); + e_xml_set_integer_prop_by_name (new_node, (const guchar *)"source", column); if (expansion >= -1) - e_xml_set_double_prop_by_name(new_node, (const unsigned char *)"expansion", expansion); + e_xml_set_double_prop_by_name(new_node, (const guchar *)"expansion", expansion); } @@ -280,7 +280,7 @@ ETableState * e_table_state_duplicate (ETableState *state) { ETableState *new_state; - char *copy; + gchar *copy; g_return_val_if_fail (state != NULL, NULL); g_return_val_if_fail (E_IS_TABLE_STATE (state), NULL); diff --git a/widgets/table/e-table-state.h b/widgets/table/e-table-state.h index 7a320c56ba..da3f11b93c 100644 --- a/widgets/table/e-table-state.h +++ b/widgets/table/e-table-state.h @@ -40,8 +40,8 @@ typedef struct { GObject base; ETableSortInfo *sort_info; - int col_count; - int *columns; + gint col_count; + gint *columns; double *expansions; } ETableState; @@ -52,18 +52,18 @@ typedef struct { GType e_table_state_get_type (void); ETableState *e_table_state_new (void); -ETableState *e_table_state_vanilla (int col_count); +ETableState *e_table_state_vanilla (gint col_count); gboolean e_table_state_load_from_file (ETableState *state, - const char *filename); + const gchar *filename); void e_table_state_load_from_string (ETableState *state, - const char *xml); + const gchar *xml); void e_table_state_load_from_node (ETableState *state, const xmlNode *node); void e_table_state_save_to_file (ETableState *state, - const char *filename); -char *e_table_state_save_to_string (ETableState *state); + const gchar *filename); +gchar *e_table_state_save_to_string (ETableState *state); xmlNode *e_table_state_save_to_node (ETableState *state, xmlNode *parent); ETableState *e_table_state_duplicate (ETableState *state); diff --git a/widgets/table/e-table-subset-variable.c b/widgets/table/e-table-subset-variable.c index b088d8302a..93faeac0f8 100644 --- a/widgets/table/e-table-subset-variable.c +++ b/widgets/table/e-table-subset-variable.c @@ -63,7 +63,7 @@ etssv_add_array (ETableSubsetVariable *etssv, { ETableModel *etm = E_TABLE_MODEL(etssv); ETableSubset *etss = E_TABLE_SUBSET(etssv); - int i; + gint i; e_table_model_pre_change(etm); @@ -82,8 +82,8 @@ etssv_add_all (ETableSubsetVariable *etssv) { ETableModel *etm = E_TABLE_MODEL(etssv); ETableSubset *etss = E_TABLE_SUBSET(etssv); - int rows; - int i; + gint rows; + gint i; e_table_model_pre_change(etm); @@ -104,7 +104,7 @@ etssv_remove (ETableSubsetVariable *etssv, { ETableModel *etm = E_TABLE_MODEL(etssv); ETableSubset *etss = E_TABLE_SUBSET(etssv); - int i; + gint i; for (i = 0; i < etss->n_map; i++){ if (etss->map_table[i] == row) { @@ -213,7 +213,7 @@ e_table_subset_variable_clear (ETableSubsetVariable *etssv) e_table_model_pre_change (etm); etss->n_map = 0; g_free (etss->map_table); - etss->map_table = (int *)g_new (unsigned int, 1); + etss->map_table = (gint *)g_new (unsigned int, 1); etssv->n_vals_allocated = 1; e_table_model_changed (etm); @@ -224,7 +224,7 @@ e_table_subset_variable_increment (ETableSubsetVariable *etssv, gint position, gint amount) { - int i; + gint i; ETableSubset *etss = E_TABLE_SUBSET(etssv); for (i = 0; i < etss->n_map; i++) { if (etss->map_table[i] >= position) @@ -237,7 +237,7 @@ e_table_subset_variable_decrement (ETableSubsetVariable *etssv, gint position, gint amount) { - int i; + gint i; ETableSubset *etss = E_TABLE_SUBSET(etssv); for (i = 0; i < etss->n_map; i++) { if (etss->map_table[i] >= position) diff --git a/widgets/table/e-table-subset-variable.h b/widgets/table/e-table-subset-variable.h index 1aed0d3cb3..4654fb5d67 100644 --- a/widgets/table/e-table-subset-variable.h +++ b/widgets/table/e-table-subset-variable.h @@ -38,7 +38,7 @@ G_BEGIN_DECLS typedef struct { ETableSubset base; - int n_vals_allocated; + gint n_vals_allocated; } ETableSubsetVariable; typedef struct { diff --git a/widgets/table/e-table-subset.c b/widgets/table/e-table-subset.c index 1cec532d03..bf137e0ef8 100644 --- a/widgets/table/e-table-subset.c +++ b/widgets/table/e-table-subset.c @@ -33,10 +33,10 @@ static void etss_proxy_model_pre_change_real (ETableSubset *etss, ETableModel *etm); static void etss_proxy_model_no_change_real (ETableSubset *etss, ETableModel *etm); static void etss_proxy_model_changed_real (ETableSubset *etss, ETableModel *etm); -static void etss_proxy_model_row_changed_real (ETableSubset *etss, ETableModel *etm, int row); -static void etss_proxy_model_cell_changed_real (ETableSubset *etss, ETableModel *etm, int col, int row); -static void etss_proxy_model_rows_inserted_real (ETableSubset *etss, ETableModel *etm, int row, int count); -static void etss_proxy_model_rows_deleted_real (ETableSubset *etss, ETableModel *etm, int row, int count); +static void etss_proxy_model_row_changed_real (ETableSubset *etss, ETableModel *etm, gint row); +static void etss_proxy_model_cell_changed_real (ETableSubset *etss, ETableModel *etm, gint col, gint row); +static void etss_proxy_model_rows_inserted_real (ETableSubset *etss, ETableModel *etm, gint row, gint count); +static void etss_proxy_model_rows_deleted_real (ETableSubset *etss, ETableModel *etm, gint row, gint count); #define d(x) @@ -50,15 +50,15 @@ G_DEFINE_TYPE (ETableSubset, etss, E_TABLE_MODEL_TYPE) #define MAP_ROW(etss, row) (row == -1 ? -1 : etss->map_table[row]) static gint -etss_get_view_row (ETableSubset *etss, int row) +etss_get_view_row (ETableSubset *etss, gint row) { - const int n = etss->n_map; - const int * const map_table = etss->map_table; - int i; + const gint n = etss->n_map; + const gint * const map_table = etss->map_table; + gint i; - int end = MIN(etss->n_map, etss->last_access + 10); - int start = MAX(0, etss->last_access - 10); - int initial = MAX (MIN (etss->last_access, end), start); + gint end = MIN(etss->n_map, etss->last_access + 10); + gint start = MAX(0, etss->last_access - 10); + gint initial = MAX (MIN (etss->last_access, end), start); for (i = initial; i < end; i++) { if (map_table [i] == row){ @@ -147,8 +147,8 @@ etss_row_count (ETableModel *etm) return etss->n_map; } -static void * -etss_value_at (ETableModel *etm, int col, int row) +static gpointer +etss_value_at (ETableModel *etm, gint col, gint row) { ETableSubset *etss = (ETableSubset *)etm; @@ -160,7 +160,7 @@ etss_value_at (ETableModel *etm, int col, int row) } static void -etss_set_value_at (ETableModel *etm, int col, int row, const void *val) +etss_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) { ETableSubset *etss = (ETableSubset *)etm; @@ -172,7 +172,7 @@ etss_set_value_at (ETableModel *etm, int col, int row, const void *val) } static gboolean -etss_is_cell_editable (ETableModel *etm, int col, int row) +etss_is_cell_editable (ETableModel *etm, gint col, gint row) { ETableSubset *etss = (ETableSubset *)etm; @@ -187,8 +187,8 @@ etss_has_save_id (ETableModel *etm) return TRUE; } -static char * -etss_get_save_id (ETableModel *etm, int row) +static gchar * +etss_get_save_id (ETableModel *etm, gint row) { ETableSubset *etss = (ETableSubset *)etm; @@ -201,14 +201,14 @@ etss_get_save_id (ETableModel *etm, int row) } static void -etss_append_row (ETableModel *etm, ETableModel *source, int row) +etss_append_row (ETableModel *etm, ETableModel *source, gint row) { ETableSubset *etss = (ETableSubset *)etm; e_table_model_append_row (etss->source, source, row); } -static void * -etss_duplicate_value (ETableModel *etm, int col, const void *value) +static gpointer +etss_duplicate_value (ETableModel *etm, gint col, gconstpointer value) { ETableSubset *etss = (ETableSubset *)etm; @@ -216,15 +216,15 @@ etss_duplicate_value (ETableModel *etm, int col, const void *value) } static void -etss_free_value (ETableModel *etm, int col, void *value) +etss_free_value (ETableModel *etm, gint col, gpointer value) { ETableSubset *etss = (ETableSubset *)etm; e_table_model_free_value (etss->source, col, value); } -static void * -etss_initialize_value (ETableModel *etm, int col) +static gpointer +etss_initialize_value (ETableModel *etm, gint col) { ETableSubset *etss = (ETableSubset *)etm; @@ -232,15 +232,15 @@ etss_initialize_value (ETableModel *etm, int col) } static gboolean -etss_value_is_empty (ETableModel *etm, int col, const void *value) +etss_value_is_empty (ETableModel *etm, gint col, gconstpointer value) { ETableSubset *etss = (ETableSubset *)etm; return e_table_model_value_is_empty (etss->source, col, value); } -static char * -etss_value_to_string (ETableModel *etm, int col, const void *value) +static gchar * +etss_value_to_string (ETableModel *etm, gint col, gconstpointer value) { ETableSubset *etss = (ETableSubset *)etm; @@ -307,9 +307,9 @@ etss_proxy_model_changed_real (ETableSubset *etss, ETableModel *etm) } static void -etss_proxy_model_row_changed_real (ETableSubset *etss, ETableModel *etm, int row) +etss_proxy_model_row_changed_real (ETableSubset *etss, ETableModel *etm, gint row) { - int view_row = etss_get_view_row (etss, row); + gint view_row = etss_get_view_row (etss, row); if (view_row != -1) e_table_model_row_changed (E_TABLE_MODEL (etss), view_row); else @@ -317,9 +317,9 @@ etss_proxy_model_row_changed_real (ETableSubset *etss, ETableModel *etm, int row } static void -etss_proxy_model_cell_changed_real (ETableSubset *etss, ETableModel *etm, int col, int row) +etss_proxy_model_cell_changed_real (ETableSubset *etss, ETableModel *etm, gint col, gint row) { - int view_row = etss_get_view_row (etss, row); + gint view_row = etss_get_view_row (etss, row); if (view_row != -1) e_table_model_cell_changed (E_TABLE_MODEL (etss), col, view_row); else @@ -327,13 +327,13 @@ etss_proxy_model_cell_changed_real (ETableSubset *etss, ETableModel *etm, int co } static void -etss_proxy_model_rows_inserted_real (ETableSubset *etss, ETableModel *etm, int row, int count) +etss_proxy_model_rows_inserted_real (ETableSubset *etss, ETableModel *etm, gint row, gint count) { e_table_model_no_change (E_TABLE_MODEL (etss)); } static void -etss_proxy_model_rows_deleted_real (ETableSubset *etss, ETableModel *etm, int row, int count) +etss_proxy_model_rows_deleted_real (ETableSubset *etss, ETableModel *etm, gint row, gint count) { e_table_model_no_change (E_TABLE_MODEL (etss)); } @@ -360,46 +360,46 @@ etss_proxy_model_changed (ETableModel *etm, ETableSubset *etss) } static void -etss_proxy_model_row_changed (ETableModel *etm, int row, ETableSubset *etss) +etss_proxy_model_row_changed (ETableModel *etm, gint row, ETableSubset *etss) { if (ETSS_CLASS(etss)->proxy_model_row_changed) (ETSS_CLASS(etss)->proxy_model_row_changed) (etss, etm, row); } static void -etss_proxy_model_cell_changed (ETableModel *etm, int row, int col, ETableSubset *etss) +etss_proxy_model_cell_changed (ETableModel *etm, gint row, gint col, ETableSubset *etss) { if (ETSS_CLASS(etss)->proxy_model_cell_changed) (ETSS_CLASS(etss)->proxy_model_cell_changed) (etss, etm, col, row); } static void -etss_proxy_model_rows_inserted (ETableModel *etm, int row, int col, ETableSubset *etss) +etss_proxy_model_rows_inserted (ETableModel *etm, gint row, gint col, ETableSubset *etss) { if (ETSS_CLASS(etss)->proxy_model_rows_inserted) (ETSS_CLASS(etss)->proxy_model_rows_inserted) (etss, etm, row, col); } static void -etss_proxy_model_rows_deleted (ETableModel *etm, int row, int col, ETableSubset *etss) +etss_proxy_model_rows_deleted (ETableModel *etm, gint row, gint col, ETableSubset *etss) { if (ETSS_CLASS(etss)->proxy_model_rows_deleted) (ETSS_CLASS(etss)->proxy_model_rows_deleted) (etss, etm, row, col); } ETableModel * -e_table_subset_construct (ETableSubset *etss, ETableModel *source, int nvals) +e_table_subset_construct (ETableSubset *etss, ETableModel *source, gint nvals) { - unsigned int *buffer; - int i; + guint *buffer; + gint i; if (nvals) { - buffer = (unsigned int *) g_malloc (sizeof (unsigned int) * nvals); + buffer = (guint *) g_malloc (sizeof (unsigned int) * nvals); if (buffer == NULL) return NULL; } else buffer = NULL; - etss->map_table = (int *)buffer; + etss->map_table = (gint *)buffer; etss->n_map = nvals; etss->source = source; g_object_ref (source); @@ -427,7 +427,7 @@ e_table_subset_construct (ETableSubset *etss, ETableModel *source, int nvals) } ETableModel * -e_table_subset_new (ETableModel *source, const int nvals) +e_table_subset_new (ETableModel *source, const gint nvals) { ETableSubset *etss = g_object_new (E_TABLE_SUBSET_TYPE, NULL); @@ -439,11 +439,11 @@ e_table_subset_new (ETableModel *source, const int nvals) return (ETableModel *) etss; } -int +gint e_table_subset_model_to_view_row (ETableSubset *ets, - int model_row) + gint model_row) { - int i; + gint i; for (i = 0; i < ets->n_map; i++) { if (ets->map_table[i] == model_row) return i; @@ -451,9 +451,9 @@ e_table_subset_model_to_view_row (ETableSubset *ets, return -1; } -int +gint e_table_subset_view_to_model_row (ETableSubset *ets, - int view_row) + gint view_row) { if (view_row >= 0 && view_row < ets->n_map) return ets->map_table[view_row]; @@ -476,7 +476,7 @@ e_table_subset_get_toplevel (ETableSubset *table) void e_table_subset_print_debugging (ETableSubset *table_model) { - int i; + gint i; for (i = 0; i < table_model->n_map; i++) { g_print("%8d\n", table_model->map_table[i]); } diff --git a/widgets/table/e-table-subset.h b/widgets/table/e-table-subset.h index 83c9af4d99..dd345732e2 100644 --- a/widgets/table/e-table-subset.h +++ b/widgets/table/e-table-subset.h @@ -41,18 +41,18 @@ typedef struct { ETableModel base; ETableModel *source; - int n_map; - int *map_table; - - int last_access; - - int table_model_pre_change_id; - int table_model_no_change_id; - int table_model_changed_id; - int table_model_row_changed_id; - int table_model_cell_changed_id; - int table_model_rows_inserted_id; - int table_model_rows_deleted_id; + gint n_map; + gint *map_table; + + gint last_access; + + gint table_model_pre_change_id; + gint table_model_no_change_id; + gint table_model_changed_id; + gint table_model_row_changed_id; + gint table_model_cell_changed_id; + gint table_model_rows_inserted_id; + gint table_model_rows_deleted_id; } ETableSubset; typedef struct { @@ -61,23 +61,23 @@ typedef struct { void (*proxy_model_pre_change) (ETableSubset *etss, ETableModel *etm); void (*proxy_model_no_change) (ETableSubset *etss, ETableModel *etm); void (*proxy_model_changed) (ETableSubset *etss, ETableModel *etm); - void (*proxy_model_row_changed) (ETableSubset *etss, ETableModel *etm, int row); - void (*proxy_model_cell_changed) (ETableSubset *etss, ETableModel *etm, int col, int row); - void (*proxy_model_rows_inserted) (ETableSubset *etss, ETableModel *etm, int row, int count); - void (*proxy_model_rows_deleted) (ETableSubset *etss, ETableModel *etm, int row, int count); + void (*proxy_model_row_changed) (ETableSubset *etss, ETableModel *etm, gint row); + void (*proxy_model_cell_changed) (ETableSubset *etss, ETableModel *etm, gint col, gint row); + void (*proxy_model_rows_inserted) (ETableSubset *etss, ETableModel *etm, gint row, gint count); + void (*proxy_model_rows_deleted) (ETableSubset *etss, ETableModel *etm, gint row, gint count); } ETableSubsetClass; GType e_table_subset_get_type (void); ETableModel *e_table_subset_new (ETableModel *etm, - int n_vals); + gint n_vals); ETableModel *e_table_subset_construct (ETableSubset *ets, ETableModel *source, - int nvals); + gint nvals); -int e_table_subset_model_to_view_row (ETableSubset *ets, - int model_row); -int e_table_subset_view_to_model_row (ETableSubset *ets, - int view_row); +gint e_table_subset_model_to_view_row (ETableSubset *ets, + gint model_row); +gint e_table_subset_view_to_model_row (ETableSubset *ets, + gint view_row); ETableModel *e_table_subset_get_toplevel (ETableSubset *table_model); diff --git a/widgets/table/e-table-tooltip.h b/widgets/table/e-table-tooltip.h index 5b2acbf584..27dcf26db2 100644 --- a/widgets/table/e-table-tooltip.h +++ b/widgets/table/e-table-tooltip.h @@ -29,10 +29,10 @@ G_BEGIN_DECLS typedef struct { gint timer; - int col, row; - int row_height; - int x, y; - int cx, cy; + gint col, row; + gint row_height; + gint x, y; + gint cx, cy; GdkColor *foreground; GdkColor *background; GnomeCanvasItem *eti; diff --git a/widgets/table/e-table-utils.c b/widgets/table/e-table-utils.c index a7a449d1b7..03c8e17a33 100644 --- a/widgets/table/e-table-utils.c +++ b/widgets/table/e-table-utils.c @@ -36,8 +36,8 @@ ETableHeader * e_table_state_to_header (GtkWidget *widget, ETableHeader *full_header, ETableState *state) { ETableHeader *nh; - const int max_cols = e_table_header_count (full_header); - int column; + const gint max_cols = e_table_header_count (full_header); + gint column; GValue *val = g_new0 (GValue, 1); g_return_val_if_fail (widget, NULL); @@ -51,7 +51,7 @@ e_table_state_to_header (GtkWidget *widget, ETableHeader *full_header, ETableSta g_free (val); for (column = 0; column < state->col_count; column++) { - int col; + gint col; double expansion; ETableCol *table_col; @@ -75,7 +75,7 @@ e_table_state_to_header (GtkWidget *widget, ETableHeader *full_header, ETableSta static ETableCol * et_col_spec_to_col (ETableColumnSpecification *col_spec, ETableExtras *ete, - const char *domain) + const gchar *domain) { ETableCol *col = NULL; ECell *cell = NULL; @@ -90,7 +90,7 @@ et_col_spec_to_col (ETableColumnSpecification *col_spec, search = e_table_extras_get_search(ete, col_spec->search); if (cell && compare) { - char *title = dgettext (domain, col_spec->title); + gchar *title = dgettext (domain, col_spec->title); title = g_strdup (title); @@ -132,7 +132,7 @@ e_table_spec_to_full_header (ETableSpecification *spec, ETableExtras *ete) { ETableHeader *nh; - int column; + gint column; g_return_val_if_fail (spec, NULL); g_return_val_if_fail (ete, NULL); @@ -161,8 +161,8 @@ check_col (ETableCol *col, gpointer user_data) ETableCol * e_table_util_calculate_current_search_col (ETableHeader *header, ETableHeader *full_header, ETableSortInfo *sort_info, gboolean always_search) { - int i; - int count; + gint i; + gint count; ETableCol *col = NULL; count = e_table_sort_info_grouping_get_count (sort_info); for (i = 0; i < count; i++) { diff --git a/widgets/table/e-table-without.c b/widgets/table/e-table-without.c index 7d9c5bfce7..6b856274a4 100644 --- a/widgets/table/e-table-without.c +++ b/widgets/table/e-table-without.c @@ -47,14 +47,14 @@ struct _ETableWithoutPrivate { ETableWithoutFreeKeyFunc free_gotten_key_func; ETableWithoutFreeKeyFunc free_duplicated_key_func; - void *closure; + gpointer closure; }; static gboolean -check (ETableWithout *etw, int model_row) +check (ETableWithout *etw, gint model_row) { gboolean ret_val; - void *key; + gpointer key; ETableSubset *etss = E_TABLE_SUBSET (etw); if (etw->priv->get_key_func) @@ -68,10 +68,10 @@ check (ETableWithout *etw, int model_row) } static gboolean -check_with_key (ETableWithout *etw, void *key, int model_row) +check_with_key (ETableWithout *etw, gpointer key, gint model_row) { gboolean ret_val; - void *key2; + gpointer key2; ETableSubset *etss = E_TABLE_SUBSET (etw); if (etw->priv->get_key_func) @@ -88,14 +88,14 @@ check_with_key (ETableWithout *etw, void *key, int model_row) } static gint -etw_view_to_model_row (ETableWithout *etw, int view_row) +etw_view_to_model_row (ETableWithout *etw, gint view_row) { ETableSubset *etss = E_TABLE_SUBSET (etw); return etss->map_table[view_row]; } static void -add_row (ETableWithout *etw, int model_row) +add_row (ETableWithout *etw, gint model_row) { ETableSubset *etss = E_TABLE_SUBSET (etw); @@ -109,7 +109,7 @@ add_row (ETableWithout *etw, int model_row) } static void -remove_row (ETableWithout *etw, int view_row) +remove_row (ETableWithout *etw, gint view_row) { ETableSubset *etss = E_TABLE_SUBSET (etw); @@ -149,9 +149,9 @@ etw_dispose (GObject *object) } static void -etw_proxy_model_rows_inserted (ETableSubset *etss, ETableModel *etm, int model_row, int count) +etw_proxy_model_rows_inserted (ETableSubset *etss, ETableModel *etm, gint model_row, gint count) { - int i; + gint i; ETableWithout *etw = E_TABLE_WITHOUT (etss); gboolean shift = FALSE; @@ -177,9 +177,9 @@ etw_proxy_model_rows_inserted (ETableSubset *etss, ETableModel *etm, int model_r } static void -etw_proxy_model_rows_deleted (ETableSubset *etss, ETableModel *etm, int model_row, int count) +etw_proxy_model_rows_deleted (ETableSubset *etss, ETableModel *etm, gint model_row, gint count) { - int i; /* View row */ + gint i; /* View row */ ETableWithout *etw = E_TABLE_WITHOUT (etss); gboolean shift = FALSE; @@ -201,9 +201,9 @@ etw_proxy_model_rows_deleted (ETableSubset *etss, ETableModel *etm, int model_ro static void etw_proxy_model_changed (ETableSubset *etss, ETableModel *etm) { - int i; /* Model row */ - int j; /* View row */ - int row_count; + gint i; /* Model row */ + gint j; /* View row */ + gint row_count; ETableWithout *etw = E_TABLE_WITHOUT (etss); g_free (etss->map_table); @@ -306,7 +306,7 @@ e_table_without_new (ETableModel *source, void e_table_without_hide (ETableWithout *etw, void *key) { - int i; /* View row */ + gint i; /* View row */ ETableSubset *etss = E_TABLE_SUBSET (etw); if (etw->priv->duplicate_key_func) @@ -325,7 +325,7 @@ void e_table_without_hide (ETableWithout *etw, void e_table_without_hide_adopt (ETableWithout *etw, void *key) { - int i; /* View row */ + gint i; /* View row */ ETableSubset *etss = E_TABLE_SUBSET (etw); g_hash_table_insert (etw->priv->hash, key, key); @@ -341,10 +341,10 @@ void e_table_without_show (ETableWithout *etw, void *key) { - int i; /* Model row */ + gint i; /* Model row */ ETableSubset *etss = E_TABLE_SUBSET (etw); - int count; - void *old_key; + gint count; + gpointer old_key; count = e_table_model_row_count (etss->source); @@ -365,8 +365,8 @@ e_table_without_show (ETableWithout *etw, void e_table_without_show_all (ETableWithout *etw) { - int i; /* Model row */ - int row_count; + gint i; /* Model row */ + gint row_count; ETableSubset *etss = E_TABLE_SUBSET (etw); e_table_model_pre_change (E_TABLE_MODEL (etw)); diff --git a/widgets/table/e-table-without.h b/widgets/table/e-table-without.h index c43bdab332..e4aabbd64d 100644 --- a/widgets/table/e-table-without.h +++ b/widgets/table/e-table-without.h @@ -38,10 +38,10 @@ extern "C" { #define E_IS_TABLE_WITHOUT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_WITHOUT_TYPE)) typedef struct _ETableWithoutPrivate ETableWithoutPrivate; -typedef void *(*ETableWithoutGetKeyFunc) (ETableModel *source, - int row, +typedef gpointer (*ETableWithoutGetKeyFunc) (ETableModel *source, + gint row, void *closure); -typedef void *(*ETableWithoutDuplicateKeyFunc) (const void *key, +typedef gpointer (*ETableWithoutDuplicateKeyFunc) (const void *key, void *closure); typedef void (*ETableWithoutFreeKeyFunc) (void *key, void *closure); diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c index d0c8519435..e0a61797df 100644 --- a/widgets/table/e-table.c +++ b/widgets/table/e-table.c @@ -253,7 +253,7 @@ expansion_changed (ETableHeader *header, ETable *et) } static void -dimension_changed (ETableHeader *header, int total_width, ETable *et) +dimension_changed (ETableHeader *header, gint total_width, ETable *et) { set_header_width (et); } @@ -405,9 +405,9 @@ et_unrealize (GtkWidget *widget) } static gboolean -check_row (ETable *et, int model_row, int col, ETableSearchFunc search, char *string) +check_row (ETable *et, gint model_row, gint col, ETableSearchFunc search, gchar *string) { - const void *value; + gconstpointer value; value = e_table_model_value_at (et->model, col, model_row); @@ -415,11 +415,11 @@ check_row (ETable *et, int model_row, int col, ETableSearchFunc search, char *st } static gboolean -et_search_search (ETableSearch *search, char *string, ETableSearchFlags flags, ETable *et) +et_search_search (ETableSearch *search, gchar *string, ETableSearchFlags flags, ETable *et) { - int cursor; - int rows; - int i; + gint cursor; + gint rows; + gint i; ETableCol *col = current_search_col (et); if (col == NULL) @@ -437,7 +437,7 @@ et_search_search (ETableSearch *search, char *string, ETableSearchFlags flags, E cursor = e_sorter_model_to_sorted (E_SORTER (et->sorter), cursor); for (i = cursor + 1; i < rows; i++) { - int model_row = e_sorter_sorted_to_model (E_SORTER (et->sorter), i); + gint model_row = e_sorter_sorted_to_model (E_SORTER (et->sorter), i); if (check_row (et, model_row, col->col_idx, col->search, string)) { e_selection_model_select_as_key_press(E_SELECTION_MODEL (et->selection), model_row, col->col_idx, GDK_CONTROL_MASK); return TRUE; @@ -445,7 +445,7 @@ et_search_search (ETableSearch *search, char *string, ETableSearchFlags flags, E } for (i = 0; i < cursor; i++) { - int model_row = e_sorter_sorted_to_model (E_SORTER (et->sorter), i); + gint model_row = e_sorter_sorted_to_model (E_SORTER (et->sorter), i); if (check_row (et, model_row, col->col_idx, col->search, string)) { e_selection_model_select_as_key_press(E_SELECTION_MODEL (et->selection), model_row, col->col_idx, GDK_CONTROL_MASK); return TRUE; @@ -461,7 +461,7 @@ et_search_search (ETableSearch *search, char *string, ETableSearchFlags flags, E static void et_search_accept (ETableSearch *search, ETable *et) { - int cursor; + gint cursor; ETableCol *col = current_search_col (et); if (col == NULL) @@ -651,7 +651,7 @@ sort_info_changed (ETableSortInfo *info, ETable *et) static void e_table_setup_header (ETable *e_table) { - char *pointer; + gchar *pointer; e_table->header_canvas = GNOME_CANVAS (e_canvas_new ()); gtk_widget_show (GTK_WIDGET (e_table->header_canvas)); @@ -740,7 +740,7 @@ table_canvas_reflow (GnomeCanvas *canvas, ETable *e_table) } static void -click_to_add_cursor_change (ETableClickToAdd *etcta, int row, int col, ETable *et) +click_to_add_cursor_change (ETableClickToAdd *etcta, gint row, gint col, ETable *et) { if (et->cursor_loc == E_TABLE_CURSOR_LOC_TABLE) { e_selection_model_clear(E_SELECTION_MODEL (et->selection)); @@ -749,7 +749,7 @@ click_to_add_cursor_change (ETableClickToAdd *etcta, int row, int col, ETable *e } static void -group_cursor_change (ETableGroup *etg, int row, ETable *et) +group_cursor_change (ETableGroup *etg, gint row, ETable *et) { ETableCursorLoc old_cursor_loc; @@ -763,39 +763,39 @@ group_cursor_change (ETableGroup *etg, int row, ETable *et) } static void -group_cursor_activated (ETableGroup *etg, int row, ETable *et) +group_cursor_activated (ETableGroup *etg, gint row, ETable *et) { g_signal_emit (G_OBJECT (et), et_signals [CURSOR_ACTIVATED], 0, row); } static void -group_double_click (ETableGroup *etg, int row, int col, GdkEvent *event, ETable *et) +group_double_click (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable *et) { g_signal_emit (G_OBJECT (et), et_signals [DOUBLE_CLICK], 0, row, col, event); } static gint -group_right_click (ETableGroup *etg, int row, int col, GdkEvent *event, ETable *et) +group_right_click (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable *et) { - int return_val = 0; + gint return_val = 0; g_signal_emit (G_OBJECT (et), et_signals [RIGHT_CLICK], 0, row, col, event, &return_val); return return_val; } static gint -group_click (ETableGroup *etg, int row, int col, GdkEvent *event, ETable *et) +group_click (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable *et) { - int return_val = 0; + gint return_val = 0; g_signal_emit (G_OBJECT (et), et_signals [CLICK], 0, row, col, event, &return_val); return return_val; } static gint -group_key_press (ETableGroup *etg, int row, int col, GdkEvent *event, ETable *et) +group_key_press (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable *et) { - int return_val = 0; + gint return_val = 0; GdkEventKey *key = (GdkEventKey *) event; - int y, row_local, col_local; + gint y, row_local, col_local; GtkAdjustment *vadj; switch (key->keyval) { @@ -849,9 +849,9 @@ group_key_press (ETableGroup *etg, int row, int col, GdkEvent *event, ETable *et } static gint -group_start_drag (ETableGroup *etg, int row, int col, GdkEvent *event, ETable *et) +group_start_drag (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable *et) { - int return_val = 0; + gint return_val = 0; g_signal_emit (G_OBJECT (et), et_signals [START_DRAG], 0, row, col, event, &return_val); return return_val; @@ -869,7 +869,7 @@ et_table_model_changed (ETableModel *model, ETable *et) } static void -et_table_row_changed (ETableModel *table_model, int row, ETable *et) +et_table_row_changed (ETableModel *table_model, gint row, ETable *et) { if (!et->need_rebuild) { if (e_table_group_remove (et->group, row)) @@ -879,18 +879,18 @@ et_table_row_changed (ETableModel *table_model, int row, ETable *et) } static void -et_table_cell_changed (ETableModel *table_model, int view_col, int row, ETable *et) +et_table_cell_changed (ETableModel *table_model, gint view_col, gint row, ETable *et) { et_table_row_changed (table_model, row, et); } static void -et_table_rows_inserted (ETableModel *table_model, int row, int count, ETable *et) +et_table_rows_inserted (ETableModel *table_model, gint row, gint count, ETable *et) { /* This number has already been decremented. */ - int row_count = e_table_model_row_count(table_model); + gint row_count = e_table_model_row_count(table_model); if (!et->need_rebuild) { - int i; + gint i; if (row != row_count - count) e_table_group_increment(et->group, row, count); for (i = 0; i < count; i++) @@ -900,11 +900,11 @@ et_table_rows_inserted (ETableModel *table_model, int row, int count, ETable *et } static void -et_table_rows_deleted (ETableModel *table_model, int row, int count, ETable *et) +et_table_rows_deleted (ETableModel *table_model, gint row, gint count, ETable *et) { - int row_count = e_table_model_row_count(table_model); + gint row_count = e_table_model_row_count(table_model); if (!et->need_rebuild) { - int i; + gint i; for (i = 0; i < count; i++) e_table_group_remove (et->group, row + i); if (row != row_count) @@ -1024,7 +1024,7 @@ et_canvas_realize (GtkWidget *canvas, ETable *e_table) static gint white_item_event (GnomeCanvasItem *white_item, GdkEvent *event, ETable *e_table) { - int return_val = 0; + gint return_val = 0; g_signal_emit (GTK_OBJECT (e_table), et_signals [WHITE_SPACE_EVENT], 0, event, &return_val); return return_val; @@ -1421,8 +1421,8 @@ ETableState * e_table_get_state_object (ETable *e_table) { ETableState *state; - int full_col_count; - int i, j; + gint full_col_count; + gint i, j; state = e_table_state_new(); if (state->sort_info) @@ -1498,7 +1498,7 @@ et_selection_model_selection_changed (ETableGroup *etg, ETable *et) } static void -et_selection_model_selection_row_changed (ETableGroup *etg, int row, ETable *et) +et_selection_model_selection_row_changed (ETableGroup *etg, gint row, ETable *et) { g_signal_emit (G_OBJECT (et), et_signals [SELECTION_CHANGE], 0); } @@ -1507,8 +1507,8 @@ static ETable * et_real_construct (ETable *e_table, ETableModel *etm, ETableExtras *ete, ETableSpecification *specification, ETableState *state) { - int row = 0; - int col_count, i; + gint row = 0; + gint col_count, i; GValue *val = g_new0 (GValue, 1); g_value_init (val, G_TYPE_OBJECT); @@ -1633,7 +1633,7 @@ et_real_construct (ETable *e_table, ETableModel *etm, ETableExtras *ete, **/ ETable * e_table_construct (ETable *e_table, ETableModel *etm, ETableExtras *ete, - const char *spec_str, const char *state_str) + const gchar *spec_str, const gchar *state_str) { ETableSpecification *specification; ETableState *state; @@ -1693,7 +1693,7 @@ e_table_construct (ETable *e_table, ETableModel *etm, ETableExtras *ete, **/ ETable * e_table_construct_from_spec_file (ETable *e_table, ETableModel *etm, ETableExtras *ete, - const char *spec_fn, const char *state_fn) + const gchar *spec_fn, const gchar *state_fn) { ETableSpecification *specification; ETableState *state; @@ -1758,7 +1758,7 @@ e_table_construct_from_spec_file (ETable *e_table, ETableModel *etm, ETableExtra * The newly created #ETable or %NULL if there's an error. **/ GtkWidget * -e_table_new (ETableModel *etm, ETableExtras *ete, const char *spec, const char *state) +e_table_new (ETableModel *etm, ETableExtras *ete, const gchar *spec, const gchar *state) { ETable *e_table; @@ -1795,7 +1795,7 @@ e_table_new (ETableModel *etm, ETableExtras *ete, const char *spec, const char * * The newly created #ETable or %NULL if there's an error. **/ GtkWidget * -e_table_new_from_spec_file (ETableModel *etm, ETableExtras *ete, const char *spec_fn, const char *state_fn) +e_table_new_from_spec_file (ETableModel *etm, ETableExtras *ete, const gchar *spec_fn, const gchar *state_fn) { ETable *e_table; @@ -1836,9 +1836,9 @@ et_build_grouping_spec (ETable *e_table) { xmlNode *node; xmlNode *grouping; - int i; - const int sort_count = e_table_sort_info_sorting_get_count (e_table->sort_info); - const int group_count = e_table_sort_info_grouping_get_count (e_table->sort_info); + gint i; + const gint sort_count = e_table_sort_info_sorting_get_count (e_table->sort_info); + const gint group_count = e_table_sort_info_grouping_get_count (e_table->sort_info); grouping = xmlNewNode (NULL, "grouping"); node = grouping; @@ -1899,18 +1899,18 @@ e_table_get_specification (ETable *e_table) return buffer; } -int -e_table_set_specification (ETable *e_table, const char *spec) +gint +e_table_set_specification (ETable *e_table, const gchar *spec) { xmlDoc *xmlSpec; - int ret; + gint ret; g_return_val_if_fail(e_table != NULL, -1); g_return_val_if_fail(E_IS_TABLE(e_table), -1); g_return_val_if_fail(spec != NULL, -1); /* doesn't work yet, sigh */ - xmlSpec = xmlParseMemory ((char *)spec, strlen(spec)); + xmlSpec = xmlParseMemory ((gchar *)spec, strlen(spec)); ret = et_real_set_specification(e_table, xmlSpec); xmlFreeDoc (xmlSpec); @@ -1918,7 +1918,7 @@ e_table_set_specification (ETable *e_table, const char *spec) } void -e_table_save_specification (ETable *e_table, const char *filename) +e_table_save_specification (ETable *e_table, const gchar *filename) { xmlDoc *doc = et_build_tree (e_table); @@ -1931,11 +1931,11 @@ e_table_save_specification (ETable *e_table, const char *filename) xmlFreeDoc (doc); } -int +gint e_table_load_specification (ETable *e_table, gchar *filename) { xmlDoc *xmlSpec; - int ret; + gint ret; g_return_val_if_fail(e_table != NULL, -1); g_return_val_if_fail(E_IS_TABLE(e_table), -1); @@ -1966,7 +1966,7 @@ e_table_load_specification (ETable *e_table, gchar *filename) * Sets the cursor row and the selection to the given row number. **/ void -e_table_set_cursor_row (ETable *e_table, int row) +e_table_set_cursor_row (ETable *e_table, gint row) { g_return_if_fail(e_table != NULL); g_return_if_fail(E_IS_TABLE(e_table)); @@ -1986,10 +1986,10 @@ e_table_set_cursor_row (ETable *e_table, int row) * Return value: * Cursor row **/ -int +gint e_table_get_cursor_row (ETable *e_table) { - int row; + gint row; g_return_val_if_fail(e_table != NULL, -1); g_return_val_if_fail(E_IS_TABLE(e_table), -1); @@ -2146,7 +2146,7 @@ et_get_property (GObject *object, } typedef struct { - char *arg; + gchar *arg; gboolean setting; } bool_closure; @@ -2260,7 +2260,7 @@ e_table_get_next_row (ETable *e_table, g_return_val_if_fail(E_IS_TABLE(e_table), -1); if (e_table->sorter) { - int i; + gint i; i = e_sorter_model_to_sorted(E_SORTER (e_table->sorter), model_row); i++; if (i < e_table_model_row_count(e_table->model)) { @@ -2294,7 +2294,7 @@ e_table_get_prev_row (ETable *e_table, g_return_val_if_fail(E_IS_TABLE(e_table), -1); if (e_table->sorter) { - int i; + gint i; i = e_sorter_model_to_sorted(E_SORTER (e_table->sorter), model_row); i--; if (i >= 0) @@ -2364,8 +2364,8 @@ e_table_view_to_model_row (ETable *e_table, **/ void e_table_get_cell_at (ETable *table, - int x, int y, - int *row_return, int *col_return) + gint x, gint y, + gint *row_return, gint *col_return) { g_return_if_fail (table != NULL); g_return_if_fail (E_IS_TABLE (table)); @@ -2395,9 +2395,9 @@ e_table_get_cell_at (ETable *table, **/ void e_table_get_cell_geometry (ETable *table, - int row, int col, - int *x_return, int *y_return, - int *width_return, int *height_return) + gint row, gint col, + gint *x_return, gint *y_return, + gint *width_return, gint *height_return) { g_return_if_fail (table != NULL); g_return_if_fail (E_IS_TABLE (table)); @@ -2419,7 +2419,7 @@ e_table_get_cell_geometry (ETable *table, * Similar to e_table_get_cell_at, only here we check based on the mouse motion information in the group. **/ void -e_table_get_mouse_over_cell (ETable *table, int *row, int *col) +e_table_get_mouse_over_cell (ETable *table, gint *row, gint *col) { g_return_if_fail (table != NULL); g_return_if_fail (E_IS_TABLE (table)); @@ -2532,8 +2532,8 @@ struct _GtkDragSourceInfo **/ void e_table_drag_get_data (ETable *table, - int row, - int col, + gint row, + gint col, GdkDragContext *context, GdkAtom target, guint32 time) @@ -2558,14 +2558,14 @@ e_table_drag_get_data (ETable *table, **/ void e_table_drag_highlight (ETable *table, - int row, - int col) + gint row, + gint col) { g_return_if_fail(table != NULL); g_return_if_fail(E_IS_TABLE(table)); if (row != -1) { - int x, y, width, height; + gint x, y, width, height; if (col == -1) { e_table_get_cell_geometry (table, row, 0, &x, &y, &width, &height); x = 0; @@ -2665,7 +2665,7 @@ e_table_drag_dest_unset (GtkWidget *widget) /* Source side */ static gint -et_real_start_drag (ETable *table, int row, int col, GdkEvent *event) +et_real_start_drag (ETable *table, gint row, gint col, GdkEvent *event) { GtkDragSourceInfo *info; GdkDragContext *context; @@ -2795,8 +2795,8 @@ e_table_drag_source_unset (ETable *table) **/ GdkDragContext * e_table_drag_begin (ETable *table, - int row, - int col, + gint row, + gint col, GtkTargetList *targets, GdkDragAction actions, gint button, @@ -2863,7 +2863,7 @@ do_drag_motion(ETable *et, guint time) { gboolean ret_val; - int row = -1, col = -1; + gint row = -1, col = -1; e_table_get_cell_at (et, x, y, &row, &col); @@ -2883,7 +2883,7 @@ static gboolean scroll_timeout (gpointer data) { ETable *et = data; - int dx = 0, dy = 0; + gint dx = 0, dy = 0; GtkAdjustment *h, *v; double hvalue, vvalue; @@ -3027,7 +3027,7 @@ et_drag_drop(GtkWidget *widget, ETable *et) { gboolean ret_val; - int row, col; + gint row, col; e_table_get_cell_at (et, x, y, &row, &col); @@ -3059,7 +3059,7 @@ et_drag_data_received(GtkWidget *widget, guint time, ETable *et) { - int row, col; + gint row, col; e_table_get_cell_at (et, x, y, &row, &col); diff --git a/widgets/table/e-table.h b/widgets/table/e-table.h index 4894085330..7d3d0ff8cb 100644 --- a/widgets/table/e-table.h +++ b/widgets/table/e-table.h @@ -80,21 +80,21 @@ typedef struct { guint search_search_id; guint search_accept_id; - int table_model_change_id; - int table_row_change_id; - int table_cell_change_id; - int table_rows_inserted_id; - int table_rows_deleted_id; + gint table_model_change_id; + gint table_row_change_id; + gint table_cell_change_id; + gint table_rows_inserted_id; + gint table_rows_deleted_id; - int group_info_change_id; - int sort_info_change_id; + gint group_info_change_id; + gint sort_info_change_id; - int structure_change_id; - int expansion_change_id; - int dimension_change_id; + gint structure_change_id; + gint expansion_change_id; + gint dimension_change_id; - int reflow_idle_id; - int scroll_idle_id; + gint reflow_idle_id; + gint scroll_idle_id; GnomeCanvas *header_canvas, *table_canvas; @@ -131,41 +131,41 @@ typedef struct { guint always_search : 1; guint search_col_set : 1; - char *click_to_add_message; + gchar *click_to_add_message; GnomeCanvasItem *click_to_add; gboolean use_click_to_add; gboolean use_click_to_add_end; ECursorMode cursor_mode; - int drop_row; - int drop_col; + gint drop_row; + gint drop_col; GnomeCanvasItem *drop_highlight; - int last_drop_x; - int last_drop_y; - int last_drop_time; + gint last_drop_x; + gint last_drop_y; + gint last_drop_time; GdkDragContext *last_drop_context; - int drag_row; - int drag_col; + gint drag_row; + gint drag_col; ETableDragSourceSite *site; - int header_width; + gint header_width; - char *domain; + gchar *domain; } ETable; typedef struct { GtkTableClass parent_class; - void (*cursor_change) (ETable *et, int row); - void (*cursor_activated) (ETable *et, int row); + void (*cursor_change) (ETable *et, gint row); + void (*cursor_activated) (ETable *et, gint row); void (*selection_change) (ETable *et); - void (*double_click) (ETable *et, int row, int col, GdkEvent *event); - gint (*right_click) (ETable *et, int row, int col, GdkEvent *event); - gint (*click) (ETable *et, int row, int col, GdkEvent *event); - gint (*key_press) (ETable *et, int row, int col, GdkEvent *event); - gint (*start_drag) (ETable *et, int row, int col, GdkEvent *event); + void (*double_click) (ETable *et, gint row, gint col, GdkEvent *event); + gint (*right_click) (ETable *et, gint row, gint col, GdkEvent *event); + gint (*click) (ETable *et, gint row, gint col, GdkEvent *event); + gint (*key_press) (ETable *et, gint row, gint col, GdkEvent *event); + gint (*start_drag) (ETable *et, gint row, gint col, GdkEvent *event); void (*state_change) (ETable *et); gint (*white_space_event) (ETable *et, GdkEvent *event); @@ -175,48 +175,48 @@ typedef struct { /* Source side drag signals */ void (* table_drag_begin) (ETable *table, - int row, - int col, + gint row, + gint col, GdkDragContext *context); void (* table_drag_end) (ETable *table, - int row, - int col, + gint row, + gint col, GdkDragContext *context); void (* table_drag_data_get) (ETable *table, - int row, - int col, + gint row, + gint col, GdkDragContext *context, GtkSelectionData *selection_data, guint info, guint time); void (* table_drag_data_delete) (ETable *table, - int row, - int col, + gint row, + gint col, GdkDragContext *context); /* Target side drag signals */ void (* table_drag_leave) (ETable *table, - int row, - int col, + gint row, + gint col, GdkDragContext *context, guint time); gboolean (* table_drag_motion) (ETable *table, - int row, - int col, + gint row, + gint col, GdkDragContext *context, gint x, gint y, guint time); gboolean (* table_drag_drop) (ETable *table, - int row, - int col, + gint row, + gint col, GdkDragContext *context, gint x, gint y, guint time); void (* table_drag_data_received) (ETable *table, - int row, - int col, + gint row, + gint col, GdkDragContext *context, gint x, gint y, @@ -228,23 +228,23 @@ GType e_table_get_type (void); ETable *e_table_construct (ETable *e_table, ETableModel *etm, ETableExtras *ete, - const char *spec, - const char *state); + const gchar *spec, + const gchar *state); GtkWidget *e_table_new (ETableModel *etm, ETableExtras *ete, - const char *spec, - const char *state); + const gchar *spec, + const gchar *state); /* Create an ETable using files. */ ETable *e_table_construct_from_spec_file (ETable *e_table, ETableModel *etm, ETableExtras *ete, - const char *spec_fn, - const char *state_fn); + const gchar *spec_fn, + const gchar *state_fn); GtkWidget *e_table_new_from_spec_file (ETableModel *etm, ETableExtras *ete, - const char *spec_fn, - const char *state_fn); + const gchar *spec_fn, + const gchar *state_fn); /* To save the state */ gchar *e_table_get_state (ETable *e_table); @@ -260,10 +260,10 @@ void e_table_set_state_object (ETable *e_tabl void e_table_load_state (ETable *e_table, const gchar *filename); void e_table_set_cursor_row (ETable *e_table, - int row); + gint row); /* -1 means we don't have the cursor. This is in model rows. */ -int e_table_get_cursor_row (ETable *e_table); +gint e_table_get_cursor_row (ETable *e_table); void e_table_selected_row_foreach (ETable *e_table, EForeachFunc callback, gpointer closure); @@ -278,18 +278,18 @@ gint e_table_model_to_view_row (ETable *e_tabl gint e_table_view_to_model_row (ETable *e_table, gint view_row); void e_table_get_cell_at (ETable *table, - int x, - int y, - int *row_return, - int *col_return); -void e_table_get_mouse_over_cell (ETable *table, int *row, int *col); + gint x, + gint y, + gint *row_return, + gint *col_return); +void e_table_get_mouse_over_cell (ETable *table, gint *row, gint *col); void e_table_get_cell_geometry (ETable *table, - int row, - int col, - int *x_return, - int *y_return, - int *width_return, - int *height_return); + gint row, + gint col, + gint *x_return, + gint *y_return, + gint *width_return, + gint *height_return); /* Useful accessor functions. */ ESelectionModel *e_table_get_selection_model (ETable *table); @@ -297,14 +297,14 @@ ESelectionModel *e_table_get_selection_model (ETable *table) /* Drag & drop stuff. */ /* Target */ void e_table_drag_get_data (ETable *table, - int row, - int col, + gint row, + gint col, GdkDragContext *context, GdkAtom target, guint32 time); void e_table_drag_highlight (ETable *table, - int row, - int col); /* col == -1 to highlight entire row. */ + gint row, + gint col); /* col == -1 to highlight entire row. */ void e_table_drag_unhighlight (ETable *table); void e_table_drag_dest_set (ETable *table, GtkDestDefaults flags, @@ -333,8 +333,8 @@ void e_table_drag_source_unset (ETable *table) * as a GtkTargetList */ GdkDragContext *e_table_drag_begin (ETable *table, - int row, - int col, + gint row, + gint col, GtkTargetList *targets, GdkDragAction actions, gint button, diff --git a/widgets/table/e-tree-memory-callbacks.c b/widgets/table/e-tree-memory-callbacks.c index 08d703b7ff..25175c9797 100644 --- a/widgets/table/e-tree-memory-callbacks.c +++ b/widgets/table/e-tree-memory-callbacks.c @@ -62,7 +62,7 @@ etmc_has_save_id (ETreeModel *etm) return FALSE; } -static char * +static gchar * etmc_get_save_id (ETreeModel *etm, ETreePath node) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm); @@ -85,7 +85,7 @@ etmc_has_get_node_by_id (ETreeModel *etm) } static ETreePath -etmc_get_node_by_id (ETreeModel *etm, const char *save_id) +etmc_get_node_by_id (ETreeModel *etm, const gchar *save_id) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm); @@ -95,8 +95,8 @@ etmc_get_node_by_id (ETreeModel *etm, const char *save_id) return NULL; } -static void * -etmc_sort_value_at (ETreeModel *etm, ETreePath node, int col) +static gpointer +etmc_sort_value_at (ETreeModel *etm, ETreePath node, gint col) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm); @@ -106,8 +106,8 @@ etmc_sort_value_at (ETreeModel *etm, ETreePath node, int col) return etmc->value_at (etm, node, col, etmc->model_data); } -static void * -etmc_value_at (ETreeModel *etm, ETreePath node, int col) +static gpointer +etmc_value_at (ETreeModel *etm, ETreePath node, gint col) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm); @@ -115,7 +115,7 @@ etmc_value_at (ETreeModel *etm, ETreePath node, int col) } static void -etmc_set_value_at (ETreeModel *etm, ETreePath node, int col, const void *val) +etmc_set_value_at (ETreeModel *etm, ETreePath node, gint col, gconstpointer val) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm); @@ -123,7 +123,7 @@ etmc_set_value_at (ETreeModel *etm, ETreePath node, int col, const void *val) } static gboolean -etmc_is_editable (ETreeModel *etm, ETreePath node, int col) +etmc_is_editable (ETreeModel *etm, ETreePath node, gint col) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm); @@ -132,19 +132,19 @@ etmc_is_editable (ETreeModel *etm, ETreePath node, int col) /* The default for etmc_duplicate_value is to return the raw value. */ -static void * -etmc_duplicate_value (ETreeModel *etm, int col, const void *value) +static gpointer +etmc_duplicate_value (ETreeModel *etm, gint col, gconstpointer value) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm); if (etmc->duplicate_value) return etmc->duplicate_value (etm, col, value, etmc->model_data); else - return (void *)value; + return (gpointer)value; } static void -etmc_free_value (ETreeModel *etm, int col, void *value) +etmc_free_value (ETreeModel *etm, gint col, gpointer value) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm); @@ -152,8 +152,8 @@ etmc_free_value (ETreeModel *etm, int col, void *value) etmc->free_value (etm, col, value, etmc->model_data); } -static void * -etmc_initialize_value (ETreeModel *etm, int col) +static gpointer +etmc_initialize_value (ETreeModel *etm, gint col) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm); @@ -164,7 +164,7 @@ etmc_initialize_value (ETreeModel *etm, int col) } static gboolean -etmc_value_is_empty (ETreeModel *etm, int col, const void *value) +etmc_value_is_empty (ETreeModel *etm, gint col, gconstpointer value) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm); @@ -174,8 +174,8 @@ etmc_value_is_empty (ETreeModel *etm, int col, const void *value) return FALSE; } -static char * -etmc_value_to_string (ETreeModel *etm, int col, const void *value) +static gchar * +etmc_value_to_string (ETreeModel *etm, gint col, gconstpointer value) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm); diff --git a/widgets/table/e-tree-memory-callbacks.h b/widgets/table/e-tree-memory-callbacks.h index f74a472642..a7705795af 100644 --- a/widgets/table/e-tree-memory-callbacks.h +++ b/widgets/table/e-tree-memory-callbacks.h @@ -36,25 +36,25 @@ extern "C" { #define E_IS_TREE_MEMORY_CALLBACKS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TREE_MEMORY_CALLBACKS_TYPE)) -typedef GdkPixbuf* (*ETreeMemoryCallbacksIconAtFn) (ETreeModel *etree, ETreePath path, void *model_data); +typedef GdkPixbuf* (*ETreeMemoryCallbacksIconAtFn) (ETreeModel *etree, ETreePath path, gpointer model_data); -typedef gint (*ETreeMemoryCallbacksColumnCountFn) (ETreeModel *etree, void *model_data); +typedef gint (*ETreeMemoryCallbacksColumnCountFn) (ETreeModel *etree, gpointer model_data); -typedef gboolean (*ETreeMemoryCallbacksHasSaveIdFn) (ETreeModel *etree, void *model_data); -typedef gchar *(*ETreeMemoryCallbacksGetSaveIdFn) (ETreeModel *etree, ETreePath path, void *model_data); +typedef gboolean (*ETreeMemoryCallbacksHasSaveIdFn) (ETreeModel *etree, gpointer model_data); +typedef gchar *(*ETreeMemoryCallbacksGetSaveIdFn) (ETreeModel *etree, ETreePath path, gpointer model_data); -typedef gboolean (*ETreeMemoryCallbacksHasGetNodeByIdFn) (ETreeModel *etree, void *model_data); -typedef ETreePath (*ETreeMemoryCallbacksGetNodeByIdFn) (ETreeModel *etree, const char *save_id, void *model_data); +typedef gboolean (*ETreeMemoryCallbacksHasGetNodeByIdFn) (ETreeModel *etree, gpointer model_data); +typedef ETreePath (*ETreeMemoryCallbacksGetNodeByIdFn) (ETreeModel *etree, const gchar *save_id, gpointer model_data); -typedef void* (*ETreeMemoryCallbacksValueAtFn) (ETreeModel *etree, ETreePath path, int col, void *model_data); -typedef void (*ETreeMemoryCallbacksSetValueAtFn) (ETreeModel *etree, ETreePath path, int col, const void *val, void *model_data); -typedef gboolean (*ETreeMemoryCallbacksIsEditableFn) (ETreeModel *etree, ETreePath path, int col, void *model_data); +typedef gpointer (*ETreeMemoryCallbacksValueAtFn) (ETreeModel *etree, ETreePath path, gint col, gpointer model_data); +typedef void (*ETreeMemoryCallbacksSetValueAtFn) (ETreeModel *etree, ETreePath path, gint col, gconstpointer val, gpointer model_data); +typedef gboolean (*ETreeMemoryCallbacksIsEditableFn) (ETreeModel *etree, ETreePath path, gint col, gpointer model_data); -typedef void *(*ETreeMemoryCallbacksDuplicateValueFn) (ETreeModel *etm, int col, const void *val, void *data); -typedef void (*ETreeMemoryCallbacksFreeValueFn) (ETreeModel *etm, int col, void *val, void *data); -typedef void *(*ETreeMemoryCallbacksInitializeValueFn) (ETreeModel *etm, int col, void *data); -typedef gboolean (*ETreeMemoryCallbacksValueIsEmptyFn) (ETreeModel *etm, int col, const void *val, void *data); -typedef char *(*ETreeMemoryCallbacksValueToStringFn) (ETreeModel *etm, int col, const void *val, void *data); +typedef void *(*ETreeMemoryCallbacksDuplicateValueFn) (ETreeModel *etm, gint col, gconstpointer val, gpointer data); +typedef void (*ETreeMemoryCallbacksFreeValueFn) (ETreeModel *etm, gint col, gpointer val, gpointer data); +typedef void *(*ETreeMemoryCallbacksInitializeValueFn) (ETreeModel *etm, gint col, gpointer data); +typedef gboolean (*ETreeMemoryCallbacksValueIsEmptyFn) (ETreeModel *etm, gint col, gconstpointer val, gpointer data); +typedef gchar *(*ETreeMemoryCallbacksValueToStringFn) (ETreeModel *etm, gint col, gconstpointer val, gpointer data); typedef struct { ETreeMemory parent; diff --git a/widgets/table/e-tree-memory.c b/widgets/table/e-tree-memory.c index 99c9ef9895..728392f7b0 100644 --- a/widgets/table/e-tree-memory.c +++ b/widgets/table/e-tree-memory.c @@ -87,7 +87,7 @@ check_children (ETreeMemory *memory, ETreePath node) static int e_tree_memory_path_depth (ETreeMemoryPath *path) { - int depth = 0; + gint depth = 0; g_return_val_if_fail(path != NULL, -1); @@ -97,7 +97,7 @@ e_tree_memory_path_depth (ETreeMemoryPath *path) } static void -e_tree_memory_path_insert (ETreeMemoryPath *parent, int position, ETreeMemoryPath *child) +e_tree_memory_path_insert (ETreeMemoryPath *parent, gint position, ETreeMemoryPath *child) { g_return_if_fail (position <= parent->num_children && position >= -1); @@ -299,7 +299,7 @@ etmm_get_children (ETreeModel *etm, ETreePath node, ETreePath **nodes) if (nodes) { ETreeMemoryPath *p; - int i = 0; + gint i = 0; (*nodes) = g_new (ETreePath, n_children); for (p = path->first_child; p; p = p->next_sibling) { @@ -486,7 +486,7 @@ e_tree_memory_node_set_data (ETreeMemory *etmm, ETreePath node, gpointer node_da ETreePath e_tree_memory_node_insert (ETreeMemory *tree_model, ETreePath parent_node, - int position, + gint position, gpointer node_data) { ETreeMemoryPriv *priv; @@ -522,7 +522,7 @@ e_tree_memory_node_insert (ETreeMemory *tree_model, return new_path; } -ETreePath e_tree_memory_node_insert_id (ETreeMemory *etree, ETreePath parent, int position, gpointer node_data, char *id) +ETreePath e_tree_memory_node_insert_id (ETreeMemory *etree, ETreePath parent, gint position, gpointer node_data, gchar *id) { return e_tree_memory_node_insert(etree, parent, position, node_data); } @@ -547,7 +547,7 @@ e_tree_memory_node_insert_before (ETreeMemory *etree, ETreeMemoryPath *child; ETreeMemoryPath *parent_path = parent; ETreeMemoryPath *sibling_path = sibling; - int position = 0; + gint position = 0; g_return_val_if_fail(etree != NULL, NULL); @@ -598,7 +598,7 @@ e_tree_memory_node_remove (ETreeMemory *etree, ETreePath node) ETreeMemoryPath *parent = path->parent; ETreeMemoryPath *sibling; gpointer ret = path->node_data; - int old_position = 0; + gint old_position = 0; g_return_val_if_fail(etree != NULL, NULL); @@ -637,7 +637,7 @@ typedef struct { } MemoryAndClosure; static int -sort_callback(const void *data1, const void *data2, gpointer user_data) +sort_callback(gconstpointer data1, gconstpointer data2, gpointer user_data) { ETreePath path1 = *(ETreePath *)data1; ETreePath path2 = *(ETreePath *)data2; @@ -653,8 +653,8 @@ e_tree_memory_sort_node (ETreeMemory *etmm, { ETreeMemoryPath **children; ETreeMemoryPath *child; - int count; - int i; + gint count; + gint i; ETreeMemoryPath *path = node; MemoryAndClosure mac; ETreeMemoryPath *last; diff --git a/widgets/table/e-tree-memory.h b/widgets/table/e-tree-memory.h index 2c82d1c8d1..0a56c8d37e 100644 --- a/widgets/table/e-tree-memory.h +++ b/widgets/table/e-tree-memory.h @@ -41,7 +41,7 @@ typedef struct ETreeMemory ETreeMemory; typedef struct ETreeMemoryPriv ETreeMemoryPriv; typedef struct ETreeMemoryClass ETreeMemoryClass; -typedef int (*ETreeMemorySortCallback) (ETreeMemory *etmm, ETreePath path1, ETreePath path2, gpointer closure); +typedef gint (*ETreeMemorySortCallback) (ETreeMemory *etmm, ETreePath path1, ETreePath path2, gpointer closure); struct ETreeMemory { ETreeModel base; @@ -63,13 +63,13 @@ ETreeMemory *e_tree_memory_new (void); /* node operations */ ETreePath e_tree_memory_node_insert (ETreeMemory *etree, ETreePath parent, - int position, + gint position, gpointer node_data); ETreePath e_tree_memory_node_insert_id (ETreeMemory *etree, ETreePath parent, - int position, + gint position, gpointer node_data, - char *id); + gchar *id); ETreePath e_tree_memory_node_insert_before (ETreeMemory *etree, ETreePath parent, ETreePath sibling, diff --git a/widgets/table/e-tree-model.c b/widgets/table/e-tree-model.c index bd35358874..9482fe9789 100644 --- a/widgets/table/e-tree-model.c +++ b/widgets/table/e-tree-model.c @@ -320,7 +320,7 @@ e_tree_model_node_data_changed (ETreeModel *tree_model, ETreePath node) * Return value: **/ void -e_tree_model_node_col_changed (ETreeModel *tree_model, ETreePath node, int col) +e_tree_model_node_col_changed (ETreeModel *tree_model, ETreePath node, gint col) { g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); @@ -361,7 +361,7 @@ e_tree_model_node_inserted (ETreeModel *tree_model, * **/ void -e_tree_model_node_removed (ETreeModel *tree_model, ETreePath parent_node, ETreePath removed_node, int old_position) +e_tree_model_node_removed (ETreeModel *tree_model, ETreePath parent_node, ETreePath removed_node, gint old_position) { g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); @@ -754,7 +754,7 @@ e_tree_model_has_get_node_by_id (ETreeModel *etree) * return values: The path for this save id. */ ETreePath -e_tree_model_get_node_by_id (ETreeModel *etree, const char *save_id) +e_tree_model_get_node_by_id (ETreeModel *etree, const gchar *save_id) { g_return_val_if_fail (etree != NULL, NULL); g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL); @@ -805,8 +805,8 @@ e_tree_model_has_change_pending (ETreeModel *etree) * affects the data in that node for that column. node_inserted, * node_removed, and no_change don't affect any data in this way. **/ -void * -e_tree_model_sort_value_at (ETreeModel *etree, ETreePath node, int col) +gpointer +e_tree_model_sort_value_at (ETreeModel *etree, ETreePath node, gint col) { g_return_val_if_fail (etree != NULL, NULL); g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL); @@ -836,8 +836,8 @@ e_tree_model_sort_value_at (ETreeModel *etree, ETreePath node, int col) * affects the data in that node for that column. node_inserted, * node_removed, and no_change don't affect any data in this way. **/ -void * -e_tree_model_value_at (ETreeModel *etree, ETreePath node, int col) +gpointer +e_tree_model_value_at (ETreeModel *etree, ETreePath node, gint col) { g_return_val_if_fail (etree != NULL, NULL); g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL); @@ -849,7 +849,7 @@ e_tree_model_value_at (ETreeModel *etree, ETreePath node, int col) } void -e_tree_model_set_value_at (ETreeModel *etree, ETreePath node, int col, const void *val) +e_tree_model_set_value_at (ETreeModel *etree, ETreePath node, gint col, gconstpointer val) { g_return_if_fail (etree != NULL); g_return_if_fail (E_IS_TREE_MODEL (etree)); @@ -868,7 +868,7 @@ e_tree_model_set_value_at (ETreeModel *etree, ETreePath node, int col, const voi * Return value: **/ gboolean -e_tree_model_node_is_editable (ETreeModel *etree, ETreePath node, int col) +e_tree_model_node_is_editable (ETreeModel *etree, ETreePath node, gint col) { g_return_val_if_fail(etree != NULL, FALSE); @@ -887,8 +887,8 @@ e_tree_model_node_is_editable (ETreeModel *etree, ETreePath node, int col) * * Return value: **/ -void * -e_tree_model_duplicate_value (ETreeModel *etree, int col, const void *value) +gpointer +e_tree_model_duplicate_value (ETreeModel *etree, gint col, gconstpointer value) { g_return_val_if_fail(etree != NULL, NULL); @@ -908,7 +908,7 @@ e_tree_model_duplicate_value (ETreeModel *etree, int col, const void *value) * Return value: **/ void -e_tree_model_free_value (ETreeModel *etree, int col, void *value) +e_tree_model_free_value (ETreeModel *etree, gint col, gpointer value) { g_return_if_fail(etree != NULL); @@ -925,8 +925,8 @@ e_tree_model_free_value (ETreeModel *etree, int col, void *value) * * Return value: **/ -void * -e_tree_model_initialize_value (ETreeModel *etree, int col) +gpointer +e_tree_model_initialize_value (ETreeModel *etree, gint col) { g_return_val_if_fail(etree != NULL, NULL); @@ -946,7 +946,7 @@ e_tree_model_initialize_value (ETreeModel *etree, int col) * Return value: **/ gboolean -e_tree_model_value_is_empty (ETreeModel *etree, int col, const void *value) +e_tree_model_value_is_empty (ETreeModel *etree, gint col, gconstpointer value) { g_return_val_if_fail(etree != NULL, TRUE); @@ -965,8 +965,8 @@ e_tree_model_value_is_empty (ETreeModel *etree, int col, const void *value) * * Return value: **/ -char * -e_tree_model_value_to_string (ETreeModel *etree, int col, const void *value) +gchar * +e_tree_model_value_to_string (ETreeModel *etree, gint col, gconstpointer value) { g_return_val_if_fail(etree != NULL, g_strdup("")); diff --git a/widgets/table/e-tree-model.h b/widgets/table/e-tree-model.h index ed34933cb1..fdd7f26a66 100644 --- a/widgets/table/e-tree-model.h +++ b/widgets/table/e-tree-model.h @@ -39,7 +39,7 @@ G_BEGIN_DECLS #define E_IS_TREE_MODEL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TREE_MODEL_TYPE)) #define E_TREE_MODEL_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), E_TREE_MODEL_TYPE, ETreeModelClass)) -typedef void * ETreePath; +typedef gpointer ETreePath; typedef struct ETreeModel ETreeModel; typedef struct ETreeModelClass ETreeModelClass; typedef gint (*ETreePathCompareFunc)(ETreeModel *model, ETreePath path1, ETreePath path2); @@ -77,23 +77,23 @@ struct ETreeModelClass { gchar *(*get_save_id) (ETreeModel *etm, ETreePath node); gboolean (*has_get_node_by_id) (ETreeModel *etm); - ETreePath (*get_node_by_id) (ETreeModel *etm, const char *save_id); + ETreePath (*get_node_by_id) (ETreeModel *etm, const gchar *save_id); gboolean (*has_change_pending) (ETreeModel *etm); /* * ETable analogs */ - void *(*sort_value_at) (ETreeModel *etm, ETreePath node, int col); - void *(*value_at) (ETreeModel *etm, ETreePath node, int col); - void (*set_value_at) (ETreeModel *etm, ETreePath node, int col, const void *val); - gboolean (*is_editable) (ETreeModel *etm, ETreePath node, int col); + void *(*sort_value_at) (ETreeModel *etm, ETreePath node, gint col); + void *(*value_at) (ETreeModel *etm, ETreePath node, gint col); + void (*set_value_at) (ETreeModel *etm, ETreePath node, gint col, gconstpointer val); + gboolean (*is_editable) (ETreeModel *etm, ETreePath node, gint col); - void *(*duplicate_value) (ETreeModel *etm, int col, const void *value); - void (*free_value) (ETreeModel *etm, int col, void *value); - void *(*initialize_value) (ETreeModel *etm, int col); - gboolean (*value_is_empty) (ETreeModel *etm, int col, const void *value); - char *(*value_to_string) (ETreeModel *etm, int col, const void *value); + void *(*duplicate_value) (ETreeModel *etm, gint col, gconstpointer value); + void (*free_value) (ETreeModel *etm, gint col, gpointer value); + void *(*initialize_value) (ETreeModel *etm, gint col); + gboolean (*value_is_empty) (ETreeModel *etm, gint col, gconstpointer value); + gchar *(*value_to_string) (ETreeModel *etm, gint col, gconstpointer value); /* * Signals @@ -108,9 +108,9 @@ struct ETreeModelClass { void (*no_change) (ETreeModel *etm); void (*node_changed) (ETreeModel *etm, ETreePath node); void (*node_data_changed) (ETreeModel *etm, ETreePath node); - void (*node_col_changed) (ETreeModel *etm, ETreePath node, int col); + void (*node_col_changed) (ETreeModel *etm, ETreePath node, gint col); void (*node_inserted) (ETreeModel *etm, ETreePath parent, ETreePath inserted_node); - void (*node_removed) (ETreeModel *etm, ETreePath parent, ETreePath removed_node, int old_position); + void (*node_removed) (ETreeModel *etm, ETreePath parent, ETreePath removed_node, gint old_position); void (*node_deleted) (ETreeModel *etm, ETreePath deleted_node); void (*rebuilt) (ETreeModel *etm); @@ -156,34 +156,34 @@ gchar *e_tree_model_get_save_id (ETreeModel *model, ETreePath node); gboolean e_tree_model_has_get_node_by_id (ETreeModel *model); ETreePath e_tree_model_get_node_by_id (ETreeModel *model, - const char *save_id); + const gchar *save_id); gboolean e_tree_model_has_change_pending (ETreeModel *model); void *e_tree_model_sort_value_at (ETreeModel *etree, ETreePath node, - int col); + gint col); void *e_tree_model_value_at (ETreeModel *etree, ETreePath node, - int col); + gint col); void e_tree_model_set_value_at (ETreeModel *etree, ETreePath node, - int col, + gint col, const void *val); gboolean e_tree_model_node_is_editable (ETreeModel *etree, ETreePath node, - int col); + gint col); void *e_tree_model_duplicate_value (ETreeModel *etree, - int col, + gint col, const void *value); void e_tree_model_free_value (ETreeModel *etree, - int col, + gint col, void *value); void *e_tree_model_initialize_value (ETreeModel *etree, - int col); + gint col); gboolean e_tree_model_value_is_empty (ETreeModel *etree, - int col, + gint col, const void *value); -char *e_tree_model_value_to_string (ETreeModel *etree, - int col, +gchar *e_tree_model_value_to_string (ETreeModel *etree, + gint col, const void *value); /* depth first traversal of path's descendents, calling func on each one */ @@ -214,14 +214,14 @@ void e_tree_model_node_data_changed (ETreeModel *tree_model, ETreePath node); void e_tree_model_node_col_changed (ETreeModel *tree_model, ETreePath node, - int col); + gint col); void e_tree_model_node_inserted (ETreeModel *tree_model, ETreePath parent_node, ETreePath inserted_node); void e_tree_model_node_removed (ETreeModel *tree_model, ETreePath parent_node, ETreePath removed_node, - int old_position); + gint old_position); void e_tree_model_node_deleted (ETreeModel *tree_model, ETreePath deleted_node); void e_tree_model_node_request_collapse (ETreeModel *tree_model, diff --git a/widgets/table/e-tree-scrolled.c b/widgets/table/e-tree-scrolled.c index 18267a42c3..fc729ab411 100644 --- a/widgets/table/e-tree-scrolled.c +++ b/widgets/table/e-tree-scrolled.c @@ -73,8 +73,8 @@ gboolean e_tree_scrolled_construct (ETreeScrolled *ets, ETreeModel *etm, ETableExtras *ete, - const char *spec, - const char *state) + const gchar *spec, + const gchar *state) { g_return_val_if_fail(ets != NULL, FALSE); g_return_val_if_fail(E_IS_TREE_SCROLLED(ets), FALSE); @@ -93,8 +93,8 @@ e_tree_scrolled_construct (ETreeScrolled *ets, GtkWidget *e_tree_scrolled_new (ETreeModel *etm, ETableExtras *ete, - const char *spec, - const char *state) + const gchar *spec, + const gchar *state) { ETreeScrolled *ets; @@ -120,8 +120,8 @@ gboolean e_tree_scrolled_construct_from_spec_file (ETreeScrolled *ets, ETreeModel *etm, ETableExtras *ete, - const char *spec_fn, - const char *state_fn) + const gchar *spec_fn, + const gchar *state_fn) { g_return_val_if_fail(ets != NULL, FALSE); g_return_val_if_fail(E_IS_TREE_SCROLLED(ets), FALSE); @@ -140,8 +140,8 @@ e_tree_scrolled_construct_from_spec_file (ETreeScrolled *ets, GtkWidget *e_tree_scrolled_new_from_spec_file (ETreeModel *etm, ETableExtras *ete, - const char *spec_fn, - const char *state_fn) + const gchar *spec_fn, + const gchar *state_fn) { ETreeScrolled *ets; diff --git a/widgets/table/e-tree-scrolled.h b/widgets/table/e-tree-scrolled.h index 5d4b8de36f..197dd9a083 100644 --- a/widgets/table/e-tree-scrolled.h +++ b/widgets/table/e-tree-scrolled.h @@ -51,22 +51,22 @@ GType e_tree_scrolled_get_type (void); gboolean e_tree_scrolled_construct (ETreeScrolled *ets, ETreeModel *etm, ETableExtras *ete, - const char *spec, - const char *state); + const gchar *spec, + const gchar *state); GtkWidget *e_tree_scrolled_new (ETreeModel *etm, ETableExtras *ete, - const char *spec, - const char *state); + const gchar *spec, + const gchar *state); gboolean e_tree_scrolled_construct_from_spec_file (ETreeScrolled *ets, ETreeModel *etm, ETableExtras *ete, - const char *spec_fn, - const char *state_fn); + const gchar *spec_fn, + const gchar *state_fn); GtkWidget *e_tree_scrolled_new_from_spec_file (ETreeModel *etm, ETableExtras *ete, - const char *spec_fn, - const char *state_fn); + const gchar *spec_fn, + const gchar *state_fn); ETree *e_tree_scrolled_get_tree (ETreeScrolled *ets); diff --git a/widgets/table/e-tree-selection-model.c b/widgets/table/e-tree-selection-model.c index 1d694f9b60..68316f72bb 100644 --- a/widgets/table/e-tree-selection-model.c +++ b/widgets/table/e-tree-selection-model.c @@ -179,7 +179,7 @@ etsm_node_data_changed (ETreeModel *etm, ETreePath node, ETreeSelectionModel *et } static void -etsm_node_col_changed (ETreeModel *etm, ETreePath node, int col, ETreeSelectionModel *etsm) +etsm_node_col_changed (ETreeModel *etm, ETreePath node, gint col, ETreeSelectionModel *etsm) { free_id (etsm); } @@ -191,7 +191,7 @@ etsm_node_inserted (ETreeModel *etm, ETreePath parent, ETreePath child, ETreeSel } static void -etsm_node_removed (ETreeModel *etm, ETreePath parent, ETreePath child, int old_position, ETreeSelectionModel *etsm) +etsm_node_removed (ETreeModel *etm, ETreePath parent, ETreePath child, gint old_position, ETreeSelectionModel *etsm) { restore_cursor (etsm, etm); } @@ -392,7 +392,7 @@ etsm_row_foreach_cb (gpointer key, gpointer value, gpointer user_data) { ETreePath path = key; ModelAndCallback *mac = user_data; - int row = e_tree_table_adapter_row_of_node(mac->etsm->priv->etta, path); + gint row = e_tree_table_adapter_row_of_node(mac->etsm->priv->etta, path); if (row >= 0) mac->callback(row, mac->closure); } @@ -521,7 +521,7 @@ etsm_invert_selection (ESelectionModel *selection) } static void -etsm_change_one_row(ESelectionModel *selection, int row, gboolean grow) +etsm_change_one_row(ESelectionModel *selection, gint row, gboolean grow) { ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL(selection); ETreePath path; @@ -539,7 +539,7 @@ etsm_change_one_row(ESelectionModel *selection, int row, gboolean grow) } static void -etsm_change_cursor (ESelectionModel *selection, int row, int col) +etsm_change_cursor (ESelectionModel *selection, gint row, gint col) { ETreeSelectionModel *etsm; @@ -570,9 +570,9 @@ etsm_cursor_col (ESelectionModel *selection) } static void -etsm_get_rows(int row, void *d) +etsm_get_rows(gint row, gpointer d) { - int **rowp = d; + gint **rowp = d; **rowp = row; (*rowp)++; @@ -583,7 +583,7 @@ etsm_select_single_row (ESelectionModel *selection, gint row) { ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL(selection); ETreePath path = e_tree_table_adapter_node_at_row (etsm->priv->etta, row); - int rows[5], *rowp = NULL, size; + gint rows[5], *rowp = NULL, size; g_return_if_fail (path != NULL); @@ -601,7 +601,7 @@ etsm_select_single_row (ESelectionModel *selection, gint row) e_selection_model_selection_changed(E_SELECTION_MODEL(etsm)); } else { if (rowp) { - int *p = rows; + gint *p = rows; while (p<rowp) e_selection_model_selection_row_changed((ESelectionModel *)etsm, *p++); @@ -702,7 +702,7 @@ void e_tree_selection_model_select_paths (ETreeSelectionModel *etsm, GPtrArray *paths) { ETreePath path; - int i; + gint i; for (i=0;i<paths->len;i++) { path = paths->pdata[i]; @@ -723,7 +723,7 @@ e_tree_selection_model_add_to_selection (ETreeSelectionModel *etsm, ETreePath pa void e_tree_selection_model_change_cursor (ETreeSelectionModel *etsm, ETreePath path) { - int row; + gint row; etsm->priv->cursor_path = path; diff --git a/widgets/table/e-tree-simple.c b/widgets/table/e-tree-simple.c index 3252a3db18..2704b7ea24 100644 --- a/widgets/table/e-tree-simple.c +++ b/widgets/table/e-tree-simple.c @@ -39,19 +39,19 @@ simple_column_count (ETableModel *etm) } /* The default for simple_duplicate_value is to return the raw value. */ -static void * -simple_duplicate_value (ETableModel *etm, int col, const void *value) +static gpointer +simple_duplicate_value (ETableModel *etm, gint col, gconstpointer value) { ETreeSimple *simple = E_TREE_SIMPLE(etm); if (simple->duplicate_value) return simple->duplicate_value (etm, col, value, simple->model_data); else - return (void *)value; + return (gpointer)value; } static void -simple_free_value (ETableModel *etm, int col, void *value) +simple_free_value (ETableModel *etm, gint col, gpointer value) { ETreeSimple *simple = E_TREE_SIMPLE(etm); @@ -59,8 +59,8 @@ simple_free_value (ETableModel *etm, int col, void *value) simple->free_value (etm, col, value, simple->model_data); } -static void * -simple_initialize_value (ETableModel *etm, int col) +static gpointer +simple_initialize_value (ETableModel *etm, gint col) { ETreeSimple *simple = E_TREE_SIMPLE(etm); @@ -71,7 +71,7 @@ simple_initialize_value (ETableModel *etm, int col) } static gboolean -simple_value_is_empty (ETableModel *etm, int col, const void *value) +simple_value_is_empty (ETableModel *etm, gint col, gconstpointer value) { ETreeSimple *simple = E_TREE_SIMPLE(etm); @@ -81,8 +81,8 @@ simple_value_is_empty (ETableModel *etm, int col, const void *value) return FALSE; } -static char * -simple_value_to_string (ETableModel *etm, int col, const void *value) +static gchar * +simple_value_to_string (ETableModel *etm, gint col, gconstpointer value) { ETreeSimple *simple = E_TREE_SIMPLE(etm); @@ -92,8 +92,8 @@ simple_value_to_string (ETableModel *etm, int col, const void *value) return g_strdup (""); } -static void * -simple_value_at (ETreeModel *etm, ETreePath *node, int col) +static gpointer +simple_value_at (ETreeModel *etm, ETreePath *node, gint col) { ETreeSimple *simple = E_TREE_SIMPLE(etm); @@ -109,7 +109,7 @@ simple_icon_at (ETreeModel *etm, ETreePath *node) } static void -simple_set_value_at (ETreeModel *etm, ETreePath *node, int col, const void *val) +simple_set_value_at (ETreeModel *etm, ETreePath *node, gint col, gconstpointer val) { ETreeSimple *simple = E_TREE_SIMPLE(etm); @@ -117,7 +117,7 @@ simple_set_value_at (ETreeModel *etm, ETreePath *node, int col, const void *val) } static gboolean -simple_is_editable (ETreeModel *etm, ETreePath *node, int col) +simple_is_editable (ETreeModel *etm, ETreePath *node, gint col) { ETreeSimple *simple = E_TREE_SIMPLE(etm); diff --git a/widgets/table/e-tree-simple.h b/widgets/table/e-tree-simple.h index bb64aa18a2..47a5e6bdf1 100644 --- a/widgets/table/e-tree-simple.h +++ b/widgets/table/e-tree-simple.h @@ -37,10 +37,10 @@ G_BEGIN_DECLS #define E_TREE_SIMPLE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), E_TREE_SIMPLE_TYPE, ETreeSimpleClass)) -typedef GdkPixbuf* (*ETreeSimpleIconAtFn) (ETreeModel *etree, ETreePath *path, void *model_data); -typedef void* (*ETreeSimpleValueAtFn) (ETreeModel *etree, ETreePath *path, int col, void *model_data); -typedef void (*ETreeSimpleSetValueAtFn) (ETreeModel *etree, ETreePath *path, int col, const void *val, void *model_data); -typedef gboolean (*ETreeSimpleIsEditableFn) (ETreeModel *etree, ETreePath *path, int col, void *model_data); +typedef GdkPixbuf* (*ETreeSimpleIconAtFn) (ETreeModel *etree, ETreePath *path, gpointer model_data); +typedef gpointer (*ETreeSimpleValueAtFn) (ETreeModel *etree, ETreePath *path, gint col, gpointer model_data); +typedef void (*ETreeSimpleSetValueAtFn) (ETreeModel *etree, ETreePath *path, gint col, gconstpointer val, gpointer model_data); +typedef gboolean (*ETreeSimpleIsEditableFn) (ETreeModel *etree, ETreePath *path, gint col, gpointer model_data); typedef struct { ETreeModel parent; diff --git a/widgets/table/e-tree-sorted-variable.c b/widgets/table/e-tree-sorted-variable.c index 432a7897e4..0bc82506e8 100644 --- a/widgets/table/e-tree-sorted-variable.c +++ b/widgets/table/e-tree-sorted-variable.c @@ -48,8 +48,8 @@ struct ETreeSortedVariablePrivate { static void etsv_proxy_model_changed (ETableModel *etm, ETreeSortedVariable *etsv); #if 0 -static void etsv_proxy_model_row_changed (ETableModel *etm, int row, ETreeSortedVariable *etsv); -static void etsv_proxy_model_cell_changed (ETableModel *etm, int col, int row, ETreeSortedVariable *etsv); +static void etsv_proxy_model_row_changed (ETableModel *etm, gint row, ETreeSortedVariable *etsv); +static void etsv_proxy_model_cell_changed (ETableModel *etm, gint col, gint row, ETreeSortedVariable *etsv); #endif static void etsv_sort_info_changed (ETableSortInfo *info, ETreeSortedVariable *etsv); static void etsv_sort (ETreeSortedVariable *etsv); @@ -186,7 +186,7 @@ etsv_proxy_model_changed (ETableModel *etm, ETreeSortedVariable *etsv) } #if 0 static void -etsv_proxy_model_row_changed (ETableModel *etm, int row, ETreeSortedVariable *etsv) +etsv_proxy_model_row_changed (ETableModel *etm, gint row, ETreeSortedVariable *etsv) { ETreeSortedVariable *etsv = E_TABLE_SUBSET_VARIABLE(etsv); @@ -195,7 +195,7 @@ etsv_proxy_model_row_changed (ETableModel *etm, int row, ETreeSortedVariable *et } static void -etsv_proxy_model_cell_changed (ETableModel *etm, int col, int row, ETreeSortedVariable *etsv) +etsv_proxy_model_cell_changed (ETableModel *etm, gint col, gint row, ETreeSortedVariable *etsv) { ETreeSortedVariable *etsv = E_TABLE_SUBSET_VARIABLE(etsv); @@ -214,10 +214,10 @@ etsv_sort_info_changed (ETableSortInfo *info, ETreeSortedVariable *etsv) static int etsv_compare(ETreeSortedVariable *etsv, const ETreePath *path1, const ETreePath *path2) { - int j; - int sort_count = e_table_sort_info_sorting_get_count(etsv->sort_info); - int comp_val = 0; - int ascending = 1; + gint j; + gint sort_count = e_table_sort_info_sorting_get_count(etsv->sort_info); + gint comp_val = 0; + gint ascending = 1; for (j = 0; j < sort_count; j++) { ETableSortColumn column = e_table_sort_info_sorting_get_nth(etsv->sort_info, j); @@ -244,18 +244,18 @@ etsv_compare(ETreeSortedVariable *etsv, const ETreePath *path1, const ETreePath static ETreeSortedVariable *etsv_closure; -int cols_closure; -int *ascending_closure; -int *col_idx_closure; +gint cols_closure; +gint *ascending_closure; +gint *col_idx_closure; GCompareFunc *compare_closure; static int etsv_compare_closure(const ETreePath *path1, const ETreePath *path2) { - int j; - int sort_count = e_table_sort_info_sorting_get_count(etsv_closure->sort_info); - int comp_val = 0; - int ascending = 1; + gint j; + gint sort_count = e_table_sort_info_sorting_get_count(etsv_closure->sort_info); + gint comp_val = 0; + gint ascending = 1; for (j = 0; j < sort_count; j++) { comp_val = (*(compare_closure[j]))(e_tree_model_value_at (etsv_closure->source, path1, col_idx_closure[j]), @@ -276,7 +276,7 @@ etsv_compare_closure(const ETreePath *path1, const ETreePath *path2) } static int -qsort_callback(const void *data1, const void *data2) +qsort_callback(gconstpointer data1, gconstpointer data2) { GNode *node1 = *(GNode **)data1; GNode *node2 = *(GNode **)data2; @@ -284,7 +284,7 @@ qsort_callback(const void *data1, const void *data2) } static int -qsort_callback_source(const void *data1, const void *data2) +qsort_callback_source(gconstpointer data1, gconstpointer data2) { return etsv_compare_closure(data1, data2); } @@ -292,8 +292,8 @@ qsort_callback_source(const void *data1, const void *data2) static void etsv_setup_closures(ETreeSortedVariable *etsv) { - int j; - int cols; + gint j; + gint cols; cols = e_table_sort_info_sorting_get_count(etsv->sort_info); cols_closure = cols; @@ -367,7 +367,7 @@ etsv_sort_tree(ETreeSortedVariable *etsv, GNode *root) static void etsv_sort(ETreeSortedVariable *etsv) { - static int reentering = 0; + static gint reentering = 0; if (reentering) return; reentering = 1; @@ -440,8 +440,8 @@ etsv_add_all_node (ETreeSortedVariable *etsv, ETreePath *path, GNode *node) { ETreeModel *source = etsv->source; ETreePath **children; - int n; - int i; + gint n; + gint i; n = e_tree_model_node_get_children(source, path, &children); qsort(children, n, sizeof(ETreePath *), qsort_callback_source); diff --git a/widgets/table/e-tree-sorted-variable.h b/widgets/table/e-tree-sorted-variable.h index 15f9d8e8af..2d5af111d9 100644 --- a/widgets/table/e-tree-sorted-variable.h +++ b/widgets/table/e-tree-sorted-variable.h @@ -46,11 +46,11 @@ typedef struct { ETableHeader *full_header; - int table_model_changed_id; - int table_model_row_changed_id; - int table_model_cell_changed_id; - int sort_info_changed_id; - int sort_idle_id; + gint table_model_changed_id; + gint table_model_row_changed_id; + gint table_model_cell_changed_id; + gint sort_info_changed_id; + gint sort_idle_id; int insert_idle_id; int insert_count; diff --git a/widgets/table/e-tree-sorted.c b/widgets/table/e-tree-sorted.c index 092fa87b9b..3ec12c8360 100644 --- a/widgets/table/e-tree-sorted.c +++ b/widgets/table/e-tree-sorted.c @@ -66,8 +66,8 @@ struct ETreeSortedPath { ETreeSortedPath *parent; gint num_children; ETreeSortedPath **children; - int position; - int orig_position; + gint position; + gint orig_position; guint needs_resort : 1; guint child_needs_resort : 1; @@ -84,20 +84,20 @@ struct ETreeSortedPriv { ETreeSortedPath *last_access; - int tree_model_pre_change_id; - int tree_model_no_change_id; - int tree_model_node_changed_id; - int tree_model_node_data_changed_id; - int tree_model_node_col_changed_id; - int tree_model_node_inserted_id; - int tree_model_node_removed_id; - int tree_model_node_deleted_id; - int tree_model_node_request_collapse_id; - - int sort_info_changed_id; - int sort_idle_id; - int insert_idle_id; - int insert_count; + gint tree_model_pre_change_id; + gint tree_model_no_change_id; + gint tree_model_node_changed_id; + gint tree_model_node_data_changed_id; + gint tree_model_node_col_changed_id; + gint tree_model_node_inserted_id; + gint tree_model_node_removed_id; + gint tree_model_node_deleted_id; + gint tree_model_node_request_collapse_id; + + gint sort_info_changed_id; + gint sort_idle_id; + gint insert_idle_id; + gint insert_count; guint in_resort_idle : 1; guint nested_resort_idle : 1; @@ -184,11 +184,11 @@ check_last_access (ETreeSorted *ets, ETreePath corresponding) #ifdef CHECK_AROUND_LAST_ACCESS parent = ets->priv->last_access->parent; if (parent && parent->children) { - int position = ets->priv->last_access->position; - int end = MIN(parent->num_children, position + 10); - int start = MAX(0, position - 10); - int initial = MAX (MIN (position, end), start); - int i; + gint position = ets->priv->last_access->position; + gint end = MIN(parent->num_children, position + 10); + gint start = MAX(0, position - 10); + gint initial = MAX (MIN (position, end), start); + gint i; for (i = initial; i < end; i++) { if (parent->children[i] && parent->children[i]->corresponding == corresponding) { @@ -211,9 +211,9 @@ check_last_access (ETreeSorted *ets, ETreePath corresponding) static ETreeSortedPath * find_path(ETreeSorted *ets, ETreePath corresponding) { - int depth; + gint depth; ETreePath *sequence; - int i; + gint i; ETreeSortedPath *path; ETreeSortedPath *check_last; @@ -238,7 +238,7 @@ find_path(ETreeSorted *ets, ETreePath corresponding) path = ets->priv->root; for (i = depth - 1; i >= 0 && path != NULL; i --) { - int j; + gint j; if (path->num_children == -1) { path = NULL; @@ -268,7 +268,7 @@ find_path(ETreeSorted *ets, ETreePath corresponding) static ETreeSortedPath * find_child_path(ETreeSorted *ets, ETreeSortedPath *parent, ETreePath corresponding) { - int i; + gint i; if (corresponding == NULL) return NULL; @@ -287,9 +287,9 @@ find_child_path(ETreeSorted *ets, ETreeSortedPath *parent, ETreePath correspondi static ETreeSortedPath * find_or_create_path(ETreeSorted *ets, ETreePath corresponding) { - int depth; + gint depth; ETreePath *sequence; - int i; + gint i; ETreeSortedPath *path; ETreeSortedPath *check_last; @@ -314,7 +314,7 @@ find_or_create_path(ETreeSorted *ets, ETreePath corresponding) path = ets->priv->root; for (i = depth - 1; i >= 0 && path != NULL; i --) { - int j; + gint j; if (path->num_children == -1) { generate_children(ets, path); @@ -343,7 +343,7 @@ find_or_create_path(ETreeSorted *ets, ETreePath corresponding) static void free_children (ETreeSortedPath *path) { - int i; + gint i; if (path == NULL) return; @@ -388,8 +388,8 @@ new_path (ETreeSortedPath *parent, ETreePath corresponding) static gboolean reposition_path (ETreeSorted *ets, ETreeSortedPath *path) { - int new_index; - int old_index = path->position; + gint new_index; + gint old_index = path->position; ETreeSortedPath *parent = path->parent; gboolean changed = FALSE; if (parent) { @@ -412,7 +412,7 @@ reposition_path (ETreeSorted *ets, ETreeSortedPath *path) old_index); if (new_index > old_index) { - int i; + gint i; ets->priv->insert_count++; memmove(parent->children + old_index, parent->children + old_index + 1, sizeof (ETreePath) * (new_index - old_index)); parent->children[new_index] = path; @@ -422,7 +422,7 @@ reposition_path (ETreeSorted *ets, ETreeSortedPath *path) e_tree_model_node_changed(E_TREE_MODEL(ets), parent); e_tree_sorted_node_resorted(ets, parent); } else if (new_index < old_index) { - int i; + gint i; ets->priv->insert_count++; memmove(parent->children + new_index + 1, parent->children + new_index, sizeof (ETreePath) * (old_index - new_index)); parent->children[new_index] = path; @@ -443,7 +443,7 @@ static void regenerate_children(ETreeSorted *ets, ETreeSortedPath *path) { ETreeSortedPath **children; - int i; + gint i; children = g_new(ETreeSortedPath *, path->num_children); for (i = 0; i < path->num_children; i++) @@ -456,8 +456,8 @@ static void generate_children(ETreeSorted *ets, ETreeSortedPath *path) { ETreePath child; - int i; - int count; + gint i; + gint count; free_children(path); @@ -492,7 +492,7 @@ resort_node (ETreeSorted *ets, ETreeSortedPath *path, gboolean resort_all_childr if (needs_resort && send_signals) e_tree_model_pre_change(E_TREE_MODEL(ets)); if (needs_resort) { - int i; + gint i; d(g_print("Start sort of node %p\n", path)); if (needs_regen) regenerate_children(ets, path); @@ -511,7 +511,7 @@ resort_node (ETreeSorted *ets, ETreeSortedPath *path, gboolean resort_all_childr if (path->resort_all_children) resort_all_children = TRUE; if ((resort_all_children || path->child_needs_resort) && path->num_children >= 0) { - int i; + gint i; for (i = 0; i < path->num_children; i++) { resort_node(ets, path->children[i], resort_all_children, needs_regen, send_signals && !needs_resort); } @@ -779,7 +779,7 @@ ets_get_children (ETreeModel *etm, ETreePath node, ETreePath **nodes) n_children = path->num_children; if (nodes) { - int i; + gint i; (*nodes) = g_malloc (sizeof (ETreePath) * n_children); for (i = 0; i < n_children; i ++) { @@ -851,7 +851,7 @@ ets_has_get_node_by_id (ETreeModel *etm) } static ETreePath -ets_get_node_by_id (ETreeModel *etm, const char *save_id) +ets_get_node_by_id (ETreeModel *etm, const gchar *save_id) { ETreeSorted *ets = E_TREE_SORTED(etm); ETreePath node; @@ -870,8 +870,8 @@ ets_has_change_pending (ETreeModel *etm) } -static void * -ets_value_at (ETreeModel *etm, ETreePath node, int col) +static gpointer +ets_value_at (ETreeModel *etm, ETreePath node, gint col) { ETreeSorted *ets = E_TREE_SORTED(etm); ETreeSortedPath *path = node; @@ -880,7 +880,7 @@ ets_value_at (ETreeModel *etm, ETreePath node, int col) } static void -ets_set_value_at (ETreeModel *etm, ETreePath node, int col, const void *val) +ets_set_value_at (ETreeModel *etm, ETreePath node, gint col, gconstpointer val) { ETreeSorted *ets = E_TREE_SORTED(etm); ETreeSortedPath *path = node; @@ -889,7 +889,7 @@ ets_set_value_at (ETreeModel *etm, ETreePath node, int col, const void *val) } static gboolean -ets_is_editable (ETreeModel *etm, ETreePath node, int col) +ets_is_editable (ETreeModel *etm, ETreePath node, gint col) { ETreeSorted *ets = E_TREE_SORTED(etm); ETreeSortedPath *path = node; @@ -899,8 +899,8 @@ ets_is_editable (ETreeModel *etm, ETreePath node, int col) /* The default for ets_duplicate_value is to return the raw value. */ -static void * -ets_duplicate_value (ETreeModel *etm, int col, const void *value) +static gpointer +ets_duplicate_value (ETreeModel *etm, gint col, gconstpointer value) { ETreeSorted *ets = E_TREE_SORTED(etm); @@ -908,15 +908,15 @@ ets_duplicate_value (ETreeModel *etm, int col, const void *value) } static void -ets_free_value (ETreeModel *etm, int col, void *value) +ets_free_value (ETreeModel *etm, gint col, gpointer value) { ETreeSorted *ets = E_TREE_SORTED(etm); e_tree_model_free_value (ets->priv->source, col, value); } -static void * -ets_initialize_value (ETreeModel *etm, int col) +static gpointer +ets_initialize_value (ETreeModel *etm, gint col) { ETreeSorted *ets = E_TREE_SORTED(etm); @@ -924,15 +924,15 @@ ets_initialize_value (ETreeModel *etm, int col) } static gboolean -ets_value_is_empty (ETreeModel *etm, int col, const void *value) +ets_value_is_empty (ETreeModel *etm, gint col, gconstpointer value) { ETreeSorted *ets = E_TREE_SORTED(etm); return e_tree_model_value_is_empty (ets->priv->source, col, value); } -static char * -ets_value_to_string (ETreeModel *etm, int col, const void *value) +static gchar * +ets_value_to_string (ETreeModel *etm, gint col, gconstpointer value) { ETreeSorted *ets = E_TREE_SORTED(etm); @@ -999,7 +999,7 @@ ets_proxy_node_data_changed (ETreeModel *etm, ETreePath node, ETreeSorted *ets) } static void -ets_proxy_node_col_changed (ETreeModel *etm, ETreePath node, int col, ETreeSorted *ets) +ets_proxy_node_col_changed (ETreeModel *etm, ETreePath node, gint col, ETreeSorted *ets) { ETreeSortedPath *path = find_path(ets, node); @@ -1021,10 +1021,10 @@ ets_proxy_node_inserted (ETreeModel *etm, ETreePath parent, ETreePath child, ETr ETreeSortedPath *parent_path = find_path(ets, parent); if (parent_path && parent_path->num_children != -1) { - int i; - int j; + gint i; + gint j; ETreeSortedPath *path; - int position = parent_path->num_children; + gint position = parent_path->num_children; ETreePath counter; for (counter = e_tree_model_node_get_next(etm, child); @@ -1084,7 +1084,7 @@ ets_proxy_node_inserted (ETreeModel *etm, ETreePath parent, ETreePath child, ETr } static void -ets_proxy_node_removed (ETreeModel *etm, ETreePath parent, ETreePath child, int old_position, ETreeSorted *ets) +ets_proxy_node_removed (ETreeModel *etm, ETreePath parent, ETreePath child, gint old_position, ETreeSorted *ets) { ETreeSortedPath *parent_path = find_path(ets, parent); ETreeSortedPath *path; @@ -1098,7 +1098,7 @@ ets_proxy_node_removed (ETreeModel *etm, ETreePath parent, ETreePath child, int ets->priv->last_access = NULL; if (path && parent_path && parent_path->num_children != -1) { - int i; + gint i; for (i = 0; i < parent_path->num_children; i++) { if (parent_path->children[i]->orig_position > old_position) parent_path->children[i]->orig_position --; @@ -1313,7 +1313,7 @@ e_tree_sorted_model_to_view_path (ETreeSorted *ets, return find_or_create_path(ets, model_path); } -int +gint e_tree_sorted_orig_position (ETreeSorted *ets, ETreePath path) { @@ -1321,7 +1321,7 @@ e_tree_sorted_orig_position (ETreeSorted *ets, return sorted_path->orig_position; } -int +gint e_tree_sorted_node_num_children (ETreeSorted *ets, ETreePath path) { diff --git a/widgets/table/e-tree-sorted.h b/widgets/table/e-tree-sorted.h index 1e286b7e75..45adbef1fb 100644 --- a/widgets/table/e-tree-sorted.h +++ b/widgets/table/e-tree-sorted.h @@ -69,9 +69,9 @@ ETreePath e_tree_sorted_view_to_model_path (ETreeSorted *ets, ETreePath view_path); ETreePath e_tree_sorted_model_to_view_path (ETreeSorted *ets, ETreePath model_path); -int e_tree_sorted_orig_position (ETreeSorted *ets, +gint e_tree_sorted_orig_position (ETreeSorted *ets, ETreePath path); -int e_tree_sorted_node_num_children (ETreeSorted *ets, +gint e_tree_sorted_node_num_children (ETreeSorted *ets, ETreePath path); void e_tree_sorted_node_resorted (ETreeSorted *tree_model, diff --git a/widgets/table/e-tree-table-adapter.c b/widgets/table/e-tree-table-adapter.c index 7cfeab33ed..2018ea59bb 100644 --- a/widgets/table/e-tree-table-adapter.c +++ b/widgets/table/e-tree-table-adapter.c @@ -60,8 +60,8 @@ struct ETreeTableAdapterPriv { ETableSortInfo *sort_info; ETableHeader *header; - int n_map; - int n_vals_allocated; + gint n_map; + gint n_vals_allocated; node_t **map_table; GHashTable *nodes; GNode *root; @@ -69,22 +69,22 @@ struct ETreeTableAdapterPriv { guint root_visible : 1; guint remap_needed : 1; - int last_access; + gint last_access; - int pre_change_id; - int no_change_id; + gint pre_change_id; + gint no_change_id; int rebuilt_id; - int node_changed_id; - int node_data_changed_id; - int node_col_changed_id; - int node_inserted_id; - int node_removed_id; - int node_request_collapse_id; - int sort_info_changed_id; + gint node_changed_id; + gint node_data_changed_id; + gint node_col_changed_id; + gint node_inserted_id; + gint node_removed_id; + gint node_request_collapse_id; + gint sort_info_changed_id; guint resort_idle_id; - int force_expanded_state; /* use this instead of model's default if not 0; <0 ... collapse, >0 ... expand */ + gint force_expanded_state; /* use this instead of model's default if not 0; <0 ... collapse, >0 ... expand */ }; static void etta_sort_info_changed (ETableSortInfo *sort_info, ETreeTableAdapter *etta); @@ -103,7 +103,7 @@ lookup_gnode(ETreeTableAdapter *etta, ETreePath path) } static void -resize_map(ETreeTableAdapter *etta, int size) +resize_map(ETreeTableAdapter *etta, gint size) { if (size > etta->priv->n_vals_allocated) { etta->priv->n_vals_allocated = MAX(etta->priv->n_vals_allocated + INCREMENT_AMOUNT, size); @@ -114,7 +114,7 @@ resize_map(ETreeTableAdapter *etta, int size) } static void -move_map_elements(ETreeTableAdapter *etta, int to, int from, int count) +move_map_elements(ETreeTableAdapter *etta, gint to, gint from, gint count) { if (count <= 0 || from >= etta->priv->n_map) return; @@ -140,7 +140,7 @@ fill_map(ETreeTableAdapter *etta, gint index, GNode *gnode) static void remap_indices(ETreeTableAdapter *etta) { - int i; + gint i; for (i = 0; i < etta->priv->n_map; i++) etta->priv->map_table[i]->index = i; etta->priv->remap_needed = FALSE; @@ -163,7 +163,7 @@ resort_node(ETreeTableAdapter *etta, GNode *gnode, gboolean recurse) node_t *node = (node_t *)gnode->data; ETreePath *paths, path; GNode *prev, *curr; - int i, count; + gint i, count; gboolean sort_needed; if (node->num_visible_children == 0) @@ -222,7 +222,7 @@ get_row(ETreeTableAdapter *etta, ETreePath path) } static ETreePath -get_path (ETreeTableAdapter *etta, int row) +get_path (ETreeTableAdapter *etta, gint row) { if (row == -1 && etta->priv->n_map > 0) row = etta->priv->n_map - 1; @@ -263,7 +263,7 @@ static int delete_children(ETreeTableAdapter *etta, GNode *gnode) { node_t *node = (node_t *)gnode->data; - int to_remove = node ? node->num_visible_children : 0; + gint to_remove = node ? node->num_visible_children : 0; if (to_remove == 0) return 0; @@ -280,9 +280,9 @@ delete_children(ETreeTableAdapter *etta, GNode *gnode) static void delete_node(ETreeTableAdapter *etta, ETreePath parent, ETreePath path) { - int to_remove = 1; - int parent_row = get_row(etta, parent); - int row = get_row(etta, path); + gint to_remove = 1; + gint parent_row = get_row(etta, parent); + gint row = get_row(etta, path); GNode *gnode = lookup_gnode(etta, path); GNode *parent_gnode = lookup_gnode(etta, parent); @@ -338,8 +338,8 @@ static gint insert_children(ETreeTableAdapter *etta, GNode *gnode) { ETreePath path, tmp; - int count = 0; - int pos = 0; + gint count = 0; + gint pos = 0; path = ((node_t *)gnode->data)->path; for (tmp = e_tree_model_node_get_first_child(etta->priv->source, path); @@ -361,7 +361,7 @@ generate_tree(ETreeTableAdapter *etta, ETreePath path) { GNode *gnode; node_t *node; - int size; + gint size; e_table_model_pre_change(E_TABLE_MODEL(etta)); @@ -391,7 +391,7 @@ insert_node(ETreeTableAdapter *etta, ETreePath parent, ETreePath path) GNode *gnode, *parent_gnode; node_t *node, *parent_node; gboolean expandable; - int size, row; + gint size, row; e_table_model_pre_change(E_TABLE_MODEL(etta)); @@ -583,7 +583,7 @@ etta_has_save_id (ETableModel *etm) } static gchar * -etta_get_save_id (ETableModel *etm, int row) +etta_get_save_id (ETableModel *etm, gint row) { ETreeTableAdapter *etta = (ETreeTableAdapter *)etm; @@ -607,8 +607,8 @@ etta_row_count (ETableModel *etm) return etta->priv->n_map; } -static void * -etta_value_at (ETableModel *etm, int col, int row) +static gpointer +etta_value_at (ETableModel *etm, gint col, gint row) { ETreeTableAdapter *etta = (ETreeTableAdapter *)etm; @@ -627,7 +627,7 @@ etta_value_at (ETableModel *etm, int col, int row) } static void -etta_set_value_at (ETableModel *etm, int col, int row, const void *val) +etta_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) { ETreeTableAdapter *etta = (ETreeTableAdapter *)etm; @@ -635,7 +635,7 @@ etta_set_value_at (ETableModel *etm, int col, int row, const void *val) } static gboolean -etta_is_cell_editable (ETableModel *etm, int col, int row) +etta_is_cell_editable (ETableModel *etm, gint col, gint row) { ETreeTableAdapter *etta = (ETreeTableAdapter *)etm; @@ -643,12 +643,12 @@ etta_is_cell_editable (ETableModel *etm, int col, int row) } static void -etta_append_row (ETableModel *etm, ETableModel *source, int row) +etta_append_row (ETableModel *etm, ETableModel *source, gint row) { } -static void * -etta_duplicate_value (ETableModel *etm, int col, const void *value) +static gpointer +etta_duplicate_value (ETableModel *etm, gint col, gconstpointer value) { ETreeTableAdapter *etta = (ETreeTableAdapter *)etm; @@ -656,15 +656,15 @@ etta_duplicate_value (ETableModel *etm, int col, const void *value) } static void -etta_free_value (ETableModel *etm, int col, void *value) +etta_free_value (ETableModel *etm, gint col, gpointer value) { ETreeTableAdapter *etta = (ETreeTableAdapter *)etm; e_tree_model_free_value (etta->priv->source, col, value); } -static void * -etta_initialize_value (ETableModel *etm, int col) +static gpointer +etta_initialize_value (ETableModel *etm, gint col) { ETreeTableAdapter *etta = (ETreeTableAdapter *)etm; @@ -672,15 +672,15 @@ etta_initialize_value (ETableModel *etm, int col) } static gboolean -etta_value_is_empty (ETableModel *etm, int col, const void *value) +etta_value_is_empty (ETableModel *etm, gint col, gconstpointer value) { ETreeTableAdapter *etta = (ETreeTableAdapter *)etm; return e_tree_model_value_is_empty (etta->priv->source, col, value); } -static char * -etta_value_to_string (ETableModel *etm, int col, const void *value) +static gchar * +etta_value_to_string (ETableModel *etm, gint col, gconstpointer value) { ETreeTableAdapter *etta = (ETreeTableAdapter *)etm; @@ -793,7 +793,7 @@ etta_proxy_node_changed (ETreeModel *etm, ETreePath path, ETreeTableAdapter *ett static void etta_proxy_node_data_changed (ETreeModel *etm, ETreePath path, ETreeTableAdapter *etta) { - int row = get_row(etta, path); + gint row = get_row(etta, path); if (row == -1) { e_table_model_no_change(E_TABLE_MODEL(etta)); @@ -804,9 +804,9 @@ etta_proxy_node_data_changed (ETreeModel *etm, ETreePath path, ETreeTableAdapter } static void -etta_proxy_node_col_changed (ETreeModel *etm, ETreePath path, int col, ETreeTableAdapter *etta) +etta_proxy_node_col_changed (ETreeModel *etm, ETreePath path, gint col, ETreeTableAdapter *etta) { - int row = get_row(etta, path); + gint row = get_row(etta, path); if (row == -1) { e_table_model_no_change(E_TABLE_MODEL(etta)); @@ -828,7 +828,7 @@ etta_proxy_node_inserted (ETreeModel *etm, ETreePath parent, ETreePath child, ET } static void -etta_proxy_node_removed (ETreeModel *etm, ETreePath parent, ETreePath child, int old_position, ETreeTableAdapter *etta) +etta_proxy_node_removed (ETreeModel *etm, ETreePath parent, ETreePath child, gint old_position, ETreeTableAdapter *etta) { delete_node(etta, parent, child); e_table_model_changed(E_TABLE_MODEL(etta)); @@ -926,8 +926,8 @@ save_expanded_state_func (gpointer keyp, gpointer value, gpointer data) if (node->expanded != tar->expanded_default) { gchar *save_id = e_tree_model_get_save_id(tar->model, path); - xmlnode = xmlNewChild (tar->root, NULL, (const unsigned char *)"node", NULL); - e_xml_set_string_prop_by_name(xmlnode, (const unsigned char *)"id", save_id); + xmlnode = xmlNewChild (tar->root, NULL, (const guchar *)"node", NULL); + e_xml_set_string_prop_by_name(xmlnode, (const guchar *)"id", save_id); g_free(save_id); } } @@ -941,16 +941,16 @@ e_tree_table_adapter_save_expanded_state_xml (ETreeTableAdapter *etta) g_return_val_if_fail (etta != NULL, NULL); - doc = xmlNewDoc ((const unsigned char *)"1.0"); - root = xmlNewDocNode (doc, NULL, (const unsigned char *)"expanded_state", NULL); + doc = xmlNewDoc ((const guchar *)"1.0"); + root = xmlNewDocNode (doc, NULL, (const guchar *)"expanded_state", NULL); xmlDocSetRootElement (doc, root); tar.model = etta->priv->source; tar.root = root; tar.expanded_default = e_tree_model_get_expanded_default(etta->priv->source); - e_xml_set_integer_prop_by_name (root, (const unsigned char *)"vers", 2); - e_xml_set_bool_prop_by_name (root, (const unsigned char *)"default", tar.expanded_default); + e_xml_set_integer_prop_by_name (root, (const guchar *)"vers", 2); + e_xml_set_bool_prop_by_name (root, (const guchar *)"default", tar.expanded_default); g_hash_table_foreach (etta->priv->nodes, save_expanded_state_func, &tar); @@ -958,7 +958,7 @@ e_tree_table_adapter_save_expanded_state_xml (ETreeTableAdapter *etta) } void -e_tree_table_adapter_save_expanded_state (ETreeTableAdapter *etta, const char *filename) +e_tree_table_adapter_save_expanded_state (ETreeTableAdapter *etta, const gchar *filename) { xmlDoc *doc; @@ -972,11 +972,11 @@ e_tree_table_adapter_save_expanded_state (ETreeTableAdapter *etta, const char *f } static xmlDoc * -open_file (ETreeTableAdapter *etta, const char *filename) +open_file (ETreeTableAdapter *etta, const gchar *filename) { xmlDoc *doc; xmlNode *root; - int vers; + gint vers; gboolean model_default, saved_default; if (!g_file_test (filename, G_FILE_TEST_EXISTS)) @@ -996,18 +996,18 @@ open_file (ETreeTableAdapter *etta, const char *filename) return NULL; root = xmlDocGetRootElement (doc); - if (root == NULL || strcmp ((char *)root->name, "expanded_state")) { + if (root == NULL || strcmp ((gchar *)root->name, "expanded_state")) { xmlFreeDoc (doc); return NULL; } - vers = e_xml_get_integer_prop_by_name_with_default (root, (const unsigned char *)"vers", 0); + vers = e_xml_get_integer_prop_by_name_with_default (root, (const guchar *)"vers", 0); if (vers > 2) { xmlFreeDoc (doc); return NULL; } model_default = e_tree_model_get_expanded_default (etta->priv->source); - saved_default = e_xml_get_bool_prop_by_name_with_default (root, (const unsigned char *)"default", !model_default); + saved_default = e_xml_get_bool_prop_by_name_with_default (root, (const guchar *)"default", !model_default); if (saved_default != model_default) { xmlFreeDoc (doc); return NULL; @@ -1018,7 +1018,7 @@ open_file (ETreeTableAdapter *etta, const char *filename) /* state: <0 ... collapse; 0 ... use default; >0 ... expand */ void -e_tree_table_adapter_force_expanded_state (ETreeTableAdapter *etta, int state) +e_tree_table_adapter_force_expanded_state (ETreeTableAdapter *etta, gint state) { g_return_if_fail (etta != NULL); @@ -1041,10 +1041,10 @@ e_tree_table_adapter_load_expanded_state_xml (ETreeTableAdapter *etta, xmlDoc *d model_default = e_tree_model_get_expanded_default(etta->priv->source); - if (!strcmp ((char *)root->name, "expanded_state")) { - char *state; + if (!strcmp ((gchar *)root->name, "expanded_state")) { + gchar *state; - state = e_xml_get_string_prop_by_name_with_default (root, (const unsigned char *)"default", ""); + state = e_xml_get_string_prop_by_name_with_default (root, (const guchar *)"default", ""); if (state[0] == 't') file_default = TRUE; @@ -1062,15 +1062,15 @@ e_tree_table_adapter_load_expanded_state_xml (ETreeTableAdapter *etta, xmlDoc *d } for (child = root->xmlChildrenNode; child; child = child->next) { - char *id; + gchar *id; ETreePath path; - if (strcmp ((char *)child->name, "node")) { + if (strcmp ((gchar *)child->name, "node")) { d(g_warning ("unknown node '%s' in %s", child->name, filename)); continue; } - id = e_xml_get_string_prop_by_name_with_default (child, (const unsigned char *)"id", ""); + id = e_xml_get_string_prop_by_name_with_default (child, (const guchar *)"id", ""); if (!strcmp(id, "")) { g_free(id); @@ -1088,7 +1088,7 @@ e_tree_table_adapter_load_expanded_state_xml (ETreeTableAdapter *etta, xmlDoc *d } void -e_tree_table_adapter_load_expanded_state (ETreeTableAdapter *etta, const char *filename) +e_tree_table_adapter_load_expanded_state (ETreeTableAdapter *etta, const gchar *filename) { xmlDoc *doc; @@ -1106,7 +1106,7 @@ e_tree_table_adapter_load_expanded_state (ETreeTableAdapter *etta, const char *f void e_tree_table_adapter_root_node_set_visible (ETreeTableAdapter *etta, gboolean visible) { - int size; + gint size; g_return_if_fail (etta != NULL); @@ -1133,7 +1133,7 @@ e_tree_table_adapter_node_set_expanded (ETreeTableAdapter *etta, ETreePath path, { GNode *gnode = lookup_gnode(etta, path); node_t *node; - int row; + gint row; if (!expanded && (!gnode || (e_tree_model_node_is_root (etta->priv->source, path) && !etta->priv->root_visible))) return; @@ -1163,7 +1163,7 @@ e_tree_table_adapter_node_set_expanded (ETreeTableAdapter *etta, ETreePath path, if (expanded) { - int num_children = insert_children(etta, gnode); + gint num_children = insert_children(etta, gnode); update_child_counts(gnode, num_children); if (etta->priv->sort_info && e_table_sort_info_sorting_get_count(etta->priv->sort_info) > 0) resort_node(etta, gnode, TRUE); @@ -1175,7 +1175,7 @@ e_tree_table_adapter_node_set_expanded (ETreeTableAdapter *etta, ETreePath path, } else e_table_model_no_change(E_TABLE_MODEL(etta)); } else { - int num_children = delete_children(etta, gnode); + gint num_children = delete_children(etta, gnode); if (num_children == 0) { e_table_model_no_change(E_TABLE_MODEL(etta)); return; @@ -1202,12 +1202,12 @@ e_tree_table_adapter_node_set_expanded_recurse (ETreeTableAdapter *etta, ETreePa } ETreePath -e_tree_table_adapter_node_at_row (ETreeTableAdapter *etta, int row) +e_tree_table_adapter_node_at_row (ETreeTableAdapter *etta, gint row) { return get_path(etta, row); } -int +gint e_tree_table_adapter_row_of_node (ETreeTableAdapter *etta, ETreePath path) { return get_row(etta, path); diff --git a/widgets/table/e-tree-table-adapter.h b/widgets/table/e-tree-table-adapter.h index 13ab5787c0..6a0f67bca8 100644 --- a/widgets/table/e-tree-table-adapter.h +++ b/widgets/table/e-tree-table-adapter.h @@ -72,12 +72,12 @@ void e_tree_table_adapter_node_set_expanded_recurse (ETreeTableAdapter ETreePath path, gboolean expanded); void e_tree_table_adapter_force_expanded_state (ETreeTableAdapter *etta, - int state); + gint state); void e_tree_table_adapter_root_node_set_visible (ETreeTableAdapter *etta, gboolean visible); ETreePath e_tree_table_adapter_node_at_row (ETreeTableAdapter *etta, - int row); -int e_tree_table_adapter_row_of_node (ETreeTableAdapter *etta, + gint row); +gint e_tree_table_adapter_row_of_node (ETreeTableAdapter *etta, ETreePath path); gboolean e_tree_table_adapter_root_node_is_visible (ETreeTableAdapter *etta); @@ -85,9 +85,9 @@ void e_tree_table_adapter_show_node (ETreeTableAdapter ETreePath path); void e_tree_table_adapter_save_expanded_state (ETreeTableAdapter *etta, - const char *filename); + const gchar *filename); void e_tree_table_adapter_load_expanded_state (ETreeTableAdapter *etta, - const char *filename); + const gchar *filename); xmlDoc *e_tree_table_adapter_save_expanded_state_xml (ETreeTableAdapter *etta); void e_tree_table_adapter_load_expanded_state_xml (ETreeTableAdapter *etta, xmlDoc *doc); diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c index 2ec7c8ba09..7b76e9b445 100644 --- a/widgets/table/e-tree.c +++ b/widgets/table/e-tree.c @@ -130,14 +130,14 @@ struct ETreePriv { guint search_search_id; guint search_accept_id; - int reflow_idle_id; - int scroll_idle_id; - int hover_idle_id; + gint reflow_idle_id; + gint scroll_idle_id; + gint hover_idle_id; - int table_model_change_id; - int table_row_change_id; - int table_cell_change_id; - int table_rows_delete_id; + gint table_model_change_id; + gint table_row_change_id; + gint table_cell_change_id; + gint table_rows_delete_id; GnomeCanvasItem *info_text; guint info_text_resize_id; @@ -173,22 +173,22 @@ struct ETreePriv { ECursorMode cursor_mode; - int drop_row; + gint drop_row; ETreePath drop_path; - int drop_col; + gint drop_col; GnomeCanvasItem *drop_highlight; - int last_drop_x; - int last_drop_y; - int last_drop_time; + gint last_drop_x; + gint last_drop_y; + gint last_drop_time; GdkDragContext *last_drop_context; - int hover_x; - int hover_y; + gint hover_x; + gint hover_y; - int drag_row; + gint drag_row; ETreePath drag_path; - int drag_col; + gint drag_col; ETreeDragSourceSite *site; GList *expanded_list; @@ -243,7 +243,7 @@ static void et_drag_data_received(GtkWidget *widget, static void scroll_off (ETree *et); static void scroll_on (ETree *et, guint scroll_direction); static void hover_off (ETree *et); -static void hover_on (ETree *et, int x, int y); +static void hover_on (ETree *et, gint x, gint y); static void context_destroyed (gpointer data, GObject *ctx); static void @@ -451,14 +451,14 @@ et_unrealize (GtkWidget *widget) typedef struct { ETree *et; - char *string; + gchar *string; } SearchSearchStruct; static gboolean search_search_callback (ETreeModel *model, ETreePath path, gpointer data) { SearchSearchStruct *cb_data = data; - const void *value; + gconstpointer value; ETableCol *col = current_search_col (cb_data->et); value = e_tree_model_value_at (model, path, cb_data->et->priv->current_search_col->col_idx); @@ -467,7 +467,7 @@ search_search_callback (ETreeModel *model, ETreePath path, gpointer data) } static gboolean -et_search_search (ETableSearch *search, char *string, ETableSearchFlags flags, ETree *et) +et_search_search (ETableSearch *search, gchar *string, ETableSearchFlags flags, ETree *et) { ETreePath cursor; ETreePath found; @@ -483,7 +483,7 @@ et_search_search (ETableSearch *search, char *string, ETableSearchFlags flags, E cursor = e_tree_get_cursor (et); if (cursor && (flags & E_TABLE_SEARCH_FLAGS_CHECK_CURSOR_FIRST)) { - const void *value; + gconstpointer value; value = e_tree_model_value_at (et->priv->model, cursor, col->col_idx); @@ -497,7 +497,7 @@ et_search_search (ETableSearch *search, char *string, ETableSearchFlags flags, E found = e_tree_model_node_find (et->priv->model, NULL, cursor, E_TREE_FIND_NEXT_FORWARD, search_search_callback, &cb_data); if (found && found != cursor) { - int model_row; + gint model_row; e_tree_table_adapter_show_node (et->priv->etta, found); model_row = e_tree_table_adapter_row_of_node (et->priv->etta, found); @@ -507,7 +507,7 @@ et_search_search (ETableSearch *search, char *string, ETableSearchFlags flags, E e_selection_model_select_as_key_press(E_SELECTION_MODEL (et->priv->selection), model_row, col->col_idx, GDK_CONTROL_MASK); return TRUE; } else if (cursor && !(flags & E_TABLE_SEARCH_FLAGS_CHECK_CURSOR_FIRST)) { - const void *value; + gconstpointer value; value = e_tree_model_value_at (et->priv->model, cursor, col->col_idx); @@ -520,7 +520,7 @@ static void et_search_accept (ETableSearch *search, ETree *et) { ETableCol *col = current_search_col (et); - int cursor; + gint cursor; if (col == NULL) return; @@ -698,7 +698,7 @@ header_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, ETree *e_t static void e_tree_setup_header (ETree *e_tree) { - char *pointer; + gchar *pointer; e_tree->priv->header_canvas = GNOME_CANVAS (e_canvas_new ()); GTK_WIDGET_UNSET_FLAGS (e_tree->priv->header_canvas, GTK_CAN_FOCUS); @@ -785,8 +785,8 @@ tree_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, x = y = w = h = 0; if (path) { - int row = e_tree_row_of_node(e_tree, path); - int col = 0; + gint row = e_tree_row_of_node(e_tree, path); + gint col = 0; if (row >= 0) e_table_item_get_cell_geometry (E_TABLE_ITEM (e_tree->priv->item), @@ -805,7 +805,7 @@ tree_canvas_reflow (GnomeCanvas *canvas, ETree *e_tree) } static void -item_cursor_change (ETableItem *eti, int row, ETree *et) +item_cursor_change (ETableItem *eti, gint row, ETree *et) { ETreePath path = e_tree_table_adapter_node_at_row(et->priv->etta, row); g_signal_emit (et, @@ -814,7 +814,7 @@ item_cursor_change (ETableItem *eti, int row, ETree *et) } static void -item_cursor_activated (ETableItem *eti, int row, ETree *et) +item_cursor_activated (ETableItem *eti, gint row, ETree *et) { ETreePath path = e_tree_table_adapter_node_at_row(et->priv->etta, row); g_signal_emit (et, @@ -824,7 +824,7 @@ item_cursor_activated (ETableItem *eti, int row, ETree *et) } static void -item_double_click (ETableItem *eti, int row, int col, GdkEvent *event, ETree *et) +item_double_click (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et) { ETreePath path = e_tree_table_adapter_node_at_row(et->priv->etta, row); g_signal_emit (et, @@ -833,9 +833,9 @@ item_double_click (ETableItem *eti, int row, int col, GdkEvent *event, ETree *et } static gint -item_right_click (ETableItem *eti, int row, int col, GdkEvent *event, ETree *et) +item_right_click (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et) { - int return_val = 0; + gint return_val = 0; ETreePath path = e_tree_table_adapter_node_at_row(et->priv->etta, row); g_signal_emit (et, et_signals [RIGHT_CLICK], 0, @@ -844,9 +844,9 @@ item_right_click (ETableItem *eti, int row, int col, GdkEvent *event, ETree *et) } static gint -item_click (ETableItem *eti, int row, int col, GdkEvent *event, ETree *et) +item_click (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et) { - int return_val = 0; + gint return_val = 0; ETreePath path = e_tree_table_adapter_node_at_row(et->priv->etta, row); g_signal_emit (et, et_signals [CLICK], 0, @@ -855,12 +855,12 @@ item_click (ETableItem *eti, int row, int col, GdkEvent *event, ETree *et) } static gint -item_key_press (ETableItem *eti, int row, int col, GdkEvent *event, ETree *et) +item_key_press (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et) { - int return_val = 0; + gint return_val = 0; GdkEventKey *key = (GdkEventKey *) event; ETreePath path; - int y, row_local, col_local; + gint y, row_local, col_local; GtkAdjustment *vadj; switch (key->keyval) { @@ -945,7 +945,7 @@ item_key_press (ETableItem *eti, int row, int col, GdkEvent *event, ETree *et) } static gint -item_start_drag (ETableItem *eti, int row, int col, GdkEvent *event, ETree *et) +item_start_drag (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et) { ETreePath path; gint return_val = 0; @@ -967,7 +967,7 @@ et_selection_model_selection_changed (ETableSelectionModel *etsm, ETree *et) } static void -et_selection_model_selection_row_changed (ETableSelectionModel *etsm, int row, ETree *et) +et_selection_model_selection_row_changed (ETableSelectionModel *etsm, gint row, ETree *et) { g_signal_emit (et, et_signals [SELECTION_CHANGE], 0); @@ -1018,7 +1018,7 @@ et_canvas_style_set (GtkWidget *widget, GtkStyle *prev_style) static gint white_item_event (GnomeCanvasItem *white_item, GdkEvent *event, ETree *e_tree) { - int return_val = 0; + gint return_val = 0; g_signal_emit (e_tree, et_signals [WHITE_SPACE_EVENT], 0, event, &return_val); @@ -1252,8 +1252,8 @@ ETableState * e_tree_get_state_object (ETree *e_tree) { ETableState *state; - int full_col_count; - int i, j; + gint full_col_count; + gint i, j; state = e_table_state_new(); state->sort_info = e_tree->priv->sort_info; @@ -1342,19 +1342,19 @@ et_table_model_changed (ETableModel *model, ETree *et) } static void -et_table_row_changed (ETableModel *table_model, int row, ETree *et) +et_table_row_changed (ETableModel *table_model, gint row, ETree *et) { et_table_model_changed (table_model, et); } static void -et_table_cell_changed (ETableModel *table_model, int view_col, int row, ETree *et) +et_table_cell_changed (ETableModel *table_model, gint view_col, gint row, ETree *et) { et_table_model_changed (table_model, et); } static void -et_table_rows_deleted (ETableModel *table_model, int row, int count, ETree *et) +et_table_rows_deleted (ETableModel *table_model, gint row, gint count, ETree *et) { ETreePath * node, * prev_node; @@ -1400,7 +1400,7 @@ static gboolean et_real_construct (ETree *e_tree, ETreeModel *etm, ETableExtras *ete, ETableSpecification *specification, ETableState *state) { - int row = 0; + gint row = 0; if (ete) g_object_ref(ete); @@ -1494,7 +1494,7 @@ et_real_construct (ETree *e_tree, ETreeModel *etm, ETableExtras *ete, **/ gboolean e_tree_construct (ETree *e_tree, ETreeModel *etm, ETableExtras *ete, - const char *spec_str, const char *state_str) + const gchar *spec_str, const gchar *state_str) { ETableSpecification *specification; ETableState *state; @@ -1553,7 +1553,7 @@ e_tree_construct (ETree *e_tree, ETreeModel *etm, ETableExtras *ete, **/ gboolean e_tree_construct_from_spec_file (ETree *e_tree, ETreeModel *etm, ETableExtras *ete, - const char *spec_fn, const char *state_fn) + const gchar *spec_fn, const gchar *state_fn) { ETableSpecification *specification; ETableState *state; @@ -1622,7 +1622,7 @@ e_tree_construct_from_spec_file (ETree *e_tree, ETreeModel *etm, ETableExtras *e * The newly created #ETree or %NULL if there's an error. **/ GtkWidget * -e_tree_new (ETreeModel *etm, ETableExtras *ete, const char *spec, const char *state) +e_tree_new (ETreeModel *etm, ETableExtras *ete, const gchar *spec, const gchar *state) { ETree *e_tree; @@ -1662,7 +1662,7 @@ e_tree_new (ETreeModel *etm, ETableExtras *ete, const char *spec, const char *st * The newly created #ETree or %NULL if there's an error. **/ GtkWidget * -e_tree_new_from_spec_file (ETreeModel *etm, ETableExtras *ete, const char *spec_fn, const char *state_fn) +e_tree_new_from_spec_file (ETreeModel *etm, ETableExtras *ete, const gchar *spec_fn, const gchar *state_fn) { ETree *e_tree; @@ -1685,7 +1685,7 @@ void e_tree_set_cursor (ETree *e_tree, ETreePath path) { #ifndef E_TREE_USE_TREE_SELECTION - int row; + gint row; #endif g_return_if_fail(e_tree != NULL); g_return_if_fail(E_IS_TREE(e_tree)); @@ -1712,7 +1712,7 @@ e_tree_get_cursor (ETree *e_tree) #ifdef E_TREE_USE_TREE_SELECTION return e_tree_selection_model_get_cursor (E_TREE_SELECTION_MODEL(e_tree->priv->selection)); #else - int row; + gint row; ETreePath path; g_return_val_if_fail(e_tree != NULL, NULL); g_return_val_if_fail(E_IS_TREE(e_tree), NULL); @@ -1825,7 +1825,7 @@ et_get_property (GObject *object, } typedef struct { - char *arg; + gchar *arg; gboolean setting; } bool_closure; @@ -1926,7 +1926,7 @@ e_tree_get_next_row (ETree *e_tree, g_return_val_if_fail(E_IS_TREE(e_tree), -1); if (e_tree->priv->sorter) { - int i; + gint i; i = e_sorter_model_to_sorted(E_SORTER (e_tree->priv->sorter), model_row); i++; if (i < e_table_model_row_count(E_TABLE_MODEL(e_tree->priv->etta))) { @@ -1948,7 +1948,7 @@ e_tree_get_prev_row (ETree *e_tree, g_return_val_if_fail(E_IS_TREE(e_tree), -1); if (e_tree->priv->sorter) { - int i; + gint i; i = e_sorter_model_to_sorted(E_SORTER (e_tree->priv->sorter), model_row); i--; if (i >= 0) @@ -2022,7 +2022,7 @@ e_tree_root_node_set_visible (ETree *et, gboolean visible) } ETreePath -e_tree_node_at_row (ETree *et, int row) +e_tree_node_at_row (ETree *et, gint row) { ETreePath path; @@ -2031,7 +2031,7 @@ e_tree_node_at_row (ETree *et, int row) return path; } -int +gint e_tree_row_of_node (ETree *et, ETreePath path) { return e_tree_table_adapter_row_of_node (et->priv->etta, path); @@ -2053,7 +2053,7 @@ e_tree_show_node (ETree *et, ETreePath path) } void -e_tree_save_expanded_state (ETree *et, char *filename) +e_tree_save_expanded_state (ETree *et, gchar *filename) { g_return_if_fail (et != NULL); g_return_if_fail (E_IS_TREE(et)); @@ -2062,7 +2062,7 @@ e_tree_save_expanded_state (ETree *et, char *filename) } void -e_tree_load_expanded_state (ETree *et, char *filename) +e_tree_load_expanded_state (ETree *et, gchar *filename) { e_tree_table_adapter_load_expanded_state (et->priv->etta, filename); } @@ -2090,7 +2090,7 @@ e_tree_load_expanded_state_xml (ETree *et, xmlDoc *doc) when using this, be sure to reset to 0 once no forcing is required anymore, aka the build of the tree is done */ void -e_tree_force_expanded_state (ETree *et, int state) +e_tree_force_expanded_state (ETree *et, gint state) { e_tree_table_adapter_force_expanded_state (et->priv->etta, state); } @@ -2321,8 +2321,8 @@ struct _GtkDragSourceInfo void e_tree_drag_get_data (ETree *tree, - int row, - int col, + gint row, + gint col, GdkDragContext *context, GdkAtom target, guint32 time) @@ -2348,14 +2348,14 @@ e_tree_drag_get_data (ETree *tree, */ void e_tree_drag_highlight (ETree *tree, - int row, - int col) + gint row, + gint col) { g_return_if_fail(tree != NULL); g_return_if_fail(E_IS_TREE(tree)); if (row != -1) { - int x, y, width, height; + gint x, y, width, height; if (col == -1) { e_tree_get_cell_geometry (tree, row, 0, &x, &y, &width, &height); x = 0; @@ -2447,7 +2447,7 @@ e_tree_drag_dest_unset (GtkWidget *widget) /* Source side */ static gint -et_real_start_drag (ETree *tree, int row, ETreePath path, int col, GdkEvent *event) +et_real_start_drag (ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event) { GtkDragSourceInfo *info; GdkDragContext *context; @@ -2545,8 +2545,8 @@ e_tree_drag_source_unset (ETree *tree) GdkDragContext * e_tree_drag_begin (ETree *tree, - int row, - int col, + gint row, + gint col, GtkTargetList *targets, GdkDragAction actions, gint button, @@ -2582,8 +2582,8 @@ e_tree_drag_begin (ETree *tree, **/ void e_tree_get_cell_at (ETree *tree, - int x, int y, - int *row_return, int *col_return) + gint x, gint y, + gint *row_return, gint *col_return) { g_return_if_fail (tree != NULL); g_return_if_fail (E_IS_TREE (tree)); @@ -2617,9 +2617,9 @@ e_tree_get_cell_at (ETree *tree, **/ void e_tree_get_cell_geometry (ETree *tree, - int row, int col, - int *x_return, int *y_return, - int *width_return, int *height_return) + gint row, gint col, + gint *x_return, gint *y_return, + gint *width_return, gint *height_return) { g_return_if_fail (tree != NULL); g_return_if_fail (E_IS_TREE (tree)); @@ -2703,7 +2703,7 @@ do_drag_motion(ETree *et, guint time) { gboolean ret_val = FALSE; - int row, col; + gint row, col; ETreePath path; e_tree_get_cell_at (et, @@ -2744,7 +2744,7 @@ static gboolean scroll_timeout (gpointer data) { ETree *et = data; - int dx = 0, dy = 0; + gint dx = 0, dy = 0; GtkAdjustment *v, *h; double vvalue, hvalue; @@ -2803,9 +2803,9 @@ static gboolean hover_timeout (gpointer data) { ETree *et = data; - int x = et->priv->hover_x; - int y = et->priv->hover_y; - int row, col; + gint x = et->priv->hover_x; + gint y = et->priv->hover_y; + gint row, col; ETreePath path; e_tree_get_cell_at (et, @@ -2827,7 +2827,7 @@ hover_timeout (gpointer data) } static void -hover_on (ETree *et, int x, int y) +hover_on (ETree *et, gint x, gint y) { et->priv->hover_x = x; et->priv->hover_y = y; @@ -2856,7 +2856,7 @@ collapse_drag (ETree *et, ETreePath drop) } for (list = et->priv->expanded_list; list; list = list->next) { - char *save_id = list->data; + gchar *save_id = list->data; ETreePath path; path = e_tree_model_get_node_by_id (et->priv->model, save_id); @@ -2938,7 +2938,7 @@ et_drag_motion(GtkWidget *widget, guint time, ETree *et) { - int ret_val; + gint ret_val; guint direction = 0; et->priv->last_drop_x = x; @@ -2988,7 +2988,7 @@ et_drag_drop(GtkWidget *widget, ETree *et) { gboolean ret_val = FALSE; - int row, col; + gint row, col; ETreePath path; e_tree_get_cell_at(et, x, @@ -3051,7 +3051,7 @@ et_drag_data_received(GtkWidget *widget, guint time, ETree *et) { - int row, col; + gint row, col; ETreePath path; e_tree_get_cell_at(et, x, @@ -3420,7 +3420,7 @@ tree_size_allocate (GtkWidget *widget, GtkAllocation *alloc, ETree *tree) * Creates an info message in table area, or removes old. **/ void -e_tree_set_info_message (ETree *tree, const char *info_message) +e_tree_set_info_message (ETree *tree, const gchar *info_message) { g_return_if_fail (tree != NULL); g_return_if_fail (tree->priv != NULL); diff --git a/widgets/table/e-tree.h b/widgets/table/e-tree.h index 426cf9c44d..6bcc21706e 100644 --- a/widgets/table/e-tree.h +++ b/widgets/table/e-tree.h @@ -60,14 +60,14 @@ typedef struct { typedef struct { GtkTableClass parent_class; - void (*cursor_change) (ETree *et, int row, ETreePath path); - void (*cursor_activated) (ETree *et, int row, ETreePath path); + void (*cursor_change) (ETree *et, gint row, ETreePath path); + void (*cursor_activated) (ETree *et, gint row, ETreePath path); void (*selection_change) (ETree *et); - void (*double_click) (ETree *et, int row, ETreePath path, int col, GdkEvent *event); - gint (*right_click) (ETree *et, int row, ETreePath path, int col, GdkEvent *event); - gint (*click) (ETree *et, int row, ETreePath path, int col, GdkEvent *event); - gint (*key_press) (ETree *et, int row, ETreePath path, int col, GdkEvent *event); - gint (*start_drag) (ETree *et, int row, ETreePath path, int col, GdkEvent *event); + void (*double_click) (ETree *et, gint row, ETreePath path, gint col, GdkEvent *event); + gint (*right_click) (ETree *et, gint row, ETreePath path, gint col, GdkEvent *event); + gint (*click) (ETree *et, gint row, ETreePath path, gint col, GdkEvent *event); + gint (*key_press) (ETree *et, gint row, ETreePath path, gint col, GdkEvent *event); + gint (*start_drag) (ETree *et, gint row, ETreePath path, gint col, GdkEvent *event); gint (*state_change) (ETree *et); gint (*white_space_event) (ETree *et, GdkEvent *event); @@ -77,56 +77,56 @@ typedef struct { /* Source side drag signals */ void (* tree_drag_begin) (ETree *tree, - int row, + gint row, ETreePath path, - int col, + gint col, GdkDragContext *context); void (* tree_drag_end) (ETree *tree, - int row, + gint row, ETreePath path, - int col, + gint col, GdkDragContext *context); void (* tree_drag_data_get) (ETree *tree, - int row, + gint row, ETreePath path, - int col, + gint col, GdkDragContext *context, GtkSelectionData *selection_data, guint info, guint time); void (* tree_drag_data_delete) (ETree *tree, - int row, + gint row, ETreePath path, - int col, + gint col, GdkDragContext *context); /* Target side drag signals */ void (* tree_drag_leave) (ETree *tree, - int row, + gint row, ETreePath path, - int col, + gint col, GdkDragContext *context, guint time); gboolean (* tree_drag_motion) (ETree *tree, - int row, + gint row, ETreePath path, - int col, + gint col, GdkDragContext *context, gint x, gint y, guint time); gboolean (* tree_drag_drop) (ETree *tree, - int row, + gint row, ETreePath path, - int col, + gint col, GdkDragContext *context, gint x, gint y, guint time); void (* tree_drag_data_received) (ETree *tree, - int row, + gint row, ETreePath path, - int col, + gint col, GdkDragContext *context, gint x, gint y, @@ -139,23 +139,23 @@ GType e_tree_get_type (void); gboolean e_tree_construct (ETree *e_tree, ETreeModel *etm, ETableExtras *ete, - const char *spec, - const char *state); + const gchar *spec, + const gchar *state); GtkWidget *e_tree_new (ETreeModel *etm, ETableExtras *ete, - const char *spec, - const char *state); + const gchar *spec, + const gchar *state); /* Create an ETree using files. */ gboolean e_tree_construct_from_spec_file (ETree *e_tree, ETreeModel *etm, ETableExtras *ete, - const char *spec_fn, - const char *state_fn); + const gchar *spec_fn, + const gchar *state_fn); GtkWidget *e_tree_new_from_spec_file (ETreeModel *etm, ETableExtras *ete, - const char *spec_fn, - const char *state_fn); + const gchar *spec_fn, + const gchar *state_fn); /* To save the state */ gchar *e_tree_get_state (ETree *e_tree); @@ -200,17 +200,17 @@ gint e_tree_model_to_view_row (ETree *e_tree, gint e_tree_view_to_model_row (ETree *e_tree, gint view_row); void e_tree_get_cell_at (ETree *tree, - int x, - int y, - int *row_return, - int *col_return); + gint x, + gint y, + gint *row_return, + gint *col_return); void e_tree_get_cell_geometry (ETree *tree, - int row, - int col, - int *x_return, - int *y_return, - int *width_return, - int *height_return); + gint row, + gint col, + gint *x_return, + gint *y_return, + gint *width_return, + gint *height_return); /* Useful accessors */ ETreeModel * e_tree_get_model (ETree *et); @@ -220,14 +220,14 @@ ETreeTableAdapter *e_tree_get_table_adapter (ETree *et); /* Drag & drop stuff. */ /* Target */ void e_tree_drag_get_data (ETree *tree, - int row, - int col, + gint row, + gint col, GdkDragContext *context, GdkAtom target, guint32 time); void e_tree_drag_highlight (ETree *tree, - int row, - int col); /* col == -1 to highlight entire row. */ + gint row, + gint col); /* col == -1 to highlight entire row. */ void e_tree_drag_unhighlight (ETree *tree); void e_tree_drag_dest_set (ETree *tree, GtkDestDefaults flags, @@ -256,8 +256,8 @@ void e_tree_drag_source_unset (ETree *tree); * as a GtkTargetList */ GdkDragContext *e_tree_drag_begin (ETree *tree, - int row, - int col, + gint row, + gint col, GtkTargetList *targets, GdkDragAction actions, gint button, @@ -275,23 +275,23 @@ void e_tree_node_set_expanded_recurse (ETree *et, void e_tree_root_node_set_visible (ETree *et, gboolean visible); ETreePath e_tree_node_at_row (ETree *et, - int row); -int e_tree_row_of_node (ETree *et, + gint row); +gint e_tree_row_of_node (ETree *et, ETreePath path); gboolean e_tree_root_node_is_visible (ETree *et); void e_tree_show_node (ETree *et, ETreePath path); void e_tree_save_expanded_state (ETree *et, - char *filename); + gchar *filename); void e_tree_load_expanded_state (ETree *et, - char *filename); + gchar *filename); xmlDoc *e_tree_save_expanded_state_xml (ETree *et); void e_tree_load_expanded_state_xml (ETree *et, xmlDoc *doc); -int e_tree_row_count (ETree *et); +gint e_tree_row_count (ETree *et); GtkWidget *e_tree_get_tooltip (ETree *et); -void e_tree_force_expanded_state (ETree *et, int state); +void e_tree_force_expanded_state (ETree *et, gint state); typedef enum { E_TREE_FIND_NEXT_BACKWARD = 0, @@ -311,7 +311,7 @@ ETableItem * e_tree_get_item(ETree * et); GnomeCanvasItem * e_tree_get_header_item(ETree * et); -void e_tree_set_info_message (ETree *tree, const char *info_message); +void e_tree_set_info_message (ETree *tree, const gchar *info_message); G_END_DECLS diff --git a/widgets/text/a11y/gal-a11y-e-text.c b/widgets/text/a11y/gal-a11y-e-text.c index 98484949ff..6717f687b0 100644 --- a/widgets/text/a11y/gal-a11y-e-text.c +++ b/widgets/text/a11y/gal-a11y-e-text.c @@ -39,11 +39,11 @@ static AtkComponentIface *component_parent_iface; static GType parent_type; static gint priv_offset; static GQuark quark_accessible_object = 0; -#define GET_PRIVATE(object) ((GalA11yETextPrivate *) (((char *) object) + priv_offset)) +#define GET_PRIVATE(object) ((GalA11yETextPrivate *) (((gchar *) object) + priv_offset)) #define PARENT_TYPE (parent_type) struct _GalA11yETextPrivate { - int dummy; + gint dummy; }; static void @@ -66,8 +66,8 @@ et_get_extents (AtkComponent *component, EText *item = E_TEXT (atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (component))); double real_width; double real_height; - int fake_width; - int fake_height; + gint fake_width; + gint fake_height; if (component_parent_iface && component_parent_iface->get_extents) @@ -94,7 +94,7 @@ et_get_full_text (AtkText *text) { EText *etext = E_TEXT (atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (text))); ETextModel *model; - const char *full_text; + const gchar *full_text; g_object_get (etext, "model", &model, NULL); @@ -105,7 +105,7 @@ et_get_full_text (AtkText *text) static void et_set_full_text (AtkEditableText *text, - const char *full_text) + const gchar *full_text) { EText *etext = E_TEXT (atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (text))); ETextModel *model; @@ -121,7 +121,7 @@ et_get_text (AtkText *text, gint end_offset) { gint start, end, real_start, real_end, len; - const char *full_text = et_get_full_text (text); + const gchar *full_text = et_get_full_text (text); if (full_text == NULL) return NULL; len = g_utf8_strlen (full_text, -1); @@ -149,12 +149,12 @@ is_a_seperator (gunichar c) } static gint -find_word_start (const char *text, +find_word_start (const gchar *text, gint begin_offset, gint step) { gint offset; - char *at_offset; + gchar *at_offset; gunichar current, previous; gint len; @@ -175,12 +175,12 @@ find_word_start (const char *text, } static gint -find_word_end (const char *text, +find_word_end (const gchar *text, gint begin_offset, gint step) { gint offset; - char *at_offset; + gchar *at_offset; gunichar current, previous; gint len; @@ -201,14 +201,14 @@ find_word_end (const char *text, } static gint -find_sentence_start (const char *text, +find_sentence_start (const gchar *text, gint begin_offset, gint step) { gint offset, last_word_end, len; - char *at_offset; + gchar *at_offset; gunichar ch; - int i; + gint i; offset = find_word_start (text, begin_offset, step); len = g_utf8_strlen (text, -1); @@ -231,12 +231,12 @@ find_sentence_start (const char *text, } static gint -find_sentence_end (const char *text, +find_sentence_end (const gchar *text, gint begin_offset, gint step) { gint offset; - char *at_offset; + gchar *at_offset; gunichar previous; gint len; @@ -255,12 +255,12 @@ find_sentence_end (const char *text, } static gint -find_line_start (const char *text, +find_line_start (const gchar *text, gint begin_offset, gint step) { gint offset; - char *at_offset; + gchar *at_offset; gunichar previous; gint len; @@ -279,12 +279,12 @@ find_line_start (const char *text, } static gint -find_line_end (const char *text, +find_line_end (const gchar *text, gint begin_offset, gint step) { gint offset; - char *at_offset; + gchar *at_offset; gunichar current; gint len; @@ -310,7 +310,7 @@ et_get_text_after_offset (AtkText *text, gint *end_offset) { gint start, end, len; - const char *full_text = et_get_full_text (text); + const gchar *full_text = et_get_full_text (text); g_return_val_if_fail (full_text, NULL); switch (boundary_type) @@ -363,7 +363,7 @@ et_get_text_at_offset (AtkText *text, gint *end_offset) { gint start, end, len; - const char *full_text = et_get_full_text (text); + const gchar *full_text = et_get_full_text (text); g_return_val_if_fail (full_text, NULL); switch (boundary_type) @@ -412,15 +412,15 @@ static gunichar et_get_character_at_offset (AtkText *text, gint offset) { - const char *full_text = et_get_full_text (text); - char *at_offset; + const gchar *full_text = et_get_full_text (text); + gchar *at_offset; at_offset = g_utf8_offset_to_pointer (full_text, offset); return g_utf8_get_char_validated (at_offset, -1); } -static gchar* +static gchar * et_get_text_before_offset (AtkText *text, gint offset, AtkTextBoundary boundary_type, @@ -428,7 +428,7 @@ et_get_text_before_offset (AtkText *text, gint *end_offset) { gint start, end, len; - const char *full_text = et_get_full_text (text); + const gchar *full_text = et_get_full_text (text); g_return_val_if_fail (full_text, NULL); switch (boundary_type) @@ -478,7 +478,7 @@ et_get_caret_offset (AtkText *text) { GObject *obj; EText *etext; - int offset; + gint offset; g_return_val_if_fail (ATK_IS_GOBJECT_ACCESSIBLE(text), -1); obj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (text)); @@ -588,7 +588,7 @@ et_get_character_extents (AtkText *text, static gint et_get_character_count (AtkText *text) { - const char *full_text = et_get_full_text (text); + const gchar *full_text = et_get_full_text (text); return g_utf8_strlen (full_text, -1); } @@ -606,8 +606,8 @@ et_get_offset_at_point (AtkText *text, gint x_widget, y_widget, x_window, y_window; GdkWindow *window; GtkWidget *widget; - int index; - int trailing; + gint index; + gint trailing; g_return_val_if_fail (ATK_IS_GOBJECT_ACCESSIBLE(text), -1); obj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (text)); @@ -670,7 +670,7 @@ et_get_n_selections (AtkText *text) } -static gchar* +static gchar * et_get_selection (AtkText *text, gint selection_num, gint *start_offset, @@ -679,7 +679,7 @@ et_get_selection (AtkText *text, gint start, end, real_start, real_end, len; EText *etext; if (selection_num == 0) { - const char *full_text = et_get_full_text (text); + const gchar *full_text = et_get_full_text (text); if (full_text == NULL) return NULL; len = g_utf8_strlen (full_text, -1); @@ -842,9 +842,9 @@ et_insert_text (AtkEditableText *text, gint *position) { /* Utf8 unimplemented */ - char *result; + gchar *result; - const char *full_text = et_get_full_text (ATK_TEXT (text)); + const gchar *full_text = et_get_full_text (ATK_TEXT (text)); if (full_text == NULL) return; diff --git a/widgets/text/e-reflow-model.c b/widgets/text/e-reflow-model.c index d24b915e6e..2bf5e4990d 100644 --- a/widgets/text/e-reflow-model.c +++ b/widgets/text/e-reflow-model.c @@ -50,7 +50,7 @@ static guint e_reflow_model_signals [LAST_SIGNAL] = { 0, }; * @width: The new value for the width of each item. */ void -e_reflow_model_set_width (EReflowModel *e_reflow_model, int width) +e_reflow_model_set_width (EReflowModel *e_reflow_model, gint width) { g_return_if_fail (e_reflow_model != NULL); g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model)); @@ -64,7 +64,7 @@ e_reflow_model_set_width (EReflowModel *e_reflow_model, int width) * * Returns: the number of items in the reflow model. */ -int +gint e_reflow_model_count (EReflowModel *e_reflow_model) { g_return_val_if_fail (e_reflow_model != NULL, 0); @@ -81,8 +81,8 @@ e_reflow_model_count (EReflowModel *e_reflow_model) * * Returns: the height of the nth item. */ -int -e_reflow_model_height (EReflowModel *e_reflow_model, int n, GnomeCanvasGroup *parent) +gint +e_reflow_model_height (EReflowModel *e_reflow_model, gint n, GnomeCanvasGroup *parent) { g_return_val_if_fail (e_reflow_model != NULL, 0); g_return_val_if_fail (E_IS_REFLOW_MODEL (e_reflow_model), 0); @@ -101,7 +101,7 @@ e_reflow_model_height (EReflowModel *e_reflow_model, int n, GnomeCanvasGroup *pa * Returns: the new GnomeCanvasItem. */ GnomeCanvasItem * -e_reflow_model_incarnate (EReflowModel *e_reflow_model, int n, GnomeCanvasGroup *parent) +e_reflow_model_incarnate (EReflowModel *e_reflow_model, gint n, GnomeCanvasGroup *parent) { g_return_val_if_fail (e_reflow_model != NULL, NULL); g_return_val_if_fail (E_IS_REFLOW_MODEL (e_reflow_model), NULL); @@ -119,8 +119,8 @@ e_reflow_model_incarnate (EReflowModel *e_reflow_model, int n, GnomeCanvasGroup * * Returns: strcmp like semantics for the comparison value. */ -int -e_reflow_model_compare (EReflowModel *e_reflow_model, int n1, int n2) +gint +e_reflow_model_compare (EReflowModel *e_reflow_model, gint n1, gint n2) { #if 0 g_return_val_if_fail (e_reflow_model != NULL, 0); @@ -139,7 +139,7 @@ e_reflow_model_compare (EReflowModel *e_reflow_model, int n1, int n2) * Update item to represent the nth piece of data. */ void -e_reflow_model_reincarnate (EReflowModel *e_reflow_model, int n, GnomeCanvasItem *item) +e_reflow_model_reincarnate (EReflowModel *e_reflow_model, gint n, GnomeCanvasItem *item) { g_return_if_fail (e_reflow_model != NULL); g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model)); @@ -219,7 +219,7 @@ e_reflow_model_init (EReflowModel *e_reflow_model) static void print_tabs (void) { - int i; + gint i; for (i = 0; i < depth; i++) g_print("\t"); } @@ -284,7 +284,7 @@ e_reflow_model_comparison_changed (EReflowModel *e_reflow_model) * Use this function to notify any views of the reflow model that a number of items have been inserted. **/ void -e_reflow_model_items_inserted (EReflowModel *e_reflow_model, int position, int count) +e_reflow_model_items_inserted (EReflowModel *e_reflow_model, gint position, gint count) { g_return_if_fail (e_reflow_model != NULL); g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model)); @@ -308,7 +308,7 @@ e_reflow_model_items_inserted (EReflowModel *e_reflow_model, int position, int c **/ void e_reflow_model_item_removed (EReflowModel *e_reflow_model, - int n) + gint n) { g_return_if_fail (e_reflow_model != NULL); g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model)); @@ -335,7 +335,7 @@ e_reflow_model_item_removed (EReflowModel *e_reflow_model, * object */ void -e_reflow_model_item_changed (EReflowModel *e_reflow_model, int n) +e_reflow_model_item_changed (EReflowModel *e_reflow_model, gint n) { g_return_if_fail (e_reflow_model != NULL); g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model)); diff --git a/widgets/text/e-reflow-model.h b/widgets/text/e-reflow-model.h index c772621d07..d606edf8cd 100644 --- a/widgets/text/e-reflow-model.h +++ b/widgets/text/e-reflow-model.h @@ -48,13 +48,13 @@ typedef struct { /* * Virtual methods */ - void (*set_width) (EReflowModel *etm, int width); + void (*set_width) (EReflowModel *etm, gint width); - int (*count) (EReflowModel *etm); - int (*height) (EReflowModel *etm, int n, GnomeCanvasGroup *parent); - GnomeCanvasItem *(*incarnate) (EReflowModel *etm, int n, GnomeCanvasGroup *parent); - int (*compare) (EReflowModel *etm, int n1, int n2); - void (*reincarnate) (EReflowModel *etm, int n, GnomeCanvasItem *item); + gint (*count) (EReflowModel *etm); + gint (*height) (EReflowModel *etm, gint n, GnomeCanvasGroup *parent); + GnomeCanvasItem *(*incarnate) (EReflowModel *etm, gint n, GnomeCanvasGroup *parent); + gint (*compare) (EReflowModel *etm, gint n1, gint n2); + void (*reincarnate) (EReflowModel *etm, gint n, GnomeCanvasItem *item); /* * Signals @@ -68,28 +68,28 @@ typedef struct { */ void (*model_changed) (EReflowModel *etm); void (*comparison_changed) (EReflowModel *etm); - void (*model_items_inserted) (EReflowModel *etm, int position, int count); - void (*model_item_removed) (EReflowModel *etm, int position); - void (*model_item_changed) (EReflowModel *etm, int n); + void (*model_items_inserted) (EReflowModel *etm, gint position, gint count); + void (*model_item_removed) (EReflowModel *etm, gint position); + void (*model_item_changed) (EReflowModel *etm, gint n); } EReflowModelClass; GType e_reflow_model_get_type (void); /**/ void e_reflow_model_set_width (EReflowModel *e_reflow_model, - int width); -int e_reflow_model_count (EReflowModel *e_reflow_model); -int e_reflow_model_height (EReflowModel *e_reflow_model, - int n, + gint width); +gint e_reflow_model_count (EReflowModel *e_reflow_model); +gint e_reflow_model_height (EReflowModel *e_reflow_model, + gint n, GnomeCanvasGroup *parent); GnomeCanvasItem *e_reflow_model_incarnate (EReflowModel *e_reflow_model, - int n, + gint n, GnomeCanvasGroup *parent); -int e_reflow_model_compare (EReflowModel *e_reflow_model, - int n1, - int n2); +gint e_reflow_model_compare (EReflowModel *e_reflow_model, + gint n1, + gint n2); void e_reflow_model_reincarnate (EReflowModel *e_reflow_model, - int n, + gint n, GnomeCanvasItem *item); /* @@ -98,12 +98,12 @@ void e_reflow_model_reincarnate (EReflowModel *e_reflow_mode void e_reflow_model_changed (EReflowModel *e_reflow_model); void e_reflow_model_comparison_changed (EReflowModel *e_reflow_model); void e_reflow_model_items_inserted (EReflowModel *e_reflow_model, - int position, - int count); + gint position, + gint count); void e_reflow_model_item_removed (EReflowModel *e_reflow_model, - int n); + gint n); void e_reflow_model_item_changed (EReflowModel *e_reflow_model, - int n); + gint n); #ifdef __cplusplus } diff --git a/widgets/text/e-reflow.c b/widgets/text/e-reflow.c index 95f3f89bab..e9f7adc2cf 100644 --- a/widgets/text/e-reflow.c +++ b/widgets/text/e-reflow.c @@ -41,10 +41,10 @@ static gboolean e_reflow_event (GnomeCanvasItem *item, GdkEvent *event); static void e_reflow_realize (GnomeCanvasItem *item); static void e_reflow_unrealize (GnomeCanvasItem *item); static void e_reflow_draw (GnomeCanvasItem *item, GdkDrawable *drawable, - int x, int y, int width, int height); + gint x, gint y, gint width, gint height); static void e_reflow_update (GnomeCanvasItem *item, double affine[6], ArtSVP *clip_path, gint flags); -static double e_reflow_point (GnomeCanvasItem *item, double x, double y, int cx, int cy, GnomeCanvasItem **actual_item); -static void e_reflow_reflow (GnomeCanvasItem *item, int flags); +static double e_reflow_point (GnomeCanvasItem *item, double x, double y, gint cx, gint cy, GnomeCanvasItem **actual_item); +static void e_reflow_reflow (GnomeCanvasItem *item, gint flags); static void set_empty(EReflow *reflow); static void e_reflow_resize_children (GnomeCanvasItem *item); @@ -75,7 +75,7 @@ enum { static guint signals [LAST_SIGNAL] = {0, }; static gint -er_compare (int i1, int i2, gpointer user_data) +er_compare (gint i1, gint i2, gpointer user_data) { EReflow *reflow = user_data; return e_reflow_model_compare (reflow->model, i1, i2); @@ -92,7 +92,7 @@ e_reflow_pick_line (EReflow *reflow, double x) static int er_find_item (EReflow *reflow, GnomeCanvasItem *item) { - int i; + gint i; for (i = 0; i < reflow->count; i++) { if (reflow->items[i] == item) return i; @@ -104,8 +104,8 @@ static void e_reflow_resize_children (GnomeCanvasItem *item) { EReflow *reflow; - int i; - int count; + gint i; + gint count; reflow = E_REFLOW (item); @@ -119,7 +119,7 @@ e_reflow_resize_children (GnomeCanvasItem *item) } static inline void -e_reflow_update_selection_row (EReflow *reflow, int row) +e_reflow_update_selection_row (EReflow *reflow, gint row) { if (reflow->items[row]) { g_object_set(reflow->items[row], @@ -137,8 +137,8 @@ e_reflow_update_selection_row (EReflow *reflow, int row) static void e_reflow_update_selection (EReflow *reflow) { - int i; - int count; + gint i; + gint count; count = reflow->count; for (i = 0; i < count; i++) { @@ -153,7 +153,7 @@ selection_changed (ESelectionModel *selection, EReflow *reflow) } static void -selection_row_changed (ESelectionModel *selection, int row, EReflow *reflow) +selection_row_changed (ESelectionModel *selection, gint row, EReflow *reflow) { e_reflow_update_selection_row (reflow, row); } @@ -161,7 +161,7 @@ selection_row_changed (ESelectionModel *selection, int row, EReflow *reflow) static gboolean do_adjustment (gpointer user_data) { - int row; + gint row; GtkAdjustment *adj ; gfloat value, min_value, max_value; EReflow *reflow = user_data; @@ -195,10 +195,10 @@ do_adjustment (gpointer user_data) } static void -cursor_changed (ESelectionModel *selection, int row, int col, EReflow *reflow) +cursor_changed (ESelectionModel *selection, gint row, gint col, EReflow *reflow) { - int count = reflow->count; - int old_cursor = reflow->cursor_row; + gint count = reflow->count; + gint old_cursor = reflow->cursor_row; if (old_cursor < count && old_cursor >= 0) { if (reflow->items[old_cursor]) { @@ -233,12 +233,12 @@ cursor_changed (ESelectionModel *selection, int row, int col, EReflow *reflow) static void incarnate (EReflow *reflow) { - int column_width; - int first_column; - int last_column; - int first_cell; - int last_cell; - int i; + gint column_width; + gint first_column; + gint last_column; + gint first_cell; + gint last_cell; + gint i; GtkAdjustment *adjustment = gtk_layout_get_hadjustment (GTK_LAYOUT (GNOME_CANVAS_ITEM (reflow)->canvas)); column_width = reflow->column_width; @@ -261,7 +261,7 @@ incarnate (EReflow *reflow) last_cell = reflow->count; for (i = first_cell; i < last_cell; i++) { - int unsorted = e_sorter_sorted_to_model (E_SORTER (reflow->sorter), i); + gint unsorted = e_sorter_sorted_to_model (E_SORTER (reflow->sorter), i); if (reflow->items[unsorted] == NULL) { if (reflow->model) { reflow->items[unsorted] = e_reflow_model_incarnate (reflow->model, unsorted, GNOME_CANVAS_GROUP (reflow)); @@ -295,10 +295,10 @@ static void reflow_columns (EReflow *reflow) { GSList *list; - int count; - int start; - int i; - int column_count, column_start; + gint count; + gint start; + gint i; + gint column_count, column_start; double running_height; if (reflow->reflow_from_column <= 1) { @@ -321,7 +321,7 @@ reflow_columns (EReflow *reflow) count = reflow->count - start; for (i = start; i < count; i++) { - int unsorted = e_sorter_sorted_to_model (E_SORTER (reflow->sorter), i); + gint unsorted = e_sorter_sorted_to_model (E_SORTER (reflow->sorter), i); if (i != 0 && running_height + reflow->heights[unsorted] + E_REFLOW_BORDER_WIDTH > reflow->height) { list = g_slist_prepend (list, GINT_TO_POINTER(i)); column_count ++; @@ -350,7 +350,7 @@ reflow_columns (EReflow *reflow) } static void -item_changed (EReflowModel *model, int i, EReflow *reflow) +item_changed (EReflowModel *model, gint i, EReflow *reflow) { if (i < 0 || i >= reflow->count) return; @@ -365,17 +365,17 @@ item_changed (EReflowModel *model, int i, EReflow *reflow) } static void -item_removed (EReflowModel *model, int i, EReflow *reflow) +item_removed (EReflowModel *model, gint i, EReflow *reflow) { - int c; - int sorted; + gint c; + gint sorted; if (i < 0 || i >= reflow->count) return; sorted = e_sorter_model_to_sorted (E_SORTER (reflow->sorter), i); for (c = reflow->column_count - 1; c >= 0; c--) { - int start_of_column = reflow->columns[c]; + gint start_of_column = reflow->columns[c]; if (start_of_column <= sorted) { if (reflow->reflow_from_column == -1 @@ -407,9 +407,9 @@ item_removed (EReflowModel *model, int i, EReflow *reflow) } static void -items_inserted (EReflowModel *model, int position, int count, EReflow *reflow) +items_inserted (EReflowModel *model, gint position, gint count, EReflow *reflow) { - int i, oldcount; + gint i, oldcount; if (position < 0 || position > reflow->count) return; @@ -438,11 +438,11 @@ items_inserted (EReflowModel *model, int position, int count, EReflow *reflow) e_sorter_array_set_count (reflow->sorter, reflow->count); for (i = position; i < position + count; i ++) { - int sorted = e_sorter_model_to_sorted (E_SORTER (reflow->sorter), i); - int c; + gint sorted = e_sorter_model_to_sorted (E_SORTER (reflow->sorter), i); + gint c; for (c = reflow->column_count - 1; c >= 0; c--) { - int start_of_column = reflow->columns[c]; + gint start_of_column = reflow->columns[c]; if (start_of_column <= sorted) { if (reflow->reflow_from_column == -1 @@ -462,9 +462,9 @@ items_inserted (EReflowModel *model, int position, int count, EReflow *reflow) static void model_changed (EReflowModel *model, EReflow *reflow) { - int i; - int count; - int oldcount; + gint i; + gint count; + gint oldcount; count = reflow->count; oldcount = count; @@ -829,8 +829,8 @@ e_reflow_realize (GnomeCanvasItem *item) { EReflow *reflow; GtkAdjustment *adjustment; - int count; - int i; + gint count; + gint i; reflow = E_REFLOW (item); @@ -897,7 +897,7 @@ static gboolean e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) { EReflow *reflow; - int return_val = FALSE; + gint return_val = FALSE; reflow = E_REFLOW (item); @@ -910,11 +910,11 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) if (event->key.keyval == GDK_Tab || event->key.keyval == GDK_KP_Tab || event->key.keyval == GDK_ISO_Left_Tab) { - int i; - int count; + gint i; + gint count; count = reflow->count; for (i = 0; i < count; i++) { - int unsorted = e_sorter_sorted_to_model (E_SORTER (reflow->sorter), i); + gint unsorted = e_sorter_sorted_to_model (E_SORTER (reflow->sorter), i); GnomeCanvasItem *item = reflow->items[unsorted]; EFocus has_focus; if (item) { @@ -1104,12 +1104,12 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) } static void e_reflow_draw (GnomeCanvasItem *item, GdkDrawable *drawable, - int x, int y, int width, int height) + gint x, gint y, gint width, gint height) { - int x_rect, y_rect, width_rect, height_rect; + gint x_rect, y_rect, width_rect, height_rect; gdouble running_width; EReflow *reflow = E_REFLOW(item); - int i; + gint i; double column_width; if (GNOME_CANVAS_ITEM_CLASS(e_reflow_parent_class)->draw) @@ -1144,7 +1144,7 @@ static void e_reflow_draw (GnomeCanvasItem *item, GdkDrawable *drawable, running_width += E_REFLOW_DIVIDER_WIDTH + E_REFLOW_BORDER_WIDTH + column_width + E_REFLOW_BORDER_WIDTH; } if (reflow->column_drag) { - int start_line = e_reflow_pick_line(reflow, + gint start_line = e_reflow_pick_line(reflow, gtk_layout_get_hadjustment(GTK_LAYOUT(item->canvas))->value); i = x - start_line * (column_width + E_REFLOW_FULL_GUTTER); running_width = start_line * (column_width + E_REFLOW_FULL_GUTTER); @@ -1216,11 +1216,11 @@ e_reflow_update (GnomeCanvasItem *item, double affine[6], ArtSVP *clip_path, gin gnome_canvas_request_redraw(item->canvas, x0, y0, x1, y1); reflow->need_height_update = FALSE; } else if (reflow->need_column_resize) { - int x_rect, y_rect, width_rect, height_rect; - int start_line = e_reflow_pick_line(reflow, + gint x_rect, y_rect, width_rect, height_rect; + gint start_line = e_reflow_pick_line(reflow, gtk_layout_get_hadjustment(GTK_LAYOUT(item->canvas))->value); gdouble running_width; - int i; + gint i; double column_width; if ( reflow->previous_temp_column_width != -1 ) { @@ -1262,7 +1262,7 @@ e_reflow_update (GnomeCanvasItem *item, double affine[6], ArtSVP *clip_path, gin static double e_reflow_point (GnomeCanvasItem *item, - double x, double y, int cx, int cy, + double x, double y, gint cx, gint cy, GnomeCanvasItem **actual_item) { double distance = 1; @@ -1292,14 +1292,14 @@ e_reflow_point (GnomeCanvasItem *item, } static void -e_reflow_reflow( GnomeCanvasItem *item, int flags ) +e_reflow_reflow( GnomeCanvasItem *item, gint flags ) { EReflow *reflow = E_REFLOW(item); gdouble old_width; gdouble running_width; gdouble running_height; - int next_column; - int i; + gint next_column; + gint i; if (! (GTK_OBJECT_FLAGS (reflow) & GNOME_CANVAS_ITEM_REALIZED)) return; @@ -1316,7 +1316,7 @@ e_reflow_reflow( GnomeCanvasItem *item, int flags ) next_column = 1; for (i = 0; i < reflow->count; i++) { - int unsorted = e_sorter_sorted_to_model (E_SORTER (reflow->sorter), i); + gint unsorted = e_sorter_sorted_to_model (E_SORTER (reflow->sorter), i); if (next_column < reflow->column_count && i == reflow->columns[next_column]) { running_height = E_REFLOW_BORDER_WIDTH; running_width += reflow->column_width + E_REFLOW_FULL_GUTTER; @@ -1340,8 +1340,8 @@ e_reflow_reflow( GnomeCanvasItem *item, int flags ) static int e_reflow_selection_event_real (EReflow *reflow, GnomeCanvasItem *item, GdkEvent *event) { - int row; - int return_val = TRUE; + gint row; + gint return_val = TRUE; switch (event->type) { case GDK_BUTTON_PRESS: switch (event->button.button) { diff --git a/widgets/text/e-reflow.h b/widgets/text/e-reflow.h index 3ea840d358..89ceb032b1 100644 --- a/widgets/text/e-reflow.h +++ b/widgets/text/e-reflow.h @@ -79,12 +79,12 @@ struct _EReflow guint adjustment_value_changed_id; guint set_scroll_adjustments_id; - int *heights; + gint *heights; GnomeCanvasItem **items; - int count; - int allocated_count; + gint count; + gint allocated_count; - int *columns; + gint *columns; gint column_count; /* Number of columnns */ GnomeCanvasItem *empty_text; @@ -96,8 +96,8 @@ struct _EReflow double column_width; - int incarnate_idle_id; - int do_adjustment_idle_id; + gint incarnate_idle_id; + gint do_adjustment_idle_id; /* These are all for when the column is being dragged. */ gdouble start_x; @@ -105,9 +105,9 @@ struct _EReflow double temp_column_width; double previous_temp_column_width; - int cursor_row; + gint cursor_row; - int reflow_from_column; + gint reflow_from_column; guint column_drag : 1; @@ -127,7 +127,7 @@ struct _EReflowClass { GnomeCanvasGroupClass parent_class; - int (*selection_event) (EReflow *reflow, GnomeCanvasItem *item, GdkEvent *event); + gint (*selection_event) (EReflow *reflow, GnomeCanvasItem *item, GdkEvent *event); void (*column_width_changed) (EReflow *reflow, double width); }; diff --git a/widgets/text/e-text-model.c b/widgets/text/e-text-model.c index c7462e21a6..1bc2090caa 100644 --- a/widgets/text/e-text-model.c +++ b/widgets/text/e-text-model.c @@ -222,10 +222,10 @@ static void e_text_model_real_insert_length (ETextModel *model, gint position, const gchar *text, gint length) { EReposInsertShift repos; - int model_len = e_text_model_real_get_text_length (model); - char *offs; - const char *p; - int byte_length, l; + gint model_len = e_text_model_real_get_text_length (model); + gchar *offs; + const gchar *p; + gint byte_length, l; if (position > model_len) return; @@ -255,9 +255,9 @@ static void e_text_model_real_delete (ETextModel *model, gint position, gint length) { EReposDeleteShift repos; - int byte_position, byte_length; - char *offs, *p; - int l; + gint byte_position, byte_length; + gchar *offs, *p; + gint l; offs = g_utf8_offset_to_pointer (model->priv->text->str, position); byte_position = offs - model->priv->text->str; diff --git a/widgets/text/e-text-model.h b/widgets/text/e-text-model.h index 69c6f0c68e..f16c061610 100644 --- a/widgets/text/e-text-model.h +++ b/widgets/text/e-text-model.h @@ -60,7 +60,7 @@ struct _ETextModelClass { gint (* validate_pos) (ETextModel *model, gint pos); - const char *(* get_text) (ETextModel *model); + const gchar *(* get_text) (ETextModel *model); gint (* get_text_len) (ETextModel *model); void (* set_text) (ETextModel *model, const gchar *text); void (* insert) (ETextModel *model, gint position, const gchar *text); diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c index b30cf05b0c..d9f599f8a7 100644 --- a/widgets/text/e-text.c +++ b/widgets/text/e-text.c @@ -122,11 +122,11 @@ static void calc_height (EText *text); static gboolean show_pango_rectangle (EText *text, PangoRectangle rect); -static void e_text_do_popup (EText *text, GdkEventButton *button, int position); +static void e_text_do_popup (EText *text, GdkEventButton *button, gint position); static void e_text_update_primary_selection (EText *text); static void e_text_paste (EText *text, GdkAtom selection); -static void e_text_insert(EText *text, const char *string); +static void e_text_insert(EText *text, const gchar *string); static void reset_layout_attrs (EText *text); @@ -139,7 +139,7 @@ static void e_text_editable_do_insert_text (GtkEditable *editable, static void e_text_editable_do_delete_text (GtkEditable *editable, gint start_pos, gint end_pos); -static gchar* e_text_editable_get_chars (GtkEditable *editable, +static gchar * e_text_editable_get_chars (GtkEditable *editable, gint start_pos, gint end_pos); static void e_text_editable_set_selection_bounds (GtkEditable *editable, @@ -341,7 +341,7 @@ static void reset_layout_attrs (EText *text) { PangoAttrList *attrs = NULL; - int object_count; + gint object_count; if (text->layout == NULL) return; @@ -349,13 +349,13 @@ reset_layout_attrs (EText *text) object_count = e_text_model_object_count (text->model); if (text->bold || text->strikeout || object_count > 0) { - int length = 0; - int i; + gint length = 0; + gint i; attrs = pango_attr_list_new (); for (i = 0; i < object_count; i++) { - int start_pos, end_pos; + gint start_pos, end_pos; PangoAttribute *attr = pango_attr_underline_new (PANGO_UNDERLINE_SINGLE); e_text_model_get_nth_object_bounds (text->model, i, &start_pos, &end_pos); @@ -442,7 +442,7 @@ reset_layout (EText *text) if (!text->button_down) { PangoRectangle strong_pos, weak_pos; - char *offs = g_utf8_offset_to_pointer (text->text, text->selection_start); + gchar *offs = g_utf8_offset_to_pointer (text->text, text->selection_start); pango_layout_get_cursor_pos (text->layout, offs - text->text, &strong_pos, &weak_pos); @@ -597,10 +597,10 @@ static void calc_height (EText *text) { GnomeCanvasItem *item; - int old_height; - int old_width; - int width = 0; - int height = 0; + gint old_height; + gint old_width; + gint width = 0; + gint height = 0; item = GNOME_CANVAS_ITEM (text); @@ -623,7 +623,7 @@ static void calc_ellipsis (EText *text) { /* FIXME: a pango layout per calc_ellipsis sucks */ - int width; + gint width; PangoLayout *layout = gtk_widget_create_pango_layout (GTK_WIDGET (GNOME_CANVAS_ITEM (text)->canvas), text->ellipsis ? text->ellipsis : "..."); pango_layout_get_size (layout, &width, NULL); @@ -651,7 +651,7 @@ set_text_gc_foreground (EText *text) /* Sets the stipple pattern for the text */ static void -set_stipple (EText *text, GdkBitmap *stipple, int reconfigure) +set_stipple (EText *text, GdkBitmap *stipple, gint reconfigure) { if (text->stipple && !reconfigure) g_object_unref (text->stipple); @@ -1167,7 +1167,7 @@ e_text_get_property (GObject *object, /* Update handler for the text item */ static void -e_text_reflow (GnomeCanvasItem *item, int flags) +e_text_reflow (GnomeCanvasItem *item, gint flags) { EText *text; @@ -1196,7 +1196,7 @@ e_text_reflow (GnomeCanvasItem *item, int flags) /* Update handler for the text item */ static void -e_text_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, int flags) +e_text_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, gint flags) { EText *text; double x1, y1, x2, y2; @@ -1293,10 +1293,10 @@ _get_tep(EText *text) } static void -draw_pango_rectangle (GdkDrawable *drawable, GdkGC *gc, int x1, int y1, PangoRectangle rect) +draw_pango_rectangle (GdkDrawable *drawable, GdkGC *gc, gint x1, gint y1, PangoRectangle rect) { - int width = rect.width / PANGO_SCALE; - int height = rect.height / PANGO_SCALE; + gint width = rect.width / PANGO_SCALE; + gint height = rect.height / PANGO_SCALE; if (width <= 0) width = 1; if (height <= 0) @@ -1308,16 +1308,16 @@ draw_pango_rectangle (GdkDrawable *drawable, GdkGC *gc, int x1, int y1, PangoRec static gboolean show_pango_rectangle (EText *text, PangoRectangle rect) { - int x1 = rect.x / PANGO_SCALE; - int x2 = (rect.x + rect.width) / PANGO_SCALE; + gint x1 = rect.x / PANGO_SCALE; + gint x2 = (rect.x + rect.width) / PANGO_SCALE; - int y1 = rect.y / PANGO_SCALE; - int y2 = (rect.y + rect.height) / PANGO_SCALE; + gint y1 = rect.y / PANGO_SCALE; + gint y2 = (rect.y + rect.height) / PANGO_SCALE; - int new_xofs_edit = text->xofs_edit; - int new_yofs_edit = text->yofs_edit; + gint new_xofs_edit = text->xofs_edit; + gint new_yofs_edit = text->yofs_edit; - int clip_width, clip_height; + gint clip_width, clip_height; clip_width = text->clip_width; if (clip_width >= 0 && text->draw_borders) { @@ -1372,11 +1372,11 @@ show_pango_rectangle (EText *text, PangoRectangle rect) /* Draw handler for the text item */ static void e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable, - int x, int y, int width, int height) + gint x, gint y, gint width, gint height) { EText *text; GdkRectangle rect, *clip_rect; - int xpos, ypos; + gint xpos, ypos; GdkGC *main_gc; GnomeCanvas *canvas; GtkWidget *widget; @@ -1422,8 +1422,8 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable, } } if (text->draw_button) { - int xoff = item->x1 - x; - int yoff = item->y1 - y; + gint xoff = item->x1 - x; + gint yoff = item->y1 - y; widget = GTK_WIDGET (item->canvas); @@ -1442,8 +1442,8 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable, if (widget) { GtkButton *button = GTK_BUTTON (widget); GtkShadowType shadow_type; - int thisx, thisy, thisheight, thiswidth; - int default_spacing; + gint thisx, thisy, thisheight, thiswidth; + gint default_spacing; GdkRectangle area; area.x = 0; area.y = 0; @@ -1562,7 +1562,7 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable, GdkRegion *clip_region = gdk_region_new (); GdkGC *selection_gc; GdkGC *text_gc; - int start_index, end_index; + gint start_index, end_index; start_index = MIN (text->selection_start, text->selection_end); end_index = MAX (text->selection_start, text->selection_end); @@ -1587,8 +1587,8 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable, PangoLayoutLine *line = pango_layout_iter_get_line (iter); gint n_ranges, i; gint *ranges; - int y0, y1; - int s, e; + gint y0, y1; + gint s, e; if (start_index < line->start_index + line->length && end_index > line->start_index) { @@ -1644,7 +1644,7 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable, } else { if (text->show_cursor) { PangoRectangle strong_pos, weak_pos; - char *offs = g_utf8_offset_to_pointer (text->text, text->selection_start); + gchar *offs = g_utf8_offset_to_pointer (text->text, text->selection_start); pango_layout_get_cursor_pos (text->layout, offs - text->text + text->preedit_len, &strong_pos, &weak_pos); draw_pango_rectangle (drawable, main_gc, xpos, ypos, strong_pos); @@ -1666,7 +1666,7 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable, /* Point handler for the text item */ static double e_text_point (GnomeCanvasItem *item, double x, double y, - int cx, int cy, GnomeCanvasItem **actual_item) + gint cx, gint cy, GnomeCanvasItem **actual_item) { EText *text; double clip_width; @@ -1783,8 +1783,8 @@ e_text_bounds (GnomeCanvasItem *item, double *x1, double *y1, double *x2, double static gint get_position_from_xy (EText *text, gint x, gint y) { - int index; - int trailing; + gint index; + gint trailing; if (text->draw_borders) { x -= BORDER_INDENT; @@ -1829,8 +1829,8 @@ _blink_scroll_timeout (gpointer data) scroll = TRUE; } if (scroll && text->button_down && text->clip) { - int old_xofs_edit = text->xofs_edit; - int old_yofs_edit = text->yofs_edit; + gint old_xofs_edit = text->xofs_edit; + gint old_yofs_edit = text->yofs_edit; if (text->clip_cwidth >= 0 && text->lastx - text->clip_cx > text->clip_cwidth && @@ -1946,13 +1946,13 @@ _do_tooltip (gpointer data) /* FIXME: need to sort out tooltip stuff. */ EText *text = E_TEXT (data); GtkWidget *canvas; - int i; - int max_width; + gint i; + gint max_width; gboolean cut_off; double i2c[6]; ArtPoint origin = {0, 0}; ArtPoint pixel_origin; - int canvas_x, canvas_y; + gint canvas_x, canvas_y; GnomeCanvasItem *tooltip_text; double tooltip_width; double tooltip_height; @@ -2525,7 +2525,7 @@ e_text_copy_clipboard (EText *text) void e_text_delete_selection(EText *text) { - int sel_start, sel_end; + gint sel_start, sel_end; sel_start = MIN(text->selection_start, text->selection_end); sel_end = MAX(text->selection_start, text->selection_end); @@ -2573,7 +2573,7 @@ primary_get_cb (GtkClipboard *clipboard, gpointer data) { EText *text = E_TEXT (data); - int sel_start, sel_end; + gint sel_start, sel_end; sel_start = MIN(text->selection_start, text->selection_end); sel_end = MAX(text->selection_start, text->selection_end); @@ -2655,7 +2655,7 @@ e_text_paste (EText *text, GdkAtom selection) typedef struct { EText *text; GdkEventButton *button; - int position; + gint position; } PopupClosure; static void @@ -2688,7 +2688,7 @@ popup_targets_received (GtkClipboard *clipboard, PopupClosure *closure = user_data; EText *text = closure->text; GdkEventButton *button = closure->button; - int position = closure->position; + gint position = closure->position; GtkWidget *popup_menu = gtk_menu_new (); GtkWidget *menuitem, *submenu; @@ -2767,7 +2767,7 @@ popup_targets_received (GtkClipboard *clipboard, } static void -e_text_do_popup (EText *text, GdkEventButton *button, int position) +e_text_do_popup (EText *text, GdkEventButton *button, gint position) { PopupClosure *closure = g_new (PopupClosure, 1); @@ -2799,10 +2799,10 @@ e_text_reset_im_context (EText *text) /* fixme: */ static int -next_word (EText *text, int start) +next_word (EText *text, gint start) { - char *p = g_utf8_offset_to_pointer (text->text, start); - int length; + gchar *p = g_utf8_offset_to_pointer (text->text, start); + gint length; length = g_utf8_strlen (text->text, -1); @@ -2828,15 +2828,15 @@ next_word (EText *text, int start) } static int -find_offset_into_line (EText *text, int offset_into_text, char **start_of_line) +find_offset_into_line (EText *text, gint offset_into_text, gchar **start_of_line) { - char *p; + gchar *p; p = g_utf8_offset_to_pointer (text->text, offset_into_text); if (p == text->text) { if (start_of_line) - *start_of_line = (char*)text->text; + *start_of_line = (gchar *)text->text; return 0; } else { @@ -2852,7 +2852,7 @@ find_offset_into_line (EText *text, int offset_into_text, char **start_of_line) } if (start_of_line) - *start_of_line = (char*)text->text; + *start_of_line = (gchar *)text->text; return offset_into_text; } } @@ -2866,7 +2866,7 @@ _get_updated_position (EText *text, gboolean direction) { PangoLogAttr *log_attrs = NULL; gint n_attrs; - char *p = NULL; + gchar *p = NULL; gint new_pos = 0; gint length = 0; @@ -2889,7 +2889,7 @@ _get_updated_position (EText *text, gboolean direction) /* get layout's PangoLogAttr to facilitate moving when moving across grapheme cluster as in indic langs */ pango_layout_get_log_attrs (text->layout, &log_attrs, &n_attrs); - /* Fetch the current char index in the line & keep moving + /* Fetch the current gchar index in the line & keep moving forward until we can display cursor */ p = g_utf8_offset_to_pointer (text->text, text->selection_end); @@ -2930,9 +2930,9 @@ _get_updated_position (EText *text, gboolean direction) static int _get_position(EText *text, ETextEventProcessorCommand *command) { - int length, obj_num; + gint length, obj_num; gunichar unival; - char *p = NULL; + gchar *p = NULL; gint new_pos = 0; switch (command->position) { @@ -3020,7 +3020,7 @@ _get_position(EText *text, ETextEventProcessorCommand *command) case E_TEP_BACKWARD_WORD: new_pos = 0; if (text->selection_end >= 1) { - int pos = text->selection_end; + gint pos = text->selection_end; p = g_utf8_find_prev_char (text->text, g_utf8_offset_to_pointer (text->text, text->selection_end)); pos --; @@ -3046,7 +3046,7 @@ _get_position(EText *text, ETextEventProcessorCommand *command) break; case E_TEP_FORWARD_LINE: { - int offset_into_line; + gint offset_into_line; offset_into_line = find_offset_into_line (text, text->selection_end, NULL); if (offset_into_line == -1) @@ -3077,7 +3077,7 @@ _get_position(EText *text, ETextEventProcessorCommand *command) break; } case E_TEP_BACKWARD_LINE: { - int offset_into_line = find_offset_into_line (text, text->selection_end, &p); + gint offset_into_line = find_offset_into_line (text, text->selection_end, &p); if (offset_into_line == -1) return text->selection_end; @@ -3196,22 +3196,22 @@ _get_position(EText *text, ETextEventProcessorCommand *command) } static void -e_text_insert(EText *text, const char *string) +e_text_insert(EText *text, const gchar *string) { - int len = strlen (string); + gint len = strlen (string); if (len > 0) { - int utf8len = 0; + gint utf8len = 0; if (!text->allow_newlines) { - const char *i; - char *new_string = g_malloc (len + 1); - char *j = new_string; + const gchar *i; + gchar *new_string = g_malloc (len + 1); + gchar *j = new_string; for (i = string; *i; i = g_utf8_next_char(i)) { if (*i != '\n') { gunichar c; - int charlen; + gint charlen; c = g_utf8_get_char (i); charlen = g_unichar_to_utf8 (c, j); @@ -3231,16 +3231,16 @@ e_text_insert(EText *text, const char *string) } static void -capitalize (EText *text, int start, int end, ETextEventProcessorCaps type) +capitalize (EText *text, gint start, gint end, ETextEventProcessorCaps type) { gboolean first = TRUE; - const char *p = g_utf8_offset_to_pointer (text->text, start); - const char *text_end = g_utf8_offset_to_pointer (text->text, end); - int utf8len = text_end - p; + const gchar *p = g_utf8_offset_to_pointer (text->text, start); + const gchar *text_end = g_utf8_offset_to_pointer (text->text, end); + gint utf8len = text_end - p; if (utf8len > 0) { - char *new_text = g_new0 (char, utf8len * 6); - char *output = new_text; + gchar *new_text = g_new0 (char, utf8len * 6); + gchar *output = new_text; while (p && *p && p < text_end) { gunichar unival = g_utf8_get_char (p); @@ -3374,8 +3374,8 @@ e_text_command(ETextEventProcessor *tep, ETextEventProcessorCommand *command, gp if (text->selection_start == text->selection_end) { capitalize (text, text->selection_start, next_word (text, text->selection_start), command->value); } else { - int selection_start = MIN (text->selection_start, text->selection_end); - int selection_end = MAX (text->selection_start, text->selection_end); + gint selection_start = MIN (text->selection_start, text->selection_end); + gint selection_end = MAX (text->selection_start, text->selection_end); capitalize (text, selection_start, selection_end, command->value); } break; @@ -3397,7 +3397,7 @@ e_text_command(ETextEventProcessor *tep, ETextEventProcessorCommand *command, gp we don't we can scrap the loop and just use pango_layout_index_to_pos */ PangoLayoutLine *cur_line = NULL; - int selection_index; + gint selection_index; PangoLayoutIter *iter = pango_layout_get_iter (text->layout); /* check if we are using selection_start or selection_end for moving? */ @@ -3418,7 +3418,7 @@ e_text_command(ETextEventProcessor *tep, ETextEventProcessorCommand *command, gp } while (pango_layout_iter_next_line (iter)); if (cur_line) { - int xpos, ypos; + gint xpos, ypos; double clip_width, clip_height; /* gboolean trailing = FALSE; */ PangoRectangle pango_pos; diff --git a/widgets/text/e-text.h b/widgets/text/e-text.h index ebe5817285..f9b838aae3 100644 --- a/widgets/text/e-text.h +++ b/widgets/text/e-text.h @@ -85,7 +85,7 @@ G_BEGIN_DECLS * ellipsis string RW The characters to use as ellipsis. NULL = "...". * line_wrap boolean RW Line wrap when not editing. * break_characters string RW List of characters to optionally break on. - * max_lines int RW Number of lines possible when doing line wrap. + * max_lines gint RW Number of lines possible when doing line wrap. * draw_borders boolean RW Whether to draw borders. * draw_background boolean RW Whether to draw the background. * draw_button boolean RW This makes EText handle being the child of a button properly and highlighting as it should. @@ -112,7 +112,7 @@ struct _EText { gint preedit_len; /* preedit length to display */ gint preedit_pos; /* preedit cursor position */ PangoLayout *layout; - int num_lines; /* Number of lines of text */ + gint num_lines; /* Number of lines of text */ gchar *revert; /* Text to revert to */ @@ -128,26 +128,26 @@ struct _EText { GdkBitmap *stipple; /* Stipple for text */ GdkGC *gc; /* GC for drawing text */ - int cx, cy; /* Top-left canvas coordinates for text */ - int text_cx, text_cy; /* Top-left canvas coordinates for text */ - int clip_cx, clip_cy; /* Top-left canvas coordinates for clip rectangle */ - int clip_cwidth, clip_cheight; /* Size of clip rectangle in pixels */ - int max_width; /* Maximum width of text lines */ - int width; /* Rendered text width in pixels */ - int height; /* Rendered text height in pixels */ + gint cx, cy; /* Top-left canvas coordinates for text */ + gint text_cx, text_cy; /* Top-left canvas coordinates for text */ + gint clip_cx, clip_cy; /* Top-left canvas coordinates for clip rectangle */ + gint clip_cwidth, clip_cheight; /* Size of clip rectangle in pixels */ + gint max_width; /* Maximum width of text lines */ + gint width; /* Rendered text width in pixels */ + gint height; /* Rendered text height in pixels */ guint32 rgba; /* RGBA color for text */ double affine[6]; /* The item -> canvas affine */ - char *ellipsis; /* The ellipsis characters. NULL = "...". */ + gchar *ellipsis; /* The ellipsis characters. NULL = "...". */ double ellipsis_width; /* The width of the ellipsis. */ - int xofs_edit; /* Offset because of editing */ - int yofs_edit; /* Offset because of editing */ + gint xofs_edit; /* Offset because of editing */ + gint yofs_edit; /* Offset because of editing */ /* This needs to be reworked a bit once we get line wrapping. */ - int selection_start; /* Start of selection IN BYTES */ - int selection_end; /* End of selection IN BYTES */ + gint selection_start; /* Start of selection IN BYTES */ + gint selection_end; /* End of selection IN BYTES */ gboolean select_by_word; /* Current selection is by word */ /* This section is for drag scrolling and blinking cursor. */ |