diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-09-11 23:50:51 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-09-12 02:14:04 +0800 |
commit | ebcce86769d174cce6e881740c5e9bcedce28e06 (patch) | |
tree | b2cc2d18ceb0c3bd3e78f5b768c1b6926b69bb4a /widgets | |
parent | 1e3deb31476cf0026011876327be83e9a47847ee (diff) | |
download | gsoc2013-evolution-ebcce86769d174cce6e881740c5e9bcedce28e06.tar gsoc2013-evolution-ebcce86769d174cce6e881740c5e9bcedce28e06.tar.gz gsoc2013-evolution-ebcce86769d174cce6e881740c5e9bcedce28e06.tar.bz2 gsoc2013-evolution-ebcce86769d174cce6e881740c5e9bcedce28e06.tar.lz gsoc2013-evolution-ebcce86769d174cce6e881740c5e9bcedce28e06.tar.xz gsoc2013-evolution-ebcce86769d174cce6e881740c5e9bcedce28e06.tar.zst gsoc2013-evolution-ebcce86769d174cce6e881740c5e9bcedce28e06.zip |
Coding style and whitespace cleanups.
Diffstat (limited to 'widgets')
93 files changed, 3052 insertions, 3003 deletions
diff --git a/widgets/e-timezone-dialog/e-timezone-dialog.c b/widgets/e-timezone-dialog/e-timezone-dialog.c index 734301ebee..cf5a41eabf 100644 --- a/widgets/e-timezone-dialog/e-timezone-dialog.c +++ b/widgets/e-timezone-dialog/e-timezone-dialog.c @@ -291,7 +291,7 @@ e_timezone_dialog_construct (ETimezoneDialog *etd) priv->map = e_map_new (); map = GTK_WIDGET (priv->map); - g_object_weak_ref(G_OBJECT(map), map_destroy_cb, priv); + g_object_weak_ref (G_OBJECT (map), map_destroy_cb, priv); gtk_widget_set_events (map, gtk_widget_get_events (map) | GDK_LEAVE_NOTIFY_MASK @@ -334,7 +334,7 @@ e_timezone_dialog_construct (ETimezoneDialog *etd) static gint get_local_offset (void) { - time_t now = time(NULL), t_gmt, t_local; + time_t now = time (NULL), t_gmt, t_local; struct tm gmt, local; gint diff; @@ -349,12 +349,12 @@ get_local_offset (void) #endif static icaltimezone* -get_local_timezone(void) +get_local_timezone (void) { icaltimezone *zone; gchar *location; - tzset(); + tzset (); location = e_cal_system_timezone_get_location (); if (location) @@ -450,12 +450,12 @@ zone_display_name_with_offset (icaltimezone *zone) struct tm local; struct icaltimetype tt; gint offset; - gchar buffer [100]; - time_t now = time(NULL); + gchar buffer[100]; + time_t now = time (NULL); gmtime_r ((const time_t *) &now, &local); tt = tm_to_icaltimetype (&local, TRUE); - offset = icaltimezone_get_utc_offset(zone, &tt, NULL); + offset = icaltimezone_get_utc_offset (zone, &tt, NULL); format_utc_offset (offset, buffer); @@ -530,7 +530,7 @@ on_map_motion (GtkWidget *widget, GdkEventMotion *event, gpointer data) new_zone = get_zone_from_point (etd, priv->point_hover); - display = zone_display_name_with_offset(new_zone); + display = zone_display_name_with_offset (new_zone); gtk_label_set_text (GTK_LABEL (priv->preview_label), display); g_free (display); @@ -661,7 +661,7 @@ get_zone_from_point (ETimezoneDialog *etd, } } - g_return_val_if_reached(NULL); + g_return_val_if_reached (NULL); } /** @@ -703,10 +703,10 @@ e_timezone_dialog_set_timezone (ETimezoneDialog *etd, g_return_if_fail (E_IS_TIMEZONE_DIALOG (etd)); if (!zone) - zone = get_local_timezone(); + zone = get_local_timezone (); if (zone) - display = zone_display_name_with_offset(zone); + display = zone_display_name_with_offset (zone); priv = etd->priv; @@ -829,12 +829,12 @@ timezone_combo_set_active_text (GtkComboBox *combo, const gchar *zone_name) } static void -map_destroy_cb(gpointer data, GObject *where_object_was) +map_destroy_cb (gpointer data, GObject *where_object_was) { ETimezoneDialogPrivate *priv = data; if (priv->timeout_id) { - g_source_remove(priv->timeout_id); + g_source_remove (priv->timeout_id); priv->timeout_id = 0; } return; diff --git a/widgets/menus/gal-define-views-dialog.c b/widgets/menus/gal-define-views-dialog.c index a6f52bf69a..66b055dca6 100644 --- a/widgets/menus/gal-define-views-dialog.c +++ b/widgets/menus/gal-define-views-dialog.c @@ -96,10 +96,10 @@ gdvd_button_new_dialog_callback (GtkWidget *widget, gint id, GalDefineViewsDialo NULL); if (name && factory) { - g_strchomp(name); + g_strchomp (name); if (*name != '\0') { view = gal_view_factory_new_view (factory, name); - gal_view_collection_append(dialog->collection, view); + gal_view_collection_append (dialog->collection, view); item = dialog->collection->view_data[dialog->collection->view_count-1]; gtk_list_store_append (GTK_LIST_STORE (dialog->model), &iter); @@ -121,7 +121,7 @@ gdvd_button_new_dialog_callback (GtkWidget *widget, gint id, GalDefineViewsDialo } static void -gdvd_button_new_callback(GtkWidget *widget, GalDefineViewsDialog *dialog) +gdvd_button_new_callback (GtkWidget *widget, GalDefineViewsDialog *dialog) { GtkWidget *view_new_dialog = gal_view_new_dialog_new (dialog->collection); gtk_window_set_transient_for (GTK_WINDOW (view_new_dialog), GTK_WINDOW (dialog)); @@ -131,7 +131,7 @@ gdvd_button_new_callback(GtkWidget *widget, GalDefineViewsDialog *dialog) } static void -gdvd_button_modify_callback(GtkWidget *widget, GalDefineViewsDialog *dialog) +gdvd_button_modify_callback (GtkWidget *widget, GalDefineViewsDialog *dialog) { GtkTreeIter iter; GalViewCollectionItem *item; @@ -148,7 +148,7 @@ gdvd_button_modify_callback(GtkWidget *widget, GalDefineViewsDialog *dialog) } static void -gdvd_button_delete_callback(GtkWidget *widget, GalDefineViewsDialog *dialog) +gdvd_button_delete_callback (GtkWidget *widget, GalDefineViewsDialog *dialog) { gint row; GtkTreeIter iter; @@ -207,7 +207,7 @@ gdvd_selection_changed_callback (GtkTreeSelection *selection, GalDefineViewsDial } static void -gdvd_connect_signal(GalDefineViewsDialog *dialog, const gchar *widget_name, const gchar *signal, GCallback handler) +gdvd_connect_signal (GalDefineViewsDialog *dialog, const gchar *widget_name, const gchar *signal, GCallback handler) { GtkWidget *widget; @@ -279,10 +279,10 @@ gal_define_views_dialog_init (GalDefineViewsDialog *dialog) static void gal_define_views_dialog_dispose (GObject *object) { - GalDefineViewsDialog *gal_define_views_dialog = GAL_DEFINE_VIEWS_DIALOG(object); + GalDefineViewsDialog *gal_define_views_dialog = GAL_DEFINE_VIEWS_DIALOG (object); if (gal_define_views_dialog->builder) - g_object_unref(gal_define_views_dialog->builder); + g_object_unref (gal_define_views_dialog->builder); gal_define_views_dialog->builder = NULL; if (G_OBJECT_CLASS (gal_define_views_dialog_parent_class)->dispose) @@ -290,7 +290,7 @@ gal_define_views_dialog_dispose (GObject *object) } static void -gal_define_views_dialog_set_collection(GalDefineViewsDialog *dialog, +gal_define_views_dialog_set_collection (GalDefineViewsDialog *dialog, GalViewCollection *collection) { gint i; @@ -384,9 +384,9 @@ gal_define_views_dialog_set_property (GObject *object, guint prop_id, const GVal switch (prop_id) { case PROP_COLLECTION: if (g_value_get_object (value)) - gal_define_views_dialog_set_collection(dialog, GAL_VIEW_COLLECTION(g_value_get_object (value))); + gal_define_views_dialog_set_collection (dialog, GAL_VIEW_COLLECTION (g_value_get_object (value))); else - gal_define_views_dialog_set_collection(dialog, NULL); + gal_define_views_dialog_set_collection (dialog, NULL); break; default: diff --git a/widgets/menus/gal-define-views-dialog.h b/widgets/menus/gal-define-views-dialog.h index da214af36a..feb349e2d3 100644 --- a/widgets/menus/gal-define-views-dialog.h +++ b/widgets/menus/gal-define-views-dialog.h @@ -65,7 +65,7 @@ struct _GalDefineViewsDialogClass { GtkDialogClass parent_class; }; -GType gal_define_views_dialog_get_type(void); +GType gal_define_views_dialog_get_type (void); GtkWidget * gal_define_views_dialog_new (GalViewCollection *collection); G_END_DECLS diff --git a/widgets/menus/gal-define-views-model.c b/widgets/menus/gal-define-views-model.c index 35a18a2484..2274fd8c78 100644 --- a/widgets/menus/gal-define-views-model.c +++ b/widgets/menus/gal-define-views-model.c @@ -33,13 +33,6 @@ G_DEFINE_TYPE (GalDefineViewsModel, gal_define_views_model, E_TABLE_MODEL_TYPE) -/* - * GalDefineViewsModel callbacks - * These are the callbacks that define the behavior of our custom model. - */ -static void gal_define_views_model_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); -static void gal_define_views_model_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); - enum { PROP_0, PROP_EDITABLE, @@ -47,12 +40,64 @@ enum { }; static void -gdvm_dispose(GObject *object) +gal_define_views_model_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) +{ + GalDefineViewsModel *model; + + model = GAL_DEFINE_VIEWS_MODEL (object); + + switch (property_id) { + case PROP_EDITABLE: + model->editable = g_value_get_boolean (value); + return; + + case PROP_COLLECTION: + e_table_model_pre_change (E_TABLE_MODEL (object)); + if (g_value_get_object (value)) + model->collection = GAL_VIEW_COLLECTION ( + g_value_get_object (value)); + else + model->collection = NULL; + e_table_model_changed (E_TABLE_MODEL (object)); + return; + } + + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); +} + +static void +gal_define_views_model_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) +{ + GalDefineViewsModel *model; + + model = GAL_DEFINE_VIEWS_MODEL (object); + + switch (property_id) { + case PROP_EDITABLE: + g_value_set_boolean (value, model->editable); + return; + + case PROP_COLLECTION: + g_value_set_object (value, model->collection); + return; + } + + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); +} + +static void +gdvm_dispose (GObject *object) { - GalDefineViewsModel *model = GAL_DEFINE_VIEWS_MODEL(object); + GalDefineViewsModel *model = GAL_DEFINE_VIEWS_MODEL (object); if (model->collection) - g_object_unref(model->collection); + g_object_unref (model->collection); model->collection = NULL; if (G_OBJECT_CLASS (gal_define_views_model_parent_class)->dispose) @@ -70,9 +115,9 @@ gdvm_col_count (ETableModel *etc) static gint gdvm_row_count (ETableModel *etc) { - GalDefineViewsModel *views = GAL_DEFINE_VIEWS_MODEL(etc); + GalDefineViewsModel *views = GAL_DEFINE_VIEWS_MODEL (etc); if (views->collection) - return gal_view_collection_get_count(views->collection); + return gal_view_collection_get_count (views->collection); else return 0; } @@ -81,10 +126,10 @@ gdvm_row_count (ETableModel *etc) static gpointer gdvm_value_at (ETableModel *etc, gint col, gint row) { - GalDefineViewsModel *views = GAL_DEFINE_VIEWS_MODEL(etc); + GalDefineViewsModel *views = GAL_DEFINE_VIEWS_MODEL (etc); const gchar *value; - value = gal_view_get_title (gal_view_collection_get_view(views->collection, row)); + value = gal_view_get_title (gal_view_collection_get_view (views->collection, row)); return (gpointer)(value ? value : ""); } @@ -93,11 +138,11 @@ gdvm_value_at (ETableModel *etc, gint col, gint row) static void gdvm_set_value_at (ETableModel *etc, gint col, gint row, gconstpointer val) { - GalDefineViewsModel *views = GAL_DEFINE_VIEWS_MODEL(etc); + GalDefineViewsModel *views = GAL_DEFINE_VIEWS_MODEL (etc); if (views->editable) { - e_table_model_pre_change(etc); - gal_view_set_title(gal_view_collection_get_view(views->collection, row), val); - e_table_model_cell_changed(etc, col, row); + e_table_model_pre_change (etc); + gal_view_set_title (gal_view_collection_get_view (views->collection, row), val); + e_table_model_cell_changed (etc, col, row); } } @@ -105,7 +150,7 @@ gdvm_set_value_at (ETableModel *etc, gint col, gint row, gconstpointer val) static gboolean gdvm_is_cell_editable (ETableModel *etc, gint col, gint row) { - return GAL_DEFINE_VIEWS_MODEL(etc)->editable; + return GAL_DEFINE_VIEWS_MODEL (etc)->editable; } static void @@ -117,14 +162,14 @@ gdvm_append_row (ETableModel *etm, ETableModel *source, gint row) static gpointer gdvm_duplicate_value (ETableModel *etc, gint col, gconstpointer value) { - return g_strdup(value); + return g_strdup (value); } /* This function frees the value passed to it. */ static void gdvm_free_value (ETableModel *etc, gint col, gpointer value) { - g_free(value); + g_free (value); } static gpointer @@ -142,7 +187,7 @@ gdvm_value_is_empty (ETableModel *etc, gint col, gconstpointer value) static gchar * gdvm_value_to_string (ETableModel *etc, gint col, gconstpointer value) { - return g_strdup(value); + return g_strdup (value); } /** @@ -156,11 +201,11 @@ void gal_define_views_model_append (GalDefineViewsModel *model, GalView *view) { - ETableModel *etm = E_TABLE_MODEL(model); + ETableModel *etm = E_TABLE_MODEL (model); - e_table_model_pre_change(etm); - gal_view_collection_append(model->collection, view); - e_table_model_row_inserted(etm, gal_view_collection_get_count(model->collection) - 1); + e_table_model_pre_change (etm); + gal_view_collection_append (model->collection, view); + e_table_model_row_inserted (etm, gal_view_collection_get_count (model->collection) - 1); } static void @@ -206,50 +251,6 @@ gal_define_views_model_init (GalDefineViewsModel *model) model->collection = NULL; } -static void -gal_define_views_model_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) -{ - GalDefineViewsModel *model; - - model = GAL_DEFINE_VIEWS_MODEL (object); - - switch (prop_id) { - case PROP_EDITABLE: - model->editable = g_value_get_boolean (value); - break; - - case PROP_COLLECTION: - e_table_model_pre_change(E_TABLE_MODEL(object)); - if (g_value_get_object (value)) - model->collection = GAL_VIEW_COLLECTION(g_value_get_object (value)); - else - model->collection = NULL; - e_table_model_changed(E_TABLE_MODEL(object)); - break; - } -} - -static void -gal_define_views_model_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) -{ - GalDefineViewsModel *model; - - model = GAL_DEFINE_VIEWS_MODEL (object); - - switch (prop_id) { - case PROP_EDITABLE: - g_value_set_boolean (value, model->editable); - break; - - case PROP_COLLECTION: - g_value_set_object (value, model->collection); - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - /** * gal_define_views_model_new * @@ -265,7 +266,7 @@ gal_define_views_model_new (void) et = g_object_new (GAL_DEFINE_VIEWS_MODEL_TYPE, NULL); - return E_TABLE_MODEL(et); + return E_TABLE_MODEL (et); } /** @@ -281,7 +282,7 @@ GalView * gal_define_views_model_get_view (GalDefineViewsModel *model, gint n) { - return gal_view_collection_get_view(model->collection, n); + return gal_view_collection_get_view (model->collection, n); } /** @@ -295,9 +296,9 @@ void gal_define_views_model_delete_view (GalDefineViewsModel *model, gint n) { - e_table_model_pre_change(E_TABLE_MODEL(model)); - gal_view_collection_delete_view(model->collection, n); - e_table_model_row_deleted(E_TABLE_MODEL(model), n); + e_table_model_pre_change (E_TABLE_MODEL (model)); + gal_view_collection_delete_view (model->collection, n); + e_table_model_row_deleted (E_TABLE_MODEL (model), n); } /** @@ -311,8 +312,8 @@ void gal_define_views_model_copy_view (GalDefineViewsModel *model, gint n) { - ETableModel *etm = E_TABLE_MODEL(model); - e_table_model_pre_change(etm); - gal_view_collection_copy_view(model->collection, n); - e_table_model_row_inserted(etm, gal_view_collection_get_count(model->collection) - 1); + ETableModel *etm = E_TABLE_MODEL (model); + e_table_model_pre_change (etm); + gal_view_collection_copy_view (model->collection, n); + e_table_model_row_inserted (etm, gal_view_collection_get_count (model->collection) - 1); } diff --git a/widgets/menus/gal-view-collection.c b/widgets/menus/gal-view-collection.c index 296b634e28..56d8044680 100644 --- a/widgets/menus/gal-view-collection.c +++ b/widgets/menus/gal-view-collection.c @@ -47,7 +47,7 @@ enum { LAST_SIGNAL }; -static guint gal_view_collection_signals [LAST_SIGNAL] = { 0, }; +static guint gal_view_collection_signals[LAST_SIGNAL] = { 0, }; /** * gal_view_collection_display_view: @@ -65,7 +65,7 @@ gal_view_collection_display_view (GalViewCollection *collection, g_return_if_fail (GAL_IS_VIEW (view)); g_signal_emit (collection, - gal_view_collection_signals [DISPLAY_VIEW], 0, + gal_view_collection_signals[DISPLAY_VIEW], 0, view); } @@ -76,20 +76,20 @@ gal_view_collection_changed (GalViewCollection *collection) g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection)); g_signal_emit (collection, - gal_view_collection_signals [CHANGED], 0); + gal_view_collection_signals[CHANGED], 0); } static void gal_view_collection_item_free (GalViewCollectionItem *item) { - g_free(item->id); + g_free (item->id); if (item->view) { if (item->view_changed_id) g_signal_handler_disconnect (item->view, item->view_changed_id); - g_object_unref(item->view); + g_object_unref (item->view); } - g_free(item); + g_free (item); } static gchar * @@ -101,13 +101,13 @@ gal_view_generate_string (GalViewCollection *collection, gchar *pointer; if (which == 1) - ret_val = g_strdup(gal_view_get_title(view)); + ret_val = g_strdup (gal_view_get_title (view)); else 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))) { + for (pointer = ret_val; *pointer; pointer = g_utf8_next_char (pointer)) { + if (!g_unichar_isalnum (g_utf8_get_char (pointer))) { gchar *ptr = pointer; - for (; ptr < g_utf8_next_char(pointer); *ptr = '_', ptr++) + for (; ptr < g_utf8_next_char (pointer); *ptr = '_', ptr++) ; } } @@ -124,11 +124,11 @@ gal_view_check_string (GalViewCollection *collection, return FALSE; for (i = 0; i < collection->view_count; i++) { - if (!strcmp(string, collection->view_data[i]->id)) + if (!strcmp (string, collection->view_data[i]->id)) return FALSE; } for (i = 0; i < collection->removed_view_count; i++) { - if (!strcmp(string, collection->removed_view_data[i]->id)) + if (!strcmp (string, collection->removed_view_data[i]->id)) return FALSE; } return TRUE; @@ -142,17 +142,17 @@ gal_view_generate_id (GalViewCollection *collection, for (i = 1; TRUE; i++) { gchar *try; - try = gal_view_generate_string(collection, view, i); - if (gal_view_check_string(collection, try)) + try = gal_view_generate_string (collection, view, i); + if (gal_view_check_string (collection, try)) return try; - g_free(try); + g_free (try); } } static void gal_view_collection_dispose (GObject *object) { - GalViewCollection *collection = GAL_VIEW_COLLECTION(object); + GalViewCollection *collection = GAL_VIEW_COLLECTION (object); gint i; for (i = 0; i < collection->view_count; i++) { @@ -171,14 +171,14 @@ gal_view_collection_dispose (GObject *object) for (i = 0; i < collection->removed_view_count; i++) { gal_view_collection_item_free (collection->removed_view_data[i]); } - g_free(collection->removed_view_data); + g_free (collection->removed_view_data); collection->removed_view_data = NULL; collection->removed_view_count = 0; - g_free(collection->system_dir); + g_free (collection->system_dir); collection->system_dir = NULL; - g_free(collection->local_dir); + g_free (collection->local_dir); collection->local_dir = NULL; g_free (collection->default_view); @@ -198,7 +198,7 @@ gal_view_collection_class_init (GalViewCollectionClass *klass) object_class->dispose = gal_view_collection_dispose; - gal_view_collection_signals [DISPLAY_VIEW] = + gal_view_collection_signals[DISPLAY_VIEW] = g_signal_new ("display_view", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -207,7 +207,7 @@ gal_view_collection_class_init (GalViewCollectionClass *klass) g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, GAL_TYPE_VIEW); - gal_view_collection_signals [CHANGED] = + gal_view_collection_signals[CHANGED] = g_signal_new ("changed", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -277,11 +277,11 @@ gal_view_collection_set_storage_directories (GalViewCollection *collection, g_return_if_fail (system_dir != NULL); g_return_if_fail (local_dir != NULL); - g_free(collection->system_dir); - g_free(collection->local_dir); + g_free (collection->system_dir); + g_free (collection->local_dir); - collection->system_dir = g_strdup(system_dir); - collection->local_dir = g_strdup(local_dir); + collection->system_dir = g_strdup (system_dir); + collection->local_dir = g_strdup (local_dir); } /** @@ -315,9 +315,9 @@ view_changed (GalView *view, item->changed = TRUE; item->ever_changed = TRUE; - g_signal_handler_block(G_OBJECT(item->view), item->view_changed_id); - gal_view_collection_changed(item->collection); - g_signal_handler_unblock(G_OBJECT(item->view), item->view_changed_id); + g_signal_handler_block (G_OBJECT (item->view), item->view_changed_id); + gal_view_collection_changed (item->collection); + g_signal_handler_unblock (G_OBJECT (item->view), item->view_changed_id); } /* Use factory list to load a GalView file. */ @@ -329,7 +329,7 @@ gal_view_collection_real_load_view_from_file (GalViewCollection *collection, con factory = NULL; for (factories = collection->factory_list; factories; factories = factories->next) { - if (type && !strcmp(gal_view_factory_get_type_code(factories->data), type)) { + if (type && !strcmp (gal_view_factory_get_type_code (factories->data), type)) { factory = factories->data; break; } @@ -339,7 +339,7 @@ gal_view_collection_real_load_view_from_file (GalViewCollection *collection, con view = gal_view_factory_new_view (factory, title); gal_view_set_title (view, title); - gal_view_load(view, filename); + gal_view_load (view, filename); return view; } return NULL; @@ -358,7 +358,7 @@ load_single_file (GalViewCollection *collection, xmlNode *node) { GalViewCollectionItem *item; - item = g_new(GalViewCollectionItem, 1); + item = g_new (GalViewCollectionItem, 1); item->ever_changed = local; item->changed = FALSE; item->built_in = !local; @@ -371,13 +371,13 @@ load_single_file (GalViewCollection *collection, if (item->filename) { gchar *fullpath; - fullpath = g_build_filename(dir, item->filename, NULL); + 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); + g_free (fullpath); if (item->view) { item->view_changed_id = g_signal_connect(item->view, "changed", - G_CALLBACK(view_changed), item); + G_CALLBACK (view_changed), item); } } return item; @@ -409,7 +409,7 @@ load_single_dir (GalViewCollection *collection, g_free (filename); return; } - root = xmlDocGetRootElement(doc); + root = xmlDocGetRootElement (doc); for (child = root->xmlChildrenNode; child; child = child->next) { gchar *id; gboolean found = FALSE; @@ -420,7 +420,7 @@ load_single_dir (GalViewCollection *collection, 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 (!strcmp (id, collection->view_data[i]->id)) { if (!local) collection->view_data[i]->built_in = TRUE; found = TRUE; @@ -429,7 +429,7 @@ load_single_dir (GalViewCollection *collection, } if (!found) { for (i = 0; i < collection->removed_view_count; i++) { - if (!strcmp(id, collection->removed_view_data[i]->id)) { + if (!strcmp (id, collection->removed_view_data[i]->id)) { if (!local) collection->removed_view_data[i]->built_in = TRUE; found = TRUE; @@ -441,16 +441,16 @@ load_single_dir (GalViewCollection *collection, if (!found) { GalViewCollectionItem *item = load_single_file (collection, dir, local, child); if (item->filename && *item->filename) { - collection->view_data = g_renew(GalViewCollectionItem *, collection->view_data, collection->view_count + 1); + collection->view_data = g_renew (GalViewCollectionItem *, collection->view_data, collection->view_count + 1); collection->view_data[collection->view_count] = item; collection->view_count++; } else { - collection->removed_view_data = g_renew(GalViewCollectionItem *, collection->removed_view_data, collection->removed_view_count + 1); + collection->removed_view_data = g_renew (GalViewCollectionItem *, collection->removed_view_data, collection->removed_view_count + 1); collection->removed_view_data[collection->removed_view_count] = item; collection->removed_view_count++; } } - g_free(id); + g_free (id); } default_view = e_xml_get_string_prop_by_name (root, (const guchar *)"default-view"); @@ -463,8 +463,8 @@ load_single_dir (GalViewCollection *collection, collection->default_view = default_view; } - g_free(filename); - xmlFreeDoc(doc); + g_free (filename); + xmlFreeDoc (doc); } /** @@ -487,9 +487,9 @@ gal_view_collection_load (GalViewCollection *collection) if ((g_mkdir_with_parents (collection->local_dir, 0777) == -1) && (errno != EEXIST)) g_warning ("Unable to create dir %s: %s", collection->local_dir, g_strerror(errno)); - load_single_dir(collection, collection->local_dir, TRUE); - load_single_dir(collection, collection->system_dir, FALSE); - gal_view_collection_changed(collection); + load_single_dir (collection, collection->local_dir, TRUE); + load_single_dir (collection, collection->system_dir, FALSE); + gal_view_collection_changed (collection); collection->loaded = TRUE; } @@ -516,7 +516,7 @@ gal_view_collection_save (GalViewCollection *collection) doc = xmlNewDoc((const guchar *)"1.0"); root = xmlNewNode(NULL, (const guchar *)"GalViewCollection"); - xmlDocSetRootElement(doc, root); + xmlDocSetRootElement (doc, root); if (collection->default_view && !collection->default_view_built_in) { e_xml_set_string_prop_by_name(root, (const guchar *)"default-view", collection->default_view); @@ -535,9 +535,9 @@ gal_view_collection_save (GalViewCollection *collection) 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); - gal_view_save(item->view, filename); - g_free(filename); + filename = g_build_filename (collection->local_dir, item->filename, NULL); + gal_view_save (item->view, filename); + g_free (filename); } } } @@ -555,8 +555,8 @@ gal_view_collection_save (GalViewCollection *collection) filename = g_build_filename(collection->local_dir, "galview.xml", NULL); if (e_xml_save_file (filename, doc) == -1) g_warning ("Unable to save view to %s - %s", filename, g_strerror(errno)); - xmlFreeDoc(doc); - g_free(filename); + xmlFreeDoc (doc); + g_free (filename); } /** @@ -608,8 +608,8 @@ gal_view_collection_get_view_item (GalViewCollection *collection, { g_return_val_if_fail (collection != NULL, NULL); g_return_val_if_fail (GAL_IS_VIEW_COLLECTION (collection), NULL); - g_return_val_if_fail(n < collection->view_count, NULL); - g_return_val_if_fail(n >= 0, NULL); + g_return_val_if_fail (n < collection->view_count, NULL); + g_return_val_if_fail (n >= 0, NULL); return collection->view_data[n]; } @@ -630,8 +630,8 @@ 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); - g_return_val_if_fail(n < collection->view_count, NULL); - g_return_val_if_fail(n >= 0, NULL); + g_return_val_if_fail (n < collection->view_count, NULL); + g_return_val_if_fail (n >= 0, NULL); return g_strdup (collection->view_data[n]->id); } @@ -647,27 +647,27 @@ gal_view_collection_append (GalViewCollection *collection, g_return_if_fail (view != NULL); g_return_if_fail (GAL_IS_VIEW (view)); - item = g_new(GalViewCollectionItem, 1); + item = g_new (GalViewCollectionItem, 1); item->ever_changed = TRUE; item->changed = TRUE; item->built_in = FALSE; - item->title = g_strdup(gal_view_get_title(view)); - item->type = g_strdup(gal_view_get_type_code(view)); - item->id = gal_view_generate_id(collection, view); + item->title = g_strdup (gal_view_get_title (view)); + item->type = g_strdup (gal_view_get_type_code (view)); + item->id = gal_view_generate_id (collection, view); item->filename = g_strdup_printf("%s.galview", item->id); item->view = view; item->collection = collection; - g_object_ref(view); + g_object_ref (view); item->view_changed_id = g_signal_connect(item->view, "changed", G_CALLBACK (view_changed), item); - collection->view_data = g_renew(GalViewCollectionItem *, collection->view_data, collection->view_count + 1); + collection->view_data = g_renew (GalViewCollectionItem *, collection->view_data, collection->view_count + 1); collection->view_data[collection->view_count] = item; collection->view_count++; - gal_view_collection_changed(collection); + gal_view_collection_changed (collection); } void @@ -681,20 +681,20 @@ gal_view_collection_delete_view (GalViewCollection *collection, g_return_if_fail (i >= 0 && i < collection->view_count); item = collection->view_data[i]; - memmove(collection->view_data + i, collection->view_data + i + 1, (collection->view_count - i - 1) * sizeof(GalViewCollectionItem *)); + memmove (collection->view_data + i, collection->view_data + i + 1, (collection->view_count - i - 1) * sizeof (GalViewCollectionItem *)); collection->view_count--; if (item->built_in) { - g_free(item->filename); + g_free (item->filename); item->filename = NULL; - collection->removed_view_data = g_renew(GalViewCollectionItem *, collection->removed_view_data, collection->removed_view_count + 1); + collection->removed_view_data = g_renew (GalViewCollectionItem *, collection->removed_view_data, collection->removed_view_count + 1); collection->removed_view_data[collection->removed_view_count] = item; collection->removed_view_count++; } else { gal_view_collection_item_free (item); } - gal_view_collection_changed(collection); + gal_view_collection_changed (collection); } void @@ -710,26 +710,26 @@ gal_view_collection_copy_view (GalViewCollection *collection, view = collection->view_data[i]->view; - item = g_new(GalViewCollectionItem, 1); + item = g_new (GalViewCollectionItem, 1); item->ever_changed = TRUE; item->changed = FALSE; item->built_in = FALSE; - item->title = g_strdup(gal_view_get_title(view)); - item->type = g_strdup(gal_view_get_type_code(view)); - item->id = gal_view_generate_id(collection, view); + item->title = g_strdup (gal_view_get_title (view)); + item->type = g_strdup (gal_view_get_type_code (view)); + item->id = gal_view_generate_id (collection, view); item->filename = g_strdup_printf("%s.galview", item->id); - item->view = gal_view_clone(view); + item->view = gal_view_clone (view); item->collection = collection; item->view_changed_id = g_signal_connect(item->view, "changed", G_CALLBACK (view_changed), item); - collection->view_data = g_renew(GalViewCollectionItem *, collection->view_data, collection->view_count + 1); + collection->view_data = g_renew (GalViewCollectionItem *, collection->view_data, collection->view_count + 1); collection->view_data[collection->view_count] = item; collection->view_count++; - gal_view_collection_changed(collection); + gal_view_collection_changed (collection); } gboolean @@ -752,27 +752,27 @@ gal_view_collection_append_with_title (GalViewCollection *collection, const gcha d(g_print("%s: %p\n", G_STRFUNC, view)); - item = g_new(GalViewCollectionItem, 1); + item = g_new (GalViewCollectionItem, 1); item->ever_changed = TRUE; item->changed = TRUE; item->built_in = FALSE; - item->title = g_strdup(gal_view_get_title(view)); - item->type = g_strdup(gal_view_get_type_code(view)); - item->id = gal_view_generate_id(collection, view); + item->title = g_strdup (gal_view_get_title (view)); + item->type = g_strdup (gal_view_get_type_code (view)); + item->id = gal_view_generate_id (collection, view); item->filename = g_strdup_printf("%s.galview", item->id); item->view = view; item->collection = collection; - g_object_ref(view); + g_object_ref (view); item->view_changed_id = g_signal_connect(item->view, "changed", G_CALLBACK (view_changed), item); - collection->view_data = g_renew(GalViewCollectionItem *, collection->view_data, collection->view_count + 1); + collection->view_data = g_renew (GalViewCollectionItem *, collection->view_data, collection->view_count + 1); collection->view_data[collection->view_count] = item; collection->view_count++; - gal_view_collection_changed(collection); + gal_view_collection_changed (collection); return item->id; } @@ -803,7 +803,7 @@ gal_view_collection_set_nth_view (GalViewCollection *collection, gint i, GalView item->ever_changed = TRUE; item->changed = TRUE; - item->type = g_strdup(gal_view_get_type_code(view)); + item->type = g_strdup (gal_view_get_type_code (view)); item->view_changed_id = g_signal_connect(item->view, "changed", diff --git a/widgets/menus/gal-view-etable.c b/widgets/menus/gal-view-etable.c index 977d58b627..1dcf453c18 100644 --- a/widgets/menus/gal-view-etable.c +++ b/widgets/menus/gal-view-etable.c @@ -61,57 +61,57 @@ config_changed (ETableConfig *config, GalViewEtable *view) { ETableState *state; if (view->state) - g_object_unref(view->state); + g_object_unref (view->state); g_object_get (config, "state", &state, NULL); - view->state = e_table_state_duplicate(state); + view->state = e_table_state_duplicate (state); g_object_unref (state); - gal_view_changed(GAL_VIEW(view)); + gal_view_changed (GAL_VIEW (view)); } static void gal_view_etable_edit (GalView *view, GtkWindow *parent) { - GalViewEtable *etable_view = GAL_VIEW_ETABLE(view); + GalViewEtable *etable_view = GAL_VIEW_ETABLE (view); ETableConfig *config; - config = e_table_config_new(etable_view->title, + config = e_table_config_new (etable_view->title, etable_view->spec, etable_view->state, parent); g_signal_connect(config, "changed", - G_CALLBACK(config_changed), view); + G_CALLBACK (config_changed), view); } static void gal_view_etable_load (GalView *view, const gchar *filename) { - e_table_state_load_from_file(GAL_VIEW_ETABLE(view)->state, filename); + e_table_state_load_from_file (GAL_VIEW_ETABLE (view)->state, filename); } static void gal_view_etable_save (GalView *view, const gchar *filename) { - e_table_state_save_to_file(GAL_VIEW_ETABLE(view)->state, filename); + e_table_state_save_to_file (GAL_VIEW_ETABLE (view)->state, filename); } static const gchar * gal_view_etable_get_title (GalView *view) { - return GAL_VIEW_ETABLE(view)->title; + return GAL_VIEW_ETABLE (view)->title; } static void gal_view_etable_set_title (GalView *view, const gchar *title) { - g_free(GAL_VIEW_ETABLE(view)->title); - GAL_VIEW_ETABLE(view)->title = g_strdup(title); + g_free (GAL_VIEW_ETABLE (view)->title); + GAL_VIEW_ETABLE (view)->title = g_strdup (title); } static const gchar * @@ -125,34 +125,34 @@ gal_view_etable_clone (GalView *view) { GalViewEtable *gve, *new; - gve = GAL_VIEW_ETABLE(view); + gve = GAL_VIEW_ETABLE (view); new = g_object_new (GAL_TYPE_VIEW_ETABLE, NULL); new->spec = gve->spec; new->title = g_strdup (gve->title); - new->state = e_table_state_duplicate(gve->state); + new->state = e_table_state_duplicate (gve->state); - g_object_ref(new->spec); + g_object_ref (new->spec); - return GAL_VIEW(new); + return GAL_VIEW (new); } static void gal_view_etable_dispose (GObject *object) { - GalViewEtable *view = GAL_VIEW_ETABLE(object); + GalViewEtable *view = GAL_VIEW_ETABLE (object); gal_view_etable_detach (view); - g_free(view->title); + g_free (view->title); view->title = NULL; if (view->spec) - g_object_unref(view->spec); + g_object_unref (view->spec); view->spec = NULL; if (view->state) - g_object_unref(view->state); + g_object_unref (view->state); view->state = NULL; if (G_OBJECT_CLASS (gal_view_etable_parent_class)->dispose) @@ -180,7 +180,7 @@ static void gal_view_etable_init (GalViewEtable *gve) { gve->spec = NULL; - gve->state = e_table_state_new(); + gve->state = e_table_state_new (); gve->title = NULL; } @@ -227,16 +227,16 @@ gal_view_etable_construct (GalViewEtable *view, g_return_val_if_fail (E_IS_TABLE_SPECIFICATION (spec), NULL); if (spec) - g_object_ref(spec); + g_object_ref (spec); view->spec = spec; if (view->state) - g_object_unref(view->state); - view->state = e_table_state_duplicate(spec->state); + g_object_unref (view->state); + view->state = e_table_state_duplicate (spec->state); - view->title = g_strdup(title); + view->title = g_strdup (title); - return GAL_VIEW(view); + return GAL_VIEW (view); } void @@ -246,10 +246,10 @@ gal_view_etable_set_state (GalViewEtable *view, ETableState *state) g_return_if_fail (E_IS_TABLE_STATE (state)); if (view->state) - g_object_unref(view->state); - view->state = e_table_state_duplicate(state); + g_object_unref (view->state); + view->state = e_table_state_duplicate (state); - gal_view_changed(GAL_VIEW(view)); + gal_view_changed (GAL_VIEW (view)); } static void @@ -261,7 +261,7 @@ table_state_changed (ETable *table, GalViewEtable *view) g_object_unref (view->state); view->state = state; - gal_view_changed(GAL_VIEW(view)); + gal_view_changed (GAL_VIEW (view)); } static void @@ -273,7 +273,7 @@ tree_state_changed (ETree *tree, GalViewEtable *view) g_object_unref (view->state); view->state = state; - gal_view_changed(GAL_VIEW(view)); + gal_view_changed (GAL_VIEW (view)); } void @@ -286,7 +286,7 @@ gal_view_etable_attach_table (GalViewEtable *view, ETable *table) view->table = table; - e_table_set_state_object(view->table, view->state); + e_table_set_state_object (view->table, view->state); g_object_ref (view->table); view->table_state_changed_id = g_signal_connect(view->table, "state_change", @@ -303,7 +303,7 @@ gal_view_etable_attach_tree (GalViewEtable *view, ETree *tree) view->tree = tree; - e_tree_set_state_object(view->tree, view->state); + e_tree_set_state_object (view->tree, view->state); g_object_ref (view->tree); view->tree_state_changed_id = g_signal_connect(view->tree, "state_change", diff --git a/widgets/menus/gal-view-factory-etable.h b/widgets/menus/gal-view-factory-etable.h index 79aaa161e9..a107b87083 100644 --- a/widgets/menus/gal-view-factory-etable.h +++ b/widgets/menus/gal-view-factory-etable.h @@ -62,7 +62,7 @@ struct _GalViewFactoryEtableClass { GalViewFactoryClass parent_class; }; -GType gal_view_factory_etable_get_type(void); +GType gal_view_factory_etable_get_type (void); ETableSpecification * gal_view_factory_etable_get_specification (GalViewFactoryEtable *factory); diff --git a/widgets/menus/gal-view-instance.c b/widgets/menus/gal-view-instance.c index 0d182608c5..fc5aff0c63 100644 --- a/widgets/menus/gal-view-instance.c +++ b/widgets/menus/gal-view-instance.c @@ -55,7 +55,7 @@ enum { LAST_SIGNAL }; -static guint gal_view_instance_signals [LAST_SIGNAL] = { 0, }; +static guint gal_view_instance_signals[LAST_SIGNAL] = { 0, }; static void gal_view_instance_changed (GalViewInstance *instance) @@ -64,7 +64,7 @@ gal_view_instance_changed (GalViewInstance *instance) g_return_if_fail (GAL_IS_VIEW_INSTANCE (instance)); g_signal_emit (instance, - gal_view_instance_signals [CHANGED], 0); + gal_view_instance_signals[CHANGED], 0); } static void @@ -74,7 +74,7 @@ gal_view_instance_display_view (GalViewInstance *instance, GalView *view) g_return_if_fail (GAL_IS_VIEW_INSTANCE (instance)); g_signal_emit (instance, - gal_view_instance_signals [DISPLAY_VIEW], 0, + gal_view_instance_signals[DISPLAY_VIEW], 0, view); } @@ -86,7 +86,7 @@ save_current_view (GalViewInstance *instance) doc = xmlNewDoc((const guchar *)"1.0"); root = xmlNewNode (NULL, (const guchar *)"GalViewCurrentView"); - xmlDocSetRootElement(doc, root); + xmlDocSetRootElement (doc, root); if (instance->current_id) e_xml_set_string_prop_by_name (root, (const guchar *)"current_view", instance->current_id); @@ -95,7 +95,7 @@ save_current_view (GalViewInstance *instance) 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)); - xmlFreeDoc(doc); + xmlFreeDoc (doc); } static void @@ -105,7 +105,7 @@ view_changed (GalView *view, GalViewInstance *instance) g_free (instance->current_id); instance->current_id = NULL; save_current_view (instance); - gal_view_instance_changed(instance); + gal_view_instance_changed (instance); } gal_view_save (view, instance->custom_filename); @@ -137,8 +137,8 @@ connect_view (GalViewInstance *instance, GalView *view) disconnect_view (instance); instance->current_view = view; - instance->current_title = g_strdup (gal_view_get_title(view)); - instance->current_type = g_strdup (gal_view_get_type_code(view)); + instance->current_title = g_strdup (gal_view_get_title (view)); + instance->current_type = g_strdup (gal_view_get_type_code (view)); instance->view_changed_id = g_signal_connect(instance->current_view, "changed", G_CALLBACK (view_changed), instance); @@ -149,7 +149,7 @@ connect_view (GalViewInstance *instance, GalView *view) static void gal_view_instance_dispose (GObject *object) { - GalViewInstance *instance = GAL_VIEW_INSTANCE(object); + GalViewInstance *instance = GAL_VIEW_INSTANCE (object); if (instance->collection) { if (instance->collection_changed_id) { @@ -179,7 +179,7 @@ gal_view_instance_class_init (GalViewInstanceClass *klass) object_class->dispose = gal_view_instance_dispose; - gal_view_instance_signals [DISPLAY_VIEW] = + gal_view_instance_signals[DISPLAY_VIEW] = g_signal_new ("display_view", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -188,7 +188,7 @@ gal_view_instance_class_init (GalViewInstanceClass *klass) g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, GAL_TYPE_VIEW); - gal_view_instance_signals [CHANGED] = + gal_view_instance_signals[CHANGED] = g_signal_new ("changed", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -197,7 +197,7 @@ gal_view_instance_class_init (GalViewInstanceClass *klass) g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); - gal_view_instance_signals [LOADED] = + gal_view_instance_signals[LOADED] = g_signal_new ("loaded", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_FIRST, @@ -253,10 +253,10 @@ load_current_view (GalViewInstance *instance) #ifdef G_OS_WIN32 gchar *locale_filename = g_win32_locale_filename_from_utf8 (instance->current_view_filename); if (locale_filename != NULL) - doc = xmlParseFile(locale_filename); + doc = xmlParseFile (locale_filename); g_free (locale_filename); #else - doc = xmlParseFile(instance->current_view_filename); + doc = xmlParseFile (instance->current_view_filename); #endif } @@ -270,14 +270,14 @@ load_current_view (GalViewInstance *instance) if (index != -1) { view = gal_view_collection_get_view (instance->collection, index); - view = gal_view_clone(view); + view = gal_view_clone (view); connect_view (instance, view); } } return; } - root = xmlDocGetRootElement(doc); + root = xmlDocGetRootElement (doc); instance->current_id = e_xml_get_string_prop_by_name_with_default (root, (const guchar *)"current_view", NULL); if (instance->current_id != NULL) { @@ -287,7 +287,7 @@ load_current_view (GalViewInstance *instance) if (index != -1) { view = gal_view_collection_get_view (instance->collection, index); - view = gal_view_clone(view); + view = gal_view_clone (view); } } if (view == NULL) { @@ -301,7 +301,7 @@ load_current_view (GalViewInstance *instance) connect_view (instance, view); - xmlFreeDoc(doc); + xmlFreeDoc (doc); } /** @@ -415,11 +415,11 @@ gal_view_instance_set_custom_view (GalViewInstance *instance, GalView *view) connect_view (instance, view); gal_view_save (view, instance->custom_filename); save_current_view (instance); - gal_view_instance_changed(instance); + gal_view_instance_changed (instance); } static void -dialog_response(GtkWidget *dialog, gint 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,8 +436,8 @@ gal_view_instance_save_as (GalViewInstance *instance) dialog = gal_view_instance_save_as_dialog_new (instance); g_signal_connect(dialog, "response", - G_CALLBACK(dialog_response), instance); - gtk_widget_show(dialog); + G_CALLBACK (dialog_response), instance); + gtk_widget_show (dialog); } /* This is idempotent. Once it's been called once, the rest of the calls are ignored. */ diff --git a/widgets/menus/gal-view-new-dialog.c b/widgets/menus/gal-view-new-dialog.c index f364bf0779..1bc9369a48 100644 --- a/widgets/menus/gal-view-new-dialog.c +++ b/widgets/menus/gal-view-new-dialog.c @@ -101,8 +101,8 @@ gal_view_new_dialog_init (GalViewNewDialog *dialog) GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_OK, NULL); - gtk_window_set_resizable (GTK_WINDOW(dialog), TRUE); - gtk_window_set_modal (GTK_WINDOW(dialog), TRUE); + gtk_window_set_resizable (GTK_WINDOW (dialog), TRUE); + gtk_window_set_modal (GTK_WINDOW (dialog), TRUE); gtk_window_set_title (GTK_WINDOW(dialog), _("Define New View")); dialog->collection = NULL; @@ -112,10 +112,10 @@ gal_view_new_dialog_init (GalViewNewDialog *dialog) static void gal_view_new_dialog_dispose (GObject *object) { - GalViewNewDialog *gal_view_new_dialog = GAL_VIEW_NEW_DIALOG(object); + GalViewNewDialog *gal_view_new_dialog = GAL_VIEW_NEW_DIALOG (object); if (gal_view_new_dialog->builder) - g_object_unref(gal_view_new_dialog->builder); + g_object_unref (gal_view_new_dialog->builder); gal_view_new_dialog->builder = NULL; if (G_OBJECT_CLASS (gal_view_new_dialog_parent_class)->dispose) @@ -126,7 +126,7 @@ GtkWidget* gal_view_new_dialog_new (GalViewCollection *collection) { GtkWidget *widget = - gal_view_new_dialog_construct(g_object_new (GAL_VIEW_NEW_DIALOG_TYPE, NULL), + gal_view_new_dialog_construct (g_object_new (GAL_VIEW_NEW_DIALOG_TYPE, NULL), collection); return widget; } @@ -209,16 +209,16 @@ gal_view_new_dialog_construct (GalViewNewDialog *dialog, gtk_tree_view_append_column (GTK_TREE_VIEW (dialog->list), column); iterator = dialog->collection->factory_list; - for (; iterator; iterator = g_list_next(iterator) ) { + for (; iterator; iterator = g_list_next (iterator) ) { GalViewFactory *factory = iterator->data; GtkTreeIter iter; - g_object_ref(factory); + g_object_ref (factory); gtk_list_store_append (dialog->list_store, &iter); gtk_list_store_set (dialog->list_store, &iter, - 0, gal_view_factory_get_title(factory), + 0, gal_view_factory_get_title (factory), 1, factory, -1); } @@ -233,7 +233,7 @@ gal_view_new_dialog_construct (GalViewNewDialog *dialog, sensitize_ok_response (dialog); - return GTK_WIDGET(dialog); + return GTK_WIDGET (dialog); } static void @@ -247,8 +247,8 @@ gal_view_new_dialog_set_property (GObject *object, guint prop_id, const GValue * switch (prop_id) { case PROP_NAME: entry = e_builder_get_widget(dialog->builder, "entry-name"); - if (entry && GTK_IS_ENTRY(entry)) { - gtk_entry_set_text(GTK_ENTRY(entry), g_value_get_string (value)); + if (entry && GTK_IS_ENTRY (entry)) { + gtk_entry_set_text (GTK_ENTRY (entry), g_value_get_string (value)); } break; default: @@ -268,7 +268,7 @@ gal_view_new_dialog_get_property (GObject *object, guint prop_id, GValue *value, switch (prop_id) { case PROP_NAME: entry = e_builder_get_widget(dialog->builder, "entry-name"); - if (entry && GTK_IS_ENTRY(entry)) { + if (entry && GTK_IS_ENTRY (entry)) { g_value_set_string (value, gtk_entry_get_text (GTK_ENTRY (entry))); } break; diff --git a/widgets/menus/gal-view.c b/widgets/menus/gal-view.c index 3b70c7a3f5..f31f2191cd 100644 --- a/widgets/menus/gal-view.c +++ b/widgets/menus/gal-view.c @@ -274,6 +274,6 @@ gal_view_changed (GalView *view) { g_return_if_fail (GAL_IS_VIEW (view)); - g_signal_emit (view, signals [CHANGED], 0); + g_signal_emit (view, signals[CHANGED], 0); } diff --git a/widgets/misc/e-buffer-tagger.c b/widgets/misc/e-buffer-tagger.c index b3d5a4e61e..217ffdb05b 100644 --- a/widgets/misc/e-buffer-tagger.c +++ b/widgets/misc/e-buffer-tagger.c @@ -51,7 +51,7 @@ struct _MagicInsertMatch typedef struct _MagicInsertMatch MagicInsertMatch; -static MagicInsertMatch mim [] = { +static MagicInsertMatch mim[] = { /* prefixed expressions */ { "(news|telnet|nntp|file|http|ftp|sftp|https|webcal)://([-a-z0-9]+(:[-a-z0-9]+)?@)?[-a-z0-9.]+[-a-z0-9](:[0-9]*)?(([.])?/[-a-z0-9_$.+!*(),;:@%&=?/~#']*[^]'.}>\\) ,?!;:\"]?)?", NULL, NULL }, { "(sip|h323|callto):([-_a-z0-9.'\\+]+(:[0-9]{1,5})?(/[-_a-z0-9.']+)?)(@([-_a-z0-9.%=?]+|([0-9]{1,3}.){3}[0-9]{1,3})?)?(:[0-9]{1,5})?", NULL, NULL }, @@ -72,11 +72,11 @@ init_magic_links (void) return; for (i = 0; i < G_N_ELEMENTS (mim); i++) { - mim [i].preg = g_new0 (regex_t, 1); - if (regcomp (mim [i].preg, mim [i].regex, REG_EXTENDED | REG_ICASE)) { + mim[i].preg = g_new0 (regex_t, 1); + if (regcomp (mim[i].preg, mim[i].regex, REG_EXTENDED | REG_ICASE)) { /* error */ - g_free (mim [i].preg); - mim [i].preg = 0; + g_free (mim[i].preg); + mim[i].preg = 0; } } } @@ -87,7 +87,7 @@ markup_text (GtkTextBuffer *buffer) GtkTextIter start, end; gchar *text; gint i; - regmatch_t pmatch [2]; + regmatch_t pmatch[2]; gboolean any; const gchar *str; gint offset = 0; @@ -104,14 +104,14 @@ markup_text (GtkTextBuffer *buffer) while (any) { any = FALSE; for (i = 0; i < G_N_ELEMENTS (mim); i++) { - if (mim [i].preg && !regexec (mim [i].preg, str, 2, pmatch, 0)) { - gtk_text_buffer_get_iter_at_offset (buffer, &start, offset + pmatch [0].rm_so); - gtk_text_buffer_get_iter_at_offset (buffer, &end, offset + pmatch [0].rm_eo); + if (mim[i].preg && !regexec (mim[i].preg, str, 2, pmatch, 0)) { + gtk_text_buffer_get_iter_at_offset (buffer, &start, offset + pmatch[0].rm_so); + gtk_text_buffer_get_iter_at_offset (buffer, &end, offset + pmatch[0].rm_eo); gtk_text_buffer_apply_tag_by_name (buffer, E_BUFFER_TAGGER_LINK_TAG, &start, &end); any = TRUE; - str += pmatch [0].rm_eo; - offset += pmatch [0].rm_eo; + str += pmatch[0].rm_eo; + offset += pmatch[0].rm_eo; break; } } diff --git a/widgets/misc/e-calendar-item.c b/widgets/misc/e-calendar-item.c index d346117a8b..f362046ee3 100644 --- a/widgets/misc/e-calendar-item.c +++ b/widgets/misc/e-calendar-item.c @@ -1326,7 +1326,7 @@ e_calendar_item_draw_month (ECalendarItem *calitem, for (day = 0; day < 7; day++) { layout_set_day_text (calitem, layout, day_index); gdk_draw_layout (drawable, fg_gc, - text_x - calitem->day_widths [day_index], + text_x - calitem->day_widths[day_index], text_y, layout); text_x += (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) @@ -1368,11 +1368,11 @@ get_digit_fomat () gint minor = 0; gint revision = 0; - major = atoi (split [0]); - minor = atoi (split [1]); + major = atoi (split[0]); + minor = atoi (split[1]); if (g_strv_length (split) > 2) - revision = atoi (split [2]); + revision = atoi (split[2]); g_strfreev (split); if (major > 2 || minor > 2 || (minor == 2 && revision > 2)) { diff --git a/widgets/misc/e-canvas-background.c b/widgets/misc/e-canvas-background.c index 6d4a9de5e4..eba6d32659 100644 --- a/widgets/misc/e-canvas-background.c +++ b/widgets/misc/e-canvas-background.c @@ -66,7 +66,7 @@ enum { LAST_SIGNAL }; -static guint ecb_signals [LAST_SIGNAL] = { 0, }; +static guint ecb_signals[LAST_SIGNAL] = { 0, }; enum { PROP_0, @@ -93,7 +93,7 @@ get_color (ECanvasBackground *ecb) static void ecb_bounds (GnomeCanvasItem *item, gdouble *x1, gdouble *y1, gdouble *x2, gdouble *y2) { - gdouble i2c [6]; + gdouble i2c[6]; ArtPoint c1, c2, i1, i2; ECanvasBackground *ecb = E_CANVAS_BACKGROUND (item); @@ -380,7 +380,7 @@ ecb_draw (GnomeCanvasItem *item, { ECanvasBackground *ecb = E_CANVAS_BACKGROUND (item); gint x1, x2, y1, y2; - gdouble i2c [6]; + gdouble i2c[6]; ArtPoint upper_left, lower_right, ecb_base_point; /* @@ -520,7 +520,7 @@ ecb_class_init (ECanvasBackgroundClass *ecb_class) "Y2", 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); - ecb_signals [STYLE_SET] = + ecb_signals[STYLE_SET] = g_signal_new ("style_set", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, diff --git a/widgets/misc/e-canvas.c b/widgets/misc/e-canvas.c index 261d92cf12..11d6c55271 100644 --- a/widgets/misc/e-canvas.c +++ b/widgets/misc/e-canvas.c @@ -727,7 +727,7 @@ idle_handler (gpointer data) /* Reset idle id */ canvas->idle_id = 0; - g_signal_emit (canvas, signals [REFLOW], 0); + g_signal_emit (canvas, signals[REFLOW], 0); GDK_THREADS_LEAVE (); diff --git a/widgets/misc/e-dateedit.c b/widgets/misc/e-dateedit.c index 77f337e4aa..8c870bb7ad 100644 --- a/widgets/misc/e-dateedit.c +++ b/widgets/misc/e-dateedit.c @@ -1829,7 +1829,7 @@ on_date_entry_focus_out (GtkEntry *entry, if (dedit->priv->has_been_changed) { /* The previous one didn't emit changed signal, * but we want it even here, thus doing itself. */ - g_signal_emit (dedit, signals [CHANGED], 0); + g_signal_emit (dedit, signals[CHANGED], 0); dedit->priv->has_been_changed = FALSE; } } else { diff --git a/widgets/misc/e-popup-menu.c b/widgets/misc/e-popup-menu.c index bea993e457..7a74edb84a 100644 --- a/widgets/misc/e-popup-menu.c +++ b/widgets/misc/e-popup-menu.c @@ -95,7 +95,7 @@ e_popup_menu_create_with_domain (EPopupMenu *menu_list, separator = !strcmp ("", menu_list[i].name); - if ((!(separator && last_item_separator)) && !(menu_list [i].disable_mask & hide_mask)) { + if ((!(separator && last_item_separator)) && !(menu_list[i].disable_mask & hide_mask)) { GtkWidget *item = NULL; if (!separator) { diff --git a/widgets/misc/e-printable.c b/widgets/misc/e-printable.c index eb10c8c1fe..bc3233a38a 100644 --- a/widgets/misc/e-printable.c +++ b/widgets/misc/e-printable.c @@ -44,14 +44,14 @@ enum { LAST_SIGNAL }; -static guint e_printable_signals [LAST_SIGNAL] = { 0, }; +static guint e_printable_signals[LAST_SIGNAL] = { 0, }; static void e_printable_class_init (EPrintableClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - e_printable_signals [PRINT_PAGE] = + e_printable_signals[PRINT_PAGE] = g_signal_new ("print_page", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -61,7 +61,7 @@ e_printable_class_init (EPrintableClass *klass) G_TYPE_NONE, 4, G_TYPE_OBJECT, G_TYPE_DOUBLE, G_TYPE_DOUBLE, G_TYPE_BOOLEAN); - e_printable_signals [DATA_LEFT] = + e_printable_signals[DATA_LEFT] = g_signal_new ("data_left", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -70,7 +70,7 @@ e_printable_class_init (EPrintableClass *klass) e_marshal_BOOLEAN__NONE, G_TYPE_BOOLEAN, 0, G_TYPE_NONE); - e_printable_signals [RESET] = + e_printable_signals[RESET] = g_signal_new ("reset", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -79,7 +79,7 @@ e_printable_class_init (EPrintableClass *klass) g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0, G_TYPE_NONE); - e_printable_signals [HEIGHT] = + e_printable_signals[HEIGHT] = g_signal_new ("height", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -89,7 +89,7 @@ e_printable_class_init (EPrintableClass *klass) G_TYPE_DOUBLE, 4, G_TYPE_OBJECT, G_TYPE_DOUBLE, G_TYPE_DOUBLE, G_TYPE_BOOLEAN); - e_printable_signals [WILL_FIT] = + e_printable_signals[WILL_FIT] = g_signal_new ("will_fit", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -129,7 +129,7 @@ e_printable_print_page (EPrintable *e_printable, g_return_if_fail (E_IS_PRINTABLE (e_printable)); g_signal_emit (e_printable, - e_printable_signals [PRINT_PAGE], 0, + e_printable_signals[PRINT_PAGE], 0, context, width, height, @@ -145,7 +145,7 @@ e_printable_data_left (EPrintable *e_printable) g_return_val_if_fail (E_IS_PRINTABLE (e_printable), FALSE); g_signal_emit (e_printable, - e_printable_signals [DATA_LEFT], 0, + e_printable_signals[DATA_LEFT], 0, &ret_val); return ret_val; @@ -158,7 +158,7 @@ e_printable_reset (EPrintable *e_printable) g_return_if_fail (E_IS_PRINTABLE (e_printable)); g_signal_emit (e_printable, - e_printable_signals [RESET], 0); + e_printable_signals[RESET], 0); } gdouble @@ -174,7 +174,7 @@ e_printable_height (EPrintable *e_printable, g_return_val_if_fail (E_IS_PRINTABLE (e_printable), -1); g_signal_emit (e_printable, - e_printable_signals [HEIGHT], 0, + e_printable_signals[HEIGHT], 0, context, width, max_height, @@ -197,7 +197,7 @@ e_printable_will_fit (EPrintable *e_printable, g_return_val_if_fail (E_IS_PRINTABLE (e_printable), FALSE); g_signal_emit (e_printable, - e_printable_signals [WILL_FIT], 0, + e_printable_signals[WILL_FIT], 0, context, width, max_height, diff --git a/widgets/misc/ea-calendar-item.c b/widgets/misc/ea-calendar-item.c index cde4e78494..97528a5639 100644 --- a/widgets/misc/ea-calendar-item.c +++ b/widgets/misc/ea-calendar-item.c @@ -350,18 +350,19 @@ ea_calendar_item_get_description (AtkObject *accessible) static AtkStateSet* ea_calendar_item_ref_state_set (AtkObject *accessible) { - AtkStateSet *state_set; - GObject *g_obj; + AtkStateSet *state_set; + GObject *g_obj; - state_set = ATK_OBJECT_CLASS (parent_class)->ref_state_set (accessible); - g_obj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (accessible)); - if (!g_obj) - return state_set; + state_set = ATK_OBJECT_CLASS (parent_class)->ref_state_set (accessible); + g_obj = atk_gobject_accessible_get_object ( + ATK_GOBJECT_ACCESSIBLE (accessible)); + if (!g_obj) + return state_set; - atk_state_set_add_state (state_set, ATK_STATE_ENABLED); - atk_state_set_add_state (state_set, ATK_STATE_SENSITIVE); + atk_state_set_add_state (state_set, ATK_STATE_ENABLED); + atk_state_set_add_state (state_set, ATK_STATE_SENSITIVE); - return state_set; + return state_set; } static gint diff --git a/widgets/misc/ea-cell-table.c b/widgets/misc/ea-cell-table.c index be859943fd..b183ef9671 100644 --- a/widgets/misc/ea-cell-table.c +++ b/widgets/misc/ea-cell-table.c @@ -38,15 +38,15 @@ ea_cell_table_create (gint rows, gint columns, gboolean column_first) cell_data->column_labels = g_new0 (gchar *, columns); for (index = columns -1; index >= 0; --index) - cell_data->column_labels [index] = NULL; + cell_data->column_labels[index] = NULL; cell_data->row_labels = g_new0 (gchar *, rows); for (index = rows -1; index >= 0; --index) - cell_data->row_labels [index] = NULL; + cell_data->row_labels[index] = NULL; cell_data->cells = g_new0 (gpointer, (columns * rows)); for (index = (columns * rows) -1; index >= 0; --index) - cell_data->cells [index] = NULL; + cell_data->cells[index] = NULL; return cell_data; } @@ -57,13 +57,13 @@ ea_cell_table_destroy (EaCellTable * cell_data) g_return_if_fail (cell_data); for (index = 0; index < cell_data->columns; ++index) - if (cell_data->column_labels [index]) - g_free (cell_data->column_labels [index]); + if (cell_data->column_labels[index]) + g_free (cell_data->column_labels[index]); g_free (cell_data->column_labels); for (index = 0; index < cell_data->rows; ++index) - if (cell_data->row_labels [index]) - g_free (cell_data->row_labels [index]); + if (cell_data->row_labels[index]) + g_free (cell_data->row_labels[index]); g_free (cell_data->row_labels); for (index = (cell_data->columns * cell_data->rows) -1; @@ -119,7 +119,7 @@ ea_cell_table_get_cell_at_index (EaCellTable * cell_data, g_return_val_if_fail (cell_data, NULL); if (index >=0 && index < (cell_data->columns * cell_data->rows)) - return cell_data->cells [index]; + return cell_data->cells[index]; return NULL; } diff --git a/widgets/table/e-cell-checkbox.c b/widgets/table/e-cell-checkbox.c index 9264c37ad4..94dd8f36b2 100644 --- a/widgets/table/e-cell-checkbox.c +++ b/widgets/table/e-cell-checkbox.c @@ -37,7 +37,7 @@ G_DEFINE_TYPE (ECellCheckbox, e_cell_checkbox, E_TYPE_CELL_TOGGLE) -static GdkPixbuf *checks [2]; +static GdkPixbuf *checks[2]; static void ecc_print (ECellView *ecell_view, GtkPrintContext *context, @@ -66,8 +66,8 @@ e_cell_checkbox_class_init (ECellCheckboxClass *klass) ECellClass *ecc = E_CELL_CLASS (klass); ecc->print = ecc_print; - checks [0] = gdk_pixbuf_new_from_xpm_data (check_empty_xpm); - checks [1] = gdk_pixbuf_new_from_xpm_data (check_filled_xpm); + checks[0] = gdk_pixbuf_new_from_xpm_data (check_empty_xpm); + checks[1] = gdk_pixbuf_new_from_xpm_data (check_filled_xpm); } static void diff --git a/widgets/table/e-cell-date-edit.c b/widgets/table/e-cell-date-edit.c index c15cccef73..4080172058 100644 --- a/widgets/table/e-cell-date-edit.c +++ b/widgets/table/e-cell-date-edit.c @@ -63,7 +63,7 @@ static gint e_cell_date_edit_do_popup (ECellPopup *ecp, 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, +static void e_cell_date_edit_select_matching_time (ECellDateEdit *ecde, gchar *time); static void e_cell_date_edit_show_popup (ECellDateEdit *ecde, gint row, @@ -329,11 +329,11 @@ e_cell_date_edit_init (ECellDateEdit *ecde) G_CALLBACK (e_cell_date_edit_on_ok_clicked), ecde); - g_signal_connect((ecde->popup_window), + g_signal_connect ((ecde->popup_window), "key_press_event", G_CALLBACK (e_cell_date_edit_key_press), ecde); - g_signal_connect((ecde->popup_window), + g_signal_connect ((ecde->popup_window), "button_press_event", G_CALLBACK (e_cell_date_edit_button_press), ecde); diff --git a/widgets/table/e-cell-date.c b/widgets/table/e-cell-date.c index 54b19ea851..c005b8371d 100644 --- a/widgets/table/e-cell-date.c +++ b/widgets/table/e-cell-date.c @@ -37,9 +37,9 @@ G_DEFINE_TYPE (ECellDate, e_cell_date, E_TYPE_CELL_TEXT) static gchar * -ecd_get_text(ECellText *cell, ETableModel *model, gint col, gint row) +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 date = GPOINTER_TO_INT (e_table_model_value_at (model, col, row)); const gchar *fmt_component, *fmt_part = NULL; if (date == 0) { @@ -55,9 +55,9 @@ ecd_get_text(ECellText *cell, ETableModel *model, gint col, gint row) } static void -ecd_free_text(ECellText *cell, gchar *text) +ecd_free_text (ECellText *cell, gchar *text) { - g_free(text); + g_free (text); } static void @@ -104,7 +104,7 @@ e_cell_date_new (const gchar *fontname, GtkJustification justify) { ECellDate *ecd = g_object_new (E_TYPE_CELL_DATE, NULL); - e_cell_text_construct(E_CELL_TEXT(ecd), fontname, justify); + e_cell_text_construct (E_CELL_TEXT (ecd), fontname, justify); return (ECell *) ecd; } diff --git a/widgets/table/e-cell-hbox.c b/widgets/table/e-cell-hbox.c index 67c3117b6b..1e6c4a6efc 100644 --- a/widgets/table/e-cell-hbox.c +++ b/widgets/table/e-cell-hbox.c @@ -88,7 +88,7 @@ ecv_kill_view (ECellView *ecv) (hbox_view->cell_view.kill_view_cb)(ecv, hbox_view->cell_view.kill_view_cb_data); if (hbox_view->cell_view.kill_view_cb_data) - g_list_free(hbox_view->cell_view.kill_view_cb_data); + g_list_free (hbox_view->cell_view.kill_view_cb_data); /* kill our subcell view */ for (i = 0; i < hbox_view->subcell_view_count; i++) @@ -195,7 +195,7 @@ ecv_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col if (width < hbox_view->def_size_cols[i]) width = hbox_view->def_size_cols[i]; if (y < subcell_offset + width) - return e_cell_event(hbox_view->subcell_views[i], event, hbox_view->model_cols[i], view_col, row, flags, actions); + return e_cell_event (hbox_view->subcell_views[i], event, hbox_view->model_cols[i], view_col, row, flags, actions); subcell_offset += width; } return 0; @@ -213,7 +213,7 @@ ecv_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) 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); - max_height = MAX(max_height, height); + max_height = MAX (max_height, height); } return max_height; } diff --git a/widgets/table/e-cell-number.c b/widgets/table/e-cell-number.c index c28d5a40cc..3fd5dcb123 100644 --- a/widgets/table/e-cell-number.c +++ b/widgets/table/e-cell-number.c @@ -33,15 +33,15 @@ G_DEFINE_TYPE (ECellNumber, e_cell_number, E_TYPE_CELL_TEXT) static gchar * -ecn_get_text(ECellText *cell, ETableModel *model, gint col, gint row) +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))); + return e_format_number (GPOINTER_TO_INT (e_table_model_value_at (model, col, row))); } static void -ecn_free_text(ECellText *cell, gchar *text) +ecn_free_text (ECellText *cell, gchar *text) { - g_free(text); + g_free (text); } static void @@ -76,7 +76,7 @@ e_cell_number_new (const gchar *fontname, GtkJustification justify) { ECellNumber *ecn = g_object_new (E_TYPE_CELL_NUMBER, NULL); - e_cell_text_construct(E_CELL_TEXT(ecn), fontname, justify); + e_cell_text_construct (E_CELL_TEXT (ecn), fontname, justify); return (ECell *) ecn; } diff --git a/widgets/table/e-cell-percent.c b/widgets/table/e-cell-percent.c index 83c60ce855..5b54527f67 100644 --- a/widgets/table/e-cell-percent.c +++ b/widgets/table/e-cell-percent.c @@ -59,7 +59,7 @@ ecp_get_text (ECellText *cell, ETableModel *model, gint col, gint row) } static void -ecp_free_text(ECellText *cell, gchar *text) +ecp_free_text (ECellText *cell, gchar *text) { /* Do Nothing. */ } @@ -145,7 +145,7 @@ e_cell_percent_new (const gchar *fontname, GtkJustification justify) { ECellPercent *ecn = g_object_new (E_TYPE_CELL_PERCENT, NULL); - e_cell_text_construct (E_CELL_TEXT(ecn), fontname, justify); + e_cell_text_construct (E_CELL_TEXT (ecn), fontname, justify); return (ECell *) ecn; } diff --git a/widgets/table/e-cell-pixbuf.c b/widgets/table/e-cell-pixbuf.c index 1d536026fc..cea43ed53f 100644 --- a/widgets/table/e-cell-pixbuf.c +++ b/widgets/table/e-cell-pixbuf.c @@ -103,7 +103,7 @@ pixbuf_kill_view (ECellView *ecell_view) ecell_view, pixbuf_view->cell_view.kill_view_cb_data); if (pixbuf_view->cell_view.kill_view_cb_data) - g_list_free(pixbuf_view->cell_view.kill_view_cb_data); + g_list_free (pixbuf_view->cell_view.kill_view_cb_data); g_free (pixbuf_view); } diff --git a/widgets/table/e-cell-size.c b/widgets/table/e-cell-size.c index e44cc1e678..90964c8f11 100644 --- a/widgets/table/e-cell-size.c +++ b/widgets/table/e-cell-size.c @@ -32,9 +32,9 @@ G_DEFINE_TYPE (ECellSize, e_cell_size, E_TYPE_CELL_TEXT) static gchar * -ecd_get_text(ECellText *cell, ETableModel *model, gint col, gint row) +ecd_get_text (ECellText *cell, ETableModel *model, gint col, gint row) { - gint size = GPOINTER_TO_INT(e_table_model_value_at(model, col, row)); + gint size = GPOINTER_TO_INT (e_table_model_value_at (model, col, row)); gfloat fsize; if (size < 1024) { @@ -51,9 +51,9 @@ ecd_get_text(ECellText *cell, ETableModel *model, gint col, gint row) } static void -ecd_free_text(ECellText *cell, gchar *text) +ecd_free_text (ECellText *cell, gchar *text) { - g_free(text); + g_free (text); } static void @@ -100,7 +100,7 @@ e_cell_size_new (const gchar *fontname, GtkJustification justify) { ECellSize *ecd = g_object_new (E_TYPE_CELL_SIZE, NULL); - e_cell_text_construct(E_CELL_TEXT(ecd), fontname, justify); + e_cell_text_construct (E_CELL_TEXT (ecd), fontname, justify); return (ECell *) ecd; } diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c index 1c0cb71eeb..51188aa101 100644 --- a/widgets/table/e-cell-text.c +++ b/widgets/table/e-cell-text.c @@ -101,7 +101,7 @@ enum { LAST_SIGNAL }; -static guint signals [LAST_SIGNAL] = { 0 }; +static guint signals[LAST_SIGNAL] = { 0 }; static GdkAtom clipboard_atom = GDK_NONE; @@ -216,7 +216,7 @@ static void update_im_cursor_location (ECellTextView *tv); static gchar * ect_real_get_text (ECellText *cell, ETableModel *model, gint col, gint row) { - return e_table_model_value_at(model, col, row); + return e_table_model_value_at (model, col, row); } static void @@ -355,7 +355,7 @@ ect_kill_view (ECellView *ecv) (text_view->cell_view.kill_view_cb)(ecv, text_view->cell_view.kill_view_cb_data); if (text_view->cell_view.kill_view_cb_data) - g_list_free(text_view->cell_view.kill_view_cb_data); + g_list_free (text_view->cell_view.kill_view_cb_data); g_free (text_view); } @@ -439,13 +439,13 @@ build_attr_list (ECellTextView *text_view, gint row, gint text_length) bold = ect->bold_column >= 0 && row >= 0 && - e_table_model_value_at(ecell_view->e_table_model, ect->bold_column, row); + e_table_model_value_at (ecell_view->e_table_model, ect->bold_column, row); strikeout = ect->strikeout_column >= 0 && row >= 0 && - e_table_model_value_at(ecell_view->e_table_model, ect->strikeout_column, row); + e_table_model_value_at (ecell_view->e_table_model, ect->strikeout_column, row); underline = ect->underline_column >= 0 && row >= 0 && - e_table_model_value_at(ecell_view->e_table_model, ect->underline_column, row); + e_table_model_value_at (ecell_view->e_table_model, ect->underline_column, row); if (bold || strikeout || underline) { if (bold) { @@ -484,7 +484,7 @@ layout_with_preedit (ECellTextView *text_view, gint row, const gchar *text, gint gchar *preedit_string = NULL; gint preedit_length = 0; gint text_length = strlen (text); - gint mlen = MIN(edit->selection_start,text_length); + gint mlen = MIN (edit->selection_start,text_length); gtk_im_context_get_preedit_string (edit->im_context, &preedit_string,&preedit_attrs, @@ -556,7 +556,7 @@ build_layout (ECellTextView *text_view, gint row, const gchar *text, gint width) context = pango_layout_get_context (layout); - font_options = get_font_options(); + font_options = get_font_options (); pango_cairo_context_set_font_options (context, font_options); cairo_font_options_destroy (font_options); pango_layout_context_changed (layout); @@ -622,9 +622,9 @@ generate_layout (ECellTextView *text_view, gint model_col, gint view_col, gint r } if (row >= 0) { - gchar *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); + e_cell_text_free_text (ect, temp); } else layout = build_layout (text_view, row, "Mumbo Jumbo", width); @@ -787,7 +787,7 @@ ect_draw (ECellView *ecell_view, GdkDrawable *drawable, selection_gc = style->base_gc[GTK_STATE_SELECTED]; text_gc = style->text_gc[GTK_STATE_SELECTED]; } else { - selection_gc = style->base_gc [GTK_STATE_ACTIVE]; + selection_gc = style->base_gc[GTK_STATE_ACTIVE]; text_gc = style->text_gc[GTK_STATE_ACTIVE]; } @@ -848,7 +848,7 @@ ect_draw (ECellView *ecell_view, GdkDrawable *drawable, * Get the background color */ static gchar * -ect_get_bg_color(ECellView *ecell_view, gint row) +ect_get_bg_color (ECellView *ecell_view, gint row) { ECellText *ect = E_CELL_TEXT (ecell_view->ecell); gchar *color_spec; @@ -897,7 +897,7 @@ ect_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col CellEdit *edit = text_view->edit; GtkWidget *canvas = GTK_WIDGET (text_view->canvas); gint return_val = 0; - d(gboolean press = FALSE); + d (gboolean press = FALSE); if (!(flags & E_CELL_EDITING)) return 0; @@ -1022,7 +1022,7 @@ ect_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col break; case GDK_BUTTON_PRESS: /* Fall Through */ - d(press = TRUE); + d (press = TRUE); case GDK_BUTTON_RELEASE: d(g_print ("%s: %s\n", __FUNCTION__, press ? "GDK_BUTTON_PRESS" : "GDK_BUTTON_RELEASE")); event->button.x -= 4; @@ -1158,7 +1158,7 @@ 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); + ECellText *ect = E_CELL_TEXT (ecell_view->ecell); gchar *temp; edit = g_new0 (CellEdit, 1); @@ -1208,15 +1208,15 @@ ect_enter_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row) edit->pointer_in = FALSE; edit->default_cursor_shown = TRUE; - temp = e_cell_text_get_text(ect, ecell_view->e_table_model, model_col, row); + temp = e_cell_text_get_text (ect, ecell_view->e_table_model, model_col, row); edit->old_text = g_strdup (temp); - e_cell_text_free_text(ect, temp); + e_cell_text_free_text (ect, temp); edit->text = g_strdup (edit->old_text); #if 0 if (edit->pointer_in) { if (edit->default_cursor_shown) { - gdk_window_set_cursor (GTK_WIDGET(item->canvas)->window, text_view->i_cursor); + gdk_window_set_cursor (GTK_WIDGET (item->canvas)->window, text_view->i_cursor); edit->default_cursor_shown = FALSE; } } @@ -1316,9 +1316,9 @@ ect_print (ECellView *ecell_view, GtkPrintContext *context, PangoLayout *layout; PangoContext *pango_context; PangoFontMetrics *font_metrics; - ECellText *ect = E_CELL_TEXT(ecell_view->ecell); + ECellText *ect = E_CELL_TEXT (ecell_view->ecell); ECellTextView *ectView = (ECellTextView *)ecell_view; - GtkWidget *canvas = GTK_WIDGET(ectView->canvas); + GtkWidget *canvas = GTK_WIDGET (ectView->canvas); GtkStyle *style; PangoDirection dir; gboolean strikeout, underline; @@ -1327,7 +1327,7 @@ ect_print (ECellView *ecell_view, GtkPrintContext *context, gdouble ty, ly, text_width = 0.0, text_height = 0.0; cr = gtk_print_context_get_cairo_context (context); - string = e_cell_text_get_text(ect, ecell_view->e_table_model, model_col, row); + string = e_cell_text_get_text (ect, ecell_view->e_table_model, model_col, row); cairo_save (cr); layout = gtk_print_context_create_pango_layout (context); @@ -1337,15 +1337,15 @@ ect_print (ECellView *ecell_view, GtkPrintContext *context, pango_layout_set_text (layout, string, -1); get_font_size (layout, font_des, string, &text_width, &text_height); - cairo_move_to(cr, 2, 2); + cairo_move_to (cr, 2, 2); cairo_rectangle (cr, 2, 2, width + 2, height + 2); - cairo_clip(cr); + cairo_clip (cr); style = gtk_widget_get_style (canvas); pango_context = gtk_widget_get_pango_context (canvas); font_metrics = pango_context_get_metrics ( pango_context, style->font_desc, - pango_context_get_language(pango_context)); + pango_context_get_language (pango_context)); ty = (gdouble)(text_height - pango_font_metrics_get_ascent (font_metrics) - pango_font_metrics_get_descent (font_metrics)) / 2.0 /(gdouble)PANGO_SCALE; @@ -1353,9 +1353,9 @@ ect_print (ECellView *ecell_view, GtkPrintContext *context, strikeout = ect->strikeout_column >= 0 && row >= 0 && e_table_model_value_at (ecell_view->e_table_model, ect->strikeout_column, row); underline = ect->underline_column >= 0 && row >= 0 && - e_table_model_value_at(ecell_view->e_table_model, ect->underline_column, row); + e_table_model_value_at (ecell_view->e_table_model, ect->underline_column, row); - dir = pango_find_base_dir (string, strlen(string)); + dir = pango_find_base_dir (string, strlen (string)); if (underline) { ly = ty + (gdouble)pango_font_metrics_get_underline_position (font_metrics)/(gdouble)PANGO_SCALE; @@ -1388,15 +1388,15 @@ ect_print (ECellView *ecell_view, GtkPrintContext *context, cairo_stroke (cr); } - cairo_move_to(cr, 2, text_height- 5); + cairo_move_to (cr, 2, text_height- 5); pango_layout_set_width (layout, (width - 4)*PANGO_SCALE); pango_layout_set_wrap (layout, PANGO_WRAP_CHAR); - pango_cairo_show_layout(cr, layout); + pango_cairo_show_layout (cr, layout); cairo_restore (cr); pango_font_description_free (font_des); g_object_unref (layout); - e_cell_text_free_text(ect, string); + e_cell_text_free_text (ect, string); } static gdouble @@ -1413,12 +1413,12 @@ ect_print_height (ECellView *ecell_view, GtkPrintContext *context, */ PangoFontDescription *font_des; PangoLayout *layout; - ECellText *ect = E_CELL_TEXT(ecell_view->ecell); + ECellText *ect = E_CELL_TEXT (ecell_view->ecell); gchar *string; gdouble text_width = 0.0, text_height = 0.0; gint lines=1; - string = e_cell_text_get_text(ect, ecell_view->e_table_model, model_col, row); + string = e_cell_text_get_text (ect, ecell_view->e_table_model, model_col, row); layout = gtk_print_context_create_pango_layout (context); font_des = pango_font_description_from_string ("sans 10"); /* fix me font hardcoded */ @@ -1611,7 +1611,7 @@ e_cell_text_class_init (ECellTextClass *klass) object_class->get_property = ect_get_property; object_class->set_property = ect_set_property; - signals [TEXT_INSERTED] = + signals[TEXT_INSERTED] = g_signal_new ("text_inserted", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_FIRST, @@ -1622,7 +1622,7 @@ e_cell_text_class_init (ECellTextClass *klass) G_TYPE_POINTER, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT); - signals [TEXT_DELETED] = + signals[TEXT_DELETED] = g_signal_new ("text_deleted", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_FIRST, @@ -1782,7 +1782,7 @@ e_cell_text_commit_cb (GtkIMContext *context, command.action = E_TEP_INSERT; command.position = E_TEP_SELECTION; command.string = (gchar *)str; - command.value = strlen(str); + command.value = strlen (str); e_cell_text_view_command (edit->tep, &command, edit); } @@ -1875,7 +1875,7 @@ e_cell_text_new (const gchar *fontname, GtkJustification justify) { ECellText *ect = g_object_new (E_TYPE_CELL_TEXT, NULL); - e_cell_text_construct(ect, fontname, justify); + e_cell_text_construct (ect, fontname, justify); return (ECell *) ect; } @@ -1897,11 +1897,11 @@ e_cell_text_construct (ECellText *cell, GtkJustification justify) { if (!cell) - return E_CELL(NULL); + return E_CELL (NULL); if (fontname) cell->font_name = g_strdup (fontname); cell->justify = justify; - return E_CELL(cell); + return E_CELL (cell); } gchar * @@ -2213,7 +2213,7 @@ _get_position (ECellTextView *text_view, ETextEventProcessorCommand *command) return edit->selection_end; } - g_return_val_if_reached(0); + g_return_val_if_reached (0); return 0; /* Kill warning */ } @@ -2255,7 +2255,7 @@ _insert (ECellTextView *text_view, const gchar *string, gint value) if (value <= 0) return; - edit->selection_start = MIN (strlen(edit->text), edit->selection_start); + edit->selection_start = MIN (strlen (edit->text), edit->selection_start); temp = g_new (gchar, strlen (edit->text) + value + 1); @@ -2355,8 +2355,8 @@ e_cell_text_view_command (ETextEventProcessor *tep, ETextEventProcessorCommand * break; case E_TEP_SELECT: edit->selection_end = _get_position (text_view, command); - sel_start = MIN(edit->selection_start, edit->selection_end); - sel_end = MAX(edit->selection_start, edit->selection_end); + sel_start = MIN (edit->selection_start, edit->selection_end); + sel_end = MAX (edit->selection_start, edit->selection_end); if (sel_start != sel_end) { e_cell_text_view_supply_selection (edit, command->time, GDK_SELECTION_PRIMARY, edit->text + sel_start, @@ -2390,8 +2390,8 @@ e_cell_text_view_command (ETextEventProcessor *tep, ETextEventProcessorCommand * change = TRUE; break; case E_TEP_COPY: - sel_start = MIN(edit->selection_start, edit->selection_end); - sel_end = MAX(edit->selection_start, edit->selection_end); + sel_start = MIN (edit->selection_start, edit->selection_end); + sel_end = MAX (edit->selection_start, edit->selection_end); if (sel_start != sel_end) { e_cell_text_view_supply_selection (edit, command->time, clipboard_atom, edit->text + sel_start, @@ -2525,7 +2525,7 @@ _get_tep (CellEdit *edit) edit->tep = e_text_event_processor_emacs_like_new (); g_signal_connect (edit->tep, "command", - G_CALLBACK(e_cell_text_view_command), + G_CALLBACK (e_cell_text_view_command), (gpointer) edit); } } diff --git a/widgets/table/e-cell-toggle.c b/widgets/table/e-cell-toggle.c index 08a9d8dcc3..35e06fbe79 100644 --- a/widgets/table/e-cell-toggle.c +++ b/widgets/table/e-cell-toggle.c @@ -275,7 +275,7 @@ cell_toggle_event (ECellView *ecell_view, return FALSE; /* Fall through */ case GDK_BUTTON_PRESS: - if (!e_table_model_is_cell_editable(ecell_view->e_table_model, model_col, row)) + if (!e_table_model_is_cell_editable (ecell_view->e_table_model, model_col, row)) return FALSE; etog_set_value (toggle_view, model_col, view_col, row, value + 1); @@ -327,7 +327,7 @@ cell_toggle_print (ECellView *ecell_view, image = g_ptr_array_index (priv->pixbufs, value); if (image) { cr = gtk_print_context_get_cairo_context (context); - cairo_save(cr); + cairo_save (cr); cairo_translate (cr, 0 , 0); image = gdk_pixbuf_add_alpha (image, TRUE, 255, 255, 255); image_width = (gdouble)gdk_pixbuf_get_width (image); @@ -338,7 +338,7 @@ cell_toggle_print (ECellView *ecell_view, cairo_clip (cr); gdk_cairo_set_source_pixbuf (cr, image, 0, image_height / 4); cairo_paint (cr); - cairo_restore(cr); + cairo_restore (cr); } } diff --git a/widgets/table/e-cell-tree.c b/widgets/table/e-cell-tree.c index 781579da24..7733b2af17 100644 --- a/widgets/table/e-cell-tree.c +++ b/widgets/table/e-cell-tree.c @@ -94,9 +94,9 @@ e_cell_tree_get_tree_table_adapter (ETableModel *table_model, gint row) static gint 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); - ETreePath path = e_cell_tree_get_node(model, row); + ETreeModel *tree_model = e_cell_tree_get_tree_model (model, row); + ETreeTableAdapter *adapter = e_cell_tree_get_tree_table_adapter (model, row); + ETreePath path = e_cell_tree_get_node (model, row); return (e_tree_model_node_depth (tree_model, path) - (e_tree_table_adapter_root_node_is_visible (adapter) ? 0 : 1)); } @@ -107,12 +107,12 @@ visible_depth_of_node (ETableModel *model, gint row) static gint 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); + ETreeModel *tree_model = e_cell_tree_get_tree_model (table_model, row); + ETreePath path = e_cell_tree_get_node (table_model, row); if (visible_depth_of_node (table_model, row) >= 0 || - e_tree_model_node_is_expandable(tree_model, path)) { - return (visible_depth_of_node(table_model, row) + 1) * INDENT_AMOUNT; + e_tree_model_node_is_expandable (tree_model, path)) { + return (visible_depth_of_node (table_model, row) + 1) * INDENT_AMOUNT; } else { return 0; } @@ -154,7 +154,7 @@ ect_kill_view (ECellView *ecv) (tree_view->cell_view.kill_view_cb)(ecv, tree_view->cell_view.kill_view_cb_data); if (tree_view->cell_view.kill_view_cb_data) - g_list_free(tree_view->cell_view.kill_view_cb_data); + g_list_free (tree_view->cell_view.kill_view_cb_data); /* kill our subcell view */ e_cell_kill_view (tree_view->subcell_view); @@ -210,12 +210,12 @@ draw_retro_expander (ECellTreeView *ectv, GdkDrawable *drawable, gboolean expand { GdkPixbuf *image; gint image_width, image_height; - ECellTree *ect = E_CELL_TREE(ectv->cell_view.ecell); + ECellTree *ect = E_CELL_TREE (ectv->cell_view.ecell); image = expanded ? ect->open_pixbuf : ect->closed_pixbuf; - image_width = gdk_pixbuf_get_width(image); - image_height = gdk_pixbuf_get_height(image); + image_width = gdk_pixbuf_get_width (image); + image_height = gdk_pixbuf_get_height (image); gdk_draw_pixbuf (drawable, NULL, @@ -255,8 +255,8 @@ ect_draw (ECellView *ecell_view, GdkDrawable *drawable, 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); - ETreeTableAdapter *tree_table_adapter = e_cell_tree_get_tree_table_adapter(ecell_view->e_table_model, row); + 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; GdkRectangle rect, *clip_rect = NULL; GtkWidget *canvas = GTK_WIDGET (tree_view->canvas); @@ -311,15 +311,15 @@ ect_draw (ECellView *ecell_view, GdkDrawable *drawable, clip_rect = ▭ if (selected) { - foreground = &style->text [GTK_STATE_SELECTED]; + foreground = &style->text[GTK_STATE_SELECTED]; } else { - foreground = &style->text [GTK_STATE_NORMAL]; + foreground = &style->text[GTK_STATE_NORMAL]; } gdk_gc_set_foreground (tree_view->gc, foreground); /* draw our lines */ - if (tree_view->retro_look && E_CELL_TREE(tree_view->cell_view.ecell)->draw_lines) { + if (tree_view->retro_look && E_CELL_TREE (tree_view->cell_view.ecell)->draw_lines) { gint depth; @@ -348,7 +348,7 @@ ect_draw (ECellView *ecell_view, GdkDrawable *drawable, offset -= INDENT_AMOUNT; depth = visible_depth_of_node (ecell_view->e_table_model, row) - 1; while (parent_node && depth != 0) { - if (e_tree_table_adapter_node_get_next(tree_table_adapter, parent_node)) { + if (e_tree_table_adapter_node_get_next (tree_table_adapter, parent_node)) { gdk_draw_line (drawable, tree_view->gc, rect.x + offset - INDENT_AMOUNT / 2, rect.y, @@ -495,7 +495,7 @@ ect_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col GdkWindow *window; 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); + 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); gint offset = offset_of_node (ecell_view->e_table_model, row); gint result; @@ -508,7 +508,7 @@ ect_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col if (event_in_expander (event, offset, 0)) { if (e_tree_model_node_is_expandable (tree_model, node)) { - gboolean expanded = e_tree_table_adapter_node_is_expanded(etta, node); + gboolean expanded = e_tree_table_adapter_node_is_expanded (etta, node); if (tree_view->retro_look) e_tree_table_adapter_node_set_expanded (etta, node, !expanded); else { @@ -590,7 +590,7 @@ ect_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col } adjust_event_position (event, -offset); - result = e_cell_event(tree_view->subcell_view, event, model_col, view_col, row, flags, actions); + result = e_cell_event (tree_view->subcell_view, event, model_col, view_col, row, flags, actions); adjust_event_position (event, offset); return result; @@ -616,7 +616,7 @@ ect_max_width (ECellView *ecell_view, gint model_col, gint view_col) subcell_max_width = e_cell_max_width (tree_view->subcell_view, model_col, view_col); for (row = 0; row < number_of_rows; row++) { - ETreeModel *tree_model = e_cell_tree_get_tree_model(ecell_view->e_table_model, row); + ETreeModel *tree_model = e_cell_tree_get_tree_model (ecell_view->e_table_model, row); ETreePath node; GdkPixbuf *node_image; gint node_image_width = 0; @@ -624,7 +624,7 @@ ect_max_width (ECellView *ecell_view, gint model_col, gint view_col) 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); + ETreeTableAdapter *tree_table_adapter = e_cell_tree_get_tree_table_adapter (ecell_view->e_table_model, row); #endif node = e_cell_tree_get_node (ecell_view->e_table_model, row); @@ -657,10 +657,10 @@ ect_max_width (ECellView *ecell_view, gint model_col, gint view_col) GdkPixbuf *image; image = (expanded - ? E_CELL_TREE(tree_view->cell_view.ecell)->open_pixbuf - : E_CELL_TREE(tree_view->cell_view.ecell)->closed_pixbuf); + ? E_CELL_TREE (tree_view->cell_view.ecell)->open_pixbuf + : E_CELL_TREE (tree_view->cell_view.ecell)->closed_pixbuf); - width += gdk_pixbuf_get_width(image); + width += gdk_pixbuf_get_width (image); } #endif @@ -717,7 +717,7 @@ ect_print (ECellView *ecell_view, GtkPrintContext *context, if (/* XXX only if we're the active sort */ TRUE) { 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); + 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); gint offset = offset_of_node (ecell_view->e_table_model, row); gint subcell_offset = offset; @@ -725,7 +725,7 @@ ect_print (ECellView *ecell_view, GtkPrintContext *context, 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) { + if (E_CELL_TREE (tree_view->cell_view.ecell)->draw_lines) { gint depth; if (!e_tree_model_node_is_root (tree_model, node) @@ -753,7 +753,7 @@ ect_print (ECellView *ecell_view, GtkPrintContext *context, depth = visible_depth_of_node (ecell_view->e_table_model, row) - 1; offset -= INDENT_AMOUNT; while (node && depth != 0) { - if (e_tree_table_adapter_node_get_next(tree_table_adapter, node)) { + if (e_tree_table_adapter_node_get_next (tree_table_adapter, node)) { cairo_move_to (cr, offset - INDENT_AMOUNT / 2, height); diff --git a/widgets/table/e-cell-vbox.c b/widgets/table/e-cell-vbox.c index af3ac2e181..f752e14834 100644 --- a/widgets/table/e-cell-vbox.c +++ b/widgets/table/e-cell-vbox.c @@ -82,7 +82,7 @@ ecv_kill_view (ECellView *ecv) (vbox_view->cell_view.kill_view_cb)(ecv, vbox_view->cell_view.kill_view_cb_data); if (vbox_view->cell_view.kill_view_cb_data) - g_list_free(vbox_view->cell_view.kill_view_cb_data); + g_list_free (vbox_view->cell_view.kill_view_cb_data); /* kill our subcell view */ for (i = 0; i < vbox_view->subcell_view_count; i++) @@ -181,7 +181,7 @@ ecv_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col for (i = 0; i < vbox_view->subcell_view_count; i++) { 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); + return e_cell_event (vbox_view->subcell_views[i], event, vbox_view->model_cols[i], view_col, row, flags, actions); subcell_offset += height; } return 0; @@ -215,7 +215,7 @@ ecv_max_width (ECellView *ecell_view, gint model_col, gint view_col) for (i = 0; i < vbox_view->subcell_view_count; i++) { gint width = e_cell_max_width (vbox_view->subcell_views[i], vbox_view->model_cols[i], view_col); - max_width = MAX(width, max_width); + max_width = MAX (width, max_width); } return max_width; diff --git a/widgets/table/e-cell.c b/widgets/table/e-cell.c index 6833ccfd43..c45ed680d4 100644 --- a/widgets/table/e-cell.c +++ b/widgets/table/e-cell.c @@ -171,7 +171,7 @@ e_cell_init (ECell *cell) gint 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 ( + return ECVIEW_EC_CLASS (ecell_view)->event ( ecell_view, event, model_col, view_col, row, flags, actions); } @@ -208,7 +208,7 @@ e_cell_new_view (ECell *ecell, ETableModel *table_model, gpointer e_table_item_v void e_cell_realize (ECellView *ecell_view) { - ECVIEW_EC_CLASS(ecell_view)->realize (ecell_view); + ECVIEW_EC_CLASS (ecell_view)->realize (ecell_view); } /** @@ -220,7 +220,7 @@ e_cell_realize (ECellView *ecell_view) void e_cell_kill_view (ECellView *ecell_view) { - ECVIEW_EC_CLASS(ecell_view)->kill_view (ecell_view); + ECVIEW_EC_CLASS (ecell_view)->kill_view (ecell_view); } /** @@ -234,7 +234,7 @@ e_cell_kill_view (ECellView *ecell_view) void e_cell_unrealize (ECellView *ecell_view) { - ECVIEW_EC_CLASS(ecell_view)->unrealize (ecell_view); + ECVIEW_EC_CLASS (ecell_view)->unrealize (ecell_view); } /** @@ -263,9 +263,9 @@ e_cell_draw (ECellView *ecell_view, GdkDrawable *drawable, { g_return_if_fail (ecell_view != NULL); g_return_if_fail (row >= 0); - g_return_if_fail (row < e_table_model_row_count(ecell_view->e_table_model)); + g_return_if_fail (row < e_table_model_row_count (ecell_view->e_table_model)); - ECVIEW_EC_CLASS(ecell_view)->draw (ecell_view, drawable, model_col, view_col, row, flags, x1, y1, x2, y2); + ECVIEW_EC_CLASS (ecell_view)->draw (ecell_view, drawable, model_col, view_col, row, flags, x1, y1, x2, y2); } /** @@ -285,8 +285,8 @@ e_cell_print (ECellView *ecell_view, GtkPrintContext *context, gint model_col, gint view_col, gint row, gdouble width, gdouble height) { - if (ECVIEW_EC_CLASS(ecell_view)->print) - ECVIEW_EC_CLASS(ecell_view)->print (ecell_view, context, model_col, view_col, row, width, height); + if (ECVIEW_EC_CLASS (ecell_view)->print) + ECVIEW_EC_CLASS (ecell_view)->print (ecell_view, context, model_col, view_col, row, width, height); } /** @@ -299,8 +299,8 @@ e_cell_print_height (ECellView *ecell_view, GtkPrintContext *context, gint model_col, gint view_col, gint row, gdouble width) { - if (ECVIEW_EC_CLASS(ecell_view)->print_height) - return ECVIEW_EC_CLASS(ecell_view)->print_height + if (ECVIEW_EC_CLASS (ecell_view)->print_height) + return ECVIEW_EC_CLASS (ecell_view)->print_height (ecell_view, context, model_col, view_col, row, width); else return 0.0; @@ -319,7 +319,7 @@ e_cell_print_height (ECellView *ecell_view, GtkPrintContext *context, 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); + return ECVIEW_EC_CLASS (ecell_view)->height (ecell_view, model_col, view_col, row); } /** @@ -335,7 +335,7 @@ e_cell_height (ECellView *ecell_view, gint model_col, gint view_col, gint 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); + return ECVIEW_EC_CLASS (ecell_view)->enter_edit (ecell_view, model_col, view_col, row); } /** @@ -352,7 +352,7 @@ e_cell_enter_edit (ECellView *ecell_view, gint model_col, gint view_col, gint ro void 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); + ECVIEW_EC_CLASS (ecell_view)->leave_edit (ecell_view, model_col, view_col, row, edit_context); } /** @@ -372,8 +372,8 @@ e_cell_leave_edit (ECellView *ecell_view, gint model_col, gint view_col, gint ro 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); + 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); else return NULL; } @@ -392,8 +392,8 @@ e_cell_save_state (ECellView *ecell_view, gint model_col, gint view_col, gint ro void 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); + 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); } /** @@ -410,8 +410,8 @@ e_cell_load_state (ECellView *ecell_view, gint model_col, gint view_col, gint ro void 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); + if (ECVIEW_EC_CLASS (ecell_view)->free_state) + ECVIEW_EC_CLASS (ecell_view)->free_state (ecell_view, model_col, view_col, row, save_state); } /** @@ -426,7 +426,7 @@ e_cell_free_state (ECellView *ecell_view, gint model_col, gint view_col, gint ro gint e_cell_max_width (ECellView *ecell_view, gint model_col, gint view_col) { - return ECVIEW_EC_CLASS(ecell_view)->max_width + return ECVIEW_EC_CLASS (ecell_view)->max_width (ecell_view, model_col, view_col); } @@ -443,8 +443,8 @@ 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) { - if (ECVIEW_EC_CLASS(ecell_view)->max_width_by_row) - return ECVIEW_EC_CLASS(ecell_view)->max_width_by_row + if (ECVIEW_EC_CLASS (ecell_view)->max_width_by_row) + return ECVIEW_EC_CLASS (ecell_view)->max_width_by_row (ecell_view, model_col, view_col, row); else return e_cell_max_width (ecell_view, model_col, view_col); @@ -463,22 +463,22 @@ e_cell_max_width_by_row (ECellView *ecell_view, gint model_col, gint view_col, g gboolean e_cell_max_width_by_row_implemented (ECellView *ecell_view) { - return (ECVIEW_EC_CLASS(ecell_view)->max_width_by_row != NULL); + return (ECVIEW_EC_CLASS (ecell_view)->max_width_by_row != NULL); } gchar * -e_cell_get_bg_color(ECellView *ecell_view, gint 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); + if (ECVIEW_EC_CLASS (ecell_view)->get_bg_color) + return ECVIEW_EC_CLASS (ecell_view)->get_bg_color (ecell_view, row); else return NULL; } void -e_cell_style_set(ECellView *ecell_view, GtkStyle *previous_style) +e_cell_style_set (ECellView *ecell_view, GtkStyle *previous_style) { - if (ECVIEW_EC_CLASS(ecell_view)->style_set) - ECVIEW_EC_CLASS(ecell_view)->style_set (ecell_view, previous_style); + if (ECVIEW_EC_CLASS (ecell_view)->style_set) + ECVIEW_EC_CLASS (ecell_view)->style_set (ecell_view, previous_style); } diff --git a/widgets/table/e-table-click-to-add.c b/widgets/table/e-table-click-to-add.c index e50d0f4274..3d5a374382 100644 --- a/widgets/table/e-table-click-to-add.c +++ b/widgets/table/e-table-click-to-add.c @@ -47,7 +47,7 @@ enum { LAST_SIGNAL }; -static guint etcta_signals [LAST_SIGNAL] = { 0 }; +static guint etcta_signals[LAST_SIGNAL] = { 0 }; /* workaround for avoiding APi breakage */ #define etcta_get_type e_table_click_to_add_get_type @@ -66,7 +66,7 @@ static void etcta_cursor_change (GtkObject *object, gint row, gint col, ETableClickToAdd *etcta) { g_signal_emit (etcta, - etcta_signals [CURSOR_CHANGE], 0, + etcta_signals[CURSOR_CHANGE], 0, row, col); } @@ -100,7 +100,7 @@ etcta_add_table_header (ETableClickToAdd *etcta, ETableHeader *header) if (etcta->eth) g_object_ref (etcta->eth); if (etcta->row) - gnome_canvas_item_set(GNOME_CANVAS_ITEM(etcta->row), + gnome_canvas_item_set (GNOME_CANVAS_ITEM (etcta->row), "ETableHeader", header, NULL); } @@ -122,10 +122,10 @@ etcta_add_one (ETableClickToAdd *etcta, ETableModel *one) if (etcta->one) g_object_ref (etcta->one); if (etcta->row) - gnome_canvas_item_set(GNOME_CANVAS_ITEM(etcta->row), + gnome_canvas_item_set (GNOME_CANVAS_ITEM (etcta->row), "ETableModel", one, NULL); - g_object_set(etcta->selection, + g_object_set (etcta->selection, "model", one, NULL); } @@ -137,7 +137,7 @@ etcta_drop_one (ETableClickToAdd *etcta) return; g_object_unref (etcta->one); etcta->one = NULL; - g_object_set(etcta->selection, + g_object_set (etcta->selection, "model", NULL, NULL); } @@ -163,13 +163,13 @@ etcta_drop_model (ETableClickToAdd *etcta) static void etcta_add_message (ETableClickToAdd *etcta, const gchar *message) { - etcta->message = g_strdup(message); + etcta->message = g_strdup (message); } static void etcta_drop_message (ETableClickToAdd *etcta) { - g_free(etcta->message); + g_free (etcta->message); etcta->message = NULL; } @@ -204,11 +204,11 @@ etcta_set_property (GObject *object, switch (prop_id) { case PROP_HEADER: etcta_drop_table_header (etcta); - etcta_add_table_header (etcta, E_TABLE_HEADER(g_value_get_object (value))); + etcta_add_table_header (etcta, E_TABLE_HEADER (g_value_get_object (value))); break; case PROP_MODEL: etcta_drop_model (etcta); - etcta_add_model (etcta, E_TABLE_MODEL(g_value_get_object (value))); + etcta_add_model (etcta, E_TABLE_MODEL (g_value_get_object (value))); break; case PROP_MESSAGE: etcta_drop_message (etcta); @@ -217,15 +217,15 @@ etcta_set_property (GObject *object, case PROP_WIDTH: etcta->width = g_value_get_double (value); if (etcta->row) - gnome_canvas_item_set(etcta->row, + gnome_canvas_item_set (etcta->row, "minimum_width", etcta->width, NULL); if (etcta->text) - gnome_canvas_item_set(etcta->text, + gnome_canvas_item_set (etcta->text, "width", etcta->width - 4, NULL); if (etcta->rect) - gnome_canvas_item_set(etcta->rect, + gnome_canvas_item_set (etcta->rect, "x2", etcta->width - 1, NULL); break; @@ -234,7 +234,7 @@ etcta_set_property (GObject *object, return; } - gnome_canvas_item_request_update(item); + gnome_canvas_item_request_update (item); } static void @@ -285,7 +285,7 @@ etcta_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *p g_value_set_object (value, etcta->model); break; case PROP_MESSAGE: - g_value_set_string (value, g_strdup(etcta->message)); + g_value_set_string (value, g_strdup (etcta->message)); break; case PROP_WIDTH: g_value_set_double (value, etcta->width); @@ -334,7 +334,7 @@ item_key_press (ETableItem *item, case GDK_KP_Enter: case GDK_ISO_Enter: case GDK_3270_Enter: - finish_editing(etcta); + finish_editing (etcta); return TRUE; } return FALSE; @@ -343,7 +343,7 @@ item_key_press (ETableItem *item, static void set_initial_selection (ETableClickToAdd *etcta) { - e_selection_model_do_something (E_SELECTION_MODEL(etcta->selection), + e_selection_model_do_something (E_SELECTION_MODEL (etcta->selection), 0, e_table_header_prioritized_column (etcta->eth), 0); } @@ -355,19 +355,19 @@ finish_editing (ETableClickToAdd *etcta) ETableModel *one; e_table_item_leave_edit (E_TABLE_ITEM (etcta->row)); - e_table_one_commit(E_TABLE_ONE(etcta->one)); + e_table_one_commit (E_TABLE_ONE (etcta->one)); etcta_drop_one (etcta); - gtk_object_destroy(GTK_OBJECT (etcta->row)); + gtk_object_destroy (GTK_OBJECT (etcta->row)); etcta->row = NULL; - one = e_table_one_new(etcta->model); + one = e_table_one_new (etcta->model); etcta_add_one (etcta, one); g_object_unref (one); - e_selection_model_clear(E_SELECTION_MODEL(etcta->selection)); + e_selection_model_clear (E_SELECTION_MODEL (etcta->selection)); - etcta->row = gnome_canvas_item_new(GNOME_CANVAS_GROUP(etcta), - e_table_item_get_type(), + etcta->row = gnome_canvas_item_new (GNOME_CANVAS_GROUP (etcta), + e_table_item_get_type (), "ETableHeader", etcta->eth, "ETableModel", etcta->one, "minimum_width", etcta->width, @@ -378,7 +378,7 @@ finish_editing (ETableClickToAdd *etcta) NULL); g_signal_connect(etcta->row, "key_press", - G_CALLBACK(item_key_press), etcta); + G_CALLBACK (item_key_press), etcta); set_initial_selection (etcta); } @@ -398,24 +398,24 @@ etcta_event (GnomeCanvasItem *item, GdkEvent *e) case GDK_BUTTON_PRESS: if (etcta->text) { - gtk_object_destroy(GTK_OBJECT (etcta->text)); + gtk_object_destroy (GTK_OBJECT (etcta->text)); etcta->text = NULL; } if (etcta->rect) { - gtk_object_destroy(GTK_OBJECT (etcta->rect)); + gtk_object_destroy (GTK_OBJECT (etcta->rect)); etcta->rect = NULL; } if (!etcta->row) { ETableModel *one; - one = e_table_one_new(etcta->model); + one = e_table_one_new (etcta->model); etcta_add_one (etcta, one); g_object_unref (one); - e_selection_model_clear(E_SELECTION_MODEL(etcta->selection)); + e_selection_model_clear (E_SELECTION_MODEL (etcta->selection)); - etcta->row = gnome_canvas_item_new(GNOME_CANVAS_GROUP(item), - e_table_item_get_type(), + etcta->row = gnome_canvas_item_new (GNOME_CANVAS_GROUP (item), + e_table_item_get_type (), "ETableHeader", etcta->eth, "ETableModel", etcta->one, "minimum_width", etcta->width, @@ -428,7 +428,7 @@ etcta_event (GnomeCanvasItem *item, GdkEvent *e) g_signal_connect(etcta->row, "key_press", G_CALLBACK (item_key_press), etcta); - e_canvas_item_grab_focus (GNOME_CANVAS_ITEM(etcta->row), TRUE); + e_canvas_item_grab_focus (GNOME_CANVAS_ITEM (etcta->row), TRUE); set_initial_selection (etcta); } @@ -447,7 +447,7 @@ etcta_event (GnomeCanvasItem *item, GdkEvent *e) if (etcta->row) { e_table_item_leave_edit (E_TABLE_ITEM (etcta->row)); etcta_drop_one (etcta); - gtk_object_destroy(GTK_OBJECT (etcta->row)); + gtk_object_destroy (GTK_OBJECT (etcta->row)); etcta->row = NULL; create_rect_and_text (etcta); e_canvas_item_move_absolute (etcta->text, 3, 3); @@ -470,32 +470,32 @@ etcta_reflow (GnomeCanvasItem *item, gint flags) gdouble old_height = etcta->height; if (etcta->text) { - g_object_get(etcta->text, + g_object_get (etcta->text, "height", &etcta->height, NULL); etcta->height += 6; } if (etcta->row) { - g_object_get(etcta->row, + g_object_get (etcta->row, "height", &etcta->height, NULL); } if (etcta->rect) { - g_object_set(etcta->rect, + g_object_set (etcta->rect, "y2", etcta->height - 1, NULL); } if (old_height != etcta->height) - e_canvas_item_request_parent_reflow(item); + e_canvas_item_request_parent_reflow (item); } static void etcta_class_init (ETableClickToAddClass *klass) { - GnomeCanvasItemClass *item_class = GNOME_CANVAS_ITEM_CLASS(klass); - GObjectClass *object_class = G_OBJECT_CLASS(klass); + GnomeCanvasItemClass *item_class = GNOME_CANVAS_ITEM_CLASS (klass); + GObjectClass *object_class = G_OBJECT_CLASS (klass); klass->cursor_change = NULL; klass->style_set = etcta_style_set; @@ -543,7 +543,7 @@ etcta_class_init (ETableClickToAddClass *klass) 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READABLE | G_PARAM_LAX_VALIDATION)); - etcta_signals [CURSOR_CHANGE] = + etcta_signals[CURSOR_CHANGE] = g_signal_new ("cursor_change", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -552,7 +552,7 @@ etcta_class_init (ETableClickToAddClass *klass) e_marshal_VOID__INT_INT, G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT); - etcta_signals [STYLE_SET] = + etcta_signals[STYLE_SET] = g_signal_new ("style_set", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -583,7 +583,7 @@ etcta_init (ETableClickToAdd *etcta) etcta->width = 12; etcta->height = 6; - etcta->selection = e_table_selection_model_new(); + etcta->selection = e_table_selection_model_new (); g_signal_connect(etcta->selection, "cursor_changed", G_CALLBACK (etcta_cursor_change), etcta); @@ -608,9 +608,9 @@ void e_table_click_to_add_commit (ETableClickToAdd *etcta) { if (etcta->row) { - e_table_one_commit(E_TABLE_ONE(etcta->one)); + e_table_one_commit (E_TABLE_ONE (etcta->one)); etcta_drop_one (etcta); - gtk_object_destroy(GTK_OBJECT (etcta->row)); + gtk_object_destroy (GTK_OBJECT (etcta->row)); etcta->row = NULL; } create_rect_and_text (etcta); diff --git a/widgets/table/e-table-column-specification.c b/widgets/table/e-table-column-specification.c index 0f6acd7fc6..e4e642db4f 100644 --- a/widgets/table/e-table-column-specification.c +++ b/widgets/table/e-table-column-specification.c @@ -41,15 +41,15 @@ G_DEFINE_TYPE (ETableColumnSpecification, etcs, G_TYPE_OBJECT) static void free_strings (ETableColumnSpecification *etcs) { - g_free(etcs->title); + g_free (etcs->title); etcs->title = NULL; - g_free(etcs->pixbuf); + g_free (etcs->pixbuf); etcs->pixbuf = NULL; - g_free(etcs->cell); + g_free (etcs->cell); etcs->cell = NULL; - g_free(etcs->compare); + g_free (etcs->compare); etcs->compare = NULL; - g_free(etcs->search); + g_free (etcs->search); etcs->search = NULL; g_free (etcs->sortable); etcs->sortable = NULL; @@ -60,7 +60,7 @@ etcs_finalize (GObject *object) { ETableColumnSpecification *etcs = E_TABLE_COLUMN_SPECIFICATION (object); - free_strings(etcs); + free_strings (etcs); G_OBJECT_CLASS (etcs_parent_class)->finalize (object); } @@ -104,7 +104,7 @@ void e_table_column_specification_load_from_node (ETableColumnSpecification *etcs, const xmlNode *node) { - free_strings(etcs); + free_strings (etcs); 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); diff --git a/widgets/table/e-table-config.c b/widgets/table/e-table-config.c index dd8d995d4a..cce43dc3c8 100644 --- a/widgets/table/e-table-config.c +++ b/widgets/table/e-table-config.c @@ -60,7 +60,7 @@ enum { COLUMN_VALUE }; -static guint e_table_config_signals [LAST_SIGNAL] = { 0, }; +static guint e_table_config_signals[LAST_SIGNAL] = { 0, }; static void config_finalize (GObject *object) @@ -96,7 +96,7 @@ e_table_config_changed (ETableConfig *config, ETableState *state) { g_return_if_fail (E_IS_TABLE_CONFIG (config)); - g_signal_emit(G_OBJECT(config), e_table_config_signals [CHANGED], 0, state); + g_signal_emit (G_OBJECT (config), e_table_config_signals[CHANGED], 0, state); } static void @@ -136,7 +136,7 @@ e_table_config_class_init (ETableConfigClass *klass) object_class->finalize = config_finalize; object_class->get_property = config_get_property; - e_table_config_signals [CHANGED] = + e_table_config_signals[CHANGED] = g_signal_new ("changed", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, @@ -269,28 +269,28 @@ update_sort_and_group_config_dialog (ETableConfig *config, gboolean is_sort) if (is_sort) { count = e_table_sort_info_sorting_get_count ( config->temp_state->sort_info); - widgets = &config->sort [0]; + widgets = &config->sort[0]; } else { count = e_table_sort_info_grouping_get_count ( config->temp_state->sort_info); - widgets = &config->group [0]; + widgets = &config->group[0]; } for (i = 0; i < 4; i++) { gboolean sensitive = (i <= count); const gchar *text = ""; - gtk_widget_set_sensitive (widgets [i].frames, sensitive); + gtk_widget_set_sensitive (widgets[i].frames, sensitive); /* * Sorting is set, auto select the text */ g_signal_handler_block ( - widgets [i].radio_ascending, - widgets [i].toggled_id); + widgets[i].radio_ascending, + widgets[i].toggled_id); g_signal_handler_block ( - widgets [i].combo, - widgets [i].changed_id); + widgets[i].combo, + widgets[i].changed_id); if (i < count) { GtkToggleButton *a, *d; @@ -322,21 +322,25 @@ update_sort_and_group_config_dialog (ETableConfig *config, gboolean is_sort) * Update radio buttons */ a = GTK_TOGGLE_BUTTON ( - widgets [i].radio_ascending); + widgets[i].radio_ascending); d = GTK_TOGGLE_BUTTON ( - widgets [i].radio_descending); + widgets[i].radio_descending); gtk_toggle_button_set_active (col.ascending ? a:d, 1); } else { GtkToggleButton *t; t = GTK_TOGGLE_BUTTON ( - widgets [i].radio_ascending); + widgets[i].radio_ascending); if (is_sort) - g_return_if_fail (widgets [i].radio_ascending != config->group [i].radio_ascending); + g_return_if_fail ( + widgets[i].radio_ascending != + config->group[i].radio_ascending); else - g_return_if_fail (widgets [i].radio_ascending != config->sort [i].radio_ascending); + g_return_if_fail ( + widgets[i].radio_ascending != + config->sort[i].radio_ascending); gtk_toggle_button_set_active (t, 1); } @@ -345,11 +349,11 @@ update_sort_and_group_config_dialog (ETableConfig *config, gboolean is_sort) GTK_COMBO_BOX (widgets[i].combo), text); g_signal_handler_unblock ( - widgets [i].radio_ascending, - widgets [i].toggled_id); + widgets[i].radio_ascending, + widgets[i].toggled_id); g_signal_handler_unblock ( - widgets [i].combo, - widgets [i].changed_id); + widgets[i].combo, + widgets[i].changed_id); } } @@ -384,10 +388,10 @@ config_sort_info_update (ETableConfig *config) g_string_append (res, ", "); } - if (res->str [0] == 0) + if (res->str[0] == 0) g_string_append (res, _("Not sorted")); - gtk_label_set_text (GTK_LABEL(config->sort_label), res->str); + gtk_label_set_text (GTK_LABEL (config->sort_label), res->str); g_string_free (res, TRUE); } @@ -425,7 +429,7 @@ config_group_info_update (ETableConfig *config) if ((i+1) != count) g_string_append (res, ", "); } - if (res->str [0] == 0) + if (res->str[0] == 0) g_string_append (res, _("No grouping")); gtk_label_set_text (GTK_LABEL (config->group_label), res->str); @@ -450,7 +454,7 @@ setup_fields (ETableConfig *config) idx++; e_table_subset_variable_add (config->shown_model, idx); - e_table_without_hide (config->available_model, GINT_TO_POINTER(idx)); + e_table_without_hide (config->available_model, GINT_TO_POINTER (idx)); } } e_table_model_thaw ((ETableModel *)config->available_model); @@ -470,7 +474,7 @@ config_fields_info_update (ETableConfig *config) if ((*column)->disabled) continue; - if (config->state->columns [i] != j) + if (config->state->columns[i] != j) continue; g_string_append (res, dgettext (config->domain, (*column)->title)); @@ -497,15 +501,16 @@ do_sort_and_group_config_dialog (ETableConfig *config, gboolean is_sort) gtk_widget_grab_focus (GTK_WIDGET ( is_sort - ? config->sort [0].combo - : config->group [0].combo)); + ? config->sort[0].combo + : config->group[0].combo)); if (is_sort) dialog = GTK_DIALOG (config->dialog_sort); else dialog = GTK_DIALOG (config->dialog_group_by); - gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (config->dialog_toplevel)); + gtk_window_set_transient_for ( + GTK_WINDOW (dialog), GTK_WINDOW (config->dialog_toplevel)); do { response = gtk_dialog_run (dialog); @@ -572,7 +577,7 @@ do_fields_config_dialog (ETableConfig *config) GTK_WINDOW (config->dialog_toplevel)); do { - response = gtk_dialog_run (GTK_DIALOG(config->dialog_show_fields)); + response = gtk_dialog_run (GTK_DIALOG (config->dialog_show_fields)); switch (response) { case GTK_RESPONSE_OK: g_object_unref (config->state); @@ -624,9 +629,11 @@ create_store (ETableConfig *config) } static const gchar *spec = -"<ETableSpecification gettext-domain=\"" GETTEXT_PACKAGE "\" no-headers=\"true\" cursor-mode=\"line\" " -" draw-grid=\"false\" draw-focus=\"true\" selection-mode=\"browse\">" -"<ETableColumn model_col= \"0\" _title=\"Name\" minimum_width=\"30\" resizable=\"true\" cell=\"string\" compare=\"string\"/>" +"<ETableSpecification gettext-domain=\"" GETTEXT_PACKAGE "\"" +" no-headers=\"true\" cursor-mode=\"line\" draw-grid=\"false\" " +" draw-focus=\"true\" selection-mode=\"browse\">" +"<ETableColumn model_col= \"0\" _title=\"Name\" minimum_width=\"30\"" +" resizable=\"true\" cell=\"string\" compare=\"string\"/>" "<ETableState> <column source=\"0\"/>" "<grouping/>" "</ETableState>" @@ -741,7 +748,10 @@ e_table_proxy_gtk_combo_text_new (void) } static void -connect_button (ETableConfig *config, GtkBuilder *builder, const gchar *widget_name, GCallback cback) +connect_button (ETableConfig *config, + GtkBuilder *builder, + const gchar *widget_name, + GCallback cback) { GtkWidget *button = e_builder_get_widget (builder, widget_name); @@ -755,9 +765,12 @@ static gint get_source_model_col_index (ETableConfig *config, gint idx) { gint visible_index; - ETableModel *src_model = E_TABLE_SUBSET (config->available_model)->source; + ETableModel *src_model; + + src_model = E_TABLE_SUBSET (config->available_model)->source; - visible_index = e_table_subset_view_to_model_row (E_TABLE_SUBSET (config->available_model), idx); + visible_index = e_table_subset_view_to_model_row ( + E_TABLE_SUBSET (config->available_model), idx); return GPOINTER_TO_INT (e_table_model_value_at (src_model, 1, visible_index)); } @@ -822,32 +835,34 @@ configure_sort_dialog (ETableConfig *config, GtkBuilder *builder) const gchar *algs[] = {"alignment4", "alignment3", "alignment2", "alignment1", NULL}; for (i = 0; i < 4; i++) { - gchar buffer [80]; + gchar buffer[80]; snprintf (buffer, sizeof (buffer), "sort-combo-%d", i + 1); - config->sort [i].combo = e_table_proxy_gtk_combo_text_new (); - gtk_widget_show (GTK_WIDGET (config->sort [i].combo)); - gtk_container_add (GTK_CONTAINER (e_builder_get_widget (builder, algs [i])), config->sort [i].combo); + config->sort[i].combo = e_table_proxy_gtk_combo_text_new (); + gtk_widget_show (GTK_WIDGET (config->sort[i].combo)); + gtk_container_add ( + GTK_CONTAINER (e_builder_get_widget ( + builder, algs[i])), config->sort[i].combo); configure_combo_box_add ( GTK_COMBO_BOX (config->sort[i].combo), "", ""); snprintf (buffer, sizeof (buffer), "frame-sort-%d", i + 1); - config->sort [i].frames = + config->sort[i].frames = e_builder_get_widget (builder, buffer); snprintf ( buffer, sizeof (buffer), "radiobutton-ascending-sort-%d", i+1); - config->sort [i].radio_ascending = e_builder_get_widget ( + config->sort[i].radio_ascending = e_builder_get_widget ( builder, buffer); snprintf ( buffer, sizeof (buffer), "radiobutton-descending-sort-%d", i+1); - config->sort [i].radio_descending = e_builder_get_widget ( + config->sort[i].radio_descending = e_builder_get_widget ( builder, buffer); - config->sort [i].e_table_config = config; + config->sort[i].e_table_config = config; } for (l = config->column_names; l; l = l->next) { @@ -864,15 +879,15 @@ configure_sort_dialog (ETableConfig *config, GtkBuilder *builder) * After we have runtime modified things, signal connect */ for (i = 0; i < 4; i++) { - config->sort [i].changed_id = g_signal_connect ( - config->sort [i].combo, + config->sort[i].changed_id = g_signal_connect ( + config->sort[i].combo, "changed", G_CALLBACK (sort_combo_changed), - &config->sort [i]); + &config->sort[i]); - config->sort [i].toggled_id = g_signal_connect ( - config->sort [i].radio_ascending, + config->sort[i].toggled_id = g_signal_connect ( + config->sort[i].radio_ascending, "toggled", G_CALLBACK (sort_ascending_toggled), - &config->sort [i]); + &config->sort[i]); } } @@ -936,39 +951,41 @@ configure_group_dialog (ETableConfig *config, GtkBuilder *builder) const gchar *vboxes[] = {"vbox7", "vbox9", "vbox11", "vbox13", NULL}; for (i = 0; i < 4; i++) { - gchar buffer [80]; + gchar buffer[80]; snprintf (buffer, sizeof (buffer), "group-combo-%d", i + 1); - config->group [i].combo = e_table_proxy_gtk_combo_text_new (); - gtk_widget_show (GTK_WIDGET (config->group [i].combo)); - gtk_box_pack_start (GTK_BOX (e_builder_get_widget (builder, vboxes [i])), config->group [i].combo, FALSE, FALSE, 0); + config->group[i].combo = e_table_proxy_gtk_combo_text_new (); + gtk_widget_show (GTK_WIDGET (config->group[i].combo)); + gtk_box_pack_start ( + GTK_BOX (e_builder_get_widget (builder, vboxes[i])), + config->group[i].combo, FALSE, FALSE, 0); configure_combo_box_add ( GTK_COMBO_BOX (config->group[i].combo), "", ""); snprintf (buffer, sizeof (buffer), "frame-group-%d", i + 1); - config->group [i].frames = + config->group[i].frames = e_builder_get_widget (builder, buffer); snprintf ( buffer, sizeof (buffer), "radiobutton-ascending-group-%d", i+1); - config->group [i].radio_ascending = e_builder_get_widget ( + config->group[i].radio_ascending = e_builder_get_widget ( builder, buffer); snprintf ( buffer, sizeof (buffer), "radiobutton-descending-group-%d", i+1); - config->group [i].radio_descending = e_builder_get_widget ( + config->group[i].radio_descending = e_builder_get_widget ( builder, buffer); snprintf ( buffer, sizeof (buffer), "checkbutton-group-%d", i+1); - config->group [i].view_check = e_builder_get_widget ( + config->group[i].view_check = e_builder_get_widget ( builder, buffer); - config->group [i].e_table_config = config; + config->group[i].e_table_config = config; } for (l = config->column_names; l; l = l->next) { @@ -985,15 +1002,15 @@ configure_group_dialog (ETableConfig *config, GtkBuilder *builder) * After we have runtime modified things, signal connect */ for (i = 0; i < 4; i++) { - config->group [i].changed_id = g_signal_connect ( - config->group [i].combo, + config->group[i].changed_id = g_signal_connect ( + config->group[i].combo, "changed", G_CALLBACK (group_combo_changed), - &config->group [i]); + &config->group[i]); - config->group [i].toggled_id = g_signal_connect ( - config->group [i].radio_ascending, + config->group[i].toggled_id = g_signal_connect ( + config->group[i].radio_ascending, "toggled", G_CALLBACK (group_ascending_toggled), - &config->group [i]); + &config->group[i]); } } @@ -1017,12 +1034,20 @@ config_button_add (GtkWidget *widget, ETableConfig *config) count = g_list_length (columns); - config->temp_state->columns = g_renew (int, config->temp_state->columns, config->temp_state->col_count + count); - config->temp_state->expansions = g_renew (double, config->temp_state->expansions, config->temp_state->col_count + count); + config->temp_state->columns = g_renew ( + int, config->temp_state->columns, + config->temp_state->col_count + count); + config->temp_state->expansions = g_renew ( + gdouble, config->temp_state->expansions, + config->temp_state->col_count + count); i = config->temp_state->col_count; for (column = columns; column; column = column->next) { - config->temp_state->columns[i] = get_source_model_col_index (config, GPOINTER_TO_INT (column->data)); - config->temp_state->expansions[i] = config->source_spec->columns[config->temp_state->columns[i]]->expansion; + config->temp_state->columns[i] = + get_source_model_col_index ( + config, GPOINTER_TO_INT (column->data)); + config->temp_state->expansions[i] = + config->source_spec->columns + [config->temp_state->columns[i]]->expansion; i++; } config->temp_state->col_count += count; @@ -1043,12 +1068,22 @@ config_button_remove (GtkWidget *widget, ETableConfig *config) for (column = columns; column; column = column->next) { gint row = GPOINTER_TO_INT (column->data); - memmove (config->temp_state->columns + row, config->temp_state->columns + row + 1, sizeof (gint) * (config->temp_state->col_count - row - 1)); - memmove (config->temp_state->expansions + row, config->temp_state->expansions + row + 1, sizeof (gdouble) * (config->temp_state->col_count - row - 1)); + memmove ( + config->temp_state->columns + row, + config->temp_state->columns + row + 1, + sizeof (gint) * (config->temp_state->col_count - row - 1)); + memmove ( + config->temp_state->expansions + row, + config->temp_state->expansions + row + 1, + sizeof (gdouble) * (config->temp_state->col_count - row - 1)); config->temp_state->col_count--; } - config->temp_state->columns = g_renew (int, config->temp_state->columns, config->temp_state->col_count); - config->temp_state->expansions = g_renew (double, config->temp_state->expansions, config->temp_state->col_count); + config->temp_state->columns = g_renew ( + int, config->temp_state->columns, + config->temp_state->col_count); + config->temp_state->expansions = g_renew ( + gdouble, config->temp_state->expansions, + config->temp_state->col_count); g_list_free (columns); @@ -1180,7 +1215,9 @@ configure_fields_dialog (ETableConfig *config, GtkBuilder *builder) "model", &config->available_model, NULL); gtk_widget_show_all (etable); - gtk_label_set_mnemonic_widget (GTK_LABEL (e_builder_get_widget (builder, "label-available")), etable); + gtk_label_set_mnemonic_widget ( + GTK_LABEL (e_builder_get_widget ( + builder, "label-available")), etable); /* "custom-shown" widget */ etable = e_table_proxy_etable_shown_new (store); @@ -1192,12 +1229,22 @@ configure_fields_dialog (ETableConfig *config, GtkBuilder *builder) "model", &config->shown_model, NULL); gtk_widget_show_all (etable); - gtk_label_set_mnemonic_widget (GTK_LABEL (e_builder_get_widget (builder, "label-displayed")), etable); - - connect_button (config, builder, "button-add", G_CALLBACK (config_button_add)); - connect_button (config, builder, "button-remove", G_CALLBACK (config_button_remove)); - connect_button (config, builder, "button-up", G_CALLBACK (config_button_up)); - connect_button (config, builder, "button-down", G_CALLBACK (config_button_down)); + gtk_label_set_mnemonic_widget ( + GTK_LABEL (e_builder_get_widget ( + builder, "label-displayed")), etable); + + connect_button ( + config, builder, "button-add", + G_CALLBACK (config_button_add)); + connect_button ( + config, builder, "button-remove", + G_CALLBACK (config_button_remove)); + connect_button ( + config, builder, "button-up", + G_CALLBACK (config_button_up)); + connect_button ( + config, builder, "button-down", + G_CALLBACK (config_button_down)); setup_fields (config); diff --git a/widgets/table/e-table-config.h b/widgets/table/e-table-config.h index c3f994a635..4f690c97cc 100644 --- a/widgets/table/e-table-config.h +++ b/widgets/table/e-table-config.h @@ -73,8 +73,8 @@ typedef struct { GtkWidget *group_label; GtkWidget *fields_label; - ETableConfigSortWidgets sort [4]; - ETableConfigSortWidgets group [4]; + ETableConfigSortWidgets sort[4]; + ETableConfigSortWidgets group[4]; ETable *available; ETableWithout *available_model; diff --git a/widgets/table/e-table-field-chooser-dialog.c b/widgets/table/e-table-field-chooser-dialog.c index c05506d953..440446e80f 100644 --- a/widgets/table/e-table-field-chooser-dialog.c +++ b/widgets/table/e-table-field-chooser-dialog.c @@ -100,10 +100,10 @@ e_table_field_chooser_dialog_init (ETableFieldChooserDialog *e_table_field_choos gtk_window_set_resizable (GTK_WINDOW (dialog), TRUE); - widget = e_table_field_chooser_new(); - e_table_field_chooser_dialog->etfc = E_TABLE_FIELD_CHOOSER(widget); + widget = e_table_field_chooser_new (); + e_table_field_chooser_dialog->etfc = E_TABLE_FIELD_CHOOSER (widget); - g_object_set(widget, + g_object_set (widget, "dnd_code", e_table_field_chooser_dialog->dnd_code, "full_header", e_table_field_chooser_dialog->full_header, "header", e_table_field_chooser_dialog->header, @@ -112,7 +112,7 @@ e_table_field_chooser_dialog_init (ETableFieldChooserDialog *e_table_field_choos content_area = gtk_dialog_get_content_area (dialog); gtk_box_pack_start (GTK_BOX (content_area), widget, TRUE, TRUE, 0); - gtk_widget_show (GTK_WIDGET(widget)); + gtk_widget_show (GTK_WIDGET (widget)); gtk_window_set_title (GTK_WINDOW (dialog), _("Add a Column")); } @@ -147,13 +147,13 @@ e_table_field_chooser_dialog_dispose (GObject *object) static void e_table_field_chooser_dialog_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { - ETableFieldChooserDialog *etfcd = E_TABLE_FIELD_CHOOSER_DIALOG(object); + ETableFieldChooserDialog *etfcd = E_TABLE_FIELD_CHOOSER_DIALOG (object); switch (prop_id) { case PROP_DND_CODE: - g_free(etfcd->dnd_code); - etfcd->dnd_code = g_strdup(g_value_get_string (value)); + g_free (etfcd->dnd_code); + etfcd->dnd_code = g_strdup (g_value_get_string (value)); if (etfcd->etfc) - g_object_set(etfcd->etfc, + g_object_set (etfcd->etfc, "dnd_code", etfcd->dnd_code, NULL); break; @@ -161,13 +161,13 @@ e_table_field_chooser_dialog_set_property (GObject *object, guint prop_id, const if (etfcd->full_header) g_object_unref (etfcd->full_header); if (g_value_get_object (value)) - etfcd->full_header = E_TABLE_HEADER(g_value_get_object (value)); + etfcd->full_header = E_TABLE_HEADER (g_value_get_object (value)); else etfcd->full_header = NULL; if (etfcd->full_header) g_object_ref (etfcd->full_header); if (etfcd->etfc) - g_object_set(etfcd->etfc, + g_object_set (etfcd->etfc, "full_header", etfcd->full_header, NULL); break; @@ -175,13 +175,13 @@ e_table_field_chooser_dialog_set_property (GObject *object, guint prop_id, const if (etfcd->header) g_object_unref (etfcd->header); if (g_value_get_object (value)) - etfcd->header = E_TABLE_HEADER(g_value_get_object (value)); + etfcd->header = E_TABLE_HEADER (g_value_get_object (value)); else etfcd->header = NULL; if (etfcd->header) g_object_ref (etfcd->header); if (etfcd->etfc) - g_object_set(etfcd->etfc, + g_object_set (etfcd->etfc, "header", etfcd->header, NULL); break; @@ -193,7 +193,7 @@ e_table_field_chooser_dialog_set_property (GObject *object, guint prop_id, const static void e_table_field_chooser_dialog_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { - ETableFieldChooserDialog *etfcd = E_TABLE_FIELD_CHOOSER_DIALOG(object); + ETableFieldChooserDialog *etfcd = E_TABLE_FIELD_CHOOSER_DIALOG (object); switch (prop_id) { case PROP_DND_CODE: g_value_set_string (value, g_strdup (etfcd->dnd_code)); diff --git a/widgets/table/e-table-field-chooser-dialog.h b/widgets/table/e-table-field-chooser-dialog.h index e2d1c2ef9b..01129ffa09 100644 --- a/widgets/table/e-table-field-chooser-dialog.h +++ b/widgets/table/e-table-field-chooser-dialog.h @@ -62,7 +62,7 @@ struct _ETableFieldChooserDialogClass GtkDialogClass parent_class; }; -GtkWidget *e_table_field_chooser_dialog_new(void); +GtkWidget *e_table_field_chooser_dialog_new (void); GType e_table_field_chooser_dialog_get_type (void); G_END_DECLS diff --git a/widgets/table/e-table-field-chooser-item.c b/widgets/table/e-table-field-chooser-item.c index 7108b33ee7..67beee9d52 100644 --- a/widgets/table/e-table-field-chooser-item.c +++ b/widgets/table/e-table-field-chooser-item.c @@ -50,7 +50,7 @@ enum { LAST_SIGNAL }; -static guint etfci_signals [LAST_SIGNAL] = { 0, }; +static guint etfci_signals[LAST_SIGNAL] = { 0, }; #endif /* workaround for avoiding API breakage */ @@ -96,7 +96,7 @@ etfci_find_button (ETableFieldChooserItem *etfci, gdouble loc) gint count; gdouble height = 0; - count = e_table_header_count(etfci->combined_header); + count = e_table_header_count (etfci->combined_header); for (i = 0; i < count; i++) { ETableCol *ecol; @@ -108,7 +108,7 @@ etfci_find_button (ETableFieldChooserItem *etfci, gdouble loc) if (height > loc) return i; } - return MAX(0, count - 1); + return MAX (0, count - 1); } static void @@ -158,7 +158,7 @@ etfci_reflow (GnomeCanvasItem *item, gint flags) old_height = etfci->height; - count = e_table_header_count(etfci->combined_header); + count = e_table_header_count (etfci->combined_header); for (i = 0; i < count; i++) { ETableCol *ecol; @@ -172,9 +172,9 @@ etfci_reflow (GnomeCanvasItem *item, gint flags) etfci->height = height; if (old_height != etfci->height) - e_canvas_item_request_parent_reflow(item); + e_canvas_item_request_parent_reflow (item); - gnome_canvas_item_request_update(item); + gnome_canvas_item_request_update (item); } static void @@ -184,7 +184,7 @@ etfci_update (GnomeCanvasItem *item, gint flags) { ETableFieldChooserItem *etfci = E_TABLE_FIELD_CHOOSER_ITEM (item); - gdouble i2c [6]; + gdouble i2c[6]; ArtPoint c1, c2, i1, i2; if (GNOME_CANVAS_ITEM_CLASS (etfci_parent_class)->update) @@ -257,14 +257,14 @@ etfci_drop_full_header (ETableFieldChooserItem *etfci) g_object_unref (header); etfci->full_header = NULL; etfci->height = 0; - e_canvas_item_request_reflow(GNOME_CANVAS_ITEM(etfci)); + e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (etfci)); } static void full_header_structure_changed (ETableHeader *header, ETableFieldChooserItem *etfci) { - e_canvas_item_request_reflow(GNOME_CANVAS_ITEM(etfci)); + e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (etfci)); } static void @@ -272,7 +272,7 @@ full_header_dimension_changed (ETableHeader *header, gint col, ETableFieldChooserItem *etfci) { - e_canvas_item_request_reflow(GNOME_CANVAS_ITEM(etfci)); + e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (etfci)); } static void @@ -284,11 +284,11 @@ etfci_add_full_header (ETableFieldChooserItem *etfci, etfci->full_header_structure_change_id = g_signal_connect ( header, "structure_change", - G_CALLBACK(full_header_structure_changed), etfci); + G_CALLBACK (full_header_structure_changed), etfci); etfci->full_header_dimension_change_id = g_signal_connect ( header, "dimension_change", - G_CALLBACK(full_header_dimension_changed), etfci); - e_canvas_item_request_reflow(GNOME_CANVAS_ITEM(etfci)); + G_CALLBACK (full_header_dimension_changed), etfci); + e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (etfci)); } static void @@ -311,14 +311,14 @@ etfci_drop_table_header (ETableFieldChooserItem *etfci) g_object_unref (header); etfci->header = NULL; etfci->height = 0; - e_canvas_item_request_reflow(GNOME_CANVAS_ITEM(etfci)); + e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (etfci)); } static void table_header_structure_changed (ETableHeader *header, ETableFieldChooserItem *etfci) { - e_canvas_item_request_reflow(GNOME_CANVAS_ITEM(etfci)); + e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (etfci)); } static void @@ -326,7 +326,7 @@ table_header_dimension_changed (ETableHeader *header, gint col, ETableFieldChooserItem *etfci) { - e_canvas_item_request_reflow(GNOME_CANVAS_ITEM(etfci)); + e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (etfci)); } static void @@ -338,11 +338,11 @@ etfci_add_table_header (ETableFieldChooserItem *etfci, etfci->table_header_structure_change_id = g_signal_connect ( header, "structure_change", - G_CALLBACK(table_header_structure_changed), etfci); + G_CALLBACK (table_header_structure_changed), etfci); etfci->table_header_dimension_change_id = g_signal_connect ( header, "dimension_change", - G_CALLBACK(table_header_dimension_changed), etfci); - e_canvas_item_request_reflow(GNOME_CANVAS_ITEM(etfci)); + G_CALLBACK (table_header_dimension_changed), etfci); + e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (etfci)); } static void @@ -361,23 +361,23 @@ etfci_set_property (GObject *object, case PROP_FULL_HEADER: etfci_drop_full_header (etfci); if (g_value_get_object (value)) - etfci_add_full_header (etfci, E_TABLE_HEADER(g_value_get_object (value))); + etfci_add_full_header (etfci, E_TABLE_HEADER (g_value_get_object (value))); break; case PROP_HEADER: etfci_drop_table_header (etfci); if (g_value_get_object (value)) - etfci_add_table_header (etfci, E_TABLE_HEADER(g_value_get_object (value))); + etfci_add_table_header (etfci, E_TABLE_HEADER (g_value_get_object (value))); break; case PROP_DND_CODE: - g_free(etfci->dnd_code); - etfci->dnd_code = g_strdup(g_value_get_string (value)); + g_free (etfci->dnd_code); + etfci->dnd_code = g_strdup (g_value_get_string (value)); break; case PROP_WIDTH: etfci->width = g_value_get_double (value); - gnome_canvas_item_request_update(item); + gnome_canvas_item_request_update (item); break; } } @@ -416,12 +416,12 @@ etfci_drag_data_get (GtkWidget *widget, { if (etfci->drag_col != -1) { gchar *string = g_strdup_printf("%d", etfci->drag_col); - gtk_selection_data_set(selection_data, + gtk_selection_data_set (selection_data, GDK_SELECTION_TYPE_STRING, - sizeof(string[0]), + sizeof (string[0]), (guchar *)string, - strlen(string)); - g_free(string); + strlen (string)); + g_free (string); } } @@ -450,7 +450,7 @@ etfci_realize (GnomeCanvasItem *item) etfci->drag_data_get_id = g_signal_connect ( item->canvas, "drag_data_get", G_CALLBACK (etfci_drag_data_get), etfci); - e_canvas_item_request_reflow(GNOME_CANVAS_ITEM(etfci)); + e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (etfci)); } static void @@ -557,16 +557,16 @@ etfci_start_drag (ETableFieldChooserItem *etfci, GdkEvent *event, gdouble x, gdo gint drag_col; gint button_height; - GtkTargetEntry etfci_drag_types [] = { + GtkTargetEntry etfci_drag_types[] = { { (gchar *) TARGET_ETABLE_COL_TYPE, 0, TARGET_ETABLE_COL_HEADER }, }; if (etfci->combined_header == NULL) return; - drag_col = etfci_find_button(etfci, y); + drag_col = etfci_find_button (etfci, y); - if (drag_col < 0 || drag_col > e_table_header_count(etfci->combined_header)) + if (drag_col < 0 || drag_col > e_table_header_count (etfci->combined_header)) return; ecol = e_table_header_get_column (etfci->combined_header, drag_col); @@ -581,7 +581,7 @@ etfci_start_drag (ETableFieldChooserItem *etfci, GdkEvent *event, gdouble x, gdo d(g_print ("etfci - %s\n", etfci_drag_types[0].target)); list = gtk_target_list_new (etfci_drag_types, G_N_ELEMENTS (etfci_drag_types)); context = gtk_drag_begin (widget, list, GDK_ACTION_MOVE, 1, event); - g_free(etfci_drag_types[0].target); + g_free (etfci_drag_types[0].target); button_height = e_table_header_compute_height (ecol, widget); window = gtk_widget_get_window (widget); @@ -721,6 +721,6 @@ etfci_init (ETableFieldChooserItem *etfci) etfci->maybe_drag = 0; etfci->drag_end_id = 0; - e_canvas_item_set_reflow_callback(GNOME_CANVAS_ITEM (etfci), etfci_reflow); + e_canvas_item_set_reflow_callback (GNOME_CANVAS_ITEM (etfci), etfci_reflow); } diff --git a/widgets/table/e-table-field-chooser.c b/widgets/table/e-table-field-chooser.c index 2cf0d5f114..54dcdb6e35 100644 --- a/widgets/table/e-table-field-chooser.c +++ b/widgets/table/e-table-field-chooser.c @@ -99,36 +99,36 @@ ensure_nonzero_step_increments (ETableFieldChooser *etfc) gtk_adjustment_set_step_increment (ha, 16.0); } -static void allocate_callback(GtkWidget *canvas, GtkAllocation *allocation, ETableFieldChooser *etfc) +static void allocate_callback (GtkWidget *canvas, GtkAllocation *allocation, ETableFieldChooser *etfc) { gdouble height; etfc->last_alloc = *allocation; - gnome_canvas_item_set( etfc->item, + gnome_canvas_item_set ( etfc->item, "width", (gdouble) allocation->width, NULL ); - g_object_get(etfc->item, + g_object_get (etfc->item, "height", &height, NULL); - height = MAX(height, allocation->height); - gnome_canvas_set_scroll_region(GNOME_CANVAS( etfc->canvas ), 0, 0, allocation->width - 1, height - 1); - gnome_canvas_item_set( etfc->rect, + height = MAX (height, allocation->height); + gnome_canvas_set_scroll_region (GNOME_CANVAS ( etfc->canvas ), 0, 0, allocation->width - 1, height - 1); + gnome_canvas_item_set ( etfc->rect, "x2", (gdouble) allocation->width, "y2", (gdouble) height, NULL ); ensure_nonzero_step_increments (etfc); } -static void resize(GnomeCanvas *canvas, ETableFieldChooser *etfc) +static void resize (GnomeCanvas *canvas, ETableFieldChooser *etfc) { gdouble height; - g_object_get(etfc->item, + g_object_get (etfc->item, "height", &height, NULL); - height = MAX(height, etfc->last_alloc.height); + height = MAX (height, etfc->last_alloc.height); - gnome_canvas_set_scroll_region (GNOME_CANVAS(etfc->canvas), 0, 0, etfc->last_alloc.width - 1, height - 1); - gnome_canvas_item_set( etfc->rect, + gnome_canvas_set_scroll_region (GNOME_CANVAS (etfc->canvas), 0, 0, etfc->last_alloc.width - 1, height - 1); + gnome_canvas_item_set ( etfc->rect, "x2", (gdouble) etfc->last_alloc.width, "y2", (gdouble) height, NULL ); @@ -185,8 +185,8 @@ e_table_field_chooser_init (ETableFieldChooser *etfc) gtk_widget_push_colormap (gdk_rgb_get_colormap ()); - etfc->rect = gnome_canvas_item_new(gnome_canvas_root( GNOME_CANVAS( etfc->canvas ) ), - gnome_canvas_rect_get_type(), + etfc->rect = gnome_canvas_item_new (gnome_canvas_root ( GNOME_CANVAS ( etfc->canvas ) ), + gnome_canvas_rect_get_type (), "x1", (gdouble) 0, "y1", (gdouble) 0, "x2", (gdouble) 100, @@ -194,8 +194,8 @@ e_table_field_chooser_init (ETableFieldChooser *etfc) "fill_color", "white", NULL ); - etfc->item = gnome_canvas_item_new(gnome_canvas_root(etfc->canvas), - e_table_field_chooser_item_get_type(), + etfc->item = gnome_canvas_item_new (gnome_canvas_root (etfc->canvas), + e_table_field_chooser_item_get_type (), "width", (gdouble) 100, "full_header", etfc->full_header, "header", etfc->header, @@ -206,7 +206,7 @@ e_table_field_chooser_init (ETableFieldChooser *etfc) G_CALLBACK ( resize ), etfc); - gnome_canvas_set_scroll_region ( GNOME_CANVAS( etfc->canvas ), + gnome_canvas_set_scroll_region ( GNOME_CANVAS ( etfc->canvas ), 0, 0, 100, 100 ); @@ -216,13 +216,13 @@ e_table_field_chooser_init (ETableFieldChooser *etfc) etfc); gtk_widget_pop_colormap (); - gtk_widget_show_all(widget); + gtk_widget_show_all (widget); } static void e_table_field_chooser_dispose (GObject *object) { - ETableFieldChooser *etfc = E_TABLE_FIELD_CHOOSER(object); + ETableFieldChooser *etfc = E_TABLE_FIELD_CHOOSER (object); g_free (etfc->dnd_code); etfc->dnd_code = NULL; @@ -249,14 +249,14 @@ e_table_field_chooser_new (void) static void e_table_field_chooser_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { - ETableFieldChooser *etfc = E_TABLE_FIELD_CHOOSER(object); + ETableFieldChooser *etfc = E_TABLE_FIELD_CHOOSER (object); switch (prop_id) { case PROP_DND_CODE: - g_free(etfc->dnd_code); - etfc->dnd_code = g_strdup(g_value_get_string(value)); + g_free (etfc->dnd_code); + etfc->dnd_code = g_strdup (g_value_get_string (value)); if (etfc->item) - g_object_set(etfc->item, + g_object_set (etfc->item, "dnd_code", etfc->dnd_code, NULL); break; @@ -264,13 +264,13 @@ e_table_field_chooser_set_property (GObject *object, guint prop_id, const GValue if (etfc->full_header) g_object_unref (etfc->full_header); if (g_value_get_object (value)) - etfc->full_header = E_TABLE_HEADER(g_value_get_object (value)); + etfc->full_header = E_TABLE_HEADER (g_value_get_object (value)); else etfc->full_header = NULL; if (etfc->full_header) g_object_ref (etfc->full_header); if (etfc->item) - g_object_set(etfc->item, + g_object_set (etfc->item, "full_header", etfc->full_header, NULL); break; @@ -278,13 +278,13 @@ e_table_field_chooser_set_property (GObject *object, guint prop_id, const GValue if (etfc->header) g_object_unref (etfc->header); if (g_value_get_object (value)) - etfc->header = E_TABLE_HEADER(g_value_get_object (value)); + etfc->header = E_TABLE_HEADER (g_value_get_object (value)); else etfc->header = NULL; if (etfc->header) g_object_ref (etfc->header); if (etfc->item) - g_object_set(etfc->item, + g_object_set (etfc->item, "header", etfc->header, NULL); break; @@ -296,7 +296,7 @@ e_table_field_chooser_set_property (GObject *object, guint prop_id, const GValue static void e_table_field_chooser_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { - ETableFieldChooser *etfc = E_TABLE_FIELD_CHOOSER(object); + ETableFieldChooser *etfc = E_TABLE_FIELD_CHOOSER (object); switch (prop_id) { case PROP_DND_CODE: diff --git a/widgets/table/e-table-field-chooser.h b/widgets/table/e-table-field-chooser.h index cff9384895..7cc6e45568 100644 --- a/widgets/table/e-table-field-chooser.h +++ b/widgets/table/e-table-field-chooser.h @@ -68,7 +68,7 @@ struct _ETableFieldChooserClass GtkVBoxClass parent_class; }; -GtkWidget *e_table_field_chooser_new(void); +GtkWidget *e_table_field_chooser_new (void); GType e_table_field_chooser_get_type (void); G_END_DECLS diff --git a/widgets/table/e-table-group-container.c b/widgets/table/e-table-group-container.c index 57a1aa537c..3db409c6a3 100644 --- a/widgets/table/e-table-group-container.c +++ b/widgets/table/e-table-group-container.c @@ -75,7 +75,7 @@ e_table_group_container_child_node_free (ETableGroupContainer *etgc, gtk_object_destroy (GTK_OBJECT (child)); e_table_model_free_value (etg->model, etgc->ecol->col_idx, child_node->key); - g_free(child_node->string); + g_free (child_node->string); gtk_object_destroy (GTK_OBJECT (child_node->text)); gtk_object_destroy (GTK_OBJECT (child_node->rect)); } @@ -120,7 +120,7 @@ etgc_dispose (GObject *object) etgc->selection_model = NULL; if (etgc->rect) - gtk_object_destroy (GTK_OBJECT(etgc->rect)); + gtk_object_destroy (GTK_OBJECT (etgc->rect)); etgc->rect = NULL; G_OBJECT_CLASS (etgc_parent_class)->dispose (object); @@ -145,11 +145,11 @@ e_table_group_container_construct (GnomeCanvasGroup *parent, ETableGroupContaine ETableModel *model, ETableSortInfo *sort_info, gint n) { ETableCol *col; - ETableSortColumn column = e_table_sort_info_grouping_get_nth(sort_info, n); + ETableSortColumn column = e_table_sort_info_grouping_get_nth (sort_info, n); GtkWidget *widget; GtkStyle *style; - col = e_table_header_get_column_by_col_idx(full_header, column.column); + col = e_table_header_get_column_by_col_idx (full_header, column.column); if (col == NULL) col = e_table_header_get_column (full_header, e_table_header_count (full_header) - 1); @@ -202,7 +202,7 @@ e_table_group_container_new (GnomeCanvasGroup *parent, ETableHeader *full_header static gint etgc_event (GnomeCanvasItem *item, GdkEvent *event) { - ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER(item); + ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (item); gboolean return_val = TRUE; gboolean change_focus = FALSE; gboolean use_col = FALSE; @@ -282,7 +282,7 @@ etgc_event (GnomeCanvasItem *item, GdkEvent *event) } } if (direction == E_FOCUS_END) - list = g_list_last(etgc->children); + list = g_list_last (etgc->children); else list = etgc->children; if (list) { @@ -306,7 +306,7 @@ etgc_event (GnomeCanvasItem *item, GdkEvent *event) break; } if (return_val == FALSE) { - if (GNOME_CANVAS_ITEM_CLASS(etgc_parent_class)->event) + if (GNOME_CANVAS_ITEM_CLASS (etgc_parent_class)->event) return GNOME_CANVAS_ITEM_CLASS (etgc_parent_class)->event (item, event); } return return_val; @@ -426,7 +426,7 @@ create_child_node (ETableGroupContainer *etgc, gpointer val) { ETableGroup *child; ETableGroupContainerChildNode *child_node; - ETableGroup *etg = E_TABLE_GROUP(etgc); + ETableGroup *etg = E_TABLE_GROUP (etgc); child_node = g_new (ETableGroupContainerChildNode, 1); child_node->rect = gnome_canvas_item_new (GNOME_CANVAS_GROUP (etgc), @@ -442,7 +442,7 @@ create_child_node (ETableGroupContainer *etgc, gpointer val) NULL); child = e_table_group_new (GNOME_CANVAS_GROUP (etgc), etg->full_header, etg->header, etg->model, etgc->sort_info, etgc->n + 1); - gnome_canvas_item_set(GNOME_CANVAS_ITEM(child), + gnome_canvas_item_set (GNOME_CANVAS_ITEM (child), "alternating_row_colors", etgc->alternating_row_colors, "horizontal_draw_grid", etgc->horizontal_draw_grid, "vertical_draw_grid", etgc->vertical_draw_grid, @@ -547,10 +547,10 @@ etgc_add_array (ETableGroup *etg, const gint *array, gint count) comp_val = (*comp)(lastval, val, cmp_cache); if (comp_val != 0) { - child_node = create_child_node(etgc, lastval); + child_node = create_child_node (etgc, lastval); child = child_node->child; - e_table_group_add_array(child, array + laststart, i - laststart); + e_table_group_add_array (child, array + laststart, i - laststart); child_node->count = i - laststart; etgc->children = g_list_append (etgc->children, child_node); @@ -562,10 +562,10 @@ etgc_add_array (ETableGroup *etg, const gint *array, gint count) e_table_sorting_utils_free_cmp_cache (cmp_cache); - child_node = create_child_node(etgc, lastval); + child_node = create_child_node (etgc, lastval); child = child_node->child; - e_table_group_add_array(child, array + laststart, i - laststart); + e_table_group_add_array (child, array + laststart, i - laststart); child_node->count = i - laststart; etgc->children = g_list_append (etgc->children, child_node); @@ -582,15 +582,15 @@ etgc_add_all (ETableGroup *etg) gint *array; gint count; - e_sorter_get_sorted_to_model_array(sorter, &array, &count); + e_sorter_get_sorted_to_model_array (sorter, &array, &count); - etgc_add_array(etg, array, count); + etgc_add_array (etg, array, count); } static gboolean etgc_remove (ETableGroup *etg, gint row) { - ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER(etg); + ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); GList *list; for (list = etgc->children; list; list = g_list_next (list)) { @@ -617,12 +617,12 @@ etgc_remove (ETableGroup *etg, gint row) static gint etgc_row_count (ETableGroup *etg) { - ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER(etg); + ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); GList *list; gint count = 0; - for (list = etgc->children; list; list = g_list_next(list)) { + for (list = etgc->children; list; list = g_list_next (list)) { ETableGroup *group = ((ETableGroupContainerChildNode *)list->data)->child; - gint this_count = e_table_group_row_count(group); + gint this_count = e_table_group_row_count (group); count += this_count; } return count; @@ -631,7 +631,7 @@ etgc_row_count (ETableGroup *etg) static void etgc_increment (ETableGroup *etg, gint position, gint amount) { - ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER(etg); + ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); GList *list; for (list = etgc->children; list; list = g_list_next (list)) @@ -642,7 +642,7 @@ etgc_increment (ETableGroup *etg, gint position, gint amount) static void etgc_decrement (ETableGroup *etg, gint position, gint amount) { - ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER(etg); + ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); GList *list; for (list = etgc->children; list; list = g_list_next (list)) @@ -653,7 +653,7 @@ etgc_decrement (ETableGroup *etg, gint position, gint amount) static void etgc_set_focus (ETableGroup *etg, EFocus direction, gint view_col) { - ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER(etg); + ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); if (etgc->children) { if (direction == E_FOCUS_END) e_table_group_set_focus (((ETableGroupContainerChildNode *)g_list_last (etgc->children)->data)->child, @@ -667,7 +667,7 @@ etgc_set_focus (ETableGroup *etg, EFocus direction, gint view_col) static gint etgc_get_focus_column (ETableGroup *etg) { - ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER(etg); + ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); if (etgc->children) { GList *list; for (list = etgc->children; list; list = list->next) { @@ -684,7 +684,7 @@ etgc_get_focus_column (ETableGroup *etg) static void etgc_compute_location (ETableGroup *etg, gint *x, gint *y, gint *row, gint *col) { - ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER(etg); + ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); if (row) *row = -1; @@ -710,7 +710,7 @@ etgc_compute_location (ETableGroup *etg, gint *x, gint *y, gint *row, gint *col) static void etgc_get_mouse_over (ETableGroup *etg, gint *row, gint *col) { - ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER(etg); + ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); if (row) *row = -1; @@ -741,7 +741,7 @@ etgc_get_mouse_over (ETableGroup *etg, gint *row, gint *col) static void 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); + ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); gint ypos; @@ -768,7 +768,7 @@ etgc_get_cell_geometry (ETableGroup *etg, gint *row, gint *col, gint *x, gint *y static void etgc_thaw (ETableGroup *etg) { - e_canvas_item_request_reflow (GNOME_CANVAS_ITEM(etg)); + e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (etg)); } static void @@ -820,7 +820,7 @@ etgc_set_property (GObject *object, guint prop_id, const GValue *value, GParamSp case PROP_SELECTION_MODEL: if (etgc->selection_model) g_object_unref (etgc->selection_model); - etgc->selection_model = E_SELECTION_MODEL(g_value_get_object (value)); + etgc->selection_model = E_SELECTION_MODEL (g_value_get_object (value)); if (etgc->selection_model) g_object_ref (etgc->selection_model); for (list = etgc->children; list; list = g_list_next (list)) { @@ -1030,7 +1030,7 @@ etgc_class_init (ETableGroupContainerClass *klass) static void etgc_reflow (GnomeCanvasItem *item, gint flags) { - ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER(item); + ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (item); gboolean frozen; g_object_get (etgc, @@ -1068,7 +1068,7 @@ etgc_reflow (GnomeCanvasItem *item, gint flags) pango_font_metrics_unref (metrics); } - extra_height = MAX(extra_height, BUTTON_HEIGHT + BUTTON_PADDING * 2); + extra_height = MAX (extra_height, BUTTON_HEIGHT + BUTTON_PADDING * 2); running_height = extra_height; @@ -1090,15 +1090,15 @@ etgc_reflow (GnomeCanvasItem *item, gint flags) "height", &item_height, NULL); - e_canvas_item_move_absolute (GNOME_CANVAS_ITEM(child_node->text), + e_canvas_item_move_absolute (GNOME_CANVAS_ITEM (child_node->text), GROUP_INDENT, running_height - BUTTON_PADDING); - e_canvas_item_move_absolute (GNOME_CANVAS_ITEM(child), + e_canvas_item_move_absolute (GNOME_CANVAS_ITEM (child), GROUP_INDENT, running_height); - gnome_canvas_item_set (GNOME_CANVAS_ITEM(child_node->rect), + gnome_canvas_item_set (GNOME_CANVAS_ITEM (child_node->rect), "x1", (gdouble) 0, "x2", (gdouble) running_width + GROUP_INDENT, "y1", (gdouble) running_height - extra_height, @@ -1122,7 +1122,7 @@ etgc_init (ETableGroupContainer *container) { container->children = NULL; - e_canvas_item_set_reflow_callback (GNOME_CANVAS_ITEM(container), etgc_reflow); + e_canvas_item_set_reflow_callback (GNOME_CANVAS_ITEM (container), etgc_reflow); container->alternating_row_colors = 1; container->horizontal_draw_grid = 1; @@ -1220,10 +1220,10 @@ e_table_group_container_print_page (EPrintable *ep, return; } else { child_node = child->data; - child_printable = e_table_group_get_printable(child_node->child); + child_printable = e_table_group_get_printable (child_node->child); if (child_printable) g_object_ref (child_printable); - e_printable_reset(child_printable); + e_printable_reset (child_printable); } } @@ -1236,13 +1236,13 @@ e_table_group_container_print_page (EPrintable *ep, pango_font_description_free (desc); while (1) { - child_height = e_printable_height(child_printable, context, width,yd + 2 * TEXT_AREA_HEIGHT, quantize); + child_height = e_printable_height (child_printable, context, width,yd + 2 * TEXT_AREA_HEIGHT, quantize); cr = gtk_print_context_get_cairo_context (context); cairo_save (cr); cairo_rectangle (cr, 0, 0, width,TEXT_AREA_HEIGHT); cairo_rectangle (cr, 0, 0, 2 * TEXT_AREA_HEIGHT, child_height + TEXT_AREA_HEIGHT); cairo_set_source_rgb (cr, .7, .7, .7); - cairo_fill(cr); + cairo_fill (cr); cairo_restore (cr); cairo_save (cr); @@ -1250,7 +1250,7 @@ e_table_group_container_print_page (EPrintable *ep, cairo_clip (cr); cairo_restore (cr); - cairo_move_to(cr, 0, 0); + cairo_move_to (cr, 0, 0); if (groupcontext->etgc->ecol->text) string = g_strdup_printf ("%s : %s (%d item%s)", groupcontext->etgc->ecol->text, @@ -1264,17 +1264,17 @@ e_table_group_container_print_page (EPrintable *ep, child_node->count == 1 ? "" : "s"); pango_layout_set_text (layout, string, -1); pango_cairo_show_layout (cr, layout); - g_free(string); + g_free (string); - cairo_translate(cr, 2 * TEXT_AREA_HEIGHT, TEXT_AREA_HEIGHT); - cairo_move_to(cr, 0, 0); + cairo_translate (cr, 2 * TEXT_AREA_HEIGHT, TEXT_AREA_HEIGHT); + cairo_move_to (cr, 0, 0); cairo_rectangle (cr, 0, 0, width - 2 * TEXT_AREA_HEIGHT,child_height); - cairo_clip(cr); + cairo_clip (cr); e_printable_print_page (child_printable, context, width-2 * TEXT_AREA_HEIGHT, height , quantize); yd += child_height + TEXT_AREA_HEIGHT; - if (e_printable_data_left(child_printable)) + if (e_printable_data_left (child_printable)) break; child = child->next; @@ -1286,10 +1286,10 @@ e_table_group_container_print_page (EPrintable *ep, child_node = child->data; if (child_printable) g_object_unref (child_printable); - child_printable = e_table_group_get_printable(child_node->child); + child_printable = e_table_group_get_printable (child_node->child); if (child_printable) g_object_ref (child_printable); - e_printable_reset(child_printable); + e_printable_reset (child_printable); } if (groupcontext->child_printable) g_object_unref (groupcontext->child_printable); @@ -1343,10 +1343,10 @@ e_table_group_container_height (EPrintable *ep, return 0; } else { child_node = child->data; - child_printable = e_table_group_get_printable(child_node->child); + child_printable = e_table_group_get_printable (child_node->child); if (child_printable) g_object_ref (child_printable); - e_printable_reset(child_printable); + e_printable_reset (child_printable); } } @@ -1354,12 +1354,12 @@ e_table_group_container_height (EPrintable *ep, return 0; while (1) { - child_height = e_printable_height(child_printable, context, width - 36, yd - (yd == -1 ? 0 : TEXT_AREA_HEIGHT), quantize); + child_height = e_printable_height (child_printable, context, width - 36, yd - (yd == -1 ? 0 : TEXT_AREA_HEIGHT), quantize); height -= child_height + TEXT_AREA_HEIGHT; if (yd != -1) { - if (!e_printable_will_fit(child_printable, context, width - 36, yd - (yd == -1 ? 0 : TEXT_AREA_HEIGHT), quantize)) { + if (!e_printable_will_fit (child_printable, context, width - 36, yd - (yd == -1 ? 0 : TEXT_AREA_HEIGHT), quantize)) { break; } @@ -1374,10 +1374,10 @@ e_table_group_container_height (EPrintable *ep, child_node = child->data; if (child_printable) g_object_unref (child_printable); - child_printable = e_table_group_get_printable(child_node->child); + child_printable = e_table_group_get_printable (child_node->child); if (child_printable) g_object_ref (child_printable); - e_printable_reset(child_printable); + e_printable_reset (child_printable); } if (child_printable) g_object_unref (child_printable); @@ -1411,10 +1411,10 @@ e_table_group_container_will_fit (EPrintable *ep, return will_fit; } else { child_node = child->data; - child_printable = e_table_group_get_printable(child_node->child); + child_printable = e_table_group_get_printable (child_node->child); if (child_printable) g_object_ref (child_printable); - e_printable_reset(child_printable); + e_printable_reset (child_printable); } } @@ -1422,10 +1422,10 @@ e_table_group_container_will_fit (EPrintable *ep, will_fit = FALSE; else { while (1) { - child_height = e_printable_height(child_printable, context, width - 36, yd - (yd == -1 ? 0 : TEXT_AREA_HEIGHT), quantize); + child_height = e_printable_height (child_printable, context, width - 36, yd - (yd == -1 ? 0 : TEXT_AREA_HEIGHT), quantize); if (yd != -1) { - if (!e_printable_will_fit(child_printable, context, width - 36, yd - (yd == -1 ? 0 : TEXT_AREA_HEIGHT), quantize)) { + if (!e_printable_will_fit (child_printable, context, width - 36, yd - (yd == -1 ? 0 : TEXT_AREA_HEIGHT), quantize)) { will_fit = FALSE; break; } @@ -1441,10 +1441,10 @@ e_table_group_container_will_fit (EPrintable *ep, child_node = child->data; if (child_printable) g_object_unref (child_printable); - child_printable = e_table_group_get_printable(child_node->child); + child_printable = e_table_group_get_printable (child_node->child); if (child_printable) g_object_ref (child_printable); - e_printable_reset(child_printable); + e_printable_reset (child_printable); } } @@ -1465,17 +1465,17 @@ e_table_group_container_printable_destroy (gpointer data, g_object_unref (groupcontext->etgc); if (groupcontext->child_printable) g_object_ref (groupcontext->child_printable); - g_free(groupcontext); + g_free (groupcontext); } static EPrintable * etgc_get_printable (ETableGroup *etg) { - ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER(etg); - EPrintable *printable = e_printable_new(); + ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); + EPrintable *printable = e_printable_new (); ETGCPrintContext *groupcontext; - groupcontext = g_new(ETGCPrintContext, 1); + groupcontext = g_new (ETGCPrintContext, 1); groupcontext->etgc = etgc; g_object_ref (etgc); groupcontext->child = etgc->children; @@ -1483,23 +1483,23 @@ etgc_get_printable (ETableGroup *etg) g_signal_connect (printable, "print_page", - G_CALLBACK(e_table_group_container_print_page), + G_CALLBACK (e_table_group_container_print_page), groupcontext); g_signal_connect (printable, "data_left", - G_CALLBACK(e_table_group_container_data_left), + G_CALLBACK (e_table_group_container_data_left), groupcontext); g_signal_connect (printable, "reset", - G_CALLBACK(e_table_group_container_reset), + G_CALLBACK (e_table_group_container_reset), groupcontext); g_signal_connect (printable, "height", - G_CALLBACK(e_table_group_container_height), + G_CALLBACK (e_table_group_container_height), groupcontext); g_signal_connect (printable, "will_fit", - G_CALLBACK(e_table_group_container_will_fit), + G_CALLBACK (e_table_group_container_will_fit), groupcontext); g_object_weak_ref (G_OBJECT (printable), e_table_group_container_printable_destroy, diff --git a/widgets/table/e-table-group-leaf.c b/widgets/table/e-table-group-leaf.c index c1ddbb677a..3e63af004d 100644 --- a/widgets/table/e-table-group-leaf.c +++ b/widgets/table/e-table-group-leaf.c @@ -59,7 +59,7 @@ enum { static void etgl_dispose (GObject *object) { - ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF(object); + ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (object); if (etgl->ets) { g_object_unref (etgl->ets); @@ -97,7 +97,7 @@ etgl_dispose (GObject *object) etgl->etgl_key_press_id = 0; etgl->etgl_start_drag_id = 0; - gtk_object_destroy (GTK_OBJECT(etgl->item)); + gtk_object_destroy (GTK_OBJECT (etgl->item)); etgl->item = NULL; } @@ -118,14 +118,14 @@ e_table_group_leaf_construct (GnomeCanvasGroup *parent, ETableModel *model, ETableSortInfo *sort_info) { - etgl->is_grouped = e_table_sort_info_grouping_get_count(sort_info) > 0 ? TRUE : FALSE; + etgl->is_grouped = e_table_sort_info_grouping_get_count (sort_info) > 0 ? TRUE : FALSE; if (etgl->is_grouped) - etgl->ets = E_TABLE_SUBSET(e_table_sorted_variable_new (model, + etgl->ets = E_TABLE_SUBSET (e_table_sorted_variable_new (model, full_header, sort_info)); else - etgl->ets = E_TABLE_SUBSET(e_table_sorted_new (model, + etgl->ets = E_TABLE_SUBSET (e_table_sorted_new (model, full_header, sort_info)); @@ -166,24 +166,24 @@ e_table_group_leaf_new (GnomeCanvasGroup *parent, static void etgl_cursor_change (GtkObject *object, gint row, ETableGroupLeaf *etgl) { - if (row < E_TABLE_SUBSET(etgl->ets)->n_map) - e_table_group_cursor_change (E_TABLE_GROUP(etgl), - E_TABLE_SUBSET(etgl->ets)->map_table[row]); + if (row < E_TABLE_SUBSET (etgl->ets)->n_map) + e_table_group_cursor_change (E_TABLE_GROUP (etgl), + E_TABLE_SUBSET (etgl->ets)->map_table[row]); } static void etgl_cursor_activated (GtkObject *object, gint view_row, ETableGroupLeaf *etgl) { - if (view_row < E_TABLE_SUBSET(etgl->ets)->n_map) - e_table_group_cursor_activated (E_TABLE_GROUP(etgl), - E_TABLE_SUBSET(etgl->ets)->map_table[view_row]); + if (view_row < E_TABLE_SUBSET (etgl->ets)->n_map) + e_table_group_cursor_activated (E_TABLE_GROUP (etgl), + E_TABLE_SUBSET (etgl->ets)->map_table[view_row]); } static void etgl_double_click (GtkObject *object, gint model_row, gint model_col, GdkEvent *event, ETableGroupLeaf *etgl) { - e_table_group_double_click (E_TABLE_GROUP(etgl), model_row, model_col, event); + e_table_group_double_click (E_TABLE_GROUP (etgl), model_row, model_col, event); } static gboolean @@ -193,10 +193,10 @@ etgl_key_press (GtkObject *object, GdkEvent *event, ETableGroupLeaf *etgl) { - if (row < E_TABLE_SUBSET(etgl->ets)->n_map && row >= 0) + if (row < E_TABLE_SUBSET (etgl->ets)->n_map && row >= 0) return e_table_group_key_press ( - E_TABLE_GROUP(etgl), - E_TABLE_SUBSET(etgl->ets)->map_table[row], + E_TABLE_GROUP (etgl), + E_TABLE_SUBSET (etgl->ets)->map_table[row], col, event); else return FALSE; @@ -206,16 +206,16 @@ static gboolean etgl_start_drag (GtkObject *object, gint model_row, gint model_col, GdkEvent *event, ETableGroupLeaf *etgl) { - return e_table_group_start_drag (E_TABLE_GROUP(etgl), model_row, model_col, event); + return e_table_group_start_drag (E_TABLE_GROUP (etgl), model_row, model_col, event); } static gboolean etgl_right_click (GtkObject *object, gint view_row, gint model_col, GdkEvent *event, ETableGroupLeaf *etgl) { - if (view_row < E_TABLE_SUBSET(etgl->ets)->n_map) - return e_table_group_right_click (E_TABLE_GROUP(etgl), - E_TABLE_SUBSET(etgl->ets)->map_table[view_row], + if (view_row < E_TABLE_SUBSET (etgl->ets)->n_map) + return e_table_group_right_click (E_TABLE_GROUP (etgl), + E_TABLE_SUBSET (etgl->ets)->map_table[view_row], model_col, event); else @@ -229,9 +229,9 @@ etgl_click (GtkObject *object, GdkEvent *event, ETableGroupLeaf *etgl) { - if (row < E_TABLE_SUBSET(etgl->ets)->n_map) - return e_table_group_click (E_TABLE_GROUP(etgl), - E_TABLE_SUBSET(etgl->ets)->map_table[row], + if (row < E_TABLE_SUBSET (etgl->ets)->n_map) + return e_table_group_click (E_TABLE_GROUP (etgl), + E_TABLE_SUBSET (etgl->ets)->map_table[row], col, event); else @@ -241,12 +241,12 @@ etgl_click (GtkObject *object, static void etgl_reflow (GnomeCanvasItem *item, gint flags) { - ETableGroupLeaf *leaf = E_TABLE_GROUP_LEAF(item); + ETableGroupLeaf *leaf = E_TABLE_GROUP_LEAF (item); - g_object_get(leaf->item, + g_object_get (leaf->item, "height", &leaf->height, NULL); - g_object_get(leaf->item, + g_object_get (leaf->item, "width", &leaf->width, NULL); @@ -256,13 +256,13 @@ etgl_reflow (GnomeCanvasItem *item, gint flags) static void etgl_realize (GnomeCanvasItem *item) { - ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF(item); + ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (item); if (GNOME_CANVAS_ITEM_CLASS (etgl_parent_class)->realize) GNOME_CANVAS_ITEM_CLASS (etgl_parent_class)->realize (item); - etgl->item = E_TABLE_ITEM(gnome_canvas_item_new ( - GNOME_CANVAS_GROUP(etgl), + etgl->item = E_TABLE_ITEM (gnome_canvas_item_new ( + GNOME_CANVAS_GROUP (etgl), e_table_item_get_type (), "ETableHeader", E_TABLE_GROUP(etgl)->header, "ETableModel", etgl->ets, @@ -279,35 +279,35 @@ etgl_realize (GnomeCanvasItem *item) etgl->etgl_cursor_change_id = g_signal_connect (etgl->item, "cursor_change", - G_CALLBACK(etgl_cursor_change), + G_CALLBACK (etgl_cursor_change), etgl); etgl->etgl_cursor_activated_id = g_signal_connect (etgl->item, "cursor_activated", - G_CALLBACK(etgl_cursor_activated), + G_CALLBACK (etgl_cursor_activated), etgl); etgl->etgl_double_click_id = g_signal_connect (etgl->item, "double_click", - G_CALLBACK(etgl_double_click), + G_CALLBACK (etgl_double_click), etgl); etgl->etgl_right_click_id = g_signal_connect (etgl->item, "right_click", - G_CALLBACK(etgl_right_click), + G_CALLBACK (etgl_right_click), etgl); etgl->etgl_click_id = g_signal_connect (etgl->item, "click", - G_CALLBACK(etgl_click), + G_CALLBACK (etgl_click), etgl); etgl->etgl_key_press_id = g_signal_connect (etgl->item, "key_press", - G_CALLBACK(etgl_key_press), + G_CALLBACK (etgl_key_press), etgl); etgl->etgl_start_drag_id = g_signal_connect (etgl->item, "start_drag", - G_CALLBACK(etgl_start_drag), + G_CALLBACK (etgl_start_drag), etgl); - e_canvas_item_request_reflow(item); + e_canvas_item_request_reflow (item); } static void @@ -315,8 +315,8 @@ etgl_add (ETableGroup *etg, gint row) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg); - if (E_IS_TABLE_SUBSET_VARIABLE(etgl->ets)) { - e_table_subset_variable_add (E_TABLE_SUBSET_VARIABLE(etgl->ets), row); + if (E_IS_TABLE_SUBSET_VARIABLE (etgl->ets)) { + e_table_subset_variable_add (E_TABLE_SUBSET_VARIABLE (etgl->ets), row); } } @@ -325,8 +325,8 @@ etgl_add_array (ETableGroup *etg, const gint *array, gint count) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg); - if (E_IS_TABLE_SUBSET_VARIABLE(etgl->ets)) { - e_table_subset_variable_add_array (E_TABLE_SUBSET_VARIABLE(etgl->ets), array, count); + if (E_IS_TABLE_SUBSET_VARIABLE (etgl->ets)) { + e_table_subset_variable_add_array (E_TABLE_SUBSET_VARIABLE (etgl->ets), array, count); } } @@ -335,8 +335,8 @@ etgl_add_all (ETableGroup *etg) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg); - if (E_IS_TABLE_SUBSET_VARIABLE(etgl->ets)) { - e_table_subset_variable_add_all (E_TABLE_SUBSET_VARIABLE(etgl->ets)); + if (E_IS_TABLE_SUBSET_VARIABLE (etgl->ets)) { + e_table_subset_variable_add_all (E_TABLE_SUBSET_VARIABLE (etgl->ets)); } } @@ -345,8 +345,8 @@ etgl_remove (ETableGroup *etg, gint row) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg); - if (E_IS_TABLE_SUBSET_VARIABLE(etgl->ets)) { - return e_table_subset_variable_remove (E_TABLE_SUBSET_VARIABLE(etgl->ets), row); + if (E_IS_TABLE_SUBSET_VARIABLE (etgl->ets)) { + return e_table_subset_variable_remove (E_TABLE_SUBSET_VARIABLE (etgl->ets), row); } return FALSE; } @@ -356,7 +356,7 @@ etgl_increment (ETableGroup *etg, gint position, gint amount) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg); - if (E_IS_TABLE_SUBSET_VARIABLE(etgl->ets)) { + if (E_IS_TABLE_SUBSET_VARIABLE (etgl->ets)) { e_table_subset_variable_increment ( E_TABLE_SUBSET_VARIABLE (etgl->ets), position, amount); @@ -368,7 +368,7 @@ etgl_decrement (ETableGroup *etg, gint position, gint amount) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg); - if (E_IS_TABLE_SUBSET_VARIABLE(etgl->ets)) { + if (E_IS_TABLE_SUBSET_VARIABLE (etgl->ets)) { e_table_subset_variable_decrement ( E_TABLE_SUBSET_VARIABLE (etgl->ets), position, amount); @@ -380,7 +380,7 @@ etgl_row_count (ETableGroup *etg) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg); - return e_table_model_row_count(E_TABLE_MODEL(etgl->ets)); + return e_table_model_row_count (E_TABLE_MODEL (etgl->ets)); } static void @@ -391,7 +391,7 @@ etgl_set_focus (ETableGroup *etg, EFocus direction, gint view_col) if (direction == E_FOCUS_END) { e_table_item_set_cursor ( etgl->item, view_col, - e_table_model_row_count (E_TABLE_MODEL(etgl->ets)) - 1); + e_table_model_row_count (E_TABLE_MODEL (etgl->ets)) - 1); } else { e_table_item_set_cursor (etgl->item, view_col, 0); } @@ -465,7 +465,7 @@ etgl_set_property (GObject *object, case PROP_WIDTH: etgl->minimum_width = g_value_get_double (value); if (etgl->item) { - gnome_canvas_item_set (GNOME_CANVAS_ITEM(etgl->item), + gnome_canvas_item_set (GNOME_CANVAS_ITEM (etgl->item), "minimum_width", etgl->minimum_width, NULL); } @@ -473,20 +473,20 @@ etgl_set_property (GObject *object, case PROP_LENGTH_THRESHOLD: etgl->length_threshold = g_value_get_int (value); if (etgl->item) { - gnome_canvas_item_set (GNOME_CANVAS_ITEM(etgl->item), + gnome_canvas_item_set (GNOME_CANVAS_ITEM (etgl->item), "length_threshold", etgl->length_threshold, NULL); } break; case PROP_SELECTION_MODEL: if (etgl->selection_model) - g_object_unref(etgl->selection_model); - etgl->selection_model = E_SELECTION_MODEL(g_value_get_object (value)); + g_object_unref (etgl->selection_model); + etgl->selection_model = E_SELECTION_MODEL (g_value_get_object (value)); if (etgl->selection_model) { - g_object_ref(etgl->selection_model); + g_object_ref (etgl->selection_model); } if (etgl->item) { - gnome_canvas_item_set (GNOME_CANVAS_ITEM(etgl->item), + gnome_canvas_item_set (GNOME_CANVAS_ITEM (etgl->item), "selection_model", etgl->selection_model, NULL); } @@ -495,7 +495,7 @@ etgl_set_property (GObject *object, case PROP_UNIFORM_ROW_HEIGHT: etgl->uniform_row_height = g_value_get_boolean (value); if (etgl->item) { - gnome_canvas_item_set (GNOME_CANVAS_ITEM(etgl->item), + gnome_canvas_item_set (GNOME_CANVAS_ITEM (etgl->item), "uniform_row_height", etgl->uniform_row_height, NULL); } @@ -504,7 +504,7 @@ etgl_set_property (GObject *object, case PROP_TABLE_ALTERNATING_ROW_COLORS: etgl->alternating_row_colors = g_value_get_boolean (value); if (etgl->item) { - gnome_canvas_item_set (GNOME_CANVAS_ITEM(etgl->item), + gnome_canvas_item_set (GNOME_CANVAS_ITEM (etgl->item), "alternating_row_colors", etgl->alternating_row_colors, NULL); } @@ -513,7 +513,7 @@ etgl_set_property (GObject *object, case PROP_TABLE_HORIZONTAL_DRAW_GRID: etgl->horizontal_draw_grid = g_value_get_boolean (value); if (etgl->item) { - gnome_canvas_item_set (GNOME_CANVAS_ITEM(etgl->item), + gnome_canvas_item_set (GNOME_CANVAS_ITEM (etgl->item), "horizontal_draw_grid", etgl->horizontal_draw_grid, NULL); } @@ -522,7 +522,7 @@ etgl_set_property (GObject *object, case PROP_TABLE_VERTICAL_DRAW_GRID: etgl->vertical_draw_grid = g_value_get_boolean (value); if (etgl->item) { - gnome_canvas_item_set (GNOME_CANVAS_ITEM(etgl->item), + gnome_canvas_item_set (GNOME_CANVAS_ITEM (etgl->item), "vertical_draw_grid", etgl->vertical_draw_grid, NULL); } @@ -531,7 +531,7 @@ etgl_set_property (GObject *object, case PROP_TABLE_DRAW_FOCUS: etgl->draw_focus = g_value_get_boolean (value); if (etgl->item) { - gnome_canvas_item_set (GNOME_CANVAS_ITEM(etgl->item), + gnome_canvas_item_set (GNOME_CANVAS_ITEM (etgl->item), "drawfocus", etgl->draw_focus, NULL); } @@ -540,7 +540,7 @@ etgl_set_property (GObject *object, case PROP_CURSOR_MODE: etgl->cursor_mode = g_value_get_int (value); if (etgl->item) { - gnome_canvas_item_set (GNOME_CANVAS_ITEM(etgl->item), + gnome_canvas_item_set (GNOME_CANVAS_ITEM (etgl->item), "cursor_mode", etgl->cursor_mode, NULL); } diff --git a/widgets/table/e-table-group.c b/widgets/table/e-table-group.c index 4189ae6015..ceec4fd81c 100644 --- a/widgets/table/e-table-group.c +++ b/widgets/table/e-table-group.c @@ -49,14 +49,14 @@ enum { LAST_SIGNAL }; -static guint etg_signals [LAST_SIGNAL] = { 0, }; +static guint etg_signals[LAST_SIGNAL] = { 0, }; static gboolean etg_get_focus (ETableGroup *etg); static void etg_dispose (GObject *object) { - ETableGroup *etg = E_TABLE_GROUP(object); + ETableGroup *etg = E_TABLE_GROUP (object); if (etg->header) { g_object_unref (etg->header); @@ -105,7 +105,7 @@ e_table_group_new (GnomeCanvasGroup *parent, { g_return_val_if_fail (model != NULL, NULL); - if (n < e_table_sort_info_grouping_get_count(sort_info)) { + if (n < e_table_sort_info_grouping_get_count (sort_info)) { return e_table_group_container_new ( parent, full_header, header, model, sort_info, n); } else { @@ -441,7 +441,7 @@ e_table_group_cursor_change (ETableGroup *e_table_group, gint row) g_return_if_fail (E_IS_TABLE_GROUP (e_table_group)); g_signal_emit (e_table_group, - etg_signals [CURSOR_CHANGE], 0, + etg_signals[CURSOR_CHANGE], 0, row); } @@ -459,7 +459,7 @@ e_table_group_cursor_activated (ETableGroup *e_table_group, gint row) g_return_if_fail (E_IS_TABLE_GROUP (e_table_group)); g_signal_emit (e_table_group, - etg_signals [CURSOR_ACTIVATED], 0, + etg_signals[CURSOR_ACTIVATED], 0, row); } @@ -482,7 +482,7 @@ e_table_group_double_click (ETableGroup *e_table_group, g_return_if_fail (E_IS_TABLE_GROUP (e_table_group)); g_signal_emit (e_table_group, - etg_signals [DOUBLE_CLICK], 0, + etg_signals[DOUBLE_CLICK], 0, row, col, event); } @@ -507,7 +507,7 @@ e_table_group_right_click (ETableGroup *e_table_group, g_return_val_if_fail (E_IS_TABLE_GROUP (e_table_group), FALSE); g_signal_emit (e_table_group, - etg_signals [RIGHT_CLICK], 0, + etg_signals[RIGHT_CLICK], 0, row, col, event, &return_val); return return_val; @@ -534,7 +534,7 @@ e_table_group_click (ETableGroup *e_table_group, g_return_val_if_fail (E_IS_TABLE_GROUP (e_table_group), FALSE); g_signal_emit (e_table_group, - etg_signals [CLICK], 0, + etg_signals[CLICK], 0, row, col, event, &return_val); return return_val; @@ -561,7 +561,7 @@ e_table_group_key_press (ETableGroup *e_table_group, g_return_val_if_fail (E_IS_TABLE_GROUP (e_table_group), FALSE); g_signal_emit (e_table_group, - etg_signals [KEY_PRESS], 0, + etg_signals[KEY_PRESS], 0, row, col, event, &return_val); return return_val; @@ -588,7 +588,7 @@ e_table_group_start_drag (ETableGroup *e_table_group, g_return_val_if_fail (E_IS_TABLE_GROUP (e_table_group), FALSE); g_signal_emit (e_table_group, - etg_signals [START_DRAG], 0, + etg_signals[START_DRAG], 0, row, col, event, &return_val); return return_val; @@ -628,8 +628,8 @@ etg_event (GnomeCanvasItem *item, GdkEvent *event) return_val = FALSE; } if (return_val == FALSE) { - if (GNOME_CANVAS_ITEM_CLASS(etg_parent_class)->event) - return GNOME_CANVAS_ITEM_CLASS(etg_parent_class)->event (item, event); + if (GNOME_CANVAS_ITEM_CLASS (etg_parent_class)->event) + return GNOME_CANVAS_ITEM_CLASS (etg_parent_class)->event (item, event); } return return_val; @@ -673,7 +673,7 @@ etg_class_init (ETableGroupClass *klass) klass->get_mouse_over = NULL; klass->get_cell_geometry = NULL; - etg_signals [CURSOR_CHANGE] = + etg_signals[CURSOR_CHANGE] = g_signal_new ("cursor_change", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -682,7 +682,7 @@ etg_class_init (ETableGroupClass *klass) g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT); - etg_signals [CURSOR_ACTIVATED] = + etg_signals[CURSOR_ACTIVATED] = g_signal_new ("cursor_activated", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -691,7 +691,7 @@ etg_class_init (ETableGroupClass *klass) g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT); - etg_signals [DOUBLE_CLICK] = + etg_signals[DOUBLE_CLICK] = g_signal_new ("double_click", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -701,7 +701,7 @@ etg_class_init (ETableGroupClass *klass) G_TYPE_NONE, 3, G_TYPE_INT, G_TYPE_INT, GDK_TYPE_EVENT); - etg_signals [RIGHT_CLICK] = + etg_signals[RIGHT_CLICK] = g_signal_new ("right_click", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -711,7 +711,7 @@ etg_class_init (ETableGroupClass *klass) G_TYPE_BOOLEAN, 3, G_TYPE_INT, G_TYPE_INT, GDK_TYPE_EVENT); - etg_signals [CLICK] = + etg_signals[CLICK] = g_signal_new ("click", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -721,7 +721,7 @@ etg_class_init (ETableGroupClass *klass) G_TYPE_BOOLEAN, 3, G_TYPE_INT, G_TYPE_INT, GDK_TYPE_EVENT); - etg_signals [KEY_PRESS] = + etg_signals[KEY_PRESS] = g_signal_new ("key_press", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -731,7 +731,7 @@ etg_class_init (ETableGroupClass *klass) G_TYPE_BOOLEAN, 3, G_TYPE_INT, G_TYPE_INT, GDK_TYPE_EVENT); - etg_signals [START_DRAG] = + etg_signals[START_DRAG] = g_signal_new ("start_drag", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, diff --git a/widgets/table/e-table-group.h b/widgets/table/e-table-group.h index 7ac1a243e8..79093416c6 100644 --- a/widgets/table/e-table-group.h +++ b/widgets/table/e-table-group.h @@ -123,7 +123,7 @@ void e_table_group_compute_location (ETableGroup *etg, gint *y, gint *row, gint *col); -void e_table_group_get_mouse_over(ETableGroup *etg, +void e_table_group_get_mouse_over (ETableGroup *etg, gint *row, gint *col); void e_table_group_get_cell_geometry (ETableGroup *etg, diff --git a/widgets/table/e-table-header-item.c b/widgets/table/e-table-header-item.c index 5084e19ebc..14597c943b 100644 --- a/widgets/table/e-table-header-item.c +++ b/widgets/table/e-table-header-item.c @@ -61,7 +61,7 @@ enum { LAST_SIGNAL }; -static guint ethi_signals [LAST_SIGNAL] = { 0, }; +static guint ethi_signals[LAST_SIGNAL] = { 0, }; #define ARROW_DOWN_HEIGHT 16 #define ARROW_PTR 7 @@ -191,7 +191,7 @@ ethi_update (GnomeCanvasItem *item, { ETableHeaderItem *ethi = E_TABLE_HEADER_ITEM (item); - gdouble i2c [6]; + gdouble i2c[6]; ArtPoint c1, c2, i1, i2; if (GNOME_CANVAS_ITEM_CLASS (ethi_parent_class)->update) @@ -247,7 +247,7 @@ ethi_font_set (ETableHeaderItem *ethi, PangoFontDescription *font_desc) ethi->font_desc = pango_font_description_copy (font_desc); ethi->height = e_table_header_item_get_height (ethi); - e_canvas_item_request_reflow(GNOME_CANVAS_ITEM(ethi)); + e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (ethi)); } static void @@ -270,13 +270,13 @@ ethi_drop_table_header (ETableHeaderItem *ethi) static void structure_changed (ETableHeader *header, ETableHeaderItem *ethi) { - gnome_canvas_item_request_update(GNOME_CANVAS_ITEM(ethi)); + gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (ethi)); } static void dimension_changed (ETableHeader *header, gint col, ETableHeaderItem *ethi) { - gnome_canvas_item_request_update(GNOME_CANVAS_ITEM(ethi)); + gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (ethi)); } static void @@ -293,14 +293,14 @@ ethi_add_table_header (ETableHeaderItem *ethi, ETableHeader *header) ethi->dimension_change_id = g_signal_connect ( header, "dimension_change", G_CALLBACK (dimension_changed), ethi); - e_canvas_item_request_reflow(GNOME_CANVAS_ITEM(ethi)); - gnome_canvas_item_request_update (GNOME_CANVAS_ITEM(ethi)); + e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (ethi)); + gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (ethi)); } static void ethi_sort_info_changed (ETableSortInfo *sort_info, ETableHeaderItem *ethi) { - gnome_canvas_item_request_update (GNOME_CANVAS_ITEM(ethi)); + gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (ethi)); } static void @@ -318,19 +318,19 @@ ethi_set_property (GObject *object, switch (prop_id) { case PROP_TABLE_HEADER: ethi_drop_table_header (ethi); - ethi_add_table_header (ethi, E_TABLE_HEADER(g_value_get_object (value))); + ethi_add_table_header (ethi, E_TABLE_HEADER (g_value_get_object (value))); break; case PROP_FULL_HEADER: if (ethi->full_header) - g_object_unref(ethi->full_header); - ethi->full_header = E_TABLE_HEADER(g_value_get_object (value)); + g_object_unref (ethi->full_header); + ethi->full_header = E_TABLE_HEADER (g_value_get_object (value)); if (ethi->full_header) - g_object_ref(ethi->full_header); + g_object_ref (ethi->full_header); break; case PROP_DND_CODE: - g_free(ethi->dnd_code); + g_free (ethi->dnd_code); ethi->dnd_code = g_strdup (g_value_get_string (value)); break; @@ -364,18 +364,18 @@ ethi_set_property (GObject *object, break; case PROP_TABLE: if (g_value_get_object (value)) - ethi->table = E_TABLE(g_value_get_object (value)); + ethi->table = E_TABLE (g_value_get_object (value)); else ethi->table = NULL; break; case PROP_TREE: if (g_value_get_object (value)) - ethi->tree = E_TREE(g_value_get_object (value)); + ethi->tree = E_TREE (g_value_get_object (value)); else ethi->tree = NULL; break; } - gnome_canvas_item_request_update(item); + gnome_canvas_item_request_update (item); } static void @@ -544,7 +544,7 @@ ethi_add_drop_marker (ETableHeaderItem *ethi, gint col, gboolean recreate) #define gray50_width 2 #define gray50_height 2 -static gchar gray50_bits [] = { +static gchar gray50_bits[] = { 0x02, 0x01, }; static void @@ -688,7 +688,7 @@ scroll_timeout (gpointer data) hadjustment_value = gtk_adjustment_get_value (adjustment); if (hadjustment_value != value) - do_drag_motion( + do_drag_motion ( ethi, ethi->last_drop_context, ethi->last_drop_x + hadjustment_value, @@ -837,8 +837,8 @@ ethi_drag_data_received (GtkWidget *canvas, data = gtk_selection_data_get_data (selection_data); if (data != NULL) { - count = e_table_header_count(ethi->eth); - column = atoi((gchar *)data); + count = e_table_header_count (ethi->eth); + column = atoi ((gchar *)data); drop_col = ethi->drop_col; ethi->drop_col = -1; @@ -846,13 +846,13 @@ ethi_drag_data_received (GtkWidget *canvas, for (i = 0; i < count; i++) { ETableCol *ecol = e_table_header_get_column (ethi->eth, i); if (ecol->col_idx == column) { - e_table_header_move(ethi->eth, i, drop_col); + e_table_header_move (ethi->eth, i, drop_col); found = TRUE; break; } } if (!found) { - count = e_table_header_count(ethi->full_header); + count = e_table_header_count (ethi->full_header); for (i = 0; i < count; i++) { ETableCol *ecol = e_table_header_get_column (ethi->full_header, i); if (ecol->col_idx == column) { @@ -864,7 +864,7 @@ ethi_drag_data_received (GtkWidget *canvas, } } ethi_remove_drop_marker (ethi); - gnome_canvas_item_request_update(GNOME_CANVAS_ITEM(ethi)); + gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (ethi)); } static void @@ -879,12 +879,12 @@ ethi_drag_data_get (GtkWidget *canvas, ETableCol *ecol = e_table_header_get_column (ethi->eth, ethi->drag_col); gchar *string = g_strdup_printf("%d", ecol->col_idx); - gtk_selection_data_set(selection_data, + gtk_selection_data_set (selection_data, GDK_SELECTION_TYPE_STRING, - sizeof(string[0]), + sizeof (string[0]), (guchar *)string, - strlen(string)); - g_free(string); + strlen (string)); + g_free (string); } } @@ -911,7 +911,7 @@ ethi_drag_drop (GtkWidget *canvas, if (col != -1) { 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); + gtk_drag_get_data (canvas, context, gdk_atom_intern (target, FALSE), time); g_free (target); } } @@ -936,7 +936,7 @@ ethi_realize (GnomeCanvasItem *item) { ETableHeaderItem *ethi = E_TABLE_HEADER_ITEM (item); GtkStyle *style; - GtkTargetEntry ethi_drop_types [] = { + GtkTargetEntry ethi_drop_types[] = { { (gchar *) TARGET_ETABLE_COL_TYPE, 0, TARGET_ETABLE_COL_HEADER }, }; @@ -1026,19 +1026,19 @@ ethi_draw (GnomeCanvasItem *item, style = gtk_widget_get_style (GTK_WIDGET (canvas)); if (ethi->sort_info) { - gint length = e_table_sort_info_grouping_get_count(ethi->sort_info); + 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); + ETableSortColumn column = e_table_sort_info_grouping_get_nth (ethi->sort_info, i); g_hash_table_insert (arrows, GINT_TO_POINTER ((gint) column.column), GINT_TO_POINTER (column.ascending ? E_TABLE_COL_ARROW_DOWN : E_TABLE_COL_ARROW_UP)); } - length = e_table_sort_info_sorting_get_count(ethi->sort_info); + length = e_table_sort_info_sorting_get_count (ethi->sort_info); for (i = 0; i < length; i++) { - ETableSortColumn column = e_table_sort_info_sorting_get_nth(ethi->sort_info, i); + ETableSortColumn column = e_table_sort_info_sorting_get_nth (ethi->sort_info, i); g_hash_table_insert (arrows, GINT_TO_POINTER ((gint) column.column), GINT_TO_POINTER (column.ascending ? @@ -1184,7 +1184,7 @@ ethi_end_resize (ETableHeaderItem *ethi) ethi->resize_col = -1; ethi->resize_guide = GINT_TO_POINTER (0); - gnome_canvas_item_request_update (GNOME_CANVAS_ITEM(ethi)); + gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (ethi)); } static gboolean @@ -1220,7 +1220,7 @@ ethi_start_drag (ETableHeaderItem *ethi, GdkEvent *event) GtkStyle *style; GdkWindow *window; - GtkTargetEntry ethi_drag_types [] = { + GtkTargetEntry ethi_drag_types[] = { { (gchar *) TARGET_ETABLE_COL_TYPE, 0, TARGET_ETABLE_COL_HEADER }, }; @@ -1235,11 +1235,11 @@ ethi_start_drag (ETableHeaderItem *ethi, GdkEvent *event) return; if (ethi->sort_info) { - gint length = e_table_sort_info_grouping_get_count(ethi->sort_info); + 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( + e_table_sort_info_grouping_get_nth ( ethi->sort_info, i); group_indent++; g_hash_table_insert ( @@ -1249,7 +1249,7 @@ ethi_start_drag (ETableHeaderItem *ethi, GdkEvent *event) E_TABLE_COL_ARROW_DOWN : E_TABLE_COL_ARROW_UP)); } - length = e_table_sort_info_sorting_get_count(ethi->sort_info); + length = e_table_sort_info_sorting_get_count (ethi->sort_info); for (i = 0; i < length; i++) { ETableSortColumn column = e_table_sort_info_sorting_get_nth ( @@ -1264,12 +1264,12 @@ ethi_start_drag (ETableHeaderItem *ethi, GdkEvent *event) } } - ethi_drag_types[0].target = g_strdup_printf( + ethi_drag_types[0].target = g_strdup_printf ( "%s-%s", ethi_drag_types[0].target, ethi->dnd_code); list = gtk_target_list_new ( ethi_drag_types, G_N_ELEMENTS (ethi_drag_types)); context = gtk_drag_begin (widget, list, GDK_ACTION_MOVE, 1, event); - g_free(ethi_drag_types[0].target); + g_free (ethi_drag_types[0].target); ecol = e_table_header_get_column (ethi->eth, ethi->drag_col); col_width = ecol->width; @@ -1304,7 +1304,7 @@ typedef struct { } EthiHeaderInfo; static void -ethi_popup_sort_ascending(GtkWidget *widget, EthiHeaderInfo *info) +ethi_popup_sort_ascending (GtkWidget *widget, EthiHeaderInfo *info) { ETableCol *col; gint model_col = -1; @@ -1317,7 +1317,7 @@ ethi_popup_sort_ascending(GtkWidget *widget, EthiHeaderInfo *info) if (col->sortable) model_col = col->col_idx; - length = e_table_sort_info_grouping_get_count(ethi->sort_info); + length = e_table_sort_info_grouping_get_count (ethi->sort_info); for (i = 0; i < length; i++) { ETableSortColumn column = e_table_sort_info_grouping_get_nth ( ethi->sort_info, i); @@ -1335,7 +1335,7 @@ ethi_popup_sort_ascending(GtkWidget *widget, EthiHeaderInfo *info) ethi->sort_info); for (i = 0; i < length; i++) { ETableSortColumn column = - e_table_sort_info_sorting_get_nth( + e_table_sort_info_sorting_get_nth ( ethi->sort_info, i); if (model_col == column.column || model_col == -1) { column.ascending = 1; @@ -1351,15 +1351,15 @@ ethi_popup_sort_ascending(GtkWidget *widget, EthiHeaderInfo *info) ETableSortColumn column; column.column = model_col; column.ascending = 1; - length = e_table_sort_info_sorting_get_count(ethi->sort_info); + length = e_table_sort_info_sorting_get_count (ethi->sort_info); if (length == 0) length++; - e_table_sort_info_sorting_set_nth(ethi->sort_info, length - 1, column); + e_table_sort_info_sorting_set_nth (ethi->sort_info, length - 1, column); } } static void -ethi_popup_sort_descending(GtkWidget *widget, EthiHeaderInfo *info) +ethi_popup_sort_descending (GtkWidget *widget, EthiHeaderInfo *info) { ETableCol *col; gint model_col=-1; @@ -1372,13 +1372,13 @@ ethi_popup_sort_descending(GtkWidget *widget, EthiHeaderInfo *info) if (col->sortable) model_col = col->col_idx; - length = e_table_sort_info_grouping_get_count(ethi->sort_info); + length = e_table_sort_info_grouping_get_count (ethi->sort_info); for (i = 0; i < length; i++) { - ETableSortColumn column = e_table_sort_info_grouping_get_nth( + ETableSortColumn column = e_table_sort_info_grouping_get_nth ( ethi->sort_info, i); if (model_col == column.column) { column.ascending = 0; - e_table_sort_info_grouping_set_nth( + e_table_sort_info_grouping_set_nth ( ethi->sort_info, i, column); found = 1; break; @@ -1388,7 +1388,7 @@ ethi_popup_sort_descending(GtkWidget *widget, EthiHeaderInfo *info) length = e_table_sort_info_sorting_get_count (ethi->sort_info); for (i = 0; i < length; i++) { ETableSortColumn column = - e_table_sort_info_sorting_get_nth( + e_table_sort_info_sorting_get_nth ( ethi->sort_info, i); if (model_col == column.column || model_col == -1) { @@ -1414,16 +1414,16 @@ ethi_popup_sort_descending(GtkWidget *widget, EthiHeaderInfo *info) } static void -ethi_popup_unsort(GtkWidget *widget, EthiHeaderInfo *info) +ethi_popup_unsort (GtkWidget *widget, EthiHeaderInfo *info) { ETableHeaderItem *ethi = info->ethi; - e_table_sort_info_grouping_truncate(ethi->sort_info, 0); - e_table_sort_info_sorting_truncate(ethi->sort_info, 0); + e_table_sort_info_grouping_truncate (ethi->sort_info, 0); + e_table_sort_info_sorting_truncate (ethi->sort_info, 0); } static void -ethi_popup_group_field(GtkWidget *widget, EthiHeaderInfo *info) +ethi_popup_group_field (GtkWidget *widget, EthiHeaderInfo *info) { ETableCol *col; gint model_col; @@ -1435,23 +1435,23 @@ ethi_popup_group_field(GtkWidget *widget, EthiHeaderInfo *info) column.column = model_col; column.ascending = 1; - e_table_sort_info_grouping_set_nth(ethi->sort_info, 0, column); - e_table_sort_info_grouping_truncate(ethi->sort_info, 1); + e_table_sort_info_grouping_set_nth (ethi->sort_info, 0, column); + e_table_sort_info_grouping_truncate (ethi->sort_info, 1); } static void -ethi_popup_group_box(GtkWidget *widget, EthiHeaderInfo *info) +ethi_popup_group_box (GtkWidget *widget, EthiHeaderInfo *info) { } static void -ethi_popup_remove_column(GtkWidget *widget, EthiHeaderInfo *info) +ethi_popup_remove_column (GtkWidget *widget, EthiHeaderInfo *info) { - e_table_header_remove(info->ethi->eth, info->col); + e_table_header_remove (info->ethi->eth, info->col); } static void -ethi_popup_field_chooser(GtkWidget *widget, EthiHeaderInfo *info) +ethi_popup_field_chooser (GtkWidget *widget, EthiHeaderInfo *info) { GtkWidget *etfcd = info->ethi->etfcd.widget; @@ -1476,12 +1476,12 @@ ethi_popup_field_chooser(GtkWidget *widget, EthiHeaderInfo *info) } static void -ethi_popup_alignment(GtkWidget *widget, EthiHeaderInfo *info) +ethi_popup_alignment (GtkWidget *widget, EthiHeaderInfo *info) { } static void -ethi_popup_best_fit(GtkWidget *widget, EthiHeaderInfo *info) +ethi_popup_best_fit (GtkWidget *widget, EthiHeaderInfo *info) { ETableHeaderItem *ethi = info->ethi; gint width; @@ -1492,12 +1492,12 @@ ethi_popup_best_fit(GtkWidget *widget, EthiHeaderInfo *info) /* Add 10 to stop it from "..."ing */ e_table_header_set_size (ethi->eth, info->col, width + 10); - gnome_canvas_item_request_update (GNOME_CANVAS_ITEM(ethi)); + gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (ethi)); } static void -ethi_popup_format_columns(GtkWidget *widget, EthiHeaderInfo *info) +ethi_popup_format_columns (GtkWidget *widget, EthiHeaderInfo *info) { } @@ -1524,7 +1524,7 @@ apply_changes (ETableConfig *config, ETableHeaderItem *ethi) } static void -ethi_popup_customize_view(GtkWidget *widget, EthiHeaderInfo *info) +ethi_popup_customize_view (GtkWidget *widget, EthiHeaderInfo *info) { ETableHeaderItem *ethi = info->ethi; ETableState *state; @@ -1534,10 +1534,10 @@ ethi_popup_customize_view(GtkWidget *widget, EthiHeaderInfo *info) e_table_config_raise (E_TABLE_CONFIG (ethi->config)); else { if (ethi->table) { - state = e_table_get_state_object(ethi->table); + state = e_table_get_state_object (ethi->table); spec = ethi->table->spec; } else if (ethi->tree) { - state = e_tree_get_state_object(ethi->tree); + state = e_tree_get_state_object (ethi->tree); spec = e_tree_get_spec (ethi->tree); } else return; @@ -1562,7 +1562,7 @@ free_popup_info (GtkWidget *w, EthiHeaderInfo *info) /* Bit 1 is always disabled. */ /* Bit 2 is disabled if not "sortable". */ /* Bit 4 is disabled if we don't have a pointer to our table object. */ -static EPopupMenu ethi_context_menu [] = { +static EPopupMenu ethi_context_menu[] = { E_POPUP_ITEM ( N_("Sort _Ascending"), G_CALLBACK (ethi_popup_sort_ascending), 2), @@ -1618,7 +1618,7 @@ sort_by_id (GtkWidget *menu_item, ETableHeaderItem *ethi) e_table_sort_info_sorting_get_count (ethi->sort_info) == 1) { ETableSortColumn column; - column = e_table_sort_info_sorting_get_nth(ethi->sort_info, 0); + column = e_table_sort_info_sorting_get_nth (ethi->sort_info, 0); clearfirst = ecol->sortable && ecol->col_idx != column.column; } @@ -1631,7 +1631,7 @@ sort_by_id (GtkWidget *menu_item, ETableHeaderItem *ethi) static void popup_custom (GtkWidget *menu_item, EthiHeaderInfo *info) { - ethi_popup_customize_view(menu_item, info); + ethi_popup_customize_view (menu_item, info); } static void @@ -1663,12 +1663,12 @@ ethi_header_context_menu (ETableHeaderItem *ethi, GdkEventButton *event) gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_item), sub_menu); gtk_menu_shell_prepend (GTK_MENU_SHELL (popup), menu_item); - sort_count = e_table_sort_info_sorting_get_count(ethi->sort_info); + sort_count = e_table_sort_info_sorting_get_count (ethi->sort_info); if (sort_count > 1 || sort_count < 1) sort_col = -1; /* Custom sorting */ else { - column = e_table_sort_info_sorting_get_nth(ethi->sort_info, 0); + column = e_table_sort_info_sorting_get_nth (ethi->sort_info, 0); sort_col = column.column; ascending = column.ascending; } @@ -1730,7 +1730,7 @@ static void ethi_button_pressed (ETableHeaderItem *ethi, GdkEventButton *event) { g_signal_emit (ethi, - ethi_signals [BUTTON_PRESSED], 0, event); + ethi_signals[BUTTON_PRESSED], 0, event); } void @@ -1747,14 +1747,14 @@ ethi_change_sort_state (ETableHeaderItem *ethi, ETableCol *col) if (col->sortable) model_col = col->col_idx; - length = e_table_sort_info_grouping_get_count(ethi->sort_info); + length = e_table_sort_info_grouping_get_count (ethi->sort_info); for (i = 0; i < length; i++) { - ETableSortColumn column = e_table_sort_info_grouping_get_nth(ethi->sort_info, i); + ETableSortColumn column = e_table_sort_info_grouping_get_nth (ethi->sort_info, i); if (model_col == column.column || model_col == -1) { gint ascending = column.ascending; ascending = !ascending; column.ascending = ascending; - e_table_sort_info_grouping_set_nth(ethi->sort_info, i, column); + e_table_sort_info_grouping_set_nth (ethi->sort_info, i, column); found = TRUE; if (model_col != -1) break; @@ -1762,9 +1762,9 @@ ethi_change_sort_state (ETableHeaderItem *ethi, ETableCol *col) } if (!found) { - length = e_table_sort_info_sorting_get_count(ethi->sort_info); + length = e_table_sort_info_sorting_get_count (ethi->sort_info); for (i = 0; i < length; i++) { - ETableSortColumn column = e_table_sort_info_sorting_get_nth(ethi->sort_info, i); + ETableSortColumn column = e_table_sort_info_sorting_get_nth (ethi->sort_info, i); if (model_col == column.column || model_col == -1) { gint ascending = column.ascending; @@ -1787,7 +1787,7 @@ ethi_change_sort_state (ETableHeaderItem *ethi, ETableCol *col) } else { ascending = !ascending; column.ascending = ascending; - e_table_sort_info_sorting_set_nth(ethi->sort_info, i, column); + e_table_sort_info_sorting_set_nth (ethi->sort_info, i, column); } found = TRUE; if (model_col != -1) @@ -1801,7 +1801,7 @@ ethi_change_sort_state (ETableHeaderItem *ethi, ETableCol *col) column.column = model_col; column.ascending = 1; e_table_sort_info_sorting_truncate (ethi->sort_info, 0); - e_table_sort_info_sorting_set_nth(ethi->sort_info, 0, column); + e_table_sort_info_sorting_set_nth (ethi->sort_info, 0, column); } } @@ -1850,7 +1850,7 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) e_table_header_set_size (ethi->eth, ethi->resize_col, new_width); - gnome_canvas_item_request_update (GNOME_CANVAS_ITEM(ethi)); + gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (ethi)); } else if (ethi_maybe_start_drag (ethi, &e->motion)) { ethi_start_drag (ethi, e); } else @@ -1910,7 +1910,7 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) /* Add 10 to stop it from "..."ing */ e_table_header_set_size (ethi->eth, ethi->resize_col, width + 10); - gnome_canvas_item_request_update (GNOME_CANVAS_ITEM(ethi)); + gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (ethi)); ethi->maybe_drag = FALSE; } break; @@ -1940,7 +1940,7 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) } case GDK_KEY_PRESS: if ((e->key.keyval == GDK_F10) && (e->key.state & GDK_SHIFT_MASK)) { - EthiHeaderInfo *info = g_new(EthiHeaderInfo, 1); + EthiHeaderInfo *info = g_new (EthiHeaderInfo, 1); ETableCol *ecol; GtkMenu *popup; @@ -2072,7 +2072,7 @@ ethi_class_init (ETableHeaderItemClass *klass) NULL, dnd_colormap, &add_col_mask, NULL, (gchar **) add_col_xpm); - ethi_signals [BUTTON_PRESSED] = + ethi_signals[BUTTON_PRESSED] = g_signal_new ("button_pressed", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, diff --git a/widgets/table/e-table-header-utils.c b/widgets/table/e-table-header-utils.c index f8080997be..fe542d76fc 100644 --- a/widgets/table/e-table-header-utils.c +++ b/widgets/table/e-table-header-utils.c @@ -347,7 +347,7 @@ e_table_header_draw_button (GdkDrawable *drawable, ETableCol *ecol, if (g_label == NULL) { GtkWidget *button = gtk_button_new_with_label("Hi"); - GtkWidget *window = gtk_window_new(GTK_WINDOW_TOPLEVEL); + GtkWidget *window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_container_add (GTK_CONTAINER (window), button); gtk_widget_ensure_style (window); gtk_widget_ensure_style (button); @@ -396,7 +396,7 @@ e_table_header_draw_button (GdkDrawable *drawable, ETableCol *ecol, inner_width -= arrow_width + HEADER_PADDING; break; default: - g_return_if_reached(); + g_return_if_reached (); } if (inner_width < 1) diff --git a/widgets/table/e-table-header.c b/widgets/table/e-table-header.c index 0ec180818e..1a3efafa85 100644 --- a/widgets/table/e-table-header.c +++ b/widgets/table/e-table-header.c @@ -52,7 +52,7 @@ enum { 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, }; +static guint eth_signals[LAST_SIGNAL] = { 0, }; G_DEFINE_TYPE (ETableHeader, e_table_header, G_TYPE_OBJECT) @@ -77,12 +77,12 @@ dequeue (ETableHeader *eth, gint *column, gint *width) if (!eth->change_queue) eth->change_tail = NULL; store = head->data; - g_slist_free_1(head); + g_slist_free_1 (head); if (column) *column = store->column; if (width) *width = store->width; - g_free(store); + g_free (store); } static gboolean @@ -112,16 +112,16 @@ static void enqueue (ETableHeader *eth, gint column, gint width) { struct two_ints *store; - store = g_new(struct two_ints, 1); + store = g_new (struct two_ints, 1); store->column = column; store->width = width; - eth->change_tail = g_slist_last(g_slist_append(eth->change_tail, store)); + eth->change_tail = g_slist_last (g_slist_append (eth->change_tail, store)); if (!eth->change_queue) eth->change_queue = eth->change_tail; if (!eth->idle) { - eth->idle = g_idle_add_full(G_PRIORITY_LOW, (GSourceFunc) dequeue_idle, eth, NULL); + eth->idle = g_idle_add_full (G_PRIORITY_LOW, (GSourceFunc) dequeue_idle, eth, NULL); } } @@ -138,9 +138,9 @@ static void eth_do_remove (ETableHeader *eth, gint idx, gboolean do_unref) { if (do_unref) - g_object_unref (eth->columns [idx]); + g_object_unref (eth->columns[idx]); - memmove (ð->columns [idx], ð->columns [idx+1], + memmove (ð->columns[idx], ð->columns[idx+1], sizeof (ETableCol *) * (eth->col_count - idx - 1)); eth->col_count--; } @@ -154,19 +154,19 @@ eth_finalize (GObject *object) if (eth->sort_info) { if (eth->sort_info_group_change_id) - g_signal_handler_disconnect(G_OBJECT(eth->sort_info), + g_signal_handler_disconnect (G_OBJECT (eth->sort_info), eth->sort_info_group_change_id); - g_object_unref(eth->sort_info); + g_object_unref (eth->sort_info); eth->sort_info = NULL; } if (eth->idle) - g_source_remove(eth->idle); + g_source_remove (eth->idle); eth->idle = 0; if (eth->change_queue) { - g_slist_foreach(eth->change_queue, (GFunc) g_free, NULL); - g_slist_free(eth->change_queue); + g_slist_foreach (eth->change_queue, (GFunc) g_free, NULL); + g_slist_free (eth->change_queue); eth->change_queue = NULL; } @@ -186,9 +186,9 @@ eth_finalize (GObject *object) } static void -eth_group_info_changed(ETableSortInfo *info, ETableHeader *eth) +eth_group_info_changed (ETableSortInfo *info, ETableHeader *eth) { - enqueue(eth, -1, eth->nominal_width); + enqueue (eth, -1, eth->nominal_width); } static void @@ -199,28 +199,28 @@ eth_set_property (GObject *object, guint prop_id, const GValue *val, GParamSpec switch (prop_id) { case PROP_WIDTH: eth->nominal_width = g_value_get_double (val); - enqueue(eth, -1, eth->nominal_width); + enqueue (eth, -1, eth->nominal_width); break; case PROP_WIDTH_EXTRAS: eth->width_extras = g_value_get_double (val); - enqueue(eth, -1, eth->nominal_width); + enqueue (eth, -1, eth->nominal_width); break; case PROP_SORT_INFO: if (eth->sort_info) { if (eth->sort_info_group_change_id) g_signal_handler_disconnect ( - G_OBJECT(eth->sort_info), + G_OBJECT (eth->sort_info), eth->sort_info_group_change_id); g_object_unref (eth->sort_info); } - eth->sort_info = E_TABLE_SORT_INFO(g_value_get_object (val)); + eth->sort_info = E_TABLE_SORT_INFO (g_value_get_object (val)); if (eth->sort_info) { - g_object_ref(eth->sort_info); + g_object_ref (eth->sort_info); eth->sort_info_group_change_id = g_signal_connect(G_OBJECT(eth->sort_info), "group_info_changed", - G_CALLBACK(eth_group_info_changed), eth); + G_CALLBACK (eth_group_info_changed), eth); } - enqueue(eth, -1, eth->nominal_width); + enqueue (eth, -1, eth->nominal_width); break; default: break; @@ -234,7 +234,7 @@ eth_get_property (GObject *object, guint prop_id, GValue *val, GParamSpec *pspec switch (prop_id) { case PROP_SORT_INFO: - g_value_set_object (val, G_OBJECT(eth->sort_info)); + g_value_set_object (val, G_OBJECT (eth->sort_info)); break; case PROP_WIDTH: g_value_set_double (val, eth->nominal_width); @@ -277,7 +277,7 @@ e_table_header_class_init (ETableHeaderClass *klass) E_TABLE_SORT_INFO_TYPE, G_PARAM_READWRITE)); - eth_signals [STRUCTURE_CHANGE] = + eth_signals[STRUCTURE_CHANGE] = g_signal_new ("structure_change", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, @@ -285,7 +285,7 @@ e_table_header_class_init (ETableHeaderClass *klass) (GSignalAccumulator) NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); - eth_signals [DIMENSION_CHANGE] = + eth_signals[DIMENSION_CHANGE] = g_signal_new ("dimension_change", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, @@ -293,7 +293,7 @@ e_table_header_class_init (ETableHeaderClass *klass) (GSignalAccumulator) NULL, NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT); - eth_signals [EXPANSION_CHANGE] = + eth_signals[EXPANSION_CHANGE] = g_signal_new ("expansion_change", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, @@ -301,7 +301,7 @@ e_table_header_class_init (ETableHeaderClass *klass) (GSignalAccumulator) NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); - eth_signals [REQUEST_WIDTH] = + eth_signals[REQUEST_WIDTH] = g_signal_new ("request_width", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, @@ -352,7 +352,7 @@ eth_update_offsets (ETableHeader *eth) gint x = 0; for (i = 0; i < eth->col_count; i++) { - ETableCol *etc = eth->columns [i]; + ETableCol *etc = eth->columns[i]; etc->x = x; x += etc->width; @@ -362,9 +362,9 @@ eth_update_offsets (ETableHeader *eth) static void eth_do_insert (ETableHeader *eth, gint pos, ETableCol *val) { - memmove (ð->columns [pos+1], ð->columns [pos], + memmove (ð->columns[pos+1], ð->columns[pos], sizeof (ETableCol *) * (eth->col_count - pos)); - eth->columns [pos] = val; + eth->columns[pos] = val; eth->col_count++; } @@ -402,8 +402,8 @@ e_table_header_add_column (ETableHeader *eth, ETableCol *tc, gint pos) eth_do_insert (eth, pos, tc); - enqueue(eth, -1, eth->nominal_width); - g_signal_emit (G_OBJECT (eth), eth_signals [STRUCTURE_CHANGE], 0); + enqueue (eth, -1, eth->nominal_width); + g_signal_emit (G_OBJECT (eth), eth_signals[STRUCTURE_CHANGE], 0); } /** @@ -425,7 +425,7 @@ e_table_header_get_column (ETableHeader *eth, gint column) if (column >= eth->col_count) return NULL; - return eth->columns [column]; + return eth->columns[column]; } /** @@ -444,7 +444,7 @@ e_table_header_get_column_by_col_idx (ETableHeader *eth, gint col_idx) for (i = 0; i < eth->col_count; i++) { if (eth->columns[i]->col_idx == col_idx) { - return eth->columns [i]; + return eth->columns[i]; } } @@ -485,7 +485,7 @@ e_table_header_index (ETableHeader *eth, gint col) g_return_val_if_fail (E_IS_TABLE_HEADER (eth), -1); g_return_val_if_fail (col >= 0 && col < eth->col_count, -1); - return eth->columns [col]->col_idx; + return eth->columns[col]->col_idx; } /** @@ -509,7 +509,7 @@ e_table_header_get_index_at (ETableHeader *eth, gint x_offset) total = 0; for (i = 0; i < eth->col_count; i++) { - total += eth->columns [i]->width; + total += eth->columns[i]->width; if (x_offset < total) return i; @@ -539,10 +539,10 @@ e_table_header_get_columns (ETableHeader *eth) ret = g_new (ETableCol *, eth->col_count + 1); memcpy (ret, eth->columns, sizeof (ETableCol *) * eth->col_count); - ret [eth->col_count] = NULL; + ret[eth->col_count] = NULL; for (i = 0; i < eth->col_count; i++) { - g_object_ref(ret[i]); + g_object_ref (ret[i]); } return ret; @@ -564,7 +564,7 @@ e_table_header_get_selected (ETableHeader *eth) g_return_val_if_fail (E_IS_TABLE_HEADER (eth), 0); for (i = 0; i < eth->col_count; i++) { - if (eth->columns [i]->selected) + if (eth->columns[i]->selected) selected++; } @@ -588,7 +588,7 @@ e_table_header_total_width (ETableHeader *eth) total = 0; for (i = 0; i < eth->col_count; i++) - total += eth->columns [i]->width; + total += eth->columns[i]->width; return total; } @@ -609,7 +609,7 @@ e_table_header_min_width (ETableHeader *eth) total = 0; for (i = 0; i < eth->col_count; i++) - total += eth->columns [i]->min_width; + total += eth->columns[i]->min_width; return total; } @@ -641,13 +641,13 @@ e_table_header_move (ETableHeader *eth, gint source_index, gint target_index) if (source_index < target_index) target_index--; - old = eth->columns [source_index]; + old = eth->columns[source_index]; eth_do_remove (eth, source_index, FALSE); eth_do_insert (eth, target_index, old); eth_update_offsets (eth); - g_signal_emit (G_OBJECT (eth), eth_signals [DIMENSION_CHANGE], 0, eth->width); - g_signal_emit (G_OBJECT (eth), eth_signals [STRUCTURE_CHANGE], 0); + g_signal_emit (G_OBJECT (eth), eth_signals[DIMENSION_CHANGE], 0, eth->width); + g_signal_emit (G_OBJECT (eth), eth_signals[STRUCTURE_CHANGE], 0); } /** @@ -667,8 +667,8 @@ e_table_header_remove (ETableHeader *eth, gint idx) g_return_if_fail (idx < eth->col_count); eth_do_remove (eth, idx, TRUE); - enqueue(eth, -1, eth->nominal_width); - g_signal_emit (G_OBJECT (eth), eth_signals [STRUCTURE_CHANGE], 0); + enqueue (eth, -1, eth->nominal_width); + g_signal_emit (G_OBJECT (eth), eth_signals[STRUCTURE_CHANGE], 0); } /* @@ -714,7 +714,7 @@ eth_set_size (ETableHeader *eth, gint idx, gint size) usable_width = eth->width - left_width - 1; if (eth->sort_info) - usable_width -= e_table_sort_info_grouping_get_count(eth->sort_info) * GROUP_INDENT; + usable_width -= e_table_sort_info_grouping_get_count (eth->sort_info) * GROUP_INDENT; /* Calculate minimum_width of stuff on the right as well as * total usable expansion on the right. @@ -739,7 +739,7 @@ eth_set_size (ETableHeader *eth, gint idx, gint size) eth->columns[i]->expansion = 0; } - g_signal_emit (G_OBJECT (eth), eth_signals [EXPANSION_CHANGE], 0); + g_signal_emit (G_OBJECT (eth), eth_signals[EXPANSION_CHANGE], 0); return; } @@ -749,7 +749,7 @@ eth_set_size (ETableHeader *eth, gint idx, gint size) for (i = idx; i < eth->col_count; i++) { eth->columns[i]->expansion = 0; } - g_signal_emit (G_OBJECT (eth), eth_signals [EXPANSION_CHANGE], 0); + g_signal_emit (G_OBJECT (eth), eth_signals[EXPANSION_CHANGE], 0); return; } @@ -766,7 +766,7 @@ eth_set_size (ETableHeader *eth, gint idx, gint size) for (i = idx + 1; i < eth->col_count; i++) { eth->columns[i]->expansion = 0; } - g_signal_emit (G_OBJECT (eth), eth_signals [EXPANSION_CHANGE], 0); + g_signal_emit (G_OBJECT (eth), eth_signals[EXPANSION_CHANGE], 0); return; } @@ -793,7 +793,7 @@ eth_set_size (ETableHeader *eth, gint idx, gint size) eth->columns[i]->expansion = expansion / expandable_count; } } - g_signal_emit (G_OBJECT (eth), eth_signals [EXPANSION_CHANGE], 0); + g_signal_emit (G_OBJECT (eth), eth_signals[EXPANSION_CHANGE], 0); return; } @@ -803,7 +803,7 @@ eth_set_size (ETableHeader *eth, gint idx, gint size) eth->columns[i]->expansion *= expansion / old_expansion; } } - g_signal_emit (G_OBJECT (eth), eth_signals [EXPANSION_CHANGE], 0); + g_signal_emit (G_OBJECT (eth), eth_signals[EXPANSION_CHANGE], 0); } /** @@ -834,7 +834,7 @@ e_table_header_col_diff (ETableHeader *eth, gint start_col, gint end_col) total = 0; for (col = start_col; col < end_col; col++) { - total += eth->columns [col]->width; + total += eth->columns[col]->width; } return total; @@ -865,7 +865,7 @@ eth_calc_widths (ETableHeader *eth) widths[i] = eth->columns[i]->min_width + eth->width_extras; } if (eth->sort_info) - extra -= e_table_sort_info_grouping_get_count(eth->sort_info) * GROUP_INDENT; + extra -= e_table_sort_info_grouping_get_count (eth->sort_info) * GROUP_INDENT; if (expansion != 0 && extra > 0) { for (i = 0; i < last_resizable; i++) { next_position += @@ -887,7 +887,7 @@ eth_calc_widths (ETableHeader *eth) } g_free (widths); if (changed) - g_signal_emit (G_OBJECT (eth), eth_signals [DIMENSION_CHANGE], 0, eth->width); + g_signal_emit (G_OBJECT (eth), eth_signals[DIMENSION_CHANGE], 0, eth->width); eth_update_offsets (eth); } @@ -908,8 +908,8 @@ e_table_header_update_horizontal (ETableHeader *eth) eth->columns[i]->min_width = width + 10; eth->columns[i]->expansion = 1; } - enqueue(eth, -1, eth->nominal_width); - g_signal_emit (G_OBJECT (eth), eth_signals [EXPANSION_CHANGE], 0); + enqueue (eth, -1, eth->nominal_width); + g_signal_emit (G_OBJECT (eth), eth_signals[EXPANSION_CHANGE], 0); } gint diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c index 9bf410a200..48c51d8f75 100644 --- a/widgets/table/e-table-item.c +++ b/widgets/table/e-table-item.c @@ -83,7 +83,7 @@ enum { LAST_SIGNAL }; -static guint eti_signals [LAST_SIGNAL] = { 0, }; +static guint eti_signals[LAST_SIGNAL] = { 0, }; enum { PROP_0, @@ -121,13 +121,13 @@ static void e_table_item_redraw_row (ETableItem *eti, gint 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, gint row) +model_to_view_row (ETableItem *eti, gint row) { gint i; if (row == -1) return -1; if (eti->uses_source_model) { - ETableSubset *etss = E_TABLE_SUBSET(eti->table_model); + ETableSubset *etss = E_TABLE_SUBSET (eti->table_model); if (eti->row_guess >= 0 && eti->row_guess < etss->n_map) { if (etss->map_table[eti->row_guess] == row) { return eti->row_guess; @@ -143,10 +143,10 @@ model_to_view_row(ETableItem *eti, gint row) } inline static gint -view_to_model_row(ETableItem *eti, gint row) +view_to_model_row (ETableItem *eti, gint row) { if (eti->uses_source_model) { - ETableSubset *etss = E_TABLE_SUBSET(eti->table_model); + ETableSubset *etss = E_TABLE_SUBSET (eti->table_model); if (row >= 0 && row < etss->n_map) { eti->row_guess = row; return etss->map_table[row]; @@ -157,7 +157,7 @@ view_to_model_row(ETableItem *eti, gint row) } inline static gint -model_to_view_col(ETableItem *eti, gint col) +model_to_view_col (ETableItem *eti, gint col) { gint i; if (col == -1) @@ -171,7 +171,7 @@ model_to_view_col(ETableItem *eti, gint col) } inline static gint -view_to_model_col(ETableItem *eti, gint 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; @@ -193,7 +193,7 @@ eti_grab (ETableItem *eti, guint32 time) if (eti->grabbed_count == 0) { eti->gtk_grabbed = FALSE; eti->grab_cancelled = FALSE; - if (e_canvas_item_grab(E_CANVAS (item->canvas), + if (e_canvas_item_grab (E_CANVAS (item->canvas), item, GDK_BUTTON1_MOTION_MASK | GDK_BUTTON2_MOTION_MASK | GDK_BUTTON3_MOTION_MASK | GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK, @@ -223,7 +223,7 @@ eti_ungrab (ETableItem *eti, guint32 time) gtk_grab_remove (GTK_WIDGET (item->canvas)); eti->gtk_grabbed = FALSE; } - gnome_canvas_item_ungrab(item, time); + gnome_canvas_item_ungrab (item, time); eti->grabbed_col = -1; eti->grabbed_row = -1; } @@ -244,7 +244,7 @@ eti_editing (ETableItem *eti) inline static GdkColor * eti_get_cell_background_color (ETableItem *eti, gint row, gint col, gboolean selected, gboolean *allocatedp) { - ECellView *ecell_view = eti->cell_views [col]; + ECellView *ecell_view = eti->cell_views[col]; GtkWidget *canvas; GdkColor *background, bg; GtkStyle *style; @@ -256,11 +256,11 @@ eti_get_cell_background_color (ETableItem *eti, gint row, gint col, gboolean sel if (selected) { if (gtk_widget_has_focus (canvas)) - background = &style->bg [GTK_STATE_SELECTED]; + background = &style->bg[GTK_STATE_SELECTED]; else - background = &style->bg [GTK_STATE_ACTIVE]; + background = &style->bg[GTK_STATE_ACTIVE]; } else { - background = &style->base [GTK_STATE_NORMAL]; + background = &style->base[GTK_STATE_NORMAL]; } color_spec = e_cell_get_bg_color (ecell_view, row); @@ -308,11 +308,11 @@ eti_get_cell_foreground_color (ETableItem *eti, gint row, gint col, gboolean sel if (selected) { if (gtk_widget_has_focus (canvas)) - foreground = &style->fg [GTK_STATE_SELECTED]; + foreground = &style->fg[GTK_STATE_SELECTED]; else - foreground = &style->fg [GTK_STATE_ACTIVE]; + foreground = &style->fg[GTK_STATE_ACTIVE]; } else { - foreground = &style->text [GTK_STATE_NORMAL]; + foreground = &style->text[GTK_STATE_NORMAL]; } return foreground; @@ -325,7 +325,7 @@ eti_free_save_state (ETableItem *eti) !eti->cell_views_realized) return; - e_cell_free_state (eti->cell_views [eti->save_col], view_to_model_col(eti, eti->save_col), + e_cell_free_state (eti->cell_views[eti->save_col], view_to_model_col (eti, eti->save_col), eti->save_col, eti->save_row, eti->save_state); eti->save_row = -1; eti->save_col = -1; @@ -355,7 +355,7 @@ eti_realize_cell_views ( ETableItem *eti) return; for (i = 0; i < eti->n_cells; i++) - e_cell_realize (eti->cell_views [i]); + e_cell_realize (eti->cell_views[i]); eti->cell_views_realized = 1; } @@ -384,7 +384,7 @@ eti_attach_cell_views (ETableItem *eti) for (i = 0; i < eti->n_cells; i++) { ETableCol *ecol = e_table_header_get_column (eti->header, i); - eti->cell_views [i] = e_cell_new_view (ecol->ecell, eti->table_model, eti); + eti->cell_views[i] = e_cell_new_view (ecol->ecell, eti->table_model, eti); } eti->needs_compute_height = 1; @@ -408,7 +408,7 @@ eti_unrealize_cell_views (ETableItem *eti) eti_free_save_state (eti); for (i = 0; i < eti->n_cells; i++) - e_cell_unrealize (eti->cell_views [i]); + e_cell_unrealize (eti->cell_views[i]); eti->cell_views_realized = 0; } @@ -420,8 +420,8 @@ eti_detach_cell_views (ETableItem *eti) eti_free_save_state (eti); for (i = 0; i < eti->n_cells; i++) { - e_cell_kill_view (eti->cell_views [i]); - eti->cell_views [i] = NULL; + e_cell_kill_view (eti->cell_views[i]); + eti->cell_views[i] = NULL; } g_free (eti->cell_views); @@ -432,7 +432,7 @@ eti_detach_cell_views (ETableItem *eti) static void eti_bounds (GnomeCanvasItem *item, gdouble *x1, gdouble *y1, gdouble *x2, gdouble *y2) { - gdouble i2c [6]; + gdouble i2c[6]; ArtPoint c1, c2, i1, i2; ETableItem *eti = E_TABLE_ITEM (item); @@ -470,7 +470,7 @@ eti_reflow (GnomeCanvasItem *item, gint flags) eti->needs_compute_height = 0; } if (eti->needs_compute_width) { - gint 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)); @@ -630,7 +630,7 @@ eti_row_height_real (ETableItem *eti, gint row) max_h = 0; for (col = 0; col < cols; col++) { - h = e_cell_height (eti->cell_views [col], view_to_model_col(eti, col), col, row); + h = e_cell_height (eti->cell_views[col], view_to_model_col (eti, col), col, row); if (h > max_h) max_h = h; @@ -645,21 +645,21 @@ confirm_height_cache (ETableItem *eti) if (eti->uniform_row_height || eti->height_cache) return; - eti->height_cache = g_new(int, eti->rows); + eti->height_cache = g_new (int, eti->rows); for (i = 0; i < eti->rows; i++) { eti->height_cache[i] = -1; } } static gboolean -height_cache_idle(ETableItem *eti) +height_cache_idle (ETableItem *eti) { gint changed = 0; gint i; - confirm_height_cache(eti); + confirm_height_cache (eti); for (i = eti->height_cache_idle_count; i < eti->rows; i++) { if (eti->height_cache[i] == -1) { - eti_row_height(eti, i); + eti_row_height (eti, i); changed++; if (changed >= 20) break; @@ -688,20 +688,20 @@ free_height_cache (ETableItem *eti) eti->uniform_row_height_cache = -1; if (eti->uniform_row_height && eti->height_cache_idle_id != 0) { - g_source_remove(eti->height_cache_idle_id); + g_source_remove (eti->height_cache_idle_id); eti->height_cache_idle_id = 0; } if ((!eti->uniform_row_height) && eti->height_cache_idle_id == 0) - eti->height_cache_idle_id = g_idle_add_full(G_PRIORITY_LOW, (GSourceFunc) height_cache_idle, eti, NULL); + eti->height_cache_idle_id = g_idle_add_full (G_PRIORITY_LOW, (GSourceFunc) height_cache_idle, eti, NULL); } } static void calculate_height_cache (ETableItem *eti) { - free_height_cache(eti); - confirm_height_cache(eti); + free_height_cache (eti); + confirm_height_cache (eti); } /* @@ -721,13 +721,13 @@ eti_row_height (ETableItem *eti, gint row) calculate_height_cache (eti); } if (eti->height_cache[row] == -1) { - eti->height_cache[row] = eti_row_height_real(eti, row); + eti->height_cache[row] = eti_row_height_real (eti, row); if (row > 0 && eti->length_threshold != -1 && eti->rows > eti->length_threshold && - eti->height_cache[row] != eti_row_height(eti, 0)) { + eti->height_cache[row] != eti_row_height (eti, 0)) { eti->needs_compute_height = 1; - e_canvas_item_request_reflow(GNOME_CANVAS_ITEM(eti)); + e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (eti)); } } return eti->height_cache[row]; @@ -756,14 +756,14 @@ eti_get_height (ETableItem *eti) return 0; if (eti->uniform_row_height) { - gint row_height = ETI_ROW_HEIGHT(eti, -1); + gint row_height = ETI_ROW_HEIGHT (eti, -1); return ((row_height + height_extra) * rows + height_extra); } else { gint height; gint row; if (eti->length_threshold != -1) { if (rows > eti->length_threshold) { - gint 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++) { @@ -797,7 +797,7 @@ eti_item_region_redraw (ETableItem *eti, gint x0, gint y0, gint x1, gint y1) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti); ArtDRect rect; - gdouble i2c [6]; + gdouble i2c[6]; rect.x0 = x0; rect.y0 = y0; @@ -824,7 +824,7 @@ e_table_item_row_diff (ETableItem *eti, gint start_row, gint end_row) end_row = eti->rows; if (eti->uniform_row_height) { - return ((end_row - start_row) * (ETI_ROW_HEIGHT(eti, -1) + height_extra)); + return ((end_row - start_row) * (ETI_ROW_HEIGHT (eti, -1) + height_extra)); } else { gint row, total; total = 0; @@ -908,9 +908,9 @@ eti_request_region_show (ETableItem *eti, &x1, &y1, &x2, &y2); if (delay) - e_canvas_item_show_area_delayed(GNOME_CANVAS_ITEM(eti), x1, y1, x2, y2, delay); + e_canvas_item_show_area_delayed (GNOME_CANVAS_ITEM (eti), x1, y1, x2, y2, delay); else - e_canvas_item_show_area(GNOME_CANVAS_ITEM(eti), x1, y1, x2, y2); + e_canvas_item_show_area (GNOME_CANVAS_ITEM (eti), x1, y1, x2, y2); } static void @@ -930,7 +930,7 @@ eti_show_cursor (ETableItem *eti, gint delay) } #if 0 - g_object_get(eti->selection, + g_object_get (eti->selection, "cursor_row", &cursor_row, NULL); #else @@ -963,7 +963,7 @@ eti_check_cursor_bounds (ETableItem *eti) return; } - g_object_get(eti->selection, + g_object_get (eti->selection, "cursor_row", &cursor_row, NULL); @@ -989,13 +989,13 @@ eti_check_cursor_bounds (ETableItem *eti) eti->cursor_y1 = y1; eti->cursor_x2 = x2; eti->cursor_y2 = y2; - eti->cursor_on_screen = e_canvas_item_area_shown (GNOME_CANVAS_ITEM(eti), x1, y1, x2, y2); + eti->cursor_on_screen = e_canvas_item_area_shown (GNOME_CANVAS_ITEM (eti), x1, y1, x2, y2); d(g_print ("%s: cursor on screen: %s\n", __FUNCTION__, eti->cursor_on_screen ? "TRUE" : "FALSE")); } static void -eti_maybe_show_cursor(ETableItem *eti, gint 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) @@ -1019,7 +1019,7 @@ eti_idle_show_cursor_cb (gpointer data) } static void -eti_idle_maybe_show_cursor(ETableItem *eti) +eti_idle_maybe_show_cursor (ETableItem *eti) { d(g_print ("%s: cursor on screen: %s\n", __FUNCTION__, eti->cursor_on_screen ? "TRUE" : "FALSE")); if (eti->cursor_on_screen) { @@ -1035,7 +1035,7 @@ eti_cancel_drag_due_to_model_change (ETableItem *eti) if (eti->maybe_in_drag) { eti->maybe_in_drag = FALSE; if (!eti->maybe_did_something) - e_selection_model_do_something(E_SELECTION_MODEL (eti->selection), eti->drag_row, eti->drag_col, eti->drag_state); + e_selection_model_do_something (E_SELECTION_MODEL (eti->selection), eti->drag_row, eti->drag_col, eti->drag_state); } if (eti->in_drag) { eti->in_drag = FALSE; @@ -1104,7 +1104,7 @@ eti_table_model_changed (ETableModel *table_model, ETableItem *eti) eti->rows = e_table_model_row_count (eti->table_model); - free_height_cache(eti); + free_height_cache (eti); eti_unfreeze (eti); @@ -1113,7 +1113,7 @@ eti_table_model_changed (ETableModel *table_model, ETableItem *eti) eti->needs_redraw = 1; gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (eti)); - eti_idle_maybe_show_cursor(eti); + eti_idle_maybe_show_cursor (eti); } static void @@ -1126,7 +1126,7 @@ eti_table_model_row_changed (ETableModel *table_model, gint row, ETableItem *eti return; } - if ((!eti->uniform_row_height) && eti->height_cache && eti->height_cache[row] != -1 && eti_row_height_real(eti, row) != eti->height_cache[row]) { + if ((!eti->uniform_row_height) && eti->height_cache && eti->height_cache[row] != -1 && eti_row_height_real (eti, row) != eti->height_cache[row]) { eti_table_model_changed (table_model, eti); return; } @@ -1146,7 +1146,7 @@ eti_table_model_cell_changed (ETableModel *table_model, gint col, gint row, ETab return; } - if ((!eti->uniform_row_height) && eti->height_cache && eti->height_cache[row] != -1 && eti_row_height_real(eti, row) != eti->height_cache[row]) { + if ((!eti->uniform_row_height) && eti->height_cache && eti->height_cache[row] != -1 && eti_row_height_real (eti, row) != eti->height_cache[row]) { eti_table_model_changed (table_model, eti); return; } @@ -1169,15 +1169,15 @@ eti_table_model_rows_inserted (ETableModel *table_model, gint row, gint count, E if (eti->height_cache) { 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(gint)); + 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 (gint)); for (i = row; i < row + count; i++) eti->height_cache[i] = -1; } eti_unfreeze (eti); - eti_idle_maybe_show_cursor(eti); + eti_idle_maybe_show_cursor (eti); eti->needs_compute_height = 1; e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (eti)); @@ -1198,12 +1198,12 @@ eti_table_model_rows_deleted (ETableModel *table_model, gint row, gint count, ET eti->rows = e_table_model_row_count (eti->table_model); if (eti->height_cache && (eti->rows > row)) { - memmove(eti->height_cache + row, eti->height_cache + row + count, (eti->rows - row) * sizeof(gint)); + memmove (eti->height_cache + row, eti->height_cache + row + count, (eti->rows - row) * sizeof (gint)); } eti_unfreeze (eti); - eti_idle_maybe_show_cursor(eti); + eti_idle_maybe_show_cursor (eti); eti->needs_compute_height = 1; e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (eti)); @@ -1233,20 +1233,20 @@ e_table_item_redraw_range (ETableItem *eti, g_return_if_fail (eti != NULL); g_return_if_fail (E_IS_TABLE_ITEM (eti)); - g_object_get(eti->selection, + g_object_get (eti->selection, "cursor_col", &cursor_col, "cursor_row", &cursor_row, NULL); if ((start_col == cursor_col) || (end_col == cursor_col) || - (view_to_model_row(eti, start_row) == cursor_row) || - (view_to_model_row(eti, end_row) == cursor_row)) + (view_to_model_row (eti, start_row) == cursor_row) || + (view_to_model_row (eti, end_row) == cursor_row)) border = 2; else border = 0; - eti_request_region_redraw(eti, start_col, start_row, end_col, end_row, border); + eti_request_region_redraw (eti, start_col, start_row, end_col, end_row, border); } static void @@ -1298,11 +1298,11 @@ eti_add_table_model (ETableItem *eti, ETableModel *table_model) eti_attach_cell_views (eti); } - if (E_IS_TABLE_SUBSET(table_model)) { + if (E_IS_TABLE_SUBSET (table_model)) { eti->uses_source_model = 1; - eti->source_model = E_TABLE_SUBSET(table_model)->source; + eti->source_model = E_TABLE_SUBSET (table_model)->source; if (eti->source_model) - g_object_ref(eti->source_model); + g_object_ref (eti->source_model); } eti_freeze (eti); @@ -1334,8 +1334,8 @@ eti_add_selection_model (ETableItem *eti, ESelectionModel *selection) selection, "cursor_activated", G_CALLBACK (eti_cursor_activated), eti); - eti_selection_change(selection, eti); - g_signal_emit_by_name (G_OBJECT(eti), + eti_selection_change (selection, eti); + g_signal_emit_by_name (G_OBJECT (eti), "selection_model_added", eti->selection); } @@ -1381,7 +1381,7 @@ eti_request_column_width (ETableHeader *eth, gint col, ETableItem *eti) 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); + width = e_cell_max_width (eti->cell_views[col], view_to_model_col (eti, col), col); } return width; @@ -1423,13 +1423,13 @@ eti_dispose (GObject *object) eti_remove_selection_model (eti); if (eti->height_cache_idle_id) { - g_source_remove(eti->height_cache_idle_id); + g_source_remove (eti->height_cache_idle_id); eti->height_cache_idle_id = 0; } eti->height_cache_idle_count = 0; if (eti->cursor_idle_id) { - g_source_remove(eti->cursor_idle_id); + g_source_remove (eti->cursor_idle_id); eti->cursor_idle_id = 0; } @@ -1451,20 +1451,20 @@ eti_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpe switch (prop_id) { case PROP_TABLE_HEADER: eti_remove_header_model (eti); - eti_add_header_model (eti, E_TABLE_HEADER(g_value_get_object (value))); + eti_add_header_model (eti, E_TABLE_HEADER (g_value_get_object (value))); break; case PROP_TABLE_MODEL: eti_remove_table_model (eti); - eti_add_table_model (eti, E_TABLE_MODEL(g_value_get_object (value))); + eti_add_table_model (eti, E_TABLE_MODEL (g_value_get_object (value))); break; case PROP_SELECTION_MODEL: - g_signal_emit_by_name (G_OBJECT(eti), + g_signal_emit_by_name (G_OBJECT (eti), "selection_model_removed", eti->selection); eti_remove_selection_model (eti); if (g_value_get_object (value)) - eti_add_selection_model (eti, E_SELECTION_MODEL(g_value_get_object(value))); + eti_add_selection_model (eti, E_SELECTION_MODEL (g_value_get_object (value))); break; case PROP_LENGTH_THRESHOLD: @@ -1493,25 +1493,25 @@ eti_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpe case PROP_MINIMUM_WIDTH: case PROP_WIDTH: - if ((eti->minimum_width == eti->width && g_value_get_double(value) > eti->width) || - g_value_get_double(value) < eti->width) { + if ((eti->minimum_width == eti->width && g_value_get_double (value) > eti->width) || + g_value_get_double (value) < eti->width) { eti->needs_compute_width = 1; e_canvas_item_request_reflow (item); } eti->minimum_width = g_value_get_double (value); break; case PROP_CURSOR_ROW: - g_object_get(eti->selection, + g_object_get (eti->selection, "cursor_col", &cursor_col, NULL); - e_table_item_focus (eti, cursor_col != -1 ? cursor_col : 0, view_to_model_row(eti, g_value_get_int (value)), 0); + e_table_item_focus (eti, cursor_col != -1 ? cursor_col : 0, view_to_model_row (eti, g_value_get_int (value)), 0); break; case PROP_UNIFORM_ROW_HEIGHT: if (eti->uniform_row_height != g_value_get_boolean (value)) { eti->uniform_row_height = g_value_get_boolean (value); if (item->flags & GNOME_CANVAS_ITEM_REALIZED) { - free_height_cache(eti); + free_height_cache (eti); eti->needs_compute_height = 1; e_canvas_item_request_reflow (item); eti->needs_redraw = 1; @@ -1543,10 +1543,10 @@ eti_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *psp g_value_set_double (value, eti->minimum_width); break; case PROP_CURSOR_ROW: - g_object_get(eti->selection, + g_object_get (eti->selection, "cursor_row", &row, NULL); - g_value_set_int (value, model_to_view_row(eti, row)); + g_value_set_int (value, model_to_view_row (eti, row)); break; case PROP_UNIFORM_ROW_HEIGHT: g_value_set_boolean (value, eti->uniform_row_height); @@ -1665,10 +1665,10 @@ eti_realize (GnomeCanvasItem *item) eti->fill_gc = gdk_gc_new (window); eti->grid_gc = gdk_gc_new (window); - gdk_gc_set_foreground (eti->grid_gc, &style->dark [GTK_STATE_NORMAL]); + gdk_gc_set_foreground (eti->grid_gc, &style->dark[GTK_STATE_NORMAL]); eti->focus_gc = gdk_gc_new (window); - gdk_gc_set_foreground (eti->focus_gc, &style->bg [GTK_STATE_NORMAL]); - gdk_gc_set_background (eti->focus_gc, &style->fg [GTK_STATE_NORMAL]); + gdk_gc_set_foreground (eti->focus_gc, &style->bg[GTK_STATE_NORMAL]); + gdk_gc_set_background (eti->focus_gc, &style->fg[GTK_STATE_NORMAL]); eti->stipple = gdk_bitmap_create_from_data (NULL, gray50_bits, gray50_width, gray50_height); gdk_gc_set_ts_origin (eti->focus_gc, 0, 0); gdk_gc_set_stipple (eti->focus_gc, eti->stipple); @@ -1681,13 +1681,13 @@ eti_realize (GnomeCanvasItem *item) eti_realize_cell_views (eti); - free_height_cache(eti); + free_height_cache (eti); if (item->canvas->focused_item == NULL && eti->selection) { gint row; row = e_selection_model_cursor_row (E_SELECTION_MODEL (eti->selection)); - row = model_to_view_row(eti, row); + row = model_to_view_row (eti, row); if (row != -1) { e_canvas_item_grab_focus (item, FALSE); eti_show_cursor (eti, 0); @@ -1716,7 +1716,7 @@ eti_unrealize (GnomeCanvasItem *item) e_table_item_leave_edit_(eti); if (eti->height_cache_idle_id) { - g_source_remove(eti->height_cache_idle_id); + g_source_remove (eti->height_cache_idle_id); eti->height_cache_idle_id = 0; } @@ -1754,9 +1754,9 @@ eti_draw (GnomeCanvasItem *item, GdkDrawable *drawable, gint x, gint y, gint wid gint x1, x2; gint f_x1, f_x2, f_y1, f_y2; gboolean f_found; - gdouble i2c [6]; + gdouble i2c[6]; ArtPoint eti_base, eti_base_item, lower_right; - GtkWidget *canvas = GTK_WIDGET(item->canvas); + GtkWidget *canvas = GTK_WIDGET (item->canvas); gint height_extra = eti->horizontal_draw_grid ? 1 : 0; cairo_t *cr; @@ -1870,16 +1870,16 @@ eti_draw (GnomeCanvasItem *item, GdkDrawable *drawable, gint x, gint y, gint wid xd = x_offset; - selected = e_selection_model_is_row_selected(E_SELECTION_MODEL (eti->selection), view_to_model_row(eti,row)); + selected = e_selection_model_is_row_selected (E_SELECTION_MODEL (eti->selection), view_to_model_row (eti,row)); - g_object_get(eti->selection, + g_object_get (eti->selection, "cursor_col", &cursor_col, "cursor_row", &cursor_row, NULL); for (col = first_col; col < last_col; col++) { ETableCol *ecol = e_table_header_get_column (eti->header, col); - ECellView *ecell_view = eti->cell_views [col]; + ECellView *ecell_view = eti->cell_views[col]; gboolean col_selected = selected; gboolean cursor = FALSE; ECellFlags flags; @@ -1891,7 +1891,7 @@ eti_draw (GnomeCanvasItem *item, GdkDrawable *drawable, gint x, gint y, gint wid switch (eti->cursor_mode) { case E_CURSOR_SIMPLE: case E_CURSOR_SPREADSHEET: - if (cursor_col == ecol->col_idx && cursor_row == view_to_model_row(eti, row)) { + if (cursor_col == ecol->col_idx && cursor_row == view_to_model_row (eti, row)) { col_selected = !col_selected; cursor = TRUE; } @@ -1975,7 +1975,7 @@ eti_draw (GnomeCanvasItem *item, GdkDrawable *drawable, gint x, gint y, gint wid if (!f_found && !selected) { switch (eti->cursor_mode) { case E_CURSOR_LINE: - if (view_to_model_row(eti, row) == cursor_row) { + if (view_to_model_row (eti, row) == cursor_row) { f_x1 = floor (eti_base.x) - x; f_x2 = floor (lower_right.x) - x; f_y1 = yd+1; @@ -1985,7 +1985,7 @@ eti_draw (GnomeCanvasItem *item, GdkDrawable *drawable, gint x, gint y, gint wid break; case E_CURSOR_SIMPLE: case E_CURSOR_SPREADSHEET: - if (view_to_model_col(eti, col) == cursor_col && view_to_model_row(eti, row) == cursor_row) { + if (view_to_model_col (eti, col) == cursor_col && view_to_model_row (eti, row) == cursor_row) { f_x1 = xd; f_x2 = xd + ecol->width; f_y1 = yd; @@ -2122,31 +2122,31 @@ static void eti_cursor_move (ETableItem *eti, gint row, gint column) { e_table_item_leave_edit_(eti); - e_table_item_focus (eti, view_to_model_col(eti, column), view_to_model_row(eti, row), 0); + e_table_item_focus (eti, view_to_model_col (eti, column), view_to_model_row (eti, row), 0); } static void eti_cursor_move_left (ETableItem *eti) { gint cursor_col, cursor_row; - g_object_get(eti->selection, + g_object_get (eti->selection, "cursor_col", &cursor_col, "cursor_row", &cursor_row, NULL); - eti_cursor_move (eti, model_to_view_row(eti, cursor_row), model_to_view_col(eti, cursor_col) - 1); + eti_cursor_move (eti, model_to_view_row (eti, cursor_row), model_to_view_col (eti, cursor_col) - 1); } static void eti_cursor_move_right (ETableItem *eti) { gint cursor_col, cursor_row; - g_object_get(eti->selection, + g_object_get (eti->selection, "cursor_col", &cursor_col, "cursor_row", &cursor_row, NULL); - eti_cursor_move (eti, model_to_view_row(eti, cursor_row), model_to_view_col(eti, cursor_col) + 1); + eti_cursor_move (eti, model_to_view_row (eti, cursor_row), model_to_view_col (eti, cursor_col) + 1); } static gint @@ -2203,7 +2203,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) switch (e->button.button) { case 1: /* Fall through. */ case 2: - e_canvas_item_grab_focus(GNOME_CANVAS_ITEM(eti), TRUE); + e_canvas_item_grab_focus (GNOME_CANVAS_ITEM (eti), TRUE); gnome_canvas_item_w2i (item, &e->button.x, &e->button.y); realx = e->button.x; @@ -2215,42 +2215,42 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) return TRUE; } - ecell_view = eti->cell_views [col]; + ecell_view = eti->cell_views[col]; button = *(GdkEventButton *)e; button.x = x1; button.y = y1; - g_object_get(eti->selection, + g_object_get (eti->selection, "cursor_row", &cursor_row, "cursor_col", &cursor_col, NULL); - if (cursor_col == view_to_model_col (eti, col) && cursor_row == view_to_model_row(eti, row)) { + if (cursor_col == view_to_model_col (eti, col) && cursor_row == view_to_model_row (eti, row)) { flags = E_CELL_CURSOR; } else { flags = 0; } - return_val = eti_e_cell_event (eti, ecell_view, (GdkEvent *) &button, button.time, view_to_model_col(eti, col), col, row, flags); + return_val = eti_e_cell_event (eti, ecell_view, (GdkEvent *) &button, button.time, view_to_model_col (eti, col), col, row, flags); if (return_val) return TRUE; - g_signal_emit (eti, eti_signals [CLICK], 0, - row, view_to_model_col(eti, col), &button, &return_val); + g_signal_emit (eti, eti_signals[CLICK], 0, + row, view_to_model_col (eti, col), &button, &return_val); if (return_val) { eti->click_count = 0; return TRUE; } - g_object_get(eti->selection, + g_object_get (eti->selection, "cursor_row", &cursor_row, "cursor_col", &cursor_col, NULL); eti->maybe_did_something = - e_selection_model_maybe_do_something(E_SELECTION_MODEL (eti->selection), view_to_model_row(eti, row), view_to_model_col(eti, col), button.state); - g_object_get(eti->selection, + e_selection_model_maybe_do_something (E_SELECTION_MODEL (eti->selection), view_to_model_row (eti, row), view_to_model_col (eti, col), button.state); + g_object_get (eti->selection, "cursor_row", &new_cursor_row, "cursor_col", &new_cursor_col, NULL); @@ -2261,7 +2261,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) eti->click_count++; eti->row_guess = row; - if ((!eti_editing(eti)) && e_table_model_is_cell_editable(eti->table_model, cursor_col, row)) { + if ((!eti_editing (eti)) && e_table_model_is_cell_editable (eti->table_model, cursor_col, row)) { e_table_item_enter_edit (eti, col, row); } @@ -2271,7 +2271,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) if (eti_editing (eti)) { return_val = eti_e_cell_event (eti, ecell_view, (GdkEvent *) &button, button.time, - view_to_model_col(eti, col), col, row, E_CELL_EDITING | E_CELL_CURSOR); + view_to_model_col (eti, col), col, row, E_CELL_EDITING | E_CELL_CURSOR); if (return_val) return TRUE; } @@ -2293,17 +2293,17 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) break; case 3: - e_canvas_item_grab_focus(GNOME_CANVAS_ITEM(eti), TRUE); + e_canvas_item_grab_focus (GNOME_CANVAS_ITEM (eti), TRUE); gnome_canvas_item_w2i (item, &e->button.x, &e->button.y); if (!find_cell (eti, e->button.x, e->button.y, &col, &row, &x1, &y1)) return TRUE; - e_selection_model_right_click_down(E_SELECTION_MODEL (eti->selection), view_to_model_row(eti, row), view_to_model_col(eti, col), 0); + e_selection_model_right_click_down (E_SELECTION_MODEL (eti->selection), view_to_model_row (eti, row), view_to_model_col (eti, col), 0); - g_signal_emit (eti, eti_signals [RIGHT_CLICK], 0, - row, view_to_model_col(eti, col), e, &return_val); + g_signal_emit (eti, eti_signals[RIGHT_CLICK], 0, + row, view_to_model_col (eti, col), e, &return_val); if (!return_val) - e_selection_model_right_click_up(E_SELECTION_MODEL (eti->selection)); + e_selection_model_right_click_up (E_SELECTION_MODEL (eti->selection)); break; case 4: case 5: @@ -2329,7 +2329,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) if (eti->maybe_in_drag) { eti->maybe_in_drag = FALSE; if (!eti->maybe_did_something) - e_selection_model_do_something(E_SELECTION_MODEL (eti->selection), eti->drag_row, eti->drag_col, eti->drag_state); + e_selection_model_do_something (E_SELECTION_MODEL (eti->selection), eti->drag_row, eti->drag_col, eti->drag_state); } if (eti->in_drag) { eti->in_drag = FALSE; @@ -2352,7 +2352,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) if (!find_cell (eti, e->button.x, e->button.y, &col, &row, &x1, &y1)) return TRUE; - g_object_get(eti->selection, + g_object_get (eti->selection, "cursor_row", &cursor_row, "cursor_col", &cursor_col, NULL); @@ -2361,12 +2361,12 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) "eti_editing: %s, row:%d:%d, col:%d:%d\n", __FUNCTION__, e->button.button, __LINE__, eti_editing(eti)?"true":"false", cursor_row, view_to_model_row(eti, row), cursor_col, view_to_model_col(eti, col))); - if (eti_editing (eti) && cursor_row == view_to_model_row(eti, row) && cursor_col == view_to_model_col(eti, col)) { + if (eti_editing (eti) && cursor_row == view_to_model_row (eti, row) && cursor_col == view_to_model_col (eti, col)) { d(g_print("%s: GDK_BUTTON_RELEASE received, button %d, line: %d\n", __FUNCTION__, e->button.button, __LINE__)) ; - ecell_view = eti->cell_views [col]; + ecell_view = eti->cell_views[col]; /* * Adjust the event positions @@ -2375,11 +2375,11 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) e->button.y = y1; return_val = eti_e_cell_event (eti, ecell_view, e, e->button.time, - view_to_model_col(eti, col), col, row, E_CELL_EDITING | E_CELL_CURSOR); + view_to_model_col (eti, col), col, row, E_CELL_EDITING | E_CELL_CURSOR); } break; case 3: - e_selection_model_right_click_up(E_SELECTION_MODEL (eti->selection)); + e_selection_model_right_click_up (E_SELECTION_MODEL (eti->selection)); return_val = TRUE; break; case 4: @@ -2412,7 +2412,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) return TRUE; #endif - g_object_get(eti->selection, + g_object_get (eti->selection, "cursor_row", &model_row, "cursor_col", &model_col, NULL); @@ -2424,7 +2424,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) if (eti->maybe_in_drag) { eti->maybe_in_drag = FALSE; if (!eti->maybe_did_something) - e_selection_model_do_something(E_SELECTION_MODEL (eti->selection), eti->drag_row, eti->drag_col, eti->drag_state); + e_selection_model_do_something (E_SELECTION_MODEL (eti->selection), eti->drag_row, eti->drag_col, eti->drag_state); } if (eti->in_drag) { eti->in_drag = FALSE; @@ -2440,7 +2440,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) } if (model_row != -1 && model_col != -1) { - g_signal_emit (eti, eti_signals [DOUBLE_CLICK], 0, + g_signal_emit (eti, eti_signals[DOUBLE_CLICK], 0, model_row, model_col, e); } } @@ -2459,7 +2459,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) gboolean drag_handled; eti->maybe_in_drag = 0; - g_signal_emit (eti, eti_signals [START_DRAG], 0, + g_signal_emit (eti, eti_signals[START_DRAG], 0, eti->drag_row, eti->drag_col, e, &drag_handled); if (drag_handled) eti->in_drag = 1; @@ -2475,26 +2475,26 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) (row != eti->motion_row || col != eti->motion_col)) { GdkEvent *cross = gdk_event_new (GDK_LEAVE_NOTIFY); cross->crossing.time = e->motion.time; - return_val = eti_e_cell_event (eti, eti->cell_views [eti->motion_col], + return_val = eti_e_cell_event (eti, eti->cell_views[eti->motion_col], cross, cross->crossing.time, - view_to_model_col(eti, eti->motion_col), + view_to_model_col (eti, eti->motion_col), eti->motion_col, eti->motion_row, 0); } eti->motion_row = row; eti->motion_col = col; - g_object_get(eti->selection, + g_object_get (eti->selection, "cursor_row", &cursor_row, "cursor_col", &cursor_col, NULL); flags = 0; - if (cursor_row == view_to_model_row(eti, row) && cursor_col == view_to_model_col(eti, col)) { + if (cursor_row == view_to_model_row (eti, row) && cursor_col == view_to_model_col (eti, col)) { flags = E_CELL_EDITING | E_CELL_CURSOR; } - ecell_view = eti->cell_views [col]; + ecell_view = eti->cell_views[col]; /* * Adjust the event positions @@ -2503,7 +2503,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) e->motion.y = y1; return_val = eti_e_cell_event (eti, ecell_view, e, e->motion.time, - view_to_model_col(eti, col), col, row, flags); + view_to_model_col (eti, col), col, row, flags); break; } @@ -2513,7 +2513,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) d(g_print("%s: GDK_KEY_PRESS received, keyval: %d\n", __FUNCTION__, (gint) e->key.keyval)); - g_object_get(eti->selection, + g_object_get (eti->selection, "cursor_row", &cursor_row, "cursor_col", &cursor_col, NULL); @@ -2531,11 +2531,11 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) break; } - g_signal_emit (eti, eti_signals [KEY_PRESS], 0, - model_to_view_row(eti, cursor_row), cursor_col, e, &return_val); + g_signal_emit (eti, eti_signals[KEY_PRESS], 0, + model_to_view_row (eti, cursor_row), cursor_col, e, &return_val); if ((!return_val) && - (atk_get_root() || eti->cursor_mode != E_CURSOR_LINE) && - cursor_col != view_to_model_col(eti, 0)) + (atk_get_root () || eti->cursor_mode != E_CURSOR_LINE) && + cursor_col != view_to_model_col (eti, 0)) eti_cursor_move_left (eti); return_val = 1; break; @@ -2547,11 +2547,11 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) break; } - g_signal_emit (eti, eti_signals [KEY_PRESS], 0, - model_to_view_row(eti, cursor_row), cursor_col, e, &return_val); + g_signal_emit (eti, eti_signals[KEY_PRESS], 0, + model_to_view_row (eti, cursor_row), cursor_col, e, &return_val); if ((!return_val) && - (atk_get_root() || eti->cursor_mode != E_CURSOR_LINE) && - cursor_col != view_to_model_col(eti, eti->cols - 1)) + (atk_get_root () || eti->cursor_mode != E_CURSOR_LINE) && + cursor_col != view_to_model_col (eti, eti->cols - 1)) eti_cursor_move_right (eti); return_val = 1; break; @@ -2562,13 +2562,13 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) case GDK_KP_Down: if ((e->key.state & GDK_MOD1_MASK) && ((e->key.keyval == GDK_Down ) || (e->key.keyval == GDK_KP_Down))) { - gint view_col = model_to_view_col(eti, cursor_col); + gint view_col = model_to_view_col (eti, cursor_col); if ((view_col >= 0) && (view_col < eti->cols)) - if (eti_e_cell_event (eti, eti->cell_views [view_col], e, ((GdkEventKey *)e)->time, cursor_col, view_col, model_to_view_row(eti, cursor_row), E_CELL_CURSOR)) + if (eti_e_cell_event (eti, eti->cell_views[view_col], e, ((GdkEventKey *)e)->time, cursor_col, view_col, model_to_view_row (eti, cursor_row), E_CELL_CURSOR)) return TRUE; } else - return_val = e_selection_model_key_press(E_SELECTION_MODEL (eti->selection), (GdkEventKey *) e); + return_val = e_selection_model_key_press (E_SELECTION_MODEL (eti->selection), (GdkEventKey *) e); break; case GDK_Home: case GDK_KP_Home: @@ -2578,10 +2578,10 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) } if (eti->cursor_mode != E_CURSOR_LINE) { - eti_cursor_move (eti, model_to_view_row(eti, cursor_row), 0); + eti_cursor_move (eti, model_to_view_row (eti, cursor_row), 0); return_val = TRUE; } else - return_val = e_selection_model_key_press(E_SELECTION_MODEL (eti->selection), (GdkEventKey *) e); + return_val = e_selection_model_key_press (E_SELECTION_MODEL (eti->selection), (GdkEventKey *) e); break; case GDK_End: case GDK_KP_End: @@ -2591,10 +2591,10 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) } if (eti->cursor_mode != E_CURSOR_LINE) { - eti_cursor_move (eti, model_to_view_row(eti, cursor_row), eti->cols - 1); + eti_cursor_move (eti, model_to_view_row (eti, cursor_row), eti->cols - 1); return_val = TRUE; } else - return_val = e_selection_model_key_press(E_SELECTION_MODEL (eti->selection), (GdkEventKey *) e); + return_val = e_selection_model_key_press (E_SELECTION_MODEL (eti->selection), (GdkEventKey *) e); break; case GDK_Tab: case GDK_KP_Tab: @@ -2606,28 +2606,28 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) if (eti->cursor_mode == E_CURSOR_SPREADSHEET) { if ((e->key.state & GDK_SHIFT_MASK) != 0) { /* shift tab */ - if (cursor_col != view_to_model_col(eti, 0)) + if (cursor_col != view_to_model_col (eti, 0)) eti_cursor_move_left (eti); - else if (cursor_row != view_to_model_row(eti, 0)) - eti_cursor_move (eti, model_to_view_row(eti, cursor_row) - 1, eti->cols - 1); + else if (cursor_row != view_to_model_row (eti, 0)) + eti_cursor_move (eti, model_to_view_row (eti, cursor_row) - 1, eti->cols - 1); else return_val = FALSE; } else { if (cursor_col != view_to_model_col (eti, eti->cols - 1)) eti_cursor_move_right (eti); - else if (cursor_row != view_to_model_row(eti, eti->rows - 1)) - eti_cursor_move (eti, model_to_view_row(eti, cursor_row) + 1, 0); + else if (cursor_row != view_to_model_row (eti, eti->rows - 1)) + eti_cursor_move (eti, model_to_view_row (eti, cursor_row) + 1, 0); else return_val = FALSE; } - g_object_get(eti->selection, + g_object_get (eti->selection, "cursor_row", &cursor_row, "cursor_col", &cursor_col, NULL); if (cursor_col >= 0 && cursor_row >= 0 && return_val && - (!eti_editing(eti)) && e_table_model_is_cell_editable(eti->table_model, cursor_col, model_to_view_row (eti, cursor_row))) { - e_table_item_enter_edit (eti, model_to_view_col(eti, cursor_col), model_to_view_row(eti, cursor_row)); + (!eti_editing (eti)) && e_table_model_is_cell_editable (eti->table_model, cursor_col, model_to_view_row (eti, cursor_row))) { + e_table_item_enter_edit (eti, model_to_view_col (eti, cursor_col), model_to_view_row (eti, cursor_row)); } break; } else { @@ -2641,14 +2641,14 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) case GDK_ISO_Enter: case GDK_3270_Enter: if (eti_editing (eti)) { - ecell_view = eti->cell_views [eti->editing_col]; + ecell_view = eti->cell_views[eti->editing_col]; return_val = eti_e_cell_event (eti, ecell_view, e, e->key.time, view_to_model_col (eti, eti->editing_col), eti->editing_col, eti->editing_row, E_CELL_EDITING | E_CELL_CURSOR | E_CELL_PREEDIT); if (!return_val) break; } - g_signal_emit (eti, eti_signals [KEY_PRESS], 0, + g_signal_emit (eti, eti_signals[KEY_PRESS], 0, model_to_view_row (eti, cursor_row), cursor_col, e, &return_val); if (!return_val) return_val = e_selection_model_key_press (E_SELECTION_MODEL (eti->selection), (GdkEventKey *) e); @@ -2683,24 +2683,24 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) default: if (!eti_editing (eti)) { gint col, row; - row = model_to_view_row(eti, cursor_row); - col = model_to_view_col(eti, cursor_col); - if (col != -1 && row != -1 && e_table_model_is_cell_editable(eti->table_model, cursor_col, row)) { + row = model_to_view_row (eti, cursor_row); + col = model_to_view_col (eti, cursor_col); + if (col != -1 && row != -1 && e_table_model_is_cell_editable (eti->table_model, cursor_col, row)) { e_table_item_enter_edit (eti, col, row); } } if (!eti_editing (eti)) { - g_signal_emit (eti, eti_signals [KEY_PRESS], 0, - model_to_view_row(eti, cursor_row), cursor_col, e, &return_val); + g_signal_emit (eti, eti_signals[KEY_PRESS], 0, + model_to_view_row (eti, cursor_row), cursor_col, e, &return_val); if (!return_val) - e_selection_model_key_press(E_SELECTION_MODEL (eti->selection), (GdkEventKey *) e); + e_selection_model_key_press (E_SELECTION_MODEL (eti->selection), (GdkEventKey *) e); } else { - ecell_view = eti->cell_views [eti->editing_col]; + ecell_view = eti->cell_views[eti->editing_col]; return_val = eti_e_cell_event (eti, ecell_view, e, e->key.time, - view_to_model_col(eti, eti->editing_col), + view_to_model_col (eti, eti->editing_col), eti->editing_col, eti->editing_row, E_CELL_EDITING | E_CELL_CURSOR); if (!return_val) - e_selection_model_key_press(E_SELECTION_MODEL (eti->selection), (GdkEventKey *) e); + e_selection_model_key_press (E_SELECTION_MODEL (eti->selection), (GdkEventKey *) e); } break; } @@ -2714,7 +2714,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) d(g_print("%s: GDK_KEY_RELEASE received, keyval: %d\n", __FUNCTION__, (gint) e->key.keyval)); - g_object_get(eti->selection, + g_object_get (eti->selection, "cursor_row", &cursor_row, "cursor_col", &cursor_col, NULL); @@ -2723,22 +2723,22 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) return FALSE; if (eti_editing (eti)) { - ecell_view = eti->cell_views [eti->editing_col]; + ecell_view = eti->cell_views[eti->editing_col]; return_val = eti_e_cell_event (eti, ecell_view, e, e->key.time, - view_to_model_col(eti, eti->editing_col), + view_to_model_col (eti, eti->editing_col), eti->editing_col, eti->editing_row, E_CELL_EDITING | E_CELL_CURSOR); } break; } case GDK_LEAVE_NOTIFY: - d(leave = TRUE); + d (leave = TRUE); case GDK_ENTER_NOTIFY: d(g_print("%s: %s received\n", __FUNCTION__, leave ? "GDK_LEAVE_NOTIFY" : "GDK_ENTER_NOTIFY")); if (eti->motion_row != -1 && eti->motion_col != -1) - return_val = eti_e_cell_event (eti, eti->cell_views [eti->motion_col], + return_val = eti_e_cell_event (eti, eti->cell_views[eti->motion_col], e, e->crossing.time, - view_to_model_col(eti, eti->motion_col), + view_to_model_col (eti, eti->motion_col), eti->motion_col, eti->motion_row, 0); eti->motion_row = -1; eti->motion_col = -1; @@ -2751,9 +2751,9 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) if (eti->save_row != -1 && eti->save_col != -1 && !eti_editing (eti) && - e_table_model_is_cell_editable(eti->table_model, view_to_model_col (eti, eti->save_col), eti->save_row)) { + e_table_model_is_cell_editable (eti->table_model, view_to_model_col (eti, eti->save_col), eti->save_row)) { e_table_item_enter_edit (eti, eti->save_col, eti->save_row); - e_cell_load_state (eti->cell_views [eti->editing_col], view_to_model_col(eti, eti->save_col), + e_cell_load_state (eti->cell_views[eti->editing_col], view_to_model_col (eti, eti->save_col), eti->save_col, eti->save_row, eti->edit_ctx, eti->save_state); eti_free_save_state (eti); } @@ -2763,7 +2763,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) eti->save_row = eti->editing_row; eti->save_col = eti->editing_col; - eti->save_state = e_cell_save_state (eti->cell_views [eti->editing_col], view_to_model_col(eti, eti->editing_col), + eti->save_state = e_cell_save_state (eti->cell_views[eti->editing_col], view_to_model_col (eti, eti->editing_col), eti->editing_col, eti->editing_row, eti->edit_ctx); e_table_item_leave_edit_(eti); } @@ -2801,7 +2801,7 @@ eti_style_set (ETableItem *eti, GtkStyle *previous_style) free_height_cache (eti); - eti_idle_maybe_show_cursor(eti); + eti_idle_maybe_show_cursor (eti); } static void @@ -2929,7 +2929,7 @@ eti_class_init (ETableItemClass *klass) FALSE, G_PARAM_READWRITE)); - eti_signals [CURSOR_CHANGE] = + eti_signals[CURSOR_CHANGE] = g_signal_new ("cursor_change", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -2938,7 +2938,7 @@ eti_class_init (ETableItemClass *klass) g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT); - eti_signals [CURSOR_ACTIVATED] = + eti_signals[CURSOR_ACTIVATED] = g_signal_new ("cursor_activated", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -2947,7 +2947,7 @@ eti_class_init (ETableItemClass *klass) g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT); - eti_signals [DOUBLE_CLICK] = + eti_signals[DOUBLE_CLICK] = g_signal_new ("double_click", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -2957,7 +2957,7 @@ eti_class_init (ETableItemClass *klass) G_TYPE_NONE, 3, G_TYPE_INT, G_TYPE_INT, GDK_TYPE_EVENT); - eti_signals [START_DRAG] = + eti_signals[START_DRAG] = g_signal_new ("start_drag", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -2967,7 +2967,7 @@ eti_class_init (ETableItemClass *klass) G_TYPE_BOOLEAN, 3, G_TYPE_INT, G_TYPE_INT, GDK_TYPE_EVENT); - eti_signals [RIGHT_CLICK] = + eti_signals[RIGHT_CLICK] = g_signal_new ("right_click", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -2977,7 +2977,7 @@ eti_class_init (ETableItemClass *klass) G_TYPE_BOOLEAN, 3, G_TYPE_INT, G_TYPE_INT, GDK_TYPE_EVENT); - eti_signals [CLICK] = + eti_signals[CLICK] = g_signal_new ("click", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -2987,7 +2987,7 @@ eti_class_init (ETableItemClass *klass) G_TYPE_BOOLEAN, 3, G_TYPE_INT, G_TYPE_INT, GDK_TYPE_EVENT); - eti_signals [KEY_PRESS] = + eti_signals[KEY_PRESS] = g_signal_new ("key_press", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -2997,7 +2997,7 @@ eti_class_init (ETableItemClass *klass) G_TYPE_BOOLEAN, 3, G_TYPE_INT, G_TYPE_INT, GDK_TYPE_EVENT); - eti_signals [STYLE_SET] = + eti_signals[STYLE_SET] = g_signal_new ("style_set", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -3041,7 +3041,7 @@ eti_class_init (ETableItemClass *klass) void e_table_item_set_cursor (ETableItem *eti, gint col, gint row) { - e_table_item_focus(eti, col, view_to_model_row(eti, row), 0); + e_table_item_focus (eti, col, view_to_model_row (eti, row), 0); } static void @@ -3051,7 +3051,7 @@ e_table_item_focus (ETableItem *eti, gint col, gint row, GdkModifierType state) g_return_if_fail (E_IS_TABLE_ITEM (eti)); if (row == -1) { - row = view_to_model_row(eti, eti->rows - 1); + row = view_to_model_row (eti, eti->rows - 1); } if (col == -1) { @@ -3059,7 +3059,7 @@ e_table_item_focus (ETableItem *eti, gint col, gint row, GdkModifierType state) } if (row != -1) { - e_selection_model_do_something(E_SELECTION_MODEL (eti->selection), + e_selection_model_do_something (E_SELECTION_MODEL (eti->selection), row, col, state); } @@ -3081,7 +3081,7 @@ e_table_item_get_focused_column (ETableItem *eti) g_return_val_if_fail (eti != NULL, -1); g_return_val_if_fail (E_IS_TABLE_ITEM (eti), -1); - g_object_get(eti->selection, + g_object_get (eti->selection, "cursor_col", &cursor_col, NULL); @@ -3097,7 +3097,7 @@ eti_cursor_change (ESelectionModel *selection, gint row, gint col, ETableItem *e if (!(item->flags & GNOME_CANVAS_ITEM_REALIZED)) return; - view_row = model_to_view_row(eti, row); + view_row = model_to_view_row (eti, row); if (eti->old_cursor_row != -1 && view_row != eti->old_cursor_row) e_table_item_redraw_row (eti, eti->old_cursor_row); @@ -3110,16 +3110,16 @@ eti_cursor_change (ESelectionModel *selection, gint row, gint col, ETableItem *e if (!e_table_model_has_change_pending (eti->table_model)) { if (!eti->in_key_press) { - eti_maybe_show_cursor(eti, DOUBLE_CLICK_TIME + 10); + eti_maybe_show_cursor (eti, DOUBLE_CLICK_TIME + 10); } else { - eti_maybe_show_cursor(eti, 0); + eti_maybe_show_cursor (eti, 0); } } - e_canvas_item_grab_focus(GNOME_CANVAS_ITEM(eti), FALSE); - if (eti_editing(eti)) + e_canvas_item_grab_focus (GNOME_CANVAS_ITEM (eti), FALSE); + if (eti_editing (eti)) e_table_item_leave_edit_(eti); - g_signal_emit (eti, eti_signals [CURSOR_CHANGE], 0, + g_signal_emit (eti, eti_signals[CURSOR_CHANGE], 0, view_row); e_table_item_redraw_row (eti, view_row); @@ -3137,25 +3137,25 @@ eti_cursor_activated (ESelectionModel *selection, gint row, gint col, ETableItem if (!(item->flags & GNOME_CANVAS_ITEM_REALIZED)) return; - view_row = model_to_view_row(eti, row); - view_col = model_to_view_col(eti, col); + view_row = model_to_view_row (eti, row); + view_col = model_to_view_col (eti, col); if (view_row != -1 && view_col != -1) { if (!e_table_model_has_change_pending (eti->table_model)) { if (!eti->in_key_press) { - eti_show_cursor(eti, DOUBLE_CLICK_TIME + 10); + eti_show_cursor (eti, DOUBLE_CLICK_TIME + 10); } else { - eti_show_cursor(eti, 0); + eti_show_cursor (eti, 0); } eti_check_cursor_bounds (eti); } } - if (eti_editing(eti)) + if (eti_editing (eti)) e_table_item_leave_edit_(eti); if (view_row != -1) - g_signal_emit (eti, eti_signals [CURSOR_ACTIVATED], 0, + g_signal_emit (eti, eti_signals[CURSOR_ACTIVATED], 0, view_row); } @@ -3168,7 +3168,7 @@ eti_selection_change (ESelectionModel *selection, ETableItem *eti) return; eti->needs_redraw = TRUE; - gnome_canvas_item_request_update(GNOME_CANVAS_ITEM(eti)); + gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (eti)); } static void @@ -3180,7 +3180,7 @@ eti_selection_row_change (ESelectionModel *selection, gint row, ETableItem *eti) return; if (!eti->needs_redraw) { - e_table_item_redraw_row (eti, model_to_view_row(eti, row)); + e_table_item_redraw_row (eti, model_to_view_row (eti, row)); } } @@ -3207,7 +3207,7 @@ e_table_item_enter_edit (ETableItem *eti, gint col, gint row) eti->editing_col = col; eti->editing_row = row; - eti->edit_ctx = e_cell_enter_edit (eti->cell_views [col], view_to_model_col(eti, col), col, row); + eti->edit_ctx = e_cell_enter_edit (eti->cell_views[col], view_to_model_col (eti, col), col, row); } /** @@ -3238,8 +3238,8 @@ e_table_item_leave_edit (ETableItem *eti) eti->editing_row = -1; eti->edit_ctx = NULL; - e_cell_leave_edit (eti->cell_views [col], - view_to_model_col(eti, col), + e_cell_leave_edit (eti->cell_views[col], + view_to_model_col (eti, col), col, row, edit_ctx); } @@ -3345,7 +3345,7 @@ e_table_item_calculate_print_widths (ETableHeader *eth, gdouble width) gdouble expansion; gint last_resizable = -1; gdouble scale = 1.0L; - gdouble *widths = g_new(gdouble, e_table_header_count(eth)); + gdouble *widths = g_new (gdouble, e_table_header_count (eth)); /* - 1 to account for the last pixel border. */ extra = width - 1; expansion = 0; @@ -3370,8 +3370,8 @@ eti_printed_row_height (ETableItem *eti, gdouble *widths, GtkPrintContext *conte gint cols = eti->cols; gdouble height = 0; for (col = 0; col < cols; col++) { - ECellView *ecell_view = eti->cell_views [col]; - gdouble this_height = e_cell_print_height (ecell_view, context, view_to_model_col(eti, col), col, row, + ECellView *ecell_view = eti->cell_views[col]; + gdouble this_height = e_cell_print_height (ecell_view, context, view_to_model_col (eti, col), col, row, widths[col] - 1); if (this_height > height) height = this_height; @@ -3421,13 +3421,13 @@ e_table_item_print_page (EPrintable *ep, */ if (eti->horizontal_draw_grid) { - gp_draw_rect(context, 0, yd, width, 1); + gp_draw_rect (context, 0, yd, width, 1); } yd++; for (row = rows_printed; row < rows; row++) { gdouble xd = 1, row_height; - row_height = eti_printed_row_height(eti, widths, context, row); + row_height = eti_printed_row_height (eti, widths, context, row); if (quantize) { if (yd + row_height + 1 > max_height && row != rows_printed) { @@ -3442,15 +3442,15 @@ e_table_item_print_page (EPrintable *ep, } for (col = 0; col < cols; col++) { - ECellView *ecell_view = eti->cell_views [col]; + ECellView *ecell_view = eti->cell_views[col]; - cairo_save(cr); - cairo_translate(cr, xd, yd); + cairo_save (cr); + cairo_translate (cr, xd, yd); cairo_rectangle (cr, 0, 0, widths[col] - 1, row_height); - cairo_clip(cr); + cairo_clip (cr); e_cell_print (ecell_view, context, - view_to_model_col(eti, col), + view_to_model_col (eti, col), col, row, widths[col] - 1, @@ -3462,7 +3462,7 @@ e_table_item_print_page (EPrintable *ep, yd += row_height; if (eti->horizontal_draw_grid) { - gp_draw_rect(context, 0, yd, width, 1); + gp_draw_rect (context, 0, yd, width, 1); } yd++; } @@ -3471,10 +3471,10 @@ e_table_item_print_page (EPrintable *ep, if (eti->vertical_draw_grid) { gdouble xd = 0; for (col = 0; col < cols; col++) { - gp_draw_rect(context, xd, height, 1, yd - height); + gp_draw_rect (context, xd, height, 1, yd - height); xd += widths[col]; } - gp_draw_rect(context, xd, height, 1, yd - height); + gp_draw_rect (context, xd, height, 1, yd - height); } if (next_page) @@ -3526,7 +3526,7 @@ e_table_item_height (EPrintable *ep, for (row = rows_printed; row < rows; row++) { gdouble row_height; - row_height = eti_printed_row_height(item, widths, context, row); + row_height = eti_printed_row_height (item, widths, context, row); if (quantize) { if (max_height != -1 && yd + row_height + 1 > max_height && row != rows_printed) { break; @@ -3577,7 +3577,7 @@ e_table_item_will_fit (EPrintable *ep, for (row = rows_printed; row < rows; row++) { gdouble row_height; - row_height = eti_printed_row_height(item, widths, context, row); + row_height = eti_printed_row_height (item, widths, context, row); if (quantize) { if (max_height != -1 && yd + row_height + 1 > max_height && row != rows_printed) { ret_val = FALSE; @@ -3607,8 +3607,8 @@ e_table_item_printable_destroy (gpointer data, { ETableItemPrintContext *itemcontext = data; - g_object_unref(itemcontext->item); - g_free(itemcontext); + g_object_unref (itemcontext->item); + g_free (itemcontext); } /** @@ -3623,33 +3623,33 @@ e_table_item_printable_destroy (gpointer data, EPrintable * e_table_item_get_printable (ETableItem *item) { - EPrintable *printable = e_printable_new(); + EPrintable *printable = e_printable_new (); ETableItemPrintContext *itemcontext; - itemcontext = g_new(ETableItemPrintContext, 1); + itemcontext = g_new (ETableItemPrintContext, 1); itemcontext->item = item; - g_object_ref(item); + g_object_ref (item); itemcontext->rows_printed = 0; g_signal_connect (printable, "print_page", - G_CALLBACK(e_table_item_print_page), + G_CALLBACK (e_table_item_print_page), itemcontext); g_signal_connect (printable, "data_left", - G_CALLBACK(e_table_item_data_left), + G_CALLBACK (e_table_item_data_left), itemcontext); g_signal_connect (printable, "reset", - G_CALLBACK(e_table_item_reset), + G_CALLBACK (e_table_item_reset), itemcontext); g_signal_connect (printable, "height", - G_CALLBACK(e_table_item_height), + G_CALLBACK (e_table_item_height), itemcontext); g_signal_connect (printable, "will_fit", - G_CALLBACK(e_table_item_will_fit), + G_CALLBACK (e_table_item_will_fit), itemcontext); g_object_weak_ref (G_OBJECT (printable), e_table_item_printable_destroy, diff --git a/widgets/table/e-table-memory-callbacks.c b/widgets/table/e-table-memory-callbacks.c index e37c1aab88..8bdfc585df 100644 --- a/widgets/table/e-table-memory-callbacks.c +++ b/widgets/table/e-table-memory-callbacks.c @@ -32,7 +32,7 @@ G_DEFINE_TYPE (ETableMemoryCalbacks, e_table_memory_callbacks, E_TABLE_MEMORY_TY static gint etmc_column_count (ETableModel *etm) { - ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS(etm); + ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS (etm); if (etmc->col_count) return etmc->col_count (etm, etmc->data); @@ -43,7 +43,7 @@ etmc_column_count (ETableModel *etm) static gpointer etmc_value_at (ETableModel *etm, gint col, gint row) { - ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS(etm); + ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS (etm); if (etmc->value_at) return etmc->value_at (etm, col, row, etmc->data); @@ -54,7 +54,7 @@ etmc_value_at (ETableModel *etm, gint col, gint row) static void etmc_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) { - ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS(etm); + ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS (etm); if (etmc->set_value_at) etmc->set_value_at (etm, col, row, val, etmc->data); @@ -63,7 +63,7 @@ etmc_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) static gboolean etmc_is_cell_editable (ETableModel *etm, gint col, gint row) { - ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS(etm); + ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS (etm); if (etmc->is_cell_editable) return etmc->is_cell_editable (etm, col, row, etmc->data); @@ -75,7 +75,7 @@ etmc_is_cell_editable (ETableModel *etm, gint col, gint row) static gpointer etmc_duplicate_value (ETableModel *etm, gint col, gconstpointer value) { - ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS(etm); + ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS (etm); if (etmc->duplicate_value) return etmc->duplicate_value (etm, col, value, etmc->data); @@ -86,7 +86,7 @@ etmc_duplicate_value (ETableModel *etm, gint col, gconstpointer value) static void etmc_free_value (ETableModel *etm, gint col, gpointer value) { - ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS(etm); + ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS (etm); if (etmc->free_value) etmc->free_value (etm, col, value, etmc->data); @@ -95,7 +95,7 @@ etmc_free_value (ETableModel *etm, gint col, gpointer value) static gpointer etmc_initialize_value (ETableModel *etm, gint col) { - ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS(etm); + ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS (etm); if (etmc->initialize_value) return etmc->initialize_value (etm, col, etmc->data); @@ -106,7 +106,7 @@ etmc_initialize_value (ETableModel *etm, gint col) static gboolean etmc_value_is_empty (ETableModel *etm, gint col, gconstpointer value) { - ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS(etm); + ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS (etm); if (etmc->value_is_empty) return etmc->value_is_empty (etm, col, value, etmc->data); @@ -117,7 +117,7 @@ etmc_value_is_empty (ETableModel *etm, gint col, gconstpointer value) static gchar * etmc_value_to_string (ETableModel *etm, gint col, gconstpointer value) { - ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS(etm); + ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS (etm); if (etmc->value_to_string) return etmc->value_to_string (etm, col, value, etmc->data); @@ -128,7 +128,7 @@ etmc_value_to_string (ETableModel *etm, gint col, gconstpointer value) static void etmc_append_row (ETableModel *etm, ETableModel *source, gint row) { - ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS(etm); + ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS (etm); if (etmc->append_row) etmc->append_row (etm, source, row, etmc->data); diff --git a/widgets/table/e-table-memory-store.c b/widgets/table/e-table-memory-store.c index 4354b57189..05aad76d35 100644 --- a/widgets/table/e-table-memory-store.c +++ b/widgets/table/e-table-memory-store.c @@ -89,7 +89,7 @@ free_value (ETableMemoryStore *etms, gint col, gpointer value) static gint etms_column_count (ETableModel *etm) { - ETableMemoryStore *etms = E_TABLE_MEMORY_STORE(etm); + ETableMemoryStore *etms = E_TABLE_MEMORY_STORE (etm); return etms->priv->col_count; } @@ -97,7 +97,7 @@ etms_column_count (ETableModel *etm) static gpointer etms_value_at (ETableModel *etm, gint col, gint row) { - ETableMemoryStore *etms = E_TABLE_MEMORY_STORE(etm); + ETableMemoryStore *etms = E_TABLE_MEMORY_STORE (etm); return STORE_LOCATOR (etms, col, row); } @@ -105,7 +105,7 @@ etms_value_at (ETableModel *etm, gint col, gint row) static void etms_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) { - ETableMemoryStore *etms = E_TABLE_MEMORY_STORE(etm); + ETableMemoryStore *etms = E_TABLE_MEMORY_STORE (etm); e_table_model_pre_change (etm); @@ -117,7 +117,7 @@ etms_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) static gboolean etms_is_cell_editable (ETableModel *etm, gint col, gint row) { - ETableMemoryStore *etms = E_TABLE_MEMORY_STORE(etm); + ETableMemoryStore *etms = E_TABLE_MEMORY_STORE (etm); return etms->priv->columns[col].editable; } @@ -126,7 +126,7 @@ etms_is_cell_editable (ETableModel *etm, gint col, gint row) static gpointer etms_duplicate_value (ETableModel *etm, gint col, gconstpointer value) { - ETableMemoryStore *etms = E_TABLE_MEMORY_STORE(etm); + ETableMemoryStore *etms = E_TABLE_MEMORY_STORE (etm); return duplicate_value (etms, col, value); } @@ -134,7 +134,7 @@ etms_duplicate_value (ETableModel *etm, gint col, gconstpointer value) static void etms_free_value (ETableModel *etm, gint col, gpointer value) { - ETableMemoryStore *etms = E_TABLE_MEMORY_STORE(etm); + ETableMemoryStore *etms = E_TABLE_MEMORY_STORE (etm); free_value (etms, col, value); } @@ -142,7 +142,7 @@ etms_free_value (ETableModel *etm, gint col, gpointer value) static gpointer etms_initialize_value (ETableModel *etm, gint col) { - ETableMemoryStore *etms = E_TABLE_MEMORY_STORE(etm); + ETableMemoryStore *etms = E_TABLE_MEMORY_STORE (etm); switch (etms->priv->columns[col].type) { case E_TABLE_MEMORY_STORE_COLUMN_TYPE_STRING: @@ -163,7 +163,7 @@ etms_initialize_value (ETableModel *etm, gint col) static gboolean etms_value_is_empty (ETableModel *etm, gint col, gconstpointer value) { - ETableMemoryStore *etms = E_TABLE_MEMORY_STORE(etm); + ETableMemoryStore *etms = E_TABLE_MEMORY_STORE (etm); switch (etms->priv->columns[col].type) { case E_TABLE_MEMORY_STORE_COLUMN_TYPE_STRING: @@ -184,7 +184,7 @@ etms_value_is_empty (ETableModel *etm, gint col, gconstpointer value) static gchar * etms_value_to_string (ETableModel *etm, gint col, gconstpointer value) { - ETableMemoryStore *etms = E_TABLE_MEMORY_STORE(etm); + ETableMemoryStore *etms = E_TABLE_MEMORY_STORE (etm); switch (etms->priv->columns[col].type) { case E_TABLE_MEMORY_STORE_COLUMN_TYPE_STRING: @@ -205,7 +205,7 @@ etms_value_to_string (ETableModel *etm, gint col, gconstpointer value) static void etms_append_row (ETableModel *etm, ETableModel *source, gint row) { - ETableMemoryStore *etms = E_TABLE_MEMORY_STORE(etm); + ETableMemoryStore *etms = E_TABLE_MEMORY_STORE (etm); gpointer *new_data; gint i; gint row_count; @@ -348,7 +348,7 @@ e_table_memory_store_insert_array (ETableMemoryStore *etms, gint row, gpointer * 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]); + STORE_LOCATOR (etms, i, row) = duplicate_value (etms, i, store[i]); } e_table_memory_insert (E_TABLE_MEMORY (etms), row, data); @@ -389,7 +389,7 @@ e_table_memory_store_insert_adopt_array (ETableMemoryStore *etms, gint row, gpoi 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]; + STORE_LOCATOR (etms, i, row) = store[i]; } e_table_memory_insert (E_TABLE_MEMORY (etms), row, data); @@ -436,8 +436,8 @@ e_table_memory_store_change_array (ETableMemoryStore *etms, gint row, gpointer * e_table_model_pre_change (E_TABLE_MODEL (etms)); for (i = 0; i < etms->priv->col_count; i++) { - free_value (etms, i, STORE_LOCATOR(etms, i, row)); - STORE_LOCATOR(etms, i, row) = duplicate_value(etms, i, store[i]); + free_value (etms, i, STORE_LOCATOR (etms, i, row)); + STORE_LOCATOR (etms, i, row) = duplicate_value (etms, i, store[i]); } e_table_memory_set_data (E_TABLE_MEMORY (etms), row, data); @@ -495,8 +495,8 @@ e_table_memory_store_change_adopt_array (ETableMemoryStore *etms, gint row, gpoi g_return_if_fail (row >= 0 && row < e_table_model_row_count (E_TABLE_MODEL (etms))); for (i = 0; i < etms->priv->col_count; i++) { - free_value (etms, i, STORE_LOCATOR(etms, i, row)); - STORE_LOCATOR(etms, i, row) = store[i]; + free_value (etms, i, STORE_LOCATOR (etms, i, row)); + STORE_LOCATOR (etms, i, row) = store[i]; } e_table_memory_set_data (E_TABLE_MEMORY (etms), row, data); diff --git a/widgets/table/e-table-memory.c b/widgets/table/e-table-memory.c index a761339b2b..ca338ab1ca 100644 --- a/widgets/table/e-table-memory.c +++ b/widgets/table/e-table-memory.c @@ -122,8 +122,8 @@ e_table_memory_new (void) gpointer 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); + g_return_val_if_fail (row >= 0, NULL); + g_return_val_if_fail (row < etmm->priv->num_rows, NULL); return etmm->priv->data[row]; } @@ -139,8 +139,8 @@ e_table_memory_get_data (ETableMemory *etmm, gint row) void 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); + g_return_if_fail (row >= 0); + g_return_if_fail (row < etmm->priv->num_rows); etmm->priv->data[row] = data; } @@ -161,15 +161,15 @@ e_table_memory_insert (ETableMemory *etmm, gint row, gpointer data) { - g_return_if_fail(row >= -1); - g_return_if_fail(row <= etmm->priv->num_rows); + g_return_if_fail (row >= -1); + g_return_if_fail (row <= etmm->priv->num_rows); if (!etmm->priv->frozen) - e_table_model_pre_change(E_TABLE_MODEL(etmm)); + e_table_model_pre_change (E_TABLE_MODEL (etmm)); if (row == -1) row = etmm->priv->num_rows; - etmm->priv->data = g_renew(gpointer, etmm->priv->data, etmm->priv->num_rows + 1); + etmm->priv->data = g_renew (gpointer, etmm->priv->data, etmm->priv->num_rows + 1); memmove ( etmm->priv->data + row + 1, etmm->priv->data + row, @@ -177,7 +177,7 @@ e_table_memory_insert (ETableMemory *etmm, etmm->priv->data[row] = data; etmm->priv->num_rows++; if (!etmm->priv->frozen) - e_table_model_row_inserted(E_TABLE_MODEL(etmm), row); + e_table_model_row_inserted (E_TABLE_MODEL (etmm), row); } @@ -196,11 +196,11 @@ e_table_memory_remove (ETableMemory *etmm, gint row) { gpointer ret; - g_return_val_if_fail(row >= 0, NULL); - g_return_val_if_fail(row < etmm->priv->num_rows, NULL); + g_return_val_if_fail (row >= 0, NULL); + g_return_val_if_fail (row < etmm->priv->num_rows, NULL); if (!etmm->priv->frozen) - e_table_model_pre_change(E_TABLE_MODEL(etmm)); + e_table_model_pre_change (E_TABLE_MODEL (etmm)); ret = etmm->priv->data[row]; memmove ( etmm->priv->data + row, @@ -208,7 +208,7 @@ e_table_memory_remove (ETableMemory *etmm, gint row) (etmm->priv->num_rows - row - 1) * sizeof (gpointer)); etmm->priv->num_rows--; if (!etmm->priv->frozen) - e_table_model_row_deleted(E_TABLE_MODEL(etmm), row); + e_table_model_row_deleted (E_TABLE_MODEL (etmm), row); return ret; } @@ -225,12 +225,12 @@ void e_table_memory_clear (ETableMemory *etmm) { if (!etmm->priv->frozen) - e_table_model_pre_change(E_TABLE_MODEL(etmm)); - g_free(etmm->priv->data); + e_table_model_pre_change (E_TABLE_MODEL (etmm)); + g_free (etmm->priv->data); etmm->priv->data = NULL; etmm->priv->num_rows = 0; if (!etmm->priv->frozen) - e_table_model_changed(E_TABLE_MODEL(etmm)); + e_table_model_changed (E_TABLE_MODEL (etmm)); } /** @@ -243,12 +243,12 @@ e_table_memory_clear (ETableMemory *etmm) * **/ void -e_table_memory_freeze(ETableMemory *etmm) +e_table_memory_freeze (ETableMemory *etmm) { ETableMemoryPriv *priv = etmm->priv; if (priv->frozen == 0) - e_table_model_pre_change(E_TABLE_MODEL(etmm)); + e_table_model_pre_change (E_TABLE_MODEL (etmm)); priv->frozen++; } @@ -263,13 +263,13 @@ e_table_memory_freeze(ETableMemory *etmm) * **/ void -e_table_memory_thaw(ETableMemory *etmm) +e_table_memory_thaw (ETableMemory *etmm) { ETableMemoryPriv *priv = etmm->priv; if (priv->frozen > 0) priv->frozen--; if (priv->frozen == 0) { - e_table_model_changed(E_TABLE_MODEL(etmm)); + e_table_model_changed (E_TABLE_MODEL (etmm)); } } diff --git a/widgets/table/e-table-model.c b/widgets/table/e-table-model.c index 3962550dd8..a03d3f4269 100644 --- a/widgets/table/e-table-model.c +++ b/widgets/table/e-table-model.c @@ -34,7 +34,7 @@ #define d(x) -d(static gint depth = 0;) +d (static gint depth = 0;) G_DEFINE_TYPE (ETableModel, e_table_model, G_TYPE_OBJECT) @@ -50,7 +50,7 @@ enum { LAST_SIGNAL }; -static guint e_table_model_signals [LAST_SIGNAL] = { 0, }; +static guint e_table_model_signals[LAST_SIGNAL] = { 0, }; /** * e_table_model_column_count: @@ -216,7 +216,7 @@ e_table_model_get_save_id (ETableModel *e_table_model, gint row) } gboolean -e_table_model_has_change_pending(ETableModel *e_table_model) +e_table_model_has_change_pending (ETableModel *e_table_model) { g_return_val_if_fail (e_table_model != NULL, FALSE); g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), FALSE); @@ -277,7 +277,7 @@ e_table_model_class_init (ETableModelClass *klass) object_class->finalize = e_table_model_finalize; - e_table_model_signals [MODEL_NO_CHANGE] = + e_table_model_signals[MODEL_NO_CHANGE] = g_signal_new ("model_no_change", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, @@ -286,7 +286,7 @@ e_table_model_class_init (ETableModelClass *klass) g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); - e_table_model_signals [MODEL_CHANGED] = + e_table_model_signals[MODEL_CHANGED] = g_signal_new ("model_changed", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, @@ -295,7 +295,7 @@ e_table_model_class_init (ETableModelClass *klass) g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); - e_table_model_signals [MODEL_PRE_CHANGE] = + e_table_model_signals[MODEL_PRE_CHANGE] = g_signal_new ("model_pre_change", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, @@ -304,7 +304,7 @@ e_table_model_class_init (ETableModelClass *klass) g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); - e_table_model_signals [MODEL_ROW_CHANGED] = + e_table_model_signals[MODEL_ROW_CHANGED] = g_signal_new ("model_row_changed", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, @@ -313,7 +313,7 @@ e_table_model_class_init (ETableModelClass *klass) g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT); - e_table_model_signals [MODEL_CELL_CHANGED] = + e_table_model_signals[MODEL_CELL_CHANGED] = g_signal_new ("model_cell_changed", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, @@ -322,7 +322,7 @@ e_table_model_class_init (ETableModelClass *klass) e_marshal_VOID__INT_INT, G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT); - e_table_model_signals [MODEL_ROWS_INSERTED] = + e_table_model_signals[MODEL_ROWS_INSERTED] = g_signal_new ("model_rows_inserted", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, @@ -331,7 +331,7 @@ e_table_model_class_init (ETableModelClass *klass) e_marshal_VOID__INT_INT, G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT); - e_table_model_signals [MODEL_ROWS_DELETED] = + e_table_model_signals[MODEL_ROWS_DELETED] = g_signal_new ("model_rows_deleted", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, @@ -392,12 +392,12 @@ e_table_model_pre_change (ETableModel *e_table_model) if (ETM_FROZEN (e_table_model)) return; - d(print_tabs()); + d (print_tabs ()); d(g_print("Emitting pre_change on model 0x%p, a %s.\n", e_table_model, g_type_name (GTK_OBJECT(e_table_model)->klass->type))); - d(depth++); + d (depth++); g_signal_emit (G_OBJECT (e_table_model), - e_table_model_signals [MODEL_PRE_CHANGE], 0); - d(depth--); + e_table_model_signals[MODEL_PRE_CHANGE], 0); + d (depth--); } /** @@ -422,12 +422,12 @@ e_table_model_no_change (ETableModel *e_table_model) if (ETM_FROZEN (e_table_model)) return; - d(print_tabs()); + d (print_tabs ()); d(g_print("Emitting model_no_change on model 0x%p, a %s.\n", e_table_model, g_type_name (GTK_OBJECT(e_table_model)->klass->type))); - d(depth++); + d (depth++); g_signal_emit (G_OBJECT (e_table_model), - e_table_model_signals [MODEL_NO_CHANGE], 0); - d(depth--); + e_table_model_signals[MODEL_NO_CHANGE], 0); + d (depth--); } /** @@ -452,12 +452,12 @@ e_table_model_changed (ETableModel *e_table_model) if (ETM_FROZEN (e_table_model)) return; - d(print_tabs()); + d (print_tabs ()); d(g_print("Emitting model_changed on model 0x%p, a %s.\n", e_table_model, g_type_name (GTK_OBJECT(e_table_model)->klass->type))); - d(depth++); + d (depth++); g_signal_emit (G_OBJECT (e_table_model), - e_table_model_signals [MODEL_CHANGED], 0); - d(depth--); + e_table_model_signals[MODEL_CHANGED], 0); + d (depth--); } /** @@ -479,12 +479,12 @@ e_table_model_row_changed (ETableModel *e_table_model, gint row) if (ETM_FROZEN (e_table_model)) return; - d(print_tabs()); + d (print_tabs ()); d(g_print("Emitting row_changed on model 0x%p, a %s, row %d.\n", e_table_model, g_type_name (GTK_OBJECT(e_table_model)->klass->type), row)); - d(depth++); + d (depth++); g_signal_emit (G_OBJECT (e_table_model), - e_table_model_signals [MODEL_ROW_CHANGED], 0, row); - d(depth--); + e_table_model_signals[MODEL_ROW_CHANGED], 0, row); + d (depth--); } /** @@ -507,12 +507,12 @@ e_table_model_cell_changed (ETableModel *e_table_model, gint col, gint row) if (ETM_FROZEN (e_table_model)) return; - d(print_tabs()); + d (print_tabs ()); d(g_print("Emitting cell_changed on model 0x%p, a %s, row %d, col %d.\n", e_table_model, g_type_name (GTK_OBJECT(e_table_model)->klass->type), row, col)); - d(depth++); + d (depth++); g_signal_emit (G_OBJECT (e_table_model), - e_table_model_signals [MODEL_CELL_CHANGED], 0, col, row); - d(depth--); + e_table_model_signals[MODEL_CELL_CHANGED], 0, col, row); + d (depth--); } /** @@ -535,12 +535,12 @@ e_table_model_rows_inserted (ETableModel *e_table_model, gint row, gint count) if (ETM_FROZEN (e_table_model)) return; - d(print_tabs()); + d (print_tabs ()); d(g_print("Emitting row_inserted on model 0x%p, a %s, row %d.\n", e_table_model, g_type_name (GTK_OBJECT(e_table_model)->klass->type), row)); - d(depth++); + d (depth++); g_signal_emit (G_OBJECT (e_table_model), - e_table_model_signals [MODEL_ROWS_INSERTED], 0, row, count); - d(depth--); + e_table_model_signals[MODEL_ROWS_INSERTED], 0, row, count); + d (depth--); } /** @@ -555,7 +555,7 @@ e_table_model_rows_inserted (ETableModel *e_table_model, gint row, gint count) void e_table_model_row_inserted (ETableModel *e_table_model, gint row) { - e_table_model_rows_inserted(e_table_model, row, 1); + e_table_model_rows_inserted (e_table_model, row, 1); } /** @@ -578,12 +578,12 @@ e_table_model_rows_deleted (ETableModel *e_table_model, gint row, gint count) if (ETM_FROZEN (e_table_model)) return; - d(print_tabs()); + d (print_tabs ()); d(g_print("Emitting row_deleted on model 0x%p, a %s, row %d.\n", e_table_model, g_type_name (GTK_OBJECT(e_table_model)->klass->type), row)); - d(depth++); + d (depth++); g_signal_emit (G_OBJECT (e_table_model), - e_table_model_signals [MODEL_ROWS_DELETED], 0, row, count); - d(depth--); + e_table_model_signals[MODEL_ROWS_DELETED], 0, row, count); + d (depth--); } /** @@ -598,7 +598,7 @@ e_table_model_rows_deleted (ETableModel *e_table_model, gint row, gint count) void e_table_model_row_deleted (ETableModel *e_table_model, gint row) { - e_table_model_rows_deleted(e_table_model, row, 1); + e_table_model_rows_deleted (e_table_model, row, 1); } void diff --git a/widgets/table/e-table-one.c b/widgets/table/e-table-one.c index 07da209088..b58b0b8631 100644 --- a/widgets/table/e-table-one.c +++ b/widgets/table/e-table-one.c @@ -32,10 +32,10 @@ G_DEFINE_TYPE (ETableOne, e_table_one, E_TABLE_MODEL_TYPE) static gint one_column_count (ETableModel *etm) { - ETableOne *one = E_TABLE_ONE(etm); + ETableOne *one = E_TABLE_ONE (etm); if (one->source) - return e_table_model_column_count(one->source); + return e_table_model_column_count (one->source); else return 0; } @@ -49,7 +49,7 @@ one_row_count (ETableModel *etm) static gpointer one_value_at (ETableModel *etm, gint col, gint row) { - ETableOne *one = E_TABLE_ONE(etm); + ETableOne *one = E_TABLE_ONE (etm); if (one->data) return one->data[col]; @@ -60,21 +60,21 @@ one_value_at (ETableModel *etm, gint col, gint row) static void one_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) { - ETableOne *one = E_TABLE_ONE(etm); + ETableOne *one = E_TABLE_ONE (etm); if (one->data && one->source) { - e_table_model_free_value(one->source, col, one->data[col]); - one->data[col] = e_table_model_duplicate_value(one->source, col, val); + e_table_model_free_value (one->source, col, one->data[col]); + one->data[col] = e_table_model_duplicate_value (one->source, col, val); } } static gboolean one_is_cell_editable (ETableModel *etm, gint col, gint row) { - ETableOne *one = E_TABLE_ONE(etm); + ETableOne *one = E_TABLE_ONE (etm); if (one->source) - return e_table_model_is_cell_editable(one->source, col, -1); + return e_table_model_is_cell_editable (one->source, col, -1); else return FALSE; } @@ -83,10 +83,10 @@ one_is_cell_editable (ETableModel *etm, gint col, gint row) static gpointer one_duplicate_value (ETableModel *etm, gint col, gconstpointer value) { - ETableOne *one = E_TABLE_ONE(etm); + ETableOne *one = E_TABLE_ONE (etm); if (one->source) - return e_table_model_duplicate_value(one->source, col, value); + return e_table_model_duplicate_value (one->source, col, value); else return (gpointer)value; } @@ -94,16 +94,16 @@ one_duplicate_value (ETableModel *etm, gint col, gconstpointer value) static void one_free_value (ETableModel *etm, gint col, gpointer value) { - ETableOne *one = E_TABLE_ONE(etm); + ETableOne *one = E_TABLE_ONE (etm); if (one->source) - e_table_model_free_value(one->source, col, value); + e_table_model_free_value (one->source, col, value); } static gpointer one_initialize_value (ETableModel *etm, gint col) { - ETableOne *one = E_TABLE_ONE(etm); + ETableOne *one = E_TABLE_ONE (etm); if (one->source) return e_table_model_initialize_value (one->source, col); @@ -114,7 +114,7 @@ one_initialize_value (ETableModel *etm, gint col) static gboolean one_value_is_empty (ETableModel *etm, gint col, gconstpointer value) { - ETableOne *one = E_TABLE_ONE(etm); + ETableOne *one = E_TABLE_ONE (etm); if (one->source) return e_table_model_value_is_empty (one->source, col, value); @@ -125,7 +125,7 @@ one_value_is_empty (ETableModel *etm, gint col, gconstpointer value) static gchar * one_value_to_string (ETableModel *etm, gint col, gconstpointer value) { - ETableOne *one = E_TABLE_ONE(etm); + ETableOne *one = E_TABLE_ONE (etm); if (one->source) return e_table_model_value_to_string (one->source, col, value); @@ -149,10 +149,10 @@ one_dispose (GObject *object) gint col_count; if (one->source) { - col_count = e_table_model_column_count(one->source); + col_count = e_table_model_column_count (one->source); for (i = 0; i < col_count; i++) - e_table_model_free_value(one->source, i, one->data[i]); + e_table_model_free_value (one->source, i, one->data[i]); } g_free (one->data); @@ -160,7 +160,7 @@ one_dispose (GObject *object) one->data = NULL; if (one->source) - g_object_unref(one->source); + g_object_unref (one->source); one->source = NULL; G_OBJECT_CLASS (e_table_one_parent_class)->dispose (object); @@ -204,14 +204,14 @@ e_table_one_new (ETableModel *source) eto = g_object_new (E_TABLE_ONE_TYPE, NULL); eto->source = source; - col_count = e_table_model_column_count(source); - eto->data = g_new(gpointer , col_count); + col_count = e_table_model_column_count (source); + eto->data = g_new (gpointer , col_count); for (i = 0; i < col_count; i++) { - eto->data[i] = e_table_model_initialize_value(source, i); + eto->data[i] = e_table_model_initialize_value (source, i); } if (source) - g_object_ref(source); + g_object_ref (source); return (ETableModel *) eto; } @@ -222,15 +222,15 @@ e_table_one_commit (ETableOne *one) if (one->source) { gint empty = TRUE; gint col; - gint cols = e_table_model_column_count(one->source); + 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])) { + if (!e_table_model_value_is_empty (one->source, col, one->data[col])) { empty = FALSE; break; } } if (!empty) { - e_table_model_append_row(one->source, E_TABLE_MODEL(one), 0); + e_table_model_append_row (one->source, E_TABLE_MODEL (one), 0); } } } diff --git a/widgets/table/e-table-search.c b/widgets/table/e-table-search.c index c7cb5d8b57..1f2f5b1a0b 100644 --- a/widgets/table/e-table-search.c +++ b/widgets/table/e-table-search.c @@ -30,7 +30,7 @@ #define d(x) -d(static gint depth = 0) +d (static gint depth = 0) struct _ETableSearchPrivate { guint timeout_id; @@ -47,7 +47,7 @@ enum { LAST_SIGNAL }; -static guint e_table_search_signals [LAST_SIGNAL] = { 0, }; +static guint e_table_search_signals[LAST_SIGNAL] = { 0, }; static gboolean e_table_search_search (ETableSearch *e_table_search, @@ -58,7 +58,7 @@ e_table_search_search (ETableSearch *e_table_search, g_return_val_if_fail (E_IS_TABLE_SEARCH (e_table_search), FALSE); g_signal_emit (G_OBJECT (e_table_search), - e_table_search_signals [SEARCH_SEARCH], + e_table_search_signals[SEARCH_SEARCH], 0, string, flags, &ret_val); return ret_val; @@ -70,7 +70,7 @@ e_table_search_accept (ETableSearch *e_table_search) g_return_if_fail (E_IS_TABLE_SEARCH (e_table_search)); g_signal_emit (G_OBJECT (e_table_search), - e_table_search_signals [SEARCH_ACCEPT], 0); + e_table_search_signals[SEARCH_ACCEPT], 0); } static gboolean @@ -123,7 +123,7 @@ e_table_search_class_init (ETableSearchClass *klass) object_class->finalize = e_table_search_finalize; - e_table_search_signals [SEARCH_SEARCH] = + e_table_search_signals[SEARCH_SEARCH] = g_signal_new ("search", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, @@ -132,7 +132,7 @@ e_table_search_class_init (ETableSearchClass *klass) e_marshal_BOOLEAN__STRING_INT, G_TYPE_BOOLEAN, 2, G_TYPE_STRING, G_TYPE_INT); - e_table_search_signals [SEARCH_ACCEPT] = + e_table_search_signals[SEARCH_ACCEPT] = g_signal_new ("accept", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, @@ -178,7 +178,7 @@ e_table_search_input_character (ETableSearch *ets, gunichar character) g_return_if_fail (ets != NULL); g_return_if_fail (E_IS_TABLE_SEARCH (ets)); - character_utf8 [g_unichar_to_utf8 (character, character_utf8)] = 0; + character_utf8[g_unichar_to_utf8 (character, character_utf8)] = 0; temp_string = g_strdup_printf ("%s%s", ets->priv->search_string, character_utf8); if (e_table_search_search (ets, temp_string, diff --git a/widgets/table/e-table-selection-model.c b/widgets/table/e-table-selection-model.c index 3e98ddbfef..b459dd1da1 100644 --- a/widgets/table/e-table-selection-model.c +++ b/widgets/table/e-table-selection-model.c @@ -42,183 +42,183 @@ enum { }; static void -save_to_hash(gint 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); + const gchar *key = e_table_model_get_save_id (etsm->model, model_row); - g_hash_table_insert(etsm->hash, (gpointer) key, (gpointer) key); + g_hash_table_insert (etsm->hash, (gpointer) key, (gpointer) key); } static void -free_hash(ETableSelectionModel *etsm) +free_hash (ETableSelectionModel *etsm) { if (etsm->hash) { - g_hash_table_destroy(etsm->hash); + g_hash_table_destroy (etsm->hash); etsm->hash = NULL; } if (etsm->cursor_id) - g_free(etsm->cursor_id); + g_free (etsm->cursor_id); etsm->cursor_id = NULL; } static void model_pre_change (ETableModel *etm, ETableSelectionModel *etsm) { - free_hash(etsm); + free_hash (etsm); if (etsm->model && e_table_model_has_save_id (etsm->model)) { gint cursor_row; - etsm->hash = g_hash_table_new_full( + etsm->hash = g_hash_table_new_full ( g_str_hash, g_str_equal, (GDestroyNotify) g_free, (GDestroyNotify) NULL); - e_selection_model_foreach(E_SELECTION_MODEL(etsm), save_to_hash, etsm); + e_selection_model_foreach (E_SELECTION_MODEL (etsm), save_to_hash, etsm); - g_object_get(etsm, + g_object_get (etsm, "cursor_row", &cursor_row, NULL); g_free (etsm->cursor_id); if (cursor_row != -1) - etsm->cursor_id = e_table_model_get_save_id(etm, cursor_row); + etsm->cursor_id = e_table_model_get_save_id (etm, cursor_row); else etsm->cursor_id = NULL; } } static gint -model_changed_idle(ETableSelectionModel *etsm) +model_changed_idle (ETableSelectionModel *etsm) { ETableModel *etm = etsm->model; - e_selection_model_clear(E_SELECTION_MODEL(etsm)); + e_selection_model_clear (E_SELECTION_MODEL (etsm)); - if (etsm->cursor_id && etm && e_table_model_has_save_id(etm)) { - gint row_count = e_table_model_row_count(etm); + if (etsm->cursor_id && etm && e_table_model_has_save_id (etm)) { + 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)); + 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); - if (g_hash_table_lookup(etsm->hash, save_id)) - e_selection_model_change_one_row(E_SELECTION_MODEL(etsm), i, TRUE); + gchar *save_id = e_table_model_get_save_id (etm, i); + if (g_hash_table_lookup (etsm->hash, save_id)) + e_selection_model_change_one_row (E_SELECTION_MODEL (etsm), i, TRUE); - if (etsm->cursor_id && !strcmp(etsm->cursor_id, save_id)) { + if (etsm->cursor_id && !strcmp (etsm->cursor_id, save_id)) { cursor_row = i; - cursor_col = e_selection_model_cursor_col(E_SELECTION_MODEL(etsm)); + cursor_col = e_selection_model_cursor_col (E_SELECTION_MODEL (etsm)); if (cursor_col == -1) { if (etsm->eth) { cursor_col = e_table_header_prioritized_column (etsm->eth); } else cursor_col = 0; } - e_selection_model_change_cursor(E_SELECTION_MODEL(etsm), cursor_row, cursor_col); - g_free(etsm->cursor_id); + e_selection_model_change_cursor (E_SELECTION_MODEL (etsm), cursor_row, cursor_col); + g_free (etsm->cursor_id); etsm->cursor_id = NULL; } - g_free(save_id); + g_free (save_id); } - free_hash(etsm); - e_selection_model_cursor_changed (E_SELECTION_MODEL(etsm), cursor_row, cursor_col); - e_selection_model_selection_changed (E_SELECTION_MODEL(etsm)); + free_hash (etsm); + e_selection_model_cursor_changed (E_SELECTION_MODEL (etsm), cursor_row, cursor_col); + e_selection_model_selection_changed (E_SELECTION_MODEL (etsm)); } etsm->model_changed_idle_id = 0; return FALSE; } static void -model_changed(ETableModel *etm, ETableSelectionModel *etsm) +model_changed (ETableModel *etm, ETableSelectionModel *etsm) { - e_selection_model_clear(E_SELECTION_MODEL(etsm)); - if (!etsm->model_changed_idle_id && etm && e_table_model_has_save_id(etm)) { - etsm->model_changed_idle_id = g_idle_add_full(G_PRIORITY_HIGH, (GSourceFunc) model_changed_idle, etsm, NULL); + e_selection_model_clear (E_SELECTION_MODEL (etsm)); + if (!etsm->model_changed_idle_id && etm && e_table_model_has_save_id (etm)) { + etsm->model_changed_idle_id = g_idle_add_full (G_PRIORITY_HIGH, (GSourceFunc) model_changed_idle, etsm, NULL); } } static void -model_row_changed(ETableModel *etm, gint row, ETableSelectionModel *etsm) +model_row_changed (ETableModel *etm, gint row, ETableSelectionModel *etsm) { - free_hash(etsm); + free_hash (etsm); } static void -model_cell_changed(ETableModel *etm, gint col, gint row, ETableSelectionModel *etsm) +model_cell_changed (ETableModel *etm, gint col, gint row, ETableSelectionModel *etsm) { - free_hash(etsm); + free_hash (etsm); } #if 1 static void -model_rows_inserted(ETableModel *etm, gint row, gint 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); + e_selection_model_array_insert_rows (E_SELECTION_MODEL_ARRAY (etsm), row, count); + free_hash (etsm); } static void -model_rows_deleted(ETableModel *etm, gint row, gint 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); + e_selection_model_array_delete_rows (E_SELECTION_MODEL_ARRAY (etsm), row, count); + free_hash (etsm); } #else static void -model_rows_inserted(ETableModel *etm, gint row, gint count, ETableSelectionModel *etsm) +model_rows_inserted (ETableModel *etm, gint row, gint count, ETableSelectionModel *etsm) { - model_changed(etm, etsm); + model_changed (etm, etsm); } static void -model_rows_deleted(ETableModel *etm, gint row, gint count, ETableSelectionModel *etsm) +model_rows_deleted (ETableModel *etm, gint row, gint count, ETableSelectionModel *etsm) { - model_changed(etm, etsm); + model_changed (etm, etsm); } #endif inline static void -add_model(ETableSelectionModel *etsm, ETableModel *model) +add_model (ETableSelectionModel *etsm, ETableModel *model) { etsm->model = model; if (model) { - g_object_ref(model); + g_object_ref (model); etsm->model_pre_change_id = g_signal_connect(G_OBJECT(model), "model_pre_change", - G_CALLBACK(model_pre_change), etsm); + G_CALLBACK (model_pre_change), etsm); etsm->model_changed_id = g_signal_connect(G_OBJECT(model), "model_changed", - G_CALLBACK(model_changed), etsm); + G_CALLBACK (model_changed), etsm); etsm->model_row_changed_id = g_signal_connect(G_OBJECT(model), "model_row_changed", - G_CALLBACK(model_row_changed), etsm); + G_CALLBACK (model_row_changed), etsm); etsm->model_cell_changed_id = g_signal_connect(G_OBJECT(model), "model_cell_changed", - G_CALLBACK(model_cell_changed), etsm); + G_CALLBACK (model_cell_changed), etsm); etsm->model_rows_inserted_id = g_signal_connect(G_OBJECT(model), "model_rows_inserted", - G_CALLBACK(model_rows_inserted), etsm); + G_CALLBACK (model_rows_inserted), etsm); etsm->model_rows_deleted_id = g_signal_connect(G_OBJECT(model), "model_rows_deleted", - G_CALLBACK(model_rows_deleted), etsm); + G_CALLBACK (model_rows_deleted), etsm); } - e_selection_model_array_confirm_row_count(E_SELECTION_MODEL_ARRAY(etsm)); + e_selection_model_array_confirm_row_count (E_SELECTION_MODEL_ARRAY (etsm)); } inline static void -drop_model(ETableSelectionModel *etsm) +drop_model (ETableSelectionModel *etsm) { if (etsm->model) { - g_signal_handler_disconnect(G_OBJECT(etsm->model), + g_signal_handler_disconnect (G_OBJECT (etsm->model), etsm->model_pre_change_id); - g_signal_handler_disconnect(G_OBJECT(etsm->model), + g_signal_handler_disconnect (G_OBJECT (etsm->model), etsm->model_changed_id); - g_signal_handler_disconnect(G_OBJECT(etsm->model), + g_signal_handler_disconnect (G_OBJECT (etsm->model), etsm->model_row_changed_id); - g_signal_handler_disconnect(G_OBJECT(etsm->model), + g_signal_handler_disconnect (G_OBJECT (etsm->model), etsm->model_cell_changed_id); - g_signal_handler_disconnect(G_OBJECT(etsm->model), + g_signal_handler_disconnect (G_OBJECT (etsm->model), etsm->model_rows_inserted_id); - g_signal_handler_disconnect(G_OBJECT(etsm->model), + g_signal_handler_disconnect (G_OBJECT (etsm->model), etsm->model_rows_deleted_id); - g_object_unref(etsm->model); + g_object_unref (etsm->model); } etsm->model = NULL; } @@ -234,11 +234,11 @@ etsm_dispose (GObject *object) g_source_remove (etsm->model_changed_idle_id); etsm->model_changed_idle_id = 0; - drop_model(etsm); - free_hash(etsm); + drop_model (etsm); + free_hash (etsm); - if (G_OBJECT_CLASS(e_table_selection_model_parent_class)->dispose) - G_OBJECT_CLASS(e_table_selection_model_parent_class)->dispose (object); + if (G_OBJECT_CLASS (e_table_selection_model_parent_class)->dispose) + G_OBJECT_CLASS (e_table_selection_model_parent_class)->dispose (object); } static void @@ -263,8 +263,8 @@ etsm_set_property (GObject *object, guint prop_id, const GValue *value, GParamSp switch (prop_id) { case PROP_MODEL: - drop_model(etsm); - add_model(etsm, g_value_get_object (value) ? E_TABLE_MODEL(g_value_get_object (value)) : NULL); + drop_model (etsm); + add_model (etsm, g_value_get_object (value) ? E_TABLE_MODEL (g_value_get_object (value)) : NULL); break; case PROP_HEADER: etsm->eth = E_TABLE_HEADER (g_value_get_object (value)); @@ -288,8 +288,8 @@ e_table_selection_model_class_init (ETableSelectionModelClass *klass) GObjectClass *object_class; ESelectionModelArrayClass *esma_class; - object_class = G_OBJECT_CLASS(klass); - esma_class = E_SELECTION_MODEL_ARRAY_CLASS(klass); + object_class = G_OBJECT_CLASS (klass); + esma_class = E_SELECTION_MODEL_ARRAY_CLASS (klass); object_class->dispose = etsm_dispose; object_class->get_property = etsm_get_property; @@ -328,7 +328,7 @@ e_table_selection_model_new (void) static gint etsm_get_row_count (ESelectionModelArray *esma) { - ETableSelectionModel *etsm = E_TABLE_SELECTION_MODEL(esma); + ETableSelectionModel *etsm = E_TABLE_SELECTION_MODEL (esma); if (etsm->model) return e_table_model_row_count (etsm->model); diff --git a/widgets/table/e-table-sort-info.c b/widgets/table/e-table-sort-info.c index e4a3874bf0..f7a6d89ad5 100644 --- a/widgets/table/e-table-sort-info.c +++ b/widgets/table/e-table-sort-info.c @@ -39,7 +39,7 @@ enum { LAST_SIGNAL }; -static guint e_table_sort_info_signals [LAST_SIGNAL] = { 0, }; +static guint e_table_sort_info_signals[LAST_SIGNAL] = { 0, }; static void etsi_finalize (GObject *object) @@ -47,11 +47,11 @@ etsi_finalize (GObject *object) ETableSortInfo *etsi = E_TABLE_SORT_INFO (object); if (etsi->groupings) - g_free(etsi->groupings); + g_free (etsi->groupings); etsi->groupings = NULL; if (etsi->sortings) - g_free(etsi->sortings); + g_free (etsi->sortings); etsi->sortings = NULL; G_OBJECT_CLASS (e_table_sort_info_parent_class)->finalize (object); @@ -79,7 +79,7 @@ e_table_sort_info_class_init (ETableSortInfoClass *klass) object_class->finalize = etsi_finalize; - e_table_sort_info_signals [SORT_INFO_CHANGED] = + e_table_sort_info_signals[SORT_INFO_CHANGED] = g_signal_new ("sort_info_changed", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, @@ -88,7 +88,7 @@ e_table_sort_info_class_init (ETableSortInfoClass *klass) g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); - e_table_sort_info_signals [GROUP_INFO_CHANGED] = + e_table_sort_info_signals[GROUP_INFO_CHANGED] = g_signal_new ("group_info_changed", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, @@ -110,7 +110,7 @@ e_table_sort_info_sort_info_changed (ETableSortInfo *info) if (info->frozen) { info->sort_info_changed = 1; } else { - g_signal_emit (G_OBJECT (info), e_table_sort_info_signals [SORT_INFO_CHANGED], 0); + g_signal_emit (G_OBJECT (info), e_table_sort_info_signals[SORT_INFO_CHANGED], 0); } } @@ -123,7 +123,7 @@ e_table_sort_info_group_info_changed (ETableSortInfo *info) if (info->frozen) { info->group_info_changed = 1; } else { - g_signal_emit (G_OBJECT (info), e_table_sort_info_signals [GROUP_INFO_CHANGED], 0); + g_signal_emit (G_OBJECT (info), e_table_sort_info_signals[GROUP_INFO_CHANGED], 0); } } @@ -164,11 +164,11 @@ e_table_sort_info_thaw (ETableSortInfo *info) if (info->sort_info_changed) { info->sort_info_changed = 0; - e_table_sort_info_sort_info_changed(info); + e_table_sort_info_sort_info_changed (info); } if (info->group_info_changed) { info->group_info_changed = 0; - e_table_sort_info_group_info_changed(info); + e_table_sort_info_group_info_changed (info); } } @@ -194,7 +194,7 @@ e_table_sort_info_grouping_real_truncate (ETableSortInfo *info, gint length) info->group_count = length; } if (length > info->group_count) { - info->groupings = g_realloc(info->groupings, length * sizeof(ETableSortColumn)); + info->groupings = g_realloc (info->groupings, length * sizeof (ETableSortColumn)); info->group_count = length; } } @@ -210,8 +210,8 @@ e_table_sort_info_grouping_real_truncate (ETableSortInfo *info, gint length) void 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); + e_table_sort_info_grouping_real_truncate (info, length); + e_table_sort_info_group_info_changed (info); } /** @@ -245,10 +245,10 @@ void 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); + e_table_sort_info_grouping_real_truncate (info, n + 1); } info->groupings[n] = column; - e_table_sort_info_group_info_changed(info); + e_table_sort_info_group_info_changed (info); } /** @@ -270,7 +270,7 @@ e_table_sort_info_sorting_real_truncate (ETableSortInfo *info, gint length) info->sort_count = length; } if (length > info->sort_count) { - info->sortings = g_realloc(info->sortings, length * sizeof(ETableSortColumn)); + info->sortings = g_realloc (info->sortings, length * sizeof (ETableSortColumn)); info->sort_count = length; } } @@ -287,7 +287,7 @@ void 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); + e_table_sort_info_sort_info_changed (info); } /** @@ -321,10 +321,10 @@ void 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); + e_table_sort_info_sorting_real_truncate (info, n + 1); } info->sortings[n] = column; - e_table_sort_info_sort_info_changed(info); + e_table_sort_info_sort_info_changed (info); } /** @@ -366,14 +366,14 @@ e_table_sort_info_load_from_node (ETableSortInfo *info, ETableSortColumn column; 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); + e_table_sort_info_grouping_set_nth (info, i++, column); } i = 0; for (; grouping && !strcmp ((gchar *)grouping->name, "leaf"); grouping = grouping->xmlChildrenNode) { ETableSortColumn column; 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); + e_table_sort_info_sorting_set_nth (info, i++, column); } } else { gint gcnt = 0; @@ -387,15 +387,15 @@ e_table_sort_info_load_from_node (ETableSortInfo *info, 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); + e_table_sort_info_grouping_set_nth (info, gcnt++, column); } 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); + e_table_sort_info_sorting_set_nth (info, scnt++, column); } } } - g_signal_emit (G_OBJECT (info), e_table_sort_info_signals [SORT_INFO_CHANGED], 0); + g_signal_emit (G_OBJECT (info), e_table_sort_info_signals[SORT_INFO_CHANGED], 0); } /** @@ -420,7 +420,7 @@ e_table_sort_info_save_to_node (ETableSortInfo *info, 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); + ETableSortColumn column = e_table_sort_info_grouping_get_nth (info, i); xmlNode *new_node = xmlNewChild(grouping, NULL, (const guchar *)"group", NULL); e_xml_set_integer_prop_by_name (new_node, (const guchar *)"column", column.column); @@ -428,7 +428,7 @@ e_table_sort_info_save_to_node (ETableSortInfo *info, } for (i = 0; i < sort_count; i++) { - ETableSortColumn column = e_table_sort_info_sorting_get_nth(info, i); + ETableSortColumn column = e_table_sort_info_sorting_get_nth (info, i); xmlNode *new_node = xmlNewChild(grouping, NULL, (const guchar *)"leaf", NULL); e_xml_set_integer_prop_by_name (new_node, (const guchar *)"column", column.column); @@ -443,15 +443,15 @@ e_table_sort_info_duplicate (ETableSortInfo *info) { ETableSortInfo *new_info; - new_info = e_table_sort_info_new(); + new_info = e_table_sort_info_new (); new_info->group_count = info->group_count; - new_info->groupings = g_new(ETableSortColumn, new_info->group_count); - memmove(new_info->groupings, info->groupings, sizeof (ETableSortColumn) * new_info->group_count); + new_info->groupings = g_new (ETableSortColumn, new_info->group_count); + memmove (new_info->groupings, info->groupings, sizeof (ETableSortColumn) * new_info->group_count); new_info->sort_count = info->sort_count; - new_info->sortings = g_new(ETableSortColumn, new_info->sort_count); - memmove(new_info->sortings, info->sortings, sizeof (ETableSortColumn) * new_info->sort_count); + new_info->sortings = g_new (ETableSortColumn, new_info->sort_count); + memmove (new_info->sortings, info->sortings, sizeof (ETableSortColumn) * new_info->sort_count); new_info->can_group = info->can_group; diff --git a/widgets/table/e-table-sorted-variable.c b/widgets/table/e-table-sorted-variable.c index f4e35d1fd8..b9185994c1 100644 --- a/widgets/table/e-table-sorted-variable.c +++ b/widgets/table/e-table-sorted-variable.c @@ -57,20 +57,20 @@ etsv_dispose (GObject *object) etsv->sort_info_changed_id = 0; if (etsv->sort_idle_id) { - g_source_remove(etsv->sort_idle_id); + g_source_remove (etsv->sort_idle_id); etsv->sort_idle_id = 0; } if (etsv->insert_idle_id) { - g_source_remove(etsv->insert_idle_id); + g_source_remove (etsv->insert_idle_id); etsv->insert_idle_id = 0; } if (etsv->sort_info) - g_object_unref(etsv->sort_info); + g_object_unref (etsv->sort_info); etsv->sort_info = NULL; if (etsv->full_header) - g_object_unref(etsv->full_header); + g_object_unref (etsv->full_header); etsv->full_header = NULL; G_OBJECT_CLASS (etsv_parent_class)->dispose (object); @@ -79,7 +79,7 @@ etsv_dispose (GObject *object) static void etsv_class_init (ETableSortedVariableClass *klass) { - ETableSubsetVariableClass *etssv_class = E_TABLE_SUBSET_VARIABLE_CLASS(klass); + ETableSubsetVariableClass *etssv_class = E_TABLE_SUBSET_VARIABLE_CLASS (klass); GObjectClass *object_class = G_OBJECT_CLASS (klass); object_class->dispose = etsv_dispose; @@ -101,18 +101,18 @@ etsv_init (ETableSortedVariable *etsv) } static gboolean -etsv_sort_idle(ETableSortedVariable *etsv) +etsv_sort_idle (ETableSortedVariable *etsv) { - g_object_ref(etsv); - etsv_sort(etsv); + g_object_ref (etsv); + etsv_sort (etsv); etsv->sort_idle_id = 0; etsv->insert_count = 0; - g_object_unref(etsv); + g_object_unref (etsv); return FALSE; } static gboolean -etsv_insert_idle(ETableSortedVariable *etsv) +etsv_insert_idle (ETableSortedVariable *etsv) { etsv->insert_count = 0; etsv->insert_idle_id = 0; @@ -123,8 +123,8 @@ static void etsv_add (ETableSubsetVariable *etssv, gint row) { - ETableModel *etm = E_TABLE_MODEL(etssv); - ETableSubset *etss = E_TABLE_SUBSET(etssv); + ETableModel *etm = E_TABLE_MODEL (etssv); + ETableSubset *etss = E_TABLE_SUBSET (etssv); ETableSortedVariable *etsv = E_TABLE_SORTED_VARIABLE (etssv); gint i; @@ -132,7 +132,7 @@ etsv_add (ETableSubsetVariable *etssv, if (etss->n_map + 1 > etssv->n_vals_allocated) { etssv->n_vals_allocated += INCREMENT_AMOUNT; - etss->map_table = g_realloc (etss->map_table, (etssv->n_vals_allocated) * sizeof(gint)); + etss->map_table = g_realloc (etss->map_table, (etssv->n_vals_allocated) * sizeof (gint)); } i = etss->n_map; if (etsv->sort_idle_id == 0) { @@ -141,14 +141,14 @@ etsv_add (ETableSubsetVariable *etssv, etsv->insert_count++; if (etsv->insert_count > ETSV_INSERT_MAX) { /* schedule a sort, and append instead */ - etsv->sort_idle_id = g_idle_add_full(50, (GSourceFunc) etsv_sort_idle, etsv, NULL); + etsv->sort_idle_id = g_idle_add_full (50, (GSourceFunc) etsv_sort_idle, etsv, NULL); } else { /* make sure we have an idle handler to reset the count every now and then */ if (etsv->insert_idle_id == 0) { - etsv->insert_idle_id = g_idle_add_full(40, (GSourceFunc) etsv_insert_idle, etsv, NULL); + etsv->insert_idle_id = g_idle_add_full (40, (GSourceFunc) etsv_insert_idle, etsv, NULL); } - i = e_table_sorting_utils_insert(etss->source, etsv->sort_info, etsv->full_header, etss->map_table, etss->n_map, row); - memmove(etss->map_table + i + 1, etss->map_table + i, (etss->n_map - i) * sizeof(gint)); + i = e_table_sorting_utils_insert (etss->source, etsv->sort_info, etsv->full_header, etss->map_table, etss->n_map, row); + memmove (etss->map_table + i + 1, etss->map_table + i, (etss->n_map - i) * sizeof (gint)); } } etss->map_table[i] = row; @@ -160,25 +160,25 @@ etsv_add (ETableSubsetVariable *etssv, static void etsv_add_all (ETableSubsetVariable *etssv) { - ETableModel *etm = E_TABLE_MODEL(etssv); - ETableSubset *etss = E_TABLE_SUBSET(etssv); + ETableModel *etm = E_TABLE_MODEL (etssv); + ETableSubset *etss = E_TABLE_SUBSET (etssv); ETableSortedVariable *etsv = E_TABLE_SORTED_VARIABLE (etssv); gint rows; gint i; - e_table_model_pre_change(etm); + e_table_model_pre_change (etm); - rows = e_table_model_row_count(etss->source); + rows = e_table_model_row_count (etss->source); if (etss->n_map + rows > etssv->n_vals_allocated) { - etssv->n_vals_allocated += MAX(INCREMENT_AMOUNT, rows); - etss->map_table = g_realloc (etss->map_table, etssv->n_vals_allocated * sizeof(gint)); + etssv->n_vals_allocated += MAX (INCREMENT_AMOUNT, rows); + etss->map_table = g_realloc (etss->map_table, etssv->n_vals_allocated * sizeof (gint)); } for (i = 0; i < rows; i++) etss->map_table[etss->n_map++] = i; if (etsv->sort_idle_id == 0) { - etsv->sort_idle_id = g_idle_add_full(50, (GSourceFunc) etsv_sort_idle, etsv, NULL); + etsv->sort_idle_id = g_idle_add_full (50, (GSourceFunc) etsv_sort_idle, etsv, NULL); } e_table_model_changed (etm); @@ -196,35 +196,35 @@ e_table_sorted_variable_new (ETableModel *source, ETableHeader *full_header, ETa } etsv->sort_info = sort_info; - g_object_ref(etsv->sort_info); + g_object_ref (etsv->sort_info); etsv->full_header = full_header; - g_object_ref(etsv->full_header); + g_object_ref (etsv->full_header); etsv->sort_info_changed_id = g_signal_connect (G_OBJECT (sort_info), "sort_info_changed", G_CALLBACK (etsv_sort_info_changed), etsv); - return E_TABLE_MODEL(etsv); + return E_TABLE_MODEL (etsv); } static void etsv_sort_info_changed (ETableSortInfo *info, ETableSortedVariable *etsv) { - etsv_sort(etsv); + etsv_sort (etsv); } static void -etsv_sort(ETableSortedVariable *etsv) +etsv_sort (ETableSortedVariable *etsv) { - ETableSubset *etss = E_TABLE_SUBSET(etsv); + ETableSubset *etss = E_TABLE_SUBSET (etsv); static gint reentering = 0; if (reentering) return; reentering = 1; - e_table_model_pre_change(E_TABLE_MODEL(etsv)); + e_table_model_pre_change (E_TABLE_MODEL (etsv)); - e_table_sorting_utils_sort(etss->source, etsv->sort_info, etsv->full_header, etss->map_table, etss->n_map); + e_table_sorting_utils_sort (etss->source, etsv->sort_info, etsv->full_header, etss->map_table, etss->n_map); - e_table_model_changed (E_TABLE_MODEL(etsv)); + e_table_model_changed (E_TABLE_MODEL (etsv)); reentering = 0; } diff --git a/widgets/table/e-table-sorted.c b/widgets/table/e-table-sorted.c index 9e4f1c4046..c1ff7740d5 100644 --- a/widgets/table/e-table-sorted.c +++ b/widgets/table/e-table-sorted.c @@ -55,22 +55,22 @@ ets_dispose (GObject *object) ETableSorted *ets = E_TABLE_SORTED (object); if (ets->sort_idle_id) - g_source_remove(ets->sort_idle_id); + g_source_remove (ets->sort_idle_id); ets->sort_idle_id = 0; if (ets->insert_idle_id) - g_source_remove(ets->insert_idle_id); + g_source_remove (ets->insert_idle_id); ets->insert_idle_id = 0; if (ets->sort_info) { g_signal_handler_disconnect (G_OBJECT (ets->sort_info), ets->sort_info_changed_id); - g_object_unref(ets->sort_info); + g_object_unref (ets->sort_info); ets->sort_info = NULL; } if (ets->full_header) - g_object_unref(ets->full_header); + g_object_unref (ets->full_header); ets->full_header = NULL; G_OBJECT_CLASS (ets_parent_class)->dispose (object); @@ -104,18 +104,18 @@ ets_init (ETableSorted *ets) } static gboolean -ets_sort_idle(ETableSorted *ets) +ets_sort_idle (ETableSorted *ets) { - g_object_ref(ets); - ets_sort(ets); + g_object_ref (ets); + ets_sort (ets); ets->sort_idle_id = 0; ets->insert_count = 0; - g_object_unref(ets); + g_object_unref (ets); return FALSE; } static gboolean -ets_insert_idle(ETableSorted *ets) +ets_insert_idle (ETableSorted *ets) { ets->insert_count = 0; ets->insert_idle_id = 0; @@ -137,22 +137,22 @@ e_table_sorted_new (ETableModel *source, ETableHeader *full_header, ETableSortIn } ets->sort_info = sort_info; - g_object_ref(ets->sort_info); + g_object_ref (ets->sort_info); ets->full_header = full_header; - g_object_ref(ets->full_header); + g_object_ref (ets->full_header); - ets_proxy_model_changed(etss, source); + ets_proxy_model_changed (etss, source); ets->sort_info_changed_id = g_signal_connect (G_OBJECT (sort_info), "sort_info_changed", G_CALLBACK (ets_sort_info_changed), ets); - return E_TABLE_MODEL(ets); + return E_TABLE_MODEL (ets); } static void ets_sort_info_changed (ETableSortInfo *info, ETableSorted *ets) { - ets_sort(ets); + ets_sort (ets); } static void @@ -160,27 +160,27 @@ ets_proxy_model_changed (ETableSubset *subset, ETableModel *source) { gint rows, i; - rows = e_table_model_row_count(source); + rows = e_table_model_row_count (source); - g_free(subset->map_table); + g_free (subset->map_table); subset->n_map = rows; - subset->map_table = g_new(int, rows); + subset->map_table = g_new (int, rows); for (i = 0; i < rows; i++) { subset->map_table[i] = i; } - 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); + 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); - e_table_model_changed(E_TABLE_MODEL(subset)); + e_table_model_changed (E_TABLE_MODEL (subset)); } static void 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); + 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); if (E_TABLE_SUBSET_CLASS (ets_parent_class)->proxy_model_row_changed) (E_TABLE_SUBSET_CLASS (ets_parent_class)->proxy_model_row_changed) (subset, source, row); @@ -189,9 +189,9 @@ ets_proxy_model_row_changed (ETableSubset *subset, ETableModel *source, gint row static void 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)) - ets_proxy_model_row_changed(subset, source, row); + ETableSorted *ets = E_TABLE_SORTED (subset); + if (e_table_sorting_utils_affects_sort (ets->sort_info, ets->full_header, col)) + ets_proxy_model_row_changed (subset, source, row); else if (E_TABLE_SUBSET_CLASS (ets_parent_class)->proxy_model_cell_changed) (E_TABLE_SUBSET_CLASS (ets_parent_class)->proxy_model_cell_changed) (subset, source, col, row); } @@ -199,8 +199,8 @@ ets_proxy_model_cell_changed (ETableSubset *subset, ETableModel *source, gint co static void 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); + ETableModel *etm = E_TABLE_MODEL (etss); + ETableSorted *ets = E_TABLE_SORTED (etss); gint i; gboolean full_change = FALSE; @@ -218,7 +218,7 @@ ets_proxy_model_rows_inserted (ETableSubset *etss, ETableModel *source, gint row } } - etss->map_table = g_realloc (etss->map_table, (etss->n_map + count) * sizeof(gint)); + etss->map_table = g_realloc (etss->map_table, (etss->n_map + count) * sizeof (gint)); for (; count > 0; count--) { if (!full_change) @@ -230,14 +230,14 @@ ets_proxy_model_rows_inserted (ETableSubset *etss, ETableModel *source, gint row ets->insert_count++; if (ets->insert_count > ETS_INSERT_MAX) { /* schedule a sort, and append instead */ - ets->sort_idle_id = g_idle_add_full(50, (GSourceFunc) ets_sort_idle, ets, NULL); + ets->sort_idle_id = g_idle_add_full (50, (GSourceFunc) ets_sort_idle, ets, NULL); } else { /* make sure we have an idle handler to reset the count every now and then */ if (ets->insert_idle_id == 0) { - ets->insert_idle_id = g_idle_add_full(40, (GSourceFunc) ets_insert_idle, ets, NULL); + ets->insert_idle_id = g_idle_add_full (40, (GSourceFunc) ets_insert_idle, ets, NULL); } - i = e_table_sorting_utils_insert(etss->source, ets->sort_info, ets->full_header, etss->map_table, etss->n_map, row); - memmove(etss->map_table + i + 1, etss->map_table + i, (etss->n_map - i) * sizeof(gint)); + i = e_table_sorting_utils_insert (etss->source, ets->sort_info, ets->full_header, etss->map_table, etss->n_map, row); + memmove (etss->map_table + i + 1, etss->map_table + i, (etss->n_map - i) * sizeof (gint)); } } etss->map_table[i] = row; @@ -253,13 +253,13 @@ ets_proxy_model_rows_inserted (ETableSubset *etss, ETableModel *source, gint row e_table_model_changed (etm); else e_table_model_no_change (etm); - d(e_table_subset_print_debugging(etss)); + d (e_table_subset_print_debugging (etss)); } static void ets_proxy_model_rows_deleted (ETableSubset *etss, ETableModel *source, gint row, gint count) { - ETableModel *etm = E_TABLE_MODEL(etss); + ETableModel *etm = E_TABLE_MODEL (etss); gint i; gboolean shift; gint j; @@ -271,7 +271,7 @@ ets_proxy_model_rows_deleted (ETableSubset *etss, ETableModel *source, gint row, if (etss->map_table[i] == row + j) { if (shift) e_table_model_pre_change (etm); - memmove (etss->map_table + i, etss->map_table + i + 1, (etss->n_map - i - 1) * sizeof(gint)); + memmove (etss->map_table + i, etss->map_table + i + 1, (etss->n_map - i - 1) * sizeof (gint)); etss->n_map--; if (shift) e_table_model_row_deleted (etm, i); @@ -290,22 +290,22 @@ ets_proxy_model_rows_deleted (ETableSubset *etss, ETableModel *source, gint row, } d(g_print("deleted row %d count %d", row, count)); - d(e_table_subset_print_debugging(etss)); + d (e_table_subset_print_debugging (etss)); } static void -ets_sort(ETableSorted *ets) +ets_sort (ETableSorted *ets) { - ETableSubset *etss = E_TABLE_SUBSET(ets); + ETableSubset *etss = E_TABLE_SUBSET (ets); static gint reentering = 0; if (reentering) return; reentering = 1; - e_table_model_pre_change(E_TABLE_MODEL(ets)); + e_table_model_pre_change (E_TABLE_MODEL (ets)); - e_table_sorting_utils_sort(etss->source, ets->sort_info, ets->full_header, etss->map_table, etss->n_map); + e_table_sorting_utils_sort (etss->source, ets->sort_info, ets->full_header, etss->map_table, etss->n_map); - e_table_model_changed (E_TABLE_MODEL(ets)); + e_table_model_changed (E_TABLE_MODEL (ets)); reentering = 0; } diff --git a/widgets/table/e-table-sorter.c b/widgets/table/e-table-sorter.c index 805aed5ca1..2a52fbb8d5 100644 --- a/widgets/table/e-table-sorter.c +++ b/widgets/table/e-table-sorter.c @@ -97,16 +97,16 @@ ets_dispose (GObject *object) ets->sort_info_changed_id = 0; ets->group_info_changed_id = 0; - g_object_unref(ets->sort_info); + g_object_unref (ets->sort_info); ets->sort_info = NULL; } if (ets->full_header) - g_object_unref(ets->full_header); + g_object_unref (ets->full_header); ets->full_header = NULL; if (ets->source) - g_object_unref(ets->source); + g_object_unref (ets->source); ets->source = NULL; G_OBJECT_CLASS (ets_parent_class)->dispose (object); @@ -121,14 +121,14 @@ ets_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpe case PROP_SORT_INFO: if (ets->sort_info) { if (ets->sort_info_changed_id) - g_signal_handler_disconnect(ets->sort_info, ets->sort_info_changed_id); + g_signal_handler_disconnect (ets->sort_info, ets->sort_info_changed_id); if (ets->group_info_changed_id) - g_signal_handler_disconnect(ets->sort_info, ets->group_info_changed_id); - g_object_unref(ets->sort_info); + g_signal_handler_disconnect (ets->sort_info, ets->group_info_changed_id); + g_object_unref (ets->sort_info); } - ets->sort_info = E_TABLE_SORT_INFO(g_value_get_object (value)); - g_object_ref(ets->sort_info); + ets->sort_info = E_TABLE_SORT_INFO (g_value_get_object (value)); + g_object_ref (ets->sort_info); ets->sort_info_changed_id = g_signal_connect (ets->sort_info, "sort_info_changed", G_CALLBACK (ets_sort_info_changed), ets); ets->group_info_changed_id = g_signal_connect (ets->sort_info, "group_info_changed", @@ -155,8 +155,8 @@ ets_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *psp static void ets_class_init (ETableSorterClass *klass) { - GObjectClass *object_class = G_OBJECT_CLASS(klass); - ESorterClass *sorter_class = E_SORTER_CLASS(klass); + GObjectClass *object_class = G_OBJECT_CLASS (klass); + ESorterClass *sorter_class = E_SORTER_CLASS (klass); object_class->dispose = ets_dispose; object_class->set_property = ets_set_property; @@ -200,11 +200,11 @@ e_table_sorter_new (ETableModel *source, ETableHeader *full_header, ETableSortIn ETableSorter *ets = g_object_new (E_TABLE_SORTER_TYPE, NULL); ets->sort_info = sort_info; - g_object_ref(ets->sort_info); + g_object_ref (ets->sort_info); ets->full_header = full_header; - g_object_ref(ets->full_header); + g_object_ref (ets->full_header); ets->source = source; - g_object_ref(ets->source); + g_object_ref (ets->source); ets->table_model_changed_id = g_signal_connect (source, "model_changed", G_CALLBACK (ets_model_changed), ets); @@ -227,38 +227,38 @@ e_table_sorter_new (ETableModel *source, ETableHeader *full_header, ETableSortIn static void ets_model_changed (ETableModel *etm, ETableSorter *ets) { - ets_clean(ets); + ets_clean (ets); } static void ets_model_row_changed (ETableModel *etm, gint row, ETableSorter *ets) { - ets_clean(ets); + ets_clean (ets); } static void ets_model_cell_changed (ETableModel *etm, gint col, gint row, ETableSorter *ets) { - ets_clean(ets); + ets_clean (ets); } static void ets_model_rows_inserted (ETableModel *etm, gint row, gint count, ETableSorter *ets) { - ets_clean(ets); + ets_clean (ets); } static void ets_model_rows_deleted (ETableModel *etm, gint row, gint count, ETableSorter *ets) { - ets_clean(ets); + ets_clean (ets); } static void ets_sort_info_changed (ETableSortInfo *info, ETableSorter *ets) { d(g_print ("sort info changed\n")); - ets_clean(ets); + ets_clean (ets); } struct qsort_data { @@ -273,7 +273,7 @@ struct qsort_data { /* FIXME: Make it not cache the second and later columns (as if anyone cares.) */ static gint -qsort_callback(gconstpointer data1, gconstpointer data2, gpointer user_data) +qsort_callback (gconstpointer data1, gconstpointer data2, gpointer user_data) { struct qsort_data *qd = (struct qsort_data *) user_data; gint row1 = *(gint *)data1; @@ -300,19 +300,19 @@ qsort_callback(gconstpointer data1, gconstpointer data2, gpointer user_data) } static void -ets_clean(ETableSorter *ets) +ets_clean (ETableSorter *ets) { - g_free(ets->sorted); + g_free (ets->sorted); ets->sorted = NULL; - g_free(ets->backsorted); + g_free (ets->backsorted); ets->backsorted = NULL; ets->needs_sorting = -1; } static void -ets_sort(ETableSorter *ets) +ets_sort (ETableSorter *ets) { gint rows; gint i; @@ -324,11 +324,11 @@ ets_sort(ETableSorter *ets) if (ets->sorted) return; - rows = e_table_model_row_count(ets->source); - group_cols = e_table_sort_info_grouping_get_count(ets->sort_info); - cols = e_table_sort_info_sorting_get_count(ets->sort_info) + group_cols; + rows = e_table_model_row_count (ets->source); + group_cols = e_table_sort_info_grouping_get_count (ets->sort_info); + cols = e_table_sort_info_sorting_get_count (ets->sort_info) + group_cols; - ets->sorted = g_new(int, rows); + ets->sorted = g_new (int, rows); for (i = 0; i < rows; i++) ets->sorted[i] = i; @@ -345,11 +345,11 @@ ets_sort(ETableSorter *ets) ETableCol *col; if (j < group_cols) - column = e_table_sort_info_grouping_get_nth(ets->sort_info, j); + column = e_table_sort_info_grouping_get_nth (ets->sort_info, j); else - column = e_table_sort_info_sorting_get_nth(ets->sort_info, j - group_cols); + column = e_table_sort_info_sorting_get_nth (ets->sort_info, j - group_cols); - col = e_table_header_get_column_by_col_idx(ets->full_header, column.column); + col = e_table_header_get_column_by_col_idx (ets->full_header, column.column); if (col == NULL) col = e_table_header_get_column (ets->full_header, e_table_header_count (ets->full_header) - 1); @@ -361,7 +361,7 @@ ets_sort(ETableSorter *ets) qd.ascending[j] = column.ascending; } - g_qsort_with_data (ets->sorted, rows, sizeof(gint), qsort_callback, &qd); + g_qsort_with_data (ets->sorted, rows, sizeof (gint), qsort_callback, &qd); g_free (qd.vals); g_free (qd.ascending); @@ -370,17 +370,17 @@ ets_sort(ETableSorter *ets) } static void -ets_backsort(ETableSorter *ets) +ets_backsort (ETableSorter *ets) { gint i, rows; if (ets->backsorted) return; - ets_sort(ets); + ets_sort (ets); - rows = e_table_model_row_count(ets->source); - ets->backsorted = g_new0(int, rows); + rows = e_table_model_row_count (ets->source); + ets->backsorted = g_new0 (int, rows); for (i = 0; i < rows; i++) { ets->backsorted[ets->sorted[i]] = i; @@ -390,14 +390,14 @@ ets_backsort(ETableSorter *ets) static gint ets_model_to_sorted (ESorter *es, gint row) { - ETableSorter *ets = E_TABLE_SORTER(es); - gint rows = e_table_model_row_count(ets->source); + ETableSorter *ets = E_TABLE_SORTER (es); + 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); + g_return_val_if_fail (row >= 0, -1); + g_return_val_if_fail (row < rows, -1); - if (ets_needs_sorting(es)) - ets_backsort(ets); + if (ets_needs_sorting (es)) + ets_backsort (ets); if (ets->backsorted) return ets->backsorted[row]; @@ -408,14 +408,14 @@ ets_model_to_sorted (ESorter *es, gint row) static gint ets_sorted_to_model (ESorter *es, gint row) { - ETableSorter *ets = E_TABLE_SORTER(es); - gint rows = e_table_model_row_count(ets->source); + ETableSorter *ets = E_TABLE_SORTER (es); + 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); + g_return_val_if_fail (row >= 0, -1); + g_return_val_if_fail (row < rows, -1); - if (ets_needs_sorting(es)) - ets_sort(ets); + if (ets_needs_sorting (es)) + ets_sort (ets); if (ets->sorted) return ets->sorted[row]; @@ -426,9 +426,9 @@ ets_sorted_to_model (ESorter *es, gint row) static void ets_get_model_to_sorted_array (ESorter *es, gint **array, gint *count) { - ETableSorter *ets = E_TABLE_SORTER(es); + ETableSorter *ets = E_TABLE_SORTER (es); if (array || count) { - ets_backsort(ets); + ets_backsort (ets); if (array) *array = ets->backsorted; @@ -440,9 +440,9 @@ ets_get_model_to_sorted_array (ESorter *es, gint **array, gint *count) static void ets_get_sorted_to_model_array (ESorter *es, gint **array, gint *count) { - ETableSorter *ets = E_TABLE_SORTER(es); + ETableSorter *ets = E_TABLE_SORTER (es); if (array || count) { - ets_sort(ets); + ets_sort (ets); if (array) *array = ets->sorted; @@ -452,11 +452,11 @@ ets_get_sorted_to_model_array (ESorter *es, gint **array, gint *count) } static gboolean -ets_needs_sorting(ESorter *es) +ets_needs_sorting (ESorter *es) { - ETableSorter *ets = E_TABLE_SORTER(es); + ETableSorter *ets = E_TABLE_SORTER (es); if (ets->needs_sorting < 0) { - if (e_table_sort_info_sorting_get_count(ets->sort_info) + e_table_sort_info_grouping_get_count(ets->sort_info)) + if (e_table_sort_info_sorting_get_count (ets->sort_info) + e_table_sort_info_grouping_get_count (ets->sort_info)) ets->needs_sorting = 1; else ets->needs_sorting = 0; diff --git a/widgets/table/e-table-sorting-utils.c b/widgets/table/e-table-sorting-utils.c index ff808da1c0..2fa679644a 100644 --- a/widgets/table/e-table-sorting-utils.c +++ b/widgets/table/e-table-sorting-utils.c @@ -33,17 +33,17 @@ /* This takes source rows. */ static gint -etsu_compare(ETableModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, gint row1, gint row2, gpointer cmp_cache) +etsu_compare (ETableModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, gint row1, gint row2, gpointer cmp_cache) { gint j; - gint sort_count = e_table_sort_info_sorting_get_count(sort_info); + 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); + ETableSortColumn column = e_table_sort_info_sorting_get_nth (sort_info, j); ETableCol *col; - col = e_table_header_get_column_by_col_idx(full_header, column.column); + col = e_table_header_get_column_by_col_idx (full_header, column.column); if (col == NULL) col = e_table_header_get_column (full_header, e_table_header_count (full_header) - 1); comp_val = (*col->compare)(e_table_model_value_at (source, col->compare_col, row1), @@ -82,7 +82,7 @@ typedef struct { /* FIXME: Make it not cache the second and later columns (as if anyone cares.) */ static gint -e_sort_callback(gconstpointer data1, gconstpointer data2, gpointer user_data) +e_sort_callback (gconstpointer data1, gconstpointer data2, gpointer user_data) { gint row1 = *(gint *)data1; gint row2 = *(gint *)data2; @@ -109,7 +109,7 @@ e_sort_callback(gconstpointer data1, gconstpointer data2, gpointer user_data) } void -e_table_sorting_utils_sort(ETableModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, gint *map_table, gint rows) +e_table_sorting_utils_sort (ETableModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, gint *map_table, gint rows) { gint total_rows; gint i; @@ -117,26 +117,26 @@ e_table_sorting_utils_sort(ETableModel *source, ETableSortInfo *sort_info, ETabl gint cols; ETableSortClosure closure; - g_return_if_fail(source != NULL); - g_return_if_fail(E_IS_TABLE_MODEL(source)); - g_return_if_fail(sort_info != NULL); - g_return_if_fail(E_IS_TABLE_SORT_INFO(sort_info)); - g_return_if_fail(full_header != NULL); - g_return_if_fail(E_IS_TABLE_HEADER(full_header)); + g_return_if_fail (source != NULL); + g_return_if_fail (E_IS_TABLE_MODEL (source)); + g_return_if_fail (sort_info != NULL); + g_return_if_fail (E_IS_TABLE_SORT_INFO (sort_info)); + g_return_if_fail (full_header != NULL); + g_return_if_fail (E_IS_TABLE_HEADER (full_header)); - total_rows = e_table_model_row_count(source); - cols = e_table_sort_info_sorting_get_count(sort_info); + total_rows = e_table_model_row_count (source); + cols = e_table_sort_info_sorting_get_count (sort_info); closure.cols = cols; - closure.vals = g_new(gpointer , total_rows * cols); - closure.ascending = g_new(int, cols); - closure.compare = g_new(GCompareDataFunc, cols); + closure.vals = g_new (gpointer , total_rows * cols); + closure.ascending = g_new (int, cols); + closure.compare = g_new (GCompareDataFunc, cols); closure.cmp_cache = e_table_sorting_utils_create_cmp_cache (); for (j = 0; j < cols; j++) { - ETableSortColumn column = e_table_sort_info_sorting_get_nth(sort_info, j); + ETableSortColumn column = e_table_sort_info_sorting_get_nth (sort_info, j); ETableCol *col; - col = e_table_header_get_column_by_col_idx(full_header, column.column); + col = e_table_header_get_column_by_col_idx (full_header, column.column); if (col == NULL) col = e_table_header_get_column (full_header, e_table_header_count (full_header) - 1); for (i = 0; i < rows; i++) { @@ -147,11 +147,11 @@ e_table_sorting_utils_sort(ETableModel *source, ETableSortInfo *sort_info, ETabl } g_qsort_with_data ( - map_table, rows, sizeof(gint), e_sort_callback, &closure); + map_table, rows, sizeof (gint), e_sort_callback, &closure); - g_free(closure.vals); - g_free(closure.ascending); - g_free(closure.compare); + g_free (closure.vals); + g_free (closure.ascending); + g_free (closure.compare); e_table_sorting_utils_free_cmp_cache (closure.cmp_cache); } @@ -163,17 +163,17 @@ e_table_sorting_utils_affects_sort (ETableSortInfo *sort_info, 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); - g_return_val_if_fail(full_header != NULL, TRUE); - g_return_val_if_fail(E_IS_TABLE_HEADER(full_header), TRUE); + g_return_val_if_fail (sort_info != NULL, TRUE); + g_return_val_if_fail (E_IS_TABLE_SORT_INFO (sort_info), TRUE); + g_return_val_if_fail (full_header != NULL, TRUE); + g_return_val_if_fail (E_IS_TABLE_HEADER (full_header), TRUE); - cols = e_table_sort_info_sorting_get_count(sort_info); + cols = e_table_sort_info_sorting_get_count (sort_info); for (j = 0; j < cols; j++) { - ETableSortColumn column = e_table_sort_info_sorting_get_nth(sort_info, j); + ETableSortColumn column = e_table_sort_info_sorting_get_nth (sort_info, j); ETableCol *tablecol; - tablecol = e_table_header_get_column_by_col_idx(full_header, column.column); + tablecol = e_table_header_get_column_by_col_idx (full_header, column.column); if (tablecol == NULL) tablecol = e_table_header_get_column (full_header, e_table_header_count (full_header) - 1); if (col == tablecol->compare_col) @@ -184,14 +184,14 @@ 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. */ gint -e_table_sorting_utils_insert(ETableModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, gint *map_table, gint rows, gint row) +e_table_sorting_utils_insert (ETableModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, gint *map_table, gint rows, gint row) { gint i; gpointer cmp_cache = e_table_sorting_utils_create_cmp_cache (); i = 0; /* handle insertions when we have a 'sort group' */ - while (i < rows && etsu_compare(source, sort_info, full_header, map_table[i], row, cmp_cache) < 0) + while (i < rows && etsu_compare (source, sort_info, full_header, map_table[i], row, cmp_cache) < 0) i++; e_table_sorting_utils_free_cmp_cache (cmp_cache); @@ -212,13 +212,13 @@ e_table_sorting_utils_check_position (ETableModel *source, ETableSortInfo *sort_ cmp_cache = e_table_sorting_utils_create_cmp_cache (); i = view_row; - if (i < rows - 1 && etsu_compare(source, sort_info, full_header, map_table[i + 1], row, cmp_cache) < 0) { + if (i < rows - 1 && etsu_compare (source, sort_info, full_header, map_table[i + 1], row, cmp_cache) < 0) { i++; - while (i < rows - 1 && etsu_compare(source, sort_info, full_header, map_table[i], row, cmp_cache) < 0) + while (i < rows - 1 && etsu_compare (source, sort_info, full_header, map_table[i], row, cmp_cache) < 0) i++; - } else if (i > 0 && etsu_compare(source, sort_info, full_header, map_table[i - 1], row, cmp_cache) > 0) { + } else if (i > 0 && etsu_compare (source, sort_info, full_header, map_table[i - 1], row, cmp_cache) > 0) { i--; - while (i > 0 && etsu_compare(source, sort_info, full_header, map_table[i], row, cmp_cache) > 0) + while (i > 0 && etsu_compare (source, sort_info, full_header, map_table[i], row, cmp_cache) > 0) i--; } @@ -229,17 +229,17 @@ e_table_sorting_utils_check_position (ETableModel *source, ETableSortInfo *sort_ /* This takes source rows. */ static gint -etsu_tree_compare(ETreeModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, ETreePath path1, ETreePath path2, gpointer cmp_cache) +etsu_tree_compare (ETreeModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, ETreePath path1, ETreePath path2, gpointer cmp_cache) { gint j; - gint sort_count = e_table_sort_info_sorting_get_count(sort_info); + 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); + ETableSortColumn column = e_table_sort_info_sorting_get_nth (sort_info, j); ETableCol *col; - col = e_table_header_get_column_by_col_idx(full_header, column.column); + col = e_table_header_get_column_by_col_idx (full_header, column.column); if (col == NULL) col = e_table_header_get_column (full_header, e_table_header_count (full_header) - 1); comp_val = (*col->compare)(e_tree_model_value_at (source, path1, col->compare_col), @@ -255,7 +255,7 @@ etsu_tree_compare(ETreeModel *source, ETableSortInfo *sort_info, ETableHeader *f } static gint -e_sort_tree_callback(gconstpointer data1, gconstpointer data2, gpointer user_data) +e_sort_tree_callback (gconstpointer data1, gconstpointer data2, gpointer user_data) { ETreePath *path1 = *(ETreePath *)data1; ETreePath *path2 = *(ETreePath *)data2; @@ -265,33 +265,33 @@ e_sort_tree_callback(gconstpointer data1, gconstpointer data2, gpointer user_dat } void -e_table_sorting_utils_tree_sort(ETreeModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, ETreePath *map_table, gint count) +e_table_sorting_utils_tree_sort (ETreeModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, ETreePath *map_table, gint count) { ETableSortClosure closure; 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)); - g_return_if_fail(sort_info != NULL); - g_return_if_fail(E_IS_TABLE_SORT_INFO(sort_info)); - g_return_if_fail(full_header != NULL); - g_return_if_fail(E_IS_TABLE_HEADER(full_header)); - - cols = e_table_sort_info_sorting_get_count(sort_info); + g_return_if_fail (source != NULL); + g_return_if_fail (E_IS_TREE_MODEL (source)); + g_return_if_fail (sort_info != NULL); + g_return_if_fail (E_IS_TABLE_SORT_INFO (sort_info)); + g_return_if_fail (full_header != NULL); + g_return_if_fail (E_IS_TABLE_HEADER (full_header)); + + cols = e_table_sort_info_sorting_get_count (sort_info); closure.cols = cols; - closure.vals = g_new(gpointer , count * cols); - closure.ascending = g_new(int, cols); + closure.vals = g_new (gpointer , count * cols); + closure.ascending = g_new (int, cols); closure.compare = g_new (GCompareDataFunc, cols); closure.cmp_cache = e_table_sorting_utils_create_cmp_cache (); for (j = 0; j < cols; j++) { - ETableSortColumn column = e_table_sort_info_sorting_get_nth(sort_info, j); + ETableSortColumn column = e_table_sort_info_sorting_get_nth (sort_info, j); ETableCol *col; - col = e_table_header_get_column_by_col_idx(full_header, column.column); + col = e_table_header_get_column_by_col_idx (full_header, column.column); if (col == NULL) col = e_table_header_get_column (full_header, e_table_header_count (full_header) - 1); @@ -302,15 +302,15 @@ e_table_sorting_utils_tree_sort(ETreeModel *source, ETableSortInfo *sort_info, E closure.compare[j] = col->compare; } - map = g_new(int, count); + map = g_new (int, count); for (i = 0; i < count; i++) { map[i] = i; } g_qsort_with_data ( - map, count, sizeof(gint), e_sort_callback, &closure); + map, count, sizeof (gint), e_sort_callback, &closure); - map_copy = g_new(ETreePath, count); + map_copy = g_new (ETreePath, count); for (i = 0; i < count; i++) { map_copy[i] = map_table[i]; } @@ -318,12 +318,12 @@ e_table_sorting_utils_tree_sort(ETreeModel *source, ETableSortInfo *sort_info, E map_table[i] = map_copy[map[i]]; } - g_free(map); - g_free(map_copy); + g_free (map); + g_free (map_copy); - g_free(closure.vals); - g_free(closure.ascending); - g_free(closure.compare); + g_free (closure.vals); + g_free (closure.ascending); + g_free (closure.compare); e_table_sorting_utils_free_cmp_cache (closure.cmp_cache); } @@ -338,13 +338,13 @@ e_table_sorting_utils_tree_check_position (ETreeModel *source, ETableSortInfo *s i = old_index; path = map_table[i]; - if (i < count - 1 && etsu_tree_compare(source, sort_info, full_header, map_table[i + 1], path, cmp_cache) < 0) { + if (i < count - 1 && etsu_tree_compare (source, sort_info, full_header, map_table[i + 1], path, cmp_cache) < 0) { i++; - while (i < count - 1 && etsu_tree_compare(source, sort_info, full_header, map_table[i], path, cmp_cache) < 0) + while (i < count - 1 && etsu_tree_compare (source, sort_info, full_header, map_table[i], path, cmp_cache) < 0) i++; - } else if (i > 0 && etsu_tree_compare(source, sort_info, full_header, map_table[i - 1], path, cmp_cache) > 0) { + } else if (i > 0 && etsu_tree_compare (source, sort_info, full_header, map_table[i - 1], path, cmp_cache) > 0) { i--; - while (i > 0 && etsu_tree_compare(source, sort_info, full_header, map_table[i], path, cmp_cache) > 0) + while (i > 0 && etsu_tree_compare (source, sort_info, full_header, map_table[i], path, cmp_cache) > 0) i--; } @@ -355,7 +355,7 @@ 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. */ gint -e_table_sorting_utils_tree_insert(ETreeModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, ETreePath *map_table, gint count, ETreePath path) +e_table_sorting_utils_tree_insert (ETreeModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, ETreePath *map_table, gint count, ETreePath path) { gsize start; gsize end; @@ -366,7 +366,7 @@ e_table_sorting_utils_tree_insert(ETreeModel *source, ETableSortInfo *sort_info, closure.full_header = full_header; closure.cmp_cache = e_table_sorting_utils_create_cmp_cache (); - e_bsearch(&path, map_table, count, sizeof(ETreePath), e_sort_tree_callback, &closure, &start, &end); + e_bsearch (&path, map_table, count, sizeof (ETreePath), e_sort_tree_callback, &closure, &start, &end); e_table_sorting_utils_free_cmp_cache (closure.cmp_cache); diff --git a/widgets/table/e-table-specification.c b/widgets/table/e-table-specification.c index 5d2bcad32c..2325aea633 100644 --- a/widgets/table/e-table-specification.c +++ b/widgets/table/e-table-specification.c @@ -393,9 +393,9 @@ e_table_specification_save_to_node (ETableSpecification *specification, if (specification->columns) { gint i; - for (i = 0; specification->columns [i]; i++) + for (i = 0; specification->columns[i]; i++) e_table_column_specification_save_to_node ( - specification->columns [i], + specification->columns[i], node); } diff --git a/widgets/table/e-table-state.c b/widgets/table/e-table-state.c index 1360271680..9844849818 100644 --- a/widgets/table/e-table-state.c +++ b/widgets/table/e-table-state.c @@ -84,7 +84,7 @@ e_table_state_init (ETableState *state) { state->columns = NULL; state->expansions = NULL; - state->sort_info = e_table_sort_info_new(); + state->sort_info = e_table_sort_info_new (); } ETableState * @@ -124,9 +124,9 @@ e_table_state_load_from_file (ETableState *state, doc = e_xml_parse_file (filename); if (doc) { - xmlNode *node = xmlDocGetRootElement(doc); - e_table_state_load_from_node(state, node); - xmlFreeDoc(doc); + xmlNode *node = xmlDocGetRootElement (doc); + e_table_state_load_from_node (state, node); + xmlFreeDoc (doc); return TRUE; } return FALSE; @@ -141,11 +141,11 @@ e_table_state_load_from_string (ETableState *state, g_return_if_fail (E_IS_TABLE_STATE (state)); g_return_if_fail (xml != NULL); - doc = xmlParseMemory ((gchar *) xml, strlen(xml)); + doc = xmlParseMemory ((gchar *) xml, strlen (xml)); if (doc) { - xmlNode *node = xmlDocGetRootElement(doc); - e_table_state_load_from_node(state, node); - xmlFreeDoc(doc); + xmlNode *node = xmlDocGetRootElement (doc); + e_table_state_load_from_node (state, node); + xmlFreeDoc (doc); } } @@ -176,27 +176,27 @@ e_table_state_load_from_node (ETableState *state, children = node->xmlChildrenNode; for (; children; children = children->next) { if (!strcmp ((gchar *)children->name, "column")) { - int_and_double *column_info = g_new(int_and_double, 1); + int_and_double *column_info = g_new (int_and_double, 1); - column_info->column = e_xml_get_integer_prop_by_name( + column_info->column = e_xml_get_integer_prop_by_name ( children, (const guchar *)"source"); column_info->expansion = - e_xml_get_double_prop_by_name_with_default( + e_xml_get_double_prop_by_name_with_default ( children, (const guchar *)"expansion", 1); list = g_list_append (list, column_info); } else if (state->sort_info == NULL && !strcmp ((gchar *)children->name, "grouping")) { - state->sort_info = e_table_sort_info_new(); - e_table_sort_info_load_from_node( + state->sort_info = e_table_sort_info_new (); + e_table_sort_info_load_from_node ( state->sort_info, children, state_version); } } - g_free(state->columns); - g_free(state->expansions); - state->col_count = g_list_length(list); - state->columns = g_new(int, state->col_count); - state->expansions = g_new(double, state->col_count); + g_free (state->columns); + g_free (state->expansions); + state->col_count = g_list_length (list); + state->columns = g_new (int, state->col_count); + state->expansions = g_new (double, state->col_count); if (!state->sort_info) state->sort_info = e_table_sort_info_new (); @@ -204,12 +204,12 @@ e_table_state_load_from_node (ETableState *state, for (iterator = list, i = 0; iterator; i++) { int_and_double *column_info = iterator->data; - state->columns [i] = column_info->column; - state->expansions [i] = column_info->expansion; + state->columns[i] = column_info->column; + state->expansions[i] = column_info->expansion; g_free (column_info); iterator = g_list_next (iterator); } - g_list_free(list); + g_list_free (list); } void @@ -239,12 +239,12 @@ e_table_state_save_to_string (ETableState *state) g_return_val_if_fail (E_IS_TABLE_STATE (state), NULL); doc = xmlNewDoc((const guchar *)"1.0"); - xmlDocSetRootElement(doc, e_table_state_save_to_node(state, NULL)); - xmlDocDumpMemory(doc, &string, &length); - xmlFreeDoc(doc); + xmlDocSetRootElement (doc, e_table_state_save_to_node (state, NULL)); + xmlDocDumpMemory (doc, &string, &length); + xmlFreeDoc (doc); - ret_val = g_strdup((gchar *)string); - xmlFree(string); + ret_val = g_strdup ((gchar *)string); + xmlFree (string); return ret_val; } @@ -281,7 +281,7 @@ e_table_state_save_to_node (ETableState *state, "expansion", expansion); } - e_table_sort_info_save_to_node(state->sort_info, node); + e_table_sort_info_save_to_node (state->sort_info, node); return node; } diff --git a/widgets/table/e-table-subset-variable.c b/widgets/table/e-table-subset-variable.c index f27d220f10..07aaa18e10 100644 --- a/widgets/table/e-table-subset-variable.c +++ b/widgets/table/e-table-subset-variable.c @@ -41,14 +41,14 @@ static void etssv_add (ETableSubsetVariable *etssv, gint row) { - ETableModel *etm = E_TABLE_MODEL(etssv); - ETableSubset *etss = E_TABLE_SUBSET(etssv); + ETableModel *etm = E_TABLE_MODEL (etssv); + ETableSubset *etss = E_TABLE_SUBSET (etssv); - e_table_model_pre_change(etm); + e_table_model_pre_change (etm); if (etss->n_map + 1 > etssv->n_vals_allocated) { etssv->n_vals_allocated += INCREMENT_AMOUNT; - etss->map_table = g_realloc (etss->map_table, etssv->n_vals_allocated * sizeof(gint)); + etss->map_table = g_realloc (etss->map_table, etssv->n_vals_allocated * sizeof (gint)); } etss->map_table[etss->n_map++] = row; @@ -61,15 +61,15 @@ etssv_add_array (ETableSubsetVariable *etssv, const gint *array, gint count) { - ETableModel *etm = E_TABLE_MODEL(etssv); - ETableSubset *etss = E_TABLE_SUBSET(etssv); + ETableModel *etm = E_TABLE_MODEL (etssv); + ETableSubset *etss = E_TABLE_SUBSET (etssv); gint i; - e_table_model_pre_change(etm); + e_table_model_pre_change (etm); if (etss->n_map + count > etssv->n_vals_allocated) { - etssv->n_vals_allocated += MAX(INCREMENT_AMOUNT, count); - etss->map_table = g_realloc (etss->map_table, etssv->n_vals_allocated * sizeof(gint)); + etssv->n_vals_allocated += MAX (INCREMENT_AMOUNT, count); + etss->map_table = g_realloc (etss->map_table, etssv->n_vals_allocated * sizeof (gint)); } for (i = 0; i < count; i++) etss->map_table[etss->n_map++] = array[i]; @@ -80,17 +80,17 @@ etssv_add_array (ETableSubsetVariable *etssv, static void etssv_add_all (ETableSubsetVariable *etssv) { - ETableModel *etm = E_TABLE_MODEL(etssv); - ETableSubset *etss = E_TABLE_SUBSET(etssv); + ETableModel *etm = E_TABLE_MODEL (etssv); + ETableSubset *etss = E_TABLE_SUBSET (etssv); gint rows; gint i; - e_table_model_pre_change(etm); + e_table_model_pre_change (etm); - rows = e_table_model_row_count(etss->source); + rows = e_table_model_row_count (etss->source); if (etss->n_map + rows > etssv->n_vals_allocated) { - etssv->n_vals_allocated += MAX(INCREMENT_AMOUNT, rows); - etss->map_table = g_realloc (etss->map_table, etssv->n_vals_allocated * sizeof(gint)); + etssv->n_vals_allocated += MAX (INCREMENT_AMOUNT, rows); + etss->map_table = g_realloc (etss->map_table, etssv->n_vals_allocated * sizeof (gint)); } for (i = 0; i < rows; i++) etss->map_table[etss->n_map++] = i; @@ -102,14 +102,14 @@ static gboolean etssv_remove (ETableSubsetVariable *etssv, gint row) { - ETableModel *etm = E_TABLE_MODEL(etssv); - ETableSubset *etss = E_TABLE_SUBSET(etssv); + ETableModel *etm = E_TABLE_MODEL (etssv); + ETableSubset *etss = E_TABLE_SUBSET (etssv); gint i; for (i = 0; i < etss->n_map; i++) { if (etss->map_table[i] == row) { e_table_model_pre_change (etm); - memmove (etss->map_table + i, etss->map_table + i + 1, (etss->n_map - i - 1) * sizeof(gint)); + memmove (etss->map_table + i, etss->map_table + i + 1, (etss->n_map - i - 1) * sizeof (gint)); etss->n_map--; e_table_model_row_deleted (etm, i); @@ -138,9 +138,9 @@ ETableModel * e_table_subset_variable_construct (ETableSubsetVariable *etssv, ETableModel *source) { - if (e_table_subset_construct (E_TABLE_SUBSET(etssv), source, 1) == NULL) + if (e_table_subset_construct (E_TABLE_SUBSET (etssv), source, 1) == NULL) return NULL; - E_TABLE_SUBSET(etssv)->n_map = 0; + E_TABLE_SUBSET (etssv)->n_map = 0; return E_TABLE_MODEL (etssv); } @@ -163,9 +163,9 @@ e_table_subset_variable_add (ETableSubsetVariable *etssv, gint row) { g_return_if_fail (etssv != NULL); - g_return_if_fail (E_IS_TABLE_SUBSET_VARIABLE(etssv)); + g_return_if_fail (E_IS_TABLE_SUBSET_VARIABLE (etssv)); - if (ETSSV_CLASS(etssv)->add) + if (ETSSV_CLASS (etssv)->add) ETSSV_CLASS (etssv)->add (etssv, row); } @@ -175,9 +175,9 @@ e_table_subset_variable_add_array (ETableSubsetVariable *etssv, gint count) { g_return_if_fail (etssv != NULL); - g_return_if_fail (E_IS_TABLE_SUBSET_VARIABLE(etssv)); + g_return_if_fail (E_IS_TABLE_SUBSET_VARIABLE (etssv)); - if (ETSSV_CLASS(etssv)->add_array) + if (ETSSV_CLASS (etssv)->add_array) ETSSV_CLASS (etssv)->add_array (etssv, array, count); } @@ -185,9 +185,9 @@ void e_table_subset_variable_add_all (ETableSubsetVariable *etssv) { g_return_if_fail (etssv != NULL); - g_return_if_fail (E_IS_TABLE_SUBSET_VARIABLE(etssv)); + g_return_if_fail (E_IS_TABLE_SUBSET_VARIABLE (etssv)); - if (ETSSV_CLASS(etssv)->add_all) + if (ETSSV_CLASS (etssv)->add_all) ETSSV_CLASS (etssv)->add_all (etssv); } @@ -196,9 +196,9 @@ e_table_subset_variable_remove (ETableSubsetVariable *etssv, gint row) { g_return_val_if_fail (etssv != NULL, FALSE); - g_return_val_if_fail (E_IS_TABLE_SUBSET_VARIABLE(etssv), FALSE); + g_return_val_if_fail (E_IS_TABLE_SUBSET_VARIABLE (etssv), FALSE); - if (ETSSV_CLASS(etssv)->remove) + if (ETSSV_CLASS (etssv)->remove) return ETSSV_CLASS (etssv)->remove (etssv, row); else return FALSE; @@ -207,8 +207,8 @@ e_table_subset_variable_remove (ETableSubsetVariable *etssv, void e_table_subset_variable_clear (ETableSubsetVariable *etssv) { - ETableModel *etm = E_TABLE_MODEL(etssv); - ETableSubset *etss = E_TABLE_SUBSET(etssv); + ETableModel *etm = E_TABLE_MODEL (etssv); + ETableSubset *etss = E_TABLE_SUBSET (etssv); e_table_model_pre_change (etm); etss->n_map = 0; @@ -225,7 +225,7 @@ e_table_subset_variable_increment (ETableSubsetVariable *etssv, gint amount) { gint i; - ETableSubset *etss = E_TABLE_SUBSET(etssv); + ETableSubset *etss = E_TABLE_SUBSET (etssv); for (i = 0; i < etss->n_map; i++) { if (etss->map_table[i] >= position) etss->map_table[i] += amount; @@ -238,7 +238,7 @@ e_table_subset_variable_decrement (ETableSubsetVariable *etssv, gint amount) { gint i; - ETableSubset *etss = E_TABLE_SUBSET(etssv); + ETableSubset *etss = E_TABLE_SUBSET (etssv); for (i = 0; i < etss->n_map; i++) { if (etss->map_table[i] >= position) etss->map_table[i] -= amount; @@ -249,10 +249,10 @@ void e_table_subset_variable_set_allocation (ETableSubsetVariable *etssv, gint total) { - ETableSubset *etss = E_TABLE_SUBSET(etssv); + ETableSubset *etss = E_TABLE_SUBSET (etssv); if (total <= 0) total = 1; if (total > etss->n_map) { - etss->map_table = g_realloc (etss->map_table, total * sizeof(gint)); + etss->map_table = g_realloc (etss->map_table, total * sizeof (gint)); } } diff --git a/widgets/table/e-table-subset.c b/widgets/table/e-table-subset.c index cdc9047160..e9f048da06 100644 --- a/widgets/table/e-table-subset.c +++ b/widgets/table/e-table-subset.c @@ -56,12 +56,12 @@ etss_get_view_row (ETableSubset *etss, gint row) const gint * const map_table = etss->map_table; gint i; - gint end = MIN(etss->n_map, etss->last_access + 10); - gint start = MAX(0, etss->last_access - 10); + 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) { + if (map_table[i] == row) { d(g_print("a) Found %d from %d\n", i, etss->last_access)); etss->last_access = i; return i; @@ -69,7 +69,7 @@ etss_get_view_row (ETableSubset *etss, gint row) } for (i = initial - 1; i >= start; i--) { - if (map_table [i] == row) { + if (map_table[i] == row) { d(g_print("b) Found %d from %d\n", i, etss->last_access)); etss->last_access = i; return i; @@ -77,7 +77,7 @@ etss_get_view_row (ETableSubset *etss, gint row) } for (i = 0; i < n; i++) { - if (map_table [i] == row) { + if (map_table[i] == row) { d(g_print("c) Found %d from %d\n", i, etss->last_access)); etss->last_access = i; return i; @@ -156,7 +156,7 @@ etss_value_at (ETableModel *etm, gint col, gint row) etss->last_access = row; d(g_print("g) Setting last_access to %d\n", row)); - return e_table_model_value_at (etss->source, col, MAP_ROW(etss, row)); + return e_table_model_value_at (etss->source, col, MAP_ROW (etss, row)); } static void @@ -168,7 +168,7 @@ etss_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) etss->last_access = row; d(g_print("h) Setting last_access to %d\n", row)); - e_table_model_set_value_at (etss->source, col, MAP_ROW(etss, row), val); + e_table_model_set_value_at (etss->source, col, MAP_ROW (etss, row), val); } static gboolean @@ -178,7 +178,7 @@ etss_is_cell_editable (ETableModel *etm, gint col, gint row) g_return_val_if_fail (VALID_ROW (etss, row), FALSE); - return e_table_model_is_cell_editable (etss->source, col, MAP_ROW(etss, row)); + return e_table_model_is_cell_editable (etss->source, col, MAP_ROW (etss, row)); } static gboolean @@ -195,7 +195,7 @@ etss_get_save_id (ETableModel *etm, gint row) g_return_val_if_fail (VALID_ROW (etss, row), NULL); if (e_table_model_has_save_id (etss->source)) - return e_table_model_get_save_id (etss->source, MAP_ROW(etss, row)); + return e_table_model_get_save_id (etss->source, MAP_ROW (etss, row)); else return g_strdup_printf ("%d", MAP_ROW(etss, row)); } @@ -341,50 +341,50 @@ etss_proxy_model_rows_deleted_real (ETableSubset *etss, ETableModel *etm, gint r static void etss_proxy_model_pre_change (ETableModel *etm, ETableSubset *etss) { - if (ETSS_CLASS(etss)->proxy_model_pre_change) - (ETSS_CLASS(etss)->proxy_model_pre_change) (etss, etm); + if (ETSS_CLASS (etss)->proxy_model_pre_change) + (ETSS_CLASS (etss)->proxy_model_pre_change) (etss, etm); } static void etss_proxy_model_no_change (ETableModel *etm, ETableSubset *etss) { - if (ETSS_CLASS(etss)->proxy_model_no_change) - (ETSS_CLASS(etss)->proxy_model_no_change) (etss, etm); + if (ETSS_CLASS (etss)->proxy_model_no_change) + (ETSS_CLASS (etss)->proxy_model_no_change) (etss, etm); } static void etss_proxy_model_changed (ETableModel *etm, ETableSubset *etss) { - if (ETSS_CLASS(etss)->proxy_model_changed) - (ETSS_CLASS(etss)->proxy_model_changed) (etss, etm); + if (ETSS_CLASS (etss)->proxy_model_changed) + (ETSS_CLASS (etss)->proxy_model_changed) (etss, etm); } static void 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); + 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, gint col, gint row, ETableSubset *etss) { - if (ETSS_CLASS(etss)->proxy_model_cell_changed) - (ETSS_CLASS(etss)->proxy_model_cell_changed) (etss, etm, col, row); + 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, 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); + 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, 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); + if (ETSS_CLASS (etss)->proxy_model_rows_deleted) + (ETSS_CLASS (etss)->proxy_model_rows_deleted) (etss, etm, row, col); } ETableModel * @@ -406,7 +406,7 @@ e_table_subset_construct (ETableSubset *etss, ETableModel *source, gint nvals) /* Init */ for (i = 0; i < nvals; i++) - etss->map_table [i] = i; + etss->map_table[i] = i; etss->table_model_pre_change_id = g_signal_connect (G_OBJECT (source), "model_pre_change", G_CALLBACK (etss_proxy_model_pre_change), etss); diff --git a/widgets/table/e-table-utils.c b/widgets/table/e-table-utils.c index 2f4939edcb..57878722b8 100644 --- a/widgets/table/e-table-utils.c +++ b/widgets/table/e-table-utils.c @@ -88,11 +88,11 @@ et_col_spec_to_col (ETableColumnSpecification *col_spec, ETableSearchFunc search = NULL; if (col_spec->cell) - cell = e_table_extras_get_cell(ete, col_spec->cell); + cell = e_table_extras_get_cell (ete, col_spec->cell); if (col_spec->compare) - compare = e_table_extras_get_compare(ete, col_spec->compare); + compare = e_table_extras_get_compare (ete, col_spec->compare); if (col_spec->search) - search = e_table_extras_get_search(ete, col_spec->search); + search = e_table_extras_get_search (ete, col_spec->search); if (cell && compare) { gchar *title = dgettext (domain, col_spec->title); @@ -184,7 +184,7 @@ e_table_util_calculate_current_search_col (ETableHeader *header, ETableCol *col = NULL; count = e_table_sort_info_grouping_get_count (sort_info); for (i = 0; i < count; i++) { - ETableSortColumn column = e_table_sort_info_grouping_get_nth(sort_info, i); + ETableSortColumn column = e_table_sort_info_grouping_get_nth (sort_info, i); col = e_table_header_get_column (full_header, column.column); @@ -197,7 +197,7 @@ e_table_util_calculate_current_search_col (ETableHeader *header, if (col == NULL) { count = e_table_sort_info_sorting_get_count (sort_info); for (i = 0; i < count; i++) { - ETableSortColumn column = e_table_sort_info_sorting_get_nth(sort_info, i); + ETableSortColumn column = e_table_sort_info_sorting_get_nth (sort_info, i); col = e_table_header_get_column (full_header, column.column); diff --git a/widgets/table/e-table-without.c b/widgets/table/e-table-without.c index b19bdeb615..5dacfb61cc 100644 --- a/widgets/table/e-table-without.c +++ b/widgets/table/e-table-without.c @@ -266,9 +266,9 @@ e_table_without_construct (ETableWithout *etw, ETableWithoutFreeKeyFunc free_duplicated_key_func, void *closure) { - if (e_table_subset_construct (E_TABLE_SUBSET(etw), source, 1) == NULL) + if (e_table_subset_construct (E_TABLE_SUBSET (etw), source, 1) == NULL) return NULL; - E_TABLE_SUBSET(etw)->n_map = 0; + E_TABLE_SUBSET (etw)->n_map = 0; etw->priv->hash_func = hash_func; etw->priv->compare_func = compare_func; @@ -387,7 +387,7 @@ e_table_without_show_all (ETableWithout *etw) } etw->priv->hash = g_hash_table_new (etw->priv->hash_func, etw->priv->compare_func); - row_count = e_table_model_row_count (E_TABLE_MODEL(etss->source)); + row_count = e_table_model_row_count (E_TABLE_MODEL (etss->source)); g_free (etss->map_table); etss->map_table = g_new (int, row_count); diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c index 9c1070bf4d..254ea47046 100644 --- a/widgets/table/e-table.c +++ b/widgets/table/e-table.c @@ -111,7 +111,7 @@ enum { ET_SCROLL_RIGHT = 1 << 3 }; -static guint et_signals [LAST_SIGNAL] = { 0 }; +static guint et_signals[LAST_SIGNAL] = { 0 }; static void e_table_fill_table (ETable *e_table, ETableModel *model); static gboolean changed_idle (gpointer data); @@ -124,33 +124,33 @@ static void et_drag_begin (GtkWidget *widget, static void et_drag_end (GtkWidget *widget, GdkDragContext *context, ETable *et); -static void et_drag_data_get(GtkWidget *widget, +static void et_drag_data_get (GtkWidget *widget, GdkDragContext *context, GtkSelectionData *selection_data, guint info, guint time, ETable *et); -static void et_drag_data_delete(GtkWidget *widget, +static void et_drag_data_delete (GtkWidget *widget, GdkDragContext *context, ETable *et); -static void et_drag_leave(GtkWidget *widget, +static void et_drag_leave (GtkWidget *widget, GdkDragContext *context, guint time, ETable *et); -static gboolean et_drag_motion(GtkWidget *widget, +static gboolean et_drag_motion (GtkWidget *widget, GdkDragContext *context, gint x, gint y, guint time, ETable *et); -static gboolean et_drag_drop(GtkWidget *widget, +static gboolean et_drag_drop (GtkWidget *widget, GdkDragContext *context, gint x, gint y, guint time, ETable *et); -static void et_drag_data_received(GtkWidget *widget, +static void et_drag_data_received (GtkWidget *widget, GdkDragContext *context, gint x, gint y, @@ -198,7 +198,7 @@ et_disconnect_model (ETable *et) static void e_table_state_change (ETable *et) { - g_signal_emit (G_OBJECT (et), et_signals [STATE_CHANGE], 0); + g_signal_emit (G_OBJECT (et), et_signals[STATE_CHANGE], 0); } #define CHECK_HORIZONTAL(et) \ @@ -282,7 +282,7 @@ disconnect_header (ETable *e_table) g_signal_handler_disconnect (G_OBJECT (e_table->header), e_table->dimension_change_id); - g_object_unref(e_table->header); + g_object_unref (e_table->header); e_table->header = NULL; } @@ -337,7 +337,7 @@ et_dispose (GObject *object) } if (et->reflow_idle_id) { - g_source_remove(et->reflow_idle_id); + g_source_remove (et->reflow_idle_id); et->reflow_idle_id = 0; } @@ -395,10 +395,10 @@ et_dispose (GObject *object) et->rebuild_idle_id = 0; } - g_free(et->click_to_add_message); + g_free (et->click_to_add_message); et->click_to_add_message = NULL; - g_free(et->domain); + g_free (et->domain); et->domain = NULL; (*G_OBJECT_CLASS (e_table_parent_class)->dispose)(object); @@ -443,7 +443,7 @@ et_search_search (ETableSearch *search, rows = e_table_model_row_count (et->model); - g_object_get(et->selection, + g_object_get (et->selection, "cursor_row", &cursor, NULL); @@ -503,7 +503,7 @@ init_search (ETable *e_table) if (e_table->search != NULL) return; - e_table->search = e_table_search_new(); + e_table->search = e_table_search_new (); e_table->search_search_id = g_signal_connect (G_OBJECT (e_table->search), "search", @@ -521,7 +521,7 @@ et_finalize (GObject *object) g_free (et->click_to_add_message); et->click_to_add_message = NULL; - g_free(et->domain); + g_free (et->domain); et->domain = NULL; G_OBJECT_CLASS (e_table_parent_class)->finalize (object); } @@ -566,7 +566,7 @@ e_table_init (ETable *e_table) e_table->do_drag = 0; e_table->sorter = NULL; - e_table->selection = e_table_selection_model_new(); + e_table->selection = e_table_selection_model_new (); e_table->cursor_loc = E_TABLE_CURSOR_LOC_NONE; e_table->spec = NULL; @@ -654,7 +654,7 @@ header_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, ETable *e_ static void group_info_changed (ETableSortInfo *info, ETable *et) { - gboolean will_be_grouped = e_table_sort_info_grouping_get_count(info) > 0; + gboolean will_be_grouped = e_table_sort_info_grouping_get_count (info) > 0; clear_current_search_col (et); if (et->is_grouped || will_be_grouped) { et->need_rebuild = TRUE; @@ -694,7 +694,7 @@ e_table_setup_header (ETable *e_table) "table", e_table, NULL); - g_free(pointer); + g_free (pointer); g_signal_connect ( G_OBJECT (e_table->header_canvas), "size_allocate", @@ -719,7 +719,7 @@ table_canvas_reflow_idle (ETable *e_table) e_table->canvas_vbox, "height", &height, "width", &width, NULL); height = MAX ((gint)height, allocation.height); - width = MAX((gint)width, allocation.width); + width = MAX ((gint)width, allocation.width); /* I have no idea why this needs to be -1, but it works. */ gnome_canvas_get_scroll_region (GNOME_CANVAS (e_table->table_canvas), NULL, NULL, &oldwidth, &oldheight); @@ -756,8 +756,8 @@ table_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, g_object_set_property (G_OBJECT (e_table->header), "width", val); g_free (val); if (e_table->reflow_idle_id) - g_source_remove(e_table->reflow_idle_id); - table_canvas_reflow_idle(e_table); + g_source_remove (e_table->reflow_idle_id); + table_canvas_reflow_idle (e_table); e_table->size_allocated = TRUE; @@ -778,7 +778,7 @@ static void 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)); + e_selection_model_clear (E_SELECTION_MODEL (et->selection)); } et->cursor_loc = E_TABLE_CURSOR_LOC_ETCTA; } @@ -791,22 +791,22 @@ group_cursor_change (ETableGroup *etg, gint row, ETable *et) old_cursor_loc = et->cursor_loc; et->cursor_loc = E_TABLE_CURSOR_LOC_TABLE; - g_signal_emit (G_OBJECT (et), et_signals [CURSOR_CHANGE], 0, row); + g_signal_emit (G_OBJECT (et), et_signals[CURSOR_CHANGE], 0, row); if (old_cursor_loc == E_TABLE_CURSOR_LOC_ETCTA && et->click_to_add) - e_table_click_to_add_commit(E_TABLE_CLICK_TO_ADD(et->click_to_add)); + e_table_click_to_add_commit (E_TABLE_CLICK_TO_ADD (et->click_to_add)); } static void group_cursor_activated (ETableGroup *etg, gint row, ETable *et) { - g_signal_emit (G_OBJECT (et), et_signals [CURSOR_ACTIVATED], 0, row); + g_signal_emit (G_OBJECT (et), et_signals[CURSOR_ACTIVATED], 0, row); } static void 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); + g_signal_emit (G_OBJECT (et), et_signals[DOUBLE_CLICK], 0, row, col, event); } static gboolean @@ -825,7 +825,7 @@ static gboolean group_click (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable *et) { gboolean return_val = 0; - g_signal_emit (G_OBJECT (et), et_signals [CLICK], 0, row, col, event, &return_val); + g_signal_emit (G_OBJECT (et), et_signals[CLICK], 0, row, col, event, &return_val); return return_val; } @@ -899,7 +899,7 @@ group_key_press (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable * (key->keyval >= GDK_A && key->keyval <= GDK_Z) || (key->keyval >= GDK_0 && key->keyval <= GDK_9))) e_table_search_input_character (et->search, key->keyval); - g_signal_emit (G_OBJECT (et), et_signals [KEY_PRESS], 0, + g_signal_emit (G_OBJECT (et), et_signals[KEY_PRESS], 0, row, col, event, &return_val); break; } @@ -910,7 +910,7 @@ static gboolean group_start_drag (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable *et) { gboolean return_val = TRUE; - g_signal_emit (G_OBJECT (et), et_signals [START_DRAG], 0, + g_signal_emit (G_OBJECT (et), et_signals[START_DRAG], 0, row, col, event, &return_val); return return_val; } @@ -932,7 +932,7 @@ et_table_row_changed (ETableModel *table_model, gint row, ETable *et) if (!et->need_rebuild) { if (e_table_group_remove (et->group, row)) e_table_group_add (et->group, row); - CHECK_HORIZONTAL(et); + CHECK_HORIZONTAL (et); } } @@ -946,28 +946,28 @@ static void et_table_rows_inserted (ETableModel *table_model, gint row, gint count, ETable *et) { /* This number has already been decremented. */ - gint row_count = e_table_model_row_count(table_model); + gint row_count = e_table_model_row_count (table_model); if (!et->need_rebuild) { gint i; if (row != row_count - count) - e_table_group_increment(et->group, row, count); + e_table_group_increment (et->group, row, count); for (i = 0; i < count; i++) e_table_group_add (et->group, row + i); - CHECK_HORIZONTAL(et); + CHECK_HORIZONTAL (et); } } static void et_table_rows_deleted (ETableModel *table_model, gint row, gint count, ETable *et) { - gint row_count = e_table_model_row_count(table_model); + gint row_count = e_table_model_row_count (table_model); if (!et->need_rebuild) { gint i; for (i = 0; i < count; i++) e_table_group_remove (et->group, row + i); if (row != row_count) - e_table_group_decrement(et->group, row, count); - CHECK_HORIZONTAL(et); + e_table_group_decrement (et->group, row, count); + CHECK_HORIZONTAL (et); } } @@ -976,7 +976,7 @@ et_build_groups (ETable *et) { gboolean was_grouped = et->is_grouped; - et->is_grouped = e_table_sort_info_grouping_get_count(et->sort_info) > 0; + et->is_grouped = e_table_sort_info_grouping_get_count (et->sort_info) > 0; et->group = e_table_group_new (GNOME_CANVAS_GROUP (et->canvas_vbox), et->full_header, @@ -995,7 +995,7 @@ et_build_groups (ETable *et) GNOME_CANVAS_ITEM (et->group)); gnome_canvas_item_set ( - GNOME_CANVAS_ITEM(et->group), + GNOME_CANVAS_ITEM (et->group), "alternating_row_colors", et->alternating_row_colors, "horizontal_draw_grid", et->horizontal_draw_grid, "vertical_draw_grid", et->vertical_draw_grid, @@ -1063,7 +1063,7 @@ changed_idle (gpointer data) if (et->group) gtk_object_destroy (GTK_OBJECT (et->group)); - et_build_groups(et); + et_build_groups (et); widget = GTK_WIDGET (et->table_canvas); gtk_widget_get_allocation (widget, &allocation); @@ -1080,7 +1080,7 @@ changed_idle (gpointer data) et->rebuild_idle_id = 0; - CHECK_HORIZONTAL(et); + CHECK_HORIZONTAL (et); return FALSE; } @@ -1094,12 +1094,12 @@ et_canvas_realize (GtkWidget *canvas, ETable *e_table) widget = GTK_WIDGET (e_table->table_canvas); style = gtk_widget_get_style (widget); - gnome_canvas_item_set( + gnome_canvas_item_set ( e_table->white_item, "fill_color_gdk", &style->base[GTK_STATE_NORMAL], NULL); - CHECK_HORIZONTAL(e_table); + CHECK_HORIZONTAL (e_table); set_header_width (e_table); } @@ -1107,7 +1107,7 @@ static gboolean white_item_event (GnomeCanvasItem *white_item, GdkEvent *event, ETable *e_table) { gboolean return_val = 0; - g_signal_emit (GTK_OBJECT (e_table), et_signals [WHITE_SPACE_EVENT], 0, + g_signal_emit (GTK_OBJECT (e_table), et_signals[WHITE_SPACE_EVENT], 0, event, &return_val); return return_val; } @@ -1118,10 +1118,10 @@ et_eti_leave_edit (ETable *et) GnomeCanvas *canvas = et->table_canvas; if (gtk_widget_has_focus (GTK_WIDGET (canvas))) { - GnomeCanvasItem *item = GNOME_CANVAS(canvas)->focused_item; + GnomeCanvasItem *item = GNOME_CANVAS (canvas)->focused_item; - if (E_IS_TABLE_ITEM(item)) { - e_table_item_leave_edit_(E_TABLE_ITEM(item)); + if (E_IS_TABLE_ITEM (item)) { + e_table_item_leave_edit_(E_TABLE_ITEM (item)); } } } @@ -1183,17 +1183,17 @@ table_canvas_focus_event_cb (GtkWidget *widget, GdkEventFocus *event, gpointer d ecanvas = E_CANVAS (widget); if (!event->in) { - gtk_im_context_focus_out(ecanvas->im_context); + gtk_im_context_focus_out (ecanvas->im_context); return FALSE; } else { - gtk_im_context_focus_in(ecanvas->im_context); + gtk_im_context_focus_in (ecanvas->im_context); } etable = E_TABLE (data); - if (e_table_model_row_count(etable->model) < 1 + if (e_table_model_row_count (etable->model) < 1 && (etable->click_to_add) - && !(E_TABLE_CLICK_TO_ADD(etable->click_to_add)->row)) { + && !(E_TABLE_CLICK_TO_ADD (etable->click_to_add)->row)) { gnome_canvas_item_grab_focus (etable->canvas_vbox); gnome_canvas_item_grab_focus (etable->click_to_add); } else if (!canvas->focused_item && etable->group) { @@ -1203,7 +1203,7 @@ table_canvas_focus_event_cb (GtkWidget *widget, GdkEventFocus *event, gpointer d /* check whether click_to_add already got the focus */ if (etable->click_to_add) { - GnomeCanvasItem *row = E_TABLE_CLICK_TO_ADD(etable->click_to_add)->row; + GnomeCanvasItem *row = E_TABLE_CLICK_TO_ADD (etable->click_to_add)->row; if (canvas->focused_item == row) return TRUE; } @@ -1250,11 +1250,11 @@ click_to_add_event (ETableClickToAdd *etcta, GdkEventKey *key, ETable *etable) case GDK_ISO_Left_Tab: if (key->state & GDK_CONTROL_MASK) { if (etable->group) { - if (e_table_model_row_count(etable->model) > 0) + if (e_table_model_row_count (etable->model) > 0) focus_first_etable_item (etable->group); else gtk_widget_child_focus ( - gtk_widget_get_toplevel(GTK_WIDGET(etable->table_canvas)), GTK_DIR_TAB_FORWARD); + gtk_widget_get_toplevel (GTK_WIDGET (etable->table_canvas)), GTK_DIR_TAB_FORWARD); break; } } @@ -1316,9 +1316,9 @@ e_table_setup_table (ETable *e_table, ETableHeader *full_header, ETableHeader *h gtk_widget_show (widget); - e_table->white_item = gnome_canvas_item_new( - gnome_canvas_root(e_table->table_canvas), - e_canvas_background_get_type(), + e_table->white_item = gnome_canvas_item_new ( + gnome_canvas_root (e_table->table_canvas), + e_canvas_background_get_type (), "fill_color_gdk", &style->base[GTK_STATE_NORMAL], NULL); @@ -1326,14 +1326,14 @@ e_table_setup_table (ETable *e_table, ETableHeader *full_header, ETableHeader *h G_CALLBACK (white_item_event), e_table); g_signal_connect (G_OBJECT(e_table->table_canvas), "realize", - G_CALLBACK(et_canvas_realize), e_table); + G_CALLBACK (et_canvas_realize), e_table); g_signal_connect (G_OBJECT(gnome_canvas_root (e_table->table_canvas)), "event", - G_CALLBACK(et_canvas_root_event), e_table); + G_CALLBACK (et_canvas_root_event), e_table); - e_table->canvas_vbox = gnome_canvas_item_new( - gnome_canvas_root(e_table->table_canvas), - e_canvas_vbox_get_type(), + e_table->canvas_vbox = gnome_canvas_item_new ( + gnome_canvas_root (e_table->table_canvas), + e_canvas_vbox_get_type (), "spacing", 10.0, NULL); @@ -1341,11 +1341,11 @@ e_table_setup_table (ETable *e_table, ETableHeader *full_header, ETableHeader *h G_OBJECT (e_table->canvas_vbox), "event", G_CALLBACK (canvas_vbox_event), e_table); - et_build_groups(e_table); + et_build_groups (e_table); if (e_table->use_click_to_add) { e_table->click_to_add = gnome_canvas_item_new ( - GNOME_CANVAS_GROUP(e_table->canvas_vbox), + GNOME_CANVAS_GROUP (e_table->canvas_vbox), e_table_click_to_add_get_type (), "header", e_table->header, "model", e_table->model, @@ -1354,11 +1354,11 @@ e_table_setup_table (ETable *e_table, ETableHeader *full_header, ETableHeader *h if (e_table->use_click_to_add_end) e_canvas_vbox_add_item ( - E_CANVAS_VBOX(e_table->canvas_vbox), + E_CANVAS_VBOX (e_table->canvas_vbox), e_table->click_to_add); else e_canvas_vbox_add_item_start ( - E_CANVAS_VBOX(e_table->canvas_vbox), + E_CANVAS_VBOX (e_table->canvas_vbox), e_table->click_to_add); g_signal_connect ( @@ -1386,7 +1386,7 @@ e_table_fill_table (ETable *e_table, ETableModel *model) * **/ void -e_table_set_state_object(ETable *e_table, ETableState *state) +e_table_set_state_object (ETable *e_table, ETableState *state) { GValue *val; GtkWidget *widget; @@ -1411,10 +1411,10 @@ e_table_set_state_object(ETable *e_table, ETableState *state) if (e_table->sort_info_change_id) g_signal_handler_disconnect (G_OBJECT (e_table->sort_info), e_table->sort_info_change_id); - g_object_unref(e_table->sort_info); + g_object_unref (e_table->sort_info); } if (state->sort_info) { - e_table->sort_info = e_table_sort_info_duplicate(state->sort_info); + e_table->sort_info = e_table_sort_info_duplicate (state->sort_info); e_table_sort_info_set_can_group (e_table->sort_info, e_table->allow_grouping); e_table->group_info_change_id = g_signal_connect (G_OBJECT (e_table->sort_info), "group_info_changed", @@ -1427,16 +1427,16 @@ e_table_set_state_object(ETable *e_table, ETableState *state) e_table->sort_info = NULL; if (e_table->sorter) - g_object_set(e_table->sorter, + g_object_set (e_table->sorter, "sort_info", e_table->sort_info, NULL); if (e_table->header_item) - g_object_set(e_table->header_item, + g_object_set (e_table->header_item, "ETableHeader", e_table->header, "sort_info", e_table->sort_info, NULL); if (e_table->click_to_add) - g_object_set(e_table->click_to_add, + g_object_set (e_table->click_to_add, "header", e_table->header, NULL); @@ -1461,17 +1461,17 @@ e_table_set_state (ETable *e_table, { ETableState *state; - g_return_if_fail(e_table != NULL); - g_return_if_fail(E_IS_TABLE(e_table)); - g_return_if_fail(state_str != NULL); + g_return_if_fail (e_table != NULL); + g_return_if_fail (E_IS_TABLE (e_table)); + g_return_if_fail (state_str != NULL); - state = e_table_state_new(); - e_table_state_load_from_string(state, state_str); + state = e_table_state_new (); + e_table_state_load_from_string (state, state_str); if (state->col_count > 0) - e_table_set_state_object(e_table, state); + e_table_set_state_object (e_table, state); - g_object_unref(state); + g_object_unref (state); } /** @@ -1488,17 +1488,17 @@ e_table_load_state (ETable *e_table, { ETableState *state; - g_return_if_fail(e_table != NULL); - g_return_if_fail(E_IS_TABLE(e_table)); - g_return_if_fail(filename != NULL); + g_return_if_fail (e_table != NULL); + g_return_if_fail (E_IS_TABLE (e_table)); + g_return_if_fail (filename != NULL); - state = e_table_state_new(); - e_table_state_load_from_file(state, filename); + state = e_table_state_new (); + e_table_state_load_from_file (state, filename); if (state->col_count > 0) - e_table_set_state_object(e_table, state); + e_table_set_state_object (e_table, state); - g_object_unref(state); + g_object_unref (state); } /** @@ -1518,21 +1518,21 @@ e_table_get_state_object (ETable *e_table) gint full_col_count; gint i, j; - state = e_table_state_new(); + state = e_table_state_new (); if (state->sort_info) g_object_unref (state->sort_info); state->sort_info = e_table->sort_info; - g_object_ref(state->sort_info); + g_object_ref (state->sort_info); state->col_count = e_table_header_count (e_table->header); full_col_count = e_table_header_count (e_table->full_header); - state->columns = g_new(int, state->col_count); - state->expansions = g_new(double, state->col_count); + state->columns = g_new (int, state->col_count); + state->expansions = g_new (double, state->col_count); for (i = 0; i < state->col_count; i++) { - ETableCol *col = e_table_header_get_column(e_table->header, i); + ETableCol *col = e_table_header_get_column (e_table->header, i); state->columns[i] = -1; for (j = 0; j < full_col_count; j++) { - if (col->col_idx == e_table_header_index(e_table->full_header, j)) { + if (col->col_idx == e_table_header_index (e_table->full_header, j)) { state->columns[i] = j; break; } @@ -1558,9 +1558,9 @@ gchar *e_table_get_state (ETable *e_table ETableState *state; gchar *string; - state = e_table_get_state_object(e_table); - string = e_table_state_save_to_string(state); - g_object_unref(state); + state = e_table_get_state_object (e_table); + string = e_table_state_save_to_string (state); + g_object_unref (state); return string; } @@ -1579,21 +1579,21 @@ e_table_save_state (ETable *e_table, { ETableState *state; - state = e_table_get_state_object(e_table); - e_table_state_save_to_file(state, filename); - g_object_unref(state); + state = e_table_get_state_object (e_table); + e_table_state_save_to_file (state, filename); + g_object_unref (state); } static void et_selection_model_selection_changed (ETableGroup *etg, ETable *et) { - g_signal_emit (G_OBJECT (et), et_signals [SELECTION_CHANGE], 0); + g_signal_emit (G_OBJECT (et), et_signals[SELECTION_CHANGE], 0); } static void et_selection_model_selection_row_changed (ETableGroup *etg, gint row, ETable *et) { - g_signal_emit (G_OBJECT (et), et_signals [SELECTION_CHANGE], 0); + g_signal_emit (G_OBJECT (et), et_signals[SELECTION_CHANGE], 0); } static ETable * @@ -1610,9 +1610,9 @@ et_real_construct (ETable *e_table, ETableModel *etm, ETableExtras *ete, g_value_init (val, G_TYPE_OBJECT); if (ete) - g_object_ref(ete); + g_object_ref (ete); else { - ete = e_table_extras_new(); + ete = e_table_extras_new (); } e_table->domain = g_strdup (specification->domain); @@ -1627,12 +1627,12 @@ et_real_construct (ETable *e_table, ETableModel *etm, ETableExtras *ete, e_table->vertical_draw_grid = specification->vertical_draw_grid; e_table->draw_focus = specification->draw_focus; e_table->cursor_mode = specification->cursor_mode; - e_table->full_header = e_table_spec_to_full_header(specification, ete); + e_table->full_header = e_table_spec_to_full_header (specification, ete); g_object_ref (e_table->full_header); col_count = e_table_header_count (e_table->full_header); for (i = 0; i < col_count; i++) { - ETableCol *col = e_table_header_get_column(e_table->full_header, i); + ETableCol *col = e_table_header_get_column (e_table->full_header, i); if (col && col->search) { e_table->current_search_col = col; e_table->search_col_set = TRUE; @@ -1666,7 +1666,7 @@ et_real_construct (ETable *e_table, ETableModel *etm, ETableExtras *ete, g_object_set_property (G_OBJECT(e_table->header), "sort_info", val); g_free (val); - e_table->sorter = e_table_sorter_new(etm, e_table->full_header, e_table->sort_info); + e_table->sorter = e_table_sorter_new (etm, e_table->full_header, e_table->sort_info); g_object_set (e_table->selection, "model", etm, @@ -1711,7 +1711,7 @@ et_real_construct (ETable *e_table, ETableModel *etm, ETableExtras *ete, gtk_widget_pop_colormap (); - g_object_unref(ete); + g_object_unref (ete); return e_table; } @@ -1737,40 +1737,40 @@ e_table_construct (ETable *e_table, ETableModel *etm, ETableExtras *ete, ETableSpecification *specification; ETableState *state; - g_return_val_if_fail(e_table != NULL, NULL); - g_return_val_if_fail(E_IS_TABLE(e_table), NULL); - g_return_val_if_fail(etm != NULL, NULL); - g_return_val_if_fail(E_IS_TABLE_MODEL(etm), NULL); - g_return_val_if_fail(ete == NULL || E_IS_TABLE_EXTRAS(ete), NULL); - g_return_val_if_fail(spec_str != NULL, NULL); + g_return_val_if_fail (e_table != NULL, NULL); + g_return_val_if_fail (E_IS_TABLE (e_table), NULL); + g_return_val_if_fail (etm != NULL, NULL); + g_return_val_if_fail (E_IS_TABLE_MODEL (etm), NULL); + g_return_val_if_fail (ete == NULL || E_IS_TABLE_EXTRAS (ete), NULL); + g_return_val_if_fail (spec_str != NULL, NULL); g_object_ref (etm); - specification = e_table_specification_new(); + specification = e_table_specification_new (); g_object_ref (specification); - if (!e_table_specification_load_from_string(specification, spec_str)) { - g_object_unref(specification); + if (!e_table_specification_load_from_string (specification, spec_str)) { + g_object_unref (specification); return NULL; } if (state_str) { - state = e_table_state_new(); + state = e_table_state_new (); g_object_ref (state); - e_table_state_load_from_string(state, state_str); + e_table_state_load_from_string (state, state_str); if (state->col_count <= 0) { - g_object_unref(state); + g_object_unref (state); state = specification->state; - g_object_ref(state); + g_object_ref (state); } } else { state = specification->state; - g_object_ref(state); + g_object_ref (state); } e_table = et_real_construct (e_table, etm, ete, specification, state); e_table->spec = specification; - g_object_unref(state); + g_object_unref (state); return e_table; } @@ -1797,40 +1797,40 @@ e_table_construct_from_spec_file (ETable *e_table, ETableModel *etm, ETableExtra ETableSpecification *specification; ETableState *state; - g_return_val_if_fail(e_table != NULL, NULL); - g_return_val_if_fail(E_IS_TABLE(e_table), NULL); - g_return_val_if_fail(etm != NULL, NULL); - g_return_val_if_fail(E_IS_TABLE_MODEL(etm), NULL); - g_return_val_if_fail(ete == NULL || E_IS_TABLE_EXTRAS(ete), NULL); - g_return_val_if_fail(spec_fn != NULL, NULL); + g_return_val_if_fail (e_table != NULL, NULL); + g_return_val_if_fail (E_IS_TABLE (e_table), NULL); + g_return_val_if_fail (etm != NULL, NULL); + g_return_val_if_fail (E_IS_TABLE_MODEL (etm), NULL); + g_return_val_if_fail (ete == NULL || E_IS_TABLE_EXTRAS (ete), NULL); + g_return_val_if_fail (spec_fn != NULL, NULL); - specification = e_table_specification_new(); - if (!e_table_specification_load_from_file(specification, spec_fn)) { - g_object_unref(specification); + specification = e_table_specification_new (); + if (!e_table_specification_load_from_file (specification, spec_fn)) { + g_object_unref (specification); return NULL; } if (state_fn) { - state = e_table_state_new(); - if (!e_table_state_load_from_file(state, state_fn)) { - g_object_unref(state); + state = e_table_state_new (); + if (!e_table_state_load_from_file (state, state_fn)) { + g_object_unref (state); state = specification->state; - g_object_ref(state); + g_object_ref (state); } if (state->col_count <= 0) { - g_object_unref(state); + g_object_unref (state); state = specification->state; - g_object_ref(state); + g_object_ref (state); } } else { state = specification->state; - g_object_ref(state); + g_object_ref (state); } e_table = et_real_construct (e_table, etm, ete, specification, state); e_table->spec = specification; - g_object_unref(state); + g_object_unref (state); return e_table; } @@ -1864,10 +1864,10 @@ e_table_new (ETableModel *etm, { ETable *e_table; - g_return_val_if_fail(etm != NULL, NULL); - g_return_val_if_fail(E_IS_TABLE_MODEL(etm), NULL); - g_return_val_if_fail(ete == NULL || E_IS_TABLE_EXTRAS(ete), NULL); - g_return_val_if_fail(spec != NULL, NULL); + g_return_val_if_fail (etm != NULL, NULL); + g_return_val_if_fail (E_IS_TABLE_MODEL (etm), NULL); + g_return_val_if_fail (ete == NULL || E_IS_TABLE_EXTRAS (ete), NULL); + g_return_val_if_fail (spec != NULL, NULL); e_table = g_object_new (E_TABLE_TYPE, NULL); @@ -1904,10 +1904,10 @@ e_table_new_from_spec_file (ETableModel *etm, { ETable *e_table; - g_return_val_if_fail(etm != NULL, NULL); - g_return_val_if_fail(E_IS_TABLE_MODEL(etm), NULL); - g_return_val_if_fail(ete == NULL || E_IS_TABLE_EXTRAS(ete), NULL); - g_return_val_if_fail(spec_fn != NULL, NULL); + g_return_val_if_fail (etm != NULL, NULL); + g_return_val_if_fail (E_IS_TABLE_MODEL (etm), NULL); + g_return_val_if_fail (ete == NULL || E_IS_TABLE_EXTRAS (ete), NULL); + g_return_val_if_fail (spec_fn != NULL, NULL); e_table = g_object_new (E_TABLE_TYPE, NULL); @@ -1949,7 +1949,7 @@ et_build_grouping_spec (ETable *e_table) node = grouping; for (i = 0; i < group_count; i++) { - ETableSortColumn column = e_table_sort_info_grouping_get_nth(e_table->sort_info, i); + ETableSortColumn column = e_table_sort_info_grouping_get_nth (e_table->sort_info, i); xmlNode *new_node = xmlNewChild(node, NULL, "group", NULL); e_xml_set_integer_prop_by_name (new_node, "column", column.column); @@ -1958,7 +1958,7 @@ et_build_grouping_spec (ETable *e_table) } for (i = 0; i < sort_count; i++) { - ETableSortColumn column = e_table_sort_info_sorting_get_nth(e_table->sort_info, i); + ETableSortColumn column = e_table_sort_info_sorting_get_nth (e_table->sort_info, i); xmlNode *new_node = xmlNewChild(node, NULL, "leaf", NULL); e_xml_set_integer_prop_by_name (new_node, "column", column.column); @@ -1994,8 +1994,8 @@ e_table_get_specification (ETable *e_table) xmlChar *buffer; gint size; - g_return_val_if_fail(e_table != NULL, NULL); - g_return_val_if_fail(E_IS_TABLE(e_table), NULL); + g_return_val_if_fail (e_table != NULL, NULL); + g_return_val_if_fail (E_IS_TABLE (e_table), NULL); doc = et_build_tree (e_table); xmlDocDumpMemory (doc, &buffer, &size); @@ -2010,13 +2010,13 @@ e_table_set_specification (ETable *e_table, const gchar *spec) xmlDoc *xmlSpec; 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); + 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 ((gchar *)spec, strlen(spec)); - ret = et_real_set_specification(e_table, xmlSpec); + xmlSpec = xmlParseMemory ((gchar *)spec, strlen (spec)); + ret = et_real_set_specification (e_table, xmlSpec); xmlFreeDoc (xmlSpec); return ret; @@ -2027,9 +2027,9 @@ e_table_save_specification (ETable *e_table, const gchar *filename) { xmlDoc *doc = et_build_tree (e_table); - g_return_if_fail(e_table != NULL); - g_return_if_fail(E_IS_TABLE(e_table)); - g_return_if_fail(filename != NULL); + g_return_if_fail (e_table != NULL); + g_return_if_fail (E_IS_TABLE (e_table)); + g_return_if_fail (filename != NULL); e_xml_save_file (filename, doc); @@ -2042,9 +2042,9 @@ e_table_load_specification (ETable *e_table, gchar *filename) xmlDoc *xmlSpec; 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(filename != NULL, -1); + 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 (filename != NULL, -1); /* doesn't work yet, yay */ #ifdef G_OS_WIN32 @@ -2056,7 +2056,7 @@ e_table_load_specification (ETable *e_table, gchar *filename) #else xmlSpec = xmlParseFile (filename); #endif - ret = et_real_set_specification(e_table, xmlSpec); + ret = et_real_set_specification (e_table, xmlSpec); xmlFreeDoc (xmlSpec); return ret; @@ -2073,11 +2073,11 @@ e_table_load_specification (ETable *e_table, gchar *filename) void 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)); - g_return_if_fail(row >= 0); + g_return_if_fail (e_table != NULL); + g_return_if_fail (E_IS_TABLE (e_table)); + g_return_if_fail (row >= 0); - g_object_set(e_table->selection, + g_object_set (e_table->selection, "cursor_row", row, NULL); } @@ -2095,10 +2095,10 @@ gint e_table_get_cursor_row (ETable *e_table) { gint row; - 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 (e_table != NULL, -1); + g_return_val_if_fail (E_IS_TABLE (e_table), -1); - g_object_get(e_table->selection, + g_object_get (e_table->selection, "cursor_row", &row, NULL); return row; @@ -2122,10 +2122,10 @@ e_table_selected_row_foreach (ETable *e_table, EForeachFunc callback, gpointer closure) { - g_return_if_fail(e_table != NULL); - g_return_if_fail(E_IS_TABLE(e_table)); + g_return_if_fail (e_table != NULL); + g_return_if_fail (E_IS_TABLE (e_table)); - e_selection_model_foreach(E_SELECTION_MODEL (e_table->selection), + e_selection_model_foreach (E_SELECTION_MODEL (e_table->selection), callback, closure); } @@ -2142,10 +2142,10 @@ e_table_selected_row_foreach (ETable *e_table, gint e_table_selected_count (ETable *e_table) { - 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 (e_table != NULL, -1); + g_return_val_if_fail (E_IS_TABLE (e_table), -1); - return e_selection_model_selected_count(E_SELECTION_MODEL (e_table->selection)); + return e_selection_model_selected_count (E_SELECTION_MODEL (e_table->selection)); } /** @@ -2190,10 +2190,10 @@ e_table_invert_selection (ETable *table) EPrintable * e_table_get_printable (ETable *e_table) { - g_return_val_if_fail(e_table != NULL, NULL); - g_return_val_if_fail(E_IS_TABLE(e_table), NULL); + g_return_val_if_fail (e_table != NULL, NULL); + g_return_val_if_fail (E_IS_TABLE (e_table), NULL); - return e_table_group_get_printable(e_table->group); + return e_table_group_get_printable (e_table->group); } /** @@ -2206,7 +2206,7 @@ e_table_get_printable (ETable *e_table) void e_table_right_click_up (ETable *table) { - e_selection_model_right_click_up(E_SELECTION_MODEL(table->selection)); + e_selection_model_right_click_up (E_SELECTION_MODEL (table->selection)); } /** @@ -2220,7 +2220,7 @@ e_table_commit_click_to_add (ETable *table) { et_eti_leave_edit (table); if (table->click_to_add) - e_table_click_to_add_commit(E_TABLE_CLICK_TO_ADD(table->click_to_add)); + e_table_click_to_add_commit (E_TABLE_CLICK_TO_ADD (table->click_to_add)); } static void @@ -2266,7 +2266,7 @@ et_set_property (GObject *object, case PROP_LENGTH_THRESHOLD: etable->length_threshold = g_value_get_int (value); if (etable->group) { - gnome_canvas_item_set (GNOME_CANVAS_ITEM(etable->group), + gnome_canvas_item_set (GNOME_CANVAS_ITEM (etable->group), "length_threshold", etable->length_threshold, NULL); } @@ -2274,7 +2274,7 @@ et_set_property (GObject *object, case PROP_UNIFORM_ROW_HEIGHT: etable->uniform_row_height = g_value_get_boolean (value); if (etable->group) { - gnome_canvas_item_set (GNOME_CANVAS_ITEM(etable->group), + gnome_canvas_item_set (GNOME_CANVAS_ITEM (etable->group), "uniform_row_height", etable->uniform_row_height, NULL); } @@ -2295,7 +2295,7 @@ et_set_property (GObject *object, if (etable->use_click_to_add) { etable->click_to_add = gnome_canvas_item_new - (GNOME_CANVAS_GROUP(etable->canvas_vbox), + (GNOME_CANVAS_GROUP (etable->canvas_vbox), e_table_click_to_add_get_type (), "header", etable->header, "model", etable->model, @@ -2303,10 +2303,10 @@ et_set_property (GObject *object, NULL); if (etable->use_click_to_add_end) - e_canvas_vbox_add_item (E_CANVAS_VBOX(etable->canvas_vbox), + e_canvas_vbox_add_item (E_CANVAS_VBOX (etable->canvas_vbox), etable->click_to_add); else - e_canvas_vbox_add_item_start (E_CANVAS_VBOX(etable->canvas_vbox), + e_canvas_vbox_add_item_start (E_CANVAS_VBOX (etable->canvas_vbox), etable->click_to_add); g_signal_connect (G_OBJECT (etable->click_to_add), "cursor_change", @@ -2332,14 +2332,14 @@ set_scroll_adjustments (ETable *table, if (table->table_canvas != NULL) { gtk_layout_set_hadjustment ( - GTK_LAYOUT(table->table_canvas), hadjustment); + GTK_LAYOUT (table->table_canvas), hadjustment); gtk_layout_set_vadjustment ( - GTK_LAYOUT(table->table_canvas), vadjustment); + GTK_LAYOUT (table->table_canvas), vadjustment); } if (table->header_canvas != NULL) gtk_layout_set_hadjustment ( - GTK_LAYOUT(table->header_canvas), hadjustment); + GTK_LAYOUT (table->header_canvas), hadjustment); } /** @@ -2357,19 +2357,19 @@ gint e_table_get_next_row (ETable *e_table, gint model_row) { - 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 (e_table != NULL, -1); + g_return_val_if_fail (E_IS_TABLE (e_table), -1); if (e_table->sorter) { gint i; - i = e_sorter_model_to_sorted(E_SORTER (e_table->sorter), model_row); + i = e_sorter_model_to_sorted (E_SORTER (e_table->sorter), model_row); i++; - if (i < e_table_model_row_count(e_table->model)) { - return e_sorter_sorted_to_model(E_SORTER (e_table->sorter), i); + if (i < e_table_model_row_count (e_table->model)) { + return e_sorter_sorted_to_model (E_SORTER (e_table->sorter), i); } else return -1; } else - if (model_row < e_table_model_row_count(e_table->model) - 1) + if (model_row < e_table_model_row_count (e_table->model) - 1) return model_row + 1; else return -1; @@ -2391,15 +2391,15 @@ gint e_table_get_prev_row (ETable *e_table, gint model_row) { - 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 (e_table != NULL, -1); + g_return_val_if_fail (E_IS_TABLE (e_table), -1); if (e_table->sorter) { gint i; - i = e_sorter_model_to_sorted(E_SORTER (e_table->sorter), model_row); + i = e_sorter_model_to_sorted (E_SORTER (e_table->sorter), model_row); i--; if (i >= 0) - return e_sorter_sorted_to_model(E_SORTER (e_table->sorter), i); + return e_sorter_sorted_to_model (E_SORTER (e_table->sorter), i); else return -1; } else @@ -2420,11 +2420,11 @@ gint e_table_model_to_view_row (ETable *e_table, gint model_row) { - 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 (e_table != NULL, -1); + g_return_val_if_fail (E_IS_TABLE (e_table), -1); if (e_table->sorter) - return e_sorter_model_to_sorted(E_SORTER (e_table->sorter), model_row); + return e_sorter_model_to_sorted (E_SORTER (e_table->sorter), model_row); else return model_row; } @@ -2443,8 +2443,8 @@ gint e_table_view_to_model_row (ETable *e_table, gint view_row) { - 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 (e_table != NULL, -1); + g_return_val_if_fail (E_IS_TABLE (e_table), -1); if (e_table->sorter) return e_sorter_sorted_to_model (E_SORTER (e_table->sorter), view_row); @@ -2669,10 +2669,10 @@ e_table_drag_get_data (ETable *table, GdkAtom target, guint32 time) { - g_return_if_fail(table != NULL); - g_return_if_fail(E_IS_TABLE(table)); + g_return_if_fail (table != NULL); + g_return_if_fail (E_IS_TABLE (table)); - gtk_drag_get_data(GTK_WIDGET(table), + gtk_drag_get_data (GTK_WIDGET (table), context, target, time); @@ -2749,8 +2749,8 @@ e_table_drag_highlight (ETable *table, void e_table_drag_unhighlight (ETable *table) { - g_return_if_fail(table != NULL); - g_return_if_fail(E_IS_TABLE(table)); + g_return_if_fail (table != NULL); + g_return_if_fail (E_IS_TABLE (table)); if (table->drop_highlight) { gtk_object_destroy (GTK_OBJECT (table->drop_highlight)); @@ -2764,10 +2764,10 @@ void e_table_drag_dest_set (ETable *table, gint n_targets, GdkDragAction actions) { - g_return_if_fail(table != NULL); - g_return_if_fail(E_IS_TABLE(table)); + g_return_if_fail (table != NULL); + g_return_if_fail (E_IS_TABLE (table)); - gtk_drag_dest_set(GTK_WIDGET(table), + gtk_drag_dest_set (GTK_WIDGET (table), flags, targets, n_targets, @@ -2779,10 +2779,10 @@ void e_table_drag_dest_set_proxy (ETable *table, GdkDragProtocol protocol, gboolean use_coordinates) { - g_return_if_fail(table != NULL); - g_return_if_fail(E_IS_TABLE(table)); + g_return_if_fail (table != NULL); + g_return_if_fail (E_IS_TABLE (table)); - gtk_drag_dest_set_proxy(GTK_WIDGET(table), + gtk_drag_dest_set_proxy (GTK_WIDGET (table), proxy_window, protocol, use_coordinates); @@ -2796,10 +2796,10 @@ void e_table_drag_dest_set_proxy (ETable *table, void e_table_drag_dest_unset (GtkWidget *widget) { - g_return_if_fail(widget != NULL); - g_return_if_fail(E_IS_TABLE(widget)); + g_return_if_fail (widget != NULL); + g_return_if_fail (E_IS_TABLE (widget)); - gtk_drag_dest_unset(widget); + gtk_drag_dest_unset (widget); } /* Source side */ @@ -2858,10 +2858,10 @@ e_table_drag_source_set (ETable *table, ETableDragSourceSite *site; GtkWidget *canvas; - g_return_if_fail(table != NULL); - g_return_if_fail(E_IS_TABLE(table)); + g_return_if_fail (table != NULL); + g_return_if_fail (E_IS_TABLE (table)); - canvas = GTK_WIDGET(table->table_canvas); + canvas = GTK_WIDGET (table->table_canvas); site = table->site; gtk_widget_add_events (canvas, @@ -2901,7 +2901,7 @@ e_table_drag_source_unset (ETable *table) ETableDragSourceSite *site; g_return_if_fail (table != NULL); - g_return_if_fail (E_IS_TABLE(table)); + g_return_if_fail (E_IS_TABLE (table)); site = table->site; @@ -2943,12 +2943,12 @@ e_table_drag_begin (ETable *table, GdkEvent *event) { g_return_val_if_fail (table != NULL, NULL); - g_return_val_if_fail (E_IS_TABLE(table), NULL); + g_return_val_if_fail (E_IS_TABLE (table), NULL); table->drag_row = row; table->drag_col = col; - return gtk_drag_begin(GTK_WIDGET(table), + return gtk_drag_begin (GTK_WIDGET (table), targets, actions, button, @@ -2960,7 +2960,7 @@ et_drag_begin (GtkWidget *widget, GdkDragContext *context, ETable *et) { - g_signal_emit (G_OBJECT (et), et_signals [TABLE_DRAG_BEGIN], 0, + g_signal_emit (G_OBJECT (et), et_signals[TABLE_DRAG_BEGIN], 0, et->drag_row, et->drag_col, context); } @@ -2969,34 +2969,34 @@ et_drag_end (GtkWidget *widget, GdkDragContext *context, ETable *et) { - g_signal_emit (G_OBJECT (et), et_signals [TABLE_DRAG_END], 0, + g_signal_emit (G_OBJECT (et), et_signals[TABLE_DRAG_END], 0, et->drag_row, et->drag_col, context); } static void -et_drag_data_get(GtkWidget *widget, +et_drag_data_get (GtkWidget *widget, GdkDragContext *context, GtkSelectionData *selection_data, guint info, guint time, ETable *et) { - g_signal_emit (G_OBJECT (et), et_signals [TABLE_DRAG_DATA_GET], 0, + g_signal_emit (G_OBJECT (et), et_signals[TABLE_DRAG_DATA_GET], 0, et->drag_row, et->drag_col, context, selection_data, info, time); } static void -et_drag_data_delete(GtkWidget *widget, +et_drag_data_delete (GtkWidget *widget, GdkDragContext *context, ETable *et) { - g_signal_emit (G_OBJECT (et), et_signals [TABLE_DRAG_DATA_DELETE], 0, + g_signal_emit (G_OBJECT (et), et_signals[TABLE_DRAG_DATA_DELETE], 0, et->drag_row, et->drag_col, context); } static gboolean -do_drag_motion(ETable *et, +do_drag_motion (ETable *et, GdkDragContext *context, gint x, gint y, @@ -3008,12 +3008,12 @@ do_drag_motion(ETable *et, e_table_get_cell_at (et, x, y, &row, &col); if (row != et->drop_row && col != et->drop_row) { - g_signal_emit (G_OBJECT (et), et_signals [TABLE_DRAG_LEAVE], 0, + g_signal_emit (G_OBJECT (et), et_signals[TABLE_DRAG_LEAVE], 0, et->drop_row, et->drop_col, context, time); } et->drop_row = row; et->drop_col = col; - g_signal_emit (G_OBJECT (et), et_signals [TABLE_DRAG_MOTION], 0, + g_signal_emit (G_OBJECT (et), et_signals[TABLE_DRAG_MOTION], 0, et->drop_row, et->drop_col, context, x, y, time, &ret_val); return ret_val; @@ -3125,12 +3125,12 @@ context_connect (ETable *et, GdkDragContext *context) } static void -et_drag_leave(GtkWidget *widget, +et_drag_leave (GtkWidget *widget, GdkDragContext *context, guint time, ETable *et) { - g_signal_emit (G_OBJECT (et), et_signals [TABLE_DRAG_LEAVE], 0, + g_signal_emit (G_OBJECT (et), et_signals[TABLE_DRAG_LEAVE], 0, et->drop_row, et->drop_col, context, time); et->drop_row = -1; et->drop_col = -1; @@ -3139,7 +3139,7 @@ et_drag_leave(GtkWidget *widget, } static gboolean -et_drag_motion(GtkWidget *widget, +et_drag_motion (GtkWidget *widget, GdkDragContext *context, gint x, gint y, @@ -3178,7 +3178,7 @@ et_drag_motion(GtkWidget *widget, } static gboolean -et_drag_drop(GtkWidget *widget, +et_drag_drop (GtkWidget *widget, GdkDragContext *context, gint x, gint y, @@ -3191,14 +3191,14 @@ et_drag_drop(GtkWidget *widget, e_table_get_cell_at (et, x, y, &row, &col); if (row != et->drop_row && col != et->drop_row) { - g_signal_emit (G_OBJECT (et), et_signals [TABLE_DRAG_LEAVE], 0, + g_signal_emit (G_OBJECT (et), et_signals[TABLE_DRAG_LEAVE], 0, et->drop_row, et->drop_col, context, time); - g_signal_emit (G_OBJECT (et), et_signals [TABLE_DRAG_MOTION], 0, + g_signal_emit (G_OBJECT (et), et_signals[TABLE_DRAG_MOTION], 0, row, col, context, x, y, time, &ret_val); } et->drop_row = row; et->drop_col = col; - g_signal_emit (G_OBJECT (et), et_signals [TABLE_DRAG_DROP], 0, + g_signal_emit (G_OBJECT (et), et_signals[TABLE_DRAG_DROP], 0, et->drop_row, et->drop_col, context, x, y, time, &ret_val); et->drop_row = -1; et->drop_col = -1; @@ -3209,7 +3209,7 @@ et_drag_drop(GtkWidget *widget, } static void -et_drag_data_received(GtkWidget *widget, +et_drag_data_received (GtkWidget *widget, GdkDragContext *context, gint x, gint y, @@ -3222,7 +3222,7 @@ et_drag_data_received(GtkWidget *widget, e_table_get_cell_at (et, x, y, &row, &col); - g_signal_emit (G_OBJECT (et), et_signals [TABLE_DRAG_DATA_RECEIVED], 0, + g_signal_emit (G_OBJECT (et), et_signals[TABLE_DRAG_DATA_RECEIVED], 0, row, col, context, x, y, selection_data, info, time); } @@ -3267,7 +3267,7 @@ e_table_class_init (ETableClass *class) class->table_drag_drop = NULL; class->table_drag_data_received = NULL; - et_signals [CURSOR_CHANGE] = + et_signals[CURSOR_CHANGE] = g_signal_new ("cursor_change", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -3276,7 +3276,7 @@ e_table_class_init (ETableClass *class) g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT); - et_signals [CURSOR_ACTIVATED] = + et_signals[CURSOR_ACTIVATED] = g_signal_new ("cursor_activated", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -3285,7 +3285,7 @@ e_table_class_init (ETableClass *class) g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT); - et_signals [SELECTION_CHANGE] = + et_signals[SELECTION_CHANGE] = g_signal_new ("selection_change", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -3294,7 +3294,7 @@ e_table_class_init (ETableClass *class) g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); - et_signals [DOUBLE_CLICK] = + et_signals[DOUBLE_CLICK] = g_signal_new ("double_click", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -3304,7 +3304,7 @@ e_table_class_init (ETableClass *class) G_TYPE_NONE, 3, G_TYPE_INT, G_TYPE_INT, GDK_TYPE_EVENT); - et_signals [RIGHT_CLICK] = + et_signals[RIGHT_CLICK] = g_signal_new ("right_click", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -3314,7 +3314,7 @@ e_table_class_init (ETableClass *class) G_TYPE_BOOLEAN, 3, G_TYPE_INT, G_TYPE_INT, GDK_TYPE_EVENT); - et_signals [CLICK] = + et_signals[CLICK] = g_signal_new ("click", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -3324,7 +3324,7 @@ e_table_class_init (ETableClass *class) G_TYPE_BOOLEAN, 3, G_TYPE_INT, G_TYPE_INT, GDK_TYPE_EVENT); - et_signals [KEY_PRESS] = + et_signals[KEY_PRESS] = g_signal_new ("key_press", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -3334,7 +3334,7 @@ e_table_class_init (ETableClass *class) G_TYPE_BOOLEAN, 3, G_TYPE_INT, G_TYPE_INT, GDK_TYPE_EVENT); - et_signals [START_DRAG] = + et_signals[START_DRAG] = g_signal_new ("start_drag", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -3344,7 +3344,7 @@ e_table_class_init (ETableClass *class) G_TYPE_BOOLEAN, 3, G_TYPE_INT, G_TYPE_INT, GDK_TYPE_EVENT); - et_signals [STATE_CHANGE] = + et_signals[STATE_CHANGE] = g_signal_new ("state_change", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -3353,7 +3353,7 @@ e_table_class_init (ETableClass *class) g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); - et_signals [WHITE_SPACE_EVENT] = + et_signals[WHITE_SPACE_EVENT] = g_signal_new ("white_space_event", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, diff --git a/widgets/table/e-tree-memory-callbacks.c b/widgets/table/e-tree-memory-callbacks.c index dc7c28804b..daf3bc7c13 100644 --- a/widgets/table/e-tree-memory-callbacks.c +++ b/widgets/table/e-tree-memory-callbacks.c @@ -34,7 +34,7 @@ G_DEFINE_TYPE (ETreeMemoryCallbacks, e_tree_memory_callbacks, E_TREE_MEMORY_TYPE static GdkPixbuf * etmc_icon_at (ETreeModel *etm, ETreePath node) { - ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm); + ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); return etmc->icon_at (etm, node, etmc->model_data); } @@ -42,7 +42,7 @@ etmc_icon_at (ETreeModel *etm, ETreePath node) static gint etmc_column_count (ETreeModel *etm) { - ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm); + ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); if (etmc->column_count) return etmc->column_count (etm, etmc->model_data); @@ -53,7 +53,7 @@ etmc_column_count (ETreeModel *etm) static gboolean etmc_has_save_id (ETreeModel *etm) { - ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm); + ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); if (etmc->has_save_id) return etmc->has_save_id (etm, etmc->model_data); @@ -64,7 +64,7 @@ etmc_has_save_id (ETreeModel *etm) static gchar * etmc_get_save_id (ETreeModel *etm, ETreePath node) { - ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm); + ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); if (etmc->get_save_id) return etmc->get_save_id (etm, node, etmc->model_data); @@ -75,7 +75,7 @@ etmc_get_save_id (ETreeModel *etm, ETreePath node) static gboolean etmc_has_get_node_by_id (ETreeModel *etm) { - ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm); + ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); if (etmc->has_get_node_by_id) return etmc->has_get_node_by_id (etm, etmc->model_data); @@ -86,7 +86,7 @@ etmc_has_get_node_by_id (ETreeModel *etm) static ETreePath etmc_get_node_by_id (ETreeModel *etm, const gchar *save_id) { - ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm); + ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); if (etmc->get_node_by_id) return etmc->get_node_by_id (etm, save_id, etmc->model_data); @@ -97,7 +97,7 @@ etmc_get_node_by_id (ETreeModel *etm, const gchar *save_id) static gpointer etmc_sort_value_at (ETreeModel *etm, ETreePath node, gint col) { - ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm); + ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); if (etmc->sort_value_at) return etmc->sort_value_at (etm, node, col, etmc->model_data); @@ -108,7 +108,7 @@ etmc_sort_value_at (ETreeModel *etm, ETreePath node, gint col) static gpointer etmc_value_at (ETreeModel *etm, ETreePath node, gint col) { - ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm); + ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); return etmc->value_at (etm, node, col, etmc->model_data); } @@ -116,7 +116,7 @@ etmc_value_at (ETreeModel *etm, ETreePath node, gint col) static void etmc_set_value_at (ETreeModel *etm, ETreePath node, gint col, gconstpointer val) { - ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm); + ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); etmc->set_value_at (etm, node, col, val, etmc->model_data); } @@ -124,7 +124,7 @@ etmc_set_value_at (ETreeModel *etm, ETreePath node, gint col, gconstpointer val) static gboolean etmc_is_editable (ETreeModel *etm, ETreePath node, gint col) { - ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm); + ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); return etmc->is_editable (etm, node, col, etmc->model_data); } @@ -133,7 +133,7 @@ etmc_is_editable (ETreeModel *etm, ETreePath node, gint col) static gpointer etmc_duplicate_value (ETreeModel *etm, gint col, gconstpointer value) { - ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm); + ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); if (etmc->duplicate_value) return etmc->duplicate_value (etm, col, value, etmc->model_data); @@ -144,7 +144,7 @@ etmc_duplicate_value (ETreeModel *etm, gint col, gconstpointer value) static void etmc_free_value (ETreeModel *etm, gint col, gpointer value) { - ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm); + ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); if (etmc->free_value) etmc->free_value (etm, col, value, etmc->model_data); @@ -153,7 +153,7 @@ etmc_free_value (ETreeModel *etm, gint col, gpointer value) static gpointer etmc_initialize_value (ETreeModel *etm, gint col) { - ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm); + ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); if (etmc->initialize_value) return etmc->initialize_value (etm, col, etmc->model_data); @@ -164,7 +164,7 @@ etmc_initialize_value (ETreeModel *etm, gint col) static gboolean etmc_value_is_empty (ETreeModel *etm, gint col, gconstpointer value) { - ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm); + ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); if (etmc->value_is_empty) return etmc->value_is_empty (etm, col, value, etmc->model_data); @@ -175,7 +175,7 @@ etmc_value_is_empty (ETreeModel *etm, gint col, gconstpointer value) static gchar * etmc_value_to_string (ETreeModel *etm, gint col, gconstpointer value) { - ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm); + ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); if (etmc->value_to_string) return etmc->value_to_string (etm, col, value, etmc->model_data); diff --git a/widgets/table/e-tree-memory.c b/widgets/table/e-tree-memory.c index 13103fc47a..71dc0cbae0 100644 --- a/widgets/table/e-tree-memory.c +++ b/widgets/table/e-tree-memory.c @@ -44,7 +44,7 @@ enum { LAST_SIGNAL }; -static guint signals [LAST_SIGNAL] = { 0, }; +static guint signals[LAST_SIGNAL] = { 0, }; typedef struct ETreeMemoryPath ETreeMemoryPath; @@ -93,7 +93,7 @@ e_tree_memory_path_depth (ETreeMemoryPath *path) { gint depth = 0; - g_return_val_if_fail(path != NULL, -1); + g_return_val_if_fail (path != NULL, -1); for ( path = path->parent; path; path = path->parent) depth++; @@ -178,12 +178,12 @@ e_tree_path_unlink (ETreeMemoryPath *path) * **/ void -e_tree_memory_freeze(ETreeMemory *etmm) +e_tree_memory_freeze (ETreeMemory *etmm) { ETreeMemoryPriv *priv = etmm->priv; if (priv->frozen == 0) - e_tree_model_pre_change(E_TREE_MODEL(etmm)); + e_tree_model_pre_change (E_TREE_MODEL (etmm)); priv->frozen++; } @@ -198,14 +198,14 @@ e_tree_memory_freeze(ETreeMemory *etmm) * **/ void -e_tree_memory_thaw(ETreeMemory *etmm) +e_tree_memory_thaw (ETreeMemory *etmm) { ETreeMemoryPriv *priv = etmm->priv; if (priv->frozen > 0) priv->frozen--; if (priv->frozen == 0) { - e_tree_model_node_changed(E_TREE_MODEL(etmm), priv->root); + e_tree_model_node_changed (E_TREE_MODEL (etmm), priv->root); } } @@ -234,7 +234,7 @@ etmm_dispose (GObject *object) static ETreePath etmm_get_root (ETreeModel *etm) { - ETreeMemoryPriv *priv = E_TREE_MEMORY(etm)->priv; + ETreeMemoryPriv *priv = E_TREE_MEMORY (etm)->priv; return priv->root; } @@ -319,7 +319,7 @@ etmm_get_children (ETreeModel *etm, ETreePath node, ETreePath **nodes) static guint etmm_depth (ETreeModel *etm, ETreePath path) { - return e_tree_memory_path_depth(path); + return e_tree_memory_path_depth (path); } static gboolean @@ -358,7 +358,7 @@ e_tree_memory_class_init (ETreeMemoryClass *klass) ETreeModelClass *tree_class = (ETreeModelClass *) klass; GObjectClass *object_class = (GObjectClass *) klass; - signals [FILL_IN_CHILDREN] = + signals[FILL_IN_CHILDREN] = g_signal_new ("fill_in_children", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, @@ -499,7 +499,7 @@ e_tree_memory_node_insert (ETreeMemory *tree_model, ETreeMemoryPath *new_path; ETreeMemoryPath *parent_path = parent_node; - g_return_val_if_fail(tree_model != NULL, NULL); + g_return_val_if_fail (tree_model != NULL, NULL); priv = tree_model->priv; @@ -508,7 +508,7 @@ e_tree_memory_node_insert (ETreeMemory *tree_model, priv = tree_model->priv; if (!tree_model->priv->frozen) - e_tree_model_pre_change(E_TREE_MODEL(tree_model)); + e_tree_model_pre_change (E_TREE_MODEL (tree_model)); new_path = g_slice_new0 (ETreeMemoryPath); @@ -518,11 +518,11 @@ e_tree_memory_node_insert (ETreeMemory *tree_model, if (parent_path != NULL) { e_tree_memory_path_insert (parent_path, position, new_path); if (!tree_model->priv->frozen) - e_tree_model_node_inserted (E_TREE_MODEL(tree_model), parent_path, new_path); + e_tree_model_node_inserted (E_TREE_MODEL (tree_model), parent_path, new_path); } else { priv->root = new_path; if (!tree_model->priv->frozen) - e_tree_model_node_changed(E_TREE_MODEL(tree_model), new_path); + e_tree_model_node_changed (E_TREE_MODEL (tree_model), new_path); } return new_path; @@ -560,7 +560,7 @@ e_tree_memory_node_insert_before (ETreeMemory *etree, ETreeMemoryPath *sibling_path = sibling; gint position = 0; - g_return_val_if_fail(etree != NULL, NULL); + g_return_val_if_fail (etree != NULL, NULL); if (sibling != NULL) { for (child = parent_path->first_child; child; child = child->next_sibling) { @@ -575,14 +575,14 @@ e_tree_memory_node_insert_before (ETreeMemory *etree, /* just blows away child data, doesn't take into account unlinking/etc */ static void -child_free(ETreeMemory *etree, ETreeMemoryPath *node) +child_free (ETreeMemory *etree, ETreeMemoryPath *node) { ETreeMemoryPath *child, *next; child = node->first_child; while (child) { next = child->next_sibling; - child_free(etree, child); + child_free (etree, child); child = next; } @@ -611,10 +611,10 @@ e_tree_memory_node_remove (ETreeMemory *etree, ETreePath node) gpointer ret = path->node_data; gint old_position = 0; - g_return_val_if_fail(etree != NULL, NULL); + g_return_val_if_fail (etree != NULL, NULL); if (!etree->priv->frozen) { - e_tree_model_pre_change(E_TREE_MODEL(etree)); + e_tree_model_pre_change (E_TREE_MODEL (etree)); for (old_position = 0, sibling = path; sibling; old_position++, sibling = sibling->prev_sibling) @@ -628,15 +628,15 @@ e_tree_memory_node_remove (ETreeMemory *etree, ETreePath node) /*printf("removing %d nodes from position %d\n", visible, base);*/ if (!etree->priv->frozen) - e_tree_model_node_removed(E_TREE_MODEL(etree), parent, path, old_position); + e_tree_model_node_removed (E_TREE_MODEL (etree), parent, path, old_position); - child_free(etree, path); + child_free (etree, path); if (path == etree->priv->root) etree->priv->root = NULL; if (!etree->priv->frozen) - e_tree_model_node_deleted(E_TREE_MODEL(etree), path); + e_tree_model_node_deleted (E_TREE_MODEL (etree), path); return ret; } @@ -648,7 +648,7 @@ typedef struct { } MemoryAndClosure; static gint -sort_callback(gconstpointer data1, gconstpointer data2, gpointer user_data) +sort_callback (gconstpointer data1, gconstpointer data2, gpointer user_data) { ETreePath path1 = *(ETreePath *)data1; ETreePath path2 = *(ETreePath *)data2; @@ -676,7 +676,7 @@ e_tree_memory_sort_node (ETreeMemory *etmm, for (child = path->first_child; child; child = child->next_sibling) i++; - children = g_new(ETreeMemoryPath *, i); + children = g_new (ETreeMemoryPath *, i); count = i; @@ -711,9 +711,9 @@ e_tree_memory_sort_node (ETreeMemory *etmm, path->last_child = last; - g_free(children); + g_free (children); - e_tree_model_node_changed(E_TREE_MODEL(etmm), node); + e_tree_model_node_changed (E_TREE_MODEL (etmm), node); } void diff --git a/widgets/table/e-tree-model.c b/widgets/table/e-tree-model.c index 9a06feac10..0c346c6ec9 100644 --- a/widgets/table/e-tree-model.c +++ b/widgets/table/e-tree-model.c @@ -57,7 +57,7 @@ enum { LAST_SIGNAL }; -static guint e_tree_model_signals [LAST_SIGNAL] = {0, }; +static guint e_tree_model_signals[LAST_SIGNAL] = {0, }; static void @@ -65,7 +65,7 @@ e_tree_model_class_init (ETreeModelClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - e_tree_model_signals [PRE_CHANGE] = + e_tree_model_signals[PRE_CHANGE] = g_signal_new ("pre_change", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, @@ -74,7 +74,7 @@ e_tree_model_class_init (ETreeModelClass *klass) g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); - e_tree_model_signals [NO_CHANGE] = + e_tree_model_signals[NO_CHANGE] = g_signal_new ("no_change", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, @@ -83,7 +83,7 @@ e_tree_model_class_init (ETreeModelClass *klass) g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); - e_tree_model_signals [REBUILT] = + e_tree_model_signals[REBUILT] = g_signal_new ("rebuilt", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, @@ -92,7 +92,7 @@ e_tree_model_class_init (ETreeModelClass *klass) g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); - e_tree_model_signals [NODE_CHANGED] = + e_tree_model_signals[NODE_CHANGED] = g_signal_new ("node_changed", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, @@ -101,7 +101,7 @@ e_tree_model_class_init (ETreeModelClass *klass) g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_POINTER); - e_tree_model_signals [NODE_DATA_CHANGED] = + e_tree_model_signals[NODE_DATA_CHANGED] = g_signal_new ("node_data_changed", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, @@ -110,7 +110,7 @@ e_tree_model_class_init (ETreeModelClass *klass) g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_POINTER); - e_tree_model_signals [NODE_COL_CHANGED] = + e_tree_model_signals[NODE_COL_CHANGED] = g_signal_new ("node_col_changed", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, @@ -119,7 +119,7 @@ e_tree_model_class_init (ETreeModelClass *klass) e_marshal_VOID__POINTER_INT, G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_INT); - e_tree_model_signals [NODE_INSERTED] = + e_tree_model_signals[NODE_INSERTED] = g_signal_new ("node_inserted", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, @@ -128,7 +128,7 @@ e_tree_model_class_init (ETreeModelClass *klass) e_marshal_VOID__POINTER_POINTER, G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_POINTER); - e_tree_model_signals [NODE_REMOVED] = + e_tree_model_signals[NODE_REMOVED] = g_signal_new ("node_removed", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, @@ -137,7 +137,7 @@ e_tree_model_class_init (ETreeModelClass *klass) e_marshal_VOID__POINTER_POINTER_INT, G_TYPE_NONE, 3, G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_INT); - e_tree_model_signals [NODE_DELETED] = + e_tree_model_signals[NODE_DELETED] = g_signal_new ("node_deleted", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, @@ -146,7 +146,7 @@ e_tree_model_class_init (ETreeModelClass *klass) g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_POINTER); - e_tree_model_signals [NODE_REQUEST_COLLAPSE] = + e_tree_model_signals[NODE_REQUEST_COLLAPSE] = g_signal_new ("node_request_collapse", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, @@ -228,7 +228,7 @@ e_tree_model_pre_change (ETreeModel *tree_model) d(g_print("Emitting pre_change on model 0x%p, a %s.\n", tree_model, g_type_name (GTK_OBJECT(tree_model)->klass->type))); - g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals [PRE_CHANGE], 0); + g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals[PRE_CHANGE], 0); } /** @@ -248,7 +248,7 @@ e_tree_model_no_change (ETreeModel *tree_model) d(g_print("Emitting no_change on model 0x%p, a %s.\n", tree_model, g_type_name (GTK_OBJECT(tree_model)->klass->type))); - g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals [NO_CHANGE], 0); + g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals[NO_CHANGE], 0); } /** @@ -268,7 +268,7 @@ e_tree_model_rebuilt (ETreeModel *tree_model) d(g_print("Emitting rebuilt on model 0x%p, a %s.\n", tree_model, g_type_name (GTK_OBJECT(tree_model)->klass->type))); - g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals [REBUILT], 0); + g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals[REBUILT], 0); } /** * e_tree_model_node_changed: @@ -287,7 +287,7 @@ e_tree_model_node_changed (ETreeModel *tree_model, ETreePath node) d(g_print("Emitting node_changed on model 0x%p, a %s.\n", tree_model, g_type_name (GTK_OBJECT(tree_model)->klass->type))); - g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals [NODE_CHANGED], 0, node); + g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals[NODE_CHANGED], 0, node); } /** @@ -307,7 +307,7 @@ e_tree_model_node_data_changed (ETreeModel *tree_model, ETreePath node) d(g_print("Emitting node_data_changed on model 0x%p, a %s.\n", tree_model, g_type_name (GTK_OBJECT(tree_model)->klass->type))); - g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals [NODE_DATA_CHANGED], 0, node); + g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals[NODE_DATA_CHANGED], 0, node); } /** @@ -327,7 +327,7 @@ e_tree_model_node_col_changed (ETreeModel *tree_model, ETreePath node, gint col d(g_print("Emitting node_col_changed on model 0x%p, a %s.\n", tree_model, g_type_name (GTK_OBJECT(tree_model)->klass->type))); - g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals [NODE_COL_CHANGED], 0, node, col); + g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals[NODE_COL_CHANGED], 0, node, col); } /** @@ -348,7 +348,7 @@ e_tree_model_node_inserted (ETreeModel *tree_model, d(g_print("Emitting node_inserted on model 0x%p, a %s.\n", tree_model, g_type_name (GTK_OBJECT(tree_model)->klass->type))); - g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals [NODE_INSERTED], 0, + g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals[NODE_INSERTED], 0, parent_node, inserted_node); } @@ -368,7 +368,7 @@ e_tree_model_node_removed (ETreeModel *tree_model, ETreePath parent_node, ETree d(g_print("Emitting node_removed on model 0x%p, a %s.\n", tree_model, g_type_name (GTK_OBJECT(tree_model)->klass->type))); - g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals [NODE_REMOVED], 0, + g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals[NODE_REMOVED], 0, parent_node, removed_node, old_position); } @@ -387,7 +387,7 @@ e_tree_model_node_deleted (ETreeModel *tree_model, ETreePath deleted_node) d(g_print("Emitting node_deleted on model 0x%p, a %s.\n", tree_model, g_type_name (GTK_OBJECT(tree_model)->klass->type))); - g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals [NODE_DELETED], 0, deleted_node); + g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals[NODE_DELETED], 0, deleted_node); } /** @@ -405,7 +405,7 @@ e_tree_model_node_request_collapse (ETreeModel *tree_model, ETreePath collapsed d(g_print("Emitting node_request_collapse on model 0x%p, a %s.\n", tree_model, g_type_name (GTK_OBJECT(tree_model)->klass->type))); - g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals [NODE_REQUEST_COLLAPSE], 0, collapsed_node); + g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals[NODE_REQUEST_COLLAPSE], 0, collapsed_node); } @@ -437,8 +437,8 @@ e_tree_model_get_root (ETreeModel *etree) g_return_val_if_fail (etree != NULL, NULL); g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL); - if (ETM_CLASS(etree)->get_root) - return ETM_CLASS(etree)->get_root(etree); + if (ETM_CLASS (etree)->get_root) + return ETM_CLASS (etree)->get_root (etree); else return NULL; } @@ -455,9 +455,9 @@ e_tree_model_get_root (ETreeModel *etree) ETreePath e_tree_model_node_get_parent (ETreeModel *etree, ETreePath node) { - g_return_val_if_fail(etree != NULL, NULL); - if (ETM_CLASS(etree)->get_parent) - return ETM_CLASS(etree)->get_parent(etree, node); + g_return_val_if_fail (etree != NULL, NULL); + if (ETM_CLASS (etree)->get_parent) + return ETM_CLASS (etree)->get_parent (etree, node); else return NULL; } @@ -477,8 +477,8 @@ e_tree_model_node_get_first_child (ETreeModel *etree, ETreePath node) g_return_val_if_fail (etree != NULL, NULL); g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL); - if (ETM_CLASS(etree)->get_first_child) - return ETM_CLASS(etree)->get_first_child(etree, node); + if (ETM_CLASS (etree)->get_first_child) + return ETM_CLASS (etree)->get_first_child (etree, node); else return NULL; } @@ -498,8 +498,8 @@ e_tree_model_node_get_last_child (ETreeModel *etree, ETreePath node) g_return_val_if_fail (etree != NULL, NULL); g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL); - if (ETM_CLASS(etree)->get_last_child) - return ETM_CLASS(etree)->get_last_child(etree, node); + if (ETM_CLASS (etree)->get_last_child) + return ETM_CLASS (etree)->get_last_child (etree, node); else return NULL; } @@ -519,8 +519,8 @@ e_tree_model_node_get_next (ETreeModel *etree, ETreePath node) g_return_val_if_fail (etree != NULL, NULL); g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL); - if (ETM_CLASS(etree)->get_next) - return ETM_CLASS(etree)->get_next(etree, node); + if (ETM_CLASS (etree)->get_next) + return ETM_CLASS (etree)->get_next (etree, node); else return NULL; } @@ -540,8 +540,8 @@ e_tree_model_node_get_prev (ETreeModel *etree, ETreePath node) g_return_val_if_fail (etree != NULL, NULL); g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL); - if (ETM_CLASS(etree)->get_prev) - return ETM_CLASS(etree)->get_prev(etree, node); + if (ETM_CLASS (etree)->get_prev) + return ETM_CLASS (etree)->get_prev (etree, node); else return NULL; } @@ -558,10 +558,10 @@ e_tree_model_node_get_prev (ETreeModel *etree, ETreePath node) gboolean e_tree_model_node_is_root (ETreeModel *etree, ETreePath node) { - g_return_val_if_fail(etree != NULL, FALSE); + g_return_val_if_fail (etree != NULL, FALSE); - if (ETM_CLASS(etree)->is_root) - return ETM_CLASS(etree)->is_root(etree, node); + if (ETM_CLASS (etree)->is_root) + return ETM_CLASS (etree)->is_root (etree, node); else return FALSE; } @@ -578,11 +578,11 @@ e_tree_model_node_is_root (ETreeModel *etree, ETreePath node) gboolean e_tree_model_node_is_expandable (ETreeModel *etree, ETreePath node) { - g_return_val_if_fail(etree != NULL, FALSE); - g_return_val_if_fail(node != NULL, FALSE); + g_return_val_if_fail (etree != NULL, FALSE); + g_return_val_if_fail (node != NULL, FALSE); - if (ETM_CLASS(etree)->is_expandable) - return ETM_CLASS(etree)->is_expandable(etree, node); + if (ETM_CLASS (etree)->is_expandable) + return ETM_CLASS (etree)->is_expandable (etree, node); else return FALSE; } @@ -590,9 +590,9 @@ e_tree_model_node_is_expandable (ETreeModel *etree, ETreePath node) guint e_tree_model_node_get_children (ETreeModel *etree, ETreePath node, ETreePath **nodes) { - g_return_val_if_fail(etree != NULL, 0); - if (ETM_CLASS(etree)->get_children) - return ETM_CLASS(etree)->get_children (etree, node, nodes); + g_return_val_if_fail (etree != NULL, 0); + if (ETM_CLASS (etree)->get_children) + return ETM_CLASS (etree)->get_children (etree, node, nodes); else return 0; } @@ -612,8 +612,8 @@ e_tree_model_node_depth (ETreeModel *etree, ETreePath node) g_return_val_if_fail (etree != NULL, 0); g_return_val_if_fail (E_IS_TREE_MODEL (etree), 0); - if (ETM_CLASS(etree)->depth) - return ETM_CLASS(etree)->depth(etree, node); + if (ETM_CLASS (etree)->depth) + return ETM_CLASS (etree)->depth (etree, node); else return 0; } @@ -633,8 +633,8 @@ e_tree_model_icon_at (ETreeModel *etree, ETreePath node) g_return_val_if_fail (etree != NULL, NULL); g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL); - if (ETM_CLASS(etree)->icon_at) - return ETM_CLASS(etree)->icon_at (etree, node); + if (ETM_CLASS (etree)->icon_at) + return ETM_CLASS (etree)->icon_at (etree, node); else return NULL; } @@ -653,8 +653,8 @@ e_tree_model_get_expanded_default (ETreeModel *etree) g_return_val_if_fail (etree != NULL, FALSE); g_return_val_if_fail (E_IS_TREE_MODEL (etree), FALSE); - if (ETM_CLASS(etree)->get_expanded_default) - return ETM_CLASS(etree)->get_expanded_default (etree); + if (ETM_CLASS (etree)->get_expanded_default) + return ETM_CLASS (etree)->get_expanded_default (etree); else return FALSE; } @@ -673,8 +673,8 @@ e_tree_model_column_count (ETreeModel *etree) g_return_val_if_fail (etree != NULL, 0); g_return_val_if_fail (E_IS_TREE_MODEL (etree), 0); - if (ETM_CLASS(etree)->column_count) - return ETM_CLASS(etree)->column_count (etree); + if (ETM_CLASS (etree)->column_count) + return ETM_CLASS (etree)->column_count (etree); else return 0; } @@ -693,8 +693,8 @@ e_tree_model_has_save_id (ETreeModel *etree) g_return_val_if_fail (etree != NULL, FALSE); g_return_val_if_fail (E_IS_TREE_MODEL (etree), FALSE); - if (ETM_CLASS(etree)->has_save_id) - return ETM_CLASS(etree)->has_save_id (etree); + if (ETM_CLASS (etree)->has_save_id) + return ETM_CLASS (etree)->has_save_id (etree); else return FALSE; } @@ -714,8 +714,8 @@ e_tree_model_get_save_id (ETreeModel *etree, ETreePath node) g_return_val_if_fail (etree != NULL, NULL); g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL); - if (ETM_CLASS(etree)->get_save_id) - return ETM_CLASS(etree)->get_save_id (etree, node); + if (ETM_CLASS (etree)->get_save_id) + return ETM_CLASS (etree)->get_save_id (etree, node); else return NULL; } @@ -734,8 +734,8 @@ e_tree_model_has_get_node_by_id (ETreeModel *etree) g_return_val_if_fail (etree != NULL, FALSE); g_return_val_if_fail (E_IS_TREE_MODEL (etree), FALSE); - if (ETM_CLASS(etree)->has_get_node_by_id) - return ETM_CLASS(etree)->has_get_node_by_id (etree); + if (ETM_CLASS (etree)->has_get_node_by_id) + return ETM_CLASS (etree)->has_get_node_by_id (etree); else return FALSE; } @@ -758,8 +758,8 @@ 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); - if (ETM_CLASS(etree)->get_node_by_id) - return ETM_CLASS(etree)->get_node_by_id (etree, save_id); + if (ETM_CLASS (etree)->get_node_by_id) + return ETM_CLASS (etree)->get_node_by_id (etree, save_id); else return NULL; } @@ -778,8 +778,8 @@ e_tree_model_has_change_pending (ETreeModel *etree) g_return_val_if_fail (etree != NULL, FALSE); g_return_val_if_fail (E_IS_TREE_MODEL (etree), FALSE); - if (ETM_CLASS(etree)->has_change_pending) - return ETM_CLASS(etree)->has_change_pending (etree); + if (ETM_CLASS (etree)->has_change_pending) + return ETM_CLASS (etree)->has_change_pending (etree); else return FALSE; } @@ -810,8 +810,8 @@ 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); - if (ETM_CLASS(etree)->sort_value_at) - return ETM_CLASS(etree)->sort_value_at (etree, node, col); + if (ETM_CLASS (etree)->sort_value_at) + return ETM_CLASS (etree)->sort_value_at (etree, node, col); else return NULL; } @@ -841,8 +841,8 @@ 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); - if (ETM_CLASS(etree)->value_at) - return ETM_CLASS(etree)->value_at (etree, node, col); + if (ETM_CLASS (etree)->value_at) + return ETM_CLASS (etree)->value_at (etree, node, col); else return NULL; } @@ -853,8 +853,8 @@ e_tree_model_set_value_at (ETreeModel *etree, ETreePath node, gint col, gconstpo g_return_if_fail (etree != NULL); g_return_if_fail (E_IS_TREE_MODEL (etree)); - if (ETM_CLASS(etree)->set_value_at) - ETM_CLASS(etree)->set_value_at (etree, node, col, val); + if (ETM_CLASS (etree)->set_value_at) + ETM_CLASS (etree)->set_value_at (etree, node, col, val); } /** @@ -869,10 +869,10 @@ e_tree_model_set_value_at (ETreeModel *etree, ETreePath node, gint col, gconstpo gboolean e_tree_model_node_is_editable (ETreeModel *etree, ETreePath node, gint col) { - g_return_val_if_fail(etree != NULL, FALSE); + g_return_val_if_fail (etree != NULL, FALSE); - if (ETM_CLASS(etree)->is_editable) - return ETM_CLASS(etree)->is_editable(etree, node, col); + if (ETM_CLASS (etree)->is_editable) + return ETM_CLASS (etree)->is_editable (etree, node, col); else return FALSE; } @@ -889,10 +889,10 @@ e_tree_model_node_is_editable (ETreeModel *etree, ETreePath node, gint col) gpointer e_tree_model_duplicate_value (ETreeModel *etree, gint col, gconstpointer value) { - g_return_val_if_fail(etree != NULL, NULL); + g_return_val_if_fail (etree != NULL, NULL); - if (ETM_CLASS(etree)->duplicate_value) - return ETM_CLASS(etree)->duplicate_value(etree, col, value); + if (ETM_CLASS (etree)->duplicate_value) + return ETM_CLASS (etree)->duplicate_value (etree, col, value); else return NULL; } @@ -909,10 +909,10 @@ e_tree_model_duplicate_value (ETreeModel *etree, gint col, gconstpointer value) void e_tree_model_free_value (ETreeModel *etree, gint col, gpointer value) { - g_return_if_fail(etree != NULL); + g_return_if_fail (etree != NULL); - if (ETM_CLASS(etree)->free_value) - ETM_CLASS(etree)->free_value(etree, col, value); + if (ETM_CLASS (etree)->free_value) + ETM_CLASS (etree)->free_value (etree, col, value); } /** @@ -927,10 +927,10 @@ e_tree_model_free_value (ETreeModel *etree, gint col, gpointer value) gpointer e_tree_model_initialize_value (ETreeModel *etree, gint col) { - g_return_val_if_fail(etree != NULL, NULL); + g_return_val_if_fail (etree != NULL, NULL); - if (ETM_CLASS(etree)->initialize_value) - return ETM_CLASS(etree)->initialize_value(etree, col); + if (ETM_CLASS (etree)->initialize_value) + return ETM_CLASS (etree)->initialize_value (etree, col); else return NULL; } @@ -947,10 +947,10 @@ e_tree_model_initialize_value (ETreeModel *etree, gint col) gboolean e_tree_model_value_is_empty (ETreeModel *etree, gint col, gconstpointer value) { - g_return_val_if_fail(etree != NULL, TRUE); + g_return_val_if_fail (etree != NULL, TRUE); - if (ETM_CLASS(etree)->value_is_empty) - return ETM_CLASS(etree)->value_is_empty(etree, col, value); + if (ETM_CLASS (etree)->value_is_empty) + return ETM_CLASS (etree)->value_is_empty (etree, col, value); else return TRUE; } @@ -969,8 +969,8 @@ e_tree_model_value_to_string (ETreeModel *etree, gint col, gconstpointer value) { g_return_val_if_fail(etree != NULL, g_strdup("")); - if (ETM_CLASS(etree)->value_to_string) - return ETM_CLASS(etree)->value_to_string(etree, col, value); + if (ETM_CLASS (etree)->value_to_string) + return ETM_CLASS (etree)->value_to_string (etree, col, value); else return g_strdup(""); } diff --git a/widgets/table/e-tree-selection-model.c b/widgets/table/e-tree-selection-model.c index bcd6cfcc3e..e734114f00 100644 --- a/widgets/table/e-tree-selection-model.c +++ b/widgets/table/e-tree-selection-model.c @@ -64,7 +64,7 @@ static gint get_cursor_row (ETreeSelectionModel *etsm) { if (etsm->priv->cursor_path) - return e_tree_table_adapter_row_of_node(etsm->priv->etta, etsm->priv->cursor_path); + return e_tree_table_adapter_row_of_node (etsm->priv->etta, etsm->priv->cursor_path); return -1; } @@ -92,7 +92,7 @@ static void select_single_path (ETreeSelectionModel *etsm, ETreePath path) { clear_selection (etsm); - change_one_path(etsm, path, TRUE); + change_one_path (etsm, path, TRUE); etsm->priv->cursor_path = path; etsm->priv->start_path = NULL; } @@ -133,17 +133,17 @@ restore_cursor (ETreeSelectionModel *etsm, ETreeModel *etm) if (etsm->priv->cursor_path != NULL && etsm->priv->cursor_col == -1) etsm->priv->cursor_col = 0; - select_single_path(etsm, etsm->priv->cursor_path); + select_single_path (etsm, etsm->priv->cursor_path); } - e_selection_model_selection_changed(E_SELECTION_MODEL(etsm)); + e_selection_model_selection_changed (E_SELECTION_MODEL (etsm)); if (etsm->priv->cursor_path) { gint cursor_row = get_cursor_row (etsm); - e_selection_model_cursor_changed(E_SELECTION_MODEL(etsm), cursor_row, etsm->priv->cursor_col); + e_selection_model_cursor_changed (E_SELECTION_MODEL (etsm), cursor_row, etsm->priv->cursor_col); } else { - e_selection_model_cursor_changed(E_SELECTION_MODEL(etsm), -1, -1); - e_selection_model_cursor_activated(E_SELECTION_MODEL(etsm), -1, -1); + e_selection_model_cursor_changed (E_SELECTION_MODEL (etsm), -1, -1); + e_selection_model_cursor_activated (E_SELECTION_MODEL (etsm), -1, -1); } @@ -204,7 +204,7 @@ etsm_node_deleted (ETreeModel *etm, ETreePath child, ETreeSelectionModel *etsm) } static void -add_model(ETreeSelectionModel *etsm, ETreeModel *model) +add_model (ETreeSelectionModel *etsm, ETreeModel *model) { ETreeSelectionModelPriv *priv = etsm->priv; @@ -213,7 +213,7 @@ add_model(ETreeSelectionModel *etsm, ETreeModel *model) if (!priv->model) return; - g_object_ref(priv->model); + g_object_ref (priv->model); priv->tree_model_pre_change_id = g_signal_connect_after (G_OBJECT (priv->model), "pre_change", G_CALLBACK (etsm_pre_change), etsm); priv->tree_model_no_change_id = g_signal_connect_after (G_OBJECT (priv->model), "no_change", @@ -233,7 +233,7 @@ add_model(ETreeSelectionModel *etsm, ETreeModel *model) } static void -drop_model(ETreeSelectionModel *etsm) +drop_model (ETreeSelectionModel *etsm) { ETreeSelectionModelPriv *priv = etsm->priv; @@ -275,7 +275,7 @@ etsm_dispose (GObject *object) { ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (object); - drop_model(etsm); + drop_model (etsm); if (G_OBJECT_CLASS (e_tree_selection_model_parent_class)->dispose) (* G_OBJECT_CLASS (e_tree_selection_model_parent_class)->dispose) (object); @@ -304,7 +304,7 @@ etsm_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *ps switch (prop_id) { case PROP_CURSOR_ROW: - g_value_set_int (value, get_cursor_row(etsm)); + g_value_set_int (value, get_cursor_row (etsm)); break; case PROP_CURSOR_COL: @@ -329,16 +329,16 @@ etsm_set_property (GObject *object, guint prop_id, const GValue *value, GParamSp switch (prop_id) { case PROP_CURSOR_ROW: - e_selection_model_do_something(esm, g_value_get_int (value), etsm->priv->cursor_col, 0); + e_selection_model_do_something (esm, g_value_get_int (value), etsm->priv->cursor_col, 0); break; case PROP_CURSOR_COL: - e_selection_model_do_something(esm, get_cursor_row(etsm), g_value_get_int(value), 0); + e_selection_model_do_something (esm, get_cursor_row (etsm), g_value_get_int (value), 0); break; case PROP_MODEL: - drop_model(etsm); - add_model(etsm, E_TREE_MODEL (g_value_get_object(value))); + drop_model (etsm); + add_model (etsm, E_TREE_MODEL (g_value_get_object (value))); break; case PROP_ETTA: @@ -369,14 +369,14 @@ static gboolean etsm_is_row_selected (ESelectionModel *selection, gint row) { - ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL(selection); + ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (selection); ETreePath path; - g_return_val_if_fail(row < e_table_model_row_count(E_TABLE_MODEL(etsm->priv->etta)), FALSE); - g_return_val_if_fail(row >= 0, FALSE); - g_return_val_if_fail(etsm != NULL, FALSE); + g_return_val_if_fail (row < e_table_model_row_count (E_TABLE_MODEL (etsm->priv->etta)), FALSE); + g_return_val_if_fail (row >= 0, FALSE); + g_return_val_if_fail (etsm != NULL, FALSE); - path = e_tree_table_adapter_node_at_row(etsm->priv->etta, row); + path = e_tree_table_adapter_node_at_row (etsm->priv->etta, row); return etsm_is_path_selected (etsm, path); } @@ -391,9 +391,9 @@ etsm_row_foreach_cb (gpointer key, gpointer value, gpointer user_data) { ETreePath path = key; ModelAndCallback *mac = user_data; - gint 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); + mac->callback (row, mac->closure); } /** @@ -410,14 +410,14 @@ etsm_foreach (ESelectionModel *selection, EForeachFunc callback, gpointer closure) { - ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL(selection); + ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (selection); ModelAndCallback mac; mac.etsm = etsm; mac.callback = callback; mac.closure = closure; - g_hash_table_foreach(etsm->priv->paths, etsm_row_foreach_cb, &mac); + g_hash_table_foreach (etsm->priv->paths, etsm_row_foreach_cb, &mac); } /** @@ -427,15 +427,15 @@ etsm_foreach (ESelectionModel *selection, * This routine clears the selection to no rows selected. */ static void -etsm_clear(ESelectionModel *selection) +etsm_clear (ESelectionModel *selection) { - ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL(selection); + ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (selection); clear_selection (etsm); etsm->priv->cursor_path = NULL; - e_selection_model_selection_changed(E_SELECTION_MODEL(etsm)); - e_selection_model_cursor_changed(E_SELECTION_MODEL(etsm), -1, -1); + e_selection_model_selection_changed (E_SELECTION_MODEL (etsm)); + e_selection_model_cursor_changed (E_SELECTION_MODEL (etsm), -1, -1); } /** @@ -449,7 +449,7 @@ etsm_clear(ESelectionModel *selection) static gint etsm_selected_count (ESelectionModel *selection) { - ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL(selection); + ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (selection); return g_hash_table_size (etsm->priv->paths); } @@ -457,8 +457,8 @@ etsm_selected_count (ESelectionModel *selection) static gint etsm_row_count (ESelectionModel *selection) { - ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL(selection); - return e_table_model_row_count(E_TABLE_MODEL(etsm->priv->etta)); + ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (selection); + return e_table_model_row_count (E_TABLE_MODEL (etsm->priv->etta)); } /** @@ -471,10 +471,10 @@ etsm_row_count (ESelectionModel *selection) static void etsm_select_all (ESelectionModel *selection) { - ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL(selection); + ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (selection); ETreePath root; - root = e_tree_model_get_root(etsm->priv->model); + root = e_tree_model_get_root (etsm->priv->model); if (root == NULL) return; @@ -482,10 +482,10 @@ etsm_select_all (ESelectionModel *selection) select_range (etsm, 0, etsm_row_count (selection) - 1); if (etsm->priv->cursor_path == NULL) - etsm->priv->cursor_path = e_tree_table_adapter_node_at_row(etsm->priv->etta, 0); + etsm->priv->cursor_path = e_tree_table_adapter_node_at_row (etsm->priv->etta, 0); - e_selection_model_selection_changed(E_SELECTION_MODEL(etsm)); - e_selection_model_cursor_changed(E_SELECTION_MODEL(etsm), get_cursor_row(etsm), etsm->priv->cursor_col); + e_selection_model_selection_changed (E_SELECTION_MODEL (etsm)); + e_selection_model_cursor_changed (E_SELECTION_MODEL (etsm), get_cursor_row (etsm), etsm->priv->cursor_col); } /** @@ -498,7 +498,7 @@ etsm_select_all (ESelectionModel *selection) static void etsm_invert_selection (ESelectionModel *selection) { - ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL(selection); + ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (selection); gint count = etsm_row_count (selection); gint i; @@ -515,21 +515,21 @@ etsm_invert_selection (ESelectionModel *selection) etsm->priv->cursor_col = -1; etsm->priv->cursor_path = NULL; etsm->priv->start_path = NULL; - e_selection_model_selection_changed(E_SELECTION_MODEL(etsm)); - e_selection_model_cursor_changed(E_SELECTION_MODEL(etsm), -1, -1); + e_selection_model_selection_changed (E_SELECTION_MODEL (etsm)); + e_selection_model_cursor_changed (E_SELECTION_MODEL (etsm), -1, -1); } static void -etsm_change_one_row(ESelectionModel *selection, gint row, gboolean grow) +etsm_change_one_row (ESelectionModel *selection, gint row, gboolean grow) { - ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL(selection); + ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (selection); ETreePath path; - g_return_if_fail(row < e_table_model_row_count(E_TABLE_MODEL(etsm->priv->etta))); - g_return_if_fail(row >= 0); - g_return_if_fail(selection != NULL); + g_return_if_fail (row < e_table_model_row_count (E_TABLE_MODEL (etsm->priv->etta))); + g_return_if_fail (row >= 0); + g_return_if_fail (selection != NULL); - path = e_tree_table_adapter_node_at_row(etsm->priv->etta, row); + path = e_tree_table_adapter_node_at_row (etsm->priv->etta, row); if (!path) return; @@ -542,15 +542,15 @@ etsm_change_cursor (ESelectionModel *selection, gint row, gint col) { ETreeSelectionModel *etsm; - g_return_if_fail(selection != NULL); - g_return_if_fail(E_IS_SELECTION_MODEL(selection)); + g_return_if_fail (selection != NULL); + g_return_if_fail (E_IS_SELECTION_MODEL (selection)); - etsm = E_TREE_SELECTION_MODEL(selection); + etsm = E_TREE_SELECTION_MODEL (selection); if (row == -1) { etsm->priv->cursor_path = NULL; } else { - etsm->priv->cursor_path = e_tree_table_adapter_node_at_row(etsm->priv->etta, row); + etsm->priv->cursor_path = e_tree_table_adapter_node_at_row (etsm->priv->etta, row); } etsm->priv->cursor_col = col; } @@ -558,18 +558,18 @@ etsm_change_cursor (ESelectionModel *selection, gint row, gint col) static gint etsm_cursor_row (ESelectionModel *selection) { - return get_cursor_row(E_TREE_SELECTION_MODEL(selection)); + return get_cursor_row (E_TREE_SELECTION_MODEL (selection)); } static gint etsm_cursor_col (ESelectionModel *selection) { - ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL(selection); + ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (selection); return etsm->priv->cursor_col; } static void -etsm_get_rows(gint row, gpointer d) +etsm_get_rows (gint row, gpointer d) { gint **rowp = d; @@ -580,7 +580,7 @@ etsm_get_rows(gint row, gpointer d) static void etsm_select_single_row (ESelectionModel *selection, gint row) { - ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL(selection); + ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (selection); ETreePath path = e_tree_table_adapter_node_at_row (etsm->priv->etta, row); gint rows[5], *rowp = NULL, size; @@ -588,32 +588,32 @@ etsm_select_single_row (ESelectionModel *selection, gint row) /* we really only care about the size=1 case (cursor changed), but this doesn't cost much */ - size = g_hash_table_size(etsm->priv->paths); + size = g_hash_table_size (etsm->priv->paths); if (size > 0 && size <= 5) { rowp = rows; - etsm_foreach(selection, etsm_get_rows, &rowp); + etsm_foreach (selection, etsm_get_rows, &rowp); } select_single_path (etsm, path); if (size>5) { - e_selection_model_selection_changed(E_SELECTION_MODEL(etsm)); + e_selection_model_selection_changed (E_SELECTION_MODEL (etsm)); } else { if (rowp) { gint *p = rows; while (p<rowp) - e_selection_model_selection_row_changed((ESelectionModel *)etsm, *p++); + e_selection_model_selection_row_changed ((ESelectionModel *)etsm, *p++); } - e_selection_model_selection_row_changed((ESelectionModel *)etsm, row); + e_selection_model_selection_row_changed ((ESelectionModel *)etsm, row); } } static void etsm_toggle_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); + ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (selection); + ETreePath path = e_tree_table_adapter_node_at_row (etsm->priv->etta, row); g_return_if_fail (path); @@ -624,7 +624,7 @@ etsm_toggle_single_row (ESelectionModel *selection, gint row) etsm->priv->start_path = NULL; - e_selection_model_selection_row_changed((ESelectionModel *)etsm, row); + e_selection_model_selection_row_changed ((ESelectionModel *)etsm, row); } static void @@ -635,7 +635,7 @@ etsm_real_move_selection_end (ETreeSelectionModel *etsm, gint row) g_return_if_fail (end_path); - start = e_tree_table_adapter_row_of_node(etsm->priv->etta, etsm->priv->start_path); + start = e_tree_table_adapter_row_of_node (etsm->priv->etta, etsm->priv->start_path); clear_selection (etsm); select_range (etsm, start, row); } @@ -643,25 +643,25 @@ etsm_real_move_selection_end (ETreeSelectionModel *etsm, gint row) static void etsm_move_selection_end (ESelectionModel *selection, gint row) { - ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL(selection); + ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (selection); g_return_if_fail (etsm->priv->cursor_path); etsm_real_move_selection_end (etsm, row); - e_selection_model_selection_changed(E_SELECTION_MODEL(selection)); + e_selection_model_selection_changed (E_SELECTION_MODEL (selection)); } static void etsm_set_selection_end (ESelectionModel *selection, gint row) { - ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL(selection); + ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (selection); g_return_if_fail (etsm->priv->cursor_path); if (!etsm->priv->start_path) etsm->priv->start_path = etsm->priv->cursor_path; - etsm_real_move_selection_end(etsm, row); - e_selection_model_selection_changed(E_SELECTION_MODEL(etsm)); + etsm_real_move_selection_end (etsm, row); + e_selection_model_selection_changed (E_SELECTION_MODEL (etsm)); } struct foreach_path_t { @@ -684,7 +684,7 @@ e_tree_selection_model_foreach (ETreeSelectionModel *etsm, ETreeForeachFunc call struct foreach_path_t c; c.callback = callback; c.closure = closure; - g_hash_table_foreach(etsm->priv->paths, foreach_path, &c); + g_hash_table_foreach (etsm->priv->paths, foreach_path, &c); return; } } @@ -694,7 +694,7 @@ e_tree_selection_model_select_single_path (ETreeSelectionModel *etsm, ETreePath { select_single_path (etsm, path); - e_selection_model_selection_changed(E_SELECTION_MODEL(etsm)); + e_selection_model_selection_changed (E_SELECTION_MODEL (etsm)); } void @@ -705,18 +705,18 @@ e_tree_selection_model_select_paths (ETreeSelectionModel *etsm, GPtrArray *paths for (i=0;i<paths->len;i++) { path = paths->pdata[i]; - change_one_path(etsm, path, TRUE); + change_one_path (etsm, path, TRUE); } - e_selection_model_selection_changed(E_SELECTION_MODEL(etsm)); + e_selection_model_selection_changed (E_SELECTION_MODEL (etsm)); } void e_tree_selection_model_add_to_selection (ETreeSelectionModel *etsm, ETreePath path) { - change_one_path(etsm, path, TRUE); + change_one_path (etsm, path, TRUE); - e_selection_model_selection_changed(E_SELECTION_MODEL(etsm)); + e_selection_model_selection_changed (E_SELECTION_MODEL (etsm)); } void @@ -726,12 +726,12 @@ e_tree_selection_model_change_cursor (ETreeSelectionModel *etsm, ETreePath path) etsm->priv->cursor_path = path; - row = get_cursor_row(etsm); + row = get_cursor_row (etsm); E_SELECTION_MODEL (etsm)->old_selection = -1; - e_selection_model_cursor_changed(E_SELECTION_MODEL(etsm), row, etsm->priv->cursor_col); - e_selection_model_cursor_activated(E_SELECTION_MODEL(etsm), row, etsm->priv->cursor_col); + e_selection_model_cursor_changed (E_SELECTION_MODEL (etsm), row, etsm->priv->cursor_col); + e_selection_model_cursor_activated (E_SELECTION_MODEL (etsm), row, etsm->priv->cursor_col); } ETreePath @@ -744,7 +744,7 @@ static void e_tree_selection_model_init (ETreeSelectionModel *etsm) { ETreeSelectionModelPriv *priv; - priv = g_new(ETreeSelectionModelPriv, 1); + priv = g_new (ETreeSelectionModelPriv, 1); etsm->priv = priv; priv->etta = NULL; @@ -773,8 +773,8 @@ e_tree_selection_model_class_init (ETreeSelectionModelClass *klass) GObjectClass *object_class; ESelectionModelClass *esm_class; - object_class = G_OBJECT_CLASS(klass); - esm_class = E_SELECTION_MODEL_CLASS(klass); + object_class = G_OBJECT_CLASS (klass); + esm_class = E_SELECTION_MODEL_CLASS (klass); object_class->dispose = etsm_dispose; object_class->finalize = etsm_finalize; diff --git a/widgets/table/e-tree-sorted.c b/widgets/table/e-tree-sorted.c index 1e887fa7b9..e62ed66ffe 100644 --- a/widgets/table/e-tree-sorted.c +++ b/widgets/table/e-tree-sorted.c @@ -55,7 +55,7 @@ enum { LAST_SIGNAL }; -static guint signals [LAST_SIGNAL] = {0, }; +static guint signals[LAST_SIGNAL] = {0, }; typedef struct ETreeSortedPath ETreeSortedPath; @@ -114,15 +114,15 @@ static void resort_node (ETreeSorted *ets, ETreeSortedPath *path, gboolean resor static void mark_path_needs_resort (ETreeSorted *ets, ETreeSortedPath *path, gboolean needs_rebuild, gboolean resort_all_children); static void schedule_resort (ETreeSorted *ets, ETreeSortedPath *path, gboolean needs_regen, gboolean resort_all_children); static void free_path (ETreeSortedPath *path); -static void generate_children(ETreeSorted *ets, ETreeSortedPath *path); -static void regenerate_children(ETreeSorted *ets, ETreeSortedPath *path); +static void generate_children (ETreeSorted *ets, ETreeSortedPath *path); +static void regenerate_children (ETreeSorted *ets, ETreeSortedPath *path); /* idle callbacks */ static gboolean -ets_sort_idle(gpointer user_data) +ets_sort_idle (gpointer user_data) { ETreeSorted *ets = user_data; if (ets->priv->in_resort_idle) { @@ -147,13 +147,13 @@ inline static void ets_stop_sort_idle (ETreeSorted *ets) { if (ets->priv->sort_idle_id) { - g_source_remove(ets->priv->sort_idle_id); + g_source_remove (ets->priv->sort_idle_id); ets->priv->sort_idle_id = 0; } } static gboolean -ets_insert_idle(ETreeSorted *ets) +ets_insert_idle (ETreeSorted *ets) { ets->priv->insert_count = 0; ets->priv->insert_idle_id = 0; @@ -185,8 +185,8 @@ check_last_access (ETreeSorted *ets, ETreePath corresponding) parent = ets->priv->last_access->parent; if (parent && parent->children) { gint position = ets->priv->last_access->position; - gint end = MIN(parent->num_children, position + 10); - gint start = MAX(0, position - 10); + gint end = MIN (parent->num_children, position + 10); + gint start = MAX (0, position - 10); gint initial = MAX (MIN (position, end), start); gint i; @@ -209,7 +209,7 @@ check_last_access (ETreeSorted *ets, ETreePath corresponding) } static ETreeSortedPath * -find_path(ETreeSorted *ets, ETreePath corresponding) +find_path (ETreeSorted *ets, ETreePath corresponding) { gint depth; ETreePath *sequence; @@ -226,14 +226,14 @@ find_path(ETreeSorted *ets, ETreePath corresponding) return check_last; } - depth = e_tree_model_node_depth(ets->priv->source, corresponding); + depth = e_tree_model_node_depth (ets->priv->source, corresponding); - sequence = g_new(ETreePath, depth + 1); + sequence = g_new (ETreePath, depth + 1); sequence[0] = corresponding; for (i = 0; i < depth; i++) - sequence[i + 1] = e_tree_model_node_get_parent(ets->priv->source, sequence[i]); + sequence[i + 1] = e_tree_model_node_get_parent (ets->priv->source, sequence[i]); path = ets->priv->root; @@ -266,7 +266,7 @@ find_path(ETreeSorted *ets, ETreePath corresponding) } static ETreeSortedPath * -find_child_path(ETreeSorted *ets, ETreeSortedPath *parent, ETreePath corresponding) +find_child_path (ETreeSorted *ets, ETreeSortedPath *parent, ETreePath corresponding) { gint i; @@ -285,7 +285,7 @@ find_child_path(ETreeSorted *ets, ETreeSortedPath *parent, ETreePath correspondi } static ETreeSortedPath * -find_or_create_path(ETreeSorted *ets, ETreePath corresponding) +find_or_create_path (ETreeSorted *ets, ETreePath corresponding) { gint depth; ETreePath *sequence; @@ -302,14 +302,14 @@ find_or_create_path(ETreeSorted *ets, ETreePath corresponding) return check_last; } - depth = e_tree_model_node_depth(ets->priv->source, corresponding); + depth = e_tree_model_node_depth (ets->priv->source, corresponding); - sequence = g_new(ETreePath, depth + 1); + sequence = g_new (ETreePath, depth + 1); sequence[0] = corresponding; for (i = 0; i < depth; i++) - sequence[i + 1] = e_tree_model_node_get_parent(ets->priv->source, sequence[i]); + sequence[i + 1] = e_tree_model_node_get_parent (ets->priv->source, sequence[i]); path = ets->priv->root; @@ -317,7 +317,7 @@ find_or_create_path(ETreeSorted *ets, ETreePath corresponding) gint j; if (path->num_children == -1) { - generate_children(ets, path); + generate_children (ets, path); } for (j = 0; j < path->num_children; j++) { @@ -349,10 +349,10 @@ free_children (ETreeSortedPath *path) return; for (i = 0; i < path->num_children; i++) { - free_path(path->children[i]); + free_path (path->children[i]); } - g_free(path->children); + g_free (path->children); path->children = NULL; path->num_children = -1; } @@ -360,8 +360,8 @@ free_children (ETreeSortedPath *path) static void free_path (ETreeSortedPath *path) { - free_children(path); - g_slice_free(ETreeSortedPath, path); + free_children (path); + g_slice_free (ETreeSortedPath, path); } static ETreeSortedPath * @@ -396,15 +396,15 @@ reposition_path (ETreeSorted *ets, ETreeSortedPath *path) if (ets->priv->sort_idle_id == 0) { if (ets->priv->insert_count > ETS_INSERT_MAX) { /* schedule a sort, and append instead */ - schedule_resort(ets, parent, TRUE, FALSE); + schedule_resort (ets, parent, TRUE, FALSE); } else { /* make sure we have an idle handler to reset the count every now and then */ if (ets->priv->insert_idle_id == 0) { - ets->priv->insert_idle_id = g_idle_add_full(40, (GSourceFunc) ets_insert_idle, ets, NULL); + ets->priv->insert_idle_id = g_idle_add_full (40, (GSourceFunc) ets_insert_idle, ets, NULL); } new_index = e_table_sorting_utils_tree_check_position - (E_TREE_MODEL(ets), + (E_TREE_MODEL (ets), ets->priv->sort_info, ets->priv->full_header, (ETreePath *) parent->children, @@ -414,66 +414,66 @@ reposition_path (ETreeSorted *ets, ETreeSortedPath *path) if (new_index > old_index) { gint i; ets->priv->insert_count++; - memmove(parent->children + old_index, parent->children + old_index + 1, sizeof (ETreePath) * (new_index - old_index)); + memmove (parent->children + old_index, parent->children + old_index + 1, sizeof (ETreePath) * (new_index - old_index)); parent->children[new_index] = path; for (i = old_index; i <= new_index; i++) parent->children[i]->position = i; changed = TRUE; - e_tree_model_node_changed(E_TREE_MODEL(ets), parent); - e_tree_sorted_node_resorted(ets, parent); + e_tree_model_node_changed (E_TREE_MODEL (ets), parent); + e_tree_sorted_node_resorted (ets, parent); } else if (new_index < old_index) { gint i; ets->priv->insert_count++; - memmove(parent->children + new_index + 1, parent->children + new_index, sizeof (ETreePath) * (old_index - new_index)); + memmove (parent->children + new_index + 1, parent->children + new_index, sizeof (ETreePath) * (old_index - new_index)); parent->children[new_index] = path; for (i = new_index; i <= old_index; i++) parent->children[i]->position = i; changed = TRUE; - e_tree_model_node_changed(E_TREE_MODEL(ets), parent); - e_tree_sorted_node_resorted(ets, parent); + e_tree_model_node_changed (E_TREE_MODEL (ets), parent); + e_tree_sorted_node_resorted (ets, parent); } } } else - mark_path_needs_resort(ets, parent, TRUE, FALSE); + mark_path_needs_resort (ets, parent, TRUE, FALSE); } return changed; } static void -regenerate_children(ETreeSorted *ets, ETreeSortedPath *path) +regenerate_children (ETreeSorted *ets, ETreeSortedPath *path) { ETreeSortedPath **children; gint i; - children = g_new(ETreeSortedPath *, path->num_children); + children = g_new (ETreeSortedPath *, path->num_children); for (i = 0; i < path->num_children; i++) children[path->children[i]->orig_position] = path->children[i]; - g_free(path->children); + g_free (path->children); path->children = children; } static void -generate_children(ETreeSorted *ets, ETreeSortedPath *path) +generate_children (ETreeSorted *ets, ETreeSortedPath *path) { ETreePath child; gint i; gint count; - free_children(path); + free_children (path); count = 0; - for (child = e_tree_model_node_get_first_child(ets->priv->source, path->corresponding); + for (child = e_tree_model_node_get_first_child (ets->priv->source, path->corresponding); child; - child = e_tree_model_node_get_next(ets->priv->source, child)) { + child = e_tree_model_node_get_next (ets->priv->source, child)) { count++; } path->num_children = count; - path->children = g_new(ETreeSortedPath *, count); - for (child = e_tree_model_node_get_first_child(ets->priv->source, path->corresponding), i = 0; + path->children = g_new (ETreeSortedPath *, count); + for (child = e_tree_model_node_get_first_child (ets->priv->source, path->corresponding), i = 0; child; - child = e_tree_model_node_get_next(ets->priv->source, child), i++) { - path->children[i] = new_path(path, child); + child = e_tree_model_node_get_next (ets->priv->source, child), i++) { + path->children[i] = new_path (path, child); path->children[i]->position = i; path->children[i]->orig_position = i; } @@ -490,14 +490,14 @@ resort_node (ETreeSorted *ets, ETreeSortedPath *path, gboolean resort_all_childr needs_regen = path->needs_regen_to_sort || needs_regen; if (path->num_children > 0) { if (needs_resort && send_signals) - e_tree_model_pre_change(E_TREE_MODEL(ets)); + e_tree_model_pre_change (E_TREE_MODEL (ets)); if (needs_resort) { gint i; d(g_print("Start sort of node %p\n", path)); if (needs_regen) - regenerate_children(ets, path); + regenerate_children (ets, path); d(g_print("Regened sort of node %p\n", path)); - e_table_sorting_utils_tree_sort (E_TREE_MODEL(ets), + e_table_sorting_utils_tree_sort (E_TREE_MODEL (ets), ets->priv->sort_info, ets->priv->full_header, (ETreePath *) path->children, @@ -513,7 +513,7 @@ resort_node (ETreeSorted *ets, ETreeSortedPath *path, gboolean resort_all_childr if ((resort_all_children || path->child_needs_resort) && path->num_children >= 0) { 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); + resort_node (ets, path->children[i], resort_all_children, needs_regen, send_signals && !needs_resort); } path->child_needs_resort = 0; } @@ -523,8 +523,8 @@ resort_node (ETreeSorted *ets, ETreeSortedPath *path, gboolean resort_all_childr path->needs_regen_to_sort = 0; path->resort_all_children = 0; if (needs_resort && send_signals && path->num_children > 0) { - e_tree_model_node_changed(E_TREE_MODEL(ets), path); - e_tree_sorted_node_resorted(ets, path); + e_tree_model_node_changed (E_TREE_MODEL (ets), path); + e_tree_sorted_node_resorted (ets, path); } } } @@ -550,7 +550,7 @@ mark_path_needs_resort (ETreeSorted *ets, ETreeSortedPath *path, gboolean needs_ path->needs_resort = 1; path->needs_regen_to_sort = needs_regen; path->resort_all_children = resort_all_children; - mark_path_child_needs_resort(ets, path->parent); + mark_path_child_needs_resort (ets, path->parent); } static void @@ -558,7 +558,7 @@ schedule_resort (ETreeSorted *ets, ETreeSortedPath *path, gboolean needs_regen, { ets->priv->insert_count = 0; if (ets->priv->insert_idle_id != 0) { - g_source_remove(ets->priv->insert_idle_id); + g_source_remove (ets->priv->insert_idle_id); ets->priv->insert_idle_id = 0; } @@ -567,9 +567,9 @@ schedule_resort (ETreeSorted *ets, ETreeSortedPath *path, gboolean needs_regen, if (path->num_children == 0) return; - mark_path_needs_resort(ets, path, needs_regen, resort_all_children); + mark_path_needs_resort (ets, path, needs_regen, resort_all_children); if (ets->priv->sort_idle_id == 0) { - ets->priv->sort_idle_id = g_idle_add_full(50, (GSourceFunc) ets_sort_idle, ets, NULL); + ets->priv->sort_idle_id = g_idle_add_full (50, (GSourceFunc) ets_sort_idle, ets, NULL); } else if (ets->priv->in_resort_idle) { ets->priv->nested_resort_idle = TRUE; } @@ -636,12 +636,12 @@ ets_dispose (GObject *object) ets_stop_sort_idle (ets); if (ets->priv->insert_idle_id) { - g_source_remove(ets->priv->insert_idle_id); + g_source_remove (ets->priv->insert_idle_id); ets->priv->insert_idle_id = 0; } if (priv->full_header) - g_object_unref(priv->full_header); + g_object_unref (priv->full_header); } @@ -651,7 +651,7 @@ ets_finalize (GObject *object) ETreeSorted *ets = (ETreeSorted *) object; if (ets->priv->root) - free_path(ets->priv->root); + free_path (ets->priv->root); g_free (ets->priv); ets->priv = NULL; @@ -662,17 +662,17 @@ ets_finalize (GObject *object) static ETreePath ets_get_root (ETreeModel *etm) { - ETreeSortedPriv *priv = E_TREE_SORTED(etm)->priv; + ETreeSortedPriv *priv = E_TREE_SORTED (etm)->priv; if (priv->root == NULL) { - ETreeSorted *ets = E_TREE_SORTED(etm); - ETreePath corresponding = e_tree_model_get_root(ets->priv->source); + ETreeSorted *ets = E_TREE_SORTED (etm); + ETreePath corresponding = e_tree_model_get_root (ets->priv->source); if (corresponding) { - priv->root = new_path(NULL, corresponding); + priv->root = new_path (NULL, corresponding); } } if (priv->root && priv->root->num_children == -1) { - generate_children(E_TREE_SORTED(etm), priv->root); + generate_children (E_TREE_SORTED (etm), priv->root); } return priv->root; @@ -689,10 +689,10 @@ static ETreePath ets_get_first_child (ETreeModel *etm, ETreePath node) { ETreeSortedPath *path = node; - ETreeSorted *ets = E_TREE_SORTED(etm); + ETreeSorted *ets = E_TREE_SORTED (etm); if (path->num_children == -1) - generate_children(ets, path); + generate_children (ets, path); if (path->num_children > 0) return path->children[0]; @@ -704,10 +704,10 @@ static ETreePath ets_get_last_child (ETreeModel *etm, ETreePath node) { ETreeSortedPath *path = node; - ETreeSorted *ets = E_TREE_SORTED(etm); + ETreeSorted *ets = E_TREE_SORTED (etm); if (path->num_children == -1) - generate_children(ets, path); + generate_children (ets, path); if (path->num_children > 0) return path->children[path->num_children - 1]; @@ -747,7 +747,7 @@ static gboolean ets_is_root (ETreeModel *etm, ETreePath node) { ETreeSortedPath *path = node; - ETreeSorted *ets = E_TREE_SORTED(etm); + ETreeSorted *ets = E_TREE_SORTED (etm); return e_tree_model_node_is_root (ets->priv->source, path->corresponding); } @@ -756,11 +756,11 @@ static gboolean ets_is_expandable (ETreeModel *etm, ETreePath node) { ETreeSortedPath *path = node; - ETreeSorted *ets = E_TREE_SORTED(etm); + ETreeSorted *ets = E_TREE_SORTED (etm); gboolean expandable = e_tree_model_node_is_expandable (ets->priv->source, path->corresponding); if (path->num_children == -1) { - generate_children(ets, node); + generate_children (ets, node); } return expandable; @@ -773,7 +773,7 @@ ets_get_children (ETreeModel *etm, ETreePath node, ETreePath **nodes) guint n_children; if (path->num_children == -1) { - generate_children(E_TREE_SORTED(etm), node); + generate_children (E_TREE_SORTED (etm), node); } n_children = path->num_children; @@ -794,34 +794,34 @@ static guint ets_depth (ETreeModel *etm, ETreePath node) { ETreeSortedPath *path = node; - ETreeSorted *ets = E_TREE_SORTED(etm); + ETreeSorted *ets = E_TREE_SORTED (etm); - return e_tree_model_node_depth(ets->priv->source, path->corresponding); + return e_tree_model_node_depth (ets->priv->source, path->corresponding); } static GdkPixbuf * ets_icon_at (ETreeModel *etm, ETreePath node) { ETreeSortedPath *path = node; - ETreeSorted *ets = E_TREE_SORTED(etm); + ETreeSorted *ets = E_TREE_SORTED (etm); - return e_tree_model_icon_at(ets->priv->source, path->corresponding); + return e_tree_model_icon_at (ets->priv->source, path->corresponding); } static gboolean ets_get_expanded_default (ETreeModel *etm) { - ETreeSorted *ets = E_TREE_SORTED(etm); + ETreeSorted *ets = E_TREE_SORTED (etm); - return e_tree_model_get_expanded_default(ets->priv->source); + return e_tree_model_get_expanded_default (ets->priv->source); } static gint ets_column_count (ETreeModel *etm) { - ETreeSorted *ets = E_TREE_SORTED(etm); + ETreeSorted *ets = E_TREE_SORTED (etm); - return e_tree_model_column_count(ets->priv->source); + return e_tree_model_column_count (ets->priv->source); } static gboolean @@ -833,11 +833,11 @@ ets_has_save_id (ETreeModel *etm) static gchar * ets_get_save_id (ETreeModel *etm, ETreePath node) { - ETreeSorted *ets = E_TREE_SORTED(etm); + ETreeSorted *ets = E_TREE_SORTED (etm); ETreeSortedPath *path = node; - if (e_tree_model_has_save_id(ets->priv->source)) - return e_tree_model_get_save_id(ets->priv->source, path->corresponding); + if (e_tree_model_has_save_id (ets->priv->source)) + return e_tree_model_get_save_id (ets->priv->source, path->corresponding); else return g_strdup_printf("%p", path->corresponding); } @@ -845,25 +845,25 @@ ets_get_save_id (ETreeModel *etm, ETreePath node) static gboolean ets_has_get_node_by_id (ETreeModel *etm) { - ETreeSorted *ets = E_TREE_SORTED(etm); - return e_tree_model_has_get_node_by_id(ets->priv->source); + ETreeSorted *ets = E_TREE_SORTED (etm); + return e_tree_model_has_get_node_by_id (ets->priv->source); } static ETreePath ets_get_node_by_id (ETreeModel *etm, const gchar *save_id) { - ETreeSorted *ets = E_TREE_SORTED(etm); + ETreeSorted *ets = E_TREE_SORTED (etm); ETreePath node; node = e_tree_model_get_node_by_id (ets->priv->source, save_id); - return find_path(ets, node); + return find_path (ets, node); } static gboolean ets_has_change_pending (ETreeModel *etm) { - ETreeSorted *ets = E_TREE_SORTED(etm); + ETreeSorted *ets = E_TREE_SORTED (etm); return ets->priv->sort_idle_id != 0; } @@ -871,16 +871,16 @@ ets_has_change_pending (ETreeModel *etm) static gpointer ets_value_at (ETreeModel *etm, ETreePath node, gint col) { - ETreeSorted *ets = E_TREE_SORTED(etm); + ETreeSorted *ets = E_TREE_SORTED (etm); ETreeSortedPath *path = node; - return e_tree_model_value_at(ets->priv->source, path->corresponding, col); + return e_tree_model_value_at (ets->priv->source, path->corresponding, col); } static void ets_set_value_at (ETreeModel *etm, ETreePath node, gint col, gconstpointer val) { - ETreeSorted *ets = E_TREE_SORTED(etm); + ETreeSorted *ets = E_TREE_SORTED (etm); ETreeSortedPath *path = node; e_tree_model_set_value_at (ets->priv->source, path->corresponding, col, val); @@ -889,7 +889,7 @@ ets_set_value_at (ETreeModel *etm, ETreePath node, gint col, gconstpointer val) static gboolean ets_is_editable (ETreeModel *etm, ETreePath node, gint col) { - ETreeSorted *ets = E_TREE_SORTED(etm); + ETreeSorted *ets = E_TREE_SORTED (etm); ETreeSortedPath *path = node; return e_tree_model_node_is_editable (ets->priv->source, path->corresponding, col); @@ -899,7 +899,7 @@ ets_is_editable (ETreeModel *etm, ETreePath node, gint col) static gpointer ets_duplicate_value (ETreeModel *etm, gint col, gconstpointer value) { - ETreeSorted *ets = E_TREE_SORTED(etm); + ETreeSorted *ets = E_TREE_SORTED (etm); return e_tree_model_duplicate_value (ets->priv->source, col, value); } @@ -907,7 +907,7 @@ ets_duplicate_value (ETreeModel *etm, gint col, gconstpointer value) static void ets_free_value (ETreeModel *etm, gint col, gpointer value) { - ETreeSorted *ets = E_TREE_SORTED(etm); + ETreeSorted *ets = E_TREE_SORTED (etm); e_tree_model_free_value (ets->priv->source, col, value); } @@ -915,7 +915,7 @@ ets_free_value (ETreeModel *etm, gint col, gpointer value) static gpointer ets_initialize_value (ETreeModel *etm, gint col) { - ETreeSorted *ets = E_TREE_SORTED(etm); + ETreeSorted *ets = E_TREE_SORTED (etm); return e_tree_model_initialize_value (ets->priv->source, col); } @@ -923,7 +923,7 @@ ets_initialize_value (ETreeModel *etm, gint col) static gboolean ets_value_is_empty (ETreeModel *etm, gint col, gconstpointer value) { - ETreeSorted *ets = E_TREE_SORTED(etm); + ETreeSorted *ets = E_TREE_SORTED (etm); return e_tree_model_value_is_empty (ets->priv->source, col, value); } @@ -931,7 +931,7 @@ ets_value_is_empty (ETreeModel *etm, gint col, gconstpointer value) static gchar * ets_value_to_string (ETreeModel *etm, gint col, gconstpointer value) { - ETreeSorted *ets = E_TREE_SORTED(etm); + ETreeSorted *ets = E_TREE_SORTED (etm); return e_tree_model_value_to_string (ets->priv->source, col, value); } @@ -941,13 +941,13 @@ ets_value_to_string (ETreeModel *etm, gint col, gconstpointer value) static void ets_proxy_pre_change (ETreeModel *etm, ETreeSorted *ets) { - e_tree_model_pre_change(E_TREE_MODEL(ets)); + e_tree_model_pre_change (E_TREE_MODEL (ets)); } static void ets_proxy_no_change (ETreeModel *etm, ETreeSorted *ets) { - e_tree_model_no_change(E_TREE_MODEL(ets)); + e_tree_model_no_change (E_TREE_MODEL (ets)); } static void @@ -956,27 +956,27 @@ ets_proxy_node_changed (ETreeModel *etm, ETreePath node, ETreeSorted *ets) ets->priv->last_access = NULL; d(g_print("Setting last access %p. (ets_proxy_node_changed)\n", ets->priv->last_access)); - if (e_tree_model_node_is_root(ets->priv->source, node)) { + if (e_tree_model_node_is_root (ets->priv->source, node)) { ets_stop_sort_idle (ets); if (ets->priv->root) { - free_path(ets->priv->root); + free_path (ets->priv->root); } - ets->priv->root = new_path(NULL, node); - e_tree_model_node_changed(E_TREE_MODEL(ets), ets->priv->root); + ets->priv->root = new_path (NULL, node); + e_tree_model_node_changed (E_TREE_MODEL (ets), ets->priv->root); return; } else { - ETreeSortedPath *path = find_path(ets, node); + ETreeSortedPath *path = find_path (ets, node); if (path) { - free_children(path); - if (!reposition_path(ets, path)) { - e_tree_model_node_changed(E_TREE_MODEL(ets), path); + free_children (path); + if (!reposition_path (ets, path)) { + e_tree_model_node_changed (E_TREE_MODEL (ets), path); } else { - e_tree_model_no_change(E_TREE_MODEL(ets)); + e_tree_model_no_change (E_TREE_MODEL (ets)); } } else { - e_tree_model_no_change(E_TREE_MODEL(ets)); + e_tree_model_no_change (E_TREE_MODEL (ets)); } } } @@ -984,38 +984,38 @@ ets_proxy_node_changed (ETreeModel *etm, ETreePath node, ETreeSorted *ets) static void ets_proxy_node_data_changed (ETreeModel *etm, ETreePath node, ETreeSorted *ets) { - ETreeSortedPath *path = find_path(ets, node); + ETreeSortedPath *path = find_path (ets, node); if (path) { - if (!reposition_path(ets, path)) - e_tree_model_node_data_changed(E_TREE_MODEL(ets), path); + if (!reposition_path (ets, path)) + e_tree_model_node_data_changed (E_TREE_MODEL (ets), path); else - e_tree_model_no_change(E_TREE_MODEL(ets)); + e_tree_model_no_change (E_TREE_MODEL (ets)); } else - e_tree_model_no_change(E_TREE_MODEL(ets)); + e_tree_model_no_change (E_TREE_MODEL (ets)); } static void ets_proxy_node_col_changed (ETreeModel *etm, ETreePath node, gint col, ETreeSorted *ets) { - ETreeSortedPath *path = find_path(ets, node); + ETreeSortedPath *path = find_path (ets, node); if (path) { gboolean changed = FALSE; - if (e_table_sorting_utils_affects_sort(ets->priv->sort_info, ets->priv->full_header, col)) - changed = reposition_path(ets, path); + if (e_table_sorting_utils_affects_sort (ets->priv->sort_info, ets->priv->full_header, col)) + changed = reposition_path (ets, path); if (!changed) - e_tree_model_node_col_changed(E_TREE_MODEL(ets), path, col); + e_tree_model_node_col_changed (E_TREE_MODEL (ets), path, col); else - e_tree_model_no_change(E_TREE_MODEL(ets)); + e_tree_model_no_change (E_TREE_MODEL (ets)); } else - e_tree_model_no_change(E_TREE_MODEL(ets)); + e_tree_model_no_change (E_TREE_MODEL (ets)); } static void ets_proxy_node_inserted (ETreeModel *etm, ETreePath parent, ETreePath child, ETreeSorted *ets) { - ETreeSortedPath *parent_path = find_path(ets, parent); + ETreeSortedPath *parent_path = find_path (ets, parent); if (parent_path && parent_path->num_children != -1) { gint i; @@ -1024,9 +1024,9 @@ ets_proxy_node_inserted (ETreeModel *etm, ETreePath parent, ETreePath child, ETr gint position = parent_path->num_children; ETreePath counter; - for (counter = e_tree_model_node_get_next(etm, child); + for (counter = e_tree_model_node_get_next (etm, child); counter; - counter = e_tree_model_node_get_next(etm, counter)) + counter = e_tree_model_node_get_next (etm, counter)) position--; if (position != parent_path->num_children) { @@ -1037,17 +1037,17 @@ ets_proxy_node_inserted (ETreeModel *etm, ETreePath parent, ETreePath child, ETr } i = parent_path->num_children; - path = new_path(parent_path, child); + path = new_path (parent_path, child); path->orig_position = position; if (!ETS_SORT_IDLE_ACTIVATED (ets)) { ets->priv->insert_count++; if (ets->priv->insert_count > ETS_INSERT_MAX) { /* schedule a sort, and append instead */ - schedule_resort(ets, parent_path, TRUE, FALSE); + schedule_resort (ets, parent_path, TRUE, FALSE); } else { /* make sure we have an idle handler to reset the count every now and then */ if (ets->priv->insert_idle_id == 0) { - ets->priv->insert_idle_id = g_idle_add_full(40, (GSourceFunc) ets_insert_idle, ets, NULL); + ets->priv->insert_idle_id = g_idle_add_full (40, (GSourceFunc) ets_insert_idle, ets, NULL); } i = e_table_sorting_utils_tree_insert (ets->priv->source, @@ -1058,38 +1058,38 @@ ets_proxy_node_inserted (ETreeModel *etm, ETreePath parent, ETreePath child, ETr path); } } else { - mark_path_needs_resort(ets, parent_path, TRUE, FALSE); + mark_path_needs_resort (ets, parent_path, TRUE, FALSE); } parent_path->num_children++; - parent_path->children = g_renew(ETreeSortedPath *, parent_path->children, parent_path->num_children); - memmove(parent_path->children + i + 1, parent_path->children + i, (parent_path->num_children - 1 - i) * sizeof(gint)); + parent_path->children = g_renew (ETreeSortedPath *, parent_path->children, parent_path->num_children); + memmove (parent_path->children + i + 1, parent_path->children + i, (parent_path->num_children - 1 - i) * sizeof (gint)); parent_path->children[i] = path; for (j = i; j < parent_path->num_children; j++) { parent_path->children[j]->position = j; } - e_tree_model_node_inserted(E_TREE_MODEL(ets), parent_path, parent_path->children[i]); + e_tree_model_node_inserted (E_TREE_MODEL (ets), parent_path, parent_path->children[i]); } else if (ets->priv->root == NULL && parent == NULL) { if (child) { - ets->priv->root = new_path(NULL, child); - e_tree_model_node_inserted(E_TREE_MODEL(ets), NULL, ets->priv->root); + ets->priv->root = new_path (NULL, child); + e_tree_model_node_inserted (E_TREE_MODEL (ets), NULL, ets->priv->root); } else { - e_tree_model_no_change(E_TREE_MODEL(ets)); + e_tree_model_no_change (E_TREE_MODEL (ets)); } } else { - e_tree_model_no_change(E_TREE_MODEL(ets)); + e_tree_model_no_change (E_TREE_MODEL (ets)); } } static void ets_proxy_node_removed (ETreeModel *etm, ETreePath parent, ETreePath child, gint old_position, ETreeSorted *ets) { - ETreeSortedPath *parent_path = find_path(ets, parent); + ETreeSortedPath *parent_path = find_path (ets, parent); ETreeSortedPath *path; if (parent_path) - path = find_child_path(ets, parent_path, child); + path = find_child_path (ets, parent_path, child); else - path = find_path(ets, child); + path = find_path (ets, child); d(g_print("Setting last access %p. (ets_proxy_node_removed)\n ", ets->priv->last_access)); ets->priv->last_access = NULL; @@ -1104,38 +1104,38 @@ ets_proxy_node_removed (ETreeModel *etm, ETreePath parent, ETreePath child, gint i = path->position; parent_path->num_children--; - memmove(parent_path->children + i, parent_path->children + i + 1, sizeof(ETreeSortedPath *) * (parent_path->num_children - i)); + memmove (parent_path->children + i, parent_path->children + i + 1, sizeof (ETreeSortedPath *) * (parent_path->num_children - i)); for (; i < parent_path->num_children; i++) { parent_path->children[i]->position = i; } - e_tree_model_node_removed(E_TREE_MODEL(ets), parent_path, path, path->position); - free_path(path); + e_tree_model_node_removed (E_TREE_MODEL (ets), parent_path, path, path->position); + free_path (path); } else if (path && path == ets->priv->root) { ets->priv->root = NULL; - e_tree_model_node_removed(E_TREE_MODEL(ets), NULL, path, -1); - free_path(path); + e_tree_model_node_removed (E_TREE_MODEL (ets), NULL, path, -1); + free_path (path); } } static void ets_proxy_node_deleted (ETreeModel *etm, ETreePath child, ETreeSorted *ets) { - e_tree_model_node_deleted(E_TREE_MODEL(ets), NULL); + e_tree_model_node_deleted (E_TREE_MODEL (ets), NULL); } static void ets_proxy_node_request_collapse (ETreeModel *etm, ETreePath node, ETreeSorted *ets) { - ETreeSortedPath *path = find_path(ets, node); + ETreeSortedPath *path = find_path (ets, node); if (path) { - e_tree_model_node_request_collapse(E_TREE_MODEL(ets), path); + e_tree_model_node_request_collapse (E_TREE_MODEL (ets), path); } } static void ets_sort_info_changed (ETableSortInfo *sort_info, ETreeSorted *ets) { - schedule_resort(ets, ets->priv->root, TRUE, TRUE); + schedule_resort (ets, ets->priv->root, TRUE, TRUE); } @@ -1188,7 +1188,7 @@ e_tree_sorted_class_init (ETreeSortedClass *klass) tree_class->value_is_empty = ets_value_is_empty; tree_class->value_to_string = ets_value_to_string; - signals [NODE_RESORTED] = + signals[NODE_RESORTED] = g_signal_new ("node_resorted", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, @@ -1244,11 +1244,11 @@ e_tree_sorted_construct (ETreeSorted *ets, ETreeModel *source, ETableHeader *ful { ets->priv->source = source; if (source) - g_object_ref(source); + g_object_ref (source); ets->priv->full_header = full_header; if (full_header) - g_object_ref(full_header); + g_object_ref (full_header); e_tree_sorted_set_sort_info (ets, sort_info); @@ -1285,7 +1285,7 @@ e_tree_sorted_new (ETreeModel *source, ETableHeader *full_header, ETableSortInfo { ETreeSorted *ets = g_object_new (E_TREE_SORTED_TYPE, NULL); - e_tree_sorted_construct(ets, source, full_header, sort_info); + e_tree_sorted_construct (ets, source, full_header, sort_info); return ets; } @@ -1307,7 +1307,7 @@ ETreePath e_tree_sorted_model_to_view_path (ETreeSorted *ets, ETreePath model_path) { - return find_or_create_path(ets, model_path); + return find_or_create_path (ets, model_path); } gint @@ -1325,7 +1325,7 @@ e_tree_sorted_node_num_children (ETreeSorted *ets, ETreeSortedPath *sorted_path = path; if (sorted_path->num_children == -1) { - generate_children(ets, sorted_path); + generate_children (ets, sorted_path); } return sorted_path->num_children; @@ -1337,7 +1337,7 @@ e_tree_sorted_node_resorted (ETreeSorted *sorted, ETreePath node) g_return_if_fail (sorted != NULL); g_return_if_fail (E_IS_TREE_SORTED (sorted)); - g_signal_emit (G_OBJECT (sorted), signals [NODE_RESORTED], 0, node); + g_signal_emit (G_OBJECT (sorted), signals[NODE_RESORTED], 0, node); } void @@ -1356,7 +1356,7 @@ e_tree_sorted_set_sort_info (ETreeSorted *ets, ETableSortInfo *sort_info) ets->priv->sort_info = sort_info; if (sort_info) { - g_object_ref(sort_info); + g_object_ref (sort_info); ets->priv->sort_info_changed_id = g_signal_connect (G_OBJECT (ets->priv->sort_info), "sort_info_changed", G_CALLBACK (ets_sort_info_changed), ets); } diff --git a/widgets/table/e-tree-table-adapter.c b/widgets/table/e-tree-table-adapter.c index e50c6d67bd..63bd640a3c 100644 --- a/widgets/table/e-tree-table-adapter.c +++ b/widgets/table/e-tree-table-adapter.c @@ -50,7 +50,7 @@ enum { LAST_SIGNAL }; -static guint signals [LAST_SIGNAL] = { 0, }; +static guint signals[LAST_SIGNAL] = { 0, }; typedef struct { ETreePath path; @@ -97,23 +97,23 @@ struct ETreeTableAdapterPriv { static void etta_sort_info_changed (ETableSortInfo *sort_info, ETreeTableAdapter *etta); static GNode * -lookup_gnode(ETreeTableAdapter *etta, ETreePath path) +lookup_gnode (ETreeTableAdapter *etta, ETreePath path) { GNode *gnode; if (!path) return NULL; - gnode = g_hash_table_lookup(etta->priv->nodes, path); + gnode = g_hash_table_lookup (etta->priv->nodes, path); return gnode; } static void -resize_map(ETreeTableAdapter *etta, gint 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); + etta->priv->n_vals_allocated = MAX (etta->priv->n_vals_allocated + INCREMENT_AMOUNT, size); etta->priv->map_table = g_renew (node_t *, etta->priv->map_table, etta->priv->n_vals_allocated); } @@ -121,16 +121,16 @@ resize_map(ETreeTableAdapter *etta, gint size) } static void -move_map_elements(ETreeTableAdapter *etta, gint to, gint from, gint count) +move_map_elements (ETreeTableAdapter *etta, gint to, gint from, gint count) { if (count <= 0 || from >= etta->priv->n_map) return; - memmove(etta->priv->map_table + to, etta->priv->map_table + from, count * sizeof (node_t *)); + memmove (etta->priv->map_table + to, etta->priv->map_table + from, count * sizeof (node_t *)); etta->priv->remap_needed = TRUE; } static gint -fill_map(ETreeTableAdapter *etta, gint index, GNode *gnode) +fill_map (ETreeTableAdapter *etta, gint index, GNode *gnode) { GNode *p; @@ -138,14 +138,14 @@ fill_map(ETreeTableAdapter *etta, gint index, GNode *gnode) etta->priv->map_table[index++] = gnode->data; for (p = gnode->children; p; p = p->next) - index = fill_map(etta, index, p); + index = fill_map (etta, index, p); etta->priv->remap_needed = TRUE; return index; } static void -remap_indices(ETreeTableAdapter *etta) +remap_indices (ETreeTableAdapter *etta) { gint i; for (i = 0; i < etta->priv->n_map; i++) @@ -154,9 +154,9 @@ remap_indices(ETreeTableAdapter *etta) } static node_t * -get_node(ETreeTableAdapter *etta, ETreePath path) +get_node (ETreeTableAdapter *etta, ETreePath path) { - GNode *gnode = lookup_gnode(etta, path); + GNode *gnode = lookup_gnode (etta, path); if (!gnode) return NULL; @@ -165,7 +165,7 @@ get_node(ETreeTableAdapter *etta, ETreePath path) } static void -resort_node(ETreeTableAdapter *etta, GNode *gnode, gboolean recurse) +resort_node (ETreeTableAdapter *etta, GNode *gnode, gboolean recurse) { node_t *node = (node_t *)gnode->data; ETreePath *paths, path; @@ -178,25 +178,25 @@ resort_node(ETreeTableAdapter *etta, GNode *gnode, gboolean recurse) sort_needed = etta->priv->sort_info && e_table_sort_info_sorting_get_count (etta->priv->sort_info) > 0; - for (i = 0, path = e_tree_model_node_get_first_child(etta->priv->source, node->path); path; - path = e_tree_model_node_get_next(etta->priv->source, path), i++); + for (i = 0, path = e_tree_model_node_get_first_child (etta->priv->source, node->path); path; + path = e_tree_model_node_get_next (etta->priv->source, path), i++); count = i; if (count <= 1) return; - paths = g_new0(ETreePath, count); + paths = g_new0 (ETreePath, count); - for (i = 0, path = e_tree_model_node_get_first_child(etta->priv->source, node->path); path; - path = e_tree_model_node_get_next(etta->priv->source, path), i++) + for (i = 0, path = e_tree_model_node_get_first_child (etta->priv->source, node->path); path; + path = e_tree_model_node_get_next (etta->priv->source, path), i++) paths[i] = path; if (count > 1 && sort_needed) - e_table_sorting_utils_tree_sort(etta->priv->source, etta->priv->sort_info, etta->priv->header, paths, count); + e_table_sorting_utils_tree_sort (etta->priv->source, etta->priv->sort_info, etta->priv->header, paths, count); prev = NULL; for (i = 0; i < count; i++) { - curr = lookup_gnode(etta, paths[i]); + curr = lookup_gnode (etta, paths[i]); if (!curr) continue; @@ -209,21 +209,21 @@ resort_node(ETreeTableAdapter *etta, GNode *gnode, gboolean recurse) curr->next = NULL; prev = curr; if (recurse) - resort_node(etta, curr, recurse); + resort_node (etta, curr, recurse); } - g_free(paths); + g_free (paths); } static gint -get_row(ETreeTableAdapter *etta, ETreePath path) +get_row (ETreeTableAdapter *etta, ETreePath path) { - node_t *node = get_node(etta, path); + node_t *node = get_node (etta, path); if (!node) return -1; if (etta->priv->remap_needed) - remap_indices(etta); + remap_indices (etta); return node->index; } @@ -236,28 +236,28 @@ get_path (ETreeTableAdapter *etta, gint row) else if (row < 0 || row >= etta->priv->n_map) return NULL; - return etta->priv->map_table [row]->path; + return etta->priv->map_table[row]->path; } static void -kill_gnode(GNode *node, ETreeTableAdapter *etta) +kill_gnode (GNode *node, ETreeTableAdapter *etta) { - g_hash_table_remove(etta->priv->nodes, ((node_t *)node->data)->path); + g_hash_table_remove (etta->priv->nodes, ((node_t *)node->data)->path); while (node->children) { GNode *next = node->children->next; - kill_gnode(node->children, etta); + kill_gnode (node->children, etta); node->children = next; } - g_free(node->data); + g_free (node->data); if (node == etta->priv->root) etta->priv->root = NULL; - g_node_destroy(node); + g_node_destroy (node); } static void -update_child_counts(GNode *gnode, gint delta) +update_child_counts (GNode *gnode, gint delta) { while (gnode) { node_t *node = (node_t *) gnode->data; @@ -267,7 +267,7 @@ update_child_counts(GNode *gnode, gint delta) } static gint -delete_children(ETreeTableAdapter *etta, GNode *gnode) +delete_children (ETreeTableAdapter *etta, GNode *gnode) { node_t *node = (node_t *)gnode->data; gint to_remove = node ? node->num_visible_children : 0; @@ -277,7 +277,7 @@ delete_children(ETreeTableAdapter *etta, GNode *gnode) while (gnode->children) { GNode *next = gnode->children->next; - kill_gnode(gnode->children, etta); + kill_gnode (gnode->children, etta); gnode->children = next; } @@ -285,179 +285,179 @@ delete_children(ETreeTableAdapter *etta, GNode *gnode) } static void -delete_node(ETreeTableAdapter *etta, ETreePath parent, ETreePath path) +delete_node (ETreeTableAdapter *etta, ETreePath parent, ETreePath 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); + 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); - e_table_model_pre_change(E_TABLE_MODEL(etta)); + e_table_model_pre_change (E_TABLE_MODEL (etta)); if (row == -1) { - e_table_model_no_change(E_TABLE_MODEL(etta)); + e_table_model_no_change (E_TABLE_MODEL (etta)); return; } - to_remove += delete_children(etta, gnode); - kill_gnode(gnode, etta); + to_remove += delete_children (etta, gnode); + kill_gnode (gnode, etta); - move_map_elements(etta, row, row + to_remove, etta->priv->n_map - row - to_remove); - resize_map(etta, etta->priv->n_map - to_remove); + move_map_elements (etta, row, row + to_remove, etta->priv->n_map - row - to_remove); + resize_map (etta, etta->priv->n_map - to_remove); if (parent_gnode != NULL) { node_t *parent_node = parent_gnode->data; - gboolean expandable = e_tree_model_node_is_expandable(etta->priv->source, parent); + gboolean expandable = e_tree_model_node_is_expandable (etta->priv->source, parent); - update_child_counts(parent_gnode, - to_remove); + update_child_counts (parent_gnode, - to_remove); if (parent_node->expandable != expandable) { - e_table_model_pre_change(E_TABLE_MODEL(etta)); + e_table_model_pre_change (E_TABLE_MODEL (etta)); parent_node->expandable = expandable; - e_table_model_row_changed(E_TABLE_MODEL(etta), parent_row); + e_table_model_row_changed (E_TABLE_MODEL (etta), parent_row); } resort_node (etta, parent_gnode, FALSE); } - e_table_model_rows_deleted(E_TABLE_MODEL(etta), row, to_remove); + e_table_model_rows_deleted (E_TABLE_MODEL (etta), row, to_remove); } static GNode * -create_gnode(ETreeTableAdapter *etta, ETreePath path) +create_gnode (ETreeTableAdapter *etta, ETreePath path) { GNode *gnode; node_t *node; - node = g_new0(node_t, 1); + node = g_new0 (node_t, 1); node->path = path; node->index = -1; node->expanded = etta->priv->force_expanded_state == 0 ? e_tree_model_get_expanded_default (etta->priv->source) : etta->priv->force_expanded_state > 0; - node->expandable = e_tree_model_node_is_expandable(etta->priv->source, path); + node->expandable = e_tree_model_node_is_expandable (etta->priv->source, path); node->expandable_set = 1; node->num_visible_children = 0; - gnode = g_node_new(node); - g_hash_table_insert(etta->priv->nodes, path, gnode); + gnode = g_node_new (node); + g_hash_table_insert (etta->priv->nodes, path, gnode); return gnode; } static gint -insert_children(ETreeTableAdapter *etta, GNode *gnode) +insert_children (ETreeTableAdapter *etta, GNode *gnode) { ETreePath path, tmp; 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); + for (tmp = e_tree_model_node_get_first_child (etta->priv->source, path); tmp; - tmp = e_tree_model_node_get_next(etta->priv->source, tmp), pos++) { - GNode *child = create_gnode(etta, tmp); + tmp = e_tree_model_node_get_next (etta->priv->source, tmp), pos++) { + GNode *child = create_gnode (etta, tmp); node_t *node = (node_t *) child->data; if (node->expanded) - node->num_visible_children = insert_children(etta, child); - g_node_prepend(gnode, child); + node->num_visible_children = insert_children (etta, child); + g_node_prepend (gnode, child); count += node->num_visible_children + 1; } - g_node_reverse_children(gnode); + g_node_reverse_children (gnode); return count; } static void -generate_tree(ETreeTableAdapter *etta, ETreePath path) +generate_tree (ETreeTableAdapter *etta, ETreePath path) { GNode *gnode; node_t *node; gint size; - e_table_model_pre_change(E_TABLE_MODEL(etta)); + e_table_model_pre_change (E_TABLE_MODEL (etta)); - g_return_if_fail (e_tree_model_node_is_root(etta->priv->source, path)); + g_return_if_fail (e_tree_model_node_is_root (etta->priv->source, path)); if (etta->priv->root) - kill_gnode(etta->priv->root, etta); - resize_map(etta, 0); + kill_gnode (etta->priv->root, etta); + resize_map (etta, 0); - gnode = create_gnode(etta, path); + gnode = create_gnode (etta, path); node = (node_t *) gnode->data; node->expanded = TRUE; - node->num_visible_children = insert_children(etta, gnode); - if (etta->priv->sort_info && e_table_sort_info_sorting_get_count(etta->priv->sort_info) > 0) - resort_node(etta, gnode, TRUE); + node->num_visible_children = insert_children (etta, gnode); + if (etta->priv->sort_info && e_table_sort_info_sorting_get_count (etta->priv->sort_info) > 0) + resort_node (etta, gnode, TRUE); etta->priv->root = gnode; size = etta->priv->root_visible ? node->num_visible_children + 1 : node->num_visible_children; - resize_map(etta, size); - fill_map(etta, 0, gnode); - e_table_model_changed(E_TABLE_MODEL(etta)); + resize_map (etta, size); + fill_map (etta, 0, gnode); + e_table_model_changed (E_TABLE_MODEL (etta)); } static void -insert_node(ETreeTableAdapter *etta, ETreePath parent, ETreePath path) +insert_node (ETreeTableAdapter *etta, ETreePath parent, ETreePath path) { GNode *gnode, *parent_gnode; node_t *node, *parent_node; gboolean expandable; gint size, row; - e_table_model_pre_change(E_TABLE_MODEL(etta)); + e_table_model_pre_change (E_TABLE_MODEL (etta)); - if (get_node(etta, path)) { - e_table_model_no_change(E_TABLE_MODEL(etta)); + if (get_node (etta, path)) { + e_table_model_no_change (E_TABLE_MODEL (etta)); return; } - parent_gnode = lookup_gnode(etta, parent); + parent_gnode = lookup_gnode (etta, parent); if (!parent_gnode) { - ETreePath grandparent = e_tree_model_node_get_parent(etta->priv->source, parent); - if (e_tree_model_node_is_root(etta->priv->source, parent)) - generate_tree(etta, parent); + ETreePath grandparent = e_tree_model_node_get_parent (etta->priv->source, parent); + if (e_tree_model_node_is_root (etta->priv->source, parent)) + generate_tree (etta, parent); else - insert_node(etta, grandparent, parent); - e_table_model_changed(E_TABLE_MODEL(etta)); + insert_node (etta, grandparent, parent); + e_table_model_changed (E_TABLE_MODEL (etta)); return; } parent_node = (node_t *) parent_gnode->data; if (parent_gnode != etta->priv->root) { - expandable = e_tree_model_node_is_expandable(etta->priv->source, parent); + expandable = e_tree_model_node_is_expandable (etta->priv->source, parent); if (parent_node->expandable != expandable) { - e_table_model_pre_change(E_TABLE_MODEL(etta)); + e_table_model_pre_change (E_TABLE_MODEL (etta)); parent_node->expandable = expandable; parent_node->expandable_set = 1; - e_table_model_row_changed(E_TABLE_MODEL(etta), parent_node->index); + e_table_model_row_changed (E_TABLE_MODEL (etta), parent_node->index); } } if (!e_tree_table_adapter_node_is_expanded (etta, parent)) { - e_table_model_no_change(E_TABLE_MODEL(etta)); + e_table_model_no_change (E_TABLE_MODEL (etta)); return; } - gnode = create_gnode(etta, path); + gnode = create_gnode (etta, path); node = (node_t *) gnode->data; if (node->expanded) - node->num_visible_children = insert_children(etta, gnode); + node->num_visible_children = insert_children (etta, gnode); - g_node_append(parent_gnode, gnode); - update_child_counts(parent_gnode, node->num_visible_children + 1); - resort_node(etta, parent_gnode, FALSE); - resort_node(etta, gnode, TRUE); + g_node_append (parent_gnode, gnode); + update_child_counts (parent_gnode, node->num_visible_children + 1); + resort_node (etta, parent_gnode, FALSE); + resort_node (etta, gnode, TRUE); size = node->num_visible_children + 1; - resize_map(etta, etta->priv->n_map + size); + resize_map (etta, etta->priv->n_map + size); if (parent_gnode == etta->priv->root) row = 0; else { gint new_size = parent_node->num_visible_children + 1; gint old_size = new_size - size; row = parent_node->index; - move_map_elements(etta, row + new_size, row + old_size, etta->priv->n_map - row - new_size); + move_map_elements (etta, row + new_size, row + old_size, etta->priv->n_map - row - new_size); } - fill_map(etta, row, parent_gnode); - e_table_model_rows_inserted(E_TABLE_MODEL(etta), get_row(etta, path), size); + fill_map (etta, row, parent_gnode); + e_table_model_rows_inserted (E_TABLE_MODEL (etta), get_row (etta, path), size); } typedef struct { @@ -466,43 +466,43 @@ typedef struct { } check_expanded_closure; static gboolean -check_expanded(GNode *gnode, gpointer data) +check_expanded (GNode *gnode, gpointer data) { check_expanded_closure *closure = (check_expanded_closure *) data; node_t *node = (node_t *) gnode->data; if (node->expanded != closure->expanded) - closure->paths = g_slist_prepend(closure->paths, node->path); + closure->paths = g_slist_prepend (closure->paths, node->path); return FALSE; } static void -update_node(ETreeTableAdapter *etta, ETreePath path) +update_node (ETreeTableAdapter *etta, ETreePath path) { check_expanded_closure closure; - ETreePath parent = e_tree_model_node_get_parent(etta->priv->source, path); - GNode *gnode = lookup_gnode(etta, path); + ETreePath parent = e_tree_model_node_get_parent (etta->priv->source, path); + GNode *gnode = lookup_gnode (etta, path); GSList *l; closure.expanded = e_tree_model_get_expanded_default (etta->priv->source); closure.paths = NULL; if (gnode) - g_node_traverse(gnode, G_POST_ORDER, G_TRAVERSE_ALL, -1, check_expanded, &closure); + g_node_traverse (gnode, G_POST_ORDER, G_TRAVERSE_ALL, -1, check_expanded, &closure); - if (e_tree_model_node_is_root(etta->priv->source, path)) - generate_tree(etta, path); + if (e_tree_model_node_is_root (etta->priv->source, path)) + generate_tree (etta, path); else { - delete_node(etta, parent, path); - insert_node(etta, parent, path); + delete_node (etta, parent, path); + insert_node (etta, parent, path); } for (l = closure.paths; l; l = l->next) - if (lookup_gnode(etta, l->data)) + if (lookup_gnode (etta, l->data)) e_tree_table_adapter_node_set_expanded (etta, l->data, !closure.expanded); - g_slist_free(closure.paths); + g_slist_free (closure.paths); } static void @@ -516,7 +516,7 @@ etta_finalize (GObject *object) } if (etta->priv->root) { - kill_gnode(etta->priv->root, etta); + kill_gnode (etta->priv->root, etta); etta->priv->root = NULL; } @@ -535,14 +535,14 @@ etta_dispose (GObject *object) ETreeTableAdapter *etta = E_TREE_TABLE_ADAPTER (object); if (etta->priv->sort_info) { - g_signal_handler_disconnect(G_OBJECT (etta->priv->sort_info), + g_signal_handler_disconnect (G_OBJECT (etta->priv->sort_info), etta->priv->sort_info_changed_id); - g_object_unref(etta->priv->sort_info); + g_object_unref (etta->priv->sort_info); etta->priv->sort_info = NULL; } if (etta->priv->header) { - g_object_unref(etta->priv->header); + g_object_unref (etta->priv->header); etta->priv->header = NULL; } @@ -594,7 +594,7 @@ etta_get_save_id (ETableModel *etm, gint row) { ETreeTableAdapter *etta = (ETreeTableAdapter *)etm; - return e_tree_model_get_save_id (etta->priv->source, get_path(etta, row)); + return e_tree_model_get_save_id (etta->priv->source, get_path (etta, row)); } static gboolean @@ -722,7 +722,7 @@ etta_class_init (ETreeTableAdapterClass *klass) klass->sorting_changed = NULL; - signals [SORTING_CHANGED] = + signals[SORTING_CHANGED] = g_signal_new ("sorting_changed", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -735,7 +735,7 @@ etta_class_init (ETreeTableAdapterClass *klass) static void etta_init (ETreeTableAdapter *etta) { - etta->priv = g_new(ETreeTableAdapterPriv, 1); + etta->priv = g_new (ETreeTableAdapterPriv, 1); etta->priv->source = NULL; etta->priv->sort_info = NULL; @@ -766,13 +766,13 @@ etta_init (ETreeTableAdapter *etta) static void etta_proxy_pre_change (ETreeModel *etm, ETreeTableAdapter *etta) { - e_table_model_pre_change(E_TABLE_MODEL(etta)); + e_table_model_pre_change (E_TABLE_MODEL (etta)); } static void etta_proxy_no_change (ETreeModel *etm, ETreeTableAdapter *etta) { - e_table_model_no_change(E_TABLE_MODEL(etta)); + e_table_model_no_change (E_TABLE_MODEL (etta)); } static void @@ -783,7 +783,7 @@ etta_proxy_rebuilt (ETreeModel *etm, ETreeTableAdapter *etta) kill_gnode (etta->priv->root, etta); etta->priv->root = NULL; g_hash_table_destroy (etta->priv->nodes); - etta->priv->nodes = g_hash_table_new(NULL, NULL); + etta->priv->nodes = g_hash_table_new (NULL, NULL); } static gboolean @@ -797,8 +797,8 @@ resort_model (ETreeTableAdapter *etta) static void etta_proxy_node_changed (ETreeModel *etm, ETreePath path, ETreeTableAdapter *etta) { - update_node(etta, path); - e_table_model_changed(E_TABLE_MODEL(etta)); + update_node (etta, path); + e_table_model_changed (E_TABLE_MODEL (etta)); /* FIXME: Really it shouldnt be required. But a lot of thread * which were supposed to be present in the list is way below @@ -810,51 +810,51 @@ etta_proxy_node_changed (ETreeModel *etm, ETreePath path, ETreeTableAdapter *ett static void etta_proxy_node_data_changed (ETreeModel *etm, ETreePath path, ETreeTableAdapter *etta) { - gint row = get_row(etta, path); + gint row = get_row (etta, path); if (row == -1) { - e_table_model_no_change(E_TABLE_MODEL(etta)); + e_table_model_no_change (E_TABLE_MODEL (etta)); return; } - e_table_model_row_changed(E_TABLE_MODEL(etta), row); + e_table_model_row_changed (E_TABLE_MODEL (etta), row); } static void etta_proxy_node_col_changed (ETreeModel *etm, ETreePath path, gint col, ETreeTableAdapter *etta) { - gint row = get_row(etta, path); + gint row = get_row (etta, path); if (row == -1) { - e_table_model_no_change(E_TABLE_MODEL(etta)); + e_table_model_no_change (E_TABLE_MODEL (etta)); return; } - e_table_model_cell_changed(E_TABLE_MODEL(etta), col, row); + e_table_model_cell_changed (E_TABLE_MODEL (etta), col, row); } static void etta_proxy_node_inserted (ETreeModel *etm, ETreePath parent, ETreePath child, ETreeTableAdapter *etta) { - if (e_tree_model_node_is_root(etm, child)) - generate_tree(etta, child); + if (e_tree_model_node_is_root (etm, child)) + generate_tree (etta, child); else - insert_node(etta, parent, child); + insert_node (etta, parent, child); - e_table_model_changed(E_TABLE_MODEL(etta)); + e_table_model_changed (E_TABLE_MODEL (etta)); } static void 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)); + delete_node (etta, parent, child); + e_table_model_changed (E_TABLE_MODEL (etta)); } static void etta_proxy_node_request_collapse (ETreeModel *etm, ETreePath node, ETreeTableAdapter *etta) { - e_tree_table_adapter_node_set_expanded(etta, node, FALSE); + e_tree_table_adapter_node_set_expanded (etta, node, FALSE); } static void @@ -868,16 +868,16 @@ etta_sort_info_changed (ETableSortInfo *sort_info, ETreeTableAdapter *etta) if (sort_info) { gboolean handled = FALSE; - g_signal_emit (etta, signals [SORTING_CHANGED], 0, &handled); + g_signal_emit (etta, signals[SORTING_CHANGED], 0, &handled); if (handled) return; } - e_table_model_pre_change(E_TABLE_MODEL(etta)); - resort_node(etta, etta->priv->root, TRUE); - fill_map(etta, 0, etta->priv->root); - e_table_model_changed(E_TABLE_MODEL(etta)); + e_table_model_pre_change (E_TABLE_MODEL (etta)); + resort_node (etta, etta->priv->root, TRUE); + fill_map (etta, 0, etta->priv->root); + e_table_model_changed (E_TABLE_MODEL (etta)); } ETableModel * @@ -890,21 +890,21 @@ e_tree_table_adapter_construct (ETreeTableAdapter *etta, ETreeModel *source, ETa etta->priv->sort_info = sort_info; if (sort_info) { - g_object_ref(sort_info); + g_object_ref (sort_info); etta->priv->sort_info_changed_id = g_signal_connect (G_OBJECT (sort_info), "sort_info_changed", G_CALLBACK (etta_sort_info_changed), etta); } etta->priv->header = header; if (header) - g_object_ref(header); + g_object_ref (header); - etta->priv->nodes = g_hash_table_new(NULL, NULL); + etta->priv->nodes = g_hash_table_new (NULL, NULL); root = e_tree_model_get_root (source); if (root) - generate_tree(etta, root); + generate_tree (etta, root); etta->priv->pre_change_id = g_signal_connect(G_OBJECT(source), "pre_change", G_CALLBACK (etta_proxy_pre_change), etta); @@ -953,10 +953,10 @@ save_expanded_state_func (gpointer keyp, gpointer value, gpointer data) xmlNode *xmlnode; if (node->expanded != tar->expanded_default) { - gchar *save_id = e_tree_model_get_save_id(tar->model, path); + gchar *save_id = e_tree_model_get_save_id (tar->model, path); 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); + g_free (save_id); } } @@ -975,7 +975,7 @@ e_tree_table_adapter_save_expanded_state_xml (ETreeTableAdapter *etta) tar.model = etta->priv->source; tar.root = root; - tar.expanded_default = e_tree_model_get_expanded_default(etta->priv->source); + tar.expanded_default = e_tree_model_get_expanded_default (etta->priv->source); 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); @@ -1065,9 +1065,9 @@ e_tree_table_adapter_load_expanded_state_xml (ETreeTableAdapter *etta, xmlDoc *d root = xmlDocGetRootElement (doc); - e_table_model_pre_change(E_TABLE_MODEL(etta)); + e_table_model_pre_change (E_TABLE_MODEL (etta)); - model_default = e_tree_model_get_expanded_default(etta->priv->source); + model_default = e_tree_model_get_expanded_default (etta->priv->source); if (!strcmp ((gchar *)root->name, "expanded_state")) { gchar *state; @@ -1101,13 +1101,13 @@ e_tree_table_adapter_load_expanded_state_xml (ETreeTableAdapter *etta, xmlDoc *d id = e_xml_get_string_prop_by_name_with_default (child, (const guchar *)"id", ""); if (!strcmp(id, "")) { - g_free(id); + g_free (id); continue; } - path = e_tree_model_get_node_by_id(etta->priv->source, id); + path = e_tree_model_get_node_by_id (etta->priv->source, id); if (path) - e_tree_table_adapter_node_set_expanded(etta, path, !model_default); + e_tree_table_adapter_node_set_expanded (etta, path, !model_default); g_free (id); } @@ -1120,9 +1120,9 @@ e_tree_table_adapter_load_expanded_state (ETreeTableAdapter *etta, const gchar * { xmlDoc *doc; - g_return_if_fail(etta != NULL); + g_return_if_fail (etta != NULL); - doc = open_file(etta, filename); + doc = open_file (etta, filename); if (!doc) return; @@ -1141,25 +1141,25 @@ e_tree_table_adapter_root_node_set_visible (ETreeTableAdapter *etta, gboolean vi if (etta->priv->root_visible == visible) return; - e_table_model_pre_change (E_TABLE_MODEL(etta)); + e_table_model_pre_change (E_TABLE_MODEL (etta)); etta->priv->root_visible = visible; if (!visible) { - ETreePath root = e_tree_model_get_root(etta->priv->source); + ETreePath root = e_tree_model_get_root (etta->priv->source); if (root) - e_tree_table_adapter_node_set_expanded(etta, root, TRUE); + e_tree_table_adapter_node_set_expanded (etta, root, TRUE); } size = (visible ? 1 : 0) + (etta->priv->root ? ((node_t *)etta->priv->root->data)->num_visible_children : 0); - resize_map(etta, size); + resize_map (etta, size); if (etta->priv->root) - fill_map(etta, 0, etta->priv->root); - e_table_model_changed(E_TABLE_MODEL(etta)); + fill_map (etta, 0, etta->priv->root); + e_table_model_changed (E_TABLE_MODEL (etta)); } void e_tree_table_adapter_node_set_expanded (ETreeTableAdapter *etta, ETreePath path, gboolean expanded) { - GNode *gnode = lookup_gnode(etta, path); + GNode *gnode = lookup_gnode (etta, path); node_t *node; gint row; @@ -1167,12 +1167,12 @@ e_tree_table_adapter_node_set_expanded (ETreeTableAdapter *etta, ETreePath path, return; if (!gnode && expanded) { - ETreePath parent = e_tree_model_node_get_parent(etta->priv->source, path); - g_return_if_fail(parent != NULL); - e_tree_table_adapter_node_set_expanded(etta, parent, expanded); - gnode = lookup_gnode(etta, path); + ETreePath parent = e_tree_model_node_get_parent (etta->priv->source, path); + g_return_if_fail (parent != NULL); + e_tree_table_adapter_node_set_expanded (etta, parent, expanded); + gnode = lookup_gnode (etta, path); } - g_return_if_fail(gnode != NULL); + g_return_if_fail (gnode != NULL); node = (node_t *) gnode->data; @@ -1181,36 +1181,36 @@ e_tree_table_adapter_node_set_expanded (ETreeTableAdapter *etta, ETreePath path, node->expanded = expanded; - row = get_row(etta, path); + row = get_row (etta, path); if (row == -1) return; - e_table_model_pre_change (E_TABLE_MODEL(etta)); - e_table_model_pre_change (E_TABLE_MODEL(etta)); - e_table_model_row_changed(E_TABLE_MODEL(etta), row); + e_table_model_pre_change (E_TABLE_MODEL (etta)); + e_table_model_pre_change (E_TABLE_MODEL (etta)); + e_table_model_row_changed (E_TABLE_MODEL (etta), row); if (expanded) { - 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); - resize_map(etta, etta->priv->n_map + num_children); - move_map_elements(etta, row + 1 + num_children, row + 1, etta->priv->n_map - row - 1 - num_children); - fill_map(etta, row, 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); + resize_map (etta, etta->priv->n_map + num_children); + move_map_elements (etta, row + 1 + num_children, row + 1, etta->priv->n_map - row - 1 - num_children); + fill_map (etta, row, gnode); if (num_children != 0) { - e_table_model_rows_inserted(E_TABLE_MODEL(etta), row + 1, num_children); + e_table_model_rows_inserted (E_TABLE_MODEL (etta), row + 1, num_children); } else - e_table_model_no_change(E_TABLE_MODEL(etta)); + e_table_model_no_change (E_TABLE_MODEL (etta)); } else { - gint 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)); + e_table_model_no_change (E_TABLE_MODEL (etta)); return; } - move_map_elements(etta, row + 1, row + 1 + num_children, etta->priv->n_map - row - 1 - num_children); - update_child_counts(gnode, - num_children); - resize_map(etta, etta->priv->n_map - num_children); - e_table_model_rows_deleted(E_TABLE_MODEL(etta), row + 1, num_children); + move_map_elements (etta, row + 1, row + 1 + num_children, etta->priv->n_map - row - 1 - num_children); + update_child_counts (gnode, - num_children); + resize_map (etta, etta->priv->n_map - num_children); + e_table_model_rows_deleted (E_TABLE_MODEL (etta), row + 1, num_children); } } @@ -1219,29 +1219,29 @@ e_tree_table_adapter_node_set_expanded_recurse (ETreeTableAdapter *etta, ETreePa { ETreePath children; - e_tree_table_adapter_node_set_expanded(etta, path, expanded); + e_tree_table_adapter_node_set_expanded (etta, path, expanded); - for (children = e_tree_model_node_get_first_child(etta->priv->source, path); + for (children = e_tree_model_node_get_first_child (etta->priv->source, path); children; - children = e_tree_model_node_get_next(etta->priv->source, children)) { - e_tree_table_adapter_node_set_expanded_recurse(etta, children, expanded); + children = e_tree_model_node_get_next (etta->priv->source, children)) { + e_tree_table_adapter_node_set_expanded_recurse (etta, children, expanded); } } ETreePath e_tree_table_adapter_node_at_row (ETreeTableAdapter *etta, gint row) { - return get_path(etta, row); + return get_path (etta, row); } gint e_tree_table_adapter_row_of_node (ETreeTableAdapter *etta, ETreePath path) { - return get_row(etta, path); + return get_row (etta, path); } gboolean -e_tree_table_adapter_root_node_is_visible(ETreeTableAdapter *etta) +e_tree_table_adapter_root_node_is_visible (ETreeTableAdapter *etta) { return etta->priv->root_visible; } @@ -1251,18 +1251,18 @@ e_tree_table_adapter_show_node (ETreeTableAdapter *etta, ETreePath path) { ETreePath parent; - parent = e_tree_model_node_get_parent(etta->priv->source, path); + parent = e_tree_model_node_get_parent (etta->priv->source, path); while (parent) { - e_tree_table_adapter_node_set_expanded(etta, parent, TRUE); - parent = e_tree_model_node_get_parent(etta->priv->source, parent); + e_tree_table_adapter_node_set_expanded (etta, parent, TRUE); + parent = e_tree_model_node_get_parent (etta->priv->source, parent); } } gboolean e_tree_table_adapter_node_is_expanded (ETreeTableAdapter *etta, ETreePath path) { - node_t *node = get_node(etta, path); + node_t *node = get_node (etta, path); if (!e_tree_model_node_is_expandable (etta->priv->source, path) || !node) return FALSE; @@ -1273,25 +1273,25 @@ void e_tree_table_adapter_set_sort_info (ETreeTableAdapter *etta, ETableSortInfo *sort_info) { if (etta->priv->sort_info) { - g_signal_handler_disconnect(G_OBJECT(etta->priv->sort_info), + g_signal_handler_disconnect (G_OBJECT (etta->priv->sort_info), etta->priv->sort_info_changed_id); - g_object_unref(etta->priv->sort_info); + g_object_unref (etta->priv->sort_info); } etta->priv->sort_info = sort_info; if (sort_info) { - g_object_ref(sort_info); + g_object_ref (sort_info); etta->priv->sort_info_changed_id = g_signal_connect(G_OBJECT(sort_info), "sort_info_changed", - G_CALLBACK(etta_sort_info_changed), etta); + G_CALLBACK (etta_sort_info_changed), etta); } if (!etta->priv->root) return; - e_table_model_pre_change(E_TABLE_MODEL(etta)); - resort_node(etta, etta->priv->root, TRUE); - fill_map(etta, 0, etta->priv->root); - e_table_model_changed(E_TABLE_MODEL(etta)); + e_table_model_pre_change (E_TABLE_MODEL (etta)); + resort_node (etta, etta->priv->root, TRUE); + fill_map (etta, 0, etta->priv->root); + e_table_model_changed (E_TABLE_MODEL (etta)); } ETableSortInfo * diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c index f0a007c097..be1f8937a6 100644 --- a/widgets/table/e-tree.c +++ b/widgets/table/e-tree.c @@ -203,33 +203,33 @@ static void et_drag_begin (GtkWidget *widget, static void et_drag_end (GtkWidget *widget, GdkDragContext *context, ETree *et); -static void et_drag_data_get(GtkWidget *widget, +static void et_drag_data_get (GtkWidget *widget, GdkDragContext *context, GtkSelectionData *selection_data, guint info, guint time, ETree *et); -static void et_drag_data_delete(GtkWidget *widget, +static void et_drag_data_delete (GtkWidget *widget, GdkDragContext *context, ETree *et); -static void et_drag_leave(GtkWidget *widget, +static void et_drag_leave (GtkWidget *widget, GdkDragContext *context, guint time, ETree *et); -static gboolean et_drag_motion(GtkWidget *widget, +static gboolean et_drag_motion (GtkWidget *widget, GdkDragContext *context, gint x, gint y, guint time, ETree *et); -static gboolean et_drag_drop(GtkWidget *widget, +static gboolean et_drag_drop (GtkWidget *widget, GdkDragContext *context, gint x, gint y, guint time, ETree *et); -static void et_drag_data_received(GtkWidget *widget, +static void et_drag_data_received (GtkWidget *widget, GdkDragContext *context, gint x, gint y, @@ -328,9 +328,9 @@ disconnect_header (ETree *e_tree) g_signal_handler_disconnect (G_OBJECT (e_tree->priv->sort_info), e_tree->priv->group_info_change_id); - g_object_unref(e_tree->priv->sort_info); + g_object_unref (e_tree->priv->sort_info); } - g_object_unref(e_tree->priv->header); + g_object_unref (e_tree->priv->header); e_tree->priv->header = NULL; e_tree->priv->sort_info = NULL; } @@ -344,7 +344,7 @@ connect_header (ETree *e_tree, ETableState *state) disconnect_header (e_tree); e_tree->priv->header = e_table_state_to_header ( - GTK_WIDGET(e_tree), e_tree->priv->full_header, state); + GTK_WIDGET (e_tree), e_tree->priv->full_header, state); e_tree->priv->structure_change_id = g_signal_connect ( e_tree->priv->header, "structure_change", @@ -355,7 +355,7 @@ connect_header (ETree *e_tree, ETableState *state) G_CALLBACK (change_trigger), e_tree); if (state->sort_info) { - e_tree->priv->sort_info = e_table_sort_info_duplicate(state->sort_info); + e_tree->priv->sort_info = e_table_sort_info_duplicate (state->sort_info); e_table_sort_info_set_can_group (e_tree->priv->sort_info, FALSE); e_tree->priv->sort_info_change_id = g_signal_connect ( e_tree->priv->sort_info, "sort_info_changed", @@ -391,7 +391,7 @@ et_dispose (GObject *object) } if (et->priv->reflow_idle_id) - g_source_remove(et->priv->reflow_idle_id); + g_source_remove (et->priv->reflow_idle_id); et->priv->reflow_idle_id = 0; scroll_off (et); @@ -424,7 +424,7 @@ et_dispose (GObject *object) e_tree_drag_source_unset (et); if (et->priv->last_drop_context) - g_object_weak_unref (G_OBJECT(et->priv->last_drop_context), context_destroyed, et); + g_object_weak_unref (G_OBJECT (et->priv->last_drop_context), context_destroyed, et); et->priv->last_drop_context = NULL; if (et->priv->info_text) @@ -434,7 +434,7 @@ et_dispose (GObject *object) gtk_widget_destroy (GTK_WIDGET (et->priv->table_canvas)); - g_free(et->priv); + g_free (et->priv); et->priv = NULL; } @@ -552,7 +552,7 @@ e_tree_init (ETree *e_tree) gtk_table_set_homogeneous (GTK_TABLE (e_tree), FALSE); - e_tree->priv = g_new(ETreePriv, 1); + e_tree->priv = g_new (ETreePriv, 1); e_tree->priv->model = NULL; e_tree->priv->etta = NULL; @@ -633,7 +633,7 @@ e_tree_init (ETree *e_tree) e_tree->priv->white_item = NULL; e_tree->priv->item = NULL; - e_tree->priv->search = e_table_search_new(); + e_tree->priv->search = e_table_search_new (); e_tree->priv->search_search_id = g_signal_connect (G_OBJECT (e_tree->priv->search), "search", @@ -740,7 +740,7 @@ e_tree_setup_header (ETree *e_tree) "tree", e_tree, NULL); - g_free(pointer); + g_free (pointer); g_signal_connect ( e_tree->priv->header_canvas, "size_allocate", @@ -767,7 +767,7 @@ scroll_to_cursor (ETree *e_tree) x = y = w = h = 0; if (path) { - gint row = e_tree_row_of_node(e_tree, path); + gint row = e_tree_row_of_node (e_tree, path); gint col = 0; if (row >= 0) @@ -806,7 +806,7 @@ tree_canvas_reflow_idle (ETree *e_tree) "height", &height, "width", &width, NULL); height = MAX ((gint)height, allocation.height); - width = MAX((gint)width, allocation.width); + width = MAX ((gint)width, allocation.width); /* I have no idea why this needs to be -1, but it works. */ gnome_canvas_get_scroll_region ( @@ -854,8 +854,8 @@ tree_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, g_free (val); if (e_tree->priv->reflow_idle_id) - g_source_remove(e_tree->priv->reflow_idle_id); - tree_canvas_reflow_idle(e_tree); + g_source_remove (e_tree->priv->reflow_idle_id); + tree_canvas_reflow_idle (e_tree); scroll_to_cursor (e_tree); } @@ -871,7 +871,7 @@ tree_canvas_reflow (GnomeCanvas *canvas, ETree *e_tree) static void item_cursor_change (ETableItem *eti, gint row, ETree *et) { - ETreePath path = e_tree_table_adapter_node_at_row(et->priv->etta, row); + ETreePath path = e_tree_table_adapter_node_at_row (et->priv->etta, row); g_signal_emit (et, et_signals[CURSOR_CHANGE], 0, row, path); } @@ -879,7 +879,7 @@ item_cursor_change (ETableItem *eti, gint row, ETree *et) static void item_cursor_activated (ETableItem *eti, gint row, ETree *et) { - ETreePath path = e_tree_table_adapter_node_at_row(et->priv->etta, row); + ETreePath path = e_tree_table_adapter_node_at_row (et->priv->etta, row); g_signal_emit (et, et_signals[CURSOR_ACTIVATED], 0, row, path); } @@ -887,7 +887,7 @@ item_cursor_activated (ETableItem *eti, gint row, ETree *et) static void 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); + ETreePath path = e_tree_table_adapter_node_at_row (et->priv->etta, row); g_signal_emit (et, et_signals[DOUBLE_CLICK], 0, row, path, col, event); } @@ -895,7 +895,7 @@ item_double_click (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree * static gboolean item_right_click (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et) { - ETreePath path = e_tree_table_adapter_node_at_row(et->priv->etta, row); + ETreePath path = e_tree_table_adapter_node_at_row (et->priv->etta, row); gboolean return_val = 0; g_signal_emit ( @@ -909,7 +909,7 @@ static gboolean item_click (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et) { gboolean return_val = 0; - ETreePath path = e_tree_table_adapter_node_at_row(et->priv->etta, row); + ETreePath path = e_tree_table_adapter_node_at_row (et->priv->etta, row); g_signal_emit ( et, et_signals[CLICK], 0, row, path, col, event, &return_val); @@ -945,7 +945,7 @@ item_key_press (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et) e_tree_get_cell_at (et, 30, y, &row_local, &col_local); if (row_local == -1) - row_local = e_table_model_row_count (E_TABLE_MODEL(et->priv->etta)) - 1; + row_local = e_table_model_row_count (E_TABLE_MODEL (et->priv->etta)) - 1; row_local = e_tree_view_to_model_row (et, row_local); col_local = e_selection_model_cursor_col ( @@ -963,7 +963,7 @@ item_key_press (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et) e_tree_get_cell_at (et, 30, y, &row_local, &col_local); if (row_local == -1) - row_local = e_table_model_row_count (E_TABLE_MODEL(et->priv->etta)) - 1; + row_local = e_table_model_row_count (E_TABLE_MODEL (et->priv->etta)) - 1; row_local = e_tree_view_to_model_row (et, row_local); col_local = e_selection_model_cursor_col ( @@ -984,7 +984,7 @@ item_key_press (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et) GDK_MOD1_MASK)) != GDK_SHIFT_MASK) break; if (row != -1) { - path = e_tree_table_adapter_node_at_row(et->priv->etta, row); + path = e_tree_table_adapter_node_at_row (et->priv->etta, row); if (path) e_tree_table_adapter_node_set_expanded (et->priv->etta, path, TRUE); } @@ -1000,7 +1000,7 @@ item_key_press (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et) GDK_MOD1_MASK)) != GDK_SHIFT_MASK) break; if (row != -1) { - path = e_tree_table_adapter_node_at_row(et->priv->etta, row); + path = e_tree_table_adapter_node_at_row (et->priv->etta, row); if (path) e_tree_table_adapter_node_set_expanded (et->priv->etta, path, FALSE); } @@ -1019,7 +1019,7 @@ item_key_press (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et) (key->keyval >= GDK_0 && key->keyval <= GDK_9))) { e_table_search_input_character (et->priv->search, key->keyval); } - path = e_tree_table_adapter_node_at_row(et->priv->etta, row); + path = e_tree_table_adapter_node_at_row (et->priv->etta, row); g_signal_emit (et, et_signals[KEY_PRESS], 0, row, path, col, event, &return_val); @@ -1034,7 +1034,7 @@ item_start_drag (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et ETreePath path; gint return_val = 0; - path = e_tree_table_adapter_node_at_row(et->priv->etta, row); + path = e_tree_table_adapter_node_at_row (et->priv->etta, row); g_signal_emit ( et, et_signals[START_DRAG], 0, @@ -1063,7 +1063,7 @@ et_build_item (ETree *et) et->priv->item = gnome_canvas_item_new ( GNOME_CANVAS_GROUP ( gnome_canvas_root (et->priv->table_canvas)), - e_table_item_get_type(), + e_table_item_get_type (), "ETableHeader", et->priv->header, "ETableModel", et->priv->etta, "selection_model", et->priv->selection, @@ -1099,8 +1099,8 @@ et_canvas_style_set (GtkWidget *widget, GtkStyle *prev_style) style = gtk_widget_get_style (widget); - gnome_canvas_item_set( - E_TREE(widget)->priv->white_item, + gnome_canvas_item_set ( + E_TREE (widget)->priv->white_item, "fill_color_gdk", &style->base[GTK_STATE_NORMAL], NULL); } @@ -1124,10 +1124,10 @@ et_canvas_root_event (GnomeCanvasItem *root, GdkEvent *event, ETree *e_tree) case GDK_BUTTON_RELEASE: if (event->button.button != 4 && event->button.button != 5) { if (gtk_widget_has_focus (GTK_WIDGET (root->canvas))) { - GnomeCanvasItem *item = GNOME_CANVAS(root->canvas)->focused_item; + GnomeCanvasItem *item = GNOME_CANVAS (root->canvas)->focused_item; - if (E_IS_TABLE_ITEM(item)) { - e_table_item_leave_edit(E_TABLE_ITEM(item)); + if (E_IS_TABLE_ITEM (item)) { + e_table_item_leave_edit (E_TABLE_ITEM (item)); return TRUE; } } @@ -1218,7 +1218,7 @@ e_tree_setup_table (ETree *e_tree) e_tree->priv->white_item = gnome_canvas_item_new ( gnome_canvas_root (e_tree->priv->table_canvas), - e_canvas_background_get_type(), + e_canvas_background_get_type (), "fill_color_gdk", &style->base[GTK_STATE_NORMAL], NULL); @@ -1227,9 +1227,9 @@ e_tree_setup_table (ETree *e_tree) G_CALLBACK (white_item_event), e_tree); g_signal_connect ( gnome_canvas_root (e_tree->priv->table_canvas), "event", - G_CALLBACK(et_canvas_root_event), e_tree); + G_CALLBACK (et_canvas_root_event), e_tree); - et_build_item(e_tree); + et_build_item (e_tree); } /** @@ -1255,7 +1255,7 @@ e_tree_set_search_column (ETree *e_tree, gint col) } void -e_tree_set_state_object(ETree *e_tree, ETableState *state) +e_tree_set_state_object (ETree *e_tree, ETableState *state) { GValue *val; GtkAllocation allocation; @@ -1274,13 +1274,13 @@ e_tree_set_state_object(ETree *e_tree, ETableState *state) g_free (val); if (e_tree->priv->header_item) - g_object_set(e_tree->priv->header_item, + g_object_set (e_tree->priv->header_item, "ETableHeader", e_tree->priv->header, "sort_info", e_tree->priv->sort_info, NULL); if (e_tree->priv->item) - g_object_set(e_tree->priv->item, + g_object_set (e_tree->priv->item, "ETableHeader", e_tree->priv->header, NULL); @@ -1304,17 +1304,17 @@ e_tree_set_state (ETree *e_tree, { ETableState *state; - g_return_if_fail(e_tree != NULL); - g_return_if_fail(E_IS_TREE(e_tree)); - g_return_if_fail(state_str != NULL); + g_return_if_fail (e_tree != NULL); + g_return_if_fail (E_IS_TREE (e_tree)); + g_return_if_fail (state_str != NULL); - state = e_table_state_new(); - e_table_state_load_from_string(state, state_str); + state = e_table_state_new (); + e_table_state_load_from_string (state, state_str); if (state->col_count > 0) - e_tree_set_state_object(e_tree, state); + e_tree_set_state_object (e_tree, state); - g_object_unref(state); + g_object_unref (state); } /** @@ -1331,17 +1331,17 @@ e_tree_load_state (ETree *e_tree, { ETableState *state; - g_return_if_fail(e_tree != NULL); - g_return_if_fail(E_IS_TREE(e_tree)); - g_return_if_fail(filename != NULL); + g_return_if_fail (e_tree != NULL); + g_return_if_fail (E_IS_TREE (e_tree)); + g_return_if_fail (filename != NULL); - state = e_table_state_new(); - e_table_state_load_from_file(state, filename); + state = e_table_state_new (); + e_table_state_load_from_file (state, filename); if (state->col_count > 0) - e_tree_set_state_object(e_tree, state); + e_tree_set_state_object (e_tree, state); - g_object_unref(state); + g_object_unref (state); } /** @@ -1361,20 +1361,20 @@ e_tree_get_state_object (ETree *e_tree) gint full_col_count; gint i, j; - state = e_table_state_new(); + state = e_table_state_new (); state->sort_info = e_tree->priv->sort_info; if (state->sort_info) - g_object_ref(state->sort_info); + g_object_ref (state->sort_info); state->col_count = e_table_header_count (e_tree->priv->header); full_col_count = e_table_header_count (e_tree->priv->full_header); - state->columns = g_new(int, state->col_count); - state->expansions = g_new(double, state->col_count); + state->columns = g_new (int, state->col_count); + state->expansions = g_new (double, state->col_count); for (i = 0; i < state->col_count; i++) { - ETableCol *col = e_table_header_get_column(e_tree->priv->header, i); + ETableCol *col = e_table_header_get_column (e_tree->priv->header, i); state->columns[i] = -1; for (j = 0; j < full_col_count; j++) { - if (col->col_idx == e_table_header_index(e_tree->priv->full_header, j)) { + if (col->col_idx == e_table_header_index (e_tree->priv->full_header, j)) { state->columns[i] = j; break; } @@ -1401,9 +1401,9 @@ e_tree_get_state (ETree *e_tree) ETableState *state; gchar *string; - state = e_tree_get_state_object(e_tree); - string = e_table_state_save_to_string(state); - g_object_unref(state); + state = e_tree_get_state_object (e_tree); + string = e_table_state_save_to_string (state); + g_object_unref (state); return string; } @@ -1421,9 +1421,9 @@ e_tree_save_state (ETree *e_tree, { ETableState *state; - state = e_tree_get_state_object(e_tree); - e_table_state_save_to_file(state, filename); - g_object_unref(state); + state = e_tree_get_state_object (e_tree); + e_table_state_save_to_file (state, filename); + g_object_unref (state); } /** @@ -1444,7 +1444,7 @@ static void et_table_model_changed (ETableModel *model, ETree *et) { if (et->priv->horizontal_scrolling) - e_table_header_update_horizontal(et->priv->header); + e_table_header_update_horizontal (et->priv->header); } static void @@ -1515,16 +1515,16 @@ et_real_construct (ETree *e_tree, ETreeModel *etm, ETableExtras *ete, gint row = 0; if (ete) - g_object_ref(ete); + g_object_ref (ete); else - ete = e_table_extras_new(); + ete = e_table_extras_new (); e_tree->priv->alternating_row_colors = specification->alternating_row_colors; e_tree->priv->horizontal_draw_grid = specification->horizontal_draw_grid; e_tree->priv->vertical_draw_grid = specification->vertical_draw_grid; e_tree->priv->draw_focus = specification->draw_focus; e_tree->priv->cursor_mode = specification->cursor_mode; - e_tree->priv->full_header = e_table_spec_to_full_header(specification, ete); + e_tree->priv->full_header = e_table_spec_to_full_header (specification, ete); connect_header (e_tree, state); @@ -1541,7 +1541,7 @@ et_real_construct (ETree *e_tree, ETreeModel *etm, ETableExtras *ete, gtk_widget_push_colormap (gdk_rgb_get_colormap ()); - e_tree->priv->sorter = e_sorter_new(); + e_tree->priv->sorter = e_sorter_new (); g_object_set (e_tree->priv->selection, "sorter", e_tree->priv->sorter, @@ -1591,7 +1591,7 @@ et_real_construct (ETree *e_tree, ETreeModel *etm, ETableExtras *ete, gtk_widget_pop_colormap (); - g_object_unref(ete); + g_object_unref (ete); return e_tree != NULL; } @@ -1616,29 +1616,29 @@ e_tree_construct (ETree *e_tree, ETreeModel *etm, ETableExtras *ete, ETableSpecification *specification; ETableState *state; - g_return_val_if_fail(e_tree != NULL, FALSE); - g_return_val_if_fail(E_IS_TREE(e_tree), FALSE); - g_return_val_if_fail(etm != NULL, FALSE); - g_return_val_if_fail(E_IS_TREE_MODEL(etm), FALSE); - g_return_val_if_fail(ete == NULL || E_IS_TABLE_EXTRAS(ete), FALSE); - g_return_val_if_fail(spec_str != NULL, FALSE); + g_return_val_if_fail (e_tree != NULL, FALSE); + g_return_val_if_fail (E_IS_TREE (e_tree), FALSE); + g_return_val_if_fail (etm != NULL, FALSE); + g_return_val_if_fail (E_IS_TREE_MODEL (etm), FALSE); + g_return_val_if_fail (ete == NULL || E_IS_TABLE_EXTRAS (ete), FALSE); + g_return_val_if_fail (spec_str != NULL, FALSE); - specification = e_table_specification_new(); - if (!e_table_specification_load_from_string(specification, spec_str)) { + specification = e_table_specification_new (); + if (!e_table_specification_load_from_string (specification, spec_str)) { g_object_unref (specification); return FALSE; } if (state_str) { - state = e_table_state_new(); - e_table_state_load_from_string(state, state_str); + state = e_table_state_new (); + e_table_state_load_from_string (state, state_str); if (state->col_count <= 0) { - g_object_unref(state); + g_object_unref (state); state = specification->state; - g_object_ref(state); + g_object_ref (state); } } else { state = specification->state; - g_object_ref(state); + g_object_ref (state); } if (!et_real_construct (e_tree, etm, ete, specification, state)) { @@ -1675,33 +1675,33 @@ e_tree_construct_from_spec_file (ETree *e_tree, ETreeModel *etm, ETableExtras *e ETableSpecification *specification; ETableState *state; - g_return_val_if_fail(e_tree != NULL, FALSE); - g_return_val_if_fail(E_IS_TREE(e_tree), FALSE); - g_return_val_if_fail(etm != NULL, FALSE); - g_return_val_if_fail(E_IS_TREE_MODEL(etm), FALSE); - g_return_val_if_fail(ete == NULL || E_IS_TABLE_EXTRAS(ete), FALSE); - g_return_val_if_fail(spec_fn != NULL, FALSE); + g_return_val_if_fail (e_tree != NULL, FALSE); + g_return_val_if_fail (E_IS_TREE (e_tree), FALSE); + g_return_val_if_fail (etm != NULL, FALSE); + g_return_val_if_fail (E_IS_TREE_MODEL (etm), FALSE); + g_return_val_if_fail (ete == NULL || E_IS_TABLE_EXTRAS (ete), FALSE); + g_return_val_if_fail (spec_fn != NULL, FALSE); - specification = e_table_specification_new(); - if (!e_table_specification_load_from_file(specification, spec_fn)) { - g_object_unref(specification); + specification = e_table_specification_new (); + if (!e_table_specification_load_from_file (specification, spec_fn)) { + g_object_unref (specification); return FALSE; } if (state_fn) { - state = e_table_state_new(); - if (!e_table_state_load_from_file(state, state_fn)) { - g_object_unref(state); + state = e_table_state_new (); + if (!e_table_state_load_from_file (state, state_fn)) { + g_object_unref (state); state = specification->state; - g_object_ref(state); + g_object_ref (state); } if (state->col_count <= 0) { - g_object_unref(state); + g_object_unref (state); state = specification->state; - g_object_ref(state); + g_object_ref (state); } } else { state = specification->state; - g_object_ref(state); + g_object_ref (state); } if (!et_real_construct (e_tree, etm, ete, specification, state)) { @@ -1712,7 +1712,7 @@ e_tree_construct_from_spec_file (ETree *e_tree, ETreeModel *etm, ETableExtras *e e_tree->priv->spec = specification; - g_object_unref(state); + g_object_unref (state); return TRUE; } @@ -1743,10 +1743,10 @@ e_tree_new (ETreeModel *etm, ETableExtras *ete, const gchar *spec, const gchar * { ETree *e_tree; - g_return_val_if_fail(etm != NULL, NULL); - g_return_val_if_fail(E_IS_TREE_MODEL(etm), NULL); - g_return_val_if_fail(ete == NULL || E_IS_TABLE_EXTRAS(ete), NULL); - g_return_val_if_fail(spec != NULL, NULL); + g_return_val_if_fail (etm != NULL, NULL); + g_return_val_if_fail (E_IS_TREE_MODEL (etm), NULL); + g_return_val_if_fail (ete == NULL || E_IS_TABLE_EXTRAS (ete), NULL); + g_return_val_if_fail (spec != NULL, NULL); e_tree = g_object_new (E_TREE_TYPE, NULL); @@ -1786,10 +1786,10 @@ e_tree_new_from_spec_file (ETreeModel *etm, { ETree *e_tree; - g_return_val_if_fail(etm != NULL, NULL); - g_return_val_if_fail(E_IS_TREE_MODEL(etm), NULL); - g_return_val_if_fail(ete == NULL || E_IS_TABLE_EXTRAS(ete), NULL); - g_return_val_if_fail(spec_fn != NULL, NULL); + g_return_val_if_fail (etm != NULL, NULL); + g_return_val_if_fail (E_IS_TREE_MODEL (etm), NULL); + g_return_val_if_fail (ete == NULL || E_IS_TABLE_EXTRAS (ete), NULL); + g_return_val_if_fail (spec_fn != NULL, NULL); e_tree = g_object_new (E_TREE_TYPE, NULL); @@ -1816,23 +1816,23 @@ e_tree_set_cursor (ETree *e_tree, ETreePath path) #ifndef E_TREE_USE_TREE_SELECTION gint row; #endif - g_return_if_fail(e_tree != NULL); - g_return_if_fail(E_IS_TREE(e_tree)); - g_return_if_fail(path != NULL); + g_return_if_fail (e_tree != NULL); + g_return_if_fail (E_IS_TREE (e_tree)); + g_return_if_fail (path != NULL); #ifdef E_TREE_USE_TREE_SELECTION e_tree_selection_model_select_single_path ( - E_TREE_SELECTION_MODEL(e_tree->priv->selection), path); + E_TREE_SELECTION_MODEL (e_tree->priv->selection), path); e_tree_selection_model_change_cursor ( - E_TREE_SELECTION_MODEL(e_tree->priv->selection), path); + E_TREE_SELECTION_MODEL (e_tree->priv->selection), path); #else row = e_tree_table_adapter_row_of_node ( - E_TREE_TABLE_ADAPTER(e_tree->priv->etta), path); + E_TREE_TABLE_ADAPTER (e_tree->priv->etta), path); if (row == -1) return; - g_object_set(e_tree->priv->selection, + g_object_set (e_tree->priv->selection, "cursor_row", row, NULL); #endif @@ -1843,20 +1843,20 @@ 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)); + E_TREE_SELECTION_MODEL (e_tree->priv->selection)); #else gint row; - g_return_val_if_fail(e_tree != NULL, NULL); - g_return_val_if_fail(E_IS_TREE(e_tree), NULL); + g_return_val_if_fail (e_tree != NULL, NULL); + g_return_val_if_fail (E_IS_TREE (e_tree), NULL); - g_object_get(e_tree->priv->selection, + g_object_get (e_tree->priv->selection, "cursor_row", &row, NULL); if (row == -1) return NULL; return e_tree_table_adapter_node_at_row ( - E_TREE_TABLE_ADAPTER(e_tree->priv->etta), row); + E_TREE_TABLE_ADAPTER (e_tree->priv->etta), row); #endif } @@ -1865,10 +1865,10 @@ e_tree_selected_row_foreach (ETree *e_tree, EForeachFunc callback, gpointer closure) { - g_return_if_fail(e_tree != NULL); - g_return_if_fail(E_IS_TREE(e_tree)); + g_return_if_fail (e_tree != NULL); + g_return_if_fail (E_IS_TREE (e_tree)); - e_selection_model_foreach(e_tree->priv->selection, + e_selection_model_foreach (e_tree->priv->selection, callback, closure); } @@ -1879,8 +1879,8 @@ e_tree_selected_path_foreach (ETree *e_tree, ETreeForeachFunc callback, gpointer closure) { - g_return_if_fail(e_tree != NULL); - g_return_if_fail(E_IS_TREE(e_tree)); + g_return_if_fail (e_tree != NULL); + g_return_if_fail (E_IS_TREE (e_tree)); e_tree_selection_model_foreach ( E_TREE_SELECTION_MODEL (e_tree->priv->selection), @@ -1896,10 +1896,10 @@ et_foreach_recurse (ETreeModel *model, { ETreePath child; - callback(path, closure); + callback (path, closure); - child = e_tree_model_node_get_first_child(E_TREE_MODEL(model), path); - for (; child; child = e_tree_model_node_get_next(E_TREE_MODEL(model), child)) + child = e_tree_model_node_get_first_child (E_TREE_MODEL (model), path); + for (; child; child = e_tree_model_node_get_next (E_TREE_MODEL (model), child)) if (child) et_foreach_recurse (model, child, callback, closure); } @@ -1911,8 +1911,8 @@ e_tree_path_foreach (ETree *e_tree, { ETreePath root; - g_return_if_fail(e_tree != NULL); - g_return_if_fail(E_IS_TREE(e_tree)); + g_return_if_fail (e_tree != NULL); + g_return_if_fail (E_IS_TREE (e_tree)); root = e_tree_model_get_root (e_tree->priv->model); @@ -1927,10 +1927,10 @@ e_tree_path_foreach (ETree *e_tree, EPrintable * e_tree_get_printable (ETree *e_tree) { - g_return_val_if_fail(e_tree != NULL, NULL); - g_return_val_if_fail(E_IS_TREE(e_tree), NULL); + g_return_val_if_fail (e_tree != NULL, NULL); + g_return_val_if_fail (E_IS_TREE (e_tree), NULL); - return e_table_item_get_printable(E_TABLE_ITEM(e_tree->priv->item)); + return e_table_item_get_printable (E_TABLE_ITEM (e_tree->priv->item)); } static void @@ -1974,7 +1974,7 @@ et_set_property (GObject *object, case PROP_LENGTH_THRESHOLD: etree->priv->length_threshold = g_value_get_int (value); if (etree->priv->item) { - gnome_canvas_item_set (GNOME_CANVAS_ITEM(etree->priv->item), + gnome_canvas_item_set (GNOME_CANVAS_ITEM (etree->priv->item), "length_threshold", etree->priv->length_threshold, NULL); } @@ -1983,7 +1983,7 @@ et_set_property (GObject *object, case PROP_HORIZONTAL_DRAW_GRID: etree->priv->horizontal_draw_grid = g_value_get_boolean (value); if (etree->priv->item) { - gnome_canvas_item_set (GNOME_CANVAS_ITEM(etree->priv->item), + gnome_canvas_item_set (GNOME_CANVAS_ITEM (etree->priv->item), "horizontal_draw_grid", etree->priv->horizontal_draw_grid, NULL); } @@ -1992,7 +1992,7 @@ et_set_property (GObject *object, case PROP_VERTICAL_DRAW_GRID: etree->priv->vertical_draw_grid = g_value_get_boolean (value); if (etree->priv->item) { - gnome_canvas_item_set (GNOME_CANVAS_ITEM(etree->priv->item), + gnome_canvas_item_set (GNOME_CANVAS_ITEM (etree->priv->item), "vertical_draw_grid", etree->priv->vertical_draw_grid, NULL); } @@ -2001,7 +2001,7 @@ et_set_property (GObject *object, case PROP_DRAW_FOCUS: etree->priv->draw_focus = g_value_get_boolean (value); if (etree->priv->item) { - gnome_canvas_item_set (GNOME_CANVAS_ITEM(etree->priv->item), + gnome_canvas_item_set (GNOME_CANVAS_ITEM (etree->priv->item), "drawfocus", etree->priv->draw_focus, NULL); } @@ -2010,7 +2010,7 @@ et_set_property (GObject *object, case PROP_UNIFORM_ROW_HEIGHT: etree->priv->uniform_row_height = g_value_get_boolean (value); if (etree->priv->item) { - gnome_canvas_item_set (GNOME_CANVAS_ITEM(etree->priv->item), + gnome_canvas_item_set (GNOME_CANVAS_ITEM (etree->priv->item), "uniform_row_height", etree->priv->uniform_row_height, NULL); } @@ -2046,7 +2046,7 @@ set_scroll_adjustments (ETree *tree, if (tree->priv->header_canvas != NULL) gtk_layout_set_hadjustment ( - GTK_LAYOUT(tree->priv->header_canvas), + GTK_LAYOUT (tree->priv->header_canvas), hadjustment); } } @@ -2055,19 +2055,19 @@ gint e_tree_get_next_row (ETree *e_tree, gint model_row) { - g_return_val_if_fail(e_tree != NULL, -1); - g_return_val_if_fail(E_IS_TREE(e_tree), -1); + g_return_val_if_fail (e_tree != NULL, -1); + g_return_val_if_fail (E_IS_TREE (e_tree), -1); if (e_tree->priv->sorter) { gint i; - i = e_sorter_model_to_sorted(E_SORTER (e_tree->priv->sorter), model_row); + 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))) { - return e_sorter_sorted_to_model(E_SORTER (e_tree->priv->sorter), i); + if (i < e_table_model_row_count (E_TABLE_MODEL (e_tree->priv->etta))) { + return e_sorter_sorted_to_model (E_SORTER (e_tree->priv->sorter), i); } else return -1; } else - if (model_row < e_table_model_row_count(E_TABLE_MODEL(e_tree->priv->etta)) - 1) + if (model_row < e_table_model_row_count (E_TABLE_MODEL (e_tree->priv->etta)) - 1) return model_row + 1; else return -1; @@ -2077,15 +2077,15 @@ gint e_tree_get_prev_row (ETree *e_tree, gint model_row) { - g_return_val_if_fail(e_tree != NULL, -1); - g_return_val_if_fail(E_IS_TREE(e_tree), -1); + g_return_val_if_fail (e_tree != NULL, -1); + g_return_val_if_fail (E_IS_TREE (e_tree), -1); if (e_tree->priv->sorter) { gint i; - i = e_sorter_model_to_sorted(E_SORTER (e_tree->priv->sorter), model_row); + i = e_sorter_model_to_sorted (E_SORTER (e_tree->priv->sorter), model_row); i--; if (i >= 0) - return e_sorter_sorted_to_model(E_SORTER (e_tree->priv->sorter), i); + return e_sorter_sorted_to_model (E_SORTER (e_tree->priv->sorter), i); else return -1; } else @@ -2096,11 +2096,11 @@ gint e_tree_model_to_view_row (ETree *e_tree, gint model_row) { - g_return_val_if_fail(e_tree != NULL, -1); - g_return_val_if_fail(E_IS_TREE(e_tree), -1); + g_return_val_if_fail (e_tree != NULL, -1); + g_return_val_if_fail (E_IS_TREE (e_tree), -1); if (e_tree->priv->sorter) - return e_sorter_model_to_sorted(E_SORTER (e_tree->priv->sorter), model_row); + return e_sorter_model_to_sorted (E_SORTER (e_tree->priv->sorter), model_row); else return model_row; } @@ -2109,8 +2109,8 @@ gint e_tree_view_to_model_row (ETree *e_tree, gint view_row) { - g_return_val_if_fail(e_tree != NULL, -1); - g_return_val_if_fail(E_IS_TREE(e_tree), -1); + g_return_val_if_fail (e_tree != NULL, -1); + g_return_val_if_fail (E_IS_TREE (e_tree), -1); if (e_tree->priv->sorter) return e_sorter_sorted_to_model (E_SORTER (e_tree->priv->sorter), view_row); @@ -2121,7 +2121,7 @@ e_tree_view_to_model_row (ETree *e_tree, gboolean e_tree_node_is_expanded (ETree *et, ETreePath path) { - g_return_val_if_fail(path, FALSE); + g_return_val_if_fail (path, FALSE); return e_tree_table_adapter_node_is_expanded (et->priv->etta, path); } @@ -2130,7 +2130,7 @@ void e_tree_node_set_expanded (ETree *et, ETreePath path, gboolean expanded) { g_return_if_fail (et != NULL); - g_return_if_fail (E_IS_TREE(et)); + g_return_if_fail (E_IS_TREE (et)); e_tree_table_adapter_node_set_expanded (et->priv->etta, path, expanded); } @@ -2139,7 +2139,7 @@ void e_tree_node_set_expanded_recurse (ETree *et, ETreePath path, gboolean expanded) { g_return_if_fail (et != NULL); - g_return_if_fail (E_IS_TREE(et)); + g_return_if_fail (E_IS_TREE (et)); e_tree_table_adapter_node_set_expanded_recurse (et->priv->etta, path, expanded); } @@ -2148,7 +2148,7 @@ void e_tree_root_node_set_visible (ETree *et, gboolean visible) { g_return_if_fail (et != NULL); - g_return_if_fail (E_IS_TREE(et)); + g_return_if_fail (E_IS_TREE (et)); e_tree_table_adapter_root_node_set_visible (et->priv->etta, visible); } @@ -2170,7 +2170,7 @@ e_tree_row_of_node (ETree *et, ETreePath path) } gboolean -e_tree_root_node_is_visible(ETree *et) +e_tree_root_node_is_visible (ETree *et) { return e_tree_table_adapter_root_node_is_visible (et->priv->etta); } @@ -2179,7 +2179,7 @@ void e_tree_show_node (ETree *et, ETreePath path) { g_return_if_fail (et != NULL); - g_return_if_fail (E_IS_TREE(et)); + g_return_if_fail (E_IS_TREE (et)); e_tree_table_adapter_show_node (et->priv->etta, path); } @@ -2188,7 +2188,7 @@ void e_tree_save_expanded_state (ETree *et, gchar *filename) { g_return_if_fail (et != NULL); - g_return_if_fail (E_IS_TREE(et)); + g_return_if_fail (E_IS_TREE (et)); e_tree_table_adapter_save_expanded_state (et->priv->etta, filename); } @@ -2230,13 +2230,13 @@ e_tree_force_expanded_state (ETree *et, gint state) gint e_tree_row_count (ETree *et) { - return e_table_model_row_count (E_TABLE_MODEL(et->priv->etta)); + return e_table_model_row_count (E_TABLE_MODEL (et->priv->etta)); } GtkWidget * e_tree_get_tooltip (ETree *et) { - return E_CANVAS(et->priv->table_canvas)->tooltip_window; + return E_CANVAS (et->priv->table_canvas)->tooltip_window; } static ETreePath @@ -2312,7 +2312,7 @@ e_tree_find_next (ETree *et, void e_tree_right_click_up (ETree *et) { - e_selection_model_right_click_up(et->priv->selection); + e_selection_model_right_click_up (et->priv->selection); } /** @@ -2367,7 +2367,7 @@ e_tree_get_table_adapter (ETree *et) } ETableItem * -e_tree_get_item(ETree * et) +e_tree_get_item (ETree * et) { g_return_val_if_fail (et != NULL, NULL); g_return_val_if_fail (E_IS_TREE (et), NULL); @@ -2376,7 +2376,7 @@ e_tree_get_item(ETree * et) } GnomeCanvasItem * -e_tree_get_header_item(ETree * et) +e_tree_get_header_item (ETree * et) { g_return_val_if_fail (et != NULL, NULL); g_return_val_if_fail (E_IS_TREE (et), NULL); @@ -2462,10 +2462,10 @@ e_tree_drag_get_data (ETree *tree, GdkAtom target, guint32 time) { - g_return_if_fail(tree != NULL); - g_return_if_fail(E_IS_TREE(tree)); + g_return_if_fail (tree != NULL); + g_return_if_fail (E_IS_TREE (tree)); - gtk_drag_get_data(GTK_WIDGET(tree), + gtk_drag_get_data (GTK_WIDGET (tree), context, target, time); @@ -2491,7 +2491,7 @@ e_tree_drag_highlight (ETree *tree, GtkLayout *layout; GtkStyle *style; - g_return_if_fail(E_IS_TREE(tree)); + g_return_if_fail (E_IS_TREE (tree)); layout = GTK_LAYOUT (tree->priv->table_canvas); style = gtk_widget_get_style (GTK_WIDGET (tree)); @@ -2537,8 +2537,8 @@ e_tree_drag_highlight (ETree *tree, void e_tree_drag_unhighlight (ETree *tree) { - g_return_if_fail(tree != NULL); - g_return_if_fail(E_IS_TREE(tree)); + g_return_if_fail (tree != NULL); + g_return_if_fail (E_IS_TREE (tree)); if (tree->priv->drop_highlight) { gtk_object_destroy (GTK_OBJECT (tree->priv->drop_highlight)); @@ -2552,10 +2552,10 @@ void e_tree_drag_dest_set (ETree *tree, gint n_targets, GdkDragAction actions) { - g_return_if_fail(tree != NULL); - g_return_if_fail(E_IS_TREE(tree)); + g_return_if_fail (tree != NULL); + g_return_if_fail (E_IS_TREE (tree)); - gtk_drag_dest_set(GTK_WIDGET(tree), + gtk_drag_dest_set (GTK_WIDGET (tree), flags, targets, n_targets, @@ -2567,10 +2567,10 @@ void e_tree_drag_dest_set_proxy (ETree *tree, GdkDragProtocol protocol, gboolean use_coordinates) { - g_return_if_fail(tree != NULL); - g_return_if_fail(E_IS_TREE(tree)); + g_return_if_fail (tree != NULL); + g_return_if_fail (E_IS_TREE (tree)); - gtk_drag_dest_set_proxy(GTK_WIDGET(tree), + gtk_drag_dest_set_proxy (GTK_WIDGET (tree), proxy_window, protocol, use_coordinates); @@ -2584,10 +2584,10 @@ void e_tree_drag_dest_set_proxy (ETree *tree, void e_tree_drag_dest_unset (GtkWidget *widget) { - g_return_if_fail(widget != NULL); - g_return_if_fail(E_IS_TREE(widget)); + g_return_if_fail (widget != NULL); + g_return_if_fail (E_IS_TREE (widget)); - gtk_drag_dest_unset(widget); + gtk_drag_dest_unset (widget); } /* Source side */ @@ -2636,10 +2636,10 @@ e_tree_drag_source_set (ETree *tree, ETreeDragSourceSite *site; GtkWidget *canvas; - g_return_if_fail(tree != NULL); - g_return_if_fail(E_IS_TREE(tree)); + g_return_if_fail (tree != NULL); + g_return_if_fail (E_IS_TREE (tree)); - canvas = GTK_WIDGET(tree->priv->table_canvas); + canvas = GTK_WIDGET (tree->priv->table_canvas); site = tree->priv->site; tree->priv->do_drag = TRUE; @@ -2673,7 +2673,7 @@ e_tree_drag_source_unset (ETree *tree) ETreeDragSourceSite *site; g_return_if_fail (tree != NULL); - g_return_if_fail (E_IS_TREE(tree)); + g_return_if_fail (E_IS_TREE (tree)); site = tree->priv->site; @@ -2700,15 +2700,15 @@ e_tree_drag_begin (ETree *tree, { ETreePath path; g_return_val_if_fail (tree != NULL, NULL); - g_return_val_if_fail (E_IS_TREE(tree), NULL); + g_return_val_if_fail (E_IS_TREE (tree), NULL); - path = e_tree_table_adapter_node_at_row(tree->priv->etta, row); + path = e_tree_table_adapter_node_at_row (tree->priv->etta, row); tree->priv->drag_row = row; tree->priv->drag_path = path; tree->priv->drag_col = col; - return gtk_drag_begin(GTK_WIDGET (tree->priv->table_canvas), + return gtk_drag_begin (GTK_WIDGET (tree->priv->table_canvas), targets, actions, button, @@ -2834,7 +2834,7 @@ et_drag_end (GtkWidget *widget, } static void -et_drag_data_get(GtkWidget *widget, +et_drag_data_get (GtkWidget *widget, GdkDragContext *context, GtkSelectionData *selection_data, guint info, @@ -2853,7 +2853,7 @@ et_drag_data_get(GtkWidget *widget, } static void -et_drag_data_delete(GtkWidget *widget, +et_drag_data_delete (GtkWidget *widget, GdkDragContext *context, ETree *et) { @@ -2866,7 +2866,7 @@ et_drag_data_delete(GtkWidget *widget, } static gboolean -do_drag_motion(ETree *et, +do_drag_motion (ETree *et, GdkDragContext *context, gint x, gint y, @@ -2891,7 +2891,7 @@ do_drag_motion(ETree *et, time); } - path = e_tree_table_adapter_node_at_row(et->priv->etta, row); + path = e_tree_table_adapter_node_at_row (et->priv->etta, row); et->priv->drop_row = row; et->priv->drop_path = path; @@ -3005,7 +3005,7 @@ hover_timeout (gpointer data) &row, &col); - path = e_tree_table_adapter_node_at_row(et->priv->etta, row); + path = e_tree_table_adapter_node_at_row (et->priv->etta, row); if (path && e_tree_model_node_is_expandable (et->priv->model, path)) { if (!e_tree_table_adapter_node_is_expanded (et->priv->etta, path)) { if (e_tree_model_has_save_id (et->priv->model) && @@ -3103,15 +3103,15 @@ context_connect (ETree *et, GdkDragContext *context) return; if (et->priv->last_drop_context) - g_object_weak_unref (G_OBJECT(et->priv->last_drop_context), context_destroyed, et); + g_object_weak_unref (G_OBJECT (et->priv->last_drop_context), context_destroyed, et); else g_object_ref (et); - g_object_weak_ref (G_OBJECT(context), context_destroyed, et); + g_object_weak_ref (G_OBJECT (context), context_destroyed, et); } static void -et_drag_leave(GtkWidget *widget, +et_drag_leave (GtkWidget *widget, GdkDragContext *context, guint time, ETree *et) @@ -3131,7 +3131,7 @@ et_drag_leave(GtkWidget *widget, } static gboolean -et_drag_motion(GtkWidget *widget, +et_drag_motion (GtkWidget *widget, GdkDragContext *context, gint x, gint y, @@ -3179,7 +3179,7 @@ et_drag_motion(GtkWidget *widget, } static gboolean -et_drag_drop(GtkWidget *widget, +et_drag_drop (GtkWidget *widget, GdkDragContext *context, gint x, gint y, @@ -3189,12 +3189,12 @@ et_drag_drop(GtkWidget *widget, gboolean ret_val = FALSE; gint row, col; ETreePath path; - e_tree_get_cell_at(et, + e_tree_get_cell_at (et, x, y, &row, &col); - path = e_tree_table_adapter_node_at_row(et->priv->etta, row); + path = e_tree_table_adapter_node_at_row (et->priv->etta, row); if (row != et->priv->drop_row && col != et->priv->drop_row) { g_signal_emit (et, @@ -3241,7 +3241,7 @@ et_drag_drop(GtkWidget *widget, } static void -et_drag_data_received(GtkWidget *widget, +et_drag_data_received (GtkWidget *widget, GdkDragContext *context, gint x, gint y, @@ -3252,12 +3252,12 @@ et_drag_data_received(GtkWidget *widget, { gint row, col; ETreePath path; - e_tree_get_cell_at(et, + e_tree_get_cell_at (et, x, y, &row, &col); - path = e_tree_table_adapter_node_at_row(et->priv->etta, row); + path = e_tree_table_adapter_node_at_row (et->priv->etta, row); g_signal_emit (et, et_signals[TREE_DRAG_DATA_RECEIVED], 0, row, diff --git a/widgets/table/e-tree.h b/widgets/table/e-tree.h index 968f6bef38..c528e937ab 100644 --- a/widgets/table/e-tree.h +++ b/widgets/table/e-tree.h @@ -309,9 +309,9 @@ gboolean e_tree_find_next (ETree *et, /* This function is only needed in single_selection_mode. */ void e_tree_right_click_up (ETree *et); -ETableItem * e_tree_get_item(ETree * et); +ETableItem * e_tree_get_item (ETree * et); -GnomeCanvasItem * e_tree_get_header_item(ETree * et); +GnomeCanvasItem * e_tree_get_header_item (ETree * et); void e_tree_set_info_message (ETree *tree, const gchar *info_message); diff --git a/widgets/table/gal-a11y-e-cell-popup.c b/widgets/table/gal-a11y-e-cell-popup.c index 921ae8e4d5..755325d4f3 100644 --- a/widgets/table/gal-a11y-e-cell-popup.c +++ b/widgets/table/gal-a11y-e-cell-popup.c @@ -92,7 +92,7 @@ gal_a11y_e_cell_popup_new (ETableItem *item, ECellPopup *popupcell; ECellView* child_view = NULL; - popupcell= E_CELL_POPUP(cell_view->ecell); + popupcell= E_CELL_POPUP (cell_view->ecell); if (popupcell && popupcell->popup_cell_view) child_view = popupcell->popup_cell_view->child_view; @@ -116,7 +116,7 @@ gal_a11y_e_cell_popup_new (ETableItem *item, row); } g_return_val_if_fail (a11y != NULL, NULL); - cell = GAL_A11Y_E_CELL(a11y); + cell = GAL_A11Y_E_CELL (a11y); gal_a11y_e_cell_add_action (cell, "popup", /* Translators: description of a "popup" action */ diff --git a/widgets/table/gal-a11y-e-cell-registry.c b/widgets/table/gal-a11y-e-cell-registry.c index 14ee7e7b2a..c1c3b441e7 100644 --- a/widgets/table/gal-a11y-e-cell-registry.c +++ b/widgets/table/gal-a11y-e-cell-registry.c @@ -101,7 +101,7 @@ static void init_default_registry (void) { if (default_registry == NULL) { - default_registry = g_object_new (gal_a11y_e_cell_registry_get_type(), NULL); + default_registry = g_object_new (gal_a11y_e_cell_registry_get_type (), NULL); } } diff --git a/widgets/table/gal-a11y-e-cell-text.c b/widgets/table/gal-a11y-e-cell-text.c index bc69ca3d26..cc3d6f3b7d 100644 --- a/widgets/table/gal-a11y-e-cell-text.c +++ b/widgets/table/gal-a11y-e-cell-text.c @@ -524,7 +524,7 @@ ect_do_action_edit (AtkAction *action) GalA11yECell *a11y = GAL_A11Y_E_CELL (action); ETableModel *e_table_model = a11y->item->table_model; - if (e_table_model_is_cell_editable(e_table_model, a11y->model_col, a11y->row)) { + if (e_table_model_is_cell_editable (e_table_model, a11y->model_col, a11y->row)) { e_table_item_enter_edit (a11y->item, a11y->view_col, a11y->row); } } diff --git a/widgets/table/gal-a11y-e-cell-toggle.c b/widgets/table/gal-a11y-e-cell-toggle.c index 54b1b3586c..fcea3ec2a1 100644 --- a/widgets/table/gal-a11y-e-cell-toggle.c +++ b/widgets/table/gal-a11y-e-cell-toggle.c @@ -152,12 +152,12 @@ gal_a11y_e_cell_toggle_new (ETableItem *item, GalA11yECellToggle *toggle_cell; gint value; - a11y = ATK_OBJECT(g_object_new (GAL_A11Y_TYPE_E_CELL_TOGGLE, NULL)); + a11y = ATK_OBJECT (g_object_new (GAL_A11Y_TYPE_E_CELL_TOGGLE, NULL)); g_return_val_if_fail (a11y != NULL, NULL); - cell = GAL_A11Y_E_CELL(a11y); - toggle_cell = GAL_A11Y_E_CELL_TOGGLE(a11y); + cell = GAL_A11Y_E_CELL (a11y); + toggle_cell = GAL_A11Y_E_CELL_TOGGLE (a11y); a11y->role = ATK_ROLE_TABLE_CELL; gal_a11y_e_cell_construct (a11y, diff --git a/widgets/table/gal-a11y-e-cell-tree.c b/widgets/table/gal-a11y-e-cell-tree.c index 148d36392f..776fc692c6 100644 --- a/widgets/table/gal-a11y-e-cell-tree.c +++ b/widgets/table/gal-a11y-e-cell-tree.c @@ -66,7 +66,7 @@ ectr_model_row_changed_cb (ETableModel *etm, } static void -kill_view_cb(ECellView *subcell_view, +kill_view_cb (ECellView *subcell_view, gpointer psubcell_a11ies) { GList *node; @@ -75,7 +75,7 @@ kill_view_cb(ECellView *subcell_view, for (node = subcell_a11ies; node != NULL; node = g_list_next (node)) { - subcell = GAL_A11Y_E_CELL(node->data); + subcell = GAL_A11Y_E_CELL (node->data); if (subcell && subcell->cell_view == subcell_view) { d(fprintf(stderr, "subcell_view %p deleted before the a11y object %p\n", subcell_view, subcell)); @@ -90,7 +90,7 @@ ectr_subcell_weak_ref (GalA11yECellTree *a11y, { ECellView *subcell_view = subcell_a11y ? subcell_a11y->cell_view : NULL; if (subcell_a11y && subcell_view && subcell_view->kill_view_cb_data) - subcell_view->kill_view_cb_data = g_list_remove(subcell_view->kill_view_cb_data, subcell_a11y); + subcell_view->kill_view_cb_data = g_list_remove (subcell_view->kill_view_cb_data, subcell_a11y); g_signal_handler_disconnect (GAL_A11Y_E_CELL (a11y)->item->table_model, a11y->model_row_changed_id); @@ -252,8 +252,8 @@ gal_a11y_e_cell_tree_new (ETableItem *item, if (subcell_a11y && subcell_view) { subcell_view->kill_view_cb = kill_view_cb; - if (!g_list_find(subcell_view->kill_view_cb_data, subcell_a11y)) - subcell_view->kill_view_cb_data = g_list_append(subcell_view->kill_view_cb_data, subcell_a11y); + if (!g_list_find (subcell_view->kill_view_cb_data, subcell_a11y)) + subcell_view->kill_view_cb_data = g_list_append (subcell_view->kill_view_cb_data, subcell_a11y); } g_object_weak_ref (G_OBJECT (subcell_a11y), (GWeakNotify) ectr_subcell_weak_ref, a11y); diff --git a/widgets/table/gal-a11y-e-cell-vbox.c b/widgets/table/gal-a11y-e-cell-vbox.c index e7407e7259..df3e00bff4 100644 --- a/widgets/table/gal-a11y-e-cell-vbox.c +++ b/widgets/table/gal-a11y-e-cell-vbox.c @@ -224,6 +224,6 @@ AtkObject *gal_a11y_e_cell_vbox_new (ETableItem *item, gaev = GAL_A11Y_E_CELL_VBOX (a11y); ecvv = (ECellVboxView *) (gaec->cell_view); gaev->a11y_subcell_count = ecvv->subcell_view_count; - gaev->a11y_subcells = g_malloc0 (sizeof(AtkObject *)*gaev->a11y_subcell_count); + gaev->a11y_subcells = g_malloc0 (sizeof (AtkObject *)*gaev->a11y_subcell_count); return a11y; } diff --git a/widgets/table/gal-a11y-e-cell.c b/widgets/table/gal-a11y-e-cell.c index e9e5eb0455..b2962ba96c 100644 --- a/widgets/table/gal-a11y-e-cell.c +++ b/widgets/table/gal-a11y-e-cell.c @@ -126,7 +126,7 @@ gal_a11y_e_cell_ref_state_set (AtkObject *accessible) g_return_val_if_fail (cell->state_set, NULL); - g_object_ref(cell->state_set); + g_object_ref (cell->state_set); return cell->state_set; } @@ -364,7 +364,7 @@ gal_a11y_e_cell_remove_action_by_name (GalA11yECell *cell, static gint gal_a11y_e_cell_action_get_n_actions (AtkAction *action) { - GalA11yECell *cell = GAL_A11Y_E_CELL(action); + GalA11yECell *cell = GAL_A11Y_E_CELL (action); if (cell->action_list != NULL) return g_list_length (cell->action_list); else @@ -375,7 +375,7 @@ static G_CONST_RETURN gchar * gal_a11y_e_cell_action_get_name (AtkAction *action, gint index) { - GalA11yECell *cell = GAL_A11Y_E_CELL(action); + GalA11yECell *cell = GAL_A11Y_E_CELL (action); ActionInfo *info = _gal_a11y_e_cell_get_action_info (cell, index); if (info == NULL) @@ -387,7 +387,7 @@ static G_CONST_RETURN gchar * gal_a11y_e_cell_action_get_description (AtkAction *action, gint index) { - GalA11yECell *cell = GAL_A11Y_E_CELL(action); + GalA11yECell *cell = GAL_A11Y_E_CELL (action); ActionInfo *info = _gal_a11y_e_cell_get_action_info (cell, index); if (info == NULL) @@ -400,7 +400,7 @@ gal_a11y_e_cell_action_set_description (AtkAction *action, gint index, const gchar *desc) { - GalA11yECell *cell = GAL_A11Y_E_CELL(action); + GalA11yECell *cell = GAL_A11Y_E_CELL (action); ActionInfo *info = _gal_a11y_e_cell_get_action_info (cell, index); if (info == NULL) @@ -414,7 +414,7 @@ static G_CONST_RETURN gchar * gal_a11y_e_cell_action_get_keybinding (AtkAction *action, gint index) { - GalA11yECell *cell = GAL_A11Y_E_CELL(action); + GalA11yECell *cell = GAL_A11Y_E_CELL (action); ActionInfo *info = _gal_a11y_e_cell_get_action_info (cell, index); if (info == NULL) return NULL; @@ -443,7 +443,7 @@ static gboolean gal_a11y_e_cell_action_do_action (AtkAction *action, gint index) { - GalA11yECell *cell = GAL_A11Y_E_CELL(action); + GalA11yECell *cell = GAL_A11Y_E_CELL (action); ActionInfo *info = _gal_a11y_e_cell_get_action_info (cell, index); if (!is_valid (ATK_OBJECT (action))) diff --git a/widgets/table/gal-a11y-e-table-click-to-add-factory.c b/widgets/table/gal-a11y-e-table-click-to-add-factory.c index 0ebb3c4621..1208241179 100644 --- a/widgets/table/gal-a11y-e-table-click-to-add-factory.c +++ b/widgets/table/gal-a11y-e-table-click-to-add-factory.c @@ -48,7 +48,7 @@ gal_a11y_e_table_click_to_add_factory_create_accessible (GObject *obj) { AtkObject * atk_object; - g_return_val_if_fail (E_IS_TABLE_CLICK_TO_ADD(obj), NULL); + g_return_val_if_fail (E_IS_TABLE_CLICK_TO_ADD (obj), NULL); atk_object = gal_a11y_e_table_click_to_add_new (obj); diff --git a/widgets/table/gal-a11y-e-table-click-to-add.c b/widgets/table/gal-a11y-e-table-click-to-add.c index ebec8681ae..32bee99f07 100644 --- a/widgets/table/gal-a11y-e-table-click-to-add.c +++ b/widgets/table/gal-a11y-e-table-click-to-add.c @@ -128,7 +128,7 @@ etcta_get_name (AtkObject *obj) g_return_val_if_fail (GAL_A11Y_IS_E_TABLE_CLICK_TO_ADD (obj), NULL); - etcta = E_TABLE_CLICK_TO_ADD (atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE(obj))); + etcta = E_TABLE_CLICK_TO_ADD (atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (obj))); if (etcta && etcta->message != NULL) return etcta->message; @@ -151,14 +151,14 @@ etcta_ref_child (AtkObject *accessible, if (i != 0) return NULL; - etcta = E_TABLE_CLICK_TO_ADD(atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (accessible))); + etcta = E_TABLE_CLICK_TO_ADD (atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (accessible))); g_return_val_if_fail (etcta, NULL); if (etcta->rect) { - atk_obj = atk_gobject_accessible_for_object (G_OBJECT(etcta->rect)); + atk_obj = atk_gobject_accessible_for_object (G_OBJECT (etcta->rect)); } else if (etcta->row) { - atk_obj = atk_gobject_accessible_for_object (G_OBJECT(etcta->row)); + atk_obj = atk_gobject_accessible_for_object (G_OBJECT (etcta->row)); } g_object_ref (atk_obj); @@ -239,7 +239,7 @@ gal_a11y_e_table_click_to_add_get_type (void) parent_type = atk_object_factory_get_accessible_type (factory); type = gal_a11y_type_register_static_with_private (PARENT_TYPE, "GalA11yETableClickToAdd", &info, 0, - sizeof(GalA11yETableClickToAddPrivate), &priv_offset); + sizeof (GalA11yETableClickToAddPrivate), &priv_offset); g_type_add_interface_static (type, ATK_TYPE_ACTION, &atk_action_info); @@ -257,7 +257,7 @@ etcta_event (GnomeCanvasItem *item, GdkEvent *e, gpointer data) g_return_val_if_fail (item, TRUE); - g_return_val_if_fail (GAL_A11Y_IS_E_TABLE_CLICK_TO_ADD(data), FALSE); + g_return_val_if_fail (GAL_A11Y_IS_E_TABLE_CLICK_TO_ADD (data), FALSE); a11y = GAL_A11Y_E_TABLE_CLICK_TO_ADD (data); priv = GET_PRIVATE (a11y); @@ -288,12 +288,12 @@ etcta_selection_cursor_changed (ESelectionModel *esm, gint row, gint col, ETableClickToAdd *etcta; AtkObject *row_a11y; - etcta = E_TABLE_CLICK_TO_ADD (atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE(a11y))); + etcta = E_TABLE_CLICK_TO_ADD (atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (a11y))); if (etcta == NULL || etcta->row == NULL) return; - row_a11y = atk_gobject_accessible_for_object (G_OBJECT(etcta->row)); + row_a11y = atk_gobject_accessible_for_object (G_OBJECT (etcta->row)); if (row_a11y) { AtkObject *cell_a11y = g_object_get_data (G_OBJECT(row_a11y), "gail-focus-object"); if (cell_a11y) { @@ -314,7 +314,7 @@ gal_a11y_e_table_click_to_add_new (GObject *widget) a11y = g_object_new (gal_a11y_e_table_click_to_add_get_type (), NULL); priv = GET_PRIVATE (a11y); - etcta = E_TABLE_CLICK_TO_ADD(widget); + etcta = E_TABLE_CLICK_TO_ADD (widget); atk_object_initialize (ATK_OBJECT (a11y), etcta); diff --git a/widgets/table/gal-a11y-e-table-column-header.c b/widgets/table/gal-a11y-e-table-column-header.c index 33b85571ee..c2f3abe91a 100644 --- a/widgets/table/gal-a11y-e-table-column-header.c +++ b/widgets/table/gal-a11y-e-table-column-header.c @@ -58,7 +58,7 @@ gal_a11y_e_table_column_header_ref_state_set (AtkObject *accessible) g_return_val_if_fail (priv->state_set, NULL); - g_object_ref(priv->state_set); + g_object_ref (priv->state_set); return priv->state_set; } @@ -213,17 +213,17 @@ gal_a11y_e_table_column_header_new (ETableCol *ecol, ETableItem *item) g_return_val_if_fail (E_IS_TABLE_COL (ecol), NULL); - a11y = g_object_new (gal_a11y_e_table_column_header_get_type(), NULL); + a11y = g_object_new (gal_a11y_e_table_column_header_get_type (), NULL); accessible = ATK_OBJECT (a11y); atk_object_initialize (accessible, ecol); GET_PRIVATE (a11y)->item = item; GET_PRIVATE (a11y)->state_set = atk_state_set_new (); - atk_state_set_add_state (GET_PRIVATE(a11y)->state_set, ATK_STATE_VISIBLE); - atk_state_set_add_state (GET_PRIVATE(a11y)->state_set, ATK_STATE_SHOWING); - atk_state_set_add_state (GET_PRIVATE(a11y)->state_set, ATK_STATE_SENSITIVE); - atk_state_set_add_state (GET_PRIVATE(a11y)->state_set, ATK_STATE_ENABLED); + atk_state_set_add_state (GET_PRIVATE (a11y)->state_set, ATK_STATE_VISIBLE); + atk_state_set_add_state (GET_PRIVATE (a11y)->state_set, ATK_STATE_SHOWING); + atk_state_set_add_state (GET_PRIVATE (a11y)->state_set, ATK_STATE_SENSITIVE); + atk_state_set_add_state (GET_PRIVATE (a11y)->state_set, ATK_STATE_ENABLED); if (ecol->text) atk_object_set_name (accessible, ecol->text); diff --git a/widgets/table/gal-a11y-e-table-item-factory.c b/widgets/table/gal-a11y-e-table-item-factory.c index fa14652788..0b58e29add 100644 --- a/widgets/table/gal-a11y-e-table-item-factory.c +++ b/widgets/table/gal-a11y-e-table-item-factory.c @@ -48,7 +48,7 @@ gal_a11y_e_table_item_factory_create_accessible (GObject *obj) { AtkObject *accessible; - g_return_val_if_fail (E_IS_TABLE_ITEM(obj), NULL); + g_return_val_if_fail (E_IS_TABLE_ITEM (obj), NULL); accessible = gal_a11y_e_table_item_new (E_TABLE_ITEM (obj)); return accessible; diff --git a/widgets/table/gal-a11y-e-table-item.c b/widgets/table/gal-a11y-e-table-item.c index f2b865ac0c..f65da5dd52 100644 --- a/widgets/table/gal-a11y-e-table-item.c +++ b/widgets/table/gal-a11y-e-table-item.c @@ -87,16 +87,16 @@ eti_ref_state_set (AtkObject *accessible) { GalA11yETableItemPrivate *priv = GET_PRIVATE (accessible); - g_object_ref(priv->state_set); + g_object_ref (priv->state_set); return priv->state_set; } inline static gint -view_to_model_row(ETableItem *eti, gint row) +view_to_model_row (ETableItem *eti, gint row) { if (eti->uses_source_model) { - ETableSubset *etss = E_TABLE_SUBSET(eti->table_model); + ETableSubset *etss = E_TABLE_SUBSET (eti->table_model); if (row >= 0 && row < etss->n_map) { eti->row_guess = row; return etss->map_table[row]; @@ -107,20 +107,20 @@ view_to_model_row(ETableItem *eti, gint row) } inline static gint -view_to_model_col(ETableItem *eti, gint 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, gint row) +model_to_view_row (ETableItem *eti, gint row) { gint i; if (row == -1) return -1; if (eti->uses_source_model) { - ETableSubset *etss = E_TABLE_SUBSET(eti->table_model); + ETableSubset *etss = E_TABLE_SUBSET (eti->table_model); if (eti->row_guess >= 0 && eti->row_guess < etss->n_map) { if (etss->map_table[eti->row_guess] == row) { return eti->row_guess; @@ -136,7 +136,7 @@ model_to_view_row(ETableItem *eti, gint row) } inline static gint -model_to_view_col(ETableItem *eti, gint col) +model_to_view_col (ETableItem *eti, gint col) { gint i; if (col == -1) @@ -203,7 +203,7 @@ eti_dispose (GObject *object) GalA11yETableItemPrivate *priv = GET_PRIVATE (a11y); if (priv->columns) { - g_free(priv->columns); + g_free (priv->columns); priv->columns = NULL; } @@ -307,7 +307,7 @@ eti_ref_accessible_at_point (AtkComponent *component, tableOrTree = gtk_widget_get_parent (GTK_WIDGET (item->parent.canvas)); - if (E_IS_TREE(tableOrTree)) + if (E_IS_TREE (tableOrTree)) e_tree_get_cell_at (E_TREE (tableOrTree), x, y, &row, &col); else e_table_get_cell_at (E_TABLE (tableOrTree), x, y, &row, &col); @@ -693,15 +693,15 @@ eti_rows_inserted (ETableModel * model, gint row, gint count, g_return_if_fail (table_item); item_a11y = GAL_A11Y_E_TABLE_ITEM (table_item); - n_cols = atk_table_get_n_columns (ATK_TABLE(table_item)); - n_rows = atk_table_get_n_rows (ATK_TABLE(table_item)); + n_cols = atk_table_get_n_columns (ATK_TABLE (table_item)); + n_rows = atk_table_get_n_rows (ATK_TABLE (table_item)); - old_nrows = GET_PRIVATE(item_a11y)->rows; + old_nrows = GET_PRIVATE (item_a11y)->rows; g_return_if_fail (n_cols > 0 && n_rows > 0); g_return_if_fail (old_nrows == n_rows - count); - GET_PRIVATE(table_item)->rows = n_rows; + GET_PRIVATE (table_item)->rows = n_rows; g_signal_emit_by_name (table_item, "row-inserted", row, count, NULL); @@ -726,14 +726,14 @@ eti_rows_deleted (ETableModel * model, gint row, gint count, atk_gobject_accessible_get_object ( ATK_GOBJECT_ACCESSIBLE (table_item))); - n_rows = atk_table_get_n_rows (ATK_TABLE(table_item)); - n_cols = atk_table_get_n_columns (ATK_TABLE(table_item)); + n_rows = atk_table_get_n_rows (ATK_TABLE (table_item)); + n_cols = atk_table_get_n_columns (ATK_TABLE (table_item)); - old_nrows = GET_PRIVATE(table_item)->rows; + old_nrows = GET_PRIVATE (table_item)->rows; g_return_if_fail ( row+count <= old_nrows); g_return_if_fail (old_nrows == n_rows + count); - GET_PRIVATE(table_item)->rows = n_rows; + GET_PRIVATE (table_item)->rows = n_rows; g_signal_emit_by_name (table_item, "row-deleted", row, count, NULL); @@ -810,11 +810,11 @@ eti_header_structure_changed (ETableHeader *eth, AtkObject *a11y) /* Compare with previously saved column headers. */ for (i = 0; i < n_cols && cols[i]; i++) { for (j = 0; j < prev_n_cols && prev_cols[j]; j++) { - if (prev_cols [j] == cols[i] && i != j) { + if (prev_cols[j] == cols[i] && i != j) { reorder_found = TRUE; - state [i] = ETI_HEADER_REORDERED; - reorder [i] = j; + state[i] = ETI_HEADER_REORDERED; + reorder[i] = j; break; } else if (prev_cols[j] == cols[i]) { @@ -833,7 +833,7 @@ eti_header_structure_changed (ETableHeader *eth, AtkObject *a11y) /* Now try to find if there are removed columns. */ for (i = 0; i < prev_n_cols && prev_cols[i]; i++) { for (j = 0; j < n_cols && cols[j]; j++) - if (prev_cols [j] == cols[i]) + if (prev_cols[j] == cols[i]) break; /* Removed columns found. */ @@ -855,11 +855,11 @@ eti_header_structure_changed (ETableHeader *eth, AtkObject *a11y) for (i = 0; i < prev_n_cols; i ++ ) { if (prev_state[i] == ETI_HEADER_REMOVED) { g_signal_emit_by_name ( - G_OBJECT(a11y_item), + G_OBJECT (a11y_item), "column-deleted", i, 1); for (j = 0; j < n_rows; j++) g_signal_emit_by_name ( - G_OBJECT(a11y_item), + G_OBJECT (a11y_item), "children_changed::remove", ((j+1)*prev_n_cols+i), NULL, NULL); @@ -871,11 +871,11 @@ eti_header_structure_changed (ETableHeader *eth, AtkObject *a11y) for (i = 0; i < n_cols; i++) { if (state[i] == ETI_HEADER_NEW_ADDED) { g_signal_emit_by_name ( - G_OBJECT(a11y_item), + G_OBJECT (a11y_item), "column-inserted", i, 1); for (j = 0; j < n_rows; j++) g_signal_emit_by_name ( - G_OBJECT(a11y_item), + G_OBJECT (a11y_item), "children_changed::add", ((j+1)*n_cols+i), NULL, NULL); @@ -1052,13 +1052,13 @@ gal_a11y_e_table_item_new (ETableItem *item) GET_PRIVATE (a11y)->state_set = atk_state_set_new (); - atk_state_set_add_state (GET_PRIVATE(a11y)->state_set, ATK_STATE_TRANSIENT); - atk_state_set_add_state (GET_PRIVATE(a11y)->state_set, ATK_STATE_ENABLED); - atk_state_set_add_state (GET_PRIVATE(a11y)->state_set, ATK_STATE_SENSITIVE); - atk_state_set_add_state (GET_PRIVATE(a11y)->state_set, ATK_STATE_SHOWING); - atk_state_set_add_state (GET_PRIVATE(a11y)->state_set, ATK_STATE_VISIBLE); + atk_state_set_add_state (GET_PRIVATE (a11y)->state_set, ATK_STATE_TRANSIENT); + atk_state_set_add_state (GET_PRIVATE (a11y)->state_set, ATK_STATE_ENABLED); + atk_state_set_add_state (GET_PRIVATE (a11y)->state_set, ATK_STATE_SENSITIVE); + atk_state_set_add_state (GET_PRIVATE (a11y)->state_set, ATK_STATE_SHOWING); + atk_state_set_add_state (GET_PRIVATE (a11y)->state_set, ATK_STATE_VISIBLE); - accessible = ATK_OBJECT(a11y); + accessible = ATK_OBJECT (a11y); /* Initialize cell data. */ GET_PRIVATE (a11y)->cols = item->cols; diff --git a/widgets/table/gal-a11y-e-table.c b/widgets/table/gal-a11y-e-table.c index 8aef407941..6c68842415 100644 --- a/widgets/table/gal-a11y-e-table.c +++ b/widgets/table/gal-a11y-e-table.c @@ -92,7 +92,7 @@ init_child_item (GalA11yETable *a11y) return FALSE; table = E_TABLE (gtk_accessible_get_widget (GTK_ACCESSIBLE (a11y))); - if (table && gtk_widget_get_mapped (GTK_WIDGET (table)) && table->group && E_IS_TABLE_GROUP_CONTAINER(table->group)) { + if (table && gtk_widget_get_mapped (GTK_WIDGET (table)) && table->group && E_IS_TABLE_GROUP_CONTAINER (table->group)) { ETableGroupContainer *etgc = (ETableGroupContainer *)table->group; GList *list; @@ -181,8 +181,8 @@ et_ref_child (AtkObject *accessible, ETableClickToAdd * etcta; if (et && et->use_click_to_add && et->click_to_add) { - etcta = E_TABLE_CLICK_TO_ADD(et->click_to_add); - accessible = atk_gobject_accessible_for_object (G_OBJECT(etcta)); + etcta = E_TABLE_CLICK_TO_ADD (et->click_to_add); + accessible = atk_gobject_accessible_for_object (G_OBJECT (etcta)); if (accessible) g_object_ref (accessible); return accessible; diff --git a/widgets/text/e-reflow-model.c b/widgets/text/e-reflow-model.c index 1eaccdad09..6f8223ae9a 100644 --- a/widgets/text/e-reflow-model.c +++ b/widgets/text/e-reflow-model.c @@ -30,7 +30,7 @@ G_DEFINE_TYPE (EReflowModel, e_reflow_model, G_TYPE_OBJECT) #define d(x) -d(static gint depth = 0;) +d (static gint depth = 0;) enum { MODEL_CHANGED, @@ -41,7 +41,7 @@ enum { LAST_SIGNAL }; -static guint e_reflow_model_signals [LAST_SIGNAL] = { 0, }; +static guint e_reflow_model_signals[LAST_SIGNAL] = { 0, }; /** * e_reflow_model_set_width: @@ -151,7 +151,7 @@ e_reflow_model_class_init (EReflowModelClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - e_reflow_model_signals [MODEL_CHANGED] = + e_reflow_model_signals[MODEL_CHANGED] = g_signal_new ("model_changed", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -160,7 +160,7 @@ e_reflow_model_class_init (EReflowModelClass *klass) g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); - e_reflow_model_signals [COMPARISON_CHANGED] = + e_reflow_model_signals[COMPARISON_CHANGED] = g_signal_new ("comparison_changed", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -169,7 +169,7 @@ e_reflow_model_class_init (EReflowModelClass *klass) g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); - e_reflow_model_signals [MODEL_ITEMS_INSERTED] = + e_reflow_model_signals[MODEL_ITEMS_INSERTED] = g_signal_new ("model_items_inserted", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -178,7 +178,7 @@ e_reflow_model_class_init (EReflowModelClass *klass) e_marshal_NONE__INT_INT, G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT); - e_reflow_model_signals [MODEL_ITEM_CHANGED] = + e_reflow_model_signals[MODEL_ITEM_CHANGED] = g_signal_new ("model_item_changed", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -187,7 +187,7 @@ e_reflow_model_class_init (EReflowModelClass *klass) g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT); - e_reflow_model_signals [MODEL_ITEM_REMOVED] = + e_reflow_model_signals[MODEL_ITEM_REMOVED] = g_signal_new ("model_item_removed", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -243,12 +243,12 @@ e_reflow_model_changed (EReflowModel *e_reflow_model) g_return_if_fail (e_reflow_model != NULL); g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model)); - d(print_tabs()); + d (print_tabs ()); d(g_print("Emitting model_changed on model 0x%p.\n", e_reflow_model)); - d(depth++); + d (depth++); g_signal_emit (e_reflow_model, - e_reflow_model_signals [MODEL_CHANGED], 0); - d(depth--); + e_reflow_model_signals[MODEL_CHANGED], 0); + d (depth--); } /** @@ -266,12 +266,12 @@ e_reflow_model_comparison_changed (EReflowModel *e_reflow_model) g_return_if_fail (e_reflow_model != NULL); g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model)); - d(print_tabs()); + d (print_tabs ()); d(g_print("Emitting comparison_changed on model 0x%p.\n", e_reflow_model)); - d(depth++); + d (depth++); g_signal_emit (e_reflow_model, - e_reflow_model_signals [COMPARISON_CHANGED], 0); - d(depth--); + e_reflow_model_signals[COMPARISON_CHANGED], 0); + d (depth--); } /** @@ -288,13 +288,13 @@ e_reflow_model_items_inserted (EReflowModel *e_reflow_model, gint position, gint g_return_if_fail (e_reflow_model != NULL); g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model)); - d(print_tabs()); + d (print_tabs ()); d(g_print("Emitting items_inserted on model 0x%p, position=%d, count=%d.\n", e_reflow_model, position, count)); - d(depth++); + d (depth++); g_signal_emit (e_reflow_model, - e_reflow_model_signals [MODEL_ITEMS_INSERTED], 0, + e_reflow_model_signals[MODEL_ITEMS_INSERTED], 0, position, count); - d(depth--); + d (depth--); } /** @@ -312,13 +312,13 @@ e_reflow_model_item_removed (EReflowModel *e_reflow_model, g_return_if_fail (e_reflow_model != NULL); g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model)); - d(print_tabs()); + d (print_tabs ()); d(g_print("Emitting item_removed on model 0x%p, n=%d.\n", e_reflow_model, n)); - d(depth++); + d (depth++); g_signal_emit (e_reflow_model, - e_reflow_model_signals [MODEL_ITEM_REMOVED], 0, + e_reflow_model_signals[MODEL_ITEM_REMOVED], 0, n); - d(depth--); + d (depth--); } /** @@ -338,11 +338,11 @@ 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)); - d(print_tabs()); + d (print_tabs ()); d(g_print("Emitting item_changed on model 0x%p, n=%d.\n", e_reflow_model, n)); - d(depth++); + d (depth++); g_signal_emit (e_reflow_model, - e_reflow_model_signals [MODEL_ITEM_CHANGED], 0, + e_reflow_model_signals[MODEL_ITEM_CHANGED], 0, n); - d(depth--); + d (depth--); } diff --git a/widgets/text/e-reflow.c b/widgets/text/e-reflow.c index ddbbf5a987..7a0f7ad121 100644 --- a/widgets/text/e-reflow.c +++ b/widgets/text/e-reflow.c @@ -45,7 +45,7 @@ static void e_reflow_draw (GnomeCanvasItem *item, GdkDrawable *drawable, static void e_reflow_update (GnomeCanvasItem *item, gdouble affine[6], ArtSVP *clip_path, gint flags); static gdouble e_reflow_point (GnomeCanvasItem *item, gdouble x, gdouble 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 set_empty (EReflow *reflow); static void e_reflow_resize_children (GnomeCanvasItem *item); @@ -72,7 +72,7 @@ enum { LAST_SIGNAL }; -static guint signals [LAST_SIGNAL] = {0, }; +static guint signals[LAST_SIGNAL] = {0, }; static gint er_compare (gint i1, gint i2, gpointer user_data) @@ -112,7 +112,7 @@ e_reflow_resize_children (GnomeCanvasItem *item) count = reflow->count; for (i = 0; i < count; i++) { if (reflow->items[i]) - gnome_canvas_item_set(reflow->items[i], + gnome_canvas_item_set (reflow->items[i], "width", (gdouble) reflow->column_width, NULL); } @@ -122,7 +122,7 @@ static inline void e_reflow_update_selection_row (EReflow *reflow, gint row) { if (reflow->items[row]) { - g_object_set(reflow->items[row], + g_object_set (reflow->items[row], "selected", e_selection_model_is_row_selected(E_SELECTION_MODEL(reflow->selection), row), NULL); } else if (e_selection_model_is_row_selected (E_SELECTION_MODEL (reflow->selection), row)) { @@ -334,7 +334,7 @@ reflow_columns (EReflow *reflow) for (i = start; i < count; 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)); + list = g_slist_prepend (list, GINT_TO_POINTER (i)); column_count++; running_height = E_REFLOW_BORDER_WIDTH * 2 + reflow->heights[unsorted]; } else @@ -347,7 +347,7 @@ reflow_columns (EReflow *reflow) for (; column_count > column_start; column_count--) { GSList *to_free; - reflow->columns[column_count] = GPOINTER_TO_INT(list->data); + reflow->columns[column_count] = GPOINTER_TO_INT (list->data); to_free = list; list = list->next; g_slist_free_1 (to_free); @@ -372,7 +372,7 @@ item_changed (EReflowModel *model, gint i, EReflow *reflow) e_sorter_array_clean (reflow->sorter); reflow->reflow_from_column = -1; reflow->need_reflow_columns = TRUE; - e_canvas_item_request_reflow(GNOME_CANVAS_ITEM (reflow)); + e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (reflow)); } static void @@ -405,12 +405,12 @@ item_removed (EReflowModel *model, gint i, EReflow *reflow) reflow->count--; - reflow->heights [reflow->count] = 0; - reflow->items [reflow->count] = NULL; + reflow->heights[reflow->count] = 0; + reflow->items[reflow->count] = NULL; reflow->need_reflow_columns = TRUE; set_empty (reflow); - e_canvas_item_request_reflow(GNOME_CANVAS_ITEM (reflow)); + e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (reflow)); e_sorter_array_set_count (reflow->sorter, reflow->count); @@ -467,7 +467,7 @@ items_inserted (EReflowModel *model, gint position, gint count, EReflow *reflow) reflow->need_reflow_columns = TRUE; set_empty (reflow); - e_canvas_item_request_reflow(GNOME_CANVAS_ITEM (reflow)); + e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (reflow)); } static void @@ -504,7 +504,7 @@ model_changed (EReflowModel *model, EReflow *reflow) if (oldcount > reflow->count) reflow_columns (reflow); set_empty (reflow); - e_canvas_item_request_reflow(GNOME_CANVAS_ITEM (reflow)); + e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (reflow)); } static void @@ -513,31 +513,31 @@ comparison_changed (EReflowModel *model, EReflow *reflow) e_sorter_array_clean (reflow->sorter); reflow->reflow_from_column = -1; reflow->need_reflow_columns = TRUE; - e_canvas_item_request_reflow(GNOME_CANVAS_ITEM (reflow)); + e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (reflow)); } static void -set_empty(EReflow *reflow) +set_empty (EReflow *reflow) { if (reflow->count == 0) { if (reflow->empty_text) { if (reflow->empty_message) { - gnome_canvas_item_set(reflow->empty_text, + gnome_canvas_item_set (reflow->empty_text, "width", reflow->minimum_width, "text", reflow->empty_message, NULL); - e_canvas_item_move_absolute(reflow->empty_text, + e_canvas_item_move_absolute (reflow->empty_text, reflow->minimum_width / 2, 0); } else { - gtk_object_destroy(GTK_OBJECT(reflow->empty_text)); + gtk_object_destroy (GTK_OBJECT (reflow->empty_text)); reflow->empty_text = NULL; } } else { if (reflow->empty_message) { reflow->empty_text = - gnome_canvas_item_new(GNOME_CANVAS_GROUP(reflow), - e_text_get_type(), + gnome_canvas_item_new (GNOME_CANVAS_GROUP (reflow), + e_text_get_type (), "anchor", GTK_ANCHOR_N, "width", reflow->minimum_width, "clip", TRUE, @@ -546,14 +546,14 @@ set_empty(EReflow *reflow) "text", reflow->empty_message, "draw_background", FALSE, NULL); - e_canvas_item_move_absolute(reflow->empty_text, + e_canvas_item_move_absolute (reflow->empty_text, reflow->minimum_width / 2, 0); } } } else { if (reflow->empty_text) { - gtk_object_destroy(GTK_OBJECT(reflow->empty_text)); + gtk_object_destroy (GTK_OBJECT (reflow->empty_text)); reflow->empty_text = NULL; } } @@ -726,19 +726,19 @@ e_reflow_set_property (GObject *object, guint prop_id, const GValue *value, GPar case PROP_HEIGHT: reflow->height = g_value_get_double (value); reflow->need_reflow_columns = TRUE; - e_canvas_item_request_reflow(item); + e_canvas_item_request_reflow (item); break; case PROP_MINIMUM_WIDTH: reflow->minimum_width = g_value_get_double (value); if (item->flags & GNOME_CANVAS_ITEM_REALIZED) - set_empty(reflow); - e_canvas_item_request_reflow(item); + set_empty (reflow); + e_canvas_item_request_reflow (item); break; case PROP_EMPTY_MESSAGE: - g_free(reflow->empty_message); - reflow->empty_message = g_strdup(g_value_get_string (value)); + g_free (reflow->empty_message); + reflow->empty_message = g_strdup (g_value_get_string (value)); if (item->flags & GNOME_CANVAS_ITEM_REALIZED) - set_empty(reflow); + set_empty (reflow); break; case PROP_MODEL: connect_model (reflow, (EReflowModel *) g_value_get_object (value)); @@ -762,11 +762,11 @@ e_reflow_set_property (GObject *object, guint prop_id, const GValue *value, GPar adjustment, step_increment); gtk_adjustment_set_page_increment ( adjustment, page_size - step_increment); - e_reflow_resize_children(item); - e_canvas_item_request_reflow(item); + e_reflow_resize_children (item); + e_canvas_item_request_reflow (item); reflow->need_column_resize = TRUE; - gnome_canvas_item_request_update(item); + gnome_canvas_item_request_update (item); if (old_width != reflow->column_width) column_width_changed (reflow); @@ -810,7 +810,7 @@ e_reflow_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec static void e_reflow_dispose (GObject *object) { - EReflow *reflow = E_REFLOW(object); + EReflow *reflow = E_REFLOW (object); g_free (reflow->items); g_free (reflow->heights); @@ -833,7 +833,7 @@ e_reflow_dispose (GObject *object) disconnect_model (reflow); disconnect_selection (reflow); - g_free(reflow->empty_message); + g_free (reflow->empty_message); reflow->empty_message = NULL; if (reflow->sorter) { @@ -841,7 +841,7 @@ e_reflow_dispose (GObject *object) reflow->sorter = NULL; } - G_OBJECT_CLASS(e_reflow_parent_class)->dispose (object); + G_OBJECT_CLASS (e_reflow_parent_class)->dispose (object); } static void @@ -857,8 +857,8 @@ e_reflow_realize (GnomeCanvasItem *item) reflow = E_REFLOW (item); - if (GNOME_CANVAS_ITEM_CLASS(e_reflow_parent_class)->realize) - (* GNOME_CANVAS_ITEM_CLASS(e_reflow_parent_class)->realize) (item); + if (GNOME_CANVAS_ITEM_CLASS (e_reflow_parent_class)->realize) + (* GNOME_CANVAS_ITEM_CLASS (e_reflow_parent_class)->realize) (item); reflow->arrow_cursor = gdk_cursor_new (GDK_SB_H_DOUBLE_ARROW); reflow->default_cursor = gdk_cursor_new (GDK_LEFT_PTR); @@ -866,15 +866,15 @@ e_reflow_realize (GnomeCanvasItem *item) count = reflow->count; for (i = 0; i < count; i++) { if (reflow->items[i]) - gnome_canvas_item_set(reflow->items[i], + gnome_canvas_item_set (reflow->items[i], "width", reflow->column_width, NULL); } - set_empty(reflow); + set_empty (reflow); reflow->need_reflow_columns = TRUE; - e_canvas_item_request_reflow(item); + e_canvas_item_request_reflow (item); adjustment = gtk_layout_get_hadjustment (GTK_LAYOUT (item->canvas)); @@ -908,8 +908,8 @@ e_reflow_unrealize (GnomeCanvasItem *item) disconnect_set_adjustment (reflow); disconnect_adjustment (reflow); - if (GNOME_CANVAS_ITEM_CLASS(e_reflow_parent_class)->unrealize) - (* GNOME_CANVAS_ITEM_CLASS(e_reflow_parent_class)->unrealize) (item); + if (GNOME_CANVAS_ITEM_CLASS (e_reflow_parent_class)->unrealize) + (* GNOME_CANVAS_ITEM_CLASS (e_reflow_parent_class)->unrealize) (item); } static gboolean @@ -923,7 +923,7 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) switch (event->type) { case GDK_KEY_PRESS: - return_val = e_selection_model_key_press(reflow->selection, (GdkEventKey *) event); + return_val = e_selection_model_key_press (reflow->selection, (GdkEventKey *) event); break; #if 0 if (event->key.keyval == GDK_Tab || @@ -937,7 +937,7 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) GnomeCanvasItem *item = reflow->items[unsorted]; EFocus has_focus; if (item) { - g_object_get(item, + g_object_get (item, "has_focus", &has_focus, NULL); if (has_focus) { @@ -957,7 +957,7 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) } item = reflow->items[unsorted]; - gnome_canvas_item_set(item, + gnome_canvas_item_set (item, "has_focus", (event->key.state & GDK_SHIFT_MASK) ? E_FOCUS_END : E_FOCUS_START, NULL); return TRUE; @@ -975,13 +975,13 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) gdouble n_x; n_x = button->x; n_x += E_REFLOW_BORDER_WIDTH + E_REFLOW_DIVIDER_WIDTH; - n_x = fmod(n_x,(reflow->column_width + E_REFLOW_FULL_GUTTER)); + n_x = fmod (n_x,(reflow->column_width + E_REFLOW_FULL_GUTTER)); if (button->y >= E_REFLOW_BORDER_WIDTH && button->y <= reflow->height - E_REFLOW_BORDER_WIDTH && n_x < E_REFLOW_FULL_GUTTER) { /* don't allow to drag the first line*/ - if (e_reflow_pick_line(reflow, button->x) == 0) + if (e_reflow_pick_line (reflow, button->x) == 0) return TRUE; - reflow->which_column_dragged = e_reflow_pick_line(reflow, button->x); + reflow->which_column_dragged = e_reflow_pick_line (reflow, button->x); reflow->start_x = reflow->which_column_dragged * (reflow->column_width + E_REFLOW_FULL_GUTTER) - E_REFLOW_DIVIDER_WIDTH / 2; reflow->temp_column_width = reflow->column_width; reflow->column_drag = TRUE; @@ -993,7 +993,7 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) reflow->previous_temp_column_width = -1; reflow->need_column_resize = TRUE; - gnome_canvas_item_request_update(item); + gnome_canvas_item_request_update (item); return TRUE; } } @@ -1045,7 +1045,7 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) value = gtk_adjustment_get_value (adjustment); reflow->temp_column_width = reflow->column_width + - (button->x - reflow->start_x)/(reflow->which_column_dragged - e_reflow_pick_line(reflow, value)); + (button->x - reflow->start_x)/(reflow->which_column_dragged - e_reflow_pick_line (reflow, value)); if (reflow->temp_column_width < 50) reflow->temp_column_width = 50; reflow->column_drag = FALSE; @@ -1055,19 +1055,19 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) gdouble page_size; page_size = gtk_adjustment_get_page_size (adjustment); - gtk_adjustment_set_value(adjustment, value + e_reflow_pick_line(reflow, value) * (reflow->temp_column_width - reflow->column_width)); + gtk_adjustment_set_value (adjustment, value + e_reflow_pick_line (reflow, value) * (reflow->temp_column_width - reflow->column_width)); reflow->column_width = reflow->temp_column_width; step_increment = (reflow->column_width + E_REFLOW_FULL_GUTTER) / 2; page_increment = page_size - step_increment; gtk_adjustment_set_step_increment (adjustment, step_increment); gtk_adjustment_set_page_increment (adjustment, page_increment); - e_reflow_resize_children(item); - e_canvas_item_request_reflow(item); - gnome_canvas_request_redraw(item->canvas, 0, 0, reflow->width, reflow->height); + e_reflow_resize_children (item); + e_canvas_item_request_reflow (item); + gnome_canvas_request_redraw (item->canvas, 0, 0, reflow->width, reflow->height); column_width_changed (reflow); } reflow->need_column_resize = TRUE; - gnome_canvas_item_request_update(item); + gnome_canvas_item_request_update (item); gnome_canvas_item_ungrab (item, button->time); return TRUE; } @@ -1085,12 +1085,12 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) value = gtk_adjustment_get_value (adjustment); reflow->temp_column_width = reflow->column_width + - (motion->x - reflow->start_x)/(reflow->which_column_dragged - e_reflow_pick_line(reflow, value)); + (motion->x - reflow->start_x)/(reflow->which_column_dragged - e_reflow_pick_line (reflow, value)); if (reflow->temp_column_width < 50) reflow->temp_column_width = 50; if (old_width != reflow->temp_column_width) { reflow->need_column_resize = TRUE; - gnome_canvas_item_request_update(item); + gnome_canvas_item_request_update (item); } return TRUE; } else { @@ -1100,18 +1100,18 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) n_x = motion->x; n_x += E_REFLOW_BORDER_WIDTH + E_REFLOW_DIVIDER_WIDTH; - n_x = fmod(n_x,(reflow->column_width + E_REFLOW_FULL_GUTTER)); + n_x = fmod (n_x,(reflow->column_width + E_REFLOW_FULL_GUTTER)); window = gtk_widget_get_window (GTK_WIDGET (item->canvas)); if (motion->y >= E_REFLOW_BORDER_WIDTH && motion->y <= reflow->height - E_REFLOW_BORDER_WIDTH && n_x < E_REFLOW_FULL_GUTTER) { if (reflow->default_cursor_shown) { - gdk_window_set_cursor(window, reflow->arrow_cursor); + gdk_window_set_cursor (window, reflow->arrow_cursor); reflow->default_cursor_shown = FALSE; } } else if (!reflow->default_cursor_shown) { - gdk_window_set_cursor(window, reflow->default_cursor); + gdk_window_set_cursor (window, reflow->default_cursor); reflow->default_cursor_shown = TRUE; } @@ -1125,13 +1125,13 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) n_x = crossing->x; n_x += E_REFLOW_BORDER_WIDTH + E_REFLOW_DIVIDER_WIDTH; - n_x = fmod(n_x,(reflow->column_width + E_REFLOW_FULL_GUTTER)); + n_x = fmod (n_x,(reflow->column_width + E_REFLOW_FULL_GUTTER)); window = gtk_widget_get_window (GTK_WIDGET (item->canvas)); if (crossing->y >= E_REFLOW_BORDER_WIDTH && crossing->y <= reflow->height - E_REFLOW_BORDER_WIDTH && n_x < E_REFLOW_FULL_GUTTER) { if (reflow->default_cursor_shown) { - gdk_window_set_cursor(window, reflow->arrow_cursor); + gdk_window_set_cursor (window, reflow->arrow_cursor); reflow->default_cursor_shown = FALSE; } } @@ -1145,13 +1145,13 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) n_x = crossing->x; n_x += E_REFLOW_BORDER_WIDTH + E_REFLOW_DIVIDER_WIDTH; - n_x = fmod(n_x,(reflow->column_width + E_REFLOW_FULL_GUTTER)); + n_x = fmod (n_x,(reflow->column_width + E_REFLOW_FULL_GUTTER)); window = gtk_widget_get_window (GTK_WIDGET (item->canvas)); if (!( crossing->y >= E_REFLOW_BORDER_WIDTH && crossing->y <= reflow->height - E_REFLOW_BORDER_WIDTH && n_x < E_REFLOW_FULL_GUTTER )) { if (!reflow->default_cursor_shown) { - gdk_window_set_cursor(window, reflow->default_cursor); + gdk_window_set_cursor (window, reflow->default_cursor); reflow->default_cursor_shown = TRUE; } } @@ -1162,8 +1162,8 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) } if (return_val) return return_val; - else if (GNOME_CANVAS_ITEM_CLASS( e_reflow_parent_class )->event) - return (* GNOME_CANVAS_ITEM_CLASS( e_reflow_parent_class )->event) (item, event); + else if (GNOME_CANVAS_ITEM_CLASS ( e_reflow_parent_class )->event) + return (* GNOME_CANVAS_ITEM_CLASS ( e_reflow_parent_class )->event) (item, event); else return FALSE; } @@ -1174,12 +1174,12 @@ static void e_reflow_draw (GnomeCanvasItem *item, GdkDrawable *drawable, GtkStyle *style; gint x_rect, y_rect, width_rect, height_rect; gdouble running_width; - EReflow *reflow = E_REFLOW(item); + EReflow *reflow = E_REFLOW (item); gint i; gdouble column_width; - if (GNOME_CANVAS_ITEM_CLASS(e_reflow_parent_class)->draw) - GNOME_CANVAS_ITEM_CLASS(e_reflow_parent_class)->draw (item, drawable, x, y, width, height); + if (GNOME_CANVAS_ITEM_CLASS (e_reflow_parent_class)->draw) + GNOME_CANVAS_ITEM_CLASS (e_reflow_parent_class)->draw (item, drawable, x, y, width, height); column_width = reflow->column_width; running_width = E_REFLOW_BORDER_WIDTH + column_width + E_REFLOW_BORDER_WIDTH; y_rect = E_REFLOW_BORDER_WIDTH; @@ -1197,12 +1197,12 @@ static void e_reflow_draw (GnomeCanvasItem *item, GdkDrawable *drawable, if (running_width > x + width) break; x_rect = running_width; - gtk_paint_flat_box(style, + gtk_paint_flat_box (style, drawable, GTK_STATE_ACTIVE, GTK_SHADOW_NONE, NULL, - GTK_WIDGET(item->canvas), + GTK_WIDGET (item->canvas), "reflow", x_rect - x, y_rect - y, @@ -1220,7 +1220,7 @@ static void e_reflow_draw (GnomeCanvasItem *item, GdkDrawable *drawable, adjustment = gtk_layout_get_hadjustment (layout); value = gtk_adjustment_get_value (adjustment); - start_line = e_reflow_pick_line(reflow, value); + start_line = e_reflow_pick_line (reflow, value); i = x - start_line * (column_width + E_REFLOW_FULL_GUTTER); running_width = start_line * (column_width + E_REFLOW_FULL_GUTTER); column_width = reflow->temp_column_width; @@ -1239,7 +1239,7 @@ static void e_reflow_draw (GnomeCanvasItem *item, GdkDrawable *drawable, if (running_width > x + width) break; x_rect = running_width; - gdk_draw_rectangle(drawable, + gdk_draw_rectangle (drawable, style->fg_gc[GTK_STATE_NORMAL], TRUE, x_rect - x, @@ -1259,8 +1259,8 @@ e_reflow_update (GnomeCanvasItem *item, gdouble affine[6], ArtSVP *clip_path, gi reflow = E_REFLOW (item); - if (GNOME_CANVAS_ITEM_CLASS(e_reflow_parent_class)->update) - GNOME_CANVAS_ITEM_CLASS(e_reflow_parent_class)->update (item, affine, clip_path, flags); + if (GNOME_CANVAS_ITEM_CLASS (e_reflow_parent_class)->update) + GNOME_CANVAS_ITEM_CLASS (e_reflow_parent_class)->update (item, affine, clip_path, flags); x0 = item->x1; y0 = item->y1; @@ -1282,12 +1282,12 @@ e_reflow_update (GnomeCanvasItem *item, gdouble affine[6], ArtSVP *clip_path, gi x0 = 0; if (y0 > 0) y0 = 0; - if (x1 < E_REFLOW(item)->width) - x1 = E_REFLOW(item)->width; - if (x1 < E_REFLOW(item)->height) - x1 = E_REFLOW(item)->height; + if (x1 < E_REFLOW (item)->width) + x1 = E_REFLOW (item)->width; + if (x1 < E_REFLOW (item)->height) + x1 = E_REFLOW (item)->height; - gnome_canvas_request_redraw(item->canvas, x0, y0, x1, y1); + gnome_canvas_request_redraw (item->canvas, x0, y0, x1, y1); reflow->need_height_update = FALSE; } else if (reflow->need_column_resize) { GtkLayout *layout; @@ -1315,7 +1315,7 @@ e_reflow_update (GnomeCanvasItem *item, gdouble affine[6], ArtSVP *clip_path, gi for ( i = 0; i < reflow->column_count; i++) { x_rect = running_width; - gnome_canvas_request_redraw(item->canvas, x_rect, y_rect, x_rect + width_rect, y_rect + height_rect); + gnome_canvas_request_redraw (item->canvas, x_rect, y_rect, x_rect + width_rect, y_rect + height_rect); running_width += E_REFLOW_DIVIDER_WIDTH + E_REFLOW_BORDER_WIDTH + column_width + E_REFLOW_BORDER_WIDTH; } } @@ -1331,7 +1331,7 @@ e_reflow_update (GnomeCanvasItem *item, gdouble affine[6], ArtSVP *clip_path, gi for ( i = 0; i < reflow->column_count; i++) { x_rect = running_width; - gnome_canvas_request_redraw(item->canvas, x_rect, y_rect, x_rect + width_rect, y_rect + height_rect); + gnome_canvas_request_redraw (item->canvas, x_rect, y_rect, x_rect + width_rect, y_rect + height_rect); running_width += E_REFLOW_DIVIDER_WIDTH + E_REFLOW_BORDER_WIDTH + column_width + E_REFLOW_BORDER_WIDTH; } } @@ -1350,8 +1350,8 @@ e_reflow_point (GnomeCanvasItem *item, *actual_item = NULL; - if (GNOME_CANVAS_ITEM_CLASS(e_reflow_parent_class)->point) - distance = GNOME_CANVAS_ITEM_CLASS(e_reflow_parent_class)->point (item, x, y, cx, cy, actual_item); + if (GNOME_CANVAS_ITEM_CLASS (e_reflow_parent_class)->point) + distance = GNOME_CANVAS_ITEM_CLASS (e_reflow_parent_class)->point (item, x, y, cx, cy, actual_item); if ((gint) (distance * item->canvas->pixels_per_unit + 0.5) <= item->canvas->close_enough && *actual_item) return distance; @@ -1362,7 +1362,7 @@ e_reflow_point (GnomeCanvasItem *item, gfloat n_x; n_x = x; n_x += E_REFLOW_BORDER_WIDTH + E_REFLOW_DIVIDER_WIDTH; - n_x = fmod(n_x, (reflow->column_width + E_REFLOW_FULL_GUTTER)); + n_x = fmod (n_x, (reflow->column_width + E_REFLOW_FULL_GUTTER)); if (n_x < E_REFLOW_FULL_GUTTER) { *actual_item = item; return 0; @@ -1373,9 +1373,9 @@ e_reflow_point (GnomeCanvasItem *item, } static void -e_reflow_reflow( GnomeCanvasItem *item, gint flags ) +e_reflow_reflow ( GnomeCanvasItem *item, gint flags ) { - EReflow *reflow = E_REFLOW(item); + EReflow *reflow = E_REFLOW (item); gdouble old_width; gdouble running_width; gdouble running_height; @@ -1405,7 +1405,7 @@ e_reflow_reflow( GnomeCanvasItem *item, gint flags ) } if (unsorted >= 0 && reflow->items[unsorted]) { - e_canvas_item_move_absolute(GNOME_CANVAS_ITEM(reflow->items[unsorted]), + e_canvas_item_move_absolute (GNOME_CANVAS_ITEM (reflow->items[unsorted]), (gdouble) running_width, (gdouble) running_height); running_height += reflow->heights[unsorted] + E_REFLOW_BORDER_WIDTH; @@ -1415,7 +1415,7 @@ e_reflow_reflow( GnomeCanvasItem *item, gint flags ) if (reflow->width < reflow->minimum_width) reflow->width = reflow->minimum_width; if (old_width != reflow->width) - e_canvas_item_request_parent_reflow(item); + e_canvas_item_request_parent_reflow (item); } static gint @@ -1431,15 +1431,15 @@ e_reflow_selection_event_real (EReflow *reflow, GnomeCanvasItem *item, GdkEvent row = er_find_item (reflow, item); if (event->button.button == 1) { reflow->maybe_did_something = - e_selection_model_maybe_do_something(reflow->selection, row, 0, event->button.state); + e_selection_model_maybe_do_something (reflow->selection, row, 0, event->button.state); reflow->maybe_in_drag = TRUE; } else { - e_selection_model_do_something(reflow->selection, row, 0, event->button.state); + e_selection_model_do_something (reflow->selection, row, 0, event->button.state); } break; case 3: row = er_find_item (reflow, item); - e_selection_model_right_click_down(reflow->selection, row, 0, 0); + e_selection_model_right_click_down (reflow->selection, row, 0, 0); break; default: return_val = FALSE; @@ -1452,13 +1452,13 @@ e_reflow_selection_event_real (EReflow *reflow, GnomeCanvasItem *item, GdkEvent reflow->maybe_in_drag = FALSE; if (!reflow->maybe_did_something) { row = er_find_item (reflow, item); - e_selection_model_do_something(reflow->selection, row, 0, event->button.state); + e_selection_model_do_something (reflow->selection, row, 0, event->button.state); } } } break; case GDK_KEY_PRESS: - return_val = e_selection_model_key_press(reflow->selection, (GdkEventKey *) event); + return_val = e_selection_model_key_press (reflow->selection, (GdkEventKey *) event); break; default: return_val = FALSE; @@ -1534,7 +1534,7 @@ e_reflow_class_init (EReflowClass *klass) 0.0, G_MAXDOUBLE, 150.0, G_PARAM_READWRITE)); - signals [SELECTION_EVENT] = + signals[SELECTION_EVENT] = g_signal_new ("selection_event", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -1544,7 +1544,7 @@ e_reflow_class_init (EReflowClass *klass) G_TYPE_INT, 2, G_TYPE_OBJECT, GDK_TYPE_EVENT); - signals [COLUMN_WIDTH_CHANGED] = + signals[COLUMN_WIDTH_CHANGED] = g_signal_new ("column_width_changed", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -1593,7 +1593,7 @@ e_reflow_init (EReflow *reflow) reflow->do_adjustment_idle_id = 0; reflow->set_scroll_adjustments_id = 0; - reflow->selection = E_SELECTION_MODEL (e_selection_model_simple_new()); + reflow->selection = E_SELECTION_MODEL (e_selection_model_simple_new ()); reflow->sorter = e_sorter_array_new (er_compare, reflow); g_object_set (reflow->selection, @@ -1610,5 +1610,5 @@ e_reflow_init (EReflow *reflow) g_signal_connect(reflow->selection, "cursor_changed", G_CALLBACK (cursor_changed), reflow); - e_canvas_item_set_reflow_callback(GNOME_CANVAS_ITEM(reflow), e_reflow_reflow); + e_canvas_item_set_reflow_callback (GNOME_CANVAS_ITEM (reflow), e_reflow_reflow); } diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c index bb9b2dda51..979cae72e0 100644 --- a/widgets/text/e-text.c +++ b/widgets/text/e-text.c @@ -123,7 +123,7 @@ static void e_text_text_model_reposition (ETextModel *model, gpointer repos_data, gpointer data); -static void _get_tep(EText *text); +static void _get_tep (EText *text); static void calc_height (EText *text); @@ -133,7 +133,7 @@ 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 gchar *string); +static void e_text_insert (EText *text, const gchar *string); static void reset_layout_attrs (EText *text); @@ -213,11 +213,11 @@ e_text_dispose (GObject *object) text->model_repos_signal_id = 0; if (text->model) - g_object_unref(text->model); + g_object_unref (text->model); text->model = NULL; if (text->tep_command_id) - g_signal_handler_disconnect(text->tep, + g_signal_handler_disconnect (text->tep, text->tep_command_id); text->tep_command_id = 0; @@ -233,13 +233,13 @@ e_text_dispose (GObject *object) text->stipple = NULL; if (text->timeout_id) { - g_source_remove(text->timeout_id); + g_source_remove (text->timeout_id); text->timeout_id = 0; } if (text->timer) { - g_timer_stop(text->timer); - g_timer_destroy(text->timer); + g_timer_stop (text->timer); + g_timer_destroy (text->timer); text->timer = NULL; } @@ -289,7 +289,7 @@ insert_preedit_text (EText *text) if (text->layout == NULL || !GTK_IS_IM_CONTEXT (text->im_context)) return; - text->text = e_text_model_get_text(text->model); + text->text = e_text_model_get_text (text->model); length = strlen (text->text); g_string_prepend_len (tmp_string, text->text,length); @@ -424,7 +424,7 @@ reset_layout (EText *text) context = pango_layout_get_context (text->layout); - font_options = get_font_options(); + font_options = get_font_options (); pango_cairo_context_set_font_options (context, font_options); cairo_font_options_destroy (font_options); pango_layout_context_changed (text->layout); @@ -469,7 +469,7 @@ static void e_text_text_model_changed (ETextModel *model, EText *text) { gint model_len = e_text_model_get_text_length (model); - text->text = e_text_model_get_text(model); + text->text = e_text_model_get_text (model); /* Make sure our selection doesn't extend past the bounds of our text. */ text->selection_start = CLAMP (text->selection_start, 0, model_len); @@ -478,7 +478,7 @@ e_text_text_model_changed (ETextModel *model, EText *text) text->needs_reset_layout = 1; text->needs_split_into_lines = 1; text->needs_redraw = 1; - e_canvas_item_request_reflow (GNOME_CANVAS_ITEM(text)); + e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (text)); gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (text)); g_signal_emit (text, e_text_signals[E_TEXT_CHANGED], 0); @@ -628,7 +628,7 @@ calc_height (EText *text) text->width = width; if (old_height != text->height || old_width != text->width) - e_canvas_item_request_parent_reflow(item); + e_canvas_item_request_parent_reflow (item); } static void @@ -730,7 +730,7 @@ e_text_set_property (GObject *object, G_CALLBACK (e_text_text_model_reposition), text); - text->text = e_text_model_get_text(text->model); + text->text = e_text_model_get_text (text->model); g_signal_emit (text, e_text_signals[E_TEXT_CHANGED], 0); text->needs_split_into_lines = 1; @@ -739,17 +739,17 @@ e_text_set_property (GObject *object, case PROP_EVENT_PROCESSOR: if (text->tep && text->tep_command_id) - g_signal_handler_disconnect(text->tep, + g_signal_handler_disconnect (text->tep, text->tep_command_id); if (text->tep) { - g_object_unref(text->tep); + g_object_unref (text->tep); } - text->tep = E_TEXT_EVENT_PROCESSOR(g_value_get_object (value)); - g_object_ref(text->tep); + text->tep = E_TEXT_EVENT_PROCESSOR (g_value_get_object (value)); + g_object_ref (text->tep); text->tep_command_id = - g_signal_connect(text->tep, + g_signal_connect (text->tep, "command", - G_CALLBACK(e_text_command), + G_CALLBACK (e_text_command), text); if (!text->allow_newlines) g_object_set (text->tep, @@ -758,7 +758,7 @@ e_text_set_property (GObject *object, break; case PROP_TEXT: - e_text_model_set_text(text->model, g_value_get_string (value)); + e_text_model_set_text (text->model, g_value_get_string (value)); break; case PROP_BOLD: @@ -920,11 +920,11 @@ e_text_set_property (GObject *object, case PROP_BREAK_CHARACTERS: if (text->break_characters) { - g_free(text->break_characters); + g_free (text->break_characters); text->break_characters = NULL; } if (g_value_get_string (value)) - text->break_characters = g_strdup( g_value_get_string (value) ); + text->break_characters = g_strdup ( g_value_get_string (value) ); text->needs_split_into_lines = 1; needs_reflow = 1; break; @@ -978,7 +978,7 @@ e_text_set_property (GObject *object, case PROP_ALLOW_NEWLINES: text->allow_newlines = g_value_get_boolean (value); - _get_tep(text); + _get_tep (text); g_object_set (text->tep, "allow_newlines", g_value_get_boolean (value), NULL); @@ -1051,7 +1051,7 @@ e_text_get_property (GObject *object, break; case PROP_EVENT_PROCESSOR: - _get_tep(text); + _get_tep (text); g_value_set_object (value, text->tep); break; @@ -1212,7 +1212,7 @@ e_text_reflow (GnomeCanvasItem *item, gint flags) if (text->needs_calc_height) { calc_height (text); - gnome_canvas_item_request_update(item); + gnome_canvas_item_request_update (item); text->needs_calc_height = 0; text->needs_recalc_bounds = 1; } @@ -1308,14 +1308,14 @@ e_text_unrealize (GnomeCanvasItem *item) } static void -_get_tep(EText *text) +_get_tep (EText *text) { if (!text->tep) { - text->tep = e_text_event_processor_emacs_like_new(); + text->tep = e_text_event_processor_emacs_like_new (); text->tep_command_id = - g_signal_connect(text->tep, + g_signal_connect (text->tep, "command", - G_CALLBACK(e_text_command), + G_CALLBACK (e_text_command), text); } } @@ -1417,8 +1417,8 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable, GtkStateType state; text = E_TEXT (item); - canvas = GNOME_CANVAS_ITEM(text)->canvas; - widget = GTK_WIDGET(canvas); + canvas = GNOME_CANVAS_ITEM (text)->canvas; + widget = GTK_WIDGET (canvas); state = gtk_widget_get_state (widget); style = gtk_widget_get_style (widget); window = gtk_widget_get_window (widget); @@ -1433,9 +1433,9 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable, gdouble thisx = item->x1 - x; gdouble thisy = item->y1 - y; gdouble thiswidth, thisheight; - widget = GTK_WIDGET(item->canvas); + widget = GTK_WIDGET (item->canvas); - g_object_get(text, + g_object_get (text, "width", &thiswidth, "height", &thisheight, NULL); @@ -1472,7 +1472,7 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable, widget = gtk_widget_get_parent (widget); - while (widget && !GTK_IS_BUTTON(widget)) { + while (widget && !GTK_IS_BUTTON (widget)) { if (gtk_widget_get_has_window (widget)) { widget = NULL; break; @@ -1616,14 +1616,14 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable, end_index = MAX (text->selection_start, text->selection_end); /* convert these into byte indices */ - start_index = g_utf8_offset_to_pointer(text->text, start_index) - text->text; - end_index = g_utf8_offset_to_pointer(text->text, end_index) - text->text; + start_index = g_utf8_offset_to_pointer (text->text, start_index) - text->text; + end_index = g_utf8_offset_to_pointer (text->text, end_index) - text->text; if (text->has_selection) { - selection_gc = style->base_gc [GTK_STATE_SELECTED]; + selection_gc = style->base_gc[GTK_STATE_SELECTED]; text_gc = style->text_gc[GTK_STATE_SELECTED]; } else { - selection_gc = style->base_gc [GTK_STATE_ACTIVE]; + selection_gc = style->base_gc[GTK_STATE_ACTIVE]; text_gc = style->text_gc[GTK_STATE_ACTIVE]; } @@ -1868,12 +1868,12 @@ get_position_from_xy (EText *text, gint x, gint y) static gboolean _blink_scroll_timeout (gpointer data) { - EText *text = E_TEXT(data); + EText *text = E_TEXT (data); gulong current_time; gboolean scroll = FALSE; gboolean redraw = FALSE; - g_timer_elapsed(text->timer, ¤t_time); + g_timer_elapsed (text->timer, ¤t_time); if (text->scroll_start + SCROLL_WAIT_TIME > 1000000) { if (current_time > text->scroll_start - (1000000 - SCROLL_WAIT_TIME) && @@ -1922,8 +1922,8 @@ _blink_scroll_timeout (gpointer data) e_tep_event.type = GDK_MOTION_NOTIFY; e_tep_event.motion.state = text->last_state; e_tep_event.motion.time = 0; - e_tep_event.motion.position = get_position_from_xy(text, text->lastx, text->lasty); - _get_tep(text); + e_tep_event.motion.position = get_position_from_xy (text, text->lastx, text->lasty); + _get_tep (text); e_text_event_processor_handle_event (text->tep, &e_tep_event); text->scroll_start = current_time; @@ -1942,7 +1942,7 @@ _blink_scroll_timeout (gpointer data) } if (redraw) { text->needs_redraw = 1; - gnome_canvas_item_request_update (GNOME_CANVAS_ITEM(text)); + gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (text)); } return TRUE; } @@ -1972,10 +1972,10 @@ start_editing (EText *text) text->xofs_edit = 0; text->yofs_edit = 0; if (text->timeout_id == 0) - text->timeout_id = g_timeout_add(10, _blink_scroll_timeout, text); - text->timer = g_timer_new(); - g_timer_elapsed(text->timer, &(text->scroll_start)); - g_timer_start(text->timer); + text->timeout_id = g_timeout_add (10, _blink_scroll_timeout, text); + text->timer = g_timer_new (); + g_timer_elapsed (text->timer, &(text->scroll_start)); + g_timer_start (text->timer); } void @@ -1997,8 +1997,8 @@ e_text_stop_editing (EText *text) text->default_cursor_shown = TRUE; } if (text->timer) { - g_timer_stop(text->timer); - g_timer_destroy(text->timer); + g_timer_stop (text->timer); + g_timer_destroy (text->timer); text->timer = NULL; } } @@ -2007,7 +2007,7 @@ void e_text_cancel_editing (EText *text) { if (text->revert) - e_text_model_set_text(text->model, text->revert); + e_text_model_set_text (text->model, text->revert); e_text_stop_editing (text); } @@ -2021,7 +2021,7 @@ _click (gpointer data) static gint e_text_event (GnomeCanvasItem *item, GdkEvent *event) { - EText *text = E_TEXT(item); + EText *text = E_TEXT (item); ETextEventProcessorEvent e_tep_event; GdkWindow *window; @@ -2094,18 +2094,18 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) e_text_stop_editing (text); if (text->timeout_id) { - g_source_remove(text->timeout_id); + g_source_remove (text->timeout_id); text->timeout_id = 0; } if (text->show_cursor || text->draw_borders) { text->show_cursor = FALSE; text->needs_redraw = 1; - gnome_canvas_item_request_update (GNOME_CANVAS_ITEM(text)); + gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (text)); } } if (text->line_wrap) text->needs_split_into_lines = 1; - e_canvas_item_request_reflow (GNOME_CANVAS_ITEM(text)); + e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (text)); } return_val = 0; break; @@ -2160,7 +2160,7 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) e_tep_event.key.length = 0; } #endif - _get_tep(text); + _get_tep (text); ret = e_text_event_processor_handle_event (text->tep, &e_tep_event); if (event->type == GDK_KEY_PRESS) @@ -2188,8 +2188,8 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) e_tep_event.button.time = button.time; e_tep_event.button.state = button.state; e_tep_event.button.button = button.button; - e_tep_event.button.position = get_position_from_xy(text, button.x, button.y); - _get_tep(text); + e_tep_event.button.position = get_position_from_xy (text, button.x, button.y); + _get_tep (text); return_val = e_text_event_processor_handle_event (text->tep, &e_tep_event); e_tep_event.type = GDK_BUTTON_RELEASE; @@ -2239,8 +2239,8 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) e_tep_event.button.time = button.time; e_tep_event.button.state = button.state; e_tep_event.button.button = button.button; - e_tep_event.button.position = get_position_from_xy(text, button.x, button.y); - _get_tep(text); + e_tep_event.button.position = get_position_from_xy (text, button.x, button.y); + _get_tep (text); return_val = e_text_event_processor_handle_event (text->tep, &e_tep_event); if (event->button.button == 1) { @@ -2259,8 +2259,8 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) GdkEventMotion motion = event->motion; e_tep_event.motion.time = motion.time; e_tep_event.motion.state = motion.state; - e_tep_event.motion.position = get_position_from_xy(text, motion.x, motion.y); - _get_tep(text); + e_tep_event.motion.position = get_position_from_xy (text, motion.x, motion.y); + _get_tep (text); return_val = e_text_event_processor_handle_event (text->tep, &e_tep_event); text->lastx = motion.x; @@ -2272,7 +2272,7 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) text->pointer_in = TRUE; if (text->editing || text->draw_borders) { if (text->default_cursor_shown) { - gdk_window_set_cursor(window, text->i_cursor); + gdk_window_set_cursor (window, text->i_cursor); text->default_cursor_shown = FALSE; } } @@ -2281,7 +2281,7 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) text->pointer_in = FALSE; if (text->editing || text->draw_borders) { if (!text->default_cursor_shown) { - gdk_window_set_cursor(window, text->default_cursor); + gdk_window_set_cursor (window, text->default_cursor); text->default_cursor_shown = TRUE; } } @@ -2291,8 +2291,8 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) } if (return_val) return return_val; - if (GNOME_CANVAS_ITEM_CLASS(e_text_parent_class)->event) - return GNOME_CANVAS_ITEM_CLASS(e_text_parent_class)->event(item, event); + if (GNOME_CANVAS_ITEM_CLASS (e_text_parent_class)->event) + return GNOME_CANVAS_ITEM_CLASS (e_text_parent_class)->event (item, event); else return 0; } @@ -2321,15 +2321,15 @@ e_text_copy_clipboard (EText *text) } void -e_text_delete_selection(EText *text) +e_text_delete_selection (EText *text) { gint sel_start, sel_end; - sel_start = MIN(text->selection_start, text->selection_end); - sel_end = MAX(text->selection_start, text->selection_end); + sel_start = MIN (text->selection_start, text->selection_end); + sel_end = MAX (text->selection_start, text->selection_end); if (sel_start != sel_end) - e_text_model_delete(text->model, sel_start, sel_end - sel_start); + e_text_model_delete (text->model, sel_start, sel_end - sel_start); } void @@ -2348,7 +2348,7 @@ e_text_paste_clipboard (EText *text) command.position = E_TEP_SELECTION; command.string = ""; command.value = 0; - e_text_command(text->tep, &command, text); + e_text_command (text->tep, &command, text); } void @@ -2360,7 +2360,7 @@ e_text_select_all (EText *text) command.position = E_TEP_SELECT_ALL; command.string = ""; command.value = 0; - e_text_command(text->tep, &command, text); + e_text_command (text->tep, &command, text); } static void @@ -2372,8 +2372,8 @@ primary_get_cb (GtkClipboard *clipboard, EText *text = E_TEXT (data); gint sel_start, sel_end; - sel_start = MIN(text->selection_start, text->selection_end); - sel_end = MAX(text->selection_start, text->selection_end); + sel_start = MIN (text->selection_start, text->selection_end); + sel_end = MAX (text->selection_start, text->selection_end); /* convert sel_start/sel_end to byte indices */ sel_start = g_utf8_offset_to_pointer (text->text, sel_start) - text->text; @@ -2471,7 +2471,7 @@ popup_menu_placement_cb (GtkMenu *menu, gboolean *push_in, gpointer user_data) { - EText *text = E_TEXT(user_data); + EText *text = E_TEXT (user_data); GnomeCanvasItem *item = &text->item; GnomeCanvas *parent = item->canvas; @@ -2502,7 +2502,7 @@ popup_targets_received (GtkClipboard *clipboard, g_free (closure); gtk_menu_attach_to_widget (GTK_MENU (popup_menu), - GTK_WIDGET(GNOME_CANVAS_ITEM (text)->canvas), + GTK_WIDGET (GNOME_CANVAS_ITEM (text)->canvas), popup_menu_detach); /* cut menu item */ @@ -2669,7 +2669,7 @@ find_offset_into_line (EText *text, gint offset_into_text, gchar **start_of_line } /* direction = TRUE (move forward), FALSE (move backward) - Any error shall return length(text->text) or 0 or + Any error shall return length (text->text) or 0 or text->selection_end (as deemed fit) */ static gint _get_updated_position (EText *text, gboolean direction) @@ -2693,7 +2693,7 @@ _get_updated_position (EText *text, gboolean direction) return 0; /* check for validness of full text->text */ - if (!g_utf8_validate(text->text, -1, NULL)) + if (!g_utf8_validate (text->text, -1, NULL)) return text->selection_end; /* get layout's PangoLogAttr to facilitate moving when @@ -2731,13 +2731,13 @@ _get_updated_position (EText *text, gboolean direction) } if (log_attrs) - g_free(log_attrs); + g_free (log_attrs); return new_pos; } static gint -_get_position(EText *text, ETextEventProcessorCommand *command) +_get_position (EText *text, ETextEventProcessorCommand *command) { gint length, obj_num; gunichar unival; @@ -2812,7 +2812,7 @@ _get_position(EText *text, ETextEventProcessorCommand *command) new_pos = length; else /* get updated position to display cursor */ - new_pos = _get_updated_position(text, TRUE); + new_pos = _get_updated_position (text, TRUE); break; @@ -3010,7 +3010,7 @@ _get_position(EText *text, ETextEventProcessorCommand *command) } static void -e_text_insert(EText *text, const gchar *string) +e_text_insert (EText *text, const gchar *string) { gint len = strlen (string); @@ -3022,7 +3022,7 @@ e_text_insert(EText *text, const gchar *string) gchar *new_string = g_malloc (len + 1); gchar *j = new_string; - for (i = string; *i; i = g_utf8_next_char(i)) { + for (i = string; *i; i = g_utf8_next_char (i)) { if (*i != '\n') { gunichar c; gint charlen; @@ -3034,12 +3034,12 @@ e_text_insert(EText *text, const gchar *string) } } *j = 0; - e_text_model_insert_length(text->model, text->selection_start, new_string, utf8len); + e_text_model_insert_length (text->model, text->selection_start, new_string, utf8len); g_free (new_string); } else { utf8len = g_utf8_strlen (string, -1); - e_text_model_insert_length(text->model, text->selection_start, string, utf8len); + e_text_model_insert_length (text->model, text->selection_start, string, utf8len); } } } @@ -3097,16 +3097,16 @@ e_text_command (ETextEventProcessor *tep, ETextEventProcessorCommand *command, gpointer data) { - EText *text = E_TEXT(data); + EText *text = E_TEXT (data); gboolean scroll = TRUE; gboolean use_start = TRUE; switch (command->action) { case E_TEP_MOVE: - text->selection_start = _get_position(text, command); + text->selection_start = _get_position (text, command); text->selection_end = text->selection_start; if (text->timer) { - g_timer_reset(text->timer); + g_timer_reset (text->timer); } use_start = TRUE; @@ -3115,7 +3115,7 @@ e_text_command (ETextEventProcessor *tep, text->selection_start = e_text_model_validate_position ( text->model, text->selection_start); /* paranoia */ - text->selection_end = _get_position(text, command); + text->selection_end = _get_position (text, command); e_text_update_primary_selection (text); @@ -3124,11 +3124,11 @@ e_text_command (ETextEventProcessor *tep, break; case E_TEP_DELETE: if (text->selection_end == text->selection_start) { - text->selection_end = _get_position(text, command); + text->selection_end = _get_position (text, command); } - e_text_delete_selection(text); + e_text_delete_selection (text); if (text->timer) { - g_timer_reset(text->timer); + g_timer_reset (text->timer); } use_start = FALSE; @@ -3138,11 +3138,11 @@ e_text_command (ETextEventProcessor *tep, case E_TEP_INSERT: if (g_utf8_validate (command->string, command->value, NULL)) { if (text->selection_end != text->selection_start) { - e_text_delete_selection(text); + e_text_delete_selection (text); } - e_text_insert(text, command->string); + e_text_insert (text, command->string); if (text->timer) { - g_timer_reset(text->timer); + g_timer_reset (text->timer); } } break; @@ -3150,14 +3150,14 @@ e_text_command (ETextEventProcessor *tep, e_text_copy_clipboard (text); if (text->timer) { - g_timer_reset(text->timer); + g_timer_reset (text->timer); } scroll = FALSE; break; case E_TEP_PASTE: e_text_paste (text, GDK_NONE); if (text->timer) { - g_timer_reset(text->timer); + g_timer_reset (text->timer); } break; case E_TEP_GET_SELECTION: @@ -3166,15 +3166,15 @@ e_text_command (ETextEventProcessor *tep, case E_TEP_ACTIVATE: g_signal_emit (text, e_text_signals[E_TEXT_ACTIVATE], 0); if (text->timer) { - g_timer_reset(text->timer); + g_timer_reset (text->timer); } break; case E_TEP_SET_SELECT_BY_WORD: text->select_by_word = command->value; break; case E_TEP_GRAB: - e_canvas_item_grab (E_CANVAS (GNOME_CANVAS_ITEM(text)->canvas), - GNOME_CANVAS_ITEM(text), + e_canvas_item_grab (E_CANVAS (GNOME_CANVAS_ITEM (text)->canvas), + GNOME_CANVAS_ITEM (text), GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK, text->i_cursor, command->time, @@ -3183,8 +3183,8 @@ e_text_command (ETextEventProcessor *tep, scroll = FALSE; break; case E_TEP_UNGRAB: - e_canvas_item_ungrab (E_CANVAS (GNOME_CANVAS_ITEM(text)->canvas), - GNOME_CANVAS_ITEM(text), + e_canvas_item_ungrab (E_CANVAS (GNOME_CANVAS_ITEM (text)->canvas), + GNOME_CANVAS_ITEM (text), command->time); scroll = FALSE; break; @@ -3311,7 +3311,7 @@ e_text_command (ETextEventProcessor *tep, } text->needs_redraw = 1; - gnome_canvas_item_request_update (GNOME_CANVAS_ITEM(text)); + gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (text)); } /* Class initialization function for the text item */ @@ -3704,7 +3704,7 @@ e_text_init (EText *text) text->handle_popup = FALSE; - e_canvas_item_set_reflow_callback(GNOME_CANVAS_ITEM(text), e_text_reflow); + e_canvas_item_set_reflow_callback (GNOME_CANVAS_ITEM (text), e_text_reflow); } /* IM Context Callbacks */ diff --git a/widgets/text/gal-a11y-e-text.c b/widgets/text/gal-a11y-e-text.c index 9145ed8b41..45bd9341ec 100644 --- a/widgets/text/gal-a11y-e-text.c +++ b/widgets/text/gal-a11y-e-text.c @@ -146,7 +146,7 @@ et_get_text (AtkText *text, static gboolean is_a_seperator (gunichar c) { - return g_unichar_ispunct(c) || g_unichar_isspace(c); + return g_unichar_ispunct (c) || g_unichar_isspace (c); } static gint @@ -480,7 +480,7 @@ et_get_caret_offset (AtkText *text) EText *etext; gint offset; - g_return_val_if_fail (ATK_IS_GOBJECT_ACCESSIBLE(text), -1); + g_return_val_if_fail (ATK_IS_GOBJECT_ACCESSIBLE (text), -1); obj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (text)); if (obj == NULL) return -1; @@ -526,14 +526,14 @@ et_get_character_extents (AtkText *text, GtkWidget *widget; PangoRectangle pango_pos; - g_return_if_fail (ATK_IS_GOBJECT_ACCESSIBLE(text)); + g_return_if_fail (ATK_IS_GOBJECT_ACCESSIBLE (text)); obj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (text)); if (obj == NULL) return; g_return_if_fail (E_IS_TEXT (obj)); - etext = E_TEXT(obj); - canvas = GNOME_CANVAS_ITEM(etext)->canvas; - widget = GTK_WIDGET(canvas); + etext = E_TEXT (obj); + canvas = GNOME_CANVAS_ITEM (etext)->canvas; + widget = GTK_WIDGET (canvas); window = gtk_widget_get_window (widget); gdk_window_get_origin (window, &x_widget, &y_widget); @@ -604,14 +604,14 @@ et_get_offset_at_point (AtkText *text, gint index; gint trailing; - g_return_val_if_fail (ATK_IS_GOBJECT_ACCESSIBLE(text), -1); + g_return_val_if_fail (ATK_IS_GOBJECT_ACCESSIBLE (text), -1); obj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (text)); if (obj == NULL) return -1; g_return_val_if_fail (E_IS_TEXT (obj), -1); - etext = E_TEXT(obj); - canvas = GNOME_CANVAS_ITEM(etext)->canvas; - widget = GTK_WIDGET(canvas); + etext = E_TEXT (obj); + canvas = GNOME_CANVAS_ITEM (etext)->canvas; + widget = GTK_WIDGET (canvas); window = gtk_widget_get_window (widget); gdk_window_get_origin (window, &x_widget, &y_widget); @@ -880,7 +880,7 @@ et_delete_text (AtkEditableText *text, GObject *obj; EText *etext; - g_return_if_fail (ATK_IS_GOBJECT_ACCESSIBLE(text)); + g_return_if_fail (ATK_IS_GOBJECT_ACCESSIBLE (text)); obj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (text)); if (obj == NULL) return; |