diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-08-16 23:25:56 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-09-04 19:34:32 +0800 |
commit | fcbbdfbd18e15b4ee8322a0217cf03a689a5e033 (patch) | |
tree | e16cd2a2279558c6a2bfb6ca39fcbaac4c85ba59 /widgets | |
parent | f78417c48861759d7b0c4535ecd3febe4638a7d3 (diff) | |
download | gsoc2013-evolution-fcbbdfbd18e15b4ee8322a0217cf03a689a5e033.tar gsoc2013-evolution-fcbbdfbd18e15b4ee8322a0217cf03a689a5e033.tar.gz gsoc2013-evolution-fcbbdfbd18e15b4ee8322a0217cf03a689a5e033.tar.bz2 gsoc2013-evolution-fcbbdfbd18e15b4ee8322a0217cf03a689a5e033.tar.lz gsoc2013-evolution-fcbbdfbd18e15b4ee8322a0217cf03a689a5e033.tar.xz gsoc2013-evolution-fcbbdfbd18e15b4ee8322a0217cf03a689a5e033.tar.zst gsoc2013-evolution-fcbbdfbd18e15b4ee8322a0217cf03a689a5e033.zip |
Coding style and whitespace cleanup.
Diffstat (limited to 'widgets')
140 files changed, 5477 insertions, 3385 deletions
diff --git a/widgets/e-timezone-dialog/e-timezone-dialog.c b/widgets/e-timezone-dialog/e-timezone-dialog.c index 26cfdea4ec..f4acb61c29 100644 --- a/widgets/e-timezone-dialog/e-timezone-dialog.c +++ b/widgets/e-timezone-dialog/e-timezone-dialog.c @@ -56,7 +56,7 @@ struct _ETimezoneDialogPrivate { /* The selected timezone. May be NULL for a 'local time' (i.e. when - the displayed name is ""). */ + * the displayed name is ""). */ icaltimezone *zone; GtkBuilder *builder; @@ -95,7 +95,7 @@ static gboolean on_map_button_pressed (GtkWidget *w, GdkEventButton *event, gpointer data); -static icaltimezone* get_zone_from_point (ETimezoneDialog *etd, +static icaltimezone * get_zone_from_point (ETimezoneDialog *etd, EMapPoint *point); static void set_map_timezone (ETimezoneDialog *etd, icaltimezone *zone); @@ -348,7 +348,7 @@ get_local_offset (void) } #endif -static icaltimezone* +static icaltimezone * get_local_timezone (void) { icaltimezone *zone; @@ -411,8 +411,8 @@ e_timezone_dialog_new (void) } static void -format_utc_offset (gint utc_offset, - gchar *buffer) +format_utc_offset (gint utc_offset, + gchar *buffer) { const gchar *sign = "+"; gint hours, minutes, seconds; @@ -503,13 +503,15 @@ on_map_timeout (gpointer data) } static gboolean -on_map_motion (GtkWidget *widget, GdkEventMotion *event, gpointer data) +on_map_motion (GtkWidget *widget, + GdkEventMotion *event, + gpointer data) { ETimezoneDialog *etd; ETimezoneDialogPrivate *priv; gdouble longitude, latitude; icaltimezone *new_zone; - gchar *display=NULL; + gchar *display = NULL; etd = E_TIMEZONE_DIALOG (data); priv = etd->priv; @@ -539,7 +541,9 @@ on_map_motion (GtkWidget *widget, GdkEventMotion *event, gpointer data) } static gboolean -on_map_leave (GtkWidget *widget, GdkEventCrossing *event, gpointer data) +on_map_leave (GtkWidget *widget, + GdkEventCrossing *event, + gpointer data) { ETimezoneDialog *etd; ETimezoneDialogPrivate *priv; @@ -548,8 +552,8 @@ on_map_leave (GtkWidget *widget, GdkEventCrossing *event, gpointer data) priv = etd->priv; /* We only want to reset the hover point if this is a normal leave - event. For some reason we are getting leave events when the - button is pressed in the map, which causes problems. */ + * event. For some reason we are getting leave events when the + * button is pressed in the map, which causes problems. */ if (event->mode != GDK_CROSSING_NORMAL) return FALSE; @@ -567,8 +571,9 @@ on_map_leave (GtkWidget *widget, GdkEventCrossing *event, gpointer data) } static gboolean -on_map_visibility_changed (GtkWidget *w, GdkEventVisibility *event, - gpointer data) +on_map_visibility_changed (GtkWidget *w, + GdkEventVisibility *event, + gpointer data) { ETimezoneDialog *etd; ETimezoneDialogPrivate *priv; @@ -578,7 +583,7 @@ on_map_visibility_changed (GtkWidget *w, GdkEventVisibility *event, if (event->state != GDK_VISIBILITY_FULLY_OBSCURED) { /* Map is visible, at least partly, so make sure we flash the - selected point. */ + * selected point. */ if (!priv->timeout_id) priv->timeout_id = g_timeout_add (100, on_map_timeout, etd); } else { @@ -593,7 +598,9 @@ on_map_visibility_changed (GtkWidget *w, GdkEventVisibility *event, } static gboolean -on_map_button_pressed (GtkWidget *w, GdkEventButton *event, gpointer data) +on_map_button_pressed (GtkWidget *w, + GdkEventButton *event, + gpointer data) { ETimezoneDialog *etd; ETimezoneDialogPrivate *priv; @@ -627,10 +634,10 @@ on_map_button_pressed (GtkWidget *w, GdkEventButton *event, gpointer data) } /* Returns the translated timezone location of the given EMapPoint, - e.g. "Europe/London". */ + * e.g. "Europe/London". */ static icaltimezone * get_zone_from_point (ETimezoneDialog *etd, - EMapPoint *point) + EMapPoint *point) { icalarray *zones; gdouble longitude, latitude; @@ -695,7 +702,7 @@ e_timezone_dialog_get_timezone (ETimezoneDialog *etd) void e_timezone_dialog_set_timezone (ETimezoneDialog *etd, - icaltimezone *zone) + icaltimezone *zone) { ETimezoneDialogPrivate *priv; gchar *display = NULL; @@ -722,7 +729,7 @@ e_timezone_dialog_set_timezone (ETimezoneDialog *etd, } GtkWidget * -e_timezone_dialog_get_toplevel (ETimezoneDialog *etd) +e_timezone_dialog_get_toplevel (ETimezoneDialog *etd) { ETimezoneDialogPrivate *priv; @@ -735,7 +742,8 @@ e_timezone_dialog_get_toplevel (ETimezoneDialog *etd) } static void -set_map_timezone (ETimezoneDialog *etd, icaltimezone *zone) +set_map_timezone (ETimezoneDialog *etd, + icaltimezone *zone) { ETimezoneDialogPrivate *priv; EMapPoint *point; @@ -761,7 +769,8 @@ set_map_timezone (ETimezoneDialog *etd, icaltimezone *zone) } static void -on_combo_changed (GtkComboBox *combo_box, ETimezoneDialog *etd) +on_combo_changed (GtkComboBox *combo_box, + ETimezoneDialog *etd) { ETimezoneDialogPrivate *priv; const gchar *new_zone_name; @@ -797,7 +806,8 @@ on_combo_changed (GtkComboBox *combo_box, ETimezoneDialog *etd) } static void -timezone_combo_get_active_text (GtkComboBox *combo, const gchar **zone_name) +timezone_combo_get_active_text (GtkComboBox *combo, + const gchar **zone_name) { GtkTreeModel *list_store; GtkTreeIter iter; @@ -812,7 +822,8 @@ timezone_combo_get_active_text (GtkComboBox *combo, const gchar **zone_name) } static gboolean -timezone_combo_set_active_text (GtkComboBox *combo, const gchar *zone_name) +timezone_combo_set_active_text (GtkComboBox *combo, + const gchar *zone_name) { GtkTreeModel *list_store; GHashTable *index; @@ -830,7 +841,8 @@ 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; diff --git a/widgets/menus/gal-define-views-dialog.c b/widgets/menus/gal-define-views-dialog.c index ec31c44162..1c4ff5172e 100644 --- a/widgets/menus/gal-define-views-dialog.c +++ b/widgets/menus/gal-define-views-dialog.c @@ -34,8 +34,8 @@ #include "gal-define-views-model.h" #include "gal-view-new-dialog.h" -static void gal_define_views_dialog_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); -static void gal_define_views_dialog_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); +static void gal_define_views_dialog_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static void gal_define_views_dialog_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); static void gal_define_views_dialog_dispose (GObject *object); /* The properties we support */ @@ -65,7 +65,7 @@ gal_define_views_dialog_class_init (GalDefineViewsDialogClass *klass) { GObjectClass *object_class; - object_class = (GObjectClass*) klass; + object_class = (GObjectClass *) klass; object_class->set_property = gal_define_views_dialog_set_property; object_class->get_property = gal_define_views_dialog_get_property; @@ -82,7 +82,9 @@ gal_define_views_dialog_class_init (GalDefineViewsDialogClass *klass) /* Button callbacks */ static void -gdvd_button_new_dialog_callback (GtkWidget *widget, gint id, GalDefineViewsDialog *dialog) +gdvd_button_new_dialog_callback (GtkWidget *widget, + gint id, + GalDefineViewsDialog *dialog) { gchar *name; GtkTreeIter iter; @@ -103,7 +105,7 @@ gdvd_button_new_dialog_callback (GtkWidget *widget, gint id, GalDefineViewsDialo view = gal_view_factory_new_view (factory, name); gal_view_collection_append (dialog->collection, view); - item = dialog->collection->view_data[dialog->collection->view_count-1]; + item = dialog->collection->view_data[dialog->collection->view_count - 1]; gtk_list_store_append (GTK_LIST_STORE (dialog->model), &iter); gtk_list_store_set (GTK_LIST_STORE (dialog->model), &iter, COL_GALVIEW_NAME, name, @@ -123,7 +125,8 @@ 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)); @@ -133,7 +136,8 @@ 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; @@ -150,7 +154,8 @@ 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; @@ -167,7 +172,7 @@ gdvd_button_delete_callback (GtkWidget *widget, GalDefineViewsDialog *dialog) g_return_if_fail (item && !item->built_in); - for (row=0; row<dialog->collection->view_count; row++) { + for (row = 0; row < dialog->collection->view_count; row++) { if (item == dialog->collection->view_data[row]) { gal_view_collection_delete_view (dialog->collection, row); path = gtk_tree_model_get_path (dialog->model, &iter); @@ -187,7 +192,8 @@ gdvd_button_delete_callback (GtkWidget *widget, GalDefineViewsDialog *dialog) } static void -gdvd_selection_changed_callback (GtkTreeSelection *selection, GalDefineViewsDialog *dialog) +gdvd_selection_changed_callback (GtkTreeSelection *selection, + GalDefineViewsDialog *dialog) { GtkWidget *button; GtkTreeIter iter; @@ -209,7 +215,10 @@ 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; @@ -220,7 +229,9 @@ gdvd_connect_signal (GalDefineViewsDialog *dialog, const gchar *widget_name, con } static void -dialog_response (GalDefineViewsDialog *dialog, gint response_id, gpointer data) +dialog_response (GalDefineViewsDialog *dialog, + gint response_id, + gpointer data) { gal_view_collection_save (dialog->collection); } @@ -293,7 +304,7 @@ gal_define_views_dialog_dispose (GObject *object) static void gal_define_views_dialog_set_collection (GalDefineViewsDialog *dialog, - GalViewCollection *collection) + GalViewCollection *collection) { gint i; GtkListStore *store; @@ -302,7 +313,7 @@ gal_define_views_dialog_set_collection (GalDefineViewsDialog *dialog, store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER); - for (i=0; i<collection->view_count; i++) { + for (i = 0; i < collection->view_count; i++) { GalViewCollectionItem *item = collection->view_data[i]; GtkTreeIter iter; @@ -368,7 +379,7 @@ gal_define_views_dialog_set_collection (GalDefineViewsDialog *dialog, * * Returns: The GalDefineViewsDialog. */ -GtkWidget* +GtkWidget * gal_define_views_dialog_new (GalViewCollection *collection) { GtkWidget *widget = g_object_new (GAL_TYPE_DEFINE_VIEWS_DIALOG, NULL); @@ -377,13 +388,16 @@ gal_define_views_dialog_new (GalViewCollection *collection) } static void -gal_define_views_dialog_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +gal_define_views_dialog_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { GalDefineViewsDialog *dialog; dialog = GAL_DEFINE_VIEWS_DIALOG (object); - switch (prop_id) { + switch (property_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))); @@ -392,24 +406,27 @@ gal_define_views_dialog_set_property (GObject *object, guint prop_id, const GVal break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); return; } } static void -gal_define_views_dialog_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +gal_define_views_dialog_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { GalDefineViewsDialog *dialog; dialog = GAL_DEFINE_VIEWS_DIALOG (object); - switch (prop_id) { + switch (property_id) { case PROP_COLLECTION: g_value_set_object (value, dialog->collection); default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } diff --git a/widgets/menus/gal-define-views-model.c b/widgets/menus/gal-define-views-model.c index 14031caf2b..7c69bce720 100644 --- a/widgets/menus/gal-define-views-model.c +++ b/widgets/menus/gal-define-views-model.c @@ -126,7 +126,9 @@ gdvm_row_count (ETableModel *etc) /* This function returns the value at a particular point in our ETableModel. */ static gpointer -gdvm_value_at (ETableModel *etc, gint col, gint row) +gdvm_value_at (ETableModel *etc, + gint col, + gint row) { GalDefineViewsModel *views = GAL_DEFINE_VIEWS_MODEL (etc); const gchar *value; @@ -138,7 +140,10 @@ gdvm_value_at (ETableModel *etc, gint col, gint row) /* This function sets the value at a particular point in our ETableModel. */ static void -gdvm_set_value_at (ETableModel *etc, gint col, gint row, gconstpointer val) +gdvm_set_value_at (ETableModel *etc, + gint col, + gint row, + gconstpointer val) { GalDefineViewsModel *views = GAL_DEFINE_VIEWS_MODEL (etc); if (views->editable) { @@ -154,44 +159,57 @@ gdvm_set_value_at (ETableModel *etc, gint col, gint row, gconstpointer val) /* This function returns whether a particular cell is editable. */ static gboolean -gdvm_is_cell_editable (ETableModel *etc, gint col, gint row) +gdvm_is_cell_editable (ETableModel *etc, + gint col, + gint row) { return GAL_DEFINE_VIEWS_MODEL (etc)->editable; } static void -gdvm_append_row (ETableModel *etm, ETableModel *source, gint row) +gdvm_append_row (ETableModel *etm, + ETableModel *source, + gint row) { } /* This function duplicates the value passed to it. */ static gpointer -gdvm_duplicate_value (ETableModel *etc, gint col, gconstpointer value) +gdvm_duplicate_value (ETableModel *etc, + gint col, + gconstpointer value) { return g_strdup (value); } /* This function frees the value passed to it. */ static void -gdvm_free_value (ETableModel *etc, gint col, gpointer value) +gdvm_free_value (ETableModel *etc, + gint col, + gpointer value) { g_free (value); } static gpointer -gdvm_initialize_value (ETableModel *etc, gint col) +gdvm_initialize_value (ETableModel *etc, + gint col) { return g_strdup(""); } static gboolean -gdvm_value_is_empty (ETableModel *etc, gint col, gconstpointer value) +gdvm_value_is_empty (ETableModel *etc, + gint col, + gconstpointer value) { return !(value && *(gchar *) value); } static gchar * -gdvm_value_to_string (ETableModel *etc, gint col, gconstpointer value) +gdvm_value_to_string (ETableModel *etc, + gint col, + gconstpointer value) { return g_strdup (value); } @@ -205,7 +223,7 @@ gdvm_value_to_string (ETableModel *etc, gint col, gconstpointer value) */ void gal_define_views_model_append (GalDefineViewsModel *model, - GalView *view) + GalView *view) { ETableModel *etm = E_TABLE_MODEL (model); @@ -287,7 +305,7 @@ gal_define_views_model_new (void) */ GalView * gal_define_views_model_get_view (GalDefineViewsModel *model, - gint n) + gint n) { return gal_view_collection_get_view (model->collection, n); } @@ -301,7 +319,7 @@ gal_define_views_model_get_view (GalDefineViewsModel *model, */ void gal_define_views_model_delete_view (GalDefineViewsModel *model, - gint n) + gint n) { e_table_model_pre_change (E_TABLE_MODEL (model)); gal_view_collection_delete_view (model->collection, n); @@ -317,7 +335,7 @@ gal_define_views_model_delete_view (GalDefineViewsModel *model, */ void gal_define_views_model_copy_view (GalDefineViewsModel *model, - gint n) + gint n) { ETableModel *etm = E_TABLE_MODEL (model); e_table_model_pre_change (etm); diff --git a/widgets/menus/gal-view-collection.c b/widgets/menus/gal-view-collection.c index 39ce216ce1..1d565d7c21 100644 --- a/widgets/menus/gal-view-collection.c +++ b/widgets/menus/gal-view-collection.c @@ -58,11 +58,9 @@ static guint gal_view_collection_signals[LAST_SIGNAL] = { 0, }; */ void gal_view_collection_display_view (GalViewCollection *collection, - GalView *view) + GalView *view) { - g_return_if_fail (collection != NULL); g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection)); - g_return_if_fail (view != NULL); g_return_if_fail (GAL_IS_VIEW (view)); g_signal_emit (collection, @@ -73,7 +71,6 @@ gal_view_collection_display_view (GalViewCollection *collection, static void gal_view_collection_changed (GalViewCollection *collection) { - g_return_if_fail (collection != NULL); g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection)); g_signal_emit (collection, @@ -95,8 +92,8 @@ gal_view_collection_item_free (GalViewCollectionItem *item) static gchar * gal_view_generate_string (GalViewCollection *collection, - GalView *view, - gint which) + GalView *view, + gint which) { gchar *ret_val; gchar *pointer; @@ -117,7 +114,7 @@ gal_view_generate_string (GalViewCollection *collection, static gint gal_view_check_string (GalViewCollection *collection, - gchar *string) + gchar *string) { gint i; @@ -137,7 +134,7 @@ gal_view_check_string (GalViewCollection *collection, static gchar * gal_view_generate_id (GalViewCollection *collection, - GalView *view) + GalView *view) { gint i; for (i = 1; TRUE; i++) { @@ -247,14 +244,14 @@ gal_view_collection_init (GalViewCollection *collection) * A collection of views and view factories. */ GalViewCollection * -gal_view_collection_new (void) +gal_view_collection_new (void) { return g_object_new (GAL_VIEW_COLLECTION_TYPE, NULL); } void gal_view_collection_set_title (GalViewCollection *collection, - const gchar *title) + const gchar *title) { g_free (collection->title); collection->title = g_strdup (title); @@ -269,11 +266,10 @@ gal_view_collection_set_title (GalViewCollection *collection, * Sets up the GalViewCollection. */ void -gal_view_collection_set_storage_directories (GalViewCollection *collection, - const gchar *system_dir, - const gchar *local_dir) +gal_view_collection_set_storage_directories (GalViewCollection *collection, + const gchar *system_dir, + const gchar *local_dir) { - g_return_if_fail (collection != NULL); g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection)); g_return_if_fail (system_dir != NULL); g_return_if_fail (local_dir != NULL); @@ -297,12 +293,10 @@ gal_view_collection_set_storage_directories (GalViewCollection *collection, * user tries to create a new view. */ void -gal_view_collection_add_factory (GalViewCollection *collection, - GalViewFactory *factory) +gal_view_collection_add_factory (GalViewCollection *collection, + GalViewFactory *factory) { - g_return_if_fail (collection != NULL); g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection)); - g_return_if_fail (factory != NULL); g_return_if_fail (GAL_IS_VIEW_FACTORY (factory)); g_object_ref (factory); @@ -311,7 +305,7 @@ gal_view_collection_add_factory (GalViewCollection *collection, static void view_changed (GalView *view, - GalViewCollectionItem *item) + GalViewCollectionItem *item) { item->changed = TRUE; item->ever_changed = TRUE; @@ -323,7 +317,11 @@ view_changed (GalView *view, /* Use factory list to load a GalView file. */ static GalView * -gal_view_collection_real_load_view_from_file (GalViewCollection *collection, const gchar *type, const gchar *title, const gchar *dir, const gchar *filename) +gal_view_collection_real_load_view_from_file (GalViewCollection *collection, + const gchar *type, + const gchar *title, + const gchar *dir, + const gchar *filename) { GalViewFactory *factory; GList *factories; @@ -347,16 +345,18 @@ gal_view_collection_real_load_view_from_file (GalViewCollection *collection, con } GalView * -gal_view_collection_load_view_from_file (GalViewCollection *collection, const gchar *type, const gchar *filename) +gal_view_collection_load_view_from_file (GalViewCollection *collection, + const gchar *type, + const gchar *filename) { return gal_view_collection_real_load_view_from_file (collection, type, "", collection->local_dir, filename); } static GalViewCollectionItem * load_single_file (GalViewCollection *collection, - gchar *dir, - gboolean local, - xmlNode *node) + gchar *dir, + gboolean local, + xmlNode *node) { GalViewCollectionItem *item; item = g_new (GalViewCollectionItem, 1); @@ -377,7 +377,7 @@ load_single_file (GalViewCollection *collection, g_free (fullpath); if (item->view) { item->view_changed_id = - g_signal_connect(item->view, "changed", + g_signal_connect (item->view, "changed", G_CALLBACK (view_changed), item); } } @@ -386,8 +386,8 @@ load_single_file (GalViewCollection *collection, static void load_single_dir (GalViewCollection *collection, - gchar *dir, - gboolean local) + gchar *dir, + gboolean local) { xmlDoc *doc = NULL; xmlNode *root; @@ -477,9 +477,8 @@ load_single_dir (GalViewCollection *collection, * other parts of gal_view. */ void -gal_view_collection_load (GalViewCollection *collection) +gal_view_collection_load (GalViewCollection *collection) { - g_return_if_fail (collection != NULL); g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection)); g_return_if_fail (collection->local_dir != NULL); g_return_if_fail (collection->system_dir != NULL); @@ -504,14 +503,13 @@ gal_view_collection_load (GalViewCollection *collection) * gal_view. */ void -gal_view_collection_save (GalViewCollection *collection) +gal_view_collection_save (GalViewCollection *collection) { gint i; xmlDoc *doc; xmlNode *root; gchar *filename; - g_return_if_fail (collection != NULL); g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection)); g_return_if_fail (collection->local_dir != NULL); @@ -571,7 +569,6 @@ gal_view_collection_save (GalViewCollection *collection) gint gal_view_collection_get_count (GalViewCollection *collection) { - g_return_val_if_fail (collection != NULL, -1); g_return_val_if_fail (GAL_IS_VIEW_COLLECTION (collection), -1); return collection->view_count; @@ -586,9 +583,8 @@ gal_view_collection_get_count (GalViewCollection *collection) */ GalView * gal_view_collection_get_view (GalViewCollection *collection, - gint n) + 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); @@ -605,9 +601,8 @@ gal_view_collection_get_view (GalViewCollection *collection, */ GalViewCollectionItem * gal_view_collection_get_view_item (GalViewCollection *collection, - gint n) + 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); @@ -616,7 +611,8 @@ gal_view_collection_get_view_item (GalViewCollection *collection, } gint -gal_view_collection_get_view_index_by_id (GalViewCollection *collection, const gchar *view_id) +gal_view_collection_get_view_index_by_id (GalViewCollection *collection, + const gchar *view_id) { gint i; for (i = 0; i < collection->view_count; i++) { @@ -627,9 +623,9 @@ gal_view_collection_get_view_index_by_id (GalViewCollection *collection, con } gchar * -gal_view_collection_get_view_id_by_index (GalViewCollection *collection, gint n) +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); @@ -638,14 +634,12 @@ gal_view_collection_get_view_id_by_index (GalViewCollection *collection, gint n) } void -gal_view_collection_append (GalViewCollection *collection, - GalView *view) +gal_view_collection_append (GalViewCollection *collection, + GalView *view) { GalViewCollectionItem *item; - g_return_if_fail (collection != NULL); g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection)); - g_return_if_fail (view != NULL); g_return_if_fail (GAL_IS_VIEW (view)); item = g_new (GalViewCollectionItem, 1); @@ -661,7 +655,7 @@ gal_view_collection_append (GalViewCollection *collection, g_object_ref (view); item->view_changed_id = - g_signal_connect(item->view, "changed", + g_signal_connect (item->view, "changed", G_CALLBACK (view_changed), item); collection->view_data = g_renew (GalViewCollectionItem *, collection->view_data, collection->view_count + 1); @@ -672,12 +666,11 @@ gal_view_collection_append (GalViewCollection *collection, } void -gal_view_collection_delete_view (GalViewCollection *collection, - gint i) +gal_view_collection_delete_view (GalViewCollection *collection, + gint i) { GalViewCollectionItem *item; - g_return_if_fail (collection != NULL); g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection)); g_return_if_fail (i >= 0 && i < collection->view_count); @@ -699,13 +692,12 @@ gal_view_collection_delete_view (GalViewCollection *collection, } void -gal_view_collection_copy_view (GalViewCollection *collection, - gint i) +gal_view_collection_copy_view (GalViewCollection *collection, + gint i) { GalViewCollectionItem *item; GalView *view; - g_return_if_fail (collection != NULL); g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection)); g_return_if_fail (i >= 0 && i < collection->view_count); @@ -723,7 +715,7 @@ gal_view_collection_copy_view (GalViewCollection *collection, item->collection = collection; item->view_changed_id = - g_signal_connect(item->view, "changed", + g_signal_connect (item->view, "changed", G_CALLBACK (view_changed), item); collection->view_data = g_renew (GalViewCollectionItem *, collection->view_data, collection->view_count + 1); @@ -740,13 +732,13 @@ gal_view_collection_loaded (GalViewCollection *collection) } const gchar * -gal_view_collection_append_with_title (GalViewCollection *collection, const gchar *title, GalView *view) +gal_view_collection_append_with_title (GalViewCollection *collection, + const gchar *title, + GalView *view) { GalViewCollectionItem *item; - g_return_val_if_fail (collection != NULL, NULL); g_return_val_if_fail (GAL_IS_VIEW_COLLECTION (collection), NULL); - g_return_val_if_fail (view != NULL, NULL); g_return_val_if_fail (GAL_IS_VIEW (view), NULL); gal_view_set_title (view, title); @@ -766,7 +758,7 @@ gal_view_collection_append_with_title (GalViewCollection *collection, const gcha g_object_ref (view); item->view_changed_id = - g_signal_connect(item->view, "changed", + g_signal_connect (item->view, "changed", G_CALLBACK (view_changed), item); collection->view_data = g_renew (GalViewCollectionItem *, collection->view_data, collection->view_count + 1); @@ -778,13 +770,13 @@ gal_view_collection_append_with_title (GalViewCollection *collection, const gcha } const gchar * -gal_view_collection_set_nth_view (GalViewCollection *collection, gint i, GalView *view) +gal_view_collection_set_nth_view (GalViewCollection *collection, + gint i, + GalView *view) { GalViewCollectionItem *item; - g_return_val_if_fail (collection != NULL, NULL); g_return_val_if_fail (GAL_IS_VIEW_COLLECTION (collection), NULL); - g_return_val_if_fail (view != NULL, NULL); g_return_val_if_fail (GAL_IS_VIEW (view), NULL); g_return_val_if_fail (i >= 0, NULL); g_return_val_if_fail (i < collection->view_count, NULL); @@ -807,7 +799,7 @@ gal_view_collection_set_nth_view (GalViewCollection *collection, gint i, GalView item->type = g_strdup (gal_view_get_type_code (view)); item->view_changed_id = - g_signal_connect(item->view, "changed", + g_signal_connect (item->view, "changed", G_CALLBACK (view_changed), item); gal_view_collection_changed (collection); @@ -821,7 +813,8 @@ gal_view_collection_get_default_view (GalViewCollection *collection) } void -gal_view_collection_set_default_view (GalViewCollection *collection, const gchar *id) +gal_view_collection_set_default_view (GalViewCollection *collection, + const gchar *id) { g_free (collection->default_view); collection->default_view = g_strdup (id); diff --git a/widgets/menus/gal-view-collection.h b/widgets/menus/gal-view-collection.h index a8dc3124e0..143bee53d1 100644 --- a/widgets/menus/gal-view-collection.h +++ b/widgets/menus/gal-view-collection.h @@ -129,7 +129,7 @@ GalView *gal_view_collection_load_view_from_file (GalViewColl const gchar *filename); /* Returns id of the new view. These functions are used for - GalViewInstanceSaveAsDialog. */ + * GalViewInstanceSaveAsDialog. */ const gchar *gal_view_collection_append_with_title (GalViewCollection *collection, const gchar *title, GalView *view); diff --git a/widgets/menus/gal-view-etable.c b/widgets/menus/gal-view-etable.c index 4a3a3fb35c..c1fa5daf8b 100644 --- a/widgets/menus/gal-view-etable.c +++ b/widgets/menus/gal-view-etable.c @@ -59,7 +59,8 @@ detach_tree (GalViewEtable *view) } static void -config_changed (ETableConfig *config, GalViewEtable *view) +config_changed (ETableConfig *config, + GalViewEtable *view) { ETableState *state; if (view->state) @@ -74,7 +75,8 @@ config_changed (ETableConfig *config, GalViewEtable *view) } static void -gal_view_etable_edit (GalView *view, GtkWindow *parent) +gal_view_etable_edit (GalView *view, + GtkWindow *parent) { GalViewEtable *etable_view = GAL_VIEW_ETABLE (view); ETableConfig *config; @@ -84,33 +86,33 @@ gal_view_etable_edit (GalView *view, GtkWindow *parent) etable_view->state, parent); - g_signal_connect(config, "changed", + g_signal_connect (config, "changed", G_CALLBACK (config_changed), view); } static void -gal_view_etable_load (GalView *view, - const gchar *filename) +gal_view_etable_load (GalView *view, + const gchar *filename) { e_table_state_load_from_file (GAL_VIEW_ETABLE (view)->state, filename); } static void -gal_view_etable_save (GalView *view, - const gchar *filename) +gal_view_etable_save (GalView *view, + const gchar *filename) { e_table_state_save_to_file (GAL_VIEW_ETABLE (view)->state, filename); } static const gchar * -gal_view_etable_get_title (GalView *view) +gal_view_etable_get_title (GalView *view) { return GAL_VIEW_ETABLE (view)->title; } static void gal_view_etable_set_title (GalView *view, - const gchar *title) + const gchar *title) { g_free (GAL_VIEW_ETABLE (view)->title); GAL_VIEW_ETABLE (view)->title = g_strdup (title); @@ -123,7 +125,7 @@ gal_view_etable_get_type_code (GalView *view) } static GalView * -gal_view_etable_clone (GalView *view) +gal_view_etable_clone (GalView *view) { GalViewEtable *gve, *new; @@ -140,7 +142,7 @@ gal_view_etable_clone (GalView *view) } static void -gal_view_etable_dispose (GObject *object) +gal_view_etable_dispose (GObject *object) { GalViewEtable *view = GAL_VIEW_ETABLE (object); @@ -162,7 +164,7 @@ gal_view_etable_dispose (GObject *object) } static void -gal_view_etable_class_init (GalViewEtableClass *klass) +gal_view_etable_class_init (GalViewEtableClass *klass) { GalViewClass *gal_view_class = GAL_VIEW_CLASS (klass); GObjectClass *object_class = G_OBJECT_CLASS (klass); @@ -179,7 +181,7 @@ gal_view_etable_class_init (GalViewEtableClass *klass) } static void -gal_view_etable_init (GalViewEtable *gve) +gal_view_etable_init (GalViewEtable *gve) { gve->spec = NULL; gve->state = e_table_state_new (); @@ -198,7 +200,7 @@ gal_view_etable_init (GalViewEtable *gve) */ GalView * gal_view_etable_new (ETableSpecification *spec, - const gchar *title) + const gchar *title) { GalViewEtable *view; @@ -221,9 +223,9 @@ gal_view_etable_new (ETableSpecification *spec, * Returns: The GalViewEtable. */ GalView * -gal_view_etable_construct (GalViewEtable *view, - ETableSpecification *spec, - const gchar *title) +gal_view_etable_construct (GalViewEtable *view, + ETableSpecification *spec, + const gchar *title) { g_return_val_if_fail (GAL_IS_VIEW_ETABLE (view), NULL); g_return_val_if_fail (E_IS_TABLE_SPECIFICATION (spec), NULL); @@ -242,7 +244,8 @@ gal_view_etable_construct (GalViewEtable *view, } void -gal_view_etable_set_state (GalViewEtable *view, ETableState *state) +gal_view_etable_set_state (GalViewEtable *view, + ETableState *state) { g_return_if_fail (GAL_IS_VIEW_ETABLE (view)); g_return_if_fail (E_IS_TABLE_STATE (state)); @@ -255,7 +258,8 @@ gal_view_etable_set_state (GalViewEtable *view, ETableState *state) } static void -table_state_changed (ETable *table, GalViewEtable *view) +table_state_changed (ETable *table, + GalViewEtable *view) { ETableState *state; @@ -267,7 +271,8 @@ table_state_changed (ETable *table, GalViewEtable *view) } static void -tree_state_changed (ETree *tree, GalViewEtable *view) +tree_state_changed (ETree *tree, + GalViewEtable *view) { ETableState *state; @@ -279,7 +284,8 @@ tree_state_changed (ETree *tree, GalViewEtable *view) } void -gal_view_etable_attach_table (GalViewEtable *view, ETable *table) +gal_view_etable_attach_table (GalViewEtable *view, + ETable *table) { g_return_if_fail (GAL_IS_VIEW_ETABLE (view)); g_return_if_fail (E_IS_TABLE (table)); @@ -291,12 +297,13 @@ gal_view_etable_attach_table (GalViewEtable *view, ETable *table) 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", + g_signal_connect (view->table, "state_change", G_CALLBACK (table_state_changed), view); } void -gal_view_etable_attach_tree (GalViewEtable *view, ETree *tree) +gal_view_etable_attach_tree (GalViewEtable *view, + ETree *tree) { g_return_if_fail (GAL_IS_VIEW_ETABLE (view)); g_return_if_fail (E_IS_TREE (tree)); @@ -308,7 +315,7 @@ gal_view_etable_attach_tree (GalViewEtable *view, ETree *tree) 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", + g_signal_connect (view->tree, "state_change", G_CALLBACK (tree_state_changed), view); } diff --git a/widgets/menus/gal-view-instance-save-as-dialog.c b/widgets/menus/gal-view-instance-save-as-dialog.c index 49a0838833..a098e094b8 100644 --- a/widgets/menus/gal-view-instance-save-as-dialog.c +++ b/widgets/menus/gal-view-instance-save-as-dialog.c @@ -48,7 +48,7 @@ enum { /* Static functions */ static void gal_view_instance_save_as_dialog_set_instance (GalViewInstanceSaveAsDialog *dialog, - GalViewInstance *instance) + GalViewInstance *instance) { gint i; GtkListStore *store; @@ -57,7 +57,7 @@ gal_view_instance_save_as_dialog_set_instance (GalViewInstanceSaveAsDialog *dial store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER); - for (i=0; i<instance->collection->view_count; i++) { + for (i = 0; i < instance->collection->view_count; i++) { GalViewCollectionItem *item = instance->collection->view_data[i]; GtkTreeIter iter; gchar *title = NULL; @@ -145,26 +145,31 @@ gvisad_setup_radio_buttons (GalViewInstanceSaveAsDialog *dialog) } static void -gvisad_radio_toggled (GtkWidget *widget, GalViewInstanceSaveAsDialog *dialog) +gvisad_radio_toggled (GtkWidget *widget, + GalViewInstanceSaveAsDialog *dialog) { gvisad_setup_radio_buttons (dialog); } static void -gvisad_entry_changed (GtkWidget *widget, GalViewInstanceSaveAsDialog *dialog) +gvisad_entry_changed (GtkWidget *widget, + GalViewInstanceSaveAsDialog *dialog) { gvisad_setup_validate_button (dialog); } /* Method override implementations */ static void -gal_view_instance_save_as_dialog_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +gal_view_instance_save_as_dialog_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { GalViewInstanceSaveAsDialog *dialog; dialog = GAL_VIEW_INSTANCE_SAVE_AS_DIALOG (object); - switch (prop_id) { + switch (property_id) { case PROP_INSTANCE: if (g_value_get_object (value)) gal_view_instance_save_as_dialog_set_instance (dialog, GAL_VIEW_INSTANCE (g_value_get_object (value))); @@ -178,19 +183,22 @@ gal_view_instance_save_as_dialog_set_property (GObject *object, guint prop_id, c } static void -gal_view_instance_save_as_dialog_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +gal_view_instance_save_as_dialog_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { GalViewInstanceSaveAsDialog *dialog; dialog = GAL_VIEW_INSTANCE_SAVE_AS_DIALOG (object); - switch (prop_id) { + switch (property_id) { case PROP_INSTANCE: g_value_set_object (value, dialog->instance); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -214,7 +222,7 @@ gal_view_instance_save_as_dialog_class_init (GalViewInstanceSaveAsDialogClass *k { GObjectClass *object_class; - object_class = (GObjectClass*) klass; + object_class = (GObjectClass *) klass; object_class->set_property = gal_view_instance_save_as_dialog_set_property; object_class->get_property = gal_view_instance_save_as_dialog_get_property; @@ -312,7 +320,7 @@ gal_view_instance_save_as_dialog_save (GalViewInstanceSaveAsDialog *dialog) if (gtk_tree_selection_get_selected (selection, &dialog->model, &iter)) { gtk_tree_model_get (dialog->model, &iter, COL_GALVIEW_DATA, &item, -1); - for (n=0; n<dialog->instance->collection->view_count; n++) { + for (n = 0; n < dialog->instance->collection->view_count; n++) { if (item == dialog->instance->collection->view_data[n]) { id = gal_view_collection_set_nth_view (dialog->instance->collection, n, view); gal_view_collection_save (dialog->instance->collection); diff --git a/widgets/menus/gal-view-instance.c b/widgets/menus/gal-view-instance.c index 22557082e4..f127868ab3 100644 --- a/widgets/menus/gal-view-instance.c +++ b/widgets/menus/gal-view-instance.c @@ -70,7 +70,8 @@ gal_view_instance_changed (GalViewInstance *instance) } static void -gal_view_instance_display_view (GalViewInstance *instance, GalView *view) +gal_view_instance_display_view (GalViewInstance *instance, + GalView *view) { g_return_if_fail (instance != NULL); g_return_if_fail (GAL_IS_VIEW_INSTANCE (instance)); @@ -101,7 +102,8 @@ save_current_view (GalViewInstance *instance) } static void -view_changed (GalView *view, GalViewInstance *instance) +view_changed (GalView *view, + GalViewInstance *instance) { if (instance->current_id != NULL) { g_free (instance->current_id); @@ -133,7 +135,8 @@ disconnect_view (GalViewInstance *instance) } static void -connect_view (GalViewInstance *instance, GalView *view) +connect_view (GalViewInstance *instance, + GalView *view) { if (instance->current_view) disconnect_view (instance); @@ -142,7 +145,7 @@ connect_view (GalViewInstance *instance, GalView *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_signal_connect (instance->current_view, "changed", G_CALLBACK (view_changed), instance); gal_view_instance_display_view (instance, instance->current_view); @@ -234,7 +237,8 @@ gal_view_instance_init (GalViewInstance *instance) } static void -collection_changed (GalView *view, GalViewInstance *instance) +collection_changed (GalView *view, + GalViewInstance *instance) { if (instance->current_id) { gchar *view_id = instance->current_id; @@ -316,7 +320,8 @@ load_current_view (GalViewInstance *instance) * Return value: The new %GalViewInstance. **/ GalViewInstance * -gal_view_instance_new (GalViewCollection *collection, const gchar *instance_id) +gal_view_instance_new (GalViewCollection *collection, + const gchar *instance_id) { GalViewInstance *instance = g_object_new (GAL_VIEW_INSTANCE_TYPE, NULL); if (gal_view_instance_construct (instance, collection, instance_id)) @@ -328,7 +333,9 @@ gal_view_instance_new (GalViewCollection *collection, const gchar *instance_id) } GalViewInstance * -gal_view_instance_construct (GalViewInstance *instance, GalViewCollection *collection, const gchar *instance_id) +gal_view_instance_construct (GalViewInstance *instance, + GalViewCollection *collection, + const gchar *instance_id) { gchar *filename; gchar *safe_id; @@ -374,7 +381,8 @@ gal_view_instance_get_current_view_id (GalViewInstance *instance) } void -gal_view_instance_set_current_view_id (GalViewInstance *instance, const gchar *view_id) +gal_view_instance_set_current_view_id (GalViewInstance *instance, + const gchar *view_id) { GalView *view; gint index; @@ -408,7 +416,8 @@ gal_view_instance_get_current_view (GalViewInstance *instance) } void -gal_view_instance_set_custom_view (GalViewInstance *instance, GalView *view) +gal_view_instance_set_custom_view (GalViewInstance *instance, + GalView *view) { g_free (instance->current_id); instance->current_id = NULL; @@ -421,7 +430,9 @@ gal_view_instance_set_custom_view (GalViewInstance *instance, GalView *view) } 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)); @@ -437,7 +448,7 @@ gal_view_instance_save_as (GalViewInstance *instance) g_return_if_fail (instance != NULL); dialog = gal_view_instance_save_as_dialog_new (instance); - g_signal_connect(dialog, "response", + g_signal_connect (dialog, "response", G_CALLBACK (dialog_response), instance); gtk_widget_show (dialog); } @@ -464,7 +475,8 @@ gal_view_instance_get_default_view (GalViewInstance *instance) } void -gal_view_instance_set_default_view (GalViewInstance *instance, const gchar *id) +gal_view_instance_set_default_view (GalViewInstance *instance, + const gchar *id) { g_free (instance->default_view); instance->default_view = g_strdup (id); diff --git a/widgets/menus/gal-view-new-dialog.c b/widgets/menus/gal-view-new-dialog.c index 4428cf6012..c26619f2bd 100644 --- a/widgets/menus/gal-view-new-dialog.c +++ b/widgets/menus/gal-view-new-dialog.c @@ -33,8 +33,8 @@ #include "gal-define-views-model.h" #include "gal-view-new-dialog.h" -static void gal_view_new_dialog_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); -static void gal_view_new_dialog_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); +static void gal_view_new_dialog_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static void gal_view_new_dialog_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); static void gal_view_new_dialog_dispose (GObject *object); /* The arguments we take */ @@ -51,7 +51,7 @@ gal_view_new_dialog_class_init (GalViewNewDialogClass *klass) { GObjectClass *object_class; - object_class = (GObjectClass*) klass; + object_class = (GObjectClass *) klass; object_class->set_property = gal_view_new_dialog_set_property; object_class->get_property = gal_view_new_dialog_get_property; @@ -124,7 +124,7 @@ gal_view_new_dialog_dispose (GObject *object) G_OBJECT_CLASS (gal_view_new_dialog_parent_class)->dispose (object); } -GtkWidget* +GtkWidget * gal_view_new_dialog_new (GalViewCollection *collection) { GtkWidget *widget = @@ -150,11 +150,11 @@ sensitize_ok_response (GalViewNewDialog *dialog) } static gboolean -selection_func (GtkTreeSelection *selection, - GtkTreeModel *model, - GtkTreePath *path, - gboolean path_currently_selected, - gpointer data) +selection_func (GtkTreeSelection *selection, + GtkTreeModel *model, + GtkTreePath *path, + gboolean path_currently_selected, + gpointer data) { GtkTreeIter iter; GalViewNewDialog *dialog = data; @@ -164,7 +164,7 @@ selection_func (GtkTreeSelection *selection, gtk_tree_model_get_iter (GTK_TREE_MODEL (dialog->list_store), &iter, - (GtkTreePath*) path); + (GtkTreePath *) path); gtk_tree_model_get (GTK_TREE_MODEL (dialog->list_store), &iter, @@ -179,16 +179,17 @@ selection_func (GtkTreeSelection *selection, } static void -entry_changed (GtkWidget *entry, gpointer data) +entry_changed (GtkWidget *entry, + gpointer data) { GalViewNewDialog *dialog = data; sensitize_ok_response (dialog); } -GtkWidget* -gal_view_new_dialog_construct (GalViewNewDialog *dialog, - GalViewCollection *collection) +GtkWidget * +gal_view_new_dialog_construct (GalViewNewDialog *dialog, + GalViewCollection *collection) { GList *iterator; GtkTreeSelection *selection; @@ -239,14 +240,17 @@ gal_view_new_dialog_construct (GalViewNewDialog *dialog, } static void -gal_view_new_dialog_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +gal_view_new_dialog_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { GalViewNewDialog *dialog; GtkWidget *entry; dialog = GAL_VIEW_NEW_DIALOG (object); - switch (prop_id) { + switch (property_id) { case PROP_NAME: entry = e_builder_get_widget(dialog->builder, "entry-name"); if (entry && GTK_IS_ENTRY (entry)) { @@ -254,20 +258,23 @@ gal_view_new_dialog_set_property (GObject *object, guint prop_id, const GValue * } break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); return; } } static void -gal_view_new_dialog_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +gal_view_new_dialog_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { GalViewNewDialog *dialog; GtkWidget *entry; dialog = GAL_VIEW_NEW_DIALOG (object); - switch (prop_id) { + switch (property_id) { case PROP_NAME: entry = e_builder_get_widget(dialog->builder, "entry-name"); if (entry && GTK_IS_ENTRY (entry)) { @@ -278,7 +285,7 @@ gal_view_new_dialog_get_property (GObject *object, guint prop_id, GValue *value, g_value_set_object (value, dialog->selected_factory); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } diff --git a/widgets/misc/e-action-combo-box.c b/widgets/misc/e-action-combo-box.c index d34409b5fd..cd99c346fb 100644 --- a/widgets/misc/e-action-combo-box.c +++ b/widgets/misc/e-action-combo-box.c @@ -253,7 +253,7 @@ action_combo_box_update_model (EActionComboBox *combo_box) g_free (stock_id); gtk_list_store_append (list_store, &iter); - g_object_get (G_OBJECT (action), "value", &value, NULL); + g_object_get (action, "value", &value, NULL); gtk_list_store_set ( list_store, &iter, COLUMN_ACTION, list->data, COLUMN_SORT, (gfloat) value, -1); @@ -395,7 +395,7 @@ action_combo_box_changed (GtkComboBox *combo_box) model = gtk_combo_box_get_model (combo_box); gtk_tree_model_get (model, &iter, COLUMN_ACTION, &action, -1); - g_object_get (G_OBJECT (action), "value", &value, NULL); + g_object_get (action, "value", &value, NULL); gtk_radio_action_set_current_value (action, value); } diff --git a/widgets/misc/e-attachment.c b/widgets/misc/e-attachment.c index 5073d582fc..ccd135e5a0 100644 --- a/widgets/misc/e-attachment.c +++ b/widgets/misc/e-attachment.c @@ -101,7 +101,8 @@ G_DEFINE_TYPE ( G_TYPE_OBJECT) static gboolean -create_system_thumbnail (EAttachment *attachment, GIcon **icon) +create_system_thumbnail (EAttachment *attachment, + GIcon **icon) { GFile *file; GFile *icon_file; diff --git a/widgets/misc/e-buffer-tagger.c b/widgets/misc/e-buffer-tagger.c index cf2944fde8..bc05525737 100644 --- a/widgets/misc/e-buffer-tagger.c +++ b/widgets/misc/e-buffer-tagger.c @@ -134,13 +134,16 @@ get_state (GtkTextBuffer *buffer) } static void -set_state (GtkTextBuffer *buffer, guint32 state) +set_state (GtkTextBuffer *buffer, + guint32 state) { g_object_set_data (G_OBJECT (buffer), E_BUFFER_TAGGER_DATA_STATE, GINT_TO_POINTER (state)); } static void -update_state (GtkTextBuffer *buffer, guint32 value, gboolean do_set) +update_state (GtkTextBuffer *buffer, + guint32 value, + gboolean do_set) { guint32 state; @@ -158,7 +161,10 @@ update_state (GtkTextBuffer *buffer, guint32 value, gboolean do_set) } static gboolean -get_tag_bounds (GtkTextIter *iter, GtkTextTag *tag, GtkTextIter *start, GtkTextIter *end) +get_tag_bounds (GtkTextIter *iter, + GtkTextTag *tag, + GtkTextIter *start, + GtkTextIter *end) { gboolean res = FALSE; @@ -184,7 +190,8 @@ get_tag_bounds (GtkTextIter *iter, GtkTextTag *tag, GtkTextIter *start, GtkTextI } static gchar * -get_url_at_iter (GtkTextBuffer *buffer, GtkTextIter *iter) +get_url_at_iter (GtkTextBuffer *buffer, + GtkTextIter *iter) { GtkTextTagTable *tag_table; GtkTextTag *tag; @@ -204,7 +211,8 @@ get_url_at_iter (GtkTextBuffer *buffer, GtkTextIter *iter) } static gboolean -invoke_link_if_present (GtkTextBuffer *buffer, GtkTextIter *iter) +invoke_link_if_present (GtkTextBuffer *buffer, + GtkTextIter *iter) { gboolean res; gchar *url; @@ -223,7 +231,8 @@ invoke_link_if_present (GtkTextBuffer *buffer, GtkTextIter *iter) } static void -remove_tag_if_present (GtkTextBuffer *buffer, GtkTextIter *where) +remove_tag_if_present (GtkTextBuffer *buffer, + GtkTextIter *where) { GtkTextTagTable *tag_table; GtkTextTag *tag; @@ -241,14 +250,21 @@ remove_tag_if_present (GtkTextBuffer *buffer, GtkTextIter *where) } static void -buffer_insert_text (GtkTextBuffer *buffer, GtkTextIter *location, gchar *text, gint len, gpointer user_data) +buffer_insert_text (GtkTextBuffer *buffer, + GtkTextIter *location, + gchar *text, + gint len, + gpointer user_data) { update_state (buffer, E_BUFFER_TAGGER_STATE_INSDEL, TRUE); remove_tag_if_present (buffer, location); } static void -buffer_delete_range (GtkTextBuffer *buffer, GtkTextIter *start, GtkTextIter *end, gpointer user_data) +buffer_delete_range (GtkTextBuffer *buffer, + GtkTextIter *start, + GtkTextIter *end, + gpointer user_data) { update_state (buffer, E_BUFFER_TAGGER_STATE_INSDEL, TRUE); remove_tag_if_present (buffer, start); @@ -256,7 +272,8 @@ buffer_delete_range (GtkTextBuffer *buffer, GtkTextIter *start, GtkTextIter *end } static void -buffer_cursor_position (GtkTextBuffer *buffer, gpointer user_data) +buffer_cursor_position (GtkTextBuffer *buffer, + gpointer user_data) { guint32 state; @@ -275,7 +292,9 @@ buffer_cursor_position (GtkTextBuffer *buffer, gpointer user_data) } static void -update_mouse_cursor (GtkTextView *text_view, gint x, gint y) +update_mouse_cursor (GtkTextView *text_view, + gint x, + gint y) { static GdkCursor *hand_cursor = NULL; static GdkCursor *regular_cursor = NULL; @@ -330,7 +349,12 @@ update_mouse_cursor (GtkTextView *text_view, gint x, gint y) } static gboolean -textview_query_tooltip (GtkTextView *text_view, gint x, gint y, gboolean keyboard_mode, GtkTooltip *tooltip, gpointer user_data) +textview_query_tooltip (GtkTextView *text_view, + gint x, + gint y, + gboolean keyboard_mode, + GtkTooltip *tooltip, + gpointer user_data) { GtkTextBuffer *buffer; guint32 state; @@ -373,7 +397,8 @@ textview_query_tooltip (GtkTextView *text_view, gint x, gint y, gboolean keyboar /* Links can be activated by pressing Enter. */ static gboolean -textview_key_press_event (GtkWidget *text_view, GdkEventKey *event) +textview_key_press_event (GtkWidget *text_view, + GdkEventKey *event) { GtkTextIter iter; GtkTextBuffer *buffer; @@ -398,7 +423,8 @@ textview_key_press_event (GtkWidget *text_view, GdkEventKey *event) } static void -update_ctrl_state (GtkTextView *textview, gboolean ctrl_is_down) +update_ctrl_state (GtkTextView *textview, + gboolean ctrl_is_down) { GtkTextBuffer *buffer; gint x, y; @@ -417,7 +443,8 @@ update_ctrl_state (GtkTextView *textview, gboolean ctrl_is_down) /* Links can also be activated by clicking. */ static gboolean -textview_event_after (GtkTextView *textview, GdkEvent *ev) +textview_event_after (GtkTextView *textview, + GdkEvent *ev) { GtkTextIter start, end, iter; GtkTextBuffer *buffer; @@ -477,7 +504,8 @@ textview_event_after (GtkTextView *textview, GdkEvent *ev) } static gboolean -textview_motion_notify_event (GtkTextView *textview, GdkEventMotion *event) +textview_motion_notify_event (GtkTextView *textview, + GdkEventMotion *event) { gint x, y; @@ -493,7 +521,8 @@ textview_motion_notify_event (GtkTextView *textview, GdkEventMotion *event) } static gboolean -textview_visibility_notify_event (GtkTextView *textview, GdkEventVisibility *event) +textview_visibility_notify_event (GtkTextView *textview, + GdkEventVisibility *event) { gint wx, wy, bx, by; diff --git a/widgets/misc/e-calendar-item.c b/widgets/misc/e-calendar-item.c index 400fbe2c64..d3f42fd359 100644 --- a/widgets/misc/e-calendar-item.c +++ b/widgets/misc/e-calendar-item.c @@ -594,7 +594,7 @@ e_calendar_item_init (ECalendarItem *calitem) } static void -e_calendar_item_dispose (GObject *object) +e_calendar_item_dispose (GObject *object) { ECalendarItem *calitem; @@ -855,7 +855,7 @@ e_calendar_item_set_property (GObject *object, } static void -e_calendar_item_realize (GnomeCanvasItem *item) +e_calendar_item_realize (GnomeCanvasItem *item) { ECalendarItem *calitem; @@ -870,7 +870,7 @@ e_calendar_item_realize (GnomeCanvasItem *item) } static void -e_calendar_item_unmap (GnomeCanvasItem *item) +e_calendar_item_unmap (GnomeCanvasItem *item) { ECalendarItem *calitem; @@ -886,9 +886,9 @@ e_calendar_item_unmap (GnomeCanvasItem *item) } static void -e_calendar_item_update (GnomeCanvasItem *item, - const cairo_matrix_t *i2c, - gint flags) +e_calendar_item_update (GnomeCanvasItem *item, + const cairo_matrix_t *i2c, + gint flags) { GnomeCanvasItemClass *item_class; ECalendarItem *calitem; @@ -924,7 +924,7 @@ e_calendar_item_update (GnomeCanvasItem *item, */ /* Make sure the minimum row width & cell height and the widths of - all the digits and characters are up to date. */ + * all the digits and characters are up to date. */ e_calendar_item_recalc_sizes (calitem); /* Calculate how many rows & cols we can fit in. */ @@ -957,9 +957,9 @@ e_calendar_item_update (GnomeCanvasItem *item, calitem->cols = cols; /* Split up the empty space according to the configuration. - If the calendar is set to expand, we divide the space between the - cells and the spaces around the calendar, otherwise we place the - calendars in the center of the available area. */ + * If the calendar is set to expand, we divide the space between the + * cells and the spaces around the calendar, otherwise we place the + * calendars in the center of the available area. */ char_height = PANGO_PIXELS (pango_font_metrics_get_ascent (font_metrics)) + @@ -1020,12 +1020,12 @@ e_calendar_item_update (GnomeCanvasItem *item, * DRAWING ROUTINES - functions to paint the canvas item. */ static void -e_calendar_item_draw (GnomeCanvasItem *canvas_item, - cairo_t *cr, - gint x, - gint y, - gint width, - gint height) +e_calendar_item_draw (GnomeCanvasItem *canvas_item, + cairo_t *cr, + gint x, + gint y, + gint width, + gint height) { ECalendarItem *calitem; GtkStyle *style; @@ -1083,7 +1083,7 @@ e_calendar_item_draw (GnomeCanvasItem *canvas_item, for (row = 0; row < calitem->rows; row++) { /* Draw the background for the title bars and the shadow around - it, and the vertical lines between columns. */ + * it, and the vertical lines between columns. */ cairo_save (cr); gdk_cairo_set_source_color (cr, &bg); @@ -1126,7 +1126,9 @@ e_calendar_item_draw (GnomeCanvasItem *canvas_item, } static void -layout_set_day_text (ECalendarItem *calitem, PangoLayout *layout, gint day_index) +layout_set_day_text (ECalendarItem *calitem, + PangoLayout *layout, + gint day_index) { const gchar *abbr_name; @@ -1136,14 +1138,14 @@ layout_set_day_text (ECalendarItem *calitem, PangoLayout *layout, gint day_index } static void -e_calendar_item_draw_month (ECalendarItem *calitem, - cairo_t *cr, - gint x, - gint y, - gint width, - gint height, - gint row, - gint col) +e_calendar_item_draw_month (ECalendarItem *calitem, + cairo_t *cr, + gint x, + gint y, + gint width, + gint height, + gint row, + gint col) { GnomeCanvasItem *item; GtkWidget *widget; @@ -1189,7 +1191,7 @@ e_calendar_item_draw_month (ECalendarItem *calitem, /* Calculate the top-left position of the entire month display. */ month_x = item->x1 + xthickness + calitem->x_offset + ( (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) - ? (calitem->cols-1 - col) : col ) * calitem->month_width - x; + ? (calitem->cols - 1 - col) : col ) * calitem->month_width - x; month_w = item->x2 - item->x1 - xthickness * 2; month_w = MIN (month_w, calitem->month_width); month_y = item->y1 + ythickness + row * calitem->month_height - y; @@ -1206,7 +1208,7 @@ e_calendar_item_draw_month (ECalendarItem *calitem, month %= 12; /* Draw the month name & year, with clipping. Note that the top row - needs extra space around it for the buttons. */ + * needs extra space around it for the buttons. */ layout = gtk_widget_create_pango_layout (widget, NULL); @@ -1250,7 +1252,7 @@ e_calendar_item_draw_month (ECalendarItem *calitem, pango_layout_set_text (layout, buffer, -1); /* Ideally we place the text centered in the month, but we - won't go to the left of the minimum x position. */ + * won't go to the left of the minimum x position. */ pango_layout_get_pixel_size (layout, &text_width, NULL); text_x = (calitem->month_width - text_width) / 2; text_x = MAX (min_x, text_x); @@ -1315,7 +1317,7 @@ e_calendar_item_draw_month (ECalendarItem *calitem, day_index = calitem->week_start_day; pango_layout_set_font_description (layout, font_desc); if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) - text_x += (7-1) * calitem->cell_width; + text_x += (7 - 1) * calitem->cell_width; gdk_cairo_set_source_color (cr, &style->text[GTK_STATE_ACTIVE]); for (day = 0; day < 7; day++) { cairo_save (cr); @@ -1351,7 +1353,7 @@ e_calendar_item_draw_month (ECalendarItem *calitem, } static const gchar * -get_digit_fomat () +get_digit_fomat (void) { #ifdef HAVE_GNU_GET_LIBC_VERSION @@ -1379,17 +1381,17 @@ get_digit_fomat () } static void -e_calendar_item_draw_day_numbers (ECalendarItem *calitem, - cairo_t *cr, - gint width, - gint height, - gint row, - gint col, - gint year, - gint month, - gint start_weekday, - gint cells_x, - gint cells_y) +e_calendar_item_draw_day_numbers (ECalendarItem *calitem, + cairo_t *cr, + gint width, + gint height, + gint row, + gint col, + gint year, + gint month, + gint start_weekday, + gint cells_x, + gint cells_y) { GnomeCanvasItem *item; GtkWidget *widget; @@ -1437,7 +1439,7 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem, layout = pango_cairo_create_layout (cr); /* Calculate the number of days in the previous, current, and next - months. */ + * months. */ years[0] = years[1] = years[2] = year; months[0] = month - 1; months[1] = month; @@ -1456,7 +1458,7 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem, days_in_month[2] = DAYS_IN_MONTH (years[2], months[2]); /* Mon 0 is the previous month, which we may show the end of. Mon 1 is - the current month, and mon 2 is the next month. */ + * the current month, and mon 2 is the next month. */ mon = 0; month_offset = row * calitem->cols + col - 1; @@ -1464,8 +1466,8 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem, days_from_week_start = (start_weekday + 7 - calitem->week_start_day) % 7; /* For the top-left month we show the end of the previous month, and - if the new month starts on the first day of the week we show a - complete week from the previous month. */ + * if the new month starts on the first day of the week we show a + * complete week from the previous month. */ if (days_from_week_start == 0) { if (row == 0 && col == 0) { day_num -= 6; @@ -1490,7 +1492,7 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem, today_mday = today_tm.tm_mday; /* We usually skip the last days of the previous month (mon = 0), - except for the top-left month displayed. */ + * except for the top-left month displayed. */ draw_day = (mon == 1 || (row == 0 && col == 0)); for (drow = 0; drow < 6; drow++) { @@ -1531,7 +1533,7 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem, if (draw_day) { day_x = cells_x + ( (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) - ? 7-1 - dcol : dcol ) * calitem->cell_width; + ? 7 - 1 - dcol : dcol ) * calitem->cell_width; day_y = cells_y + drow * calitem->cell_height; @@ -1671,7 +1673,7 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem, month_offset++; mon++; /* We only draw the start of the next month - for the bottom-right month displayed. */ + * for the bottom-right month displayed. */ if (mon == 2 && (row != calitem->rows - 1 || col != calitem->cols - 1)) { /* Set a flag so we exit the loop. */ @@ -1700,10 +1702,10 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem, } gint -e_calendar_item_get_week_number (ECalendarItem *calitem, - gint day, - gint month, - gint year) +e_calendar_item_get_week_number (ECalendarItem *calitem, + gint day, + gint month, + gint year) { GDate date; guint weekday, yearday; @@ -1717,7 +1719,7 @@ e_calendar_item_get_week_number (ECalendarItem *calitem, if (weekday > 0) { /* we want always point to nearest Monday, as the first day of the week, - regardless of the calendar's week_start_day */ + * regardless of the calendar's week_start_day */ if (weekday >= 3) g_date_add_days (&date, 7 - weekday); else @@ -1728,7 +1730,7 @@ e_calendar_item_get_week_number (ECalendarItem *calitem, yearday = g_date_get_day_of_year (&date) - 1; /* If the week starts on or after 29th December, it is week 1 of the - next year, since there are 4 days in the next year. */ + * next year, since there are 4 days in the next year. */ if (g_date_get_month (&date) == 12 && g_date_get_day (&date) >= 29) return 1; @@ -1736,7 +1738,7 @@ e_calendar_item_get_week_number (ECalendarItem *calitem, week_num = yearday / 7; /* If the first week starts on or after Jan 5th, then we need to add - 1 since the previous week will really be the first week. */ + * 1 since the previous week will really be the first week. */ if (yearday % 7 >= 4) week_num++; @@ -1745,17 +1747,21 @@ e_calendar_item_get_week_number (ECalendarItem *calitem, } /* This is supposed to return the nearest item the the point and the distance. - Since we are the only item we just return ourself and 0 for the distance. - This is needed so that we get button/motion events. */ + * Since we are the only item we just return ourself and 0 for the distance. + * This is needed so that we get button/motion events. */ static GnomeCanvasItem * -e_calendar_item_point (GnomeCanvasItem *item, gdouble x, gdouble y, - gint cx, gint cy) +e_calendar_item_point (GnomeCanvasItem *item, + gdouble x, + gdouble y, + gint cx, + gint cy) { return item; } static void -e_calendar_item_stop_selecting (ECalendarItem *calitem, guint32 time) +e_calendar_item_stop_selecting (ECalendarItem *calitem, + guint32 time) { if (!calitem->selecting) return; @@ -1765,8 +1771,8 @@ e_calendar_item_stop_selecting (ECalendarItem *calitem, guint32 time) calitem->selecting = FALSE; /* If the user selects the grayed dates before the first month or - after the last month, we move backwards or forwards one month. - The set_month () call should take care of updating the selection. */ + * after the last month, we move backwards or forwards one month. + * The set_month () call should take care of updating the selection. */ if (calitem->selection_end_month_offset == -1) e_calendar_item_set_first_month (calitem, calitem->year, calitem->month - 1); @@ -1785,8 +1791,9 @@ e_calendar_item_stop_selecting (ECalendarItem *calitem, guint32 time) } static void -e_calendar_item_selection_add_days (ECalendarItem *calitem, gint n_days, - gboolean multi_selection) +e_calendar_item_selection_add_days (ECalendarItem *calitem, + gint n_days, + gboolean multi_selection) { GDate gdate_start, gdate_end; @@ -1846,7 +1853,8 @@ e_calendar_item_selection_add_days (ECalendarItem *calitem, gint n_days, } static gint -e_calendar_item_key_press_event (ECalendarItem *calitem, GdkEvent *event) +e_calendar_item_key_press_event (ECalendarItem *calitem, + GdkEvent *event) { guint keyval = event->key.keyval; gboolean multi_selection = FALSE; @@ -1884,7 +1892,8 @@ e_calendar_item_key_press_event (ECalendarItem *calitem, GdkEvent *event) } static gint -e_calendar_item_event (GnomeCanvasItem *item, GdkEvent *event) +e_calendar_item_event (GnomeCanvasItem *item, + GdkEvent *event) { ECalendarItem *calitem; @@ -1909,8 +1918,11 @@ e_calendar_item_event (GnomeCanvasItem *item, GdkEvent *event) } static void -e_calendar_item_bounds (GnomeCanvasItem *item, gdouble *x1, gdouble *y1, - gdouble *x2, gdouble *y2) +e_calendar_item_bounds (GnomeCanvasItem *item, + gdouble *x1, + gdouble *y1, + gdouble *x2, + gdouble *y2) { ECalendarItem *calitem; @@ -1924,9 +1936,9 @@ e_calendar_item_bounds (GnomeCanvasItem *item, gdouble *x1, gdouble *y1, } /* This checks if any fonts have changed, and if so it recalculates the - text sizes and the minimum month size. */ + * text sizes and the minimum month size. */ static void -e_calendar_item_recalc_sizes (ECalendarItem *calitem) +e_calendar_item_recalc_sizes (ECalendarItem *calitem) { GnomeCanvasItem *canvas_item; GtkStyle *style; @@ -2028,21 +2040,21 @@ e_calendar_item_recalc_sizes (ECalendarItem *calitem) } static void -e_calendar_item_get_day_style (ECalendarItem *calitem, - gint year, - gint month, - gint day, - gint day_style, - gboolean today, - gboolean prev_or_next_month, - gboolean selected, - gboolean has_focus, - gboolean drop_target, - GdkColor **bg_color, - GdkColor **fg_color, - GdkColor **box_color, - gboolean *bold, - gboolean *italic) +e_calendar_item_get_day_style (ECalendarItem *calitem, + gint year, + gint month, + gint day, + gint day_style, + gboolean today, + gboolean prev_or_next_month, + gboolean selected, + gboolean has_focus, + gboolean drop_target, + GdkColor **bg_color, + GdkColor **fg_color, + GdkColor **box_color, + gboolean *bold, + gboolean *italic) { GtkWidget *widget; GtkStyle *style; @@ -2075,8 +2087,8 @@ e_calendar_item_get_day_style (ECalendarItem *calitem, } static gboolean -e_calendar_item_button_press (ECalendarItem *calitem, - GdkEvent *event) +e_calendar_item_button_press (ECalendarItem *calitem, + GdkEvent *event) { gint month_offset, day, add_days = 0; gboolean all_week, round_up_end = FALSE, round_down_start = FALSE; @@ -2099,7 +2111,7 @@ e_calendar_item_button_press (ECalendarItem *calitem, if (event->button.button == 3 && day == -1 && e_calendar_item_get_display_popup (calitem)) { e_calendar_item_show_popup_menu (calitem, - (GdkEventButton*) event, + (GdkEventButton *) event, month_offset); return TRUE; } @@ -2187,16 +2199,16 @@ e_calendar_item_button_press (ECalendarItem *calitem, } static gboolean -e_calendar_item_button_release (ECalendarItem *calitem, - GdkEvent *event) +e_calendar_item_button_release (ECalendarItem *calitem, + GdkEvent *event) { e_calendar_item_stop_selecting (calitem, event->button.time); return FALSE; } static gboolean -e_calendar_item_motion (ECalendarItem *calitem, - GdkEvent *event) +e_calendar_item_motion (ECalendarItem *calitem, + GdkEvent *event) { gint start_month, start_day, end_month, end_day, month_offset, day; gint tmp_month, tmp_day, days_in_selection; @@ -2251,13 +2263,13 @@ e_calendar_item_motion (ECalendarItem *calitem, } /* If we are over a week number and we are dragging the end of the - selection, we round up to the end of this week. */ + * selection, we round up to the end of this week. */ if (all_week && calitem->selection_dragging_end) round_up_end = TRUE; /* If the selection was started from a week number and we are dragging - the start of the selection, we need to round up the end to include - all of the original week selected. */ + * the start of the selection, we need to round up the end to include + * all of the original week selected. */ if (calitem->selection_from_full_week && !calitem->selection_dragging_end) round_up_end = TRUE; @@ -2307,11 +2319,11 @@ e_calendar_item_motion (ECalendarItem *calitem, } static void -e_calendar_item_check_selection_end (ECalendarItem *calitem, - gint start_month, - gint start_day, - gint *end_month, - gint *end_day) +e_calendar_item_check_selection_end (ECalendarItem *calitem, + gint start_month, + gint start_day, + gint *end_month, + gint *end_day) { gint year, month, max_month, max_day, days_in_month; @@ -2347,11 +2359,11 @@ e_calendar_item_check_selection_end (ECalendarItem *calitem, } static void -e_calendar_item_check_selection_start (ECalendarItem *calitem, - gint *start_month, - gint *start_day, - gint end_month, - gint end_day) +e_calendar_item_check_selection_start (ECalendarItem *calitem, + gint *start_month, + gint *start_day, + gint end_month, + gint end_day) { gint year, month, min_month, min_day, days_in_month; @@ -2385,19 +2397,19 @@ e_calendar_item_check_selection_start (ECalendarItem *calitem, } /* Converts a position within the item to a month & day. - The month returned is 0 for the top-left month displayed. - If the position is over the month heading -1 is returned for the day. - If the position is over a week number the first day of the week is returned - and entire_week is set to TRUE. - It returns FALSE if the position is completely outside all months. */ + * The month returned is 0 for the top-left month displayed. + * If the position is over the month heading -1 is returned for the day. + * If the position is over a week number the first day of the week is returned + * and entire_week is set to TRUE. + * It returns FALSE if the position is completely outside all months. */ static gboolean -e_calendar_item_convert_position_to_day (ECalendarItem *calitem, - gint event_x, - gint event_y, - gboolean round_empty_positions, - gint *month_offset, - gint *day, - gboolean *entire_week) +e_calendar_item_convert_position_to_day (ECalendarItem *calitem, + gint event_x, + gint event_y, + gboolean round_empty_positions, + gint *month_offset, + gint *day, + gboolean *entire_week) { GnomeCanvasItem *item; GtkWidget *widget; @@ -2443,7 +2455,7 @@ e_calendar_item_convert_position_to_day (ECalendarItem *calitem, if (row >= calitem->rows || col >= calitem->cols) return FALSE; if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) - col = calitem->cols-1 - col; + col = calitem->cols - 1 - col; *month_offset = row * calitem->cols + col; @@ -2489,7 +2501,7 @@ e_calendar_item_convert_position_to_day (ECalendarItem *calitem, return FALSE; day_col = x / calitem->cell_width; if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) - day_col = E_CALENDAR_COLS_PER_MONTH-1 - day_col; + day_col = E_CALENDAR_COLS_PER_MONTH - 1 - day_col; if (day_col >= E_CALENDAR_COLS_PER_MONTH) return FALSE; } @@ -2529,12 +2541,12 @@ e_calendar_item_convert_position_to_day (ECalendarItem *calitem, } static void -e_calendar_item_get_month_info (ECalendarItem *calitem, - gint row, - gint col, - gint *first_day_offset, - gint *days_in_month, - gint *days_in_prev_month) +e_calendar_item_get_month_info (ECalendarItem *calitem, + gint row, + gint col, + gint *first_day_offset, + gint *days_in_month, + gint *days_in_prev_month) { gint year, month, start_weekday, first_day_of_month; struct tm tmp_tm = { 0 }; @@ -2567,19 +2579,19 @@ e_calendar_item_get_month_info (ECalendarItem *calitem, } void -e_calendar_item_get_first_month (ECalendarItem *calitem, - gint *year, - gint *month) +e_calendar_item_get_first_month (ECalendarItem *calitem, + gint *year, + gint *month) { *year = calitem->year; *month = calitem->month; } static void -e_calendar_item_preserve_day_selection (ECalendarItem *calitem, - gint selected_day, - gint *month_offset, - gint *day) +e_calendar_item_preserve_day_selection (ECalendarItem *calitem, + gint selected_day, + gint *month_offset, + gint *day) { gint year, month, weekday, days, days_in_month; struct tm tmp_tm = { 0 }; @@ -2615,9 +2627,9 @@ e_calendar_item_preserve_day_selection (ECalendarItem *calitem, /* This also handles values of month < 0 or > 11 by updating the year. */ void -e_calendar_item_set_first_month (ECalendarItem *calitem, - gint year, - gint month) +e_calendar_item_set_first_month (ECalendarItem *calitem, + gint year, + gint month) { gint new_year, new_month, months_diff, num_months; gint old_days_in_selection, new_days_in_selection; @@ -2673,7 +2685,7 @@ e_calendar_item_set_first_month (ECalendarItem *calitem, } /* We want to ensure that the same number of days are - selected after we have moved the selection. */ + * selected after we have moved the selection. */ calitem->year = new_year; calitem->month = new_month; @@ -2704,9 +2716,9 @@ e_calendar_item_set_first_month (ECalendarItem *calitem, new_days_in_selection); /* Flag that we need to emit the "selection_changed" - signal. We don't want to emit it here since setting - the "year" and "month" args would result in 2 - signals emitted. */ + * signal. We don't want to emit it here since setting + * the "year" and "month" args would result in 2 + * signals emitted. */ calitem->selection_changed = TRUE; } } else { @@ -2720,15 +2732,15 @@ e_calendar_item_set_first_month (ECalendarItem *calitem, /* Get the maximum number of days selectable */ gint -e_calendar_item_get_max_days_sel (ECalendarItem *calitem) +e_calendar_item_get_max_days_sel (ECalendarItem *calitem) { return calitem->max_days_selected; } /* Set the maximum number of days selectable */ void -e_calendar_item_set_max_days_sel (ECalendarItem *calitem, - gint days) +e_calendar_item_set_max_days_sel (ECalendarItem *calitem, + gint days) { calitem->max_days_selected = MAX (0, days); gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (calitem)); @@ -2736,38 +2748,38 @@ e_calendar_item_set_max_days_sel (ECalendarItem *calitem, /* Get the maximum number of days before whole weeks are selected */ gint -e_calendar_item_get_days_start_week_sel (ECalendarItem *calitem) +e_calendar_item_get_days_start_week_sel (ECalendarItem *calitem) { return calitem->days_to_start_week_selection; } /* Set the maximum number of days before whole weeks are selected */ void -e_calendar_item_set_days_start_week_sel (ECalendarItem *calitem, - gint days) +e_calendar_item_set_days_start_week_sel (ECalendarItem *calitem, + gint days) { calitem->days_to_start_week_selection = days; } gboolean -e_calendar_item_get_display_popup (ECalendarItem *calitem) +e_calendar_item_get_display_popup (ECalendarItem *calitem) { return calitem->display_popup; } void -e_calendar_item_set_display_popup (ECalendarItem *calitem, - gboolean display) +e_calendar_item_set_display_popup (ECalendarItem *calitem, + gboolean display) { calitem->display_popup = display; } /* This will make sure that the given year & month are valid, i.e. if month - is < 0 or > 11 the year and month will be updated accordingly. */ + * is < 0 or > 11 the year and month will be updated accordingly. */ void -e_calendar_item_normalize_date (ECalendarItem *calitem, - gint *year, - gint *month) +e_calendar_item_normalize_date (ECalendarItem *calitem, + gint *year, + gint *month) { if (*month >= 0) { *year += *month / 12; @@ -2781,11 +2793,11 @@ e_calendar_item_normalize_date (ECalendarItem *calitem, } /* Adds or subtracts days from the selection. It is used when we switch months - and the selection extends past the end of a month but we want to keep the - number of days selected the same. days should not be more than 30. */ + * and the selection extends past the end of a month but we want to keep the + * number of days selected the same. days should not be more than 30. */ static void -e_calendar_item_add_days_to_selection (ECalendarItem *calitem, - gint days) +e_calendar_item_add_days_to_selection (ECalendarItem *calitem, + gint days) { gint year, month, days_in_month; @@ -2809,17 +2821,17 @@ e_calendar_item_add_days_to_selection (ECalendarItem *calitem, } /* Gets the range of dates actually shown. Months are 0 to 11. - This also includes the last days of the previous month and the first days - of the following month, which are normally shown in gray. - It returns FALSE if no dates are currently shown. */ + * This also includes the last days of the previous month and the first days + * of the following month, which are normally shown in gray. + * It returns FALSE if no dates are currently shown. */ gboolean -e_calendar_item_get_date_range (ECalendarItem *calitem, - gint *start_year, - gint *start_month, - gint *start_day, - gint *end_year, - gint *end_month, - gint *end_day) +e_calendar_item_get_date_range (ECalendarItem *calitem, + gint *start_year, + gint *start_month, + gint *start_day, + gint *end_year, + gint *end_month, + gint *end_day) { gint first_day_offset, days_in_month, days_in_prev_month; @@ -2827,7 +2839,7 @@ e_calendar_item_get_date_range (ECalendarItem *calitem, return FALSE; /* Calculate the first day shown. This will be one of the greyed-out - days before the first full month begins. */ + * days before the first full month begins. */ e_calendar_item_get_month_info (calitem, 0, 0, &first_day_offset, &days_in_month, &days_in_prev_month); *start_year = calitem->year; @@ -2839,7 +2851,7 @@ e_calendar_item_get_date_range (ECalendarItem *calitem, *start_day = days_in_prev_month + 1 - first_day_offset; /* Calculate the last day shown. This will be one of the greyed-out - days after the last full month ends. */ + * days after the last full month ends. */ e_calendar_item_get_month_info (calitem, calitem->rows - 1, calitem->cols - 1, &first_day_offset, &days_in_month, &days_in_prev_month); @@ -2853,9 +2865,9 @@ e_calendar_item_get_date_range (ECalendarItem *calitem, } /* Simple way to mark days so they appear bold. - A more flexible interface may be added later. */ + * A more flexible interface may be added later. */ void -e_calendar_item_clear_marks (ECalendarItem *calitem) +e_calendar_item_clear_marks (ECalendarItem *calitem) { GnomeCanvasItem *item; @@ -2870,12 +2882,12 @@ e_calendar_item_clear_marks (ECalendarItem *calitem) /* add_day_style - whether bit-or with the actual style or change the style fully */ void -e_calendar_item_mark_day (ECalendarItem *calitem, - gint year, - gint month, - gint day, - guint8 day_style, - gboolean add_day_style) +e_calendar_item_mark_day (ECalendarItem *calitem, + gint year, + gint month, + gint day, + guint8 day_style, + gboolean add_day_style) { gint month_offset; gint index; @@ -2895,15 +2907,15 @@ e_calendar_item_mark_day (ECalendarItem *calitem, } void -e_calendar_item_mark_days (ECalendarItem *calitem, - gint start_year, - gint start_month, - gint start_day, - gint end_year, - gint end_month, - gint end_day, - guint8 day_style, - gboolean add_day_style) +e_calendar_item_mark_days (ECalendarItem *calitem, + gint start_year, + gint start_month, + gint start_day, + gint end_year, + gint end_month, + gint end_day, + guint8 day_style, + gboolean add_day_style) { gint month_offset, end_month_offset, day; @@ -2964,9 +2976,9 @@ e_calendar_item_mark_days (ECalendarItem *calitem, /* Rounds up the given day to the end of the week. */ static void -e_calendar_item_round_up_selection (ECalendarItem *calitem, - gint *month_offset, - gint *day) +e_calendar_item_round_up_selection (ECalendarItem *calitem, + gint *month_offset, + gint *day) { gint year, month, weekday, days, days_in_month; struct tm tmp_tm = { 0 }; @@ -2997,9 +3009,9 @@ e_calendar_item_round_up_selection (ECalendarItem *calitem, /* Rounds down the given day to the start of the week. */ static void -e_calendar_item_round_down_selection (ECalendarItem *calitem, - gint *month_offset, - gint *day) +e_calendar_item_round_down_selection (ECalendarItem *calitem, + gint *month_offset, + gint *day) { gint year, month, weekday, days, days_in_month; struct tm tmp_tm = { 0 }; @@ -3034,11 +3046,11 @@ e_calendar_item_round_down_selection (ECalendarItem *calitem, } static gint -e_calendar_item_get_inclusive_days (ECalendarItem *calitem, - gint start_month_offset, - gint start_day, - gint end_month_offset, - gint end_day) +e_calendar_item_get_inclusive_days (ECalendarItem *calitem, + gint start_month_offset, + gint start_day, + gint end_month_offset, + gint end_day) { gint start_year, start_month, end_year, end_month, days = 0; @@ -3065,11 +3077,11 @@ e_calendar_item_get_inclusive_days (ECalendarItem *calitem, } /* If the day is off the end of the month it is set to the last day of the - month. */ + * month. */ static void -e_calendar_item_ensure_valid_day (ECalendarItem *calitem, - gint *month_offset, - gint *day) +e_calendar_item_ensure_valid_day (ECalendarItem *calitem, + gint *month_offset, + gint *day) { gint year, month, days_in_month; @@ -3083,9 +3095,9 @@ e_calendar_item_ensure_valid_day (ECalendarItem *calitem, } gboolean -e_calendar_item_get_selection (ECalendarItem *calitem, - GDate *start_date, - GDate *end_date) +e_calendar_item_get_selection (ECalendarItem *calitem, + GDate *start_date, + GDate *end_date) { gint start_year, start_month, start_day; gint end_year, end_month, end_day; @@ -3113,10 +3125,10 @@ e_calendar_item_get_selection (ECalendarItem *calitem, } static void -e_calendar_item_set_selection_if_emission (ECalendarItem *calitem, - const GDate *start_date, - const GDate *end_date, - gboolean emission) +e_calendar_item_set_selection_if_emission (ECalendarItem *calitem, + const GDate *start_date, + const GDate *end_date, + gboolean emission) { gint start_year, start_month, start_day; gint end_year, end_month, end_day; @@ -3127,7 +3139,7 @@ e_calendar_item_set_selection_if_emission (ECalendarItem *calitem, g_return_if_fail (E_IS_CALENDAR_ITEM (calitem)); /* If start_date is NULL, we clear the selection without changing the - month shown. */ + * month shown. */ if (start_date == NULL) { calitem->selection_set = FALSE; calitem->selection_changed = TRUE; @@ -3192,7 +3204,8 @@ e_calendar_item_set_selection_if_emission (ECalendarItem *calitem, } void -e_calendar_item_style_set (GtkWidget *widget, ECalendarItem *calitem) +e_calendar_item_style_set (GtkWidget *widget, + ECalendarItem *calitem) { GtkStyle *style; GdkColor *color; @@ -3216,9 +3229,9 @@ e_calendar_item_style_set (GtkWidget *widget, ECalendarItem *calitem) } void -e_calendar_item_set_selection (ECalendarItem *calitem, - const GDate *start_date, - const GDate *end_date) +e_calendar_item_set_selection (ECalendarItem *calitem, + const GDate *start_date, + const GDate *end_date) { /* If the user is in the middle of a selection, we must abort it. */ if (calitem->selecting) { @@ -3233,18 +3246,18 @@ e_calendar_item_set_selection (ECalendarItem *calitem, } /* This tries to ensure that the given time range is visible. If the range - given is longer than we can show, only the start of it will be visible. - Note that this will not update the selection. That should be done somewhere - else. It returns TRUE if the visible range has been changed. */ + * given is longer than we can show, only the start of it will be visible. + * Note that this will not update the selection. That should be done somewhere + * else. It returns TRUE if the visible range has been changed. */ static gboolean -e_calendar_item_ensure_days_visible (ECalendarItem *calitem, - gint start_year, - gint start_month, - gint start_day, - gint end_year, - gint end_month, - gint end_day, - gboolean emission) +e_calendar_item_ensure_days_visible (ECalendarItem *calitem, + gint start_year, + gint start_month, + gint start_day, + gint end_year, + gint end_month, + gint end_day, + gboolean emission) { gint current_end_year, current_end_month; gint months_shown; @@ -3264,7 +3277,7 @@ e_calendar_item_ensure_days_visible (ECalendarItem *calitem, current_end_month == 11 && end_month == 0) || (end_year == current_end_year && end_month == current_end_month + 1)) { /* See if the end of the selection will fit in the - leftover days of the month after the last one shown. */ + * leftover days of the month after the last one shown. */ calitem->month += (months_shown - 1); e_calendar_item_normalize_date (calitem, &calitem->year, &calitem->month); @@ -3301,14 +3314,14 @@ e_calendar_item_ensure_days_visible (ECalendarItem *calitem, } /* Now try to ensure that the start month is shown. We do this after - the end month so that the start month will always be shown. */ + * the end month so that the start month will always be shown. */ if (start_year < calitem->year || (start_year == calitem->year && start_month < calitem->month)) { need_update = TRUE; /* First we see if the start of the selection will fit in the - leftover days of the month before the first one shown. */ + * leftover days of the month before the first one shown. */ calitem->year = start_year; calitem->month = start_month + 1; e_calendar_item_normalize_date (calitem, &calitem->year, @@ -3348,9 +3361,9 @@ deactivate_menu_cb (GtkWidget *menu) } static void -e_calendar_item_show_popup_menu (ECalendarItem *calitem, - GdkEventButton *event, - gint month_offset) +e_calendar_item_show_popup_menu (ECalendarItem *calitem, + GdkEventButton *event, + gint month_offset) { GtkWidget *menu, *submenu, *menuitem, *label; gint year, month; @@ -3388,7 +3401,7 @@ e_calendar_item_show_popup_menu (ECalendarItem *calitem, g_object_set_data(G_OBJECT(menuitem), "month", GINT_TO_POINTER (month)); - g_signal_connect((menuitem), "activate", + g_signal_connect ((menuitem), "activate", G_CALLBACK (e_calendar_item_on_menu_item_activate), calitem); } } @@ -3400,8 +3413,8 @@ e_calendar_item_show_popup_menu (ECalendarItem *calitem, } static void -e_calendar_item_on_menu_item_activate (GtkWidget *menuitem, - ECalendarItem *calitem) +e_calendar_item_on_menu_item_activate (GtkWidget *menuitem, + ECalendarItem *calitem) { GtkWidget *parent; gint year, month_offset, month; @@ -3424,11 +3437,11 @@ e_calendar_item_on_menu_item_activate (GtkWidget *menuitem, } static void -e_calendar_item_position_menu (GtkMenu *menu, - gint *x, - gint *y, - gboolean *push_in, - gpointer user_data) +e_calendar_item_position_menu (GtkMenu *menu, + gint *x, + gint *y, + gboolean *push_in, + gpointer user_data) { GtkRequisition requisition; gint screen_width, screen_height; @@ -3449,10 +3462,10 @@ e_calendar_item_position_menu (GtkMenu *menu, /* Sets the function to call to get the colors to use for a particular day. */ void -e_calendar_item_set_style_callback (ECalendarItem *calitem, - ECalendarItemStyleCallback cb, - gpointer data, - GDestroyNotify destroy) +e_calendar_item_set_style_callback (ECalendarItem *calitem, + ECalendarItemStyleCallback cb, + gpointer data, + GDestroyNotify destroy) { g_return_if_fail (E_IS_CALENDAR_ITEM (calitem)); @@ -3465,7 +3478,7 @@ e_calendar_item_set_style_callback (ECalendarItem *calitem, } static void -e_calendar_item_date_range_changed (ECalendarItem *calitem) +e_calendar_item_date_range_changed (ECalendarItem *calitem) { g_free (calitem->styles); calitem->styles = NULL; @@ -3474,7 +3487,7 @@ e_calendar_item_date_range_changed (ECalendarItem *calitem) } static void -e_calendar_item_queue_signal_emission (ECalendarItem *calitem) +e_calendar_item_queue_signal_emission (ECalendarItem *calitem) { if (calitem->signal_emission_idle_id == 0) { calitem->signal_emission_idle_id = g_idle_add_full ( @@ -3485,7 +3498,7 @@ e_calendar_item_queue_signal_emission (ECalendarItem *calitem) } static gboolean -e_calendar_item_signal_emission_idle_cb (gpointer data) +e_calendar_item_signal_emission_idle_cb (gpointer data) { ECalendarItem *calitem; @@ -3498,7 +3511,7 @@ e_calendar_item_signal_emission_idle_cb (gpointer data) calitem->signal_emission_idle_id = 0; /* We ref the calitem & check in case it gets destroyed, since we - were getting a free memory write here. */ + * were getting a free memory write here. */ g_object_ref ((calitem)); if (calitem->date_range_changed) { @@ -3518,13 +3531,13 @@ e_calendar_item_signal_emission_idle_cb (gpointer data) } /* Sets a callback to use to get the current time. This is useful if the - application needs to use its own timezone data rather than rely on the - Unix timezone. */ + * application needs to use its own timezone data rather than rely on the + * Unix timezone. */ void -e_calendar_item_set_get_time_callback (ECalendarItem *calitem, - ECalendarItemGetTimeCallback cb, - gpointer data, - GDestroyNotify destroy) +e_calendar_item_set_get_time_callback (ECalendarItem *calitem, + ECalendarItemGetTimeCallback cb, + gpointer data, + GDestroyNotify destroy) { g_return_if_fail (E_IS_CALENDAR_ITEM (calitem)); diff --git a/widgets/misc/e-calendar-item.h b/widgets/misc/e-calendar-item.h index 0b07cc7b25..19f096c5b2 100644 --- a/widgets/misc/e-calendar-item.h +++ b/widgets/misc/e-calendar-item.h @@ -86,7 +86,7 @@ typedef struct _ECalendarItem ECalendarItem; typedef struct _ECalendarItemClass ECalendarItemClass; /* The type of the callback function optionally used to get the colors to - use for each day. */ + * use for each day. */ typedef void (*ECalendarItemStyleCallback) (ECalendarItem *calitem, gint year, gint month, @@ -137,10 +137,10 @@ struct _ECalendarItem gint month; /* 0 to 11 */ /* Points to an array of styles, one gchar for each day. We use 32 - chars for each month, with n + 2 months, where n is the number of - complete months shown (since we show some days before the first - month and after the last month grayes out). - A value of 0 is the default, and 1 is bold. */ + * chars for each month, with n + 2 months, where n is the number of + * complete months shown (since we show some days before the first + * month and after the last month grayes out). + * A value of 0 is the default, and 1 is bold. */ guint8 *styles; /* @@ -148,8 +148,8 @@ struct _ECalendarItem */ /* The minimum & maximum number of rows & columns of months. - If the maximum values are -1 then there is no maximum. - The minimum valies default to 1. The maximum values to -1. */ + * If the maximum values are -1 then there is no maximum. + * The minimum valies default to 1. The maximum values to -1. */ gint min_rows; gint min_cols; gint max_rows; @@ -174,16 +174,16 @@ struct _ECalendarItem gint max_days_selected; /* The number of days selected before we switch to selecting whole - weeks, or -1 if we never switch. Defaults to -1. */ + * weeks, or -1 if we never switch. Defaults to -1. */ gint days_to_start_week_selection; /* Whether the selection is moved when we move back/forward one month. - Used for things like the EDateEdit which only want the selection to - be changed when the user explicitly selects a day. */ + * Used for things like the EDateEdit which only want the selection to + * be changed when the user explicitly selects a day. */ gboolean move_selection_when_moving; /* Whether the selection day is preserved when we move back/forward - one month. Used for the work week and week view. */ + * one month. Used for the work week and week view. */ gboolean preserve_day_when_moving; /* Whether to display the pop-up, TRUE by default */ @@ -216,8 +216,8 @@ struct _ECalendarItem gint cell_height; /* The current selection. The month offsets are from 0, which is the - top-left calendar month view. Note that -1 is used for the last days - from the previous month. The days are real month days. */ + * top-left calendar month view. Note that -1 is used for the last days + * from the previous month. The days are real month days. */ gboolean selecting; GDate *selecting_axis; gboolean selection_dragging_end; @@ -242,7 +242,7 @@ struct _ECalendarItem gint max_week_number_digit_width; /* Fonts for drawing text. If font isn't set it uses the font from the - canvas widget. If week_number_font isn't set it uses font. */ + * canvas widget. If week_number_font isn't set it uses font. */ PangoFontDescription *font_desc; PangoFontDescription *week_number_font_desc; @@ -261,9 +261,9 @@ struct _ECalendarItem gint signal_emission_idle_id; /* A flag to indicate that the selection or date range has changed. - When set the idle function will emit the signal and reset it to - FALSE. This is so we don't emit it several times when args are set - etc. */ + * When set the idle function will emit the signal and reset it to + * FALSE. This is so we don't emit it several times when args are set + * etc. */ gboolean selection_changed; gboolean date_range_changed; }; @@ -311,9 +311,9 @@ void e_calendar_item_set_display_popup (ECalendarItem *calitem, gboolean display); /* Gets the range of dates actually shown. Months are 0 to 11. - This also includes the last days of the previous month and the first days - of the following month, which are normally shown in gray. - It returns FALSE if no dates are currently shown. */ + * This also includes the last days of the previous month and the first days + * of the following month, which are normally shown in gray. + * It returns FALSE if no dates are currently shown. */ gboolean e_calendar_item_get_date_range (ECalendarItem *calitem, gint *start_year, @@ -324,22 +324,22 @@ gboolean gint *end_day); /* Returns the selected date range. It returns FALSE if no days are currently - selected. */ + * selected. */ gboolean e_calendar_item_get_selection (ECalendarItem *calitem, GDate *start_date, GDate *end_date); /* Sets the selected date range, and changes the date range shown so at least - the start of the selection is shown. If start_date is NULL it clears the - selection. */ + * the start of the selection is shown. If start_date is NULL it clears the + * selection. */ void e_calendar_item_set_selection (ECalendarItem *calitem, const GDate *start_date, const GDate *end_date); /* Marks a particular day. Passing E_CALENDAR_ITEM_MARK_BOLD as the day style - will result in the day being shown as bold by default. The style callback - could support more day_styles, or the style callback could determine the - colors itself, without needing to mark days. */ + * will result in the day being shown as bold by default. The style callback + * could support more day_styles, or the style callback could determine the + * colors itself, without needing to mark days. */ void e_calendar_item_clear_marks (ECalendarItem *calitem); void e_calendar_item_mark_day (ECalendarItem *calitem, gint year, @@ -349,7 +349,7 @@ void e_calendar_item_mark_day (ECalendarItem *calitem, gboolean add_day_style); /* Mark a range of days. Any days outside the currently shown range are - ignored. */ + * ignored. */ void e_calendar_item_mark_days (ECalendarItem *calitem, gint start_year, gint start_month, @@ -367,8 +367,8 @@ void e_calendar_item_set_style_callback (ECalendarItem *calitem, GDestroyNotify destroy); /* Sets a callback to use to get the current time. This is useful if the - application needs to use its own timezone data rather than rely on the - Unix timezone. */ + * application needs to use its own timezone data rather than rely on the + * Unix timezone. */ void e_calendar_item_set_get_time_callback (ECalendarItem *calitem, ECalendarItemGetTimeCallback cb, gpointer data, diff --git a/widgets/misc/e-calendar.c b/widgets/misc/e-calendar.c index 2c0c6ab9c0..1899d7c61f 100644 --- a/widgets/misc/e-calendar.c +++ b/widgets/misc/e-calendar.c @@ -51,7 +51,7 @@ #define E_CALENDAR_ARROW_BUTTON_Y_PAD 0 /* Vertical padding. The padding above the button includes the space for the - horizontal line. */ + * horizontal line. */ #define E_CALENDAR_YPAD_ABOVE_LOWER_BUTTONS 4 #define E_CALENDAR_YPAD_BELOW_LOWER_BUTTONS 3 @@ -60,8 +60,8 @@ #define E_CALENDAR_XPAD_BUTTONS 8 /* The time between steps when the prev/next buttons is pressed, in 1/1000ths - of a second, and the number of timeouts we skip before we start - automatically moving back/forward. */ + * of a second, and the number of timeouts we skip before we start + * automatically moving back/forward. */ #define E_CALENDAR_AUTO_MOVE_TIMEOUT 150 #define E_CALENDAR_AUTO_MOVE_TIMEOUT_DELAY 2 @@ -216,7 +216,7 @@ e_calendar_init (ECalendar *cal) * Creates a new #ECalendar. **/ GtkWidget * -e_calendar_new (void) +e_calendar_new (void) { GtkWidget *cal; AtkObject *a11y; @@ -229,7 +229,7 @@ e_calendar_new (void) } static void -e_calendar_dispose (GObject *object) +e_calendar_dispose (GObject *object) { ECalendar *cal; @@ -256,15 +256,15 @@ e_calendar_realize (GtkWidget *widget) (*GTK_WIDGET_CLASS (e_calendar_parent_class)->realize) (widget); /* Set the background of the canvas window to the normal color, - or the arrow buttons are not displayed properly. */ + * or the arrow buttons are not displayed properly. */ style = gtk_widget_get_style (widget); window = gtk_layout_get_bin_window (GTK_LAYOUT (widget)); gdk_window_set_background (window, &style->bg[GTK_STATE_NORMAL]); } static void -e_calendar_style_set (GtkWidget *widget, - GtkStyle *previous_style) +e_calendar_style_set (GtkWidget *widget, + GtkStyle *previous_style) { ECalendar *e_calendar; @@ -274,7 +274,7 @@ e_calendar_style_set (GtkWidget *widget, previous_style); /* Set the background of the canvas window to the normal color, - or the arrow buttons are not displayed properly. */ + * or the arrow buttons are not displayed properly. */ if (gtk_widget_get_realized (widget)) { GtkStyle *style; GdkWindow *window; @@ -288,8 +288,8 @@ e_calendar_style_set (GtkWidget *widget, static void e_calendar_get_preferred_width (GtkWidget *widget, - gint *minimum, - gint *natural) + gint *minimum, + gint *natural) { ECalendar *cal; GtkStyle *style; @@ -305,8 +305,8 @@ e_calendar_get_preferred_width (GtkWidget *widget, static void e_calendar_get_preferred_height (GtkWidget *widget, - gint *minimum, - gint *natural) + gint *minimum, + gint *natural) { ECalendar *cal; GtkStyle *style; @@ -321,8 +321,8 @@ e_calendar_get_preferred_height (GtkWidget *widget, } static void -e_calendar_size_allocate (GtkWidget *widget, - GtkAllocation *allocation) +e_calendar_size_allocate (GtkWidget *widget, + GtkAllocation *allocation) { ECalendar *cal; GtkStyle *style; @@ -398,9 +398,9 @@ e_calendar_size_allocate (GtkWidget *widget, } void -e_calendar_set_minimum_size (ECalendar *cal, - gint rows, - gint cols) +e_calendar_set_minimum_size (ECalendar *cal, + gint rows, + gint cols) { g_return_if_fail (E_IS_CALENDAR (cal)); @@ -416,9 +416,9 @@ e_calendar_set_minimum_size (ECalendar *cal, } void -e_calendar_set_maximum_size (ECalendar *cal, - gint rows, - gint cols) +e_calendar_set_maximum_size (ECalendar *cal, + gint rows, + gint cols) { g_return_if_fail (E_IS_CALENDAR (cal)); @@ -435,11 +435,11 @@ e_calendar_set_maximum_size (ECalendar *cal, /* Returns the border size on each side of the month displays. */ void -e_calendar_get_border_size (ECalendar *cal, - gint *top, - gint *bottom, - gint *left, - gint *right) +e_calendar_get_border_size (ECalendar *cal, + gint *top, + gint *bottom, + gint *left, + gint *right) { GtkStyle *style; @@ -458,20 +458,20 @@ e_calendar_get_border_size (ECalendar *cal, } static void -e_calendar_on_prev_pressed (ECalendar *cal) +e_calendar_on_prev_pressed (ECalendar *cal) { e_calendar_start_auto_move (cal, FALSE); } static void -e_calendar_on_next_pressed (ECalendar *cal) +e_calendar_on_next_pressed (ECalendar *cal) { e_calendar_start_auto_move (cal, TRUE); } static void -e_calendar_start_auto_move (ECalendar *cal, - gboolean moving_forward) +e_calendar_start_auto_move (ECalendar *cal, + gboolean moving_forward) { if (cal->timeout_id == 0) { cal->timeout_id = g_timeout_add (E_CALENDAR_AUTO_MOVE_TIMEOUT, @@ -484,7 +484,7 @@ e_calendar_start_auto_move (ECalendar *cal, } static gboolean -e_calendar_auto_move_handler (gpointer data) +e_calendar_auto_move_handler (gpointer data) { ECalendar *cal; ECalendarItem *calitem; @@ -510,19 +510,19 @@ e_calendar_auto_move_handler (gpointer data) } static void -e_calendar_on_prev_released (ECalendar *cal) +e_calendar_on_prev_released (ECalendar *cal) { e_calendar_stop_auto_move (cal); } static void -e_calendar_on_next_released (ECalendar *cal) +e_calendar_on_next_released (ECalendar *cal) { e_calendar_stop_auto_move (cal); } static void -e_calendar_stop_auto_move (ECalendar *cal) +e_calendar_stop_auto_move (ECalendar *cal) { if (cal->timeout_id != 0) { g_source_remove (cal->timeout_id); @@ -531,45 +531,38 @@ e_calendar_stop_auto_move (ECalendar *cal) } static void -e_calendar_on_prev_clicked (ECalendar *cal) +e_calendar_on_prev_clicked (ECalendar *cal) { e_calendar_item_set_first_month (cal->calitem, cal->calitem->year, cal->calitem->month - 1); } static void -e_calendar_on_next_clicked (ECalendar *cal) +e_calendar_on_next_clicked (ECalendar *cal) { e_calendar_item_set_first_month (cal->calitem, cal->calitem->year, cal->calitem->month + 1); } static gint -e_calendar_drag_motion (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - guint time) +e_calendar_drag_motion (GtkWidget *widget, + GdkDragContext *context, + gint x, + gint y, + guint time) { -#if 0 - g_print ("In e_calendar_drag_motion\n"); -#endif - return FALSE; } static void -e_calendar_drag_leave (GtkWidget *widget, - GdkDragContext *context, - guint time) +e_calendar_drag_leave (GtkWidget *widget, + GdkDragContext *context, + guint time) { -#if 0 - g_print ("In e_calendar_drag_leave\n"); -#endif } static gboolean -e_calendar_button_has_focus (ECalendar *cal) +e_calendar_button_has_focus (ECalendar *cal) { GtkWidget *prev_widget, *next_widget; gboolean ret_val; @@ -584,7 +577,8 @@ e_calendar_button_has_focus (ECalendar *cal) } static gboolean -e_calendar_focus (GtkWidget *widget, GtkDirectionType direction) +e_calendar_focus (GtkWidget *widget, + GtkDirectionType direction) { #define E_CALENDAR_FOCUS_CHILDREN_NUM 3 ECalendar *cal; @@ -641,7 +635,8 @@ e_calendar_focus (GtkWidget *widget, GtkDirectionType direction) } void -e_calendar_set_focusable (ECalendar *cal, gboolean focusable) +e_calendar_set_focusable (ECalendar *cal, + gboolean focusable) { GtkWidget *widget; GtkWidget *prev_widget, *next_widget; diff --git a/widgets/misc/e-calendar.h b/widgets/misc/e-calendar.h index a3d979c07e..027a1c1fc3 100644 --- a/widgets/misc/e-calendar.h +++ b/widgets/misc/e-calendar.h @@ -74,8 +74,8 @@ struct _ECalendar { gint max_cols; /* These are all used when the prev/next buttons are held down. - moving_forward is TRUE if we are moving forward in time, i.e. the - next button is pressed. */ + * moving_forward is TRUE if we are moving forward in time, i.e. the + * next button is pressed. */ gint timeout_id; gint timeout_delay; gboolean moving_forward; diff --git a/widgets/misc/e-canvas-background.c b/widgets/misc/e-canvas-background.c index dc415777d9..ea45aab4d5 100644 --- a/widgets/misc/e-canvas-background.c +++ b/widgets/misc/e-canvas-background.c @@ -68,7 +68,11 @@ enum { }; static void -ecb_bounds (GnomeCanvasItem *item, gdouble *x1, gdouble *y1, gdouble *x2, gdouble *y2) +ecb_bounds (GnomeCanvasItem *item, + gdouble *x1, + gdouble *y1, + gdouble *x2, + gdouble *y2) { *x1 = -G_MAXDOUBLE; *y1 = -G_MAXDOUBLE; @@ -77,7 +81,9 @@ ecb_bounds (GnomeCanvasItem *item, gdouble *x1, gdouble *y1, gdouble *x2, gdoubl } static void -ecb_update (GnomeCanvasItem *item, const cairo_matrix_t *i2c, gint flags) +ecb_update (GnomeCanvasItem *item, + const cairo_matrix_t *i2c, + gint flags) { gdouble x1, y1, x2, y2; @@ -112,9 +118,9 @@ ecb_dispose (GObject *object) static void ecb_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) + guint property_id, + const GValue *value, + GParamSpec *pspec) { ECanvasBackground *ecb; @@ -123,7 +129,7 @@ ecb_set_property (GObject *object, ecb = E_CANVAS_BACKGROUND (object); - switch (prop_id) { + switch (property_id) { case PROP_FILL_COLOR: if (g_value_get_string (value)) gdk_color_parse (g_value_get_string (value), &color); @@ -157,20 +163,20 @@ ecb_set_property (GObject *object, static void ecb_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) + guint property_id, + GValue *value, + GParamSpec *pspec) { ECanvasBackground *ecb; ecb = E_CANVAS_BACKGROUND (object); - switch (prop_id) { + switch (property_id) { case PROP_FILL_COLOR_RGBA: g_value_set_uint (value, ecb->priv->rgba); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -202,7 +208,11 @@ ecb_draw (GnomeCanvasItem *item, } static GnomeCanvasItem * -ecb_point (GnomeCanvasItem *item, gdouble x, gdouble y, gint cx, gint cy) +ecb_point (GnomeCanvasItem *item, + gdouble x, + gdouble y, + gint cx, + gint cy) { return item; } diff --git a/widgets/misc/e-canvas-utils.c b/widgets/misc/e-canvas-utils.c index 4a697f8ed2..ec3aad3858 100644 --- a/widgets/misc/e-canvas-utils.c +++ b/widgets/misc/e-canvas-utils.c @@ -28,7 +28,9 @@ #include "e-canvas-utils.h" void -e_canvas_item_move_absolute (GnomeCanvasItem *item, gdouble dx, gdouble dy) +e_canvas_item_move_absolute (GnomeCanvasItem *item, + gdouble dx, + gdouble dy) { cairo_matrix_t translate; @@ -40,7 +42,10 @@ e_canvas_item_move_absolute (GnomeCanvasItem *item, gdouble dx, gdouble dy) } static double -compute_offset (gint top, gint bottom, gint page_top, gint page_bottom) +compute_offset (gint top, + gint bottom, + gint page_top, + gint page_bottom) { gint size = bottom - top; gint offset = 0; @@ -67,7 +72,11 @@ compute_offset (gint top, gint bottom, gint page_top, gint page_bottom) } static void -e_canvas_show_area (GnomeCanvas *canvas, gdouble x1, gdouble y1, gdouble x2, gdouble y2) +e_canvas_show_area (GnomeCanvas *canvas, + gdouble x1, + gdouble y1, + gdouble x2, + gdouble y2) { GtkAdjustment *h, *v; gint dx = 0, dy = 0; @@ -99,7 +108,11 @@ e_canvas_show_area (GnomeCanvas *canvas, gdouble x1, gdouble y1, gdouble x2, gdo } void -e_canvas_item_show_area (GnomeCanvasItem *item, gdouble x1, gdouble y1, gdouble x2, gdouble y2) +e_canvas_item_show_area (GnomeCanvasItem *item, + gdouble x1, + gdouble y1, + gdouble x2, + gdouble y2) { g_return_if_fail (item != NULL); g_return_if_fail (GNOME_IS_CANVAS_ITEM (item)); @@ -111,7 +124,11 @@ e_canvas_item_show_area (GnomeCanvasItem *item, gdouble x1, gdouble y1, gdouble } static gboolean -e_canvas_area_shown (GnomeCanvas *canvas, gdouble x1, gdouble y1, gdouble x2, gdouble y2) +e_canvas_area_shown (GnomeCanvas *canvas, + gdouble x1, + gdouble y1, + gdouble x2, + gdouble y2) { GtkAdjustment *h, *v; gint dx = 0, dy = 0; @@ -144,7 +161,11 @@ e_canvas_area_shown (GnomeCanvas *canvas, gdouble x1, gdouble y1, gdouble x2, gd } gboolean -e_canvas_item_area_shown (GnomeCanvasItem *item, gdouble x1, gdouble y1, gdouble x2, gdouble y2) +e_canvas_item_area_shown (GnomeCanvasItem *item, + gdouble x1, + gdouble y1, + gdouble x2, + gdouble y2) { g_return_val_if_fail (item != NULL, FALSE); g_return_val_if_fail (GNOME_IS_CANVAS_ITEM (item), FALSE); @@ -175,7 +196,12 @@ show_area_timeout (gpointer data) } void -e_canvas_item_show_area_delayed (GnomeCanvasItem *item, gdouble x1, gdouble y1, gdouble x2, gdouble y2, gint delay) +e_canvas_item_show_area_delayed (GnomeCanvasItem *item, + gdouble x1, + gdouble y1, + gdouble x2, + gdouble y2, + gint delay) { DoubsAndCanvas *dac; diff --git a/widgets/misc/e-canvas-utils.h b/widgets/misc/e-canvas-utils.h index 8f7600e72d..0843ba8f17 100644 --- a/widgets/misc/e-canvas-utils.h +++ b/widgets/misc/e-canvas-utils.h @@ -42,8 +42,8 @@ void e_canvas_item_show_area_delayed (GnomeCanvasItem *item, gdouble y2, gint delay); /* Returns TRUE if the area is already shown on the screen (including - spacing.) This is equivelent to returning FALSE iff show_area - would do anything. */ + * spacing.) This is equivelent to returning FALSE iff show_area + * would do anything. */ gboolean e_canvas_item_area_shown (GnomeCanvasItem *item, gdouble x1, gdouble y1, diff --git a/widgets/misc/e-canvas-vbox.c b/widgets/misc/e-canvas-vbox.c index 1513e44eb2..1b7e6ac900 100644 --- a/widgets/misc/e-canvas-vbox.c +++ b/widgets/misc/e-canvas-vbox.c @@ -36,8 +36,8 @@ #include "e-canvas-utils.h" #include "e-canvas-vbox.h" -static void e_canvas_vbox_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); -static void e_canvas_vbox_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); +static void e_canvas_vbox_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static void e_canvas_vbox_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); static void e_canvas_vbox_dispose (GObject *object); static gint e_canvas_vbox_event (GnomeCanvasItem *item, GdkEvent *event); @@ -69,7 +69,7 @@ e_canvas_vbox_class_init (ECanvasVboxClass *klass) GObjectClass *object_class; GnomeCanvasItemClass *item_class; - object_class = (GObjectClass*) klass; + object_class = (GObjectClass *) klass; item_class = (GnomeCanvasItemClass *) klass; klass->add_item = e_canvas_vbox_real_add_item; @@ -123,7 +123,10 @@ e_canvas_vbox_init (ECanvasVbox *vbox) } static void -e_canvas_vbox_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +e_canvas_vbox_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { GnomeCanvasItem *item; ECanvasVbox *e_canvas_vbox; @@ -131,7 +134,7 @@ e_canvas_vbox_set_property (GObject *object, guint prop_id, const GValue *value, item = GNOME_CANVAS_ITEM (object); e_canvas_vbox = E_CANVAS_VBOX (object); - switch (prop_id) { + switch (property_id) { case PROP_WIDTH: case PROP_MINIMUM_WIDTH: e_canvas_vbox->minimum_width = g_value_get_double (value); @@ -146,13 +149,16 @@ e_canvas_vbox_set_property (GObject *object, guint prop_id, const GValue *value, } static void -e_canvas_vbox_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +e_canvas_vbox_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { ECanvasVbox *e_canvas_vbox; e_canvas_vbox = E_CANVAS_VBOX (object); - switch (prop_id) { + switch (property_id) { case PROP_WIDTH: g_value_set_double (value, e_canvas_vbox->width); break; @@ -166,14 +172,15 @@ e_canvas_vbox_get_property (GObject *object, guint prop_id, GValue *value, GPara g_value_set_double (value, e_canvas_vbox->spacing); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } /* Used from g_list_foreach(); disconnects from an item's signals */ static void -disconnect_item_cb (gpointer data, gpointer user_data) +disconnect_item_cb (gpointer data, + gpointer user_data) { ECanvasVbox *vbox; GnomeCanvasItem *item; @@ -202,7 +209,8 @@ e_canvas_vbox_dispose (GObject *object) } static gint -e_canvas_vbox_event (GnomeCanvasItem *item, GdkEvent *event) +e_canvas_vbox_event (GnomeCanvasItem *item, + GdkEvent *event) { gint return_val = TRUE; @@ -249,14 +257,16 @@ e_canvas_vbox_realize (GnomeCanvasItem *item) } static void -e_canvas_vbox_remove_item (gpointer data, GObject *where_object_was) +e_canvas_vbox_remove_item (gpointer data, + GObject *where_object_was) { ECanvasVbox *vbox = data; vbox->items = g_list_remove (vbox->items, where_object_was); } static void -e_canvas_vbox_real_add_item (ECanvasVbox *e_canvas_vbox, GnomeCanvasItem *item) +e_canvas_vbox_real_add_item (ECanvasVbox *e_canvas_vbox, + GnomeCanvasItem *item) { e_canvas_vbox->items = g_list_append (e_canvas_vbox->items, item); g_object_weak_ref (G_OBJECT (item), @@ -270,7 +280,8 @@ e_canvas_vbox_real_add_item (ECanvasVbox *e_canvas_vbox, GnomeCanvasItem *item) } static void -e_canvas_vbox_real_add_item_start (ECanvasVbox *e_canvas_vbox, GnomeCanvasItem *item) +e_canvas_vbox_real_add_item_start (ECanvasVbox *e_canvas_vbox, + GnomeCanvasItem *item) { e_canvas_vbox->items = g_list_prepend (e_canvas_vbox->items, item); g_object_weak_ref (G_OBJECT (item), @@ -299,7 +310,8 @@ e_canvas_vbox_resize_children (GnomeCanvasItem *item) } static void -e_canvas_vbox_reflow ( GnomeCanvasItem *item, gint flags ) +e_canvas_vbox_reflow (GnomeCanvasItem *item, + gint flags) { ECanvasVbox *e_canvas_vbox = E_CANVAS_VBOX (item); if (item->flags & GNOME_CANVAS_ITEM_REALIZED) { @@ -361,14 +373,16 @@ e_canvas_vbox_reflow ( GnomeCanvasItem *item, gint flags ) } void -e_canvas_vbox_add_item (ECanvasVbox *e_canvas_vbox, GnomeCanvasItem *item) +e_canvas_vbox_add_item (ECanvasVbox *e_canvas_vbox, + GnomeCanvasItem *item) { if (E_CANVAS_VBOX_CLASS (G_OBJECT_GET_CLASS (e_canvas_vbox))->add_item) (E_CANVAS_VBOX_CLASS (G_OBJECT_GET_CLASS (e_canvas_vbox))->add_item) (e_canvas_vbox, item); } void -e_canvas_vbox_add_item_start (ECanvasVbox *e_canvas_vbox, GnomeCanvasItem *item) +e_canvas_vbox_add_item_start (ECanvasVbox *e_canvas_vbox, + GnomeCanvasItem *item) { if (E_CANVAS_VBOX_CLASS (G_OBJECT_GET_CLASS (e_canvas_vbox))->add_item_start) (E_CANVAS_VBOX_CLASS (G_OBJECT_GET_CLASS (e_canvas_vbox))->add_item_start) (e_canvas_vbox, item); diff --git a/widgets/misc/e-canvas.c b/widgets/misc/e-canvas.c index b27b7182d7..5e6889fa8e 100644 --- a/widgets/misc/e-canvas.c +++ b/widgets/misc/e-canvas.c @@ -195,7 +195,8 @@ gnome_canvas_item_invoke_point (GnomeCanvasItem *item, #define DISPLAY_X1(canvas) (GNOME_CANVAS (canvas)->layout.xoffset) #define DISPLAY_Y1(canvas) (GNOME_CANVAS (canvas)->layout.yoffset) static gint -pick_current_item (GnomeCanvas *canvas, GdkEvent *event) +pick_current_item (GnomeCanvas *canvas, + GdkEvent *event) { gint button_down; gdouble x, y; diff --git a/widgets/misc/e-cell-renderer-combo.c b/widgets/misc/e-cell-renderer-combo.c index 5994c075c5..07382b9225 100644 --- a/widgets/misc/e-cell-renderer-combo.c +++ b/widgets/misc/e-cell-renderer-combo.c @@ -44,7 +44,8 @@ G_DEFINE_TYPE ( GTK_TYPE_CELL_RENDERER_TEXT) static void -ecrc_editing_done (GtkCellEditable *editable, ECellRendererCombo *cell) +ecrc_editing_done (GtkCellEditable *editable, + ECellRendererCombo *cell) { const gchar *new_text; @@ -59,8 +60,13 @@ ecrc_editing_done (GtkCellEditable *editable, ECellRendererCombo *cell) } static GtkCellEditable * -ecrc_start_editing (GtkCellRenderer *cell, GdkEvent *event, GtkWidget *widget, const gchar *path, - const GdkRectangle *bg_area, const GdkRectangle *cell_area, GtkCellRendererState flags) +ecrc_start_editing (GtkCellRenderer *cell, + GdkEvent *event, + GtkWidget *widget, + const gchar *path, + const GdkRectangle *bg_area, + const GdkRectangle *cell_area, + GtkCellRendererState flags) { ECellRendererCombo *combo_cell = E_CELL_RENDERER_COMBO (cell); GtkCellRendererText *text_cell = GTK_CELL_RENDERER_TEXT (cell); @@ -91,8 +97,13 @@ ecrc_start_editing (GtkCellRenderer *cell, GdkEvent *event, GtkWidget *widget, c } static void -ecrc_get_size (GtkCellRenderer *cell, GtkWidget *widget, const GdkRectangle *cell_area, - gint *x_offset, gint *y_offset, gint *width, gint *height) +ecrc_get_size (GtkCellRenderer *cell, + GtkWidget *widget, + const GdkRectangle *cell_area, + gint *x_offset, + gint *y_offset, + gint *width, + gint *height) { GtkWidget *btn; GtkRequisition req; @@ -108,11 +119,14 @@ ecrc_get_size (GtkCellRenderer *cell, GtkWidget *widget, const GdkRectangle *cel } static void -ecrc_get_prop (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +ecrc_get_prop (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { ECellRendererCombo *ecrc = E_CELL_RENDERER_COMBO (object); - switch (prop_id) { + switch (property_id) { case PROP_LIST: g_value_set_pointer (value, ecrc->priv->list); break; @@ -122,11 +136,14 @@ ecrc_get_prop (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) } static void -ecrc_set_prop (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +ecrc_set_prop (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { ECellRendererCombo *ecrc = E_CELL_RENDERER_COMBO (object); - switch (prop_id) { + switch (property_id) { case PROP_LIST: ecrc->priv->list = g_value_get_pointer (value); break; diff --git a/widgets/misc/e-combo-cell-editable.c b/widgets/misc/e-combo-cell-editable.c index 49ce7ce733..00a8382833 100644 --- a/widgets/misc/e-combo-cell-editable.c +++ b/widgets/misc/e-combo-cell-editable.c @@ -61,7 +61,9 @@ kill_popup (EComboCellEditable *ecce) } static gboolean -popup_key_press_cb (GtkWidget *widget, GdkEventKey *event, EComboCellEditable *ecce) +popup_key_press_cb (GtkWidget *widget, + GdkEventKey *event, + EComboCellEditable *ecce) { switch (event->keyval) { case GDK_KEY_Escape: @@ -83,7 +85,9 @@ popup_key_press_cb (GtkWidget *widget, GdkEventKey *event, EComboCellEditable *e } static gboolean -popup_button_press_cb (GtkWidget *widget, GdkEventButton *event, EComboCellEditable *ecce) +popup_button_press_cb (GtkWidget *widget, + GdkEventButton *event, + EComboCellEditable *ecce) { GtkAllocation alloc; GdkWindow *window; @@ -110,14 +114,17 @@ popup_button_press_cb (GtkWidget *widget, GdkEventButton *event, EComboCellEdita } static gboolean -tree_button_release_cb (GtkWidget *widget, GdkEventButton *event, EComboCellEditable *ecce) +tree_button_release_cb (GtkWidget *widget, + GdkEventButton *event, + EComboCellEditable *ecce) { kill_popup (ecce); return TRUE; } static void -selection_changed_cb (GtkTreeSelection *selection, EComboCellEditable *ecce) +selection_changed_cb (GtkTreeSelection *selection, + EComboCellEditable *ecce) { GtkTreeModel *model; GtkTreeIter iter; @@ -179,7 +186,8 @@ build_popup (EComboCellEditable *ecce) } static gint -lookup_row (GList *list, const gchar *text) +lookup_row (GList *list, + const gchar *text) { GList *l; gint result = 0; @@ -192,7 +200,8 @@ lookup_row (GList *list, const gchar *text) } static void -set_cursor (GtkTreeView *tree_view, gint index) +set_cursor (GtkTreeView *tree_view, + gint index) { GtkTreePath *path = gtk_tree_path_new (); gtk_tree_path_append_index (path, index); @@ -210,7 +219,10 @@ grab_popup (GdkWindow *popup) } static void -position_popup (EComboCellEditable *ecce, gint x, gint y, gint offset) +position_popup (EComboCellEditable *ecce, + gint x, + gint y, + gint offset) { GtkRequisition req; @@ -258,7 +270,8 @@ show_popup (EComboCellEditable *ecce) } static void -button_clicked_cb (GtkButton *btn, EComboCellEditable *ecce) +button_clicked_cb (GtkButton *btn, + EComboCellEditable *ecce) { if (ecce->priv->popup) { kill_popup (ecce); @@ -269,14 +282,17 @@ button_clicked_cb (GtkButton *btn, EComboCellEditable *ecce) } static void -entry_activated_cb (GtkEntry *entry, EComboCellEditable *widget) +entry_activated_cb (GtkEntry *entry, + EComboCellEditable *widget) { gtk_cell_editable_editing_done (GTK_CELL_EDITABLE (widget)); gtk_cell_editable_remove_widget (GTK_CELL_EDITABLE (widget)); } static gboolean -entry_key_press_event_cb (GtkEntry *entry, GdkEventKey *key_event, EComboCellEditable *ecce) +entry_key_press_event_cb (GtkEntry *entry, + GdkEventKey *key_event, + EComboCellEditable *ecce) { if (key_event->keyval == GDK_KEY_Escape) { ecce->priv->cancelled = TRUE; @@ -297,7 +313,8 @@ entry_key_press_event_cb (GtkEntry *entry, GdkEventKey *key_event, EComboCellEdi } static void -ecce_start_editing (GtkCellEditable *cell_editable, GdkEvent *event) +ecce_start_editing (GtkCellEditable *cell_editable, + GdkEvent *event) { EComboCellEditable *ecce = E_COMBO_CELL_EDITABLE (cell_editable); @@ -383,7 +400,8 @@ e_combo_cell_editable_get_list (EComboCellEditable *ecce) } void -e_combo_cell_editable_set_list (EComboCellEditable *ecce, GList *list) +e_combo_cell_editable_set_list (EComboCellEditable *ecce, + GList *list) { g_return_if_fail (E_IS_COMBO_CELL_EDITABLE (ecce)); @@ -399,7 +417,8 @@ e_combo_cell_editable_get_text (EComboCellEditable *ecce) } void -e_combo_cell_editable_set_text (EComboCellEditable *ecce, const gchar *text) +e_combo_cell_editable_set_text (EComboCellEditable *ecce, + const gchar *text) { g_return_if_fail (E_IS_COMBO_CELL_EDITABLE (ecce)); diff --git a/widgets/misc/e-contact-map-window.c b/widgets/misc/e-contact-map-window.c index 2984d4094d..9612f0d6ac 100644 --- a/widgets/misc/e-contact-map-window.c +++ b/widgets/misc/e-contact-map-window.c @@ -99,7 +99,7 @@ book_contacts_received_cb (GObject *source_object, for (p = contacts; p; p = p->next) e_contact_map_add_contact ( - window->priv->map, (EContact*) p->data); + window->priv->map, (EContact *) p->data); e_client_util_free_object_slist (contacts); g_object_unref (client); @@ -254,7 +254,7 @@ contact_map_window_entry_key_pressed_cb (GtkWidget *entry, static gboolean entry_completion_match_selected_cb (GtkEntryCompletion *widget, - GtkTreeModel* model, + GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data) { @@ -456,7 +456,7 @@ e_contact_map_window_load_addressbook (EContactMapWindow *map, g_return_if_fail (E_IS_BOOK_CLIENT (book_client)); /* Reference book, so that it does not get deleted before the callback is - involved. The book is unrefed in the callback */ + * involved. The book is unrefed in the callback */ g_object_ref (book_client); book_query = e_book_query_field_exists (E_CONTACT_ADDRESS); @@ -470,7 +470,7 @@ e_contact_map_window_load_addressbook (EContactMapWindow *map, g_free (query_string); } -EContactMap* +EContactMap * e_contact_map_window_get_map (EContactMapWindow *window) { g_return_val_if_fail (E_IS_CONTACT_MAP_WINDOW (window), NULL); diff --git a/widgets/misc/e-contact-map-window.h b/widgets/misc/e-contact-map-window.h index ea92d75c46..a73ce47e46 100644 --- a/widgets/misc/e-contact-map-window.h +++ b/widgets/misc/e-contact-map-window.h @@ -65,12 +65,12 @@ struct _EContactMapWindowClass { }; GType e_contact_map_window_get_type (void) G_GNUC_CONST; -EContactMapWindow* e_contact_map_window_new (void); +EContactMapWindow * e_contact_map_window_new (void); void e_contact_map_window_load_addressbook (EContactMapWindow *window, EBookClient *book); -EContactMap* e_contact_map_window_get_map (EContactMapWindow *window); +EContactMap * e_contact_map_window_get_map (EContactMapWindow *window); G_END_DECLS diff --git a/widgets/misc/e-contact-map.c b/widgets/misc/e-contact-map.c index dfe5454011..500600de7c 100644 --- a/widgets/misc/e-contact-map.c +++ b/widgets/misc/e-contact-map.c @@ -83,13 +83,13 @@ contact_map_geocode_address (EContactAddress *address) static void contact_map_address_resolved_cb (GeoclueGeocode *geocode, - GeocluePositionFields fields, - double latitude, - double longitude, - double altitude, - GeoclueAccuracy *accuracy, - GError *error, - struct GeoclueCallbackData *data) + GeocluePositionFields fields, + double latitude, + double longitude, + double altitude, + GeoclueAccuracy *accuracy, + GError *error, + struct GeoclueCallbackData *data) { EContactMapPrivate *priv; gpointer marker_ptr; @@ -101,8 +101,8 @@ contact_map_address_resolved_cb (GeoclueGeocode *geocode, g_return_if_fail (data->marker && E_IS_CONTACT_MARKER (data->marker)); /* If the marker_layer does not exist anymore, the map has probably been destroyed before this - callback was launched. It's not a failure, just silently clean up what was left behind - a pretend nothing happend */ + * callback was launched. It's not a failure, just silently clean up what was left behind + * a pretend nothing happend */ if (!data->map->priv->marker_layer || !CHAMPLAIN_IS_MARKER_LAYER (data->map->priv->marker_layer)) { goto exit; @@ -150,8 +150,8 @@ exit: static void resolve_marker_position (EContactMap *map, - EContactMarker *marker, - EContactAddress *address) + EContactMarker *marker, + EContactAddress *address) { GHashTable *details; @@ -166,7 +166,7 @@ resolve_marker_position (EContactMap *map, callback_data->marker = marker; /* Make sure the map won't cease to exist before the address - is resolved */ + * is resolved */ g_object_ref (map); geocoder = geoclue_geocode_new ("org.freedesktop.Geoclue.Providers.Yahoo", @@ -268,7 +268,7 @@ e_contact_map_init (EContactMap *map) map->priv->marker_layer = layer; } -GtkWidget* +GtkWidget * e_contact_map_new (void) { return g_object_new ( @@ -277,7 +277,7 @@ e_contact_map_new (void) void e_contact_map_add_contact (EContactMap *map, - EContact *contact) + EContact *contact) { EContactAddress *address; EContactPhoto *photo; @@ -312,10 +312,10 @@ e_contact_map_add_contact (EContactMap *map, void e_contact_map_add_marker (EContactMap *map, - const gchar *name, - const gchar *contact_uid, - EContactAddress *address, - EContactPhoto *photo) + const gchar *name, + const gchar *contact_uid, + EContactAddress *address, + EContactPhoto *photo) { EContactMarker *marker; @@ -335,7 +335,7 @@ e_contact_map_add_marker (EContactMap *map, */ void e_contact_map_remove_contact (EContactMap *map, - const gchar *name) + const gchar *name) { ChamplainMarker *marker; @@ -353,7 +353,7 @@ e_contact_map_remove_contact (EContactMap *map, void e_contact_map_remove_marker (EContactMap *map, - ClutterActor *marker) + ClutterActor *marker) { const gchar *name; @@ -367,7 +367,7 @@ e_contact_map_remove_marker (EContactMap *map, void e_contact_map_zoom_on_marker (EContactMap *map, - ClutterActor *marker) + ClutterActor *marker) { ChamplainView *view; gdouble lat, lng; @@ -384,7 +384,7 @@ e_contact_map_zoom_on_marker (EContactMap *map, champlain_view_set_zoom_level (view, 15); } -ChamplainView* +ChamplainView * e_contact_map_get_view (EContactMap *map) { g_return_val_if_fail (E_IS_CONTACT_MAP (map), NULL); diff --git a/widgets/misc/e-contact-map.h b/widgets/misc/e-contact-map.h index f2f98f72b6..a5ff813ad8 100644 --- a/widgets/misc/e-contact-map.h +++ b/widgets/misc/e-contact-map.h @@ -97,7 +97,7 @@ void e_contact_map_remove_marker (EContactMap *map, void e_contact_map_zoom_on_marker (EContactMap *map, ClutterActor *marker); -ChamplainView* e_contact_map_get_view (EContactMap *map); +ChamplainView * e_contact_map_get_view (EContactMap *map); G_END_DECLS diff --git a/widgets/misc/e-contact-marker.c b/widgets/misc/e-contact-marker.c index b5781c8c3b..7d7f57db25 100644 --- a/widgets/misc/e-contact-marker.c +++ b/widgets/misc/e-contact-marker.c @@ -74,8 +74,8 @@ static ClutterColor DEFAULT_COLOR = { 0x33, 0x33, 0x33, 0xff }; static gboolean contact_marker_clicked_cb (ClutterActor *actor, - ClutterEvent *event, - gpointer user_data) + ClutterEvent *event, + gpointer user_data) { gint click_count = clutter_event_get_click_count (event); @@ -87,7 +87,7 @@ contact_marker_clicked_cb (ClutterActor *actor, static ClutterActor * texture_new_from_pixbuf (GdkPixbuf *pixbuf, - GError **error) + GError **error) { ClutterActor *texture = NULL; const guchar *data; @@ -114,7 +114,7 @@ texture_new_from_pixbuf (GdkPixbuf *pixbuf, return texture; } -static ClutterActor* +static ClutterActor * contact_photo_to_texture (EContactPhoto *photo) { GdkPixbuf *pixbuf; @@ -168,9 +168,9 @@ contact_photo_to_texture (EContactPhoto *photo) static void draw_box (cairo_t *cr, - gint width, - gint height, - gint point) + gint width, + gint height, + gint point) { cairo_move_to (cr, RADIUS, 0); cairo_line_to (cr, width - RADIUS, 0); @@ -185,9 +185,9 @@ draw_box (cairo_t *cr, static void draw_shadow (EContactMarker *marker, - gint width, - gint height, - gint point) + gint width, + gint height, + gint point) { EContactMarkerPrivate *priv = marker->priv; ClutterActor *shadow = NULL; @@ -232,9 +232,9 @@ draw_shadow (EContactMarker *marker, static void draw_background (EContactMarker *marker, - gint width, - gint height, - gint point) + gint width, + gint height, + gint point) { EContactMarkerPrivate *priv = marker->priv; ClutterActor *bg = NULL; @@ -295,7 +295,7 @@ draw_marker (EContactMarker *marker) ClutterText *text; if (priv->image) { - clutter_actor_set_position (priv->image, 2*PADDING, 2*PADDING); + clutter_actor_set_position (priv->image, 2 *PADDING, 2 *PADDING); if (clutter_actor_get_parent (priv->image) == NULL) clutter_container_add_actor ( CLUTTER_CONTAINER (priv->content_group), @@ -326,14 +326,14 @@ draw_marker (EContactMarker *marker) if (priv->image) { clutter_actor_set_width (priv->text_actor, clutter_actor_get_width (priv->image)); - total_height = clutter_actor_get_height (priv->image) + 2*PADDING + - clutter_actor_get_height (priv->text_actor) + 2*PADDING; - total_width = clutter_actor_get_width (priv->image) + 4*PADDING; + total_height = clutter_actor_get_height (priv->image) + 2 *PADDING + + clutter_actor_get_height (priv->text_actor) + 2 *PADDING; + total_width = clutter_actor_get_width (priv->image) + 4 *PADDING; clutter_actor_set_position (priv->text_actor, PADDING, - clutter_actor_get_height (priv->image)+2*PADDING+3); + clutter_actor_get_height (priv->image) + 2 *PADDING + 3); } else { - total_height = clutter_actor_get_height (priv->text_actor) + 2*PADDING; - total_width = clutter_actor_get_width (priv->text_actor) + 4*PADDING; + total_height = clutter_actor_get_height (priv->text_actor) + 2 *PADDING; + total_width = clutter_actor_get_width (priv->text_actor) + 4 *PADDING; clutter_actor_set_position (priv->text_actor, 2 * PADDING, PADDING); } @@ -395,8 +395,8 @@ queue_redraw (EContactMarker *marker) static void allocate (ClutterActor *self, - const ClutterActorBox *box, - ClutterAllocationFlags flags) + const ClutterActorBox *box, + ClutterAllocationFlags flags) { ClutterActorBox child_box; EContactMarkerPrivate *priv = E_CONTACT_MARKER (self)->priv; @@ -473,8 +473,8 @@ pick (ClutterActor *self, static void notify_selected (GObject *gobject, - G_GNUC_UNUSED GParamSpec *pspec, - G_GNUC_UNUSED gpointer user_data) + G_GNUC_UNUSED GParamSpec *pspec, + G_GNUC_UNUSED gpointer user_data) { queue_redraw (E_CONTACT_MARKER (gobject)); } @@ -573,8 +573,8 @@ e_contact_marker_init (EContactMarker *marker) ClutterActor * e_contact_marker_new (const gchar *name, - const gchar *contact_uid, - EContactPhoto *photo) + const gchar *contact_uid, + EContactPhoto *photo) { ClutterActor *marker = CLUTTER_ACTOR (g_object_new (E_TYPE_CONTACT_MARKER, NULL)); EContactMarkerPrivate *priv = E_CONTACT_MARKER (marker)->priv; diff --git a/widgets/misc/e-contact-marker.h b/widgets/misc/e-contact-marker.h index 7b332b15e7..996e922e1c 100644 --- a/widgets/misc/e-contact-marker.h +++ b/widgets/misc/e-contact-marker.h @@ -71,7 +71,7 @@ struct _EContactMarkerClass GType e_contact_marker_get_type (void); -ClutterActor* e_contact_marker_new (const gchar *name, +ClutterActor * e_contact_marker_new (const gchar *name, const gchar *contact_uid, EContactPhoto *photo); diff --git a/widgets/misc/e-dateedit.c b/widgets/misc/e-dateedit.c index acc3c08fe5..2a9eb7f457 100644 --- a/widgets/misc/e-dateedit.c +++ b/widgets/misc/e-dateedit.c @@ -56,7 +56,7 @@ struct _EDateEditPrivate { GtkWidget *now_button; GtkWidget *today_button; GtkWidget *none_button; /* This will only be visible if a - 'None' date/time is permitted. */ + * 'None' date/time is permitted. */ gboolean show_date; gboolean show_time; @@ -79,8 +79,8 @@ struct _EDateEditPrivate { gboolean date_is_valid; /* This is the last valid date which was set. If the date was set to - 'None' or empty, date_set_to_none will be TRUE and the other fields - are undefined, so don't use them. */ + * 'None' or empty, date_set_to_none will be TRUE and the other fields + * are undefined, so don't use them. */ gboolean date_set_to_none; gint year; gint month; @@ -95,8 +95,8 @@ struct _EDateEditPrivate { gboolean time_is_valid; /* This is the last valid time which was set. If the time was set to - 'None' or empty, time_set_to_none will be TRUE and the other fields - are undefined, so don't use them. */ + * 'None' or empty, time_set_to_none will be TRUE and the other fields + * are undefined, so don't use them. */ gboolean time_set_to_none; gint hour; gint minute; @@ -491,7 +491,7 @@ e_date_edit_init (EDateEdit *dedit) * Returns: a new #EDateEdit widget. */ GtkWidget * -e_date_edit_new (void) +e_date_edit_new (void) { EDateEdit *dedit; AtkObject *a11y; @@ -504,7 +504,7 @@ e_date_edit_new (void) } static void -create_children (EDateEdit *dedit) +create_children (EDateEdit *dedit) { EDateEditPrivate *priv; ECalendar *calendar; @@ -673,7 +673,7 @@ create_children (EDateEdit *dedit) G_CALLBACK (on_date_popup_today_button_clicked), dedit); /* Note that we don't show this here, since by default a 'None' date - is not permitted. */ + * is not permitted. */ priv->none_button = gtk_button_new_with_mnemonic (_("_None")); gtk_container_add (GTK_CONTAINER (bbox), priv->none_button); g_signal_connect (priv->none_button, "clicked", @@ -686,16 +686,17 @@ create_children (EDateEdit *dedit) /* GtkWidget::mnemonic_activate() handler for the EDateEdit */ static gboolean -e_date_edit_mnemonic_activate (GtkWidget *widget, gboolean group_cycling) +e_date_edit_mnemonic_activate (GtkWidget *widget, + gboolean group_cycling) { e_date_edit_grab_focus (widget); return TRUE; } /* Grab_focus handler for the EDateEdit. If the date field is being shown, we - grab the focus to that, otherwise we grab it to the time field. */ + * grab the focus to that, otherwise we grab it to the time field. */ static void -e_date_edit_grab_focus (GtkWidget *widget) +e_date_edit_grab_focus (GtkWidget *widget) { EDateEdit *dedit; GtkWidget *child; @@ -721,7 +722,8 @@ e_date_edit_grab_focus (GtkWidget *widget) * date from the GtkEntry. */ void -e_date_edit_set_editable (EDateEdit *dedit, gboolean editable) +e_date_edit_set_editable (EDateEdit *dedit, + gboolean editable) { EDateEditPrivate *priv; @@ -746,7 +748,7 @@ e_date_edit_set_editable (EDateEdit *dedit, gboolean editable) * check this with e_date_edit_time_is_valid(). */ time_t -e_date_edit_get_time (EDateEdit *dedit) +e_date_edit_get_time (EDateEdit *dedit) { EDateEditPrivate *priv; struct tm tmp_tm = { 0 }; @@ -793,8 +795,8 @@ e_date_edit_get_time (EDateEdit *dedit) * e_date_edit_set_date() and e_date_edit_set_time_of_day() instead. */ void -e_date_edit_set_time (EDateEdit *dedit, - time_t the_time) +e_date_edit_set_time (EDateEdit *dedit, + time_t the_time) { EDateEditPrivate *priv; struct tm tmp_tm; @@ -852,10 +854,10 @@ e_date_edit_set_time (EDateEdit *dedit, * Returns the last valid date entered into the date field. */ gboolean -e_date_edit_get_date (EDateEdit *dedit, - gint *year, - gint *month, - gint *day) +e_date_edit_get_date (EDateEdit *dedit, + gint *year, + gint *month, + gint *day) { EDateEditPrivate *priv; @@ -887,10 +889,10 @@ e_date_edit_get_date (EDateEdit *dedit, * Sets the date in the date field. */ void -e_date_edit_set_date (EDateEdit *dedit, - gint year, - gint month, - gint day) +e_date_edit_set_date (EDateEdit *dedit, + gint year, + gint month, + gint day) { gboolean date_changed = FALSE; @@ -918,9 +920,9 @@ e_date_edit_set_date (EDateEdit *dedit, * Returns the last valid time entered into the time field. */ gboolean -e_date_edit_get_time_of_day (EDateEdit *dedit, - gint *hour, - gint *minute) +e_date_edit_get_time_of_day (EDateEdit *dedit, + gint *hour, + gint *minute) { EDateEditPrivate *priv; @@ -951,9 +953,9 @@ e_date_edit_get_time_of_day (EDateEdit *dedit, * Description: Sets the time in the time field. */ void -e_date_edit_set_time_of_day (EDateEdit *dedit, - gint hour, - gint minute) +e_date_edit_set_time_of_day (EDateEdit *dedit, + gint hour, + gint minute) { EDateEditPrivate *priv; gboolean time_changed = FALSE; @@ -985,12 +987,12 @@ e_date_edit_set_time_of_day (EDateEdit *dedit, } void -e_date_edit_set_date_and_time_of_day (EDateEdit *dedit, - gint year, - gint month, - gint day, - gint hour, - gint minute) +e_date_edit_set_date_and_time_of_day (EDateEdit *dedit, + gint year, + gint month, + gint day, + gint hour, + gint minute) { gboolean date_changed, time_changed; @@ -1017,7 +1019,7 @@ e_date_edit_set_date_and_time_of_day (EDateEdit *dedit, * Description: Returns TRUE if the date field is currently shown. */ gboolean -e_date_edit_get_show_date (EDateEdit *dedit) +e_date_edit_get_show_date (EDateEdit *dedit) { g_return_val_if_fail (E_IS_DATE_EDIT (dedit), TRUE); @@ -1033,8 +1035,8 @@ e_date_edit_get_show_date (EDateEdit *dedit) * field would be hidden if only a time needed to be entered. */ void -e_date_edit_set_show_date (EDateEdit *dedit, - gboolean show_date) +e_date_edit_set_show_date (EDateEdit *dedit, + gboolean show_date) { EDateEditPrivate *priv; @@ -1074,7 +1076,7 @@ e_date_edit_set_show_date (EDateEdit *dedit, * Description: Returns TRUE if the time field is currently shown. */ gboolean -e_date_edit_get_show_time (EDateEdit *dedit) +e_date_edit_get_show_time (EDateEdit *dedit) { g_return_val_if_fail (E_IS_DATE_EDIT (dedit), TRUE); @@ -1090,8 +1092,8 @@ e_date_edit_get_show_time (EDateEdit *dedit) * field would be hidden if only a date needed to be entered. */ void -e_date_edit_set_show_time (EDateEdit *dedit, - gboolean show_time) +e_date_edit_set_show_time (EDateEdit *dedit, + gboolean show_time) { EDateEditPrivate *priv; @@ -1119,7 +1121,7 @@ e_date_edit_set_show_time (EDateEdit *dedit, * hiding it. */ gboolean -e_date_edit_get_make_time_insensitive (EDateEdit *dedit) +e_date_edit_get_make_time_insensitive (EDateEdit *dedit) { g_return_val_if_fail (E_IS_DATE_EDIT (dedit), TRUE); @@ -1140,8 +1142,8 @@ e_date_edit_get_make_time_insensitive (EDateEdit *dedit) * disappear as that may affect the layout of the widgets. */ void -e_date_edit_set_make_time_insensitive (EDateEdit *dedit, - gboolean make_insensitive) +e_date_edit_set_make_time_insensitive (EDateEdit *dedit, + gboolean make_insensitive) { EDateEditPrivate *priv; @@ -1255,7 +1257,7 @@ e_date_edit_set_use_24_hour_format (EDateEdit *dedit, } /* Whether we allow the date to be set to 'None'. e_date_edit_get_time() will - return (time_t) -1 in this case. */ + * return (time_t) -1 in this case. */ gboolean e_date_edit_get_allow_no_date_set (EDateEdit *dedit) { @@ -1274,8 +1276,8 @@ e_date_edit_set_allow_no_date_set (EDateEdit *dedit, if (!allow_no_date_set) { /* If the date is showing, we make sure it isn't 'None' (we - don't really mind if the time is empty), else if just the - time is showing we make sure it isn't 'None'. */ + * don't really mind if the time is empty), else if just the + * time is showing we make sure it isn't 'None'. */ if (dedit->priv->show_date) { if (dedit->priv->date_set_to_none) e_date_edit_set_time (dedit, 0); @@ -1290,9 +1292,9 @@ e_date_edit_set_allow_no_date_set (EDateEdit *dedit, /* The range of time to show in the time combo popup. */ void -e_date_edit_get_time_popup_range (EDateEdit *dedit, - gint *lower_hour, - gint *upper_hour) +e_date_edit_get_time_popup_range (EDateEdit *dedit, + gint *lower_hour, + gint *upper_hour) { g_return_if_fail (E_IS_DATE_EDIT (dedit)); @@ -1301,9 +1303,9 @@ e_date_edit_get_time_popup_range (EDateEdit *dedit, } void -e_date_edit_set_time_popup_range (EDateEdit *dedit, - gint lower_hour, - gint upper_hour) +e_date_edit_set_time_popup_range (EDateEdit *dedit, + gint lower_hour, + gint upper_hour) { EDateEditPrivate *priv; @@ -1321,22 +1323,22 @@ e_date_edit_set_time_popup_range (EDateEdit *dedit, rebuild_time_popup (dedit); /* Setting the combo list items seems to mess up the time entry, so - we set it again. We have to reset it to its last valid time. */ + * we set it again. We have to reset it to its last valid time. */ priv->time_is_valid = TRUE; e_date_edit_update_time_entry (dedit); } /* The arrow button beside the date field has been clicked, so we show the - popup with the ECalendar in. */ + * popup with the ECalendar in. */ static void -on_date_button_clicked (GtkWidget *widget, - EDateEdit *dedit) +on_date_button_clicked (GtkWidget *widget, + EDateEdit *dedit) { e_date_edit_show_date_popup (dedit); } static void -e_date_edit_show_date_popup (EDateEdit *dedit) +e_date_edit_show_date_popup (EDateEdit *dedit) { EDateEditPrivate *priv; ECalendar *calendar; @@ -1365,7 +1367,7 @@ e_date_edit_show_date_popup (EDateEdit *dedit) } /* FIXME: Hack. Change ECalendarItem so it doesn't queue signal - emissions. */ + * emissions. */ calendar->calitem->selection_changed = FALSE; position_date_popup (dedit); @@ -1385,9 +1387,9 @@ e_date_edit_show_date_popup (EDateEdit *dedit) } /* This positions the date popup below and to the left of the arrow button, - just before it is shown. */ + * just before it is shown. */ static void -position_date_popup (EDateEdit *dedit) +position_date_popup (EDateEdit *dedit) { gint x, y; gint win_x, win_y; @@ -1427,10 +1429,10 @@ position_date_popup (EDateEdit *dedit) } /* A date has been selected in the date popup, so we set the date field - and hide the popup. */ + * and hide the popup. */ static void -on_date_popup_date_selected (ECalendarItem *calitem, - EDateEdit *dedit) +on_date_popup_date_selected (ECalendarItem *calitem, + EDateEdit *dedit) { GDate start_date, end_date; @@ -1445,16 +1447,16 @@ on_date_popup_date_selected (ECalendarItem *calitem, } static void -on_date_popup_now_button_clicked (GtkWidget *button, - EDateEdit *dedit) +on_date_popup_now_button_clicked (GtkWidget *button, + EDateEdit *dedit) { hide_date_popup (dedit); e_date_edit_set_time (dedit, 0); } static void -on_date_popup_today_button_clicked (GtkWidget *button, - EDateEdit *dedit) +on_date_popup_today_button_clicked (GtkWidget *button, + EDateEdit *dedit) { EDateEditPrivate *priv; struct tm tmp_tm; @@ -1476,19 +1478,19 @@ on_date_popup_today_button_clicked (GtkWidget *button, } static void -on_date_popup_none_button_clicked (GtkWidget *button, - EDateEdit *dedit) +on_date_popup_none_button_clicked (GtkWidget *button, + EDateEdit *dedit) { hide_date_popup (dedit); e_date_edit_set_time (dedit, -1); } /* A key has been pressed while the date popup is showing. If it is the Escape - key we hide the popup. */ + * key we hide the popup. */ static gint -on_date_popup_key_press (GtkWidget *widget, - GdkEventKey *event, - EDateEdit *dedit) +on_date_popup_key_press (GtkWidget *widget, + GdkEventKey *event, + EDateEdit *dedit) { GdkWindow *window; @@ -1506,13 +1508,13 @@ on_date_popup_key_press (GtkWidget *widget, } /* A mouse button has been pressed while the date popup is showing. - Any button press events used to select days etc. in the popup will have - have been handled elsewhere, so here we just hide the popup. - (This function is yanked from gtkcombo.c) */ + * Any button press events used to select days etc. in the popup will have + * have been handled elsewhere, so here we just hide the popup. + * (This function is yanked from gtkcombo.c) */ static gint -on_date_popup_button_press (GtkWidget *widget, - GdkEventButton *event, - gpointer data) +on_date_popup_button_press (GtkWidget *widget, + GdkEventButton *event, + gpointer data) { EDateEdit *dedit; GtkWidget *child; @@ -1542,10 +1544,10 @@ on_date_popup_button_press (GtkWidget *widget, } /* A delete event has been received for the date popup, so we hide it and - return TRUE so it doesn't get destroyed. */ + * return TRUE so it doesn't get destroyed. */ static gint -on_date_popup_delete_event (GtkWidget *widget, - EDateEdit *dedit) +on_date_popup_delete_event (GtkWidget *widget, + EDateEdit *dedit) { hide_date_popup (dedit); return TRUE; @@ -1553,7 +1555,7 @@ on_date_popup_delete_event (GtkWidget *widget, /* Hides the date popup, removing any grabs. */ static void -hide_date_popup (EDateEdit *dedit) +hide_date_popup (EDateEdit *dedit) { gtk_widget_hide (dedit->priv->cal_popup); gtk_grab_remove (dedit->priv->cal_popup); @@ -1562,9 +1564,9 @@ hide_date_popup (EDateEdit *dedit) } /* Clears the time popup and rebuilds it using the lower_hour, upper_hour - and use_24_hour_format settings. */ + * and use_24_hour_format settings. */ static void -rebuild_time_popup (EDateEdit *dedit) +rebuild_time_popup (EDateEdit *dedit) { EDateEditPrivate *priv; GtkTreeModel *model; @@ -1629,8 +1631,8 @@ rebuild_time_popup (EDateEdit *dedit) static gboolean e_date_edit_parse_date (EDateEdit *dedit, - const gchar *date_text, - struct tm *date_tm) + const gchar *date_text, + struct tm *date_tm) { gboolean twodigit_year = FALSE; @@ -1652,9 +1654,9 @@ e_date_edit_parse_date (EDateEdit *dedit, } static gboolean -e_date_edit_parse_time (EDateEdit *dedit, - const gchar *time_text, - struct tm *time_tm) +e_date_edit_parse_time (EDateEdit *dedit, + const gchar *time_text, + struct tm *time_tm) { if (field_set_to_none (time_text)) { time_tm->tm_hour = 0; @@ -1669,7 +1671,7 @@ e_date_edit_parse_time (EDateEdit *dedit, } /* Returns TRUE if the string is empty or is "None" in the current locale. - It ignores whitespace. */ + * It ignores whitespace. */ static gboolean field_set_to_none (const gchar *text) { @@ -1678,7 +1680,7 @@ field_set_to_none (const gchar *text) gint n; pos = text; - while (n = (gint)((guchar)*pos), isspace (n)) + while (n = (gint)((guchar) * pos), isspace (n)) pos++; /* Translators: "None" for date field of a date edit, shown when @@ -1691,15 +1693,15 @@ field_set_to_none (const gchar *text) } static void -on_date_edit_time_selected (GtkComboBox *combo, - EDateEdit *dedit) +on_date_edit_time_selected (GtkComboBox *combo, + EDateEdit *dedit) { GtkWidget *child; child = gtk_bin_get_child (GTK_BIN (combo)); /* We only want to emit signals when an item is selected explicitly, - not when it is selected by the silly combo update thing. */ + * not when it is selected by the silly combo update thing. */ if (gtk_combo_box_get_active (combo) == -1) return; @@ -1710,9 +1712,9 @@ on_date_edit_time_selected (GtkComboBox *combo, } static gint -on_date_entry_key_press (GtkWidget *widget, - GdkEventKey *event, - EDateEdit *dedit) +on_date_entry_key_press (GtkWidget *widget, + GdkEventKey *event, + EDateEdit *dedit) { if (event->state & GDK_MOD1_MASK && (event->keyval == GDK_KEY_Up || event->keyval == GDK_KEY_Down @@ -1724,7 +1726,7 @@ on_date_entry_key_press (GtkWidget *widget, } /* If the user hits the return key emit a "date_changed" signal if - needed. But let the signal carry on. */ + * needed. But let the signal carry on. */ if (event->keyval == GDK_KEY_Return) { e_date_edit_check_date_changed (dedit); return FALSE; @@ -1734,16 +1736,16 @@ on_date_entry_key_press (GtkWidget *widget, } static gint -on_time_entry_key_press (GtkWidget *widget, - GdkEventKey *event, - EDateEdit *dedit) +on_time_entry_key_press (GtkWidget *widget, + GdkEventKey *event, + EDateEdit *dedit) { GtkWidget *child; child = gtk_bin_get_child (GTK_BIN (dedit->priv->time_combo)); /* I'd like to use Alt+Up/Down for popping up the list, like Win32, - but the combo steals any Up/Down keys, so we use Alt+Return. */ + * but the combo steals any Up/Down keys, so we use Alt + Return. */ #if 0 if (event->state & GDK_MOD1_MASK && (event->keyval == GDK_KEY_Up || event->keyval == GDK_KEY_Down)) { @@ -1756,7 +1758,7 @@ on_time_entry_key_press (GtkWidget *widget, } /* Stop the return key from emitting the activate signal, and check - if we need to emit a "time_changed" signal. */ + * if we need to emit a "time_changed" signal. */ if (event->keyval == GDK_KEY_Return) { g_signal_stop_emission_by_name (widget, "key_press_event"); @@ -1768,18 +1770,18 @@ on_time_entry_key_press (GtkWidget *widget, } static gint -on_date_entry_key_release (GtkWidget *widget, - GdkEventKey *event, - EDateEdit *dedit) +on_date_entry_key_release (GtkWidget *widget, + GdkEventKey *event, + EDateEdit *dedit) { e_date_edit_check_date_changed (dedit); return TRUE; } static gint -on_time_entry_key_release (GtkWidget *widget, - GdkEventKey *event, - EDateEdit *dedit) +on_time_entry_key_release (GtkWidget *widget, + GdkEventKey *event, + EDateEdit *dedit) { if (event->keyval == GDK_KEY_Up || event->keyval == GDK_KEY_Down) { g_signal_stop_emission_by_name (widget, @@ -1792,9 +1794,9 @@ on_time_entry_key_release (GtkWidget *widget, } static gint -on_date_entry_focus_out (GtkEntry *entry, - GdkEventFocus *event, - EDateEdit *dedit) +on_date_entry_focus_out (GtkEntry *entry, + GdkEventFocus *event, + EDateEdit *dedit) { struct tm tmp_tm; GtkWidget *msg_dialog; @@ -1841,16 +1843,16 @@ on_date_entry_focus_out (GtkEntry *entry, } static gint -on_time_entry_focus_out (GtkEntry *entry, - GdkEventFocus *event, - EDateEdit *dedit) +on_time_entry_focus_out (GtkEntry *entry, + GdkEventFocus *event, + EDateEdit *dedit) { GtkWidget *msg_dialog; e_date_edit_check_time_changed (dedit); if (!e_date_edit_time_is_valid (dedit)) { - msg_dialog=gtk_message_dialog_new (NULL, + msg_dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_OK, @@ -1865,7 +1867,8 @@ on_time_entry_focus_out (GtkEntry *entry, } static void -add_relation (EDateEdit *dedit, GtkWidget *widget) +add_relation (EDateEdit *dedit, + GtkWidget *widget) { AtkObject *a11yEdit, *a11yWidget; AtkRelationSet *set; @@ -1906,7 +1909,7 @@ add_relation (EDateEdit *dedit, GtkWidget *widget) /* This sets the text in the date entry according to the current settings. */ static void -e_date_edit_update_date_entry (EDateEdit *dedit) +e_date_edit_update_date_entry (EDateEdit *dedit) { EDateEditPrivate *priv; gchar buffer[100]; @@ -2033,7 +2036,7 @@ e_date_edit_update_time_entry (EDateEdit *dedit) } static void -e_date_edit_update_time_combo_state (EDateEdit *dedit) +e_date_edit_update_time_combo_state (EDateEdit *dedit) { EDateEditPrivate *priv; gboolean show = TRUE, show_now_button = TRUE; @@ -2043,7 +2046,7 @@ e_date_edit_update_time_combo_state (EDateEdit *dedit) priv = dedit->priv; /* If the date entry is currently shown, and it is set to None, - clear the time entry and disable the time combo. */ + * clear the time entry and disable the time combo. */ if (priv->show_date && priv->date_set_to_none) { clear_entry = TRUE; sensitive = FALSE; @@ -2090,9 +2093,9 @@ e_date_edit_update_time_combo_state (EDateEdit *dedit) } /* Parses the date, and if it is different from the current settings it - updates the settings and emits a "date_changed" signal. */ + * updates the settings and emits a "date_changed" signal. */ static void -e_date_edit_check_date_changed (EDateEdit *dedit) +e_date_edit_check_date_changed (EDateEdit *dedit) { EDateEditPrivate *priv; const gchar *date_text; @@ -2127,9 +2130,9 @@ e_date_edit_check_date_changed (EDateEdit *dedit) } /* Parses the time, and if it is different from the current settings it - updates the settings and emits a "time_changed" signal. */ + * updates the settings and emits a "time_changed" signal. */ static void -e_date_edit_check_time_changed (EDateEdit *dedit) +e_date_edit_check_time_changed (EDateEdit *dedit) { EDateEditPrivate *priv; GtkWidget *child; @@ -2171,7 +2174,7 @@ e_date_edit_check_time_changed (EDateEdit *dedit) * valid. */ gboolean -e_date_edit_date_is_valid (EDateEdit *dedit) +e_date_edit_date_is_valid (EDateEdit *dedit) { g_return_val_if_fail (E_IS_DATE_EDIT (dedit), FALSE); @@ -2198,7 +2201,7 @@ e_date_edit_date_is_valid (EDateEdit *dedit) * entered which was valid. */ gboolean -e_date_edit_time_is_valid (EDateEdit *dedit) +e_date_edit_time_is_valid (EDateEdit *dedit) { g_return_val_if_fail (E_IS_DATE_EDIT (dedit), FALSE); @@ -2206,8 +2209,8 @@ e_date_edit_time_is_valid (EDateEdit *dedit) return FALSE; /* If the time is empty and that isn't permitted, return FALSE. - Note that we don't mind an empty time if the date field is shown - - in that case we just assume 0:00. */ + * Note that we don't mind an empty time if the date field is shown + * - in that case we just assume 0:00. */ if (dedit->priv->time_set_to_none && !dedit->priv->show_date && !e_date_edit_get_allow_no_date_set (dedit)) return FALSE; @@ -2233,12 +2236,12 @@ e_date_edit_have_time (EDateEdit *dedit) } static gboolean -e_date_edit_set_date_internal (EDateEdit *dedit, - gboolean valid, - gboolean none, - gint year, - gint month, - gint day) +e_date_edit_set_date_internal (EDateEdit *dedit, + gboolean valid, + gboolean none, + gint year, + gint month, + gint day) { EDateEditPrivate *priv; gboolean date_changed = FALSE; @@ -2279,11 +2282,11 @@ e_date_edit_set_date_internal (EDateEdit *dedit, } static gboolean -e_date_edit_set_time_internal (EDateEdit *dedit, - gboolean valid, - gboolean none, - gint hour, - gint minute) +e_date_edit_set_time_internal (EDateEdit *dedit, + gboolean valid, + gboolean none, + gint hour, + gint minute) { EDateEditPrivate *priv; gboolean time_changed = FALSE; @@ -2337,13 +2340,13 @@ void e_date_edit_set_twodigit_year_can_future (EDateEdit *dedit, } /* Sets a callback to use to get the current time. This is useful if the - application needs to use its own timezone data rather than rely on the - Unix timezone. */ + * application needs to use its own timezone data rather than rely on the + * Unix timezone. */ void -e_date_edit_set_get_time_callback (EDateEdit *dedit, - EDateEditGetTimeCallback cb, - gpointer data, - GDestroyNotify destroy) +e_date_edit_set_get_time_callback (EDateEdit *dedit, + EDateEditGetTimeCallback cb, + gpointer data, + GDestroyNotify destroy) { EDateEditPrivate *priv; @@ -2361,7 +2364,7 @@ e_date_edit_set_get_time_callback (EDateEdit *dedit, } GtkWidget * -e_date_edit_get_entry (EDateEdit *dedit) +e_date_edit_get_entry (EDateEdit *dedit) { EDateEditPrivate *priv; priv = dedit->priv; diff --git a/widgets/misc/e-dateedit.h b/widgets/misc/e-dateedit.h index 28032dd8c9..f490a5f359 100644 --- a/widgets/misc/e-dateedit.h +++ b/widgets/misc/e-dateedit.h @@ -73,15 +73,15 @@ struct _EDateEditClass { }; GType e_date_edit_get_type (void); -GtkWidget* e_date_edit_new (void); +GtkWidget * e_date_edit_new (void); /* Analogous to gtk_editable_set_editable. disable editing, while still - allowing selection. */ + * allowing selection. */ void e_date_edit_set_editable (EDateEdit *dedit, gboolean editable); /* Returns TRUE if the last date and time set were valid. The date and time - are only set when the user hits Return or switches keyboard focus, or - selects a date or time from the popup. */ + * are only set when the user hits Return or switches keyboard focus, or + * selects a date or time from the popup. */ gboolean e_date_edit_date_is_valid (EDateEdit *dedit); gboolean e_date_edit_time_is_valid (EDateEdit *dedit); @@ -89,14 +89,14 @@ gboolean e_date_edit_time_is_valid (EDateEdit *dedit); gboolean e_date_edit_have_time (EDateEdit *dedit); /* Returns the last valid date & time set, or -1 if the date & time was set to - 'None' and this is permitted via e_date_edit_set_allow_no_date_set. */ + * 'None' and this is permitted via e_date_edit_set_allow_no_date_set. */ time_t e_date_edit_get_time (EDateEdit *dedit); void e_date_edit_set_time (EDateEdit *dedit, time_t the_time); /* This returns the last valid date set, without the time. It returns TRUE - if a date is set, or FALSE if the date is set to 'None' and this is - permitted via e_date_edit_set_allow_no_date_set. (Month is 1 - 12). */ + * if a date is set, or FALSE if the date is set to 'None' and this is + * permitted via e_date_edit_set_allow_no_date_set. (Month is 1 - 12). */ gboolean e_date_edit_get_date (EDateEdit *dedit, gint *year, gint *month, @@ -107,8 +107,8 @@ void e_date_edit_set_date (EDateEdit *dedit, gint day); /* This returns the last valid time set, without the date. It returns TRUE - if a time is set, or FALSE if the time is set to 'None' and this is - permitted via e_date_edit_set_allow_no_date_set. */ + * if a time is set, or FALSE if the time is set to 'None' and this is + * permitted via e_date_edit_set_allow_no_date_set. */ gboolean e_date_edit_get_time_of_day (EDateEdit *dedit, gint *hour, gint *minute); @@ -150,7 +150,7 @@ void e_date_edit_set_use_24_hour_format (EDateEdit *dedit, gboolean use_24_hour_format); /* Whether we allow the date to be set to 'None'. e_date_edit_get_time() will - return (time_t) -1 in this case. */ + * return (time_t) -1 in this case. */ gboolean e_date_edit_get_allow_no_date_set (EDateEdit *dedit); void e_date_edit_set_allow_no_date_set (EDateEdit *dedit, gboolean allow_no_date_set); @@ -174,13 +174,13 @@ void e_date_edit_set_twodigit_year_can_future (EDateEdit *dedit, gboolean value); /* Sets a callback to use to get the current time. This is useful if the - application needs to use its own timezone data rather than rely on the - Unix timezone. */ + * application needs to use its own timezone data rather than rely on the + * Unix timezone. */ void e_date_edit_set_get_time_callback (EDateEdit *dedit, EDateEditGetTimeCallback cb, gpointer data, GDestroyNotify destroy); -GtkWidget* e_date_edit_get_entry (EDateEdit *dedit); +GtkWidget * e_date_edit_get_entry (EDateEdit *dedit); #endif diff --git a/widgets/misc/e-import-assistant.c b/widgets/misc/e-import-assistant.c index 69cf847ae5..06dff88e29 100644 --- a/widgets/misc/e-import-assistant.c +++ b/widgets/misc/e-import-assistant.c @@ -159,7 +159,7 @@ filename_changed (GtkWidget *widget, gboolean valid; GSList *l; EImportImporter *first = NULL; - gint i=0, firstitem=0; + gint i = 0, firstitem = 0; g_free (page->target->uri_src); page->target->uri_src = g_filename_to_uri (filename, NULL, NULL); @@ -541,7 +541,7 @@ prepare_intelligent_page (GtkAssistant *assistant, table = gtk_table_new (g_slist_length (l), 2, FALSE); row = 0; - for (;l;l=l->next) { + for (; l; l = l->next) { EImportImporter *eii = l->data; gchar *str; GtkWidget *w, *label; @@ -558,11 +558,11 @@ prepare_intelligent_page (GtkAssistant *assistant, gtk_table_attach ( GTK_TABLE (table), label, - 0, 1, row, row+1, GTK_FILL, 0, 0, 0); + 0, 1, row, row + 1, GTK_FILL, 0, 0, 0); if (w) gtk_table_attach ( GTK_TABLE (table), w, - 1, 2, row, row+1, GTK_FILL, 0, 3, 0); + 1, 2, row, row + 1, GTK_FILL, 0, 3, 0); row++; } @@ -597,7 +597,8 @@ import_done (EImport *ei, } static void -import_simple_done (EImport *ei, gpointer user_data) +import_simple_done (EImport *ei, + gpointer user_data) { EImportAssistant *import_assistant = user_data; EImportAssistantPrivate *priv; @@ -775,7 +776,7 @@ prepare_progress_page (GtkAssistant *assistant, gtk_assistant_add_action_widget (assistant, cancel_button); gtk_widget_show (cancel_button); - g_object_get (G_OBJECT (assistant), "is-simple", &is_simple, NULL); + g_object_get (assistant, "is-simple", &is_simple, NULL); intelligent_import = is_simple ? FALSE : gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON (priv->type_page.intelligent)); @@ -809,7 +810,8 @@ prepare_progress_page (GtkAssistant *assistant, } static void -simple_filetype_changed_cb (GtkComboBox *combo_box, GtkAssistant *assistant) +simple_filetype_changed_cb (GtkComboBox *combo_box, + GtkAssistant *assistant) { EImportAssistantPrivate *priv; ImportSimplePage *page; @@ -853,7 +855,8 @@ simple_filetype_changed_cb (GtkComboBox *combo_box, GtkAssistant *assistant) } static void -prepare_simple_page (GtkAssistant *assistant, GtkWidget *vbox) +prepare_simple_page (GtkAssistant *assistant, + GtkWidget *vbox) { EImportAssistantPrivate *priv; GSList *importers, *imp; @@ -963,7 +966,7 @@ forward_cb (gint current_page, GtkToggleButton *toggle_button; gboolean is_simple = FALSE; - g_object_get (G_OBJECT (import_assistant), "is-simple", &is_simple, NULL); + g_object_get (import_assistant, "is-simple", &is_simple, NULL); if (is_simple) { if (!import_assistant->priv->simple_page.has_preview) @@ -1036,7 +1039,7 @@ set_import_uris (EImportAssistant *assistant, if (importers != NULL) { /* there is at least one importer which can be used, - thus there can be done an import */ + * thus there can be done an import */ fileuris = g_ptr_array_new (); } @@ -1175,7 +1178,7 @@ import_assistant_prepare (GtkAssistant *assistant, gint page_no = gtk_assistant_get_current_page (assistant); gboolean is_simple = FALSE; - g_object_get (G_OBJECT (assistant), "is-simple", &is_simple, NULL); + g_object_get (assistant, "is-simple", &is_simple, NULL); if (is_simple) { if (page_no == 0) { diff --git a/widgets/misc/e-map.c b/widgets/misc/e-map.c index dd02486a43..a239709415 100644 --- a/widgets/misc/e-map.c +++ b/widgets/misc/e-map.c @@ -155,7 +155,8 @@ e_map_stop_tweening (EMap *map) } static void -e_map_tween_destroy (EMap *map, EMapTween *tween) +e_map_tween_destroy (EMap *map, + EMapTween *tween) { map->priv->tweens = g_slist_remove (map->priv->tweens, tween); g_slice_free (EMapTween, tween); @@ -313,7 +314,8 @@ e_map_apply_tween (EMapTween *tween, } static void -e_map_tweens_compute_matrix (EMap *map, cairo_matrix_t *matrix) +e_map_tweens_compute_matrix (EMap *map, + cairo_matrix_t *matrix) { GSList *walk; gdouble zoom, x, y, latitude, longitude, effect; @@ -348,7 +350,8 @@ e_map_tweens_compute_matrix (EMap *map, cairo_matrix_t *matrix) /* GtkScrollable implementation */ static void -e_map_adjustment_changed (GtkAdjustment *adjustment, EMap *map) +e_map_adjustment_changed (GtkAdjustment *adjustment, + EMap *map) { EMapPrivate *priv = map->priv; @@ -420,7 +423,8 @@ e_map_set_vadjustment_values (EMap *map) } static void -e_map_set_hadjustment (EMap *map, GtkAdjustment *adjustment) +e_map_set_hadjustment (EMap *map, + GtkAdjustment *adjustment) { EMapPrivate *priv = map->priv; @@ -447,7 +451,8 @@ e_map_set_hadjustment (EMap *map, GtkAdjustment *adjustment) } static void -e_map_set_vadjustment (EMap *map, GtkAdjustment *adjustment) +e_map_set_vadjustment (EMap *map, + GtkAdjustment *adjustment) { EMapPrivate *priv = map->priv; @@ -479,7 +484,7 @@ e_map_set_vadjustment (EMap *map, GtkAdjustment *adjustment) static void e_map_set_property (GObject *object, - guint prop_id, + guint property_id, const GValue *value, GParamSpec *pspec) { @@ -487,7 +492,7 @@ e_map_set_property (GObject *object, map = E_MAP (object); - switch (prop_id) { + switch (property_id) { case PROP_HADJUSTMENT: e_map_set_hadjustment (map, g_value_get_object (value)); break; @@ -504,14 +509,14 @@ e_map_set_property (GObject *object, break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void e_map_get_property (GObject *object, - guint prop_id, + guint property_id, GValue *value, GParamSpec *pspec) { @@ -519,7 +524,7 @@ e_map_get_property (GObject *object, map = E_MAP (object); - switch (prop_id) { + switch (property_id) { case PROP_HADJUSTMENT: g_value_set_object (value, map->priv->hadjustment); break; @@ -534,7 +539,7 @@ e_map_get_property (GObject *object, break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -618,7 +623,9 @@ e_map_unrealize (GtkWidget *widget) } static void -e_map_get_preferred_width (GtkWidget *widget, gint *minimum, gint *natural) +e_map_get_preferred_width (GtkWidget *widget, + gint *minimum, + gint *natural) { EMap *map; @@ -633,7 +640,9 @@ e_map_get_preferred_width (GtkWidget *widget, gint *minimum, gint *natural) } static void -e_map_get_preferred_height (GtkWidget *widget, gint *minimum, gint *natural) +e_map_get_preferred_height (GtkWidget *widget, + gint *minimum, + gint *natural) { EMap *view; EMapPrivate *priv; @@ -650,7 +659,8 @@ e_map_get_preferred_height (GtkWidget *widget, gint *minimum, gint *natural) } static void -e_map_size_allocate (GtkWidget *widget, GtkAllocation *allocation) +e_map_size_allocate (GtkWidget *widget, + GtkAllocation *allocation) { EMap *map; @@ -680,7 +690,8 @@ e_map_size_allocate (GtkWidget *widget, GtkAllocation *allocation) } static gboolean -e_map_draw (GtkWidget *widget, cairo_t *cr) +e_map_draw (GtkWidget *widget, + cairo_t *cr) { EMap *map; cairo_matrix_t matrix; @@ -704,14 +715,16 @@ e_map_draw (GtkWidget *widget, cairo_t *cr) } static gint -e_map_button_press (GtkWidget *widget, GdkEventButton *event) +e_map_button_press (GtkWidget *widget, + GdkEventButton *event) { if (!gtk_widget_has_focus (widget)) gtk_widget_grab_focus (widget); return TRUE; } static gint -e_map_button_release (GtkWidget *widget, GdkEventButton *event) +e_map_button_release (GtkWidget *widget, + GdkEventButton *event) { if (event->button != 1) return FALSE; @@ -720,7 +733,8 @@ e_map_button_release (GtkWidget *widget, GdkEventButton *event) } static gint -e_map_motion (GtkWidget *widget, GdkEventMotion *event) +e_map_motion (GtkWidget *widget, + GdkEventMotion *event) { return FALSE; } @@ -934,7 +948,8 @@ e_map_get_magnification (EMap *map) } static void -e_map_set_zoom (EMap *map, EMapZoomState zoom) +e_map_set_zoom (EMap *map, + EMapZoomState zoom) { if (map->priv->zoom_state == zoom) return; @@ -986,7 +1001,8 @@ e_map_zoom_out (EMap *map) } void -e_map_set_smooth_zoom (EMap *map, gboolean state) +e_map_set_smooth_zoom (EMap *map, + gboolean state) { ((EMapPrivate *) map->priv)->smooth_zoom = state; } @@ -1040,7 +1056,8 @@ e_map_add_point (EMap *map, } void -e_map_remove_point (EMap *map, EMapPoint *point) +e_map_remove_point (EMap *map, + EMapPoint *point) { g_ptr_array_remove (map->priv->points, point); @@ -1094,7 +1111,8 @@ e_map_point_set_color_rgba (EMap *map, } void -e_map_point_set_data (EMapPoint *point, gpointer data) +e_map_point_set_data (EMapPoint *point, + gpointer data) { point->user_data = data; } @@ -1106,7 +1124,8 @@ e_map_point_get_data (EMapPoint *point) } gboolean -e_map_point_is_in_view (EMap *map, EMapPoint *point) +e_map_point_is_in_view (EMap *map, + EMapPoint *point) { GtkAllocation allocation; gdouble x, y; @@ -1165,7 +1184,8 @@ update_and_paint (EMap *map) } static gint -load_map_background (EMap *map, gchar *name) +load_map_background (EMap *map, + gchar *name) { GdkPixbuf *pb0; @@ -1251,7 +1271,8 @@ update_render_surface (EMap *map, /* Redraw point in client surface */ static void -update_render_point (EMap *map, EMapPoint *point) +update_render_point (EMap *map, + EMapPoint *point) { cairo_t *cr; gdouble px, py; @@ -1295,7 +1316,8 @@ update_render_point (EMap *map, EMapPoint *point) /* Repaint point on X server */ static void -repaint_point (EMap *map, EMapPoint *point) +repaint_point (EMap *map, + EMapPoint *point) { gdouble px, py; @@ -1310,7 +1332,9 @@ repaint_point (EMap *map, EMapPoint *point) } static void -center_at (EMap *map, gdouble longitude, gdouble latitude) +center_at (EMap *map, + gdouble longitude, + gdouble latitude) { GtkAllocation allocation; gint pb_width, pb_height; @@ -1335,7 +1359,9 @@ center_at (EMap *map, gdouble longitude, gdouble latitude) /* Scrolls the view to the specified offsets. Does not perform range checking! */ static void -scroll_to (EMap *map, gint x, gint y) +scroll_to (EMap *map, + gint x, + gint y) { gint xofs, yofs; @@ -1354,7 +1380,9 @@ scroll_to (EMap *map, gint x, gint y) } static void -set_scroll_area (EMap *view, gint width, gint height) +set_scroll_area (EMap *view, + gint width, + gint height) { EMapPrivate *priv; GtkAllocation allocation; diff --git a/widgets/misc/e-paned.c b/widgets/misc/e-paned.c index b98dc1928d..c90d40c140 100644 --- a/widgets/misc/e-paned.c +++ b/widgets/misc/e-paned.c @@ -57,6 +57,14 @@ G_DEFINE_TYPE ( GTK_TYPE_PANED) static gboolean +paned_queue_resize_on_idle (GtkWidget *paned) +{ + gtk_widget_queue_resize_no_redraw (paned); + + return FALSE; +} + +static gboolean paned_window_state_event_cb (EPaned *paned, GdkEventWindowState *event, GtkWidget *toplevel) @@ -240,19 +248,6 @@ paned_realize (GtkWidget *widget) priv->toplevel_ready = TRUE; } -static gboolean -paned_queue_resize_on_idle (gpointer user_data) -{ - GtkWidget *paned = user_data; - - g_return_val_if_fail (paned != NULL, FALSE); - - gtk_widget_queue_resize_no_redraw (paned); - g_object_unref (paned); - - return FALSE; -} - static void paned_size_allocate (GtkWidget *widget, GtkAllocation *allocation) @@ -297,10 +292,13 @@ paned_size_allocate (GtkWidget *widget, paned->priv->sync_request = SYNC_REQUEST_NONE; /* gtk_paned_set_position() calls queue_resize, which cannot - be called from size_allocate, thus call it on idle to take - the change in the effect. - */ - g_idle_add (paned_queue_resize_on_idle, g_object_ref (paned)); + * be called from size_allocate, so schedule it from an idle + * callback so the change takes effect. */ + g_idle_add_full ( + G_PRIORITY_DEFAULT_IDLE, + (GSourceFunc) paned_queue_resize_on_idle, + g_object_ref (paned), + (GDestroyNotify) g_object_unref); } static void diff --git a/widgets/misc/e-picture-gallery.c b/widgets/misc/e-picture-gallery.c index a657dbf373..a742a5e37c 100644 --- a/widgets/misc/e-picture-gallery.c +++ b/widgets/misc/e-picture-gallery.c @@ -47,7 +47,10 @@ enum { G_DEFINE_TYPE (EPictureGallery, e_picture_gallery, GTK_TYPE_ICON_VIEW) static gboolean -update_file_iter (GtkListStore *list_store, GtkTreeIter *iter, GFile *file, gboolean force_thumbnail_update) +update_file_iter (GtkListStore *list_store, + GtkTreeIter *iter, + GFile *file, + gboolean force_thumbnail_update) { GFileInfo *file_info; gchar *uri; @@ -85,7 +88,7 @@ update_file_iter (GtkListStore *list_store, GtkTreeIter *iter, GFile *file, gboo } if (existing_thumb && !g_file_info_get_attribute_boolean (file_info, G_FILE_ATTRIBUTE_THUMBNAILING_FAILED)) { - GdkPixbuf* pixbuf; + GdkPixbuf * pixbuf; pixbuf = gdk_pixbuf_new_from_file (existing_thumb, NULL); @@ -125,7 +128,8 @@ update_file_iter (GtkListStore *list_store, GtkTreeIter *iter, GFile *file, gboo } static void -add_file (GtkListStore *list_store, GFile *file) +add_file (GtkListStore *list_store, + GFile *file) { GtkTreeIter iter; @@ -138,7 +142,9 @@ add_file (GtkListStore *list_store, GFile *file) } static gboolean -find_file_uri (GtkListStore *list_store, const gchar *uri, GtkTreeIter *iter) +find_file_uri (GtkListStore *list_store, + const gchar *uri, + GtkTreeIter *iter) { GtkTreeModel *model; @@ -171,14 +177,16 @@ find_file_uri (GtkListStore *list_store, const gchar *uri, GtkTreeIter *iter) } static void -picture_gallery_dir_changed_cb (GFileMonitor *monitor, GFile *file, GFile *other_file, GFileMonitorEvent event_type, EPictureGallery *gallery) +picture_gallery_dir_changed_cb (GFileMonitor *monitor, + GFile *file, + GFile *other_file, + GFileMonitorEvent event_type, + EPictureGallery *gallery) { gchar *uri; GtkListStore *list_store; GtkTreeIter iter; - g_return_if_fail (gallery != NULL); - g_return_if_fail (gallery->priv != NULL); g_return_if_fail (file != NULL); list_store = GTK_LIST_STORE (gtk_icon_view_get_model (GTK_ICON_VIEW (gallery))); @@ -273,9 +281,9 @@ e_picture_gallery_get_path (EPictureGallery *gallery) } static void -picture_gallery_set_path (EPictureGallery *gallery, const gchar *path) +picture_gallery_set_path (EPictureGallery *gallery, + const gchar *path) { - g_return_if_fail (gallery != NULL); g_return_if_fail (E_IS_PICTURE_GALLERY (gallery)); g_return_if_fail (gallery->priv != NULL); @@ -288,7 +296,10 @@ picture_gallery_set_path (EPictureGallery *gallery, const gchar *path) } static void -picture_gallery_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +picture_gallery_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { switch (property_id) { case PROP_PATH: @@ -300,7 +311,10 @@ picture_gallery_get_property (GObject *object, guint property_id, GValue *value, } static void -picture_gallery_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +picture_gallery_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { switch (property_id) { case PROP_PATH: @@ -314,9 +328,6 @@ picture_gallery_set_property (GObject *object, guint property_id, const GValue * static void visible_cb (EPictureGallery *gallery) { - g_return_if_fail (gallery != NULL); - g_return_if_fail (gallery->priv != NULL); - if (!gallery->priv->initialized && gtk_widget_get_visible (GTK_WIDGET (gallery))) { gallery->priv->initialized = TRUE; @@ -367,9 +378,6 @@ picture_gallery_dispose (GObject *object) gallery = E_PICTURE_GALLERY (object); - g_return_if_fail (gallery != NULL); - g_return_if_fail (gallery->priv != NULL); - if (gallery->priv->monitor) { g_object_unref (gallery->priv->monitor); gallery->priv->monitor = NULL; diff --git a/widgets/misc/e-printable.c b/widgets/misc/e-printable.c index a918081480..ada5398523 100644 --- a/widgets/misc/e-printable.c +++ b/widgets/misc/e-printable.c @@ -121,11 +121,11 @@ e_printable_new (void) } void -e_printable_print_page (EPrintable *e_printable, - GtkPrintContext *context, - gdouble width, - gdouble height, - gboolean quantized) +e_printable_print_page (EPrintable *e_printable, + GtkPrintContext *context, + gdouble width, + gdouble height, + gboolean quantized) { g_return_if_fail (e_printable != NULL); g_return_if_fail (E_IS_PRINTABLE (e_printable)); @@ -139,7 +139,7 @@ e_printable_print_page (EPrintable *e_printable, } gboolean -e_printable_data_left (EPrintable *e_printable) +e_printable_data_left (EPrintable *e_printable) { gboolean ret_val; @@ -154,7 +154,7 @@ e_printable_data_left (EPrintable *e_printable) } void -e_printable_reset (EPrintable *e_printable) +e_printable_reset (EPrintable *e_printable) { g_return_if_fail (e_printable != NULL); g_return_if_fail (E_IS_PRINTABLE (e_printable)); @@ -164,11 +164,11 @@ e_printable_reset (EPrintable *e_printable) } gdouble -e_printable_height (EPrintable *e_printable, - GtkPrintContext *context, - gdouble width, - gdouble max_height, - gboolean quantized) +e_printable_height (EPrintable *e_printable, + GtkPrintContext *context, + gdouble width, + gdouble max_height, + gboolean quantized) { gdouble ret_val; @@ -187,11 +187,11 @@ e_printable_height (EPrintable *e_printable, } gboolean -e_printable_will_fit (EPrintable *e_printable, - GtkPrintContext *context, - gdouble width, - gdouble max_height, - gboolean quantized) +e_printable_will_fit (EPrintable *e_printable, + GtkPrintContext *context, + gdouble width, + gdouble max_height, + gboolean quantized) { gboolean ret_val; diff --git a/widgets/misc/e-searching-tokenizer.c b/widgets/misc/e-searching-tokenizer.c index 3720030815..c3a7dfff2e 100644 --- a/widgets/misc/e-searching-tokenizer.c +++ b/widgets/misc/e-searching-tokenizer.c @@ -56,7 +56,7 @@ G_DEFINE_TYPE ( static inline guint32 camel_utf8_getc (const guchar **ptr) { - register guchar *p = (guchar *)*ptr; + register guchar *p = (guchar *) * ptr; register guchar c, r; register guint32 v, m; @@ -75,7 +75,7 @@ loop: r = c; goto loop; } - v = (v<<6) | (c & 0x3f); + v = (v << 6) | (c & 0x3f); r<<=1; m<<=5; } while (r & 0x40); @@ -93,22 +93,22 @@ loop: /* note: our tags of interest are 7 bit ascii * only no need to do any fancy utf8 stuff */ /* tags should be upper case - if this list gets longer than 10 entries, consider binary search */ + * if this list gets longer than 10 entries, consider binary search */ static const gchar *ignored_tags[] = { "B", "I", "FONT", "TT", "EM", /* and more? */}; static gint ignore_tag (const gchar *tag) { - gchar *t = g_alloca (strlen (tag)+1), c, *out; + gchar *t = g_alloca (strlen (tag) + 1), c, *out; const gchar *in; gint i; /* we could use a aho-corasick matcher here too ... but we wont */ /* normalise tag into 't'. - Note we use the property that the only tags we're interested in - are 7 bit ascii to shortcut and simplify case insensitivity */ + * Note we use the property that the only tags we're interested in + * are 7 bit ascii to shortcut and simplify case insensitivity */ in = tag+2; /* skip: TAG_ESCAPE '<' */ if (*in == '/') in++; @@ -163,20 +163,21 @@ struct _trie { /* will be enabled only if debug is enabled */ #if d(1) -1 != -1 static void -dump_trie (struct _state *s, gint d) +dump_trie (struct _state *s, + gint d) { - gchar *p = g_alloca (d*2+1); + gchar *p = g_alloca (d *2 + 1); struct _match *m; - memset (p, ' ', d*2); - p[d*2]=0; + memset (p, ' ', d *2); + p[d *2]=0; printf("%s[state] %p: %d fail->%p\n", p, s, s->final, s->fail); m = s->matches; while (m) { printf(" %s'%c' -> %p\n", p, m->ch, m->match); if (m->match) - dump_trie (m->match, d+1); + dump_trie (m->match, d + 1); m = m->next; } } @@ -184,11 +185,12 @@ dump_trie (struct _state *s, gint d) /* This builds an Aho-Corasick search trie for a set of utf8 words */ /* See - http://www-sr.informatik.uni-tuebingen.de/~buehler/AC/AC.html - for a neat demo */ + * http://www-sr.informatik.uni-tuebingen.de/~buehler/AC/AC.html + * for a neat demo */ static inline struct _match * -g (struct _state *q, guint32 c) +g (struct _state *q, + guint32 c) { struct _match *m = q->matches; @@ -199,7 +201,9 @@ g (struct _state *q, guint32 c) } static struct _trie * -build_trie (gint nocase, gint len, guchar **words) +build_trie (gint nocase, + gint len, + guchar **words) { struct _state *q, *qt, *r; const guchar *word; @@ -222,14 +226,14 @@ build_trie (gint nocase, gint len, guchar **words) /* This will correspond to the length of the longest pattern */ state_depth_size = 0; state_depth_max = 64; - state_depth = g_malloc (sizeof (*state_depth[0])*64); + state_depth = g_malloc (sizeof (*state_depth[0]) * 64); state_depth[0] = NULL; /* Step 1: Build trie */ /* This just builds a tree that merges all common prefixes into the same branch */ - for (i=0;i<len;i++) { + for (i = 0; i < len; i++) { word = words[i]; q = &trie->root; depth = 0; @@ -277,7 +281,7 @@ build_trie (gint nocase, gint len, guchar **words) * find multiple substrings concurrently, using aho-corasick's * algorithm. */ - for (i=0;i<state_depth_size;i++) { + for (i = 0; i < state_depth_size; i++) { q = state_depth[i]; while (q) { m = q->matches; @@ -411,17 +415,17 @@ searcher_new (gint flags, s->offout = 0; /* rotating queue of previous character positions */ - m = s->t->max_depth+1; + m = s->t->max_depth + 1; i = 2; - while (i<m) + while (i < m) i<<=2; - s->last = g_malloc (sizeof (s->last[0])*i); - s->last_mask = i-1; + s->last = g_malloc (sizeof (s->last[0]) * i); + s->last_mask = i - 1; s->lastp = 0; /* a stack of possible submatches */ s->submatchp = 0; - s->submatches = g_malloc (sizeof (s->submatches[0])*argc+1); + s->submatches = g_malloc (sizeof (s->submatches[0]) * argc + 1); return s; } @@ -444,13 +448,15 @@ searcher_free (struct _searcher *s) } static struct _token * -append_token (GQueue *queue, const gchar *tok, gint len) +append_token (GQueue *queue, + const gchar *tok, + gint len) { struct _token *token; if (len == -1) len = strlen (tok); - token = g_malloc (sizeof (*token) + len+1); + token = g_malloc (sizeof (*token) + len + 1); token->offset = 0; /* set by caller when required */ memcpy (token->tok, tok, len); token->tok[len] = 0; @@ -462,7 +468,8 @@ append_token (GQueue *queue, const gchar *tok, gint len) #define free_token(x) (g_free (x)) static void -output_token (struct _searcher *s, struct _token *token) +output_token (struct _searcher *s, + struct _token *token) { gint offend; gint left, pre; @@ -475,11 +482,11 @@ output_token (struct _searcher *s, struct _token *token) } } else { offend = token->offset + strlen (token->tok); - left = offend-s->offout; + left = offend - s->offout; if (left > 0) { pre = s->offout - token->offset; - if (pre>0) - memmove (token->tok, token->tok+pre, left+1); + if (pre > 0) + memmove (token->tok, token->tok + pre, left + 1); s->offout = offend; g_queue_push_tail (&s->output, token); } else { @@ -489,7 +496,8 @@ output_token (struct _searcher *s, struct _token *token) } static struct _token * -find_token (struct _searcher *s, gint start) +find_token (struct _searcher *s, + gint start) { GList *link; @@ -508,7 +516,9 @@ find_token (struct _searcher *s, gint start) } static void -output_match (struct _searcher *s, guint start, guint end) +output_match (struct _searcher *s, + guint start, + guint end) { register struct _token *token; struct _token *starttoken, *endtoken; @@ -534,8 +544,8 @@ output_match (struct _searcher *s, guint start, guint end) if (s->offout < start) { token = append_token ( &s->output, starttoken->tok + - (s->offout-starttoken->offset), - start-s->offout); + (s->offout - starttoken->offset), + start - s->offout); s->offout = start; } @@ -559,8 +569,8 @@ output_match (struct _searcher *s, guint start, guint end) if (s->offout < end) { token = append_token ( &s->output, endtoken->tok + - (s->offout-endtoken->offset), - end-s->offout); + (s->offout - endtoken->offset), + end - s->offout); s->offout = end; } @@ -581,29 +591,31 @@ output_subpending (struct _searcher *s) { gint i; - for (i=s->submatchp-1;i>=0;i--) + for (i = s->submatchp - 1; i >= 0; i--) output_match (s, s->submatches[i].offstart, s->submatches[i].offend); s->submatchp = 0; } /* returns true if a merge took place */ static gint -merge_subpending (struct _searcher *s, gint offstart, gint offend) +merge_subpending (struct _searcher *s, + gint offstart, + gint offend) { gint i; /* merges overlapping or abutting match strings */ if (s->submatchp && - s->submatches[s->submatchp-1].offend >= offstart) { + s->submatches[s->submatchp - 1].offend >= offstart) { /* go from end, any that match 'invalidate' follow-on ones too */ - for (i=s->submatchp-1;i>=0;i--) { + for (i = s->submatchp - 1; i >= 0; i--) { if (s->submatches[i].offend >= offstart) { if (offstart < s->submatches[i].offstart) s->submatches[i].offstart = offstart; s->submatches[i].offend = offend; if (s->submatchp > i) - s->submatchp = i+1; + s->submatchp = i + 1; } } return 1; @@ -613,13 +625,15 @@ merge_subpending (struct _searcher *s, gint offstart, gint offend) } static void -push_subpending (struct _searcher *s, gint offstart, gint offend) +push_subpending (struct _searcher *s, + gint offstart, + gint offend) { /* This is really an assertion, we just ignore the * last pending match instead of crashing though. */ if (s->submatchp >= s->words) { d (printf("ERROR: submatch pending stack overflow\n")); - s->submatchp = s->words-1; + s->submatchp = s->words - 1; } s->submatches[s->submatchp].offstart = offstart; @@ -648,7 +662,7 @@ flush_extra (struct _searcher *s) /* find earliest gchar that can be in contention */ start = s->offset - s->t->max_depth; - for (i=0;i<s->submatchp;i++) + for (i = 0; i < s->submatchp; i++) if (s->submatches[i].offstart < start) start = s->submatches[i].offstart; @@ -713,8 +727,8 @@ searcher_next_token (struct _searcher *s) q = &t->root; } else if (m != NULL) { /* keep track of previous offsets of utf8 chars, rotating buffer */ - s->last[s->lastp] = s->offset + (pre_tok-stok); - s->lastp = (s->lastp+1)&s->last_mask; + s->last[s->lastp] = s->offset + (pre_tok - stok); + s->lastp = (s->lastp + 1) &s->last_mask; q = m->match; /* we have a match of q->final characters for a matching word */ @@ -722,7 +736,7 @@ searcher_next_token (struct _searcher *s) s->matchcount++; /* use the last buffer to find the real offset of this gchar */ - offstart = s->last[(s->lastp - q->final)&s->last_mask]; + offstart = s->last[(s->lastp - q->final) &s->last_mask]; offend = s->offset + (tok - stok); if (q->matches == NULL) { @@ -752,7 +766,7 @@ searcher_next_token (struct _searcher *s) pre_tok = tok; } - s->offset += (pre_tok-stok); + s->offset += (pre_tok - stok); flush_extra (s); } @@ -794,8 +808,8 @@ searcher_pending (struct _searcher *s) struct _search_info { GPtrArray *strv; gchar *color; - guint size:8; - guint flags:8; + guint size : 8; + guint flags : 8; }; /** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **/ @@ -812,20 +826,24 @@ search_info_new (void) } static void -search_info_set_flags (struct _search_info *si, guint flags, guint mask) +search_info_set_flags (struct _search_info *si, + guint flags, + guint mask) { si->flags = (si->flags & ~mask) | (flags & mask); } static void -search_info_set_color (struct _search_info *si, const gchar *color) +search_info_set_color (struct _search_info *si, + const gchar *color) { g_free (si->color); si->color = g_strdup (color); } static void -search_info_add_string (struct _search_info *si, const gchar *s) +search_info_add_string (struct _search_info *si, + const gchar *s) { const guchar *start; guint32 c; @@ -851,7 +869,7 @@ search_info_clear (struct _search_info *si) { gint i; - for (i=0;i<si->strv->len;i++) + for (i = 0; i < si->strv->len; i++) g_free (si->strv->pdata[i]); g_ptr_array_set_size (si->strv, 0); @@ -862,7 +880,7 @@ search_info_free (struct _search_info *si) { gint i; - for (i=0;i<si->strv->len;i++) + for (i = 0; i < si->strv->len; i++) g_free (si->strv->pdata[i]); g_ptr_array_free (si->strv, TRUE); @@ -877,7 +895,7 @@ search_info_clone (struct _search_info *si) gint i; out = search_info_new (); - for (i=0;i<si->strv->len;i++) + for (i = 0; i < si->strv->len; i++) g_ptr_array_add (out->strv, g_strdup (si->strv->pdata[i])); out->color = g_strdup (si->color); out->flags = si->flags; @@ -900,7 +918,7 @@ search_info_to_searcher (struct _search_info *si) else col = si->color; - tags = g_alloca (20+strlen (col)); + tags = g_alloca (20 + strlen (col)); sprintf(tags, "%c<font color=\"%s\">", TAG_ESCAPE, col); tage = g_alloca (20); sprintf(tage, "%c</font>", TAG_ESCAPE); @@ -922,7 +940,7 @@ struct _ESearchingTokenizerPrivate { /** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **/ /* blah blah the htmltokeniser doesn't like being asked - for a token if it doens't hvae any! */ + * for a token if it doens't hvae any! */ static gchar * get_token (HTMLTokenizer *tokenizer) { diff --git a/widgets/misc/e-selection-model-array.c b/widgets/misc/e-selection-model-array.c index a023ea5916..d744111bb4 100644 --- a/widgets/misc/e-selection-model-array.c +++ b/widgets/misc/e-selection-model-array.c @@ -55,7 +55,8 @@ e_selection_model_array_confirm_row_count (ESelectionModelArray *esma) } static gint -es_row_model_to_sorted (ESelectionModelArray *esma, gint model_row) +es_row_model_to_sorted (ESelectionModelArray *esma, + gint model_row) { if (model_row >= 0 && esma && esma->base.sorter && e_sorter_needs_sorting (esma->base.sorter)) return e_sorter_model_to_sorted (esma->base.sorter, model_row); @@ -64,7 +65,8 @@ es_row_model_to_sorted (ESelectionModelArray *esma, gint model_row) } static gint -es_row_sorted_to_model (ESelectionModelArray *esma, gint sorted_row) +es_row_sorted_to_model (ESelectionModelArray *esma, + gint sorted_row) { if (sorted_row >= 0 && esma && esma->base.sorter && e_sorter_needs_sorting (esma->base.sorter)) return e_sorter_sorted_to_model (esma->base.sorter, sorted_row); @@ -74,7 +76,9 @@ es_row_sorted_to_model (ESelectionModelArray *esma, gint sorted_row) /* FIXME: Should this deal with moving the selection if it's in single mode? */ void -e_selection_model_array_delete_rows (ESelectionModelArray *esma, gint row, gint count) +e_selection_model_array_delete_rows (ESelectionModelArray *esma, + gint row, + gint count) { if (esma->eba) { if (E_SELECTION_MODEL (esma)->mode == GTK_SELECTION_SINGLE) @@ -124,7 +128,9 @@ e_selection_model_array_delete_rows (ESelectionModelArray *esma, gint row, gint } void -e_selection_model_array_insert_rows (ESelectionModelArray *esma, gint row, gint count) +e_selection_model_array_insert_rows (ESelectionModelArray *esma, + gint row, + gint count) { if (esma->eba) { e_bit_array_insert (esma->eba, row, count); @@ -140,7 +146,9 @@ e_selection_model_array_insert_rows (ESelectionModelArray *esma, gint row, gint } void -e_selection_model_array_move_row (ESelectionModelArray *esma, gint old_row, gint new_row) +e_selection_model_array_move_row (ESelectionModelArray *esma, + gint old_row, + gint new_row) { ESelectionModel *esm = E_SELECTION_MODEL (esma); @@ -195,11 +203,14 @@ esma_dispose (GObject *object) } static void -esma_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +esma_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY (object); - switch (prop_id) { + switch (property_id) { case PROP_CURSOR_ROW: g_value_set_int (value, esma->cursor_row); break; @@ -211,12 +222,15 @@ esma_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *ps } static void -esma_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +esma_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { ESelectionModel *esm = E_SELECTION_MODEL (object); ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY (object); - switch (prop_id) { + switch (property_id) { case PROP_CURSOR_ROW: e_selection_model_do_something (esm, g_value_get_int (value), esma->cursor_col, 0); break; @@ -238,7 +252,7 @@ esma_set_property (GObject *object, guint prop_id, const GValue *value, GParamSp */ static gboolean esma_is_row_selected (ESelectionModel *selection, - gint n) + gint n) { ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY (selection); if (esma->eba) @@ -258,8 +272,8 @@ esma_is_row_selected (ESelectionModel *selection, */ static void esma_foreach (ESelectionModel *selection, - EForeachFunc callback, - gpointer closure) + EForeachFunc callback, + gpointer closure) { ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY (selection); if (esma->eba) @@ -371,7 +385,9 @@ esma_row_count (ESelectionModel *selection) } static void -esma_change_one_row (ESelectionModel *selection, gint row, gboolean grow) +esma_change_one_row (ESelectionModel *selection, + gint row, + gboolean grow) { ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY (selection); e_selection_model_array_confirm_row_count (esma); @@ -379,7 +395,9 @@ esma_change_one_row (ESelectionModel *selection, gint row, gboolean grow) } static void -esma_change_cursor (ESelectionModel *selection, gint row, gint col) +esma_change_cursor (ESelectionModel *selection, + gint row, + gint col) { ESelectionModelArray *esma; @@ -394,7 +412,10 @@ esma_change_cursor (ESelectionModel *selection, gint row, gint col) } static void -esma_change_range (ESelectionModel *selection, gint start, gint end, gboolean grow) +esma_change_range (ESelectionModel *selection, + gint start, + gint end, + gboolean grow) { gint i; ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY (selection); @@ -425,7 +446,8 @@ esma_cursor_col (ESelectionModel *selection) } static void -esma_real_select_single_row (ESelectionModel *selection, gint row) +esma_real_select_single_row (ESelectionModel *selection, + gint row) { ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY (selection); @@ -439,7 +461,8 @@ esma_real_select_single_row (ESelectionModel *selection, gint row) } static void -esma_select_single_row (ESelectionModel *selection, gint row) +esma_select_single_row (ESelectionModel *selection, + gint row) { ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY (selection); gint selected_row = esma->selected_row; @@ -456,7 +479,8 @@ esma_select_single_row (ESelectionModel *selection, gint row) } static void -esma_toggle_single_row (ESelectionModel *selection, gint row) +esma_toggle_single_row (ESelectionModel *selection, + gint row) { ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY (selection); @@ -470,7 +494,8 @@ esma_toggle_single_row (ESelectionModel *selection, gint row) } static void -esma_real_move_selection_end (ESelectionModel *selection, gint row) +esma_real_move_selection_end (ESelectionModel *selection, + gint row) { ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY (selection); gint old_start; @@ -506,14 +531,16 @@ esma_real_move_selection_end (ESelectionModel *selection, gint row) } static void -esma_move_selection_end (ESelectionModel *selection, gint row) +esma_move_selection_end (ESelectionModel *selection, + gint row) { esma_real_move_selection_end (selection, row); e_selection_model_selection_changed (selection); } static void -esma_set_selection_end (ESelectionModel *selection, gint row) +esma_set_selection_end (ESelectionModel *selection, + gint row) { ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY (selection); gint selected_range_end = esma->selected_range_end; diff --git a/widgets/misc/e-selection-model.c b/widgets/misc/e-selection-model.c index 4f00369b16..fc73df6b5e 100644 --- a/widgets/misc/e-selection-model.c +++ b/widgets/misc/e-selection-model.c @@ -54,7 +54,8 @@ enum { }; inline static void -add_sorter (ESelectionModel *esm, ESorter *sorter) +add_sorter (ESelectionModel *esm, + ESorter *sorter) { esm->sorter = sorter; if (sorter) { diff --git a/widgets/misc/e-send-options.c b/widgets/misc/e-send-options.c index 9a916fbf0b..103697fd0b 100644 --- a/widgets/misc/e-send-options.c +++ b/widgets/misc/e-send-options.c @@ -259,7 +259,8 @@ sensitize_widgets (ESendOptionsDialog *sod) } static void -expiration_toggled_cb (GtkToggleButton *toggle, gpointer data) +expiration_toggled_cb (GtkToggleButton *toggle, + gpointer data) { gboolean active; ESendOptionsDialog *sod; @@ -274,7 +275,8 @@ expiration_toggled_cb (GtkToggleButton *toggle, gpointer data) } static void -reply_request_toggled_cb (GtkToggleButton *toggle, gpointer data) +reply_request_toggled_cb (GtkToggleButton *toggle, + gpointer data) { gboolean active; ESendOptionsDialog *sod; @@ -291,7 +293,8 @@ reply_request_toggled_cb (GtkToggleButton *toggle, gpointer data) } static void -delay_delivery_toggled_cb (GtkToggleButton *toggle, gpointer data) +delay_delivery_toggled_cb (GtkToggleButton *toggle, + gpointer data) { gboolean active; ESendOptionsDialog *sod; @@ -305,7 +308,8 @@ delay_delivery_toggled_cb (GtkToggleButton *toggle, gpointer data) } static void -sent_item_toggled_cb (GtkToggleButton *toggle, gpointer data) +sent_item_toggled_cb (GtkToggleButton *toggle, + gpointer data) { gboolean active; ESendOptionsDialog *sod; @@ -322,7 +326,8 @@ sent_item_toggled_cb (GtkToggleButton *toggle, gpointer data) } static void -delay_until_date_changed_cb (GtkWidget *dedit, gpointer data) +delay_until_date_changed_cb (GtkWidget *dedit, + gpointer data) { ESendOptionsDialog *sod; ESendOptionsDialogPrivate *priv; @@ -340,7 +345,10 @@ delay_until_date_changed_cb (GtkWidget *dedit, gpointer data) } static void -page_changed_cb (GtkNotebook *notebook, GtkWidget *page, gint num, gpointer data) +page_changed_cb (GtkNotebook *notebook, + GtkWidget *page, + gint num, + gpointer data) { ESendOptionsDialog *sod = data; ESendOptionsDialogPrivate *priv = sod->priv; @@ -484,7 +492,8 @@ get_widgets (ESendOptionsDialog *sod) } static void -setup_widgets (ESendOptionsDialog *sod, Item_type type) +setup_widgets (ESendOptionsDialog *sod, + Item_type type) { ESendOptionsDialogPrivate *priv; @@ -558,7 +567,8 @@ setup_widgets (ESendOptionsDialog *sod, Item_type type) } ESendOptionsDialog * -e_send_options_dialog_new (void) { +e_send_options_dialog_new (void) +{ ESendOptionsDialog *sod; sod = g_object_new (E_TYPE_SENDOPTIONS_DIALOG, NULL); @@ -567,7 +577,8 @@ e_send_options_dialog_new (void) { } void -e_send_options_set_need_general_options (ESendOptionsDialog *sod, gboolean needed) +e_send_options_set_need_general_options (ESendOptionsDialog *sod, + gboolean needed) { g_return_if_fail (E_IS_SENDOPTIONS_DIALOG (sod)); @@ -583,7 +594,8 @@ e_send_options_get_need_general_options (ESendOptionsDialog *sod) } gboolean -e_send_options_set_global (ESendOptionsDialog *sod, gboolean set) +e_send_options_set_global (ESendOptionsDialog *sod, + gboolean set) { g_return_val_if_fail (E_IS_SENDOPTIONS_DIALOG (sod), FALSE); @@ -592,7 +604,10 @@ e_send_options_set_global (ESendOptionsDialog *sod, gboolean set) return TRUE; } -static void e_send_options_cb (GtkDialog *dialog, gint state, gpointer func_data) +static void +e_send_options_cb (GtkDialog *dialog, + gint state, + gpointer func_data) { ESendOptionsDialogPrivate *priv; ESendOptionsDialog *sod; @@ -619,7 +634,9 @@ static void e_send_options_cb (GtkDialog *dialog, gint state, gpointer func_data } gboolean -e_send_options_dialog_run (ESendOptionsDialog *sod, GtkWidget *parent, Item_type type) +e_send_options_dialog_run (ESendOptionsDialog *sod, + GtkWidget *parent, + Item_type type) { ESendOptionsDialogPrivate *priv; GtkWidget *toplevel; diff --git a/widgets/misc/e-url-entry.c b/widgets/misc/e-url-entry.c index eaefdccddd..c4a174c0a6 100644 --- a/widgets/misc/e-url-entry.c +++ b/widgets/misc/e-url-entry.c @@ -106,7 +106,8 @@ finalize (GObject *object) /* GtkWidget::mnemonic_activate() handler for the EUrlEntry */ static gboolean -mnemonic_activate (GtkWidget *widget, gboolean group_cycling) +mnemonic_activate (GtkWidget *widget, + gboolean group_cycling) { EUrlEntry *url_entry; EUrlEntryPrivate *priv; @@ -139,7 +140,8 @@ e_url_entry_get_entry (EUrlEntry *url_entry) } static void -button_clicked_cb (GtkWidget *widget, gpointer data) +button_clicked_cb (GtkWidget *widget, + gpointer data) { EUrlEntry *url_entry; EUrlEntryPrivate *priv; @@ -155,7 +157,8 @@ button_clicked_cb (GtkWidget *widget, gpointer data) } static void -entry_changed_cb (GtkEditable *editable, gpointer data) +entry_changed_cb (GtkEditable *editable, + gpointer data) { EUrlEntry *url_entry; EUrlEntryPrivate *priv; diff --git a/widgets/misc/e-web-view-preview.c b/widgets/misc/e-web-view-preview.c index 763d31329e..12270da0b7 100644 --- a/widgets/misc/e-web-view-preview.c +++ b/widgets/misc/e-web-view-preview.c @@ -47,9 +47,9 @@ G_DEFINE_TYPE ( static void web_view_preview_set_property (GObject *object, - guint property_id, - const GValue *value, - GParamSpec *pspec) + guint property_id, + const GValue *value, + GParamSpec *pspec) { switch (property_id) { case PROP_ESCAPE_VALUES: @@ -64,9 +64,9 @@ web_view_preview_set_property (GObject *object, static void web_view_preview_get_property (GObject *object, - guint property_id, - GValue *value, - GParamSpec *pspec) + guint property_id, + GValue *value, + GParamSpec *pspec) { switch (property_id) { case PROP_TREE_VIEW: @@ -108,13 +108,13 @@ web_view_preview_dispose (GObject *object) } static void -e_web_view_preview_class_init (EWebViewPreviewClass *klass) +e_web_view_preview_class_init (EWebViewPreviewClass *class) { GObjectClass *object_class; - g_type_class_add_private (klass, sizeof (EWebViewPreviewPrivate)); + g_type_class_add_private (class, sizeof (EWebViewPreviewPrivate)); - object_class = G_OBJECT_CLASS (klass); + object_class = G_OBJECT_CLASS (class); object_class->set_property = web_view_preview_set_property; object_class->get_property = web_view_preview_get_property; object_class->dispose = web_view_preview_dispose; @@ -206,7 +206,7 @@ e_web_view_preview_get_tree_view (EWebViewPreview *preview) } GtkWidget * -e_web_view_preview_get_preview (EWebViewPreview *preview) +e_web_view_preview_get_preview (EWebViewPreview *preview) { g_return_val_if_fail (preview != NULL, NULL); g_return_val_if_fail (E_IS_WEB_VIEW_PREVIEW (preview), NULL); @@ -215,13 +215,12 @@ e_web_view_preview_get_preview (EWebViewPreview *preview) } void -e_web_view_preview_set_preview (EWebViewPreview *preview, GtkWidget *preview_widget) +e_web_view_preview_set_preview (EWebViewPreview *preview, + GtkWidget *preview_widget) { GtkWidget *old_child; - g_return_if_fail (preview != NULL); g_return_if_fail (E_IS_WEB_VIEW_PREVIEW (preview)); - g_return_if_fail (preview_widget != NULL); g_return_if_fail (GTK_IS_WIDGET (preview_widget)); old_child = gtk_bin_get_child (GTK_BIN (gtk_paned_get_child2 (GTK_PANED (preview)))); @@ -236,7 +235,6 @@ e_web_view_preview_set_preview (EWebViewPreview *preview, GtkWidget *preview_wid void e_web_view_preview_show_tree_view (EWebViewPreview *preview) { - g_return_if_fail (preview != NULL); g_return_if_fail (E_IS_WEB_VIEW_PREVIEW (preview)); gtk_widget_show (gtk_paned_get_child1 (GTK_PANED (preview))); @@ -245,18 +243,16 @@ e_web_view_preview_show_tree_view (EWebViewPreview *preview) void e_web_view_preview_hide_tree_view (EWebViewPreview *preview) { - g_return_if_fail (preview != NULL); g_return_if_fail (E_IS_WEB_VIEW_PREVIEW (preview)); gtk_widget_hide (gtk_paned_get_child1 (GTK_PANED (preview))); } void -e_web_view_preview_set_escape_values (EWebViewPreview *preview, gboolean escape) +e_web_view_preview_set_escape_values (EWebViewPreview *preview, + gboolean escape) { - g_return_if_fail (preview != NULL); g_return_if_fail (E_IS_WEB_VIEW_PREVIEW (preview)); - g_return_if_fail (preview->priv != NULL); preview->priv->escape_values = escape; } @@ -274,9 +270,7 @@ e_web_view_preview_get_escape_values (EWebViewPreview *preview) void e_web_view_preview_begin_update (EWebViewPreview *preview) { - g_return_if_fail (preview != NULL); g_return_if_fail (E_IS_WEB_VIEW_PREVIEW (preview)); - g_return_if_fail (preview->priv != NULL); if (preview->priv->updating_content) { g_warning ("%s: Previous content update isn't finished with e_web_view_preview_end_update()", G_STRFUNC); @@ -291,9 +285,7 @@ e_web_view_preview_end_update (EWebViewPreview *preview) { GtkWidget *web_view; - g_return_if_fail (preview != NULL); g_return_if_fail (E_IS_WEB_VIEW_PREVIEW (preview)); - g_return_if_fail (preview->priv != NULL); g_return_if_fail (preview->priv->updating_content != NULL); g_string_append (preview->priv->updating_content, "</TABLE>"); @@ -307,7 +299,9 @@ e_web_view_preview_end_update (EWebViewPreview *preview) } static gchar * -replace_string (const gchar *text, const gchar *find, const gchar *replace) +replace_string (const gchar *text, + const gchar *find, + const gchar *replace) { const gchar *p, *next; GString *str; @@ -337,7 +331,8 @@ replace_string (const gchar *text, const gchar *find, const gchar *replace) } static gchar * -web_view_preview_escape_text (EWebViewPreview *preview, const gchar *text) +web_view_preview_escape_text (EWebViewPreview *preview, + const gchar *text) { gchar *utf8_valid, *res, *end; @@ -375,13 +370,13 @@ web_view_preview_escape_text (EWebViewPreview *preview, const gchar *text) } void -e_web_view_preview_add_header (EWebViewPreview *preview, gint index, const gchar *header) +e_web_view_preview_add_header (EWebViewPreview *preview, + gint index, + const gchar *header) { gchar *escaped; - g_return_if_fail (preview != NULL); g_return_if_fail (E_IS_WEB_VIEW_PREVIEW (preview)); - g_return_if_fail (preview->priv != NULL); g_return_if_fail (preview->priv->updating_content != NULL); g_return_if_fail (header != NULL); @@ -400,13 +395,12 @@ e_web_view_preview_add_header (EWebViewPreview *preview, gint index, const gchar } void -e_web_view_preview_add_text (EWebViewPreview *preview, const gchar *text) +e_web_view_preview_add_text (EWebViewPreview *preview, + const gchar *text) { gchar *escaped; - g_return_if_fail (preview != NULL); g_return_if_fail (E_IS_WEB_VIEW_PREVIEW (preview)); - g_return_if_fail (preview->priv != NULL); g_return_if_fail (preview->priv->updating_content != NULL); g_return_if_fail (text != NULL); @@ -420,11 +414,10 @@ e_web_view_preview_add_text (EWebViewPreview *preview, const gchar *text) } void -e_web_view_preview_add_raw_html (EWebViewPreview *preview, const gchar *raw_html) +e_web_view_preview_add_raw_html (EWebViewPreview *preview, + const gchar *raw_html) { - g_return_if_fail (preview != NULL); g_return_if_fail (E_IS_WEB_VIEW_PREVIEW (preview)); - g_return_if_fail (preview->priv != NULL); g_return_if_fail (preview->priv->updating_content != NULL); g_return_if_fail (raw_html != NULL); @@ -434,9 +427,7 @@ e_web_view_preview_add_raw_html (EWebViewPreview *preview, const gchar *raw_html void e_web_view_preview_add_separator (EWebViewPreview *preview) { - g_return_if_fail (preview != NULL); g_return_if_fail (E_IS_WEB_VIEW_PREVIEW (preview)); - g_return_if_fail (preview->priv != NULL); g_return_if_fail (preview->priv->updating_content != NULL); g_string_append (preview->priv->updating_content, "<TR><TD colspan=2><HR></TD></TR>"); @@ -445,9 +436,7 @@ e_web_view_preview_add_separator (EWebViewPreview *preview) void e_web_view_preview_add_empty_line (EWebViewPreview *preview) { - g_return_if_fail (preview != NULL); g_return_if_fail (E_IS_WEB_VIEW_PREVIEW (preview)); - g_return_if_fail (preview->priv != NULL); g_return_if_fail (preview->priv->updating_content != NULL); g_string_append (preview->priv->updating_content, "<TR><TD colspan=2> </TD></TR>"); @@ -455,13 +444,13 @@ e_web_view_preview_add_empty_line (EWebViewPreview *preview) /* section can be NULL, but value cannot */ void -e_web_view_preview_add_section (EWebViewPreview *preview, const gchar *section, const gchar *value) +e_web_view_preview_add_section (EWebViewPreview *preview, + const gchar *section, + const gchar *value) { gchar *escaped_section = NULL, *escaped_value; - g_return_if_fail (preview != NULL); g_return_if_fail (E_IS_WEB_VIEW_PREVIEW (preview)); - g_return_if_fail (preview->priv != NULL); g_return_if_fail (preview->priv->updating_content != NULL); g_return_if_fail (value != NULL); diff --git a/widgets/misc/e-web-view.c b/widgets/misc/e-web-view.c index 18529b603e..8e037ac66c 100644 --- a/widgets/misc/e-web-view.c +++ b/widgets/misc/e-web-view.c @@ -2049,7 +2049,8 @@ e_web_view_get_cursor_image_src (EWebView *web_view) } void -e_web_view_set_cursor_image_src (EWebView *web_view, const gchar *src_uri) +e_web_view_set_cursor_image_src (EWebView *web_view, + const gchar *src_uri) { g_return_if_fail (E_IS_WEB_VIEW (web_view)); diff --git a/widgets/misc/ea-calendar-cell.c b/widgets/misc/ea-calendar-cell.c index b8e53fd359..c71f4f4d47 100644 --- a/widgets/misc/ea-calendar-cell.c +++ b/widgets/misc/ea-calendar-cell.c @@ -70,7 +70,9 @@ e_calendar_cell_class_init (ECalendarCellClass *class) } ECalendarCell * -e_calendar_cell_new (ECalendarItem *calitem, gint row, gint column) +e_calendar_cell_new (ECalendarItem *calitem, + gint row, + gint column) { GObject *object; ECalendarCell *cell; @@ -182,7 +184,7 @@ ea_calendar_cell_init (EaCalendarCell *a11y) atk_state_set_add_state (a11y->state_set, ATK_STATE_FOCUSABLE); } -AtkObject* +AtkObject * ea_calendar_cell_new (GObject *obj) { gpointer object; @@ -316,8 +318,11 @@ atk_component_interface_init (AtkComponentIface *iface) static void component_interface_get_extents (AtkComponent *component, - gint *x, gint *y, gint *width, gint *height, - AtkCoordType coord_type) + gint *x, + gint *y, + gint *width, + gint *height, + AtkCoordType coord_type) { GObject *g_obj; AtkObject *atk_obj, *atk_canvas; diff --git a/widgets/misc/ea-calendar-cell.h b/widgets/misc/ea-calendar-cell.h index fa68fdca55..2fd2051538 100644 --- a/widgets/misc/ea-calendar-cell.h +++ b/widgets/misc/ea-calendar-cell.h @@ -79,7 +79,7 @@ struct _EaCalendarCellClass AtkGObjectAccessibleClass parent_class; }; -AtkObject* ea_calendar_cell_new (GObject *gobj); +AtkObject * ea_calendar_cell_new (GObject *gobj); G_END_DECLS diff --git a/widgets/misc/ea-calendar-item.c b/widgets/misc/ea-calendar-item.c index 5d482feb40..98a715eacf 100644 --- a/widgets/misc/ea-calendar-item.c +++ b/widgets/misc/ea-calendar-item.c @@ -45,7 +45,7 @@ static const gchar * ea_calendar_item_get_name (AtkObject *accessible); static const gchar * ea_calendar_item_get_description (AtkObject *accessible); static gint ea_calendar_item_get_n_children (AtkObject *accessible); static AtkObject *ea_calendar_item_ref_child (AtkObject *accessible, gint index); -static AtkStateSet* ea_calendar_item_ref_state_set (AtkObject *accessible); +static AtkStateSet * ea_calendar_item_ref_state_set (AtkObject *accessible); /* atk table interface */ static void atk_table_interface_init (AtkTableIface *iface); @@ -56,7 +56,7 @@ static gint table_interface_get_column_at_index (AtkTable *table, gint index); static gint table_interface_get_row_at_index (AtkTable *table, gint index); -static AtkObject* table_interface_ref_at (AtkTable *table, +static AtkObject * table_interface_ref_at (AtkTable *table, gint row, gint column); static gint table_interface_get_n_rows (AtkTable *table); @@ -86,29 +86,31 @@ static gboolean table_interface_add_column_selection (AtkTable *table, gint column); static gboolean table_interface_remove_column_selection (AtkTable *table, gint column); -static AtkObject* table_interface_get_row_header (AtkTable *table, gint row); -static AtkObject* table_interface_get_column_header (AtkTable *table, +static AtkObject * table_interface_get_row_header (AtkTable *table, gint row); +static AtkObject * table_interface_get_column_header (AtkTable *table, gint in_col); -static AtkObject* table_interface_get_caption (AtkTable *table); +static AtkObject * table_interface_get_caption (AtkTable *table); static const gchar * -table_interface_get_column_description (AtkTable *table, gint in_col); +table_interface_get_column_description (AtkTable *table, + gint in_col); static const gchar * -table_interface_get_row_description (AtkTable *table, gint row); +table_interface_get_row_description (AtkTable *table, + gint row); -static AtkObject* table_interface_get_summary (AtkTable *table); +static AtkObject *table_interface_get_summary (AtkTable *table); /* atk selection interface */ static void atk_selection_interface_init (AtkSelectionIface *iface); static gboolean selection_interface_add_selection (AtkSelection *selection, - gint i); + gint i); static gboolean selection_interface_clear_selection (AtkSelection *selection); -static AtkObject* selection_interface_ref_selection (AtkSelection *selection, - gint i); +static AtkObject *selection_interface_ref_selection (AtkSelection *selection, + gint i); static gint selection_interface_get_selection_count (AtkSelection *selection); static gboolean selection_interface_is_child_selected (AtkSelection *selection, - gint i); + gint i); /* callbacks */ static void selection_preview_change_cb (ECalendarItem *calitem); @@ -118,18 +120,20 @@ static void date_range_changed_cb (ECalendarItem *calitem); static EaCellTable *ea_calendar_item_get_cell_data (EaCalendarItem *ea_calitem); static void ea_calendar_item_destory_cell_data (EaCalendarItem *ea_calitem); static gboolean ea_calendar_item_get_column_label (EaCalendarItem *ea_calitem, - gint column, - gchar *buffer, - gint buffer_size); + gint column, + gchar *buffer, + gint buffer_size); static gboolean ea_calendar_item_get_row_label (EaCalendarItem *ea_calitem, - gint row, - gchar *buffer, - gint buffer_size); + gint row, + gchar *buffer, + gint buffer_size); static gboolean e_calendar_item_get_offset_for_date (ECalendarItem *calitem, - gint year, gint month, gint day, - gint *offset); + gint year, + gint month, + gint day, + gint *offset); static void ea_calendar_set_focus_object (EaCalendarItem *ea_calitem, - AtkObject *item_cell); + AtkObject *item_cell); #ifdef ACC_DEBUG static gint n_ea_calendar_item_created = 0; @@ -212,7 +216,7 @@ ea_calendar_item_class_init (EaCalendarItemClass *klass) class->ref_child = ea_calendar_item_ref_child; } -AtkObject* +AtkObject * ea_calendar_item_new (GObject *obj) { gpointer object; @@ -350,7 +354,7 @@ ea_calendar_item_get_description (AtkObject *accessible) return _("evolution calendar item"); } -static AtkStateSet* +static AtkStateSet * ea_calendar_item_ref_state_set (AtkObject *accessible) { AtkStateSet *state_set; @@ -403,7 +407,8 @@ ea_calendar_item_get_n_children (AtkObject *accessible) } static AtkObject * -ea_calendar_item_ref_child (AtkObject *accessible, gint index) +ea_calendar_item_ref_child (AtkObject *accessible, + gint index) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; @@ -482,14 +487,14 @@ atk_table_interface_init (AtkTableIface *iface) iface->get_column_description = table_interface_get_column_description; } -static AtkObject* +static AtkObject * table_interface_ref_at (AtkTable *table, - gint row, - gint column) + gint row, + gint column) { gint index; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (table); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (table); index = EA_CALENDAR_COLUMN_NUM * row + column; return ea_calendar_item_ref_child (ATK_OBJECT (ea_calitem), index); } @@ -499,7 +504,7 @@ table_interface_get_n_rows (AtkTable *table) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (table); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (table); gint n_children; atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem); @@ -516,7 +521,7 @@ table_interface_get_n_columns (AtkTable *table) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (table); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (table); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -528,12 +533,12 @@ table_interface_get_n_columns (AtkTable *table) static gint table_interface_get_index_at (AtkTable *table, - gint row, - gint column) + gint row, + gint column) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (table); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (table); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -545,11 +550,11 @@ table_interface_get_index_at (AtkTable *table, static gint table_interface_get_column_at_index (AtkTable *table, - gint index) + gint index) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (table); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (table); gint n_children; atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem); @@ -565,11 +570,11 @@ table_interface_get_column_at_index (AtkTable *table, static gint table_interface_get_row_at_index (AtkTable *table, - gint index) + gint index) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (table); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (table); gint n_children; atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem); @@ -584,14 +589,14 @@ table_interface_get_row_at_index (AtkTable *table, } static gint -table_interface_get_column_extent_at (AtkTable *table, - gint row, - gint column) +table_interface_get_column_extent_at (AtkTable *table, + gint row, + gint column) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; ECalendarItem *calitem; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (table); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (table); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -604,12 +609,13 @@ table_interface_get_column_extent_at (AtkTable *table, static gint table_interface_get_row_extent_at (AtkTable *table, - gint row, gint column) + gint row, + gint column) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; ECalendarItem *calitem; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (table); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (table); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -623,7 +629,7 @@ table_interface_get_row_extent_at (AtkTable *table, /* any day in the row is selected, the row is selected */ static gboolean table_interface_is_row_selected (AtkTable *table, - gint row) + gint row) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; @@ -673,8 +679,8 @@ table_interface_is_row_selected (AtkTable *table, static gboolean table_interface_is_selected (AtkTable *table, - gint row, - gint column) + gint row, + gint column) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; @@ -722,14 +728,14 @@ table_interface_is_selected (AtkTable *table, static gboolean table_interface_is_column_selected (AtkTable *table, - gint column) + gint column) { return FALSE; } static gint table_interface_get_selected_rows (AtkTable *table, - gint **rows_selected) + gint **rows_selected) { *rows_selected = NULL; return -1; @@ -737,7 +743,7 @@ table_interface_get_selected_rows (AtkTable *table, static gint table_interface_get_selected_columns (AtkTable *table, - gint **columns_selected) + gint **columns_selected) { *columns_selected = NULL; return -1; @@ -745,62 +751,63 @@ table_interface_get_selected_columns (AtkTable *table, static gboolean table_interface_add_row_selection (AtkTable *table, - gint row) + gint row) { return FALSE; } static gboolean table_interface_remove_row_selection (AtkTable *table, - gint row) + gint row) { return FALSE; } static gboolean table_interface_add_column_selection (AtkTable *table, - gint column) + gint column) { return FALSE; } static gboolean table_interface_remove_column_selection (AtkTable *table, - gint column) + gint column) { /* FIXME: NOT IMPLEMENTED */ return FALSE; } -static AtkObject* +static AtkObject * table_interface_get_row_header (AtkTable *table, - gint row) + gint row) { /* FIXME: NOT IMPLEMENTED */ return NULL; } -static AtkObject* +static AtkObject * table_interface_get_column_header (AtkTable *table, - gint in_col) + gint in_col) { /* FIXME: NOT IMPLEMENTED */ return NULL; } -static AtkObject* -table_interface_get_caption (AtkTable *table) +static AtkObject * +table_interface_get_caption (AtkTable *table) { /* FIXME: NOT IMPLEMENTED */ return NULL; } static const gchar * -table_interface_get_column_description (AtkTable *table, gint in_col) +table_interface_get_column_description (AtkTable *table, + gint in_col) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (table); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (table); const gchar *description = NULL; EaCellTable *cell_data; gint n_columns; @@ -830,11 +837,12 @@ table_interface_get_column_description (AtkTable *table, gint in_col) } static const gchar * -table_interface_get_row_description (AtkTable *table, gint row) +table_interface_get_row_description (AtkTable *table, + gint row) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (table); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (table); const gchar *description = NULL; EaCellTable *cell_data; gint n_rows; @@ -863,8 +871,8 @@ table_interface_get_row_description (AtkTable *table, gint row) return description; } -static AtkObject* -table_interface_get_summary (AtkTable *table) +static AtkObject * +table_interface_get_summary (AtkTable *table) { /* FIXME: NOT IMPLEMENTED */ return NULL; @@ -885,12 +893,13 @@ atk_selection_interface_init (AtkSelectionIface *iface) } static gboolean -selection_interface_add_selection (AtkSelection *selection, gint index) +selection_interface_add_selection (AtkSelection *selection, + gint index) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; ECalendarItem *calitem; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (selection); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (selection); gint year, month, day; GDate start_date, end_date; @@ -917,7 +926,7 @@ selection_interface_clear_selection (AtkSelection *selection) AtkGObjectAccessible *atk_gobj; GObject *g_obj; ECalendarItem *calitem; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (selection); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (selection); atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem); g_obj = atk_gobject_accessible_get_object (atk_gobj); @@ -930,12 +939,13 @@ selection_interface_clear_selection (AtkSelection *selection) return TRUE; } -static AtkObject* -selection_interface_ref_selection (AtkSelection *selection, gint i) +static AtkObject * +selection_interface_ref_selection (AtkSelection *selection, + gint i) { GObject *g_obj; ECalendarItem *calitem; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (selection); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (selection); gint count, sel_offset; GDate start_date, end_date; @@ -964,7 +974,7 @@ selection_interface_get_selection_count (AtkSelection *selection) AtkGObjectAccessible *atk_gobj; GObject *g_obj; ECalendarItem *calitem; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (selection); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (selection); GDate start_date, end_date; atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem); @@ -980,11 +990,12 @@ selection_interface_get_selection_count (AtkSelection *selection) } static gboolean -selection_interface_is_child_selected (AtkSelection *selection, gint index) +selection_interface_is_child_selected (AtkSelection *selection, + gint index) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; - EaCalendarItem* ea_calitem = EA_CALENDAR_ITEM (selection); + EaCalendarItem * ea_calitem = EA_CALENDAR_ITEM (selection); gint row, column, n_children; atk_gobj = ATK_GOBJECT_ACCESSIBLE (ea_calitem); @@ -1066,7 +1077,7 @@ ea_calendar_item_get_cell_data (EaCalendarItem *ea_calitem) if (!cell_data) { gint n_cells = ea_calendar_item_get_n_children (ATK_OBJECT (ea_calitem)); - cell_data = ea_cell_table_create (n_cells/EA_CALENDAR_COLUMN_NUM, + cell_data = ea_cell_table_create (n_cells / EA_CALENDAR_COLUMN_NUM, EA_CALENDAR_COLUMN_NUM, FALSE); g_object_set_data (G_OBJECT (ea_calitem), @@ -1092,8 +1103,10 @@ ea_calendar_item_destory_cell_data (EaCalendarItem *ea_calitem) } static gboolean -ea_calendar_item_get_row_label (EaCalendarItem *ea_calitem, gint row, - gchar *buffer, gint buffer_size) +ea_calendar_item_get_row_label (EaCalendarItem *ea_calitem, + gint row, + gchar *buffer, + gint buffer_size) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; @@ -1123,8 +1136,10 @@ ea_calendar_item_get_row_label (EaCalendarItem *ea_calitem, gint row, } static gboolean -ea_calendar_item_get_column_label (EaCalendarItem *ea_calitem, gint column, - gchar *buffer, gint buffer_size) +ea_calendar_item_get_column_label (EaCalendarItem *ea_calitem, + gint column, + gchar *buffer, + gint buffer_size) { AtkGObjectAccessible *atk_gobj; GObject *g_obj; @@ -1147,9 +1162,13 @@ ea_calendar_item_get_column_label (EaCalendarItem *ea_calitem, gint column, /* the coordinate the e-calendar canvas coord */ gboolean e_calendar_item_get_day_extents (ECalendarItem *calitem, - gint year, gint month, gint date, - gint *x, gint *y, - gint *width, gint *height) + gint year, + gint month, + gint date, + gint *x, + gint *y, + gint *width, + gint *height) { GnomeCanvasItem *item; GtkWidget *widget; @@ -1229,8 +1248,11 @@ e_calendar_item_get_day_extents (ECalendarItem *calitem, /* month is from 0 to 11 */ gboolean -e_calendar_item_get_date_for_offset (ECalendarItem *calitem, gint day_offset, - gint *year, gint *month, gint *day) +e_calendar_item_get_date_for_offset (ECalendarItem *calitem, + gint day_offset, + gint *year, + gint *month, + gint *day) { gint start_year, start_month, start_day; gint end_year, end_month, end_day; @@ -1258,8 +1280,10 @@ e_calendar_item_get_date_for_offset (ECalendarItem *calitem, gint day_offset, /* the arg month is from 0 to 11 */ static gboolean e_calendar_item_get_offset_for_date (ECalendarItem *calitem, - gint year, gint month, gint day, - gint *offset) + gint year, + gint month, + gint day, + gint *offset) { gint start_year, start_month, start_day; gint end_year, end_month, end_day; @@ -1286,7 +1310,8 @@ e_calendar_item_get_offset_for_date (ECalendarItem *calitem, gint e_calendar_item_get_n_days_from_week_start (ECalendarItem *calitem, - gint year, gint month) + gint year, + gint month) { struct tm tmp_tm; gint start_weekday, days_from_week_start; @@ -1304,7 +1329,8 @@ e_calendar_item_get_n_days_from_week_start (ECalendarItem *calitem, } static void -ea_calendar_set_focus_object (EaCalendarItem *ea_calitem, AtkObject *item_cell) +ea_calendar_set_focus_object (EaCalendarItem *ea_calitem, + AtkObject *item_cell) { AtkStateSet *state_set, *old_state_set; AtkObject *old_cell; diff --git a/widgets/misc/ea-cell-table.c b/widgets/misc/ea-cell-table.c index c0c2bc0cde..bbdef0aea1 100644 --- a/widgets/misc/ea-cell-table.c +++ b/widgets/misc/ea-cell-table.c @@ -27,9 +27,11 @@ #include "ea-cell-table.h" EaCellTable * -ea_cell_table_create (gint rows, gint columns, gboolean column_first) +ea_cell_table_create (gint rows, + gint columns, + gboolean column_first) { - EaCellTable * cell_data; + EaCellTable *cell_data; gint index; g_return_val_if_fail (((columns > 0) && (rows > 0)), NULL); @@ -55,7 +57,7 @@ ea_cell_table_create (gint rows, gint columns, gboolean column_first) } void -ea_cell_table_destroy (EaCellTable * cell_data) +ea_cell_table_destroy (EaCellTable *cell_data) { gint index; g_return_if_fail (cell_data); @@ -80,8 +82,9 @@ ea_cell_table_destroy (EaCellTable * cell_data) } gpointer -ea_cell_table_get_cell (EaCellTable * cell_data, - gint row, gint column) +ea_cell_table_get_cell (EaCellTable *cell_data, + gint row, + gint column) { gint index; @@ -95,8 +98,10 @@ ea_cell_table_get_cell (EaCellTable * cell_data, } gboolean -ea_cell_table_set_cell (EaCellTable * cell_data, - gint row, gint column, gpointer cell) +ea_cell_table_set_cell (EaCellTable *cell_data, + gint row, + gint column, + gpointer cell) { gint index; @@ -117,8 +122,8 @@ ea_cell_table_set_cell (EaCellTable * cell_data, } gpointer -ea_cell_table_get_cell_at_index (EaCellTable * cell_data, - gint index) +ea_cell_table_get_cell_at_index (EaCellTable *cell_data, + gint index) { g_return_val_if_fail (cell_data, NULL); @@ -128,8 +133,9 @@ ea_cell_table_get_cell_at_index (EaCellTable * cell_data, } gboolean -ea_cell_table_set_cell_at_index (EaCellTable * cell_data, - gint index, gpointer cell) +ea_cell_table_set_cell_at_index (EaCellTable *cell_data, + gint index, + gpointer cell) { g_return_val_if_fail (cell_data, FALSE); @@ -147,8 +153,8 @@ ea_cell_table_set_cell_at_index (EaCellTable * cell_data, } const gchar * -ea_cell_table_get_column_label (EaCellTable * cell_data, - gint column) +ea_cell_table_get_column_label (EaCellTable *cell_data, + gint column) { g_return_val_if_fail (cell_data, NULL); g_return_val_if_fail ((column >= 0 && column < cell_data->columns), NULL); @@ -157,8 +163,9 @@ ea_cell_table_get_column_label (EaCellTable * cell_data, } void -ea_cell_table_set_column_label (EaCellTable * cell_data, - gint column, const gchar *label) +ea_cell_table_set_column_label (EaCellTable *cell_data, + gint column, + const gchar *label) { g_return_if_fail (cell_data); g_return_if_fail ((column >= 0 && column < cell_data->columns)); @@ -169,8 +176,8 @@ ea_cell_table_set_column_label (EaCellTable * cell_data, } const gchar * -ea_cell_table_get_row_label (EaCellTable * cell_data, - gint row) +ea_cell_table_get_row_label (EaCellTable *cell_data, + gint row) { g_return_val_if_fail (cell_data, NULL); g_return_val_if_fail ((row >= 0 && row < cell_data->rows), NULL); @@ -179,8 +186,9 @@ ea_cell_table_get_row_label (EaCellTable * cell_data, } void -ea_cell_table_set_row_label (EaCellTable * cell_data, - gint row, const gchar *label) +ea_cell_table_set_row_label (EaCellTable *cell_data, + gint row, + const gchar *label) { g_return_if_fail (cell_data); g_return_if_fail ((row >= 0 && row < cell_data->rows)); @@ -192,7 +200,8 @@ ea_cell_table_set_row_label (EaCellTable * cell_data, gint ea_cell_table_get_index (EaCellTable *cell_data, - gint row, gint column) + gint row, + gint column) { g_return_val_if_fail (cell_data, -1); if (row < 0 || row >= cell_data->rows || diff --git a/widgets/misc/test-calendar.c b/widgets/misc/test-calendar.c index 83b8f11cd7..7a4d2f8954 100644 --- a/widgets/misc/test-calendar.c +++ b/widgets/misc/test-calendar.c @@ -46,14 +46,15 @@ static void on_selection_changed (ECalendarItem *calitem); static void delete_event_cb (GtkWidget *widget, - GdkEventAny *event, - gpointer data) + GdkEventAny *event, + gpointer data) { gtk_main_quit (); } gint -main (gint argc, gchar **argv) +main (gint argc, + gchar **argv) { GtkWidget *window; GtkWidget *cal; diff --git a/widgets/misc/test-dateedit.c b/widgets/misc/test-dateedit.c index 79ca726c3e..2629fad4e0 100644 --- a/widgets/misc/test-dateedit.c +++ b/widgets/misc/test-dateedit.c @@ -48,7 +48,8 @@ static void on_time_changed (EDateEdit *dedit, #endif gint -main (gint argc, gchar **argv) +main (gint argc, + gchar **argv) { GtkWidget *window; EDateEdit *dedit; @@ -94,14 +95,14 @@ main (gint argc, gchar **argv) gtk_table_attach (GTK_TABLE (table), button, 1, 2, 0, 1, 0, 0, 0, 0); gtk_widget_show (button); - g_signal_connect((button), "clicked", + g_signal_connect ((button), "clicked", G_CALLBACK (on_get_date_clicked), dedit); /* EDateEdit 2. */ dedit = E_DATE_EDIT (e_date_edit_new ()); - gtk_table_attach (GTK_TABLE (table), (GtkWidget*) dedit, + gtk_table_attach (GTK_TABLE (table), (GtkWidget *) dedit, 0, 1, 1, 2, GTK_FILL, GTK_EXPAND, 0, 0); - gtk_widget_show ((GtkWidget*) (dedit)); + gtk_widget_show ((GtkWidget *) (dedit)); e_date_edit_set_week_start_day (dedit, 1); e_date_edit_set_show_week_numbers (dedit, TRUE); e_date_edit_set_use_24_hour_format (dedit, FALSE); @@ -127,9 +128,9 @@ main (gint argc, gchar **argv) /* EDateEdit 3. */ dedit = E_DATE_EDIT (e_date_edit_new ()); - gtk_table_attach (GTK_TABLE (table), (GtkWidget*) dedit, + gtk_table_attach (GTK_TABLE (table), (GtkWidget *) dedit, 0, 1, 2, 3, GTK_FILL, GTK_EXPAND, 0, 0); - gtk_widget_show ((GtkWidget*) (dedit)); + gtk_widget_show ((GtkWidget *) (dedit)); e_date_edit_set_week_start_day (dedit, 1); e_date_edit_set_show_week_numbers (dedit, TRUE); e_date_edit_set_use_24_hour_format (dedit, FALSE); @@ -168,9 +169,9 @@ main (gint argc, gchar **argv) } static void -delete_event_cb (GtkWidget *widget, - GdkEventAny *event, - GtkWidget *window) +delete_event_cb (GtkWidget *widget, + GdkEventAny *event, + GtkWidget *window) { gtk_widget_destroy (window); @@ -178,8 +179,8 @@ delete_event_cb (GtkWidget *widget, } static void -on_get_date_clicked (GtkWidget *button, - EDateEdit *dedit) +on_get_date_clicked (GtkWidget *button, + EDateEdit *dedit) { time_t t; @@ -197,8 +198,8 @@ on_get_date_clicked (GtkWidget *button, } static void -on_toggle_24_hour_clicked (GtkWidget *button, - EDateEdit *dedit) +on_toggle_24_hour_clicked (GtkWidget *button, + EDateEdit *dedit) { gboolean use_24_hour_format; @@ -208,8 +209,8 @@ on_toggle_24_hour_clicked (GtkWidget *button, #if 0 static void -on_date_changed (EDateEdit *dedit, - gchar *name) +on_date_changed (EDateEdit *dedit, + gchar *name) { gint year, month, day; @@ -226,8 +227,8 @@ on_date_changed (EDateEdit *dedit, } static void -on_time_changed (EDateEdit *dedit, - gchar *name) +on_time_changed (EDateEdit *dedit, + gchar *name) { gint hour, minute; @@ -245,8 +246,8 @@ on_time_changed (EDateEdit *dedit, #endif static void -on_changed (EDateEdit *dedit, - gchar *name) +on_changed (EDateEdit *dedit, + gchar *name) { gint year, month, day, hour, minute; diff --git a/widgets/misc/test-preferences-window.c b/widgets/misc/test-preferences-window.c index e7c4499d6a..738d7ff403 100644 --- a/widgets/misc/test-preferences-window.c +++ b/widgets/misc/test-preferences-window.c @@ -71,8 +71,8 @@ add_pages (EPreferencesWindow *preferences_window) static gint delete_event_callback (GtkWidget *widget, - GdkEventAny *event, - gpointer data) + GdkEventAny *event, + gpointer data) { gtk_main_quit (); @@ -80,7 +80,8 @@ delete_event_callback (GtkWidget *widget, } gint -main (gint argc, gchar **argv) +main (gint argc, + gchar **argv) { GtkWidget *window; diff --git a/widgets/table/e-cell-checkbox.c b/widgets/table/e-cell-checkbox.c index 7969e2b4f0..9e775761c7 100644 --- a/widgets/table/e-cell-checkbox.c +++ b/widgets/table/e-cell-checkbox.c @@ -42,9 +42,13 @@ G_DEFINE_TYPE (ECellCheckbox, e_cell_checkbox, E_TYPE_CELL_TOGGLE) static GdkPixbuf *checks[2]; static void -ecc_print (ECellView *ecell_view, GtkPrintContext *context, - gint model_col, gint view_col, gint row, - gdouble width, gdouble height) +ecc_print (ECellView *ecell_view, + GtkPrintContext *context, + gint model_col, + gint view_col, + gint row, + gdouble width, + gdouble height) { cairo_t *cr = gtk_print_context_get_cairo_context (context); const gint value = GPOINTER_TO_INT ( diff --git a/widgets/table/e-cell-combo.c b/widgets/table/e-cell-combo.c index f759185a56..2617cfafdf 100644 --- a/widgets/table/e-cell-combo.c +++ b/widgets/table/e-cell-combo.c @@ -109,7 +109,7 @@ static void e_cell_combo_restart_edit (ECellCombo *ecc); G_DEFINE_TYPE (ECellCombo, e_cell_combo, E_TYPE_CELL_POPUP) static void -e_cell_combo_class_init (ECellComboClass *class) +e_cell_combo_class_init (ECellComboClass *class) { ECellPopupClass *ecpc = E_CELL_POPUP_CLASS (class); GObjectClass *object_class = G_OBJECT_CLASS (class); @@ -120,7 +120,7 @@ e_cell_combo_class_init (ECellComboClass *class) } static void -e_cell_combo_init (ECellCombo *ecc) +e_cell_combo_init (ECellCombo *ecc) { GtkWidget *frame; AtkObject *a11y; @@ -129,7 +129,7 @@ e_cell_combo_init (ECellCombo *ecc) GtkScrolledWindow *scrolled_window; /* We create one popup window for the ECell, since there will only - ever be one popup in use at a time. */ + * ever be one popup in use at a time. */ ecc->popup_window = gtk_window_new (GTK_WINDOW_POPUP); gtk_window_set_type_hint ( @@ -292,10 +292,10 @@ e_cell_combo_do_popup (ECellPopup *ecp, } static void -e_cell_combo_select_matching_item (ECellCombo *ecc) +e_cell_combo_select_matching_item (ECellCombo *ecc) { ECellPopup *ecp = E_CELL_POPUP (ecc); - ECellView *ecv = (ECellView*) ecp->popup_cell_view; + ECellView *ecv = (ECellView *) ecp->popup_cell_view; ECellText *ecell_text = E_CELL_TEXT (ecp->child); ETableItem *eti = E_TABLE_ITEM (ecp->popup_cell_view->cell_view.e_table_item_view); ETableCol *ecol; @@ -342,7 +342,9 @@ e_cell_combo_select_matching_item (ECellCombo *ecc) } static void -e_cell_combo_show_popup (ECellCombo *ecc, gint row, gint view_col) +e_cell_combo_show_popup (ECellCombo *ecc, + gint row, + gint view_col) { GdkWindow *window; GtkAllocation allocation; @@ -379,13 +381,13 @@ e_cell_combo_show_popup (ECellCombo *ecc, gint row, gint view_col) /* Calculates the size and position of the popup window (like GtkCombo). */ static void -e_cell_combo_get_popup_pos (ECellCombo *ecc, - gint row, - gint view_col, - gint *x, - gint *y, - gint *height, - gint *width) +e_cell_combo_get_popup_pos (ECellCombo *ecc, + gint row, + gint view_col, + gint *x, + gint *y, + gint *height, + gint *width) { ECellPopup *ecp = E_CELL_POPUP (ecc); ETableItem *eti = E_TABLE_ITEM (ecp->popup_cell_view->cell_view.e_table_item_view); @@ -448,7 +450,7 @@ e_cell_combo_get_popup_pos (ECellCombo *ecc, avail_height = gdk_screen_height () - *y; /* We'll use the entire screen width if needed, but we save space for - the vertical scrollbar in case we need to show that. */ + * the vertical scrollbar in case we need to show that. */ screen_width = gdk_screen_width (); avail_width = screen_width - scrollbar_width; @@ -481,7 +483,7 @@ e_cell_combo_get_popup_pos (ECellCombo *ecc, *width = column_width; /* If it is larger than the available width, use that instead and show - the horizontal scrollbar. */ + * the horizontal scrollbar. */ if (*width > avail_width) { *width = avail_width; show_hscroll = TRUE; @@ -506,11 +508,11 @@ e_cell_combo_get_popup_pos (ECellCombo *ecc, /* Check if it fits in the available height. */ if (work_height + list_requisition.height > avail_height) { /* It doesn't fit, so we see if we have the minimum space - needed. */ + * needed. */ if (work_height + min_height > avail_height && *y - row_height > avail_height) { /* We don't, so we show the popup above the cell - instead of below it. */ + * instead of below it. */ avail_height = *y - row_height; *y -= (work_height + list_requisition.height + row_height); @@ -526,7 +528,7 @@ e_cell_combo_get_popup_pos (ECellCombo *ecc, } /* We try to line it up with the right edge of the column, but we don't - want it to go off the edges of the screen. */ + * want it to go off the edges of the screen. */ if (*x > screen_width) *x = screen_width; *x -= *width; @@ -540,7 +542,8 @@ e_cell_combo_get_popup_pos (ECellCombo *ecc, } static void -e_cell_combo_selection_changed (GtkTreeSelection *selection, ECellCombo *ecc) +e_cell_combo_selection_changed (GtkTreeSelection *selection, + ECellCombo *ecc) { GtkTreeIter iter; GtkTreeModel *model; @@ -554,25 +557,25 @@ e_cell_combo_selection_changed (GtkTreeSelection *selection, ECellCombo *ecc) } /* This handles button press events in the popup window. - Note that since we have a pointer grab on this window, we also get button - press events for windows outside the application here, so we hide the popup - window if that happens. We also get propagated events from child widgets - which we ignore. */ + * Note that since we have a pointer grab on this window, we also get button + * press events for windows outside the application here, so we hide the popup + * window if that happens. We also get propagated events from child widgets + * which we ignore. */ static gint -e_cell_combo_button_press (GtkWidget *popup_window, - GdkEvent *event, - ECellCombo *ecc) +e_cell_combo_button_press (GtkWidget *popup_window, + GdkEvent *event, + ECellCombo *ecc) { GtkWidget *event_widget; event_widget = gtk_get_event_widget (event); /* If the button press was for a widget inside the popup list, but - not the popup window itself, then we ignore the event and return - FALSE. Otherwise we will hide the popup. - Note that since we have a pointer grab on the popup list, button - presses outside the application will be reported to this window, - which is why we hide the popup in this case. */ + * not the popup window itself, then we ignore the event and return + * FALSE. Otherwise we will hide the popup. + * Note that since we have a pointer grab on the popup list, button + * presses outside the application will be reported to this window, + * which is why we hide the popup in this case. */ while (event_widget) { event_widget = gtk_widget_get_parent (event_widget); if (event_widget == ecc->popup_tree_view) @@ -588,10 +591,10 @@ e_cell_combo_button_press (GtkWidget *popup_window, d(g_print("%s: popup_shown = FALSE\n", __FUNCTION__)); /* We don't want to update the cell here. Since the list is in browse - mode there will always be one item selected, so when we popup the - list one item is selected even if it doesn't match the current text - in the cell. So if you click outside the popup (which is what has - happened here) it is better to not update the cell. */ + * mode there will always be one item selected, so when we popup the + * list one item is selected even if it doesn't match the current text + * in the cell. So if you click outside the popup (which is what has + * happened here) it is better to not update the cell. */ /*e_cell_combo_update_cell (ecc);*/ e_cell_combo_restart_edit (ecc); @@ -599,16 +602,16 @@ e_cell_combo_button_press (GtkWidget *popup_window, } /* This handles button release events in the popup window. If the button is - released inside the list, we want to hide the popup window and update the - cell with the new selection. */ + * released inside the list, we want to hide the popup window and update the + * cell with the new selection. */ static gint -e_cell_combo_button_release (GtkWidget *popup_window, - GdkEventButton *event, - ECellCombo *ecc) +e_cell_combo_button_release (GtkWidget *popup_window, + GdkEventButton *event, + ECellCombo *ecc) { GtkWidget *event_widget; - event_widget = gtk_get_event_widget ((GdkEvent*) event); + event_widget = gtk_get_event_widget ((GdkEvent *) event); /* See if the button was released in the list (or its children). */ while (event_widget && event_widget != ecc->popup_tree_view) @@ -619,7 +622,7 @@ e_cell_combo_button_release (GtkWidget *popup_window, return FALSE; /* The button was released inside the list, so we hide the popup and - update the cell to reflect the new selection. */ + * update the cell to reflect the new selection. */ gtk_grab_remove (ecc->popup_window); gdk_pointer_ungrab (event->time); gdk_keyboard_ungrab (event->time); @@ -635,11 +638,11 @@ e_cell_combo_button_release (GtkWidget *popup_window, } /* This handles key press events in the popup window. If the Escape key is - pressed we hide the popup, and do not change the cell contents. */ + * pressed we hide the popup, and do not change the cell contents. */ static gint -e_cell_combo_key_press (GtkWidget *popup_window, - GdkEventKey *event, - ECellCombo *ecc) +e_cell_combo_key_press (GtkWidget *popup_window, + GdkEventKey *event, + ECellCombo *ecc) { /* If the Escape key is pressed we hide the popup. */ if (event->keyval != GDK_KEY_Escape @@ -670,10 +673,10 @@ e_cell_combo_key_press (GtkWidget *popup_window, } static void -e_cell_combo_update_cell (ECellCombo *ecc) +e_cell_combo_update_cell (ECellCombo *ecc) { ECellPopup *ecp = E_CELL_POPUP (ecc); - ECellView *ecv = (ECellView*) ecp->popup_cell_view; + ECellView *ecv = (ECellView *) ecp->popup_cell_view; ECellText *ecell_text = E_CELL_TEXT (ecp->child); ETableItem *eti = E_TABLE_ITEM (ecv->e_table_item_view); ETableCol *ecol; @@ -708,11 +711,11 @@ e_cell_combo_update_cell (ECellCombo *ecc) } static void -e_cell_combo_restart_edit (ECellCombo *ecc) +e_cell_combo_restart_edit (ECellCombo *ecc) { /* This doesn't work. ETable stops the edit straight-away again. */ #if 0 - ECellView *ecv = (ECellView*) ecc->popup_cell_view; + ECellView *ecv = (ECellView *) ecc->popup_cell_view; ETableItem *eti = E_TABLE_ITEM (ecv->e_table_item_view); e_table_item_enter_edit (eti, ecc->popup_view_col, ecc->popup_row); diff --git a/widgets/table/e-cell-date-edit.c b/widgets/table/e-cell-date-edit.c index 7517ad0e9c..3035652116 100644 --- a/widgets/table/e-cell-date-edit.c +++ b/widgets/table/e-cell-date-edit.c @@ -219,7 +219,7 @@ e_cell_date_edit_init (ECellDateEdit *ecde) ecde->time_callback_destroy = NULL; /* We create one popup window for the ECell, since there will only - ever be one popup in use at a time. */ + * ever be one popup in use at a time. */ ecde->popup_window = gtk_window_new (GTK_WINDOW_POPUP); gtk_window_set_type_hint (GTK_WINDOW (ecde->popup_window), @@ -299,7 +299,7 @@ e_cell_date_edit_init (ECellDateEdit *ecde) now_button = gtk_button_new_with_label (_("Now")); gtk_container_add (GTK_CONTAINER (bbox), now_button); gtk_widget_show (now_button); - g_signal_connect((now_button), "clicked", + g_signal_connect ((now_button), "clicked", G_CALLBACK (e_cell_date_edit_on_now_clicked), ecde); ecde->now_button = now_button; @@ -307,7 +307,7 @@ e_cell_date_edit_init (ECellDateEdit *ecde) today_button = gtk_button_new_with_label (_("Today")); gtk_container_add (GTK_CONTAINER (bbox), today_button); gtk_widget_show (today_button); - g_signal_connect((today_button), "clicked", + g_signal_connect ((today_button), "clicked", G_CALLBACK (e_cell_date_edit_on_today_clicked), ecde); ecde->today_button = today_button; @@ -316,7 +316,7 @@ e_cell_date_edit_init (ECellDateEdit *ecde) none_button = gtk_button_new_with_label (C_("table-date", "None")); gtk_container_add (GTK_CONTAINER (bbox), none_button); gtk_widget_show (none_button); - g_signal_connect((none_button), "clicked", + g_signal_connect ((none_button), "clicked", G_CALLBACK (e_cell_date_edit_on_none_clicked), ecde); ecde->none_button = none_button; @@ -324,7 +324,7 @@ e_cell_date_edit_init (ECellDateEdit *ecde) ok_button = gtk_button_new_with_label (_("OK")); gtk_container_add (GTK_CONTAINER (bbox), ok_button); gtk_widget_show (ok_button); - g_signal_connect((ok_button), "clicked", + g_signal_connect ((ok_button), "clicked", G_CALLBACK (e_cell_date_edit_on_ok_clicked), ecde); @@ -346,16 +346,16 @@ e_cell_date_edit_init (ECellDateEdit *ecde) * Returns: an ECellDateEdit object. */ ECell * -e_cell_date_edit_new (void) +e_cell_date_edit_new (void) { return g_object_new (e_cell_date_edit_get_type (), NULL); } static void -e_cell_date_edit_get_property (GObject *object, - guint property_id, - GValue *value, - GParamSpec *pspec) +e_cell_date_edit_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { ECellDateEdit *ecde; @@ -389,10 +389,10 @@ e_cell_date_edit_get_property (GObject *object, } static void -e_cell_date_edit_set_property (GObject *object, - guint property_id, - const GValue *value, - GParamSpec *pspec) +e_cell_date_edit_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { ECellDateEdit *ecde; gint ivalue; @@ -477,10 +477,10 @@ e_cell_date_edit_dispose (GObject *object) } static gint -e_cell_date_edit_do_popup (ECellPopup *ecp, - GdkEvent *event, - gint row, - gint view_col) +e_cell_date_edit_do_popup (ECellPopup *ecp, + GdkEvent *event, + gint row, + gint view_col) { ECellDateEdit *ecde = E_CELL_DATE_EDIT (ecp); GdkWindow *window; @@ -499,11 +499,11 @@ e_cell_date_edit_do_popup (ECellPopup *ecp, } static void -e_cell_date_edit_set_popup_values (ECellDateEdit *ecde) +e_cell_date_edit_set_popup_values (ECellDateEdit *ecde) { ECellPopup *ecp = E_CELL_POPUP (ecde); ECellText *ecell_text = E_CELL_TEXT (ecp->child); - ECellView *ecv = (ECellView*) ecp->popup_cell_view; + ECellView *ecv = (ECellView *) ecp->popup_cell_view; ETableItem *eti = E_TABLE_ITEM (ecp->popup_cell_view->cell_view.e_table_item_view); ETableCol *ecol; gchar *cell_text; @@ -519,7 +519,7 @@ e_cell_date_edit_set_popup_values (ECellDateEdit *ecde) ecol->col_idx, ecp->popup_row); /* Try to parse just a date first. If the value is only a date, we - use a DATE value. */ + * use a DATE value. */ status = e_time_parse_date (cell_text, &date_tm); if (status == E_TIME_PARSE_INVALID) { is_date = FALSE; @@ -527,7 +527,7 @@ e_cell_date_edit_set_popup_values (ECellDateEdit *ecde) } /* If there is no date and time set, or the date is invalid, we clear - the selections, else we select the appropriate date & time. */ + * the selections, else we select the appropriate date & time. */ calitem = E_CALENDAR_ITEM (E_CALENDAR (ecde->calendar)->calitem); if (status == E_TIME_PARSE_NONE || status == E_TIME_PARSE_INVALID) { gtk_entry_set_text (GTK_ENTRY (ecde->time_entry), ""); @@ -562,8 +562,8 @@ e_cell_date_edit_set_popup_values (ECellDateEdit *ecde) } static void -e_cell_date_edit_select_matching_time (ECellDateEdit *ecde, - gchar *time) +e_cell_date_edit_select_matching_time (ECellDateEdit *ecde, + gchar *time) { gboolean found = FALSE; gboolean valid; @@ -605,9 +605,9 @@ e_cell_date_edit_select_matching_time (ECellDateEdit *ecde, } static void -e_cell_date_edit_show_popup (ECellDateEdit *ecde, - gint row, - gint view_col) +e_cell_date_edit_show_popup (ECellDateEdit *ecde, + gint row, + gint view_col) { GdkWindow *window; gint x, y, width, height; @@ -631,13 +631,13 @@ e_cell_date_edit_show_popup (ECellDateEdit *ecde, /* Calculates the size and position of the popup window (like GtkCombo). */ static void -e_cell_date_edit_get_popup_pos (ECellDateEdit *ecde, - gint row, - gint view_col, - gint *x, - gint *y, - gint *height, - gint *width) +e_cell_date_edit_get_popup_pos (ECellDateEdit *ecde, + gint row, + gint view_col, + gint *x, + gint *y, + gint *height, + gint *width) { ECellPopup *ecp = E_CELL_POPUP (ecde); ETableItem *eti = E_TABLE_ITEM (ecp->popup_cell_view->cell_view.e_table_item_view); @@ -672,7 +672,7 @@ e_cell_date_edit_get_popup_pos (ECellDateEdit *ecde, *x += x1; /* The ETable positions don't include the grid lines, I think, so we - add 1. */ + * add 1. */ scrollable = GTK_SCROLLABLE (&GNOME_CANVAS (canvas)->layout); adjustment = gtk_scrollable_get_vadjustment (scrollable); value = (gint) gtk_adjustment_get_value (adjustment); @@ -681,7 +681,7 @@ e_cell_date_edit_get_popup_pos (ECellDateEdit *ecde, avail_height = gdk_screen_height () - *y; /* We'll use the entire screen width if needed, but we save space for - the vertical scrollbar in case we need to show that. */ + * the vertical scrollbar in case we need to show that. */ screen_width = gdk_screen_width (); gtk_widget_get_preferred_size (ecde->popup_window, &popup_requisition, NULL); @@ -696,10 +696,10 @@ e_cell_date_edit_get_popup_pos (ECellDateEdit *ecde, /* Check if it fits in the available height. */ if (popup_requisition.height > avail_height) { /* It doesn't fit, so we see if we have the minimum space - needed. */ + * needed. */ if (*y - row_height > avail_height) { /* We don't, so we show the popup above the cell - instead of below it. */ + * instead of below it. */ *y -= (popup_requisition.height + row_height); if (*y < 0) *y = 0; @@ -707,7 +707,7 @@ e_cell_date_edit_get_popup_pos (ECellDateEdit *ecde, } /* We try to line it up with the right edge of the column, but we don't - want it to go off the edges of the screen. */ + * want it to go off the edges of the screen. */ if (*x > screen_width) *x = screen_width; *x -= *width; @@ -718,11 +718,11 @@ e_cell_date_edit_get_popup_pos (ECellDateEdit *ecde, } /* This handles key press events in the popup window. If the Escape key is - pressed we hide the popup, and do not change the cell contents. */ + * pressed we hide the popup, and do not change the cell contents. */ static gint -e_cell_date_edit_key_press (GtkWidget *popup_window, - GdkEventKey *event, - ECellDateEdit *ecde) +e_cell_date_edit_key_press (GtkWidget *popup_window, + GdkEventKey *event, + ECellDateEdit *ecde) { /* If the Escape key is pressed we hide the popup. */ if (event->keyval != GDK_KEY_Escape) @@ -734,16 +734,16 @@ e_cell_date_edit_key_press (GtkWidget *popup_window, } /* This handles button press events in the popup window. If the button is - pressed outside the popup, we hide it and do not change the cell contents. + * pressed outside the popup, we hide it and do not change the cell contents. */ static gint -e_cell_date_edit_button_press (GtkWidget *popup_window, - GdkEventButton *event, - ECellDateEdit *ecde) +e_cell_date_edit_button_press (GtkWidget *popup_window, + GdkEventButton *event, + ECellDateEdit *ecde) { GtkWidget *event_widget; - event_widget = gtk_get_event_widget ((GdkEvent*) event); + event_widget = gtk_get_event_widget ((GdkEvent *) event); if (gtk_widget_get_toplevel (event_widget) != popup_window) { e_cell_date_edit_hide_popup (ecde); } @@ -752,9 +752,9 @@ e_cell_date_edit_button_press (GtkWidget *popup_window, } /* Clears the time list and rebuilds it using the lower_hour, upper_hour - and use_24_hour_format settings. */ + * and use_24_hour_format settings. */ static void -e_cell_date_edit_rebuild_time_list (ECellDateEdit *ecde) +e_cell_date_edit_rebuild_time_list (ECellDateEdit *ecde) { GtkListStore *store; gchar buffer[40]; @@ -774,7 +774,7 @@ e_cell_date_edit_rebuild_time_list (ECellDateEdit *ecde) for (hour = ecde->lower_hour; hour <= ecde->upper_hour; hour++) { /* We don't want to display midnight at the end, since that is - really in the next day. */ + * really in the next day. */ if (hour == 24) break; @@ -798,8 +798,8 @@ e_cell_date_edit_rebuild_time_list (ECellDateEdit *ecde) } static void -e_cell_date_edit_on_ok_clicked (GtkWidget *button, - ECellDateEdit *ecde) +e_cell_date_edit_on_ok_clicked (GtkWidget *button, + ECellDateEdit *ecde) { ECalendarItem *calitem; GDate start_date, end_date; @@ -860,7 +860,7 @@ e_cell_date_edit_show_time_invalid_warning (ECellDateEdit *ecde) buffer, sizeof (buffer)); /* FIXME: Fix transient settings - I'm not sure it works with popup - windows. Maybe we need to use a normal window without decorations.*/ + * windows. Maybe we need to use a normal window without decorations.*/ dialog = gtk_message_dialog_new ( GTK_WINDOW (ecde->popup_window), GTK_DIALOG_DESTROY_WITH_PARENT, @@ -937,7 +937,7 @@ e_cell_date_edit_update_cell (ECellDateEdit *ecde, { ECellPopup *ecp = E_CELL_POPUP (ecde); ECellText *ecell_text = E_CELL_TEXT (ecp->child); - ECellView *ecv = (ECellView*) ecp->popup_cell_view; + ECellView *ecv = (ECellView *) ecp->popup_cell_view; ETableItem *eti = E_TABLE_ITEM (ecv->e_table_item_view); ETableCol *ecol; gchar *old_text; @@ -991,10 +991,10 @@ e_cell_date_edit_hide_popup (ECellDateEdit *ecde) } /* These freeze and thaw the rebuilding of the time list. They are useful when - setting several properties which result in rebuilds of the list, e.g. the - lower_hour, upper_hour and use_24_hour_format properties. */ + * setting several properties which result in rebuilds of the list, e.g. the + * lower_hour, upper_hour and use_24_hour_format properties. */ void -e_cell_date_edit_freeze (ECellDateEdit *ecde) +e_cell_date_edit_freeze (ECellDateEdit *ecde) { g_return_if_fail (E_IS_CELL_DATE_EDIT (ecde)); @@ -1002,7 +1002,7 @@ e_cell_date_edit_freeze (ECellDateEdit *ecde) } void -e_cell_date_edit_thaw (ECellDateEdit *ecde) +e_cell_date_edit_thaw (ECellDateEdit *ecde) { g_return_if_fail (E_IS_CELL_DATE_EDIT (ecde)); @@ -1015,13 +1015,13 @@ e_cell_date_edit_thaw (ECellDateEdit *ecde) } /* Sets a callback to use to get the current time. This is useful if the - application needs to use its own timezone data rather than rely on the - Unix timezone. */ + * application needs to use its own timezone data rather than rely on the + * Unix timezone. */ void -e_cell_date_edit_set_get_time_callback (ECellDateEdit *ecde, - ECellDateEditGetTimeCallback cb, - gpointer data, - GDestroyNotify destroy) +e_cell_date_edit_set_get_time_callback (ECellDateEdit *ecde, + ECellDateEditGetTimeCallback cb, + gpointer data, + GDestroyNotify destroy) { g_return_if_fail (E_IS_CELL_DATE_EDIT (ecde)); diff --git a/widgets/table/e-cell-date-edit.h b/widgets/table/e-cell-date-edit.h index 5224b0ddff..186302d79a 100644 --- a/widgets/table/e-cell-date-edit.h +++ b/widgets/table/e-cell-date-edit.h @@ -84,7 +84,7 @@ struct _ECellDateEdit { gboolean need_time_list_rebuild; /* The freeze count for rebuilding the time list. We only rebuild when - this is 0. */ + * this is 0. */ gint freeze_count; ECellDateEditGetTimeCallback time_callback; @@ -100,14 +100,14 @@ GType e_cell_date_edit_get_type (void) G_GNUC_CONST; ECell * e_cell_date_edit_new (void); /* These freeze and thaw the rebuilding of the time list. They are useful when - setting several properties which result in rebuilds of the list, e.g. the - lower_hour, upper_hour and use_24_hour_format properties. */ + * setting several properties which result in rebuilds of the list, e.g. the + * lower_hour, upper_hour and use_24_hour_format properties. */ void e_cell_date_edit_freeze (ECellDateEdit *ecde); void e_cell_date_edit_thaw (ECellDateEdit *ecde); /* Sets a callback to use to get the current time. This is useful if the - application needs to use its own timezone data rather than rely on the - Unix timezone. */ + * application needs to use its own timezone data rather than rely on the + * Unix timezone. */ void e_cell_date_edit_set_get_time_callback (ECellDateEdit *ecde, ECellDateEditGetTimeCallback cb, diff --git a/widgets/table/e-cell-date.c b/widgets/table/e-cell-date.c index fb3dd9fc71..79534aff45 100644 --- a/widgets/table/e-cell-date.c +++ b/widgets/table/e-cell-date.c @@ -39,7 +39,10 @@ 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)); const gchar *fmt_component, *fmt_part = NULL; @@ -59,7 +62,8 @@ 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); } @@ -104,7 +108,8 @@ e_cell_date_init (ECellDate *ecd) * Returns: an ECell object that can be used to render dates. */ ECell * -e_cell_date_new (const gchar *fontname, GtkJustification justify) +e_cell_date_new (const gchar *fontname, + GtkJustification justify) { ECellDate *ecd = g_object_new (E_TYPE_CELL_DATE, NULL); @@ -114,7 +119,8 @@ e_cell_date_new (const gchar *fontname, GtkJustification justify) } void -e_cell_date_set_format_component (ECellDate *ecd, const gchar *fmt_component) +e_cell_date_set_format_component (ECellDate *ecd, + const gchar *fmt_component) { g_return_if_fail (ecd != NULL); diff --git a/widgets/table/e-cell-hbox.c b/widgets/table/e-cell-hbox.c index c8485b983a..a8eb4ccb76 100644 --- a/widgets/table/e-cell-hbox.c +++ b/widgets/table/e-cell-hbox.c @@ -50,7 +50,9 @@ G_DEFINE_TYPE (ECellHbox, e_cell_hbox, E_TYPE_CELL) * ECell::new_view method */ static ECellView * -ecv_new_view (ECell *ecell, ETableModel *table_model, gpointer e_table_item_view) +ecv_new_view (ECell *ecell, + ETableModel *table_model, + gpointer e_table_item_view) { ECellHbox *ecv = E_CELL_HBOX (ecell); ECellHboxView *hbox_view = g_new0 (ECellHboxView, 1); @@ -155,11 +157,11 @@ ecv_draw (ECellView *ecell_view, gint subcell_offset = 0; gint i; - gint allotted_width = x2-x1; + gint allotted_width = x2 - x1; for (i = 0; i < hbox_view->subcell_view_count; i++) { /* Now cause our subcells to draw their contents, - shifted by subcell_offset pixels */ + * shifted by subcell_offset pixels */ gint width = allotted_width * hbox_view->def_size_cols[i] / 100; /* e_cell_max_width_by_row (hbox_view->subcell_views[i], hbox_view->model_cols[i], view_col, row); if (width < hbox_view->def_size_cols[i]) @@ -180,7 +182,13 @@ ecv_draw (ECellView *ecell_view, * ECell::event method */ static gint -ecv_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col, gint row, ECellFlags flags, ECellActions *actions) +ecv_event (ECellView *ecell_view, + GdkEvent *event, + gint model_col, + gint view_col, + gint row, + ECellFlags flags, + ECellActions *actions) { ECellHboxView *hbox_view = (ECellHboxView *) ecell_view; gint y = 0; @@ -217,7 +225,10 @@ ecv_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col * ECell::height method */ static gint -ecv_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) +ecv_height (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row) { ECellHboxView *hbox_view = (ECellHboxView *) ecell_view; gint height = 0, max_height = 0; @@ -234,7 +245,9 @@ ecv_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) * ECell::max_width method */ static gint -ecv_max_width (ECellView *ecell_view, gint model_col, gint view_col) +ecv_max_width (ECellView *ecell_view, + gint model_col, + gint view_col) { ECellHboxView *hbox_view = (ECellHboxView *) ecell_view; gint width = 0; @@ -321,7 +334,10 @@ e_cell_hbox_new (void) } void -e_cell_hbox_append (ECellHbox *hbox, ECell *subcell, gint model_col, gint size) +e_cell_hbox_append (ECellHbox *hbox, + ECell *subcell, + gint model_col, + gint size) { hbox->subcell_count++; diff --git a/widgets/table/e-cell-number.c b/widgets/table/e-cell-number.c index 7944bbea51..6e2f685a86 100644 --- a/widgets/table/e-cell-number.c +++ b/widgets/table/e-cell-number.c @@ -35,7 +35,10 @@ 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) { gpointer value; @@ -45,7 +48,8 @@ ecn_get_text (ECellText *cell, ETableModel *model, gint col, gint row) } static void -ecn_free_text (ECellText *cell, gchar *text) +ecn_free_text (ECellText *cell, + gchar *text) { g_free (text); } @@ -78,7 +82,8 @@ e_cell_number_init (ECellNumber *cell_number) * Returns: an ECell object that can be used to render numbers. */ ECell * -e_cell_number_new (const gchar *fontname, GtkJustification justify) +e_cell_number_new (const gchar *fontname, + GtkJustification justify) { ECellNumber *ecn = g_object_new (E_TYPE_CELL_NUMBER, NULL); diff --git a/widgets/table/e-cell-percent.c b/widgets/table/e-cell-percent.c index 5b54527f67..61543b0e0c 100644 --- a/widgets/table/e-cell-percent.c +++ b/widgets/table/e-cell-percent.c @@ -41,7 +41,10 @@ G_DEFINE_TYPE (ECellPercent, e_cell_percent, E_TYPE_CELL_TEXT) static gchar * -ecp_get_text (ECellText *cell, ETableModel *model, gint col, gint row) +ecp_get_text (ECellText *cell, + ETableModel *model, + gint col, + gint row) { gint percent; static gchar buffer[8]; @@ -59,7 +62,8 @@ 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. */ } @@ -79,8 +83,11 @@ show_percent_warning (void) } static void -ecp_set_value (ECellText *cell, ETableModel *model, gint col, gint row, - const gchar *text) +ecp_set_value (ECellText *cell, + ETableModel *model, + gint col, + gint row, + const gchar *text) { gint matched, percent; gboolean empty = TRUE; @@ -141,7 +148,8 @@ e_cell_percent_init (ECellPercent *ecp) * Returns: an ECell object that can be used to render numbers. */ ECell * -e_cell_percent_new (const gchar *fontname, GtkJustification justify) +e_cell_percent_new (const gchar *fontname, + GtkJustification justify) { ECellPercent *ecn = g_object_new (E_TYPE_CELL_PERCENT, NULL); diff --git a/widgets/table/e-cell-pixbuf.c b/widgets/table/e-cell-pixbuf.c index 9a9e31c7e4..b2cf3e2a2d 100644 --- a/widgets/table/e-cell-pixbuf.c +++ b/widgets/table/e-cell-pixbuf.c @@ -66,7 +66,9 @@ e_cell_pixbuf_new (void) */ static ECellView * -pixbuf_new_view (ECell *ecell, ETableModel *table_model, gpointer e_table_item_view) +pixbuf_new_view (ECell *ecell, + ETableModel *table_model, + gpointer e_table_item_view) { ECellPixbufView *pixbuf_view = g_new0 (ECellPixbufView, 1); ETableItem *eti = E_TABLE_ITEM (e_table_item_view); @@ -99,9 +101,16 @@ pixbuf_kill_view (ECellView *ecell_view) } static void -pixbuf_draw (ECellView *ecell_view, cairo_t *cr, - gint model_col, gint view_col, gint row, ECellFlags flags, - gint x1, gint y1, gint x2, gint y2) +pixbuf_draw (ECellView *ecell_view, + cairo_t *cr, + gint model_col, + gint view_col, + gint row, + ECellFlags flags, + gint x1, + gint y1, + gint x2, + gint y2) { GdkPixbuf *cell_pixbuf; gint real_x, real_y; @@ -124,14 +133,14 @@ pixbuf_draw (ECellView *ecell_view, cairo_t *cr, /* We center the pixbuf within our allocated space */ if (x2 - x1 > pix_w) { gint diff = (x2 - x1) - pix_w; - real_x = x1 + diff/2; + real_x = x1 + diff / 2; } else { real_x = x1; } if (y2 - y1 > pix_h) { gint diff = (y2 - y1) - pix_h; - real_y = y1 + diff/2; + real_y = y1 + diff / 2; } else { real_y = y1; } @@ -143,9 +152,13 @@ pixbuf_draw (ECellView *ecell_view, cairo_t *cr, } static gint -pixbuf_event (ECellView *ecell_view, GdkEvent *event, - gint model_col, gint view_col, gint row, - ECellFlags flags, ECellActions *actions) +pixbuf_event (ECellView *ecell_view, + GdkEvent *event, + gint model_col, + gint view_col, + gint row, + ECellFlags flags, + ECellActions *actions) { /* noop */ @@ -153,7 +166,10 @@ pixbuf_event (ECellView *ecell_view, GdkEvent *event, } static gint -pixbuf_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) +pixbuf_height (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row) { GdkPixbuf *pixbuf; if (row == -1) { @@ -176,9 +192,13 @@ pixbuf_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) * ECell::print method */ static void -pixbuf_print (ECellView *ecell_view, GtkPrintContext *context, - gint model_col, gint view_col, gint row, - gdouble width, gdouble height) +pixbuf_print (ECellView *ecell_view, + GtkPrintContext *context, + gint model_col, + gint view_col, + gint row, + gdouble width, + gdouble height) { GdkPixbuf *pixbuf; gint scale; @@ -197,9 +217,12 @@ pixbuf_print (ECellView *ecell_view, GtkPrintContext *context, } static gdouble -pixbuf_print_height (ECellView *ecell_view, GtkPrintContext *context, - gint model_col, gint view_col, gint row, - gdouble width) +pixbuf_print_height (ECellView *ecell_view, + GtkPrintContext *context, + gint model_col, + gint view_col, + gint row, + gdouble width) { GdkPixbuf *pixbuf; @@ -220,7 +243,9 @@ pixbuf_print_height (ECellView *ecell_view, GtkPrintContext *context, } static gint -pixbuf_max_width (ECellView *ecell_view, gint model_col, gint view_col) +pixbuf_max_width (ECellView *ecell_view, + gint model_col, + gint view_col) { gint pw; gint num_rows, i; @@ -249,15 +274,15 @@ pixbuf_max_width (ECellView *ecell_view, gint model_col, gint view_col) static void pixbuf_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) + guint property_id, + const GValue *value, + GParamSpec *pspec) { ECellPixbuf *pixbuf; pixbuf = E_CELL_PIXBUF (object); - switch (prop_id) { + switch (property_id) { case PROP_SELECTED_COLUMN: pixbuf->selected_column = g_value_get_int (value); break; @@ -278,15 +303,15 @@ pixbuf_set_property (GObject *object, /* Get_arg handler for the pixbuf item */ static void pixbuf_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) + guint property_id, + GValue *value, + GParamSpec *pspec) { ECellPixbuf *pixbuf; pixbuf = E_CELL_PIXBUF (object); - switch (prop_id) { + switch (property_id) { case PROP_SELECTED_COLUMN: g_value_set_int (value, pixbuf->selected_column); break; @@ -300,7 +325,7 @@ pixbuf_get_property (GObject *object, break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } diff --git a/widgets/table/e-cell-popup.c b/widgets/table/e-cell-popup.c index b3ba9bdfac..65440b2465 100644 --- a/widgets/table/e-cell-popup.c +++ b/widgets/table/e-cell-popup.c @@ -49,7 +49,7 @@ static void e_cell_popup_dispose (GObject *object); -static ECellView* ecp_new_view (ECell *ecell, +static ECellView * ecp_new_view (ECell *ecell, ETableModel *table_model, void *e_table_item_view); static void ecp_kill_view (ECellView *ecv); @@ -111,7 +111,7 @@ static gint e_cell_popup_do_popup (ECellPopupView *ecp_view, G_DEFINE_TYPE (ECellPopup, e_cell_popup, E_TYPE_CELL) static void -e_cell_popup_class_init (ECellPopupClass *class) +e_cell_popup_class_init (ECellPopupClass *class) { ECellClass *ecc = E_CELL_CLASS (class); @@ -137,7 +137,7 @@ e_cell_popup_class_init (ECellPopupClass *class) } static void -e_cell_popup_init (ECellPopup *ecp) +e_cell_popup_init (ECellPopup *ecp) { ecp->popup_shown = FALSE; ecp->popup_model = NULL; @@ -172,7 +172,9 @@ e_cell_popup_dispose (GObject *object) * ECell::new_view method */ static ECellView * -ecp_new_view (ECell *ecell, ETableModel *table_model, gpointer e_table_item_view) +ecp_new_view (ECell *ecell, + ETableModel *table_model, + gpointer e_table_item_view) { ECellPopup *ecp = E_CELL_POPUP (ecell); ECellPopupView *ecp_view; @@ -191,7 +193,7 @@ ecp_new_view (ECell *ecell, ETableModel *table_model, gpointer e_table_item_view ecp_view->child_view = e_cell_new_view (ecp->child, table_model, e_table_item_view); - return (ECellView*) ecp_view; + return (ECellView *) ecp_view; } /* @@ -247,9 +249,16 @@ ecp_unrealize (ECellView *ecv) * ECell::draw method */ static void -ecp_draw (ECellView *ecv, cairo_t *cr, - gint model_col, gint view_col, gint row, ECellFlags flags, - gint x1, gint y1, gint x2, gint y2) +ecp_draw (ECellView *ecv, + cairo_t *cr, + gint model_col, + gint view_col, + gint row, + ECellFlags flags, + gint x1, + gint y1, + gint x2, + gint y2) { ECellPopup *ecp = E_CELL_POPUP (ecv->ecell); ECellPopupView *ecp_view = (ECellPopupView *) ecv; @@ -263,7 +272,7 @@ ecp_draw (ECellView *ecv, cairo_t *cr, canvas = GTK_WIDGET (GNOME_CANVAS_ITEM (ecv->e_table_item_view)->canvas); /* Display the popup arrow if we are the cursor cell, or the popup - is shown for this cell. */ + * is shown for this cell. */ show_popup_arrow = e_table_model_is_cell_editable ( ecv->e_table_model, model_col, row) && @@ -318,8 +327,13 @@ ecp_draw (ECellView *ecv, cairo_t *cr, * ECell::event method */ static gint -ecp_event (ECellView *ecv, GdkEvent *event, gint model_col, gint view_col, - gint row, ECellFlags flags, ECellActions *actions) +ecp_event (ECellView *ecv, + GdkEvent *event, + gint model_col, + gint view_col, + gint row, + ECellFlags flags, + ECellActions *actions) { ECellPopupView *ecp_view = (ECellPopupView *) ecv; ECellPopup *ecp = E_CELL_POPUP (ecp_view->cell_view.ecell); @@ -335,7 +349,7 @@ ecp_event (ECellView *ecv, GdkEvent *event, gint model_col, gint view_col, view_col + 1); /* FIXME: The event coords seem to be relative to the - text within the cell, so we have to add 4. */ + * text within the cell, so we have to add 4. */ if (event->button.x + 4 >= width - E_CELL_POPUP_ARROW_WIDTH) { return e_cell_popup_do_popup (ecp_view, event, row, view_col); } @@ -360,7 +374,10 @@ ecp_event (ECellView *ecv, GdkEvent *event, gint model_col, gint view_col, * ECell::height method */ static gint -ecp_height (ECellView *ecv, gint model_col, gint view_col, gint row) +ecp_height (ECellView *ecv, + gint model_col, + gint view_col, + gint row) { ECellPopupView *ecp_view = (ECellPopupView *) ecv; @@ -371,7 +388,10 @@ ecp_height (ECellView *ecv, gint model_col, gint view_col, gint row) * ECellView::enter_edit method */ static gpointer -ecp_enter_edit (ECellView *ecv, gint model_col, gint view_col, gint row) +ecp_enter_edit (ECellView *ecv, + gint model_col, + gint view_col, + gint row) { ECellPopupView *ecp_view = (ECellPopupView *) ecv; @@ -382,8 +402,11 @@ ecp_enter_edit (ECellView *ecv, gint model_col, gint view_col, gint row) * ECellView::leave_edit method */ static void -ecp_leave_edit (ECellView *ecv, gint model_col, gint view_col, gint row, - gpointer edit_context) +ecp_leave_edit (ECellView *ecv, + gint model_col, + gint view_col, + gint row, + gpointer edit_context) { ECellPopupView *ecp_view = (ECellPopupView *) ecv; @@ -392,8 +415,13 @@ ecp_leave_edit (ECellView *ecv, gint model_col, gint view_col, gint row, } static void -ecp_print (ECellView *ecv, GtkPrintContext *context, - gint model_col, gint view_col, gint row, gdouble width, gdouble height) +ecp_print (ECellView *ecv, + GtkPrintContext *context, + gint model_col, + gint view_col, + gint row, + gdouble width, + gdouble height) { ECellPopupView *ecp_view = (ECellPopupView *) ecv; @@ -402,9 +430,12 @@ ecp_print (ECellView *ecv, GtkPrintContext *context, } static gdouble -ecp_print_height (ECellView *ecv, GtkPrintContext *context, - gint model_col, gint view_col, gint row, - gdouble width) +ecp_print_height (ECellView *ecv, + GtkPrintContext *context, + gint model_col, + gint view_col, + gint row, + gdouble width) { ECellPopupView *ecp_view = (ECellPopupView *) ecv; @@ -414,8 +445,8 @@ ecp_print_height (ECellView *ecv, GtkPrintContext *context, static gint ecp_max_width (ECellView *ecv, - gint model_col, - gint view_col) + gint model_col, + gint view_col) { ECellPopupView *ecp_view = (ECellPopupView *) ecv; @@ -423,15 +454,16 @@ ecp_max_width (ECellView *ecv, } static gchar * -ecp_get_bg_color (ECellView *ecell_view, gint row) +ecp_get_bg_color (ECellView *ecell_view, + gint row) { ECellPopupView *ecp_view = (ECellPopupView *) ecell_view; return e_cell_get_bg_color (ecp_view->child_view, row); } -ECell* -e_cell_popup_get_child (ECellPopup *ecp) +ECell * +e_cell_popup_get_child (ECellPopup *ecp) { g_return_val_if_fail (E_IS_CELL_POPUP (ecp), NULL); @@ -439,8 +471,8 @@ e_cell_popup_get_child (ECellPopup *ecp) } void -e_cell_popup_set_child (ECellPopup *ecp, - ECell *child) +e_cell_popup_set_child (ECellPopup *ecp, + ECell *child) { g_return_if_fail (E_IS_CELL_POPUP (ecp)); @@ -452,10 +484,10 @@ e_cell_popup_set_child (ECellPopup *ecp, } static gint -e_cell_popup_do_popup (ECellPopupView *ecp_view, - GdkEvent *event, - gint row, - gint view_col) +e_cell_popup_do_popup (ECellPopupView *ecp_view, + GdkEvent *event, + gint row, + gint view_col) { ECellPopup *ecp = E_CELL_POPUP (ecp_view->cell_view.ecell); gint (*popup_func) (ECellPopup *ecp, GdkEvent *event, gint row, gint view_col); @@ -472,7 +504,7 @@ e_cell_popup_do_popup (ECellPopupView *ecp_view, } /* This redraws the popup cell. Only use this if you know popup_view_col and - popup_row are valid. */ + * popup_row are valid. */ void e_cell_popup_queue_cell_redraw (ECellPopup *ecp) { @@ -486,8 +518,8 @@ e_cell_popup_queue_cell_redraw (ECellPopup *ecp) } void -e_cell_popup_set_shown (ECellPopup *ecp, - gboolean shown) +e_cell_popup_set_shown (ECellPopup *ecp, + gboolean shown) { ecp->popup_shown = shown; e_cell_popup_queue_cell_redraw (ecp); diff --git a/widgets/table/e-cell-popup.h b/widgets/table/e-cell-popup.h index 6d04fb3c8d..bc99196eaf 100644 --- a/widgets/table/e-cell-popup.h +++ b/widgets/table/e-cell-popup.h @@ -66,13 +66,13 @@ struct _ECellPopup { ECell *child; /* This is TRUE if the popup window is shown for the cell being - edited. While shown we display the arrow indented. */ + * edited. While shown we display the arrow indented. */ gboolean popup_shown; /* This is TRUE if the popup arrow is shown for the cell being edited. - This is needed to stop the first click on the cell from popping up - the popup window. We only popup the window after we have drawn the - arrow. */ + * This is needed to stop the first click on the cell from popping up + * the popup window. We only popup the window after we have drawn the + * arrow. */ gboolean popup_arrow_shown; /* The view in which the popup is shown. */ diff --git a/widgets/table/e-cell-size.c b/widgets/table/e-cell-size.c index d596713977..b330a95a96 100644 --- a/widgets/table/e-cell-size.c +++ b/widgets/table/e-cell-size.c @@ -34,7 +34,10 @@ 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)); gfloat fsize; @@ -53,7 +56,8 @@ 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); } @@ -98,7 +102,8 @@ e_cell_size_init (ECellSize *e_cell_size) * * Returns: an ECell object that can be used to render file sizes. */ ECell * -e_cell_size_new (const gchar *fontname, GtkJustification justify) +e_cell_size_new (const gchar *fontname, + GtkJustification justify) { ECellSize *ecd = g_object_new (E_TYPE_CELL_SIZE, NULL); diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c index 9d652372d0..7e391c3ba9 100644 --- a/widgets/table/e-cell-text.c +++ b/widgets/table/e-cell-text.c @@ -205,33 +205,42 @@ static gboolean e_cell_text_retrieve_surrounding_cb (GtkIMContext *context, ECel static gboolean e_cell_text_delete_surrounding_cb (GtkIMContext *context, gint offset, gint n_chars, ECellTextView *text_view); static void _insert (ECellTextView *text_view, const gchar *string, gint value); static void _delete_selection (ECellTextView *text_view); -static PangoAttrList* build_attr_list (ECellTextView *text_view, gint row, gint text_length); +static PangoAttrList * build_attr_list (ECellTextView *text_view, gint row, gint text_length); static void update_im_cursor_location (ECellTextView *tv); static gchar * -ect_real_get_text (ECellText *cell, ETableModel *model, gint col, gint row) +ect_real_get_text (ECellText *cell, + ETableModel *model, + gint col, + gint row) { return e_table_model_value_at (model, col, row); } static void -ect_real_free_text (ECellText *cell, gchar *text) +ect_real_free_text (ECellText *cell, + gchar *text) { } /* This is the default method for setting the ETableModel value based on - the text in the ECellText. This simply uses the text as it is - it assumes - the value in the model is a gchar *. Subclasses may parse the text into - data structures to pass to the model. */ + * the text in the ECellText. This simply uses the text as it is - it assumes + * the value in the model is a gchar *. Subclasses may parse the text into + * data structures to pass to the model. */ static void -ect_real_set_value (ECellText *cell, ETableModel *model, gint col, gint row, - const gchar *text) +ect_real_set_value (ECellText *cell, + ETableModel *model, + gint col, + gint row, + const gchar *text) { e_table_model_set_value_at (model, col, row, text); } static void -ect_queue_redraw (ECellTextView *text_view, gint view_col, gint view_row) +ect_queue_redraw (ECellTextView *text_view, + gint view_col, + gint view_row) { e_table_item_redraw_range ( text_view->cell_view.e_table_item_view, @@ -242,7 +251,8 @@ ect_queue_redraw (ECellTextView *text_view, gint view_col, gint view_row) * Shuts down the editing process */ static void -ect_stop_editing (ECellTextView *text_view, gboolean commit) +ect_stop_editing (ECellTextView *text_view, + gboolean commit) { GdkWindow *window; CellEdit *edit = text_view->edit; @@ -319,7 +329,9 @@ ect_cancel_edit (ECellTextView *text_view) * ECell::new_view method */ static ECellView * -ect_new_view (ECell *ecell, ETableModel *table_model, gpointer e_table_item_view) +ect_new_view (ECell *ecell, + ETableModel *table_model, + gpointer e_table_item_view) { ECellTextView *text_view = g_new0 (ECellTextView, 1); GnomeCanvas *canvas = GNOME_CANVAS_ITEM (e_table_item_view)->canvas; @@ -388,8 +400,10 @@ ect_unrealize (ECellView *ecv) } -static PangoAttrList* -build_attr_list (ECellTextView *text_view, gint row, gint text_length) +static PangoAttrList * +build_attr_list (ECellTextView *text_view, + gint row, + gint text_length) { ECellView *ecell_view = (ECellView *) text_view; @@ -434,7 +448,10 @@ build_attr_list (ECellTextView *text_view, gint row, gint text_length) } static PangoLayout * -layout_with_preedit (ECellTextView *text_view, gint row, const gchar *text, gint width) +layout_with_preedit (ECellTextView *text_view, + gint row, + const gchar *text, + gint width) { CellEdit *edit = text_view->edit; PangoAttrList *attrs; @@ -463,9 +480,9 @@ layout_with_preedit (ECellTextView *text_view, gint row, const gchar *text, gint */ if (mlen < text_length) { - if (!g_utf8_validate (text+mlen, -1, NULL)) { + if (!g_utf8_validate (text + mlen, -1, NULL)) { gchar *tc; - tc = g_utf8_find_next_char (text+mlen,NULL); + tc = g_utf8_find_next_char (text + mlen,NULL); if (tc) { mlen = (gint) (tc - text); } @@ -495,7 +512,10 @@ layout_with_preedit (ECellTextView *text_view, gint row, const gchar *text, gint } static PangoLayout * -build_layout (ECellTextView *text_view, gint row, const gchar *text, gint width) +build_layout (ECellTextView *text_view, + gint row, + const gchar *text, + gint width) { ECellView *ecell_view = (ECellView *) text_view; ECellText *ect = E_CELL_TEXT (ecell_view->ecell); @@ -560,7 +580,11 @@ build_layout (ECellTextView *text_view, gint row, const gchar *text, gint width) } static PangoLayout * -generate_layout (ECellTextView *text_view, gint model_col, gint view_col, gint row, gint width) +generate_layout (ECellTextView *text_view, + gint model_col, + gint view_col, + gint row, + gint width) { ECellView *ecell_view = (ECellView *) text_view; ECellText *ect = E_CELL_TEXT (ecell_view->ecell); @@ -583,7 +607,10 @@ generate_layout (ECellTextView *text_view, gint model_col, gint view_col, gint r } static void -draw_cursor (cairo_t *cr, gint x1, gint y1, PangoRectangle rect) +draw_cursor (cairo_t *cr, + gint x1, + gint y1, + PangoRectangle rect) { gdouble scaled_x; gdouble scaled_y; @@ -602,7 +629,8 @@ draw_cursor (cairo_t *cr, gint x1, gint y1, PangoRectangle rect) } static gboolean -show_pango_rectangle (CellEdit *edit, PangoRectangle rect) +show_pango_rectangle (CellEdit *edit, + PangoRectangle rect) { gint x1 = rect.x / PANGO_SCALE; gint x2 = (rect.x + rect.width) / PANGO_SCALE; @@ -664,9 +692,16 @@ get_vertical_spacing (GtkWidget *canvas) * ECell::draw method */ static void -ect_draw (ECellView *ecell_view, cairo_t *cr, - gint model_col, gint view_col, gint row, ECellFlags flags, - gint x1, gint y1, gint x2, gint y2) +ect_draw (ECellView *ecell_view, + cairo_t *cr, + gint model_col, + gint view_col, + gint row, + ECellFlags flags, + gint x1, + gint y1, + gint x2, + gint y2) { PangoLayout *layout; ECellTextView *text_view = (ECellTextView *) ecell_view; @@ -771,7 +806,8 @@ ect_draw (ECellView *ecell_view, cairo_t *cr, * 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; @@ -811,7 +847,13 @@ key_begins_editing (GdkEventKey *event) * ECell::event method */ static gint -ect_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col, gint row, ECellFlags flags, ECellActions *actions) +ect_event (ECellView *ecell_view, + GdkEvent *event, + gint model_col, + gint view_col, + gint row, + ECellFlags flags, + ECellActions *actions) { ECellTextView *text_view = (ECellTextView *) ecell_view; ETextEventProcessorEvent e_tep_event; @@ -849,7 +891,7 @@ ect_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col if (edit_display && edit->im_context && gtk_im_context_filter_keypress (\ edit->im_context, - (GdkEventKey*) event)) { + (GdkEventKey *) event)) { edit->need_im_reset = TRUE; if (preedit_len && flags & E_CELL_PREEDIT) @@ -1022,7 +1064,10 @@ ect_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col * ECell::height method */ static gint -ect_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) +ect_height (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row) { ECellTextView *text_view = (ECellTextView *) ecell_view; gint height; @@ -1038,7 +1083,10 @@ ect_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) * ECellView::enter_edit method */ static gpointer -ect_enter_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row) +ect_enter_edit (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row) { ECellTextView *text_view = (ECellTextView *) ecell_view; CellEdit *edit; @@ -1127,7 +1175,11 @@ ect_enter_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row) * ECellView::leave_edit method */ static void -ect_leave_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer edit_context) +ect_leave_edit (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row, + gpointer edit_context) { ECellTextView *text_view = (ECellTextView *) ecell_view; CellEdit *edit = text_view->edit; @@ -1153,7 +1205,11 @@ ect_leave_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row, * ECellView::save_state method */ static gpointer -ect_save_state (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer edit_context) +ect_save_state (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row, + gpointer edit_context) { ECellTextView *text_view = (ECellTextView *) ecell_view; CellEdit *edit = text_view->edit; @@ -1169,7 +1225,12 @@ ect_save_state (ECellView *ecell_view, gint model_col, gint view_col, gint row, * ECellView::load_state method */ static void -ect_load_state (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer edit_context, gpointer save_state) +ect_load_state (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row, + gpointer edit_context, + gpointer save_state) { ECellTextView *text_view = (ECellTextView *) ecell_view; CellEdit *edit = text_view->edit; @@ -1188,14 +1249,21 @@ ect_load_state (ECellView *ecell_view, gint model_col, gint view_col, gint row, * ECellView::free_state method */ static void -ect_free_state (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer save_state) +ect_free_state (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row, + gpointer save_state) { g_free (save_state); } static void -get_font_size (PangoLayout *layout, PangoFontDescription *font, const gchar *text, - gdouble *width, gdouble *height) +get_font_size (PangoLayout *layout, + PangoFontDescription *font, + const gchar *text, + gdouble *width, + gdouble *height) { gint w; gint h; @@ -1213,9 +1281,13 @@ get_font_size (PangoLayout *layout, PangoFontDescription *font, const gchar *tex } static void -ect_print (ECellView *ecell_view, GtkPrintContext *context, - gint model_col, gint view_col, gint row, - gdouble width, gdouble height) +ect_print (ECellView *ecell_view, + GtkPrintContext *context, + gint model_col, + gint view_col, + gint row, + gdouble width, + gdouble height) { PangoFontDescription *font_des; PangoLayout *layout; @@ -1263,7 +1335,7 @@ ect_print (ECellView *ecell_view, GtkPrintContext *context, dir = pango_find_base_dir (string, strlen (string)); if (underline) { - ly = ty + (gdouble) pango_font_metrics_get_underline_position (font_metrics)/(gdouble) PANGO_SCALE; + ly = ty + (gdouble) pango_font_metrics_get_underline_position (font_metrics) / (gdouble) PANGO_SCALE; cairo_new_path (cr); if (dir == PANGO_DIRECTION_RTL) { cairo_move_to (cr, width - 2, ly + text_height + 6); @@ -1273,12 +1345,12 @@ ect_print (ECellView *ecell_view, GtkPrintContext *context, cairo_move_to (cr, 2, ly + text_height + 6); cairo_line_to (cr, MIN (2 + text_width, width - 2), ly + text_height + 6); } - cairo_set_line_width (cr, (gdouble) pango_font_metrics_get_underline_thickness (font_metrics)/(gdouble) PANGO_SCALE); + cairo_set_line_width (cr, (gdouble) pango_font_metrics_get_underline_thickness (font_metrics) / (gdouble) PANGO_SCALE); cairo_stroke (cr); } if (strikeout) { - ly = ty + (gdouble) pango_font_metrics_get_strikethrough_position (font_metrics)/(gdouble) PANGO_SCALE; + ly = ty + (gdouble) pango_font_metrics_get_strikethrough_position (font_metrics) / (gdouble) PANGO_SCALE; cairo_new_path (cr); if (dir == PANGO_DIRECTION_RTL) { cairo_move_to (cr, width - 2, ly + text_height + 6); @@ -1288,13 +1360,13 @@ ect_print (ECellView *ecell_view, GtkPrintContext *context, cairo_move_to (cr, 2, ly + text_height + 6); cairo_line_to (cr, MIN (2 + text_width, width - 2), ly + text_height + 6); } - cairo_set_line_width (cr,(gdouble) pango_font_metrics_get_strikethrough_thickness (font_metrics)/(gdouble) PANGO_SCALE); + cairo_set_line_width (cr,(gdouble) pango_font_metrics_get_strikethrough_thickness (font_metrics) / (gdouble) PANGO_SCALE); cairo_stroke (cr); } cairo_move_to (cr, 2, text_height- 5); - pango_layout_set_width (layout, (width - 4)*PANGO_SCALE); + pango_layout_set_width (layout, (width - 4) * PANGO_SCALE); pango_layout_set_wrap (layout, PANGO_WRAP_CHAR); pango_cairo_show_layout (cr, layout); cairo_restore (cr); @@ -1305,9 +1377,12 @@ ect_print (ECellView *ecell_view, GtkPrintContext *context, } static gdouble -ect_print_height (ECellView *ecell_view, GtkPrintContext *context, - gint model_col, gint view_col, gint row, - gdouble width) +ect_print_height (ECellView *ecell_view, + GtkPrintContext *context, + gint model_col, + gint view_col, + gint row, + gdouble width) { /* * Font size is 16 by default. To leave some margin for cell @@ -1321,7 +1396,7 @@ ect_print_height (ECellView *ecell_view, GtkPrintContext *context, ECellText *ect = E_CELL_TEXT (ecell_view->ecell); gchar *string; gdouble text_width = 0.0, text_height = 0.0; - gint lines=1; + gint lines = 1; string = e_cell_text_get_text (ect, ecell_view->e_table_model, model_col, row); @@ -1334,15 +1409,15 @@ ect_print_height (ECellView *ecell_view, GtkPrintContext *context, /* Checking if the text width goes beyond the column width to increase the * number of lines. */ - if ( text_width > width-4) - lines = (text_width / (width-4)) + 1; - return 16*lines + 8; + if ( text_width > width - 4) + lines = (text_width / (width - 4)) + 1; + return 16 *lines + 8; } static gint ect_max_width (ECellView *ecell_view, - gint model_col, - gint view_col) + gint model_col, + gint view_col) { /* New ECellText */ ECellTextView *text_view = (ECellTextView *) ecell_view; @@ -1367,9 +1442,9 @@ ect_max_width (ECellView *ecell_view, static gint ect_max_width_by_row (ECellView *ecell_view, - gint model_col, - gint view_col, - gint row) + gint model_col, + gint view_col, + gint row) { /* New ECellText */ ECellTextView *text_view = (ECellTextView *) ecell_view; @@ -1399,15 +1474,15 @@ ect_finalize (GObject *object) /* Set_arg handler for the text item */ static void ect_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) + guint property_id, + const GValue *value, + GParamSpec *pspec) { ECellText *text; text = E_CELL_TEXT (object); - switch (prop_id) { + switch (property_id) { case PROP_STRIKEOUT_COLUMN: text->strikeout_column = g_value_get_int (value); break; @@ -1440,15 +1515,15 @@ ect_set_property (GObject *object, /* Get_arg handler for the text item */ static void ect_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) + guint property_id, + GValue *value, + GParamSpec *pspec) { ECellText *text; text = E_CELL_TEXT (object); - switch (prop_id) { + switch (property_id) { case PROP_STRIKEOUT_COLUMN: g_value_set_int (value, text->strikeout_column); break; @@ -1474,7 +1549,7 @@ ect_get_property (GObject *object, break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -1597,11 +1672,11 @@ e_cell_text_class_init (ECellTextClass *class) static void e_cell_text_get_cursor_locations (ECellTextView *tv, - GdkRectangle *strong_pos, - GdkRectangle *weak_pos) + GdkRectangle *strong_pos, + GdkRectangle *weak_pos) { GdkRectangle area; - CellEdit *edit=tv->edit; + CellEdit *edit = tv->edit; ECellView *cell_view = (ECellView *) tv; ETableItem *item = E_TABLE_ITEM ((cell_view)->e_table_item_view); GnomeCanvasItem *parent_item = GNOME_CANVAS_ITEM (item)->parent; @@ -1647,7 +1722,7 @@ e_cell_text_get_cursor_locations (ECellTextView *tv, static void update_im_cursor_location (ECellTextView *tv) { - CellEdit *edit=tv->edit; + CellEdit *edit = tv->edit; GdkRectangle area; e_cell_text_get_cursor_locations (tv, &area, NULL); @@ -1657,11 +1732,11 @@ update_im_cursor_location (ECellTextView *tv) static void e_cell_text_preedit_changed_cb (GtkIMContext *context, - ECellTextView *tv) + ECellTextView *tv) { gchar *preedit_string; gint cursor_pos; - CellEdit *edit=tv->edit; + CellEdit *edit = tv->edit; gtk_im_context_get_preedit_string (edit->im_context, &preedit_string, NULL, &cursor_pos); @@ -1675,8 +1750,8 @@ e_cell_text_preedit_changed_cb (GtkIMContext *context, static void e_cell_text_commit_cb (GtkIMContext *context, - const gchar *str, - ECellTextView *tv) + const gchar *str, + ECellTextView *tv) { CellEdit *edit = tv->edit; ETextEventProcessorCommand command; @@ -1693,7 +1768,7 @@ e_cell_text_commit_cb (GtkIMContext *context, static gboolean e_cell_text_retrieve_surrounding_cb (GtkIMContext *context, - ECellTextView *tv) + ECellTextView *tv) { CellEdit *edit = tv->edit; @@ -1707,10 +1782,10 @@ e_cell_text_retrieve_surrounding_cb (GtkIMContext *context, } static gboolean -e_cell_text_delete_surrounding_cb (GtkIMContext *context, - gint offset, - gint n_chars, - ECellTextView *tv) +e_cell_text_delete_surrounding_cb (GtkIMContext *context, + gint offset, + gint n_chars, + ECellTextView *tv) { gint begin_pos, end_pos; glong text_len; @@ -1774,7 +1849,8 @@ e_cell_text_init (ECellText *ect) * Returns: an ECell object that can be used to render strings. */ ECell * -e_cell_text_new (const gchar *fontname, GtkJustification justify) +e_cell_text_new (const gchar *fontname, + GtkJustification justify) { ECellText *ect = g_object_new (E_TYPE_CELL_TEXT, NULL); @@ -1861,7 +1937,9 @@ e_cell_text_set_value (ECellText *cell, /* position is in BYTES */ static gint -get_position_from_xy (CellEdit *edit, gint x, gint y) +get_position_from_xy (CellEdit *edit, + gint x, + gint y) { gint index; gint trailing; @@ -1955,7 +2033,8 @@ _blink_scroll_timeout (gpointer data) } static gint -next_word (CellEdit *edit, gint start) +next_word (CellEdit *edit, + gint start) { gchar *p; gint length; @@ -1977,7 +2056,8 @@ next_word (CellEdit *edit, gint start) } static gint -_get_position (ECellTextView *text_view, ETextEventProcessorCommand *command) +_get_position (ECellTextView *text_view, + ETextEventProcessorCommand *command) { gint length; CellEdit *edit = text_view->edit; @@ -2144,14 +2224,16 @@ _delete_selection (ECellTextView *text_view) edit->selection_end = edit->selection_start; - g_signal_emit (VIEW_TO_CELL (text_view), signals[TEXT_DELETED], 0, text_view, edit->selection_start, ep-sp, edit->row, edit->model_col); + g_signal_emit (VIEW_TO_CELL (text_view), signals[TEXT_DELETED], 0, text_view, edit->selection_start, ep - sp, edit->row, edit->model_col); } /* fixme: */ /* NB! We expect value to be length IN BYTES */ static void -_insert (ECellTextView *text_view, const gchar *string, gint value) +_insert (ECellTextView *text_view, + const gchar *string, + gint value) { CellEdit *edit = text_view->edit; gchar *temp; @@ -2173,11 +2255,14 @@ _insert (ECellTextView *text_view, const gchar *string, gint value) edit->selection_start += value; edit->selection_end = edit->selection_start; - g_signal_emit (VIEW_TO_CELL (text_view), signals[TEXT_INSERTED], 0, text_view, edit->selection_end-value, value, edit->row, edit->model_col); + g_signal_emit (VIEW_TO_CELL (text_view), signals[TEXT_INSERTED], 0, text_view, edit->selection_end - value, value, edit->row, edit->model_col); } static void -capitalize (CellEdit *edit, gint start, gint end, ETextEventProcessorCaps type) +capitalize (CellEdit *edit, + gint start, + gint end, + ETextEventProcessorCaps type) { ECellTextView *text_view = edit->text_view; @@ -2228,7 +2313,9 @@ capitalize (CellEdit *edit, gint start, gint end, ETextEventProcessorCaps type) } static void -e_cell_text_view_command (ETextEventProcessor *tep, ETextEventProcessorCommand *command, gpointer data) +e_cell_text_view_command (ETextEventProcessor *tep, + ETextEventProcessorCommand *command, + gpointer data) { CellEdit *edit = (CellEdit *) data; ECellTextView *text_view = edit->text_view; @@ -2240,7 +2327,7 @@ e_cell_text_view_command (ETextEventProcessor *tep, ETextEventProcessorCommand * gint sel_start, sel_end; /* If the EText isn't editable, then ignore any commands that would - modify the text. */ + * modify the text. */ if (!ect->editable && (command->action == E_TEP_DELETE || command->action == E_TEP_INSERT || command->action == E_TEP_PASTE @@ -2372,7 +2459,11 @@ e_cell_text_view_command (ETextEventProcessor *tep, ETextEventProcessorCommand * } static void -e_cell_text_view_supply_selection (CellEdit *edit, guint time, GdkAtom selection, gchar *data, gint length) +e_cell_text_view_supply_selection (CellEdit *edit, + guint time, + GdkAtom selection, + gchar *data, + gint length) { #if DO_SELECTION GtkClipboard *clipboard; @@ -2390,8 +2481,8 @@ e_cell_text_view_supply_selection (CellEdit *edit, guint time, GdkAtom selection #ifdef DO_SELECTION static void paste_received (GtkClipboard *clipboard, - const gchar *text, - gpointer data) + const gchar *text, + gpointer data) { CellEdit *edit; @@ -2412,7 +2503,9 @@ paste_received (GtkClipboard *clipboard, #endif static void -e_cell_text_view_get_selection (CellEdit *edit, GdkAtom selection, guint32 time) +e_cell_text_view_get_selection (CellEdit *edit, + GdkAtom selection, + guint32 time) { #if DO_SELECTION gtk_clipboard_request_text (gtk_widget_get_clipboard (GTK_WIDGET (edit->text_view->canvas), diff --git a/widgets/table/e-cell-text.h b/widgets/table/e-cell-text.h index 7645a0064b..850d0caf29 100644 --- a/widgets/table/e-cell-text.h +++ b/widgets/table/e-cell-text.h @@ -87,8 +87,8 @@ struct _ECellText { gint bold_column; /* This column in the ETable should return a string specifying a color, - either a color name like "red" or a color spec like "rgb:F/0/0". - See the XParseColor man page for the formats available. */ + * either a color name like "red" or a color spec like "rgb:F/0/0". + * See the XParseColor man page for the formats available. */ gint color_column; gint bg_color_column; }; @@ -132,8 +132,8 @@ ECell * e_cell_text_construct (ECellText *cell, GtkJustification justify); /* Gets the value from the model and converts it into a string. In ECellText - itself, the value is assumed to be a gchar * and so needs no conversion. - In subclasses the ETableModel value may be a more complicated datatype. */ + * itself, the value is assumed to be a gchar * and so needs no conversion. + * In subclasses the ETableModel value may be a more complicated datatype. */ gchar * e_cell_text_get_text (ECellText *cell, ETableModel *model, gint col, diff --git a/widgets/table/e-cell-tree.c b/widgets/table/e-cell-tree.c index 77f25ae387..e4bb093912 100644 --- a/widgets/table/e-cell-tree.c +++ b/widgets/table/e-cell-tree.c @@ -71,25 +71,29 @@ e_cell_tree_view_get_subcell_view (ECellView *ect) } static ETreePath -e_cell_tree_get_node (ETableModel *table_model, gint row) +e_cell_tree_get_node (ETableModel *table_model, + gint row) { return e_table_model_value_at (table_model, -1, row); } -static ETreeModel* -e_cell_tree_get_tree_model (ETableModel *table_model, gint row) +static ETreeModel * +e_cell_tree_get_tree_model (ETableModel *table_model, + gint row) { return e_table_model_value_at (table_model, -2, row); } static ETreeTableAdapter * -e_cell_tree_get_tree_table_adapter (ETableModel *table_model, gint row) +e_cell_tree_get_tree_table_adapter (ETableModel *table_model, + gint row) { return e_table_model_value_at (table_model, -3, row); } static gint -visible_depth_of_node (ETableModel *model, gint row) +visible_depth_of_node (ETableModel *model, + gint row) { ETreeModel *tree_model = e_cell_tree_get_tree_model (model, row); ETreeTableAdapter *adapter = e_cell_tree_get_tree_table_adapter (model, row); @@ -99,10 +103,11 @@ visible_depth_of_node (ETableModel *model, gint row) } /* If this is changed to not include the width of the expansion pixmap - if the path is not expandable, then max_width needs to change as - well. */ + * if the path is not expandable, then max_width needs to change as + * well. */ static gint -offset_of_node (ETableModel *table_model, gint row) +offset_of_node (ETableModel *table_model, + gint row) { ETreeModel *tree_model = e_cell_tree_get_tree_model (table_model, row); ETreePath path = e_cell_tree_get_node (table_model, row); @@ -119,7 +124,9 @@ offset_of_node (ETableModel *table_model, gint row) * ECell::new_view method */ static ECellView * -ect_new_view (ECell *ecell, ETableModel *table_model, gpointer e_table_item_view) +ect_new_view (ECell *ecell, + ETableModel *table_model, + gpointer e_table_item_view) { ECellTree *ect = E_CELL_TREE (ecell); ECellTreeView *tree_view = g_new0 (ECellTreeView, 1); @@ -283,7 +290,7 @@ ect_draw (ECellView *ecell_view, } /* Now cause our subcell to draw its contents, shifted by - subcell_offset pixels */ + * subcell_offset pixels */ e_cell_draw (tree_view->subcell_view, cr, model_col, view_col, row, flags, x1 + subcell_offset, y1, x2, y2); @@ -292,7 +299,8 @@ ect_draw (ECellView *ecell_view, } static void -adjust_event_position (GdkEvent *event, gint offset) +adjust_event_position (GdkEvent *event, + gint offset) { switch (event->type) { case GDK_BUTTON_PRESS: @@ -310,7 +318,9 @@ adjust_event_position (GdkEvent *event, gint offset) } static gboolean -event_in_expander (GdkEvent *event, gint offset, gint height) +event_in_expander (GdkEvent *event, + gint offset, + gint height) { switch (event->type) { case GDK_BUTTON_PRESS: @@ -329,7 +339,10 @@ event_in_expander (GdkEvent *event, gint offset, gint height) * ECell::height method */ static gint -ect_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) +ect_height (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row) { ECellTreeView *tree_view = (ECellTreeView *) ecell_view; @@ -381,7 +394,13 @@ animate_expander (gpointer data) * ECell::event method */ static gint -ect_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col, gint row, ECellFlags flags, ECellActions *actions) +ect_event (ECellView *ecell_view, + GdkEvent *event, + gint model_col, + gint view_col, + gint row, + ECellFlags flags, + ECellActions *actions) { GtkLayout *layout; GdkWindow *window; @@ -504,7 +523,9 @@ ect_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col * ECell::max_width method */ static gint -ect_max_width (ECellView *ecell_view, gint model_col, gint view_col) +ect_max_width (ECellView *ecell_view, + gint model_col, + gint view_col) { ECellTreeView *tree_view = (ECellTreeView *) ecell_view; gint row; @@ -578,7 +599,8 @@ ect_max_width (ECellView *ecell_view, gint model_col, gint view_col) * ECellView::get_bg_color method */ static gchar * -ect_get_bg_color (ECellView *ecell_view, gint row) +ect_get_bg_color (ECellView *ecell_view, + gint row) { ECellTreeView *tree_view = (ECellTreeView *) ecell_view; @@ -589,7 +611,10 @@ ect_get_bg_color (ECellView *ecell_view, gint row) * ECellView::enter_edit method */ static gpointer -ect_enter_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row) +ect_enter_edit (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row) { /* just defer to our subcell's view */ ECellTreeView *tree_view = (ECellTreeView *) ecell_view; @@ -601,7 +626,11 @@ ect_enter_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row) * ECellView::leave_edit method */ static void -ect_leave_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer edit_context) +ect_leave_edit (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row, + gpointer edit_context) { /* just defer to our subcell's view */ ECellTreeView *tree_view = (ECellTreeView *) ecell_view; @@ -610,9 +639,13 @@ ect_leave_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row, } static void -ect_print (ECellView *ecell_view, GtkPrintContext *context, - gint model_col, gint view_col, gint row, - gdouble width, gdouble height) +ect_print (ECellView *ecell_view, + GtkPrintContext *context, + gint model_col, + gint view_col, + gint row, + gdouble width, + gdouble height) { ECellTreeView *tree_view = (ECellTreeView *) ecell_view; cairo_t *cr = gtk_print_context_get_cairo_context (context); @@ -650,8 +683,8 @@ ect_print (ECellView *ecell_view, GtkPrintContext *context, } /* now traverse back up to the root of the tree, checking at - each level if the node has siblings, and drawing the - correct vertical pipe for it's configuration. */ + * each level if the node has siblings, and drawing the + * correct vertical pipe for it's configuration. */ node = e_tree_model_node_get_parent (tree_model, node); depth = visible_depth_of_node (ecell_view->e_table_model, row) - 1; offset -= INDENT_AMOUNT; @@ -700,9 +733,12 @@ ect_print (ECellView *ecell_view, GtkPrintContext *context, } static gdouble -ect_print_height (ECellView *ecell_view, GtkPrintContext *context, - gint model_col, gint view_col, gint row, - gdouble width) +ect_print_height (ECellView *ecell_view, + GtkPrintContext *context, + gint model_col, + gint view_col, + gint row, + gdouble width) { return 12; /* XXX */ } @@ -766,8 +802,8 @@ e_cell_tree_init (ECellTree *ect) **/ void e_cell_tree_construct (ECellTree *ect, - gboolean draw_lines, - ECell *subcell) + gboolean draw_lines, + ECell *subcell) { ect->subcell = subcell; if (subcell) @@ -792,7 +828,7 @@ e_cell_tree_construct (ECellTree *ect, **/ ECell * e_cell_tree_new (gboolean draw_lines, - ECell *subcell) + ECell *subcell) { ECellTree *ect = g_object_new (E_TYPE_CELL_TREE, NULL); diff --git a/widgets/table/e-cell-vbox.c b/widgets/table/e-cell-vbox.c index 1c0cbc62ca..9830a06aff 100644 --- a/widgets/table/e-cell-vbox.c +++ b/widgets/table/e-cell-vbox.c @@ -46,7 +46,9 @@ G_DEFINE_TYPE (ECellVbox, e_cell_vbox, E_TYPE_CELL) * ECell::new_view method */ static ECellView * -ecv_new_view (ECell *ecell, ETableModel *table_model, gpointer e_table_item_view) +ecv_new_view (ECell *ecell, + ETableModel *table_model, + gpointer e_table_item_view) { ECellVbox *ecv = E_CELL_VBOX (ecell); ECellVboxView *vbox_view = g_new0 (ECellVboxView, 1); @@ -151,7 +153,7 @@ ecv_draw (ECellView *ecell_view, for (i = 0; i < vbox_view->subcell_view_count; i++) { /* Now cause our subcells to draw their contents, - shifted by subcell_offset pixels */ + * shifted by subcell_offset pixels */ gint height; height = e_cell_height ( @@ -173,7 +175,13 @@ ecv_draw (ECellView *ecell_view, * ECell::event method */ static gint -ecv_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col, gint row, ECellFlags flags, ECellActions *actions) +ecv_event (ECellView *ecell_view, + GdkEvent *event, + gint model_col, + gint view_col, + gint row, + ECellFlags flags, + ECellActions *actions) { ECellVboxView *vbox_view = (ECellVboxView *) ecell_view; gint y = 0; @@ -208,7 +216,10 @@ ecv_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col * ECell::height method */ static gint -ecv_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) +ecv_height (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row) { ECellVboxView *vbox_view = (ECellVboxView *) ecell_view; gint height = 0; @@ -224,7 +235,9 @@ ecv_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) * ECell::max_width method */ static gint -ecv_max_width (ECellView *ecell_view, gint model_col, gint view_col) +ecv_max_width (ECellView *ecell_view, + gint model_col, + gint view_col) { ECellVboxView *vbox_view = (ECellVboxView *) ecell_view; gint max_width = 0; @@ -312,7 +325,9 @@ e_cell_vbox_new (void) } void -e_cell_vbox_append (ECellVbox *vbox, ECell *subcell, gint model_col) +e_cell_vbox_append (ECellVbox *vbox, + ECell *subcell, + gint model_col) { vbox->subcell_count++; diff --git a/widgets/table/e-cell.c b/widgets/table/e-cell.c index cbc0bfc0ae..88762f6a7a 100644 --- a/widgets/table/e-cell.c +++ b/widgets/table/e-cell.c @@ -36,7 +36,9 @@ G_DEFINE_TYPE (ECell, e_cell, G_TYPE_OBJECT) #define ECVIEW_EC_CLASS(v) (E_CELL_GET_CLASS (v->ecell)) static ECellView * -ec_new_view (ECell *ecell, ETableModel *table_model, gpointer e_table_item_view) +ec_new_view (ECell *ecell, + ETableModel *table_model, + gpointer e_table_item_view) { return NULL; } @@ -57,15 +59,28 @@ ec_unrealize (ECellView *e_cell) } static void -ec_draw (ECellView *ecell_view, cairo_t *cr, - gint model_col, gint view_col, gint row, ECellFlags flags, - gint x1, gint y1, gint x2, gint y2) +ec_draw (ECellView *ecell_view, + cairo_t *cr, + gint model_col, + gint view_col, + gint row, + ECellFlags flags, + gint x1, + gint y1, + gint x2, + gint y2) { g_critical ("e-cell-draw invoked"); } static gint -ec_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col, gint row, ECellFlags flags, ECellActions *actions) +ec_event (ECellView *ecell_view, + GdkEvent *event, + gint model_col, + gint view_col, + gint row, + ECellFlags flags, + ECellActions *actions) { g_critical ("e-cell-event invoked"); @@ -73,7 +88,10 @@ ec_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col, } static gint -ec_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) +ec_height (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row) { g_critical ("e-cell-height invoked"); @@ -81,7 +99,14 @@ ec_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) } static void -ec_focus (ECellView *ecell_view, gint model_col, gint view_col, gint row, gint x1, gint y1, gint x2, gint y2) +ec_focus (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row, + gint x1, + gint y1, + gint x2, + gint y2) { ecell_view->focus_col = view_col; ecell_view->focus_row = row; @@ -103,29 +128,49 @@ ec_unfocus (ECellView *ecell_view) } static gpointer -ec_enter_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row) +ec_enter_edit (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row) { return NULL; } static void -ec_leave_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer context) +ec_leave_edit (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row, + gpointer context) { } static gpointer -ec_save_state (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer context) +ec_save_state (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row, + gpointer context) { return NULL; } static void -ec_load_state (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer context, gpointer save_state) +ec_load_state (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row, + gpointer context, + gpointer save_state) { } static void -ec_free_state (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer save_state) +ec_free_state (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row, + gpointer save_state) { } @@ -172,7 +217,13 @@ e_cell_init (ECell *cell) * Returns: processing state from the GdkEvent handling. */ gint -e_cell_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col, gint row, ECellFlags flags, ECellActions *actions) +e_cell_event (ECellView *ecell_view, + GdkEvent *event, + gint model_col, + gint view_col, + gint row, + ECellFlags flags, + ECellActions *actions) { return ECVIEW_EC_CLASS (ecell_view)->event ( ecell_view, event, model_col, view_col, row, flags, actions); @@ -194,7 +245,9 @@ e_cell_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_ * Returns: a new ECellView for this @ecell on the @table_model displayed on the @e_table_item_view. */ ECellView * -e_cell_new_view (ECell *ecell, ETableModel *table_model, gpointer e_table_item_view) +e_cell_new_view (ECell *ecell, + ETableModel *table_model, + gpointer e_table_item_view) { return E_CELL_GET_CLASS (ecell)->new_view ( ecell, table_model, e_table_item_view); @@ -260,9 +313,16 @@ e_cell_unrealize (ECellView *ecell_view) * flags include alignments and justifications. */ void -e_cell_draw (ECellView *ecell_view, cairo_t *cr, - gint model_col, gint view_col, gint row, ECellFlags flags, - gint x1, gint y1, gint x2, gint y2) +e_cell_draw (ECellView *ecell_view, + cairo_t *cr, + gint model_col, + gint view_col, + gint row, + ECellFlags flags, + gint x1, + gint y1, + gint x2, + gint y2) { g_return_if_fail (ecell_view != NULL); g_return_if_fail (row >= 0); @@ -288,9 +348,13 @@ e_cell_draw (ECellView *ecell_view, cairo_t *cr, * FIXME: */ void -e_cell_print (ECellView *ecell_view, GtkPrintContext *context, - gint model_col, gint view_col, gint row, - gdouble width, gdouble height) +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); @@ -302,9 +366,12 @@ e_cell_print (ECellView *ecell_view, GtkPrintContext *context, * FIXME: */ gdouble -e_cell_print_height (ECellView *ecell_view, GtkPrintContext *context, - gint model_col, gint view_col, gint row, - gdouble width) +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 @@ -324,7 +391,10 @@ e_cell_print_height (ECellView *ecell_view, GtkPrintContext *context, * @view_col, @row. */ gint -e_cell_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) +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); } @@ -340,7 +410,10 @@ e_cell_height (ECellView *ecell_view, gint model_col, gint view_col, gint row) * @model_col, @row rendered at @view_col, @row. */ gpointer -e_cell_enter_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row) +e_cell_enter_edit (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row) { return ECVIEW_EC_CLASS (ecell_view)->enter_edit (ecell_view, model_col, view_col, row); } @@ -357,7 +430,11 @@ e_cell_enter_edit (ECellView *ecell_view, gint model_col, gint view_col, gint ro * rendered at @view_col, @row. */ void -e_cell_leave_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer edit_context) +e_cell_leave_edit (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row, + gpointer edit_context) { ECVIEW_EC_CLASS (ecell_view)->leave_edit (ecell_view, model_col, view_col, row, edit_context); } @@ -377,7 +454,11 @@ e_cell_leave_edit (ECellView *ecell_view, gint model_col, gint view_col, gint ro * or scrolling. */ gpointer -e_cell_save_state (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer edit_context) +e_cell_save_state (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row, + gpointer edit_context) { if (ECVIEW_EC_CLASS (ecell_view)->save_state) return ECVIEW_EC_CLASS (ecell_view)->save_state (ecell_view, model_col, view_col, row, edit_context); @@ -397,7 +478,12 @@ e_cell_save_state (ECellView *ecell_view, gint model_col, gint view_col, gint ro * Requests that the ECellView load from the given save state. */ void -e_cell_load_state (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer edit_context, gpointer save_state) +e_cell_load_state (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row, + gpointer edit_context, + gpointer save_state) { if (ECVIEW_EC_CLASS (ecell_view)->load_state) ECVIEW_EC_CLASS (ecell_view)->load_state (ecell_view, model_col, view_col, row, edit_context, save_state); @@ -415,7 +501,11 @@ e_cell_load_state (ECellView *ecell_view, gint model_col, gint view_col, gint ro * Requests that the ECellView free the given save state. */ void -e_cell_free_state (ECellView *ecell_view, gint model_col, gint view_col, gint row, gpointer save_state) +e_cell_free_state (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row, + gpointer save_state) { if (ECVIEW_EC_CLASS (ecell_view)->free_state) ECVIEW_EC_CLASS (ecell_view)->free_state (ecell_view, model_col, view_col, row, save_state); @@ -431,7 +521,9 @@ e_cell_free_state (ECellView *ecell_view, gint model_col, gint view_col, gint ro * is being rendered as @view_col */ gint -e_cell_max_width (ECellView *ecell_view, gint model_col, gint view_col) +e_cell_max_width (ECellView *ecell_view, + gint model_col, + gint view_col) { return ECVIEW_EC_CLASS (ecell_view)->max_width (ecell_view, model_col, view_col); @@ -448,7 +540,10 @@ e_cell_max_width (ECellView *ecell_view, gint model_col, gint view_col) * is being rendered as @view_col for the data in @row. */ gint -e_cell_max_width_by_row (ECellView *ecell_view, gint model_col, gint view_col, gint row) +e_cell_max_width_by_row (ECellView *ecell_view, + gint model_col, + gint view_col, + gint row) { if (ECVIEW_EC_CLASS (ecell_view)->max_width_by_row) return ECVIEW_EC_CLASS (ecell_view)->max_width_by_row @@ -474,7 +569,8 @@ e_cell_max_width_by_row_implemented (ECellView *ecell_view) } 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); @@ -483,7 +579,8 @@ e_cell_get_bg_color (ECellView *ecell_view, gint row) } 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); diff --git a/widgets/table/e-cell.h b/widgets/table/e-cell.h index 3a41db0afe..830184c06d 100644 --- a/widgets/table/e-cell.h +++ b/widgets/table/e-cell.h @@ -92,7 +92,7 @@ struct _ECellView { gint focus_x1, focus_y1, focus_x2, focus_y2; gint focus_col, focus_row; - void (*kill_view_cb) (struct _ECellView*, gpointer ); + void (*kill_view_cb) (struct _ECellView *, gpointer ); GList *kill_view_cb_data; }; diff --git a/widgets/table/e-popup-menu.c b/widgets/table/e-popup-menu.c index 07589b1589..a4cfec07e9 100644 --- a/widgets/table/e-popup-menu.c +++ b/widgets/table/e-popup-menu.c @@ -38,7 +38,9 @@ * Creates an item with an optional icon */ static void -make_item (GtkMenu *menu, GtkMenuItem *item, const gchar *name) +make_item (GtkMenu *menu, + GtkMenuItem *item, + const gchar *name) { GtkWidget *label; @@ -57,10 +59,10 @@ make_item (GtkMenu *menu, GtkMenuItem *item, const gchar *name) GtkMenu * e_popup_menu_create_with_domain (EPopupMenu *menu_list, - guint32 disable_mask, - guint32 hide_mask, - gpointer default_closure, - const gchar *domain) + guint32 disable_mask, + guint32 hide_mask, + gpointer default_closure, + const gchar *domain) { GtkMenu *menu = GTK_MENU (gtk_menu_new ()); gboolean last_item_separator = TRUE; diff --git a/widgets/table/e-table-click-to-add.c b/widgets/table/e-table-click-to-add.c index 662a9c50a5..8defc2c479 100644 --- a/widgets/table/e-table-click-to-add.c +++ b/widgets/table/e-table-click-to-add.c @@ -63,7 +63,10 @@ enum { }; static void -etcta_cursor_change (GObject *object, gint row, gint col, ETableClickToAdd *etcta) +etcta_cursor_change (GObject *object, + gint row, + gint col, + ETableClickToAdd *etcta) { g_signal_emit (etcta, etcta_signals[CURSOR_CHANGE], 0, @@ -71,7 +74,8 @@ etcta_cursor_change (GObject *object, gint row, gint col, ETableClickToAdd *etct } static void -etcta_style_set (ETableClickToAdd *etcta, GtkStyle *previous_style) +etcta_style_set (ETableClickToAdd *etcta, + GtkStyle *previous_style) { GtkWidget *widget; GtkStyle *style; @@ -94,7 +98,8 @@ etcta_style_set (ETableClickToAdd *etcta, GtkStyle *previous_style) } static void -etcta_add_table_header (ETableClickToAdd *etcta, ETableHeader *header) +etcta_add_table_header (ETableClickToAdd *etcta, + ETableHeader *header) { etcta->eth = header; if (etcta->eth) @@ -116,7 +121,8 @@ etcta_drop_table_header (ETableClickToAdd *etcta) } static void -etcta_add_one (ETableClickToAdd *etcta, ETableModel *one) +etcta_add_one (ETableClickToAdd *etcta, + ETableModel *one) { etcta->one = one; if (etcta->one) @@ -143,7 +149,8 @@ etcta_drop_one (ETableClickToAdd *etcta) } static void -etcta_add_model (ETableClickToAdd *etcta, ETableModel *model) +etcta_add_model (ETableClickToAdd *etcta, + ETableModel *model) { etcta->model = model; if (etcta->model) @@ -161,7 +168,8 @@ etcta_drop_model (ETableClickToAdd *etcta) } static void -etcta_add_message (ETableClickToAdd *etcta, const gchar *message) +etcta_add_message (ETableClickToAdd *etcta, + const gchar *message) { etcta->message = g_strdup (message); } @@ -191,7 +199,7 @@ etcta_dispose (GObject *object) static void etcta_set_property (GObject *object, - guint prop_id, + guint property_id, const GValue *value, GParamSpec *pspec) { @@ -201,7 +209,7 @@ etcta_set_property (GObject *object, item = GNOME_CANVAS_ITEM (object); etcta = E_TABLE_CLICK_TO_ADD (object); - switch (prop_id) { + switch (property_id) { case PROP_HEADER: etcta_drop_table_header (etcta); etcta_add_table_header (etcta, E_TABLE_HEADER (g_value_get_object (value))); @@ -230,7 +238,7 @@ etcta_set_property (GObject *object, NULL); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); return; } @@ -270,13 +278,16 @@ create_rect_and_text (ETableClickToAdd *etcta) } static void -etcta_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +etcta_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { ETableClickToAdd *etcta; etcta = E_TABLE_CLICK_TO_ADD (object); - switch (prop_id) { + switch (property_id) { case PROP_HEADER: g_value_set_object (value, etcta->eth); break; @@ -293,7 +304,7 @@ etcta_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *p g_value_set_double (value, etcta->height); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -376,7 +387,7 @@ finish_editing (ETableClickToAdd *etcta) "cursor_mode", E_CURSOR_SPREADSHEET, NULL); - g_signal_connect(etcta->row, "key_press", + g_signal_connect (etcta->row, "key_press", G_CALLBACK (item_key_press), etcta); set_initial_selection (etcta); @@ -386,7 +397,8 @@ finish_editing (ETableClickToAdd *etcta) /* Handles the events on the ETableClickToAdd, particularly * it creates the ETableItem and passes in some events. */ static gint -etcta_event (GnomeCanvasItem *item, GdkEvent *e) +etcta_event (GnomeCanvasItem *item, + GdkEvent *e) { ETableClickToAdd *etcta = E_TABLE_CLICK_TO_ADD (item); @@ -424,7 +436,7 @@ etcta_event (GnomeCanvasItem *item, GdkEvent *e) "cursor_mode", E_CURSOR_SPREADSHEET, NULL); - g_signal_connect(etcta->row, "key_press", + g_signal_connect (etcta->row, "key_press", G_CALLBACK (item_key_press), etcta); e_canvas_item_grab_focus (GNOME_CANVAS_ITEM (etcta->row), TRUE); @@ -462,7 +474,8 @@ etcta_event (GnomeCanvasItem *item, GdkEvent *e) } static void -etcta_reflow (GnomeCanvasItem *item, gint flags) +etcta_reflow (GnomeCanvasItem *item, + gint flags) { ETableClickToAdd *etcta = E_TABLE_CLICK_TO_ADD (item); @@ -583,7 +596,7 @@ etcta_init (ETableClickToAdd *etcta) etcta->height = 6; etcta->selection = e_table_selection_model_new (); - g_signal_connect(etcta->selection, "cursor_changed", + g_signal_connect (etcta->selection, "cursor_changed", G_CALLBACK (etcta_cursor_change), etcta); e_canvas_item_set_reflow_callback (GNOME_CANVAS_ITEM (etcta), etcta_reflow); diff --git a/widgets/table/e-table-col.c b/widgets/table/e-table-col.c index 7296408594..fc7da9c9f5 100644 --- a/widgets/table/e-table-col.c +++ b/widgets/table/e-table-col.c @@ -82,13 +82,13 @@ etc_dispose (GObject *object) static void etc_set_property (GObject *object, - guint prop_id, + guint property_id, const GValue *value, GParamSpec *pspec) { ETableCol *etc = E_TABLE_COL (object); - switch (prop_id) { + switch (property_id) { case PROP_COMPARE_COL: etc->compare_col = g_value_get_int (value); break; @@ -99,18 +99,18 @@ etc_set_property (GObject *object, static void etc_get_property (GObject *object, - guint prop_id, + guint property_id, GValue *value, GParamSpec *pspec) { ETableCol *etc = E_TABLE_COL (object); - switch (prop_id) { + switch (property_id) { case PROP_COMPARE_COL: g_value_set_int (value, etc->compare_col); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } diff --git a/widgets/table/e-table-col.h b/widgets/table/e-table-col.h index b82886a5ca..042137b40a 100644 --- a/widgets/table/e-table-col.h +++ b/widgets/table/e-table-col.h @@ -73,11 +73,11 @@ struct _ETableCol { GCompareDataFunc compare; ETableSearchFunc search; - guint selected:1; - guint resizable:1; - guint disabled:1; - guint sortable:1; - guint groupable:1; + guint selected : 1; + guint resizable : 1; + guint disabled : 1; + guint sortable : 1; + guint groupable : 1; gint col_idx; gint compare_col; diff --git a/widgets/table/e-table-column-specification.c b/widgets/table/e-table-column-specification.c index 7fb0756085..cd7e07acca 100644 --- a/widgets/table/e-table-column-specification.c +++ b/widgets/table/e-table-column-specification.c @@ -102,7 +102,7 @@ e_table_column_specification_new (void) void e_table_column_specification_load_from_node (ETableColumnSpecification *etcs, - const xmlNode *node) + const xmlNode *node) { free_strings (etcs); @@ -128,7 +128,7 @@ e_table_column_specification_load_from_node (ETableColumnSpecification *etcs, xmlNode * e_table_column_specification_save_to_node (ETableColumnSpecification *specification, - xmlNode *parent) + xmlNode *parent) { xmlNode *node; if (parent) diff --git a/widgets/table/e-table-config.c b/widgets/table/e-table-config.c index 4bfb80d1e9..4e9fe81117 100644 --- a/widgets/table/e-table-config.c +++ b/widgets/table/e-table-config.c @@ -94,7 +94,8 @@ config_finalize (GObject *object) } static void -e_table_config_changed (ETableConfig *config, ETableState *state) +e_table_config_changed (ETableConfig *config, + ETableState *state) { g_return_if_fail (E_IS_TABLE_CONFIG (config)); @@ -113,13 +114,13 @@ config_dialog_changed (ETableConfig *config) static void config_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) + guint property_id, + GValue *value, + GParamSpec *pspec) { ETableConfig *config = E_TABLE_CONFIG (object); - switch (prop_id) { + switch (property_id) { case PROP_STATE: g_value_set_object (value, config->state); break; @@ -156,7 +157,8 @@ e_table_config_class_init (ETableConfigClass *class) } static void -configure_combo_box_add (GtkComboBox *combo_box, const gchar *item, +configure_combo_box_add (GtkComboBox *combo_box, + const gchar *item, const gchar *value) { GtkTreeRowReference *reference; @@ -203,7 +205,8 @@ configure_combo_box_get_active (GtkComboBox *combo_box) } static void -configure_combo_box_set_active (GtkComboBox *combo_box, const gchar *value) +configure_combo_box_set_active (GtkComboBox *combo_box, + const gchar *value) { GtkTreeRowReference *reference; GHashTable *index; @@ -231,7 +234,8 @@ configure_combo_box_set_active (GtkComboBox *combo_box, const gchar *value) } static ETableColumnSpecification * -find_column_in_spec (ETableSpecification *spec, gint model_col) +find_column_in_spec (ETableSpecification *spec, + gint model_col) { ETableColumnSpecification **column; @@ -248,7 +252,8 @@ find_column_in_spec (ETableSpecification *spec, gint model_col) } static gint -find_model_column_by_name (ETableSpecification *spec, const gchar *s) +find_model_column_by_name (ETableSpecification *spec, + const gchar *s) { ETableColumnSpecification **column; @@ -263,7 +268,8 @@ find_model_column_by_name (ETableSpecification *spec, const gchar *s) } static void -update_sort_and_group_config_dialog (ETableConfig *config, gboolean is_sort) +update_sort_and_group_config_dialog (ETableConfig *config, + gboolean is_sort) { ETableConfigSortWidgets *widgets; gint count, i; @@ -328,7 +334,7 @@ update_sort_and_group_config_dialog (ETableConfig *config, gboolean is_sort) d = GTK_TOGGLE_BUTTON ( widgets[i].radio_descending); - gtk_toggle_button_set_active (col.ascending ? a:d, 1); + gtk_toggle_button_set_active (col.ascending ? a : d, 1); } else { GtkToggleButton *t; @@ -428,7 +434,7 @@ config_group_info_update (ETableConfig *config) col.ascending ? _("(Ascending)") : _("(Descending)")); - if ((i+1) != count) + if ((i + 1) != count) g_string_append (res, ", "); } if (res->str[0] == 0) @@ -492,7 +498,8 @@ config_fields_info_update (ETableConfig *config) } static void -do_sort_and_group_config_dialog (ETableConfig *config, gboolean is_sort) +do_sort_and_group_config_dialog (ETableConfig *config, + gboolean is_sort) { GtkDialog *dialog; gint response, running = 1; @@ -682,32 +689,38 @@ e_table_proxy_etable_available_new (ETableModel *store) } static void -config_button_fields (GtkWidget *widget, ETableConfig *config) +config_button_fields (GtkWidget *widget, + ETableConfig *config) { do_fields_config_dialog (config); } static void -config_button_sort (GtkWidget *widget, ETableConfig *config) +config_button_sort (GtkWidget *widget, + ETableConfig *config) { do_sort_and_group_config_dialog (config, TRUE); } static void -config_button_group (GtkWidget *widget, ETableConfig *config) +config_button_group (GtkWidget *widget, + ETableConfig *config) { do_sort_and_group_config_dialog (config, FALSE); } static void -dialog_destroyed (gpointer data, GObject *where_object_was) +dialog_destroyed (gpointer data, + GObject *where_object_was) { ETableConfig *config = data; g_object_unref (config); } static void -dialog_response (GtkWidget *dialog, gint response_id, ETableConfig *config) +dialog_response (GtkWidget *dialog, + gint response_id, + ETableConfig *config) { if (response_id == GTK_RESPONSE_APPLY || response_id == GTK_RESPONSE_OK) { @@ -760,14 +773,13 @@ connect_button (ETableConfig *config, { GtkWidget *button = e_builder_get_widget (builder, widget_name); - if (button) { - g_signal_connect (G_OBJECT (button), "clicked", - cback, config); - } + if (button) + g_signal_connect (button, "clicked", cback, config); } static gint -get_source_model_col_index (ETableConfig *config, gint idx) +get_source_model_col_index (ETableConfig *config, + gint idx) { gint visible_index; ETableModel *src_model; @@ -781,7 +793,8 @@ get_source_model_col_index (ETableConfig *config, gint idx) } static void -sort_combo_changed (GtkComboBox *combo_box, ETableConfigSortWidgets *sort) +sort_combo_changed (GtkComboBox *combo_box, + ETableConfigSortWidgets *sort) { ETableConfig *config = sort->e_table_config; ETableSortInfo *sort_info = config->temp_state->sort_info; @@ -819,7 +832,8 @@ sort_combo_changed (GtkComboBox *combo_box, ETableConfigSortWidgets *sort) } static void -sort_ascending_toggled (GtkToggleButton *t, ETableConfigSortWidgets *sort) +sort_ascending_toggled (GtkToggleButton *t, + ETableConfigSortWidgets *sort) { ETableConfig *config = sort->e_table_config; ETableSortInfo *si = config->temp_state->sort_info; @@ -833,7 +847,8 @@ sort_ascending_toggled (GtkToggleButton *t, ETableConfigSortWidgets *sort) } static void -configure_sort_dialog (ETableConfig *config, GtkBuilder *builder) +configure_sort_dialog (ETableConfig *config, + GtkBuilder *builder) { GSList *l; gint i; @@ -904,7 +919,8 @@ configure_sort_dialog (ETableConfig *config, GtkBuilder *builder) } static void -group_combo_changed (GtkComboBox *combo_box, ETableConfigSortWidgets *group) +group_combo_changed (GtkComboBox *combo_box, + ETableConfigSortWidgets *group) { ETableConfig *config = group->e_table_config; ETableSortInfo *sort_info = config->temp_state->sort_info; @@ -942,7 +958,8 @@ group_combo_changed (GtkComboBox *combo_box, ETableConfigSortWidgets *group) } static void -group_ascending_toggled (GtkToggleButton *t, ETableConfigSortWidgets *group) +group_ascending_toggled (GtkToggleButton *t, + ETableConfigSortWidgets *group) { ETableConfig *config = group->e_table_config; ETableSortInfo *si = config->temp_state->sort_info; @@ -956,7 +973,8 @@ group_ascending_toggled (GtkToggleButton *t, ETableConfigSortWidgets *group) } static void -configure_group_dialog (ETableConfig *config, GtkBuilder *builder) +configure_group_dialog (ETableConfig *config, + GtkBuilder *builder) { GSList *l; gint i; @@ -1027,14 +1045,16 @@ configure_group_dialog (ETableConfig *config, GtkBuilder *builder) } static void -add_column (gint model_row, gpointer closure) +add_column (gint model_row, + gpointer closure) { GList **columns = closure; *columns = g_list_prepend (*columns, GINT_TO_POINTER (model_row)); } static void -config_button_add (GtkWidget *widget, ETableConfig *config) +config_button_add (GtkWidget *widget, + ETableConfig *config) { GList *columns = NULL; GList *column; @@ -1070,7 +1090,8 @@ config_button_add (GtkWidget *widget, ETableConfig *config) } static void -config_button_remove (GtkWidget *widget, ETableConfig *config) +config_button_remove (GtkWidget *widget, + ETableConfig *config) { GList *columns = NULL; GList *column; @@ -1103,7 +1124,8 @@ config_button_remove (GtkWidget *widget, ETableConfig *config) } static void -config_button_up (GtkWidget *widget, ETableConfig *config) +config_button_up (GtkWidget *widget, + ETableConfig *config) { GList *columns = NULL; GList *column; @@ -1158,7 +1180,8 @@ config_button_up (GtkWidget *widget, ETableConfig *config) } static void -config_button_down (GtkWidget *widget, ETableConfig *config) +config_button_down (GtkWidget *widget, + ETableConfig *config) { GList *columns = NULL; GList *column; @@ -1211,7 +1234,8 @@ config_button_down (GtkWidget *widget, ETableConfig *config) } static void -configure_fields_dialog (ETableConfig *config, GtkBuilder *builder) +configure_fields_dialog (ETableConfig *config, + GtkBuilder *builder) { GtkWidget *scrolled; GtkWidget *etable; @@ -1341,11 +1365,11 @@ e_table_config_init (ETableConfig *config) } ETableConfig * -e_table_config_construct (ETableConfig *config, - const gchar *header, - ETableSpecification *spec, - ETableState *state, - GtkWindow *parent_window) +e_table_config_construct (ETableConfig *config, + const gchar *header, + ETableSpecification *spec, + ETableState *state, + GtkWindow *parent_window) { ETableColumnSpecification **column; diff --git a/widgets/table/e-table-extras.c b/widgets/table/e-table-extras.c index b07651a22c..f3e55cf8cf 100644 --- a/widgets/table/e-table-extras.c +++ b/widgets/table/e-table-extras.c @@ -156,7 +156,9 @@ e_string_search (gconstpointer haystack, } static gint -e_table_str_case_compare (gconstpointer x, gconstpointer y, gpointer cmp_cache) +e_table_str_case_compare (gconstpointer x, + gconstpointer y, + gpointer cmp_cache) { const gchar *cx = NULL, *cy = NULL; @@ -190,7 +192,9 @@ e_table_str_case_compare (gconstpointer x, gconstpointer y, gpointer cmp_cache) } static gint -e_table_collate_compare (gconstpointer x, gconstpointer y, gpointer cmp_cache) +e_table_collate_compare (gconstpointer x, + gconstpointer y, + gpointer cmp_cache) { const gchar *cx = NULL, *cy = NULL; diff --git a/widgets/table/e-table-field-chooser-dialog.c b/widgets/table/e-table-field-chooser-dialog.c index b4ac8e53ef..354095b0c8 100644 --- a/widgets/table/e-table-field-chooser-dialog.c +++ b/widgets/table/e-table-field-chooser-dialog.c @@ -32,8 +32,8 @@ #include "e-table-field-chooser-dialog.h" -static void e_table_field_chooser_dialog_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); -static void e_table_field_chooser_dialog_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); +static void e_table_field_chooser_dialog_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static void e_table_field_chooser_dialog_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); static void e_table_field_chooser_dialog_dispose (GObject *object); static void e_table_field_chooser_dialog_response (GtkDialog *dialog, gint id); @@ -53,7 +53,7 @@ e_table_field_chooser_dialog_class_init (ETableFieldChooserDialogClass *class) GObjectClass *object_class; GtkDialogClass *dialog_class; - object_class = (GObjectClass*) class; + object_class = (GObjectClass *) class; dialog_class = GTK_DIALOG_CLASS (class); object_class->dispose = e_table_field_chooser_dialog_dispose; @@ -119,7 +119,7 @@ e_table_field_chooser_dialog_init (ETableFieldChooserDialog *e_table_field_choos gtk_window_set_title (GTK_WINDOW (dialog), _("Add a Column")); } -GtkWidget* +GtkWidget * e_table_field_chooser_dialog_new (void) { return g_object_new (E_TYPE_TABLE_FIELD_CHOOSER_DIALOG, NULL); @@ -146,10 +146,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) +e_table_field_chooser_dialog_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { ETableFieldChooserDialog *etfcd = E_TABLE_FIELD_CHOOSER_DIALOG (object); - switch (prop_id) { + switch (property_id) { case PROP_DND_CODE: g_free (etfcd->dnd_code); etfcd->dnd_code = g_strdup (g_value_get_string (value)); @@ -192,10 +195,13 @@ 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) +e_table_field_chooser_dialog_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { ETableFieldChooserDialog *etfcd = E_TABLE_FIELD_CHOOSER_DIALOG (object); - switch (prop_id) { + switch (property_id) { case PROP_DND_CODE: g_value_set_string (value, etfcd->dnd_code); break; @@ -206,13 +212,14 @@ e_table_field_chooser_dialog_get_property (GObject *object, guint prop_id, GValu g_value_set_object (value, etfcd->header); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void -e_table_field_chooser_dialog_response (GtkDialog *dialog, gint id) +e_table_field_chooser_dialog_response (GtkDialog *dialog, + gint id) { if (id == GTK_RESPONSE_OK) gtk_widget_destroy (GTK_WIDGET (dialog)); diff --git a/widgets/table/e-table-field-chooser-item.c b/widgets/table/e-table-field-chooser-item.c index e2dc6f1721..ecc414853c 100644 --- a/widgets/table/e-table-field-chooser-item.c +++ b/widgets/table/e-table-field-chooser-item.c @@ -89,7 +89,8 @@ etfci_dispose (GObject *object) } static gint -etfci_find_button (ETableFieldChooserItem *etfci, gdouble loc) +etfci_find_button (ETableFieldChooserItem *etfci, + gdouble loc) { gint i; gint count; @@ -148,7 +149,8 @@ etfci_rebuild_combined (ETableFieldChooserItem *etfci) } static void -etfci_reflow (GnomeCanvasItem *item, gint flags) +etfci_reflow (GnomeCanvasItem *item, + gint flags) { ETableFieldChooserItem *etfci = E_TABLE_FIELD_CHOOSER_ITEM (item); gdouble old_height; @@ -345,7 +347,7 @@ etfci_add_table_header (ETableFieldChooserItem *etfci, static void etfci_set_property (GObject *object, - guint prop_id, + guint property_id, const GValue *value, GParamSpec *pspec) { @@ -355,7 +357,7 @@ etfci_set_property (GObject *object, item = GNOME_CANVAS_ITEM (object); etfci = E_TABLE_FIELD_CHOOSER_ITEM (object); - switch (prop_id) { + switch (property_id) { case PROP_FULL_HEADER: etfci_drop_full_header (etfci); if (g_value_get_object (value)) @@ -385,13 +387,16 @@ etfci_set_property (GObject *object, } static void -etfci_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +etfci_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { ETableFieldChooserItem *etfci; etfci = E_TABLE_FIELD_CHOOSER_ITEM (object); - switch (prop_id) { + switch (property_id) { case PROP_DND_CODE: g_value_set_string (value, etfci->dnd_code); @@ -403,18 +408,18 @@ etfci_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *p g_value_set_double (value, etfci->height); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void -etfci_drag_data_get (GtkWidget *widget, - GdkDragContext *context, - GtkSelectionData *selection_data, - guint info, - guint time, - ETableFieldChooserItem *etfci) +etfci_drag_data_get (GtkWidget *widget, + GdkDragContext *context, + GtkSelectionData *selection_data, + guint info, + guint time, + ETableFieldChooserItem *etfci) { if (etfci->drag_col != -1) { gchar *string = g_strdup_printf("%d", etfci->drag_col); @@ -428,9 +433,9 @@ etfci_drag_data_get (GtkWidget *widget, } static void -etfci_drag_end (GtkWidget *canvas, - GdkDragContext *context, - ETableFieldChooserItem *etfci) +etfci_drag_end (GtkWidget *canvas, + GdkDragContext *context, + ETableFieldChooserItem *etfci) { etfci->drag_col = -1; } @@ -529,13 +534,19 @@ etfci_draw (GnomeCanvasItem *item, } static GnomeCanvasItem * -etfci_point (GnomeCanvasItem *item, gdouble x, gdouble y, gint cx, gint cy) +etfci_point (GnomeCanvasItem *item, + gdouble x, + gdouble y, + gint cx, + gint cy) { return item; } static gboolean -etfci_maybe_start_drag (ETableFieldChooserItem *etfci, gint x, gint y) +etfci_maybe_start_drag (ETableFieldChooserItem *etfci, + gint x, + gint y) { if (!etfci->maybe_drag) return FALSE; @@ -548,7 +559,10 @@ etfci_maybe_start_drag (ETableFieldChooserItem *etfci, gint x, gint y) } static void -etfci_start_drag (ETableFieldChooserItem *etfci, GdkEvent *event, gdouble x, gdouble y) +etfci_start_drag (ETableFieldChooserItem *etfci, + GdkEvent *event, + gdouble x, + gdouble y) { GtkWidget *widget = GTK_WIDGET (GNOME_CANVAS_ITEM (etfci)->canvas); GtkTargetList *list; @@ -622,7 +636,8 @@ etfci_start_drag (ETableFieldChooserItem *etfci, GdkEvent *event, gdouble x, gdo * Handles the events on the ETableFieldChooserItem */ static gint -etfci_event (GnomeCanvasItem *item, GdkEvent *e) +etfci_event (GnomeCanvasItem *item, + GdkEvent *e) { ETableFieldChooserItem *etfci = E_TABLE_FIELD_CHOOSER_ITEM (item); GnomeCanvas *canvas = item->canvas; diff --git a/widgets/table/e-table-field-chooser-item.h b/widgets/table/e-table-field-chooser-item.h index 066dd52ffb..f08b94ac6f 100644 --- a/widgets/table/e-table-field-chooser-item.h +++ b/widgets/table/e-table-field-chooser-item.h @@ -74,7 +74,7 @@ struct _ETableFieldChooserItem { /* * For dragging columns */ - guint maybe_drag:1; + guint maybe_drag : 1; gint click_x, click_y; gint drag_col; guint drag_data_get_id; diff --git a/widgets/table/e-table-field-chooser.c b/widgets/table/e-table-field-chooser.c index 2f945bb079..5e2cb13880 100644 --- a/widgets/table/e-table-field-chooser.c +++ b/widgets/table/e-table-field-chooser.c @@ -36,8 +36,8 @@ #include "e-table-field-chooser.h" #include "e-table-field-chooser-item.h" -static void e_table_field_chooser_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); -static void e_table_field_chooser_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); +static void e_table_field_chooser_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); +static void e_table_field_chooser_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); static void e_table_field_chooser_dispose (GObject *object); /* The arguments we take */ @@ -55,7 +55,7 @@ e_table_field_chooser_class_init (ETableFieldChooserClass *class) { GObjectClass *object_class; - object_class = (GObjectClass*) class; + object_class = (GObjectClass *) class; object_class->set_property = e_table_field_chooser_set_property; object_class->get_property = e_table_field_chooser_get_property; @@ -202,7 +202,7 @@ e_table_field_chooser_init (ETableFieldChooser *etfc) "dnd_code", etfc->dnd_code, NULL ); - g_signal_connect( etfc->canvas, "reflow", + g_signal_connect ( etfc->canvas, "reflow", G_CALLBACK ( resize ), etfc); @@ -238,18 +238,21 @@ e_table_field_chooser_dispose (GObject *object) G_OBJECT_CLASS (e_table_field_chooser_parent_class)->dispose (object); } -GtkWidget* +GtkWidget * e_table_field_chooser_new (void) { return g_object_new (E_TYPE_TABLE_FIELD_CHOOSER, NULL); } static void -e_table_field_chooser_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +e_table_field_chooser_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { ETableFieldChooser *etfc = E_TABLE_FIELD_CHOOSER (object); - switch (prop_id) { + switch (property_id) { case PROP_DND_CODE: g_free (etfc->dnd_code); etfc->dnd_code = g_strdup (g_value_get_string (value)); @@ -292,11 +295,14 @@ 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) +e_table_field_chooser_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { ETableFieldChooser *etfc = E_TABLE_FIELD_CHOOSER (object); - switch (prop_id) { + switch (property_id) { case PROP_DND_CODE: g_value_set_string (value, etfc->dnd_code); break; @@ -307,7 +313,7 @@ e_table_field_chooser_get_property (GObject *object, guint prop_id, GValue *valu g_value_set_object (value, etfc->header); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } diff --git a/widgets/table/e-table-group-container.c b/widgets/table/e-table-group-container.c index 0a933769f9..d874834db1 100644 --- a/widgets/table/e-table-group-container.c +++ b/widgets/table/e-table-group-container.c @@ -68,8 +68,8 @@ static EPrintable * etgc_get_printable (ETableGroup *etg); static void -e_table_group_container_child_node_free (ETableGroupContainer *etgc, - ETableGroupContainerChildNode *child_node) +e_table_group_container_child_node_free (ETableGroupContainer *etgc, + ETableGroupContainerChildNode *child_node) { ETableGroup *etg = E_TABLE_GROUP (etgc); ETableGroup *child = child_node->child; @@ -141,10 +141,13 @@ etgc_dispose (GObject *object) * This routine constructs the new %ETableGroupContainer. */ void -e_table_group_container_construct (GnomeCanvasGroup *parent, ETableGroupContainer *etgc, - ETableHeader *full_header, - ETableHeader *header, - ETableModel *model, ETableSortInfo *sort_info, gint n) +e_table_group_container_construct (GnomeCanvasGroup *parent, + ETableGroupContainer *etgc, + ETableHeader *full_header, + ETableHeader *header, + ETableModel *model, + ETableSortInfo *sort_info, + gint n) { ETableCol *col; ETableSortColumn column = e_table_sort_info_grouping_get_nth (sort_info, n); @@ -186,9 +189,12 @@ e_table_group_container_construct (GnomeCanvasGroup *parent, ETableGroupContaine * Returns: The new %ETableGroupContainer. */ ETableGroup * -e_table_group_container_new (GnomeCanvasGroup *parent, ETableHeader *full_header, - ETableHeader *header, - ETableModel *model, ETableSortInfo *sort_info, gint n) +e_table_group_container_new (GnomeCanvasGroup *parent, + ETableHeader *full_header, + ETableHeader *header, + ETableModel *model, + ETableSortInfo *sort_info, + gint n) { ETableGroupContainer *etgc; @@ -202,7 +208,8 @@ e_table_group_container_new (GnomeCanvasGroup *parent, ETableHeader *full_header } static gint -etgc_event (GnomeCanvasItem *item, GdkEvent *event) +etgc_event (GnomeCanvasItem *item, + GdkEvent *event) { ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (item); gboolean return_val = TRUE; @@ -338,17 +345,18 @@ etgc_unrealize (GnomeCanvasItem *item) } static void -compute_text (ETableGroupContainer *etgc, ETableGroupContainerChildNode *child_node) +compute_text (ETableGroupContainer *etgc, + ETableGroupContainerChildNode *child_node) { gchar *text; if (etgc->ecol->text) { /* Translators: This text is used as a special row when an ETable - has turned on grouping on a column, which has set a title. - The first %s is replaced with a column title. - The second %s is replaced with an actual group value. - Finally the %d is replaced with count of items in this group. - Example: "Family name: Smith (13 items)" + * has turned on grouping on a column, which has set a title. + * The first %s is replaced with a column title. + * The second %s is replaced with an actual group value. + * Finally the %d is replaced with count of items in this group. + * Example: "Family name: Smith (13 items)" */ text = g_strdup_printf (ngettext("%s: %s (%d item)", "%s: %s (%d items)", @@ -357,10 +365,10 @@ compute_text (ETableGroupContainer *etgc, ETableGroupContainerChildNode *child_n (gint) child_node->count); } else { /* Translators: This text is used as a special row when an ETable - has turned on grouping on a column, which doesn't have set a title. - The %s is replaced with an actual group value. - The %d is replaced with count of items in this group. - Example: "Smith (13 items)" + * has turned on grouping on a column, which doesn't have set a title. + * The %s is replaced with an actual group value. + * The %d is replaced with count of items in this group. + * Example: "Smith (13 items)" */ text = g_strdup_printf (ngettext("%s (%d item)", "%s (%d items)", @@ -375,56 +383,74 @@ compute_text (ETableGroupContainer *etgc, ETableGroupContainerChildNode *child_n } static void -child_cursor_change (ETableGroup *etg, gint row, - ETableGroupContainer *etgc) +child_cursor_change (ETableGroup *etg, + gint row, + ETableGroupContainer *etgc) { e_table_group_cursor_change (E_TABLE_GROUP (etgc), row); } static void -child_cursor_activated (ETableGroup *etg, gint row, - ETableGroupContainer *etgc) +child_cursor_activated (ETableGroup *etg, + gint row, + ETableGroupContainer *etgc) { e_table_group_cursor_activated (E_TABLE_GROUP (etgc), row); } static void -child_double_click (ETableGroup *etg, gint row, gint col, GdkEvent *event, - ETableGroupContainer *etgc) +child_double_click (ETableGroup *etg, + gint row, + gint col, + GdkEvent *event, + ETableGroupContainer *etgc) { e_table_group_double_click (E_TABLE_GROUP (etgc), row, col, event); } static gboolean -child_right_click (ETableGroup *etg, gint row, gint col, GdkEvent *event, - ETableGroupContainer *etgc) +child_right_click (ETableGroup *etg, + gint row, + gint col, + GdkEvent *event, + ETableGroupContainer *etgc) { return e_table_group_right_click (E_TABLE_GROUP (etgc), row, col, event); } static gboolean -child_click (ETableGroup *etg, gint row, gint col, GdkEvent *event, - ETableGroupContainer *etgc) +child_click (ETableGroup *etg, + gint row, + gint col, + GdkEvent *event, + ETableGroupContainer *etgc) { return e_table_group_click (E_TABLE_GROUP (etgc), row, col, event); } static gboolean -child_key_press (ETableGroup *etg, gint row, gint col, GdkEvent *event, - ETableGroupContainer *etgc) +child_key_press (ETableGroup *etg, + gint row, + gint col, + GdkEvent *event, + ETableGroupContainer *etgc) { return e_table_group_key_press (E_TABLE_GROUP (etgc), row, col, event); } static gboolean -child_start_drag (ETableGroup *etg, gint row, gint col, GdkEvent *event, - ETableGroupContainer *etgc) +child_start_drag (ETableGroup *etg, + gint row, + gint col, + GdkEvent *event, + ETableGroupContainer *etgc) { return e_table_group_start_drag (E_TABLE_GROUP (etgc), row, col, event); } static ETableGroupContainerChildNode * -create_child_node (ETableGroupContainer *etgc, gpointer val) +create_child_node (ETableGroupContainer *etgc, + gpointer val) { ETableGroup *child; ETableGroupContainerChildNode *child_node; @@ -478,7 +504,8 @@ create_child_node (ETableGroupContainer *etgc, gpointer val) } static void -etgc_add (ETableGroup *etg, gint row) +etgc_add (ETableGroup *etg, + gint row) { ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); gpointer val = e_table_model_value_at (etg->model, etgc->ecol->col_idx, row); @@ -522,7 +549,9 @@ etgc_add (ETableGroup *etg, gint row) } static void -etgc_add_array (ETableGroup *etg, const gint *array, gint count) +etgc_add_array (ETableGroup *etg, + const gint *array, + gint count) { gint i; ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); @@ -589,7 +618,8 @@ etgc_add_all (ETableGroup *etg) } static gboolean -etgc_remove (ETableGroup *etg, gint row) +etgc_remove (ETableGroup *etg, + gint row) { ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); GList *list; @@ -630,7 +660,9 @@ etgc_row_count (ETableGroup *etg) } static void -etgc_increment (ETableGroup *etg, gint position, gint amount) +etgc_increment (ETableGroup *etg, + gint position, + gint amount) { ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); GList *list; @@ -641,7 +673,9 @@ etgc_increment (ETableGroup *etg, gint position, gint amount) } static void -etgc_decrement (ETableGroup *etg, gint position, gint amount) +etgc_decrement (ETableGroup *etg, + gint position, + gint amount) { ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); GList *list; @@ -652,7 +686,9 @@ etgc_decrement (ETableGroup *etg, gint position, gint amount) } static void -etgc_set_focus (ETableGroup *etg, EFocus direction, gint view_col) +etgc_set_focus (ETableGroup *etg, + EFocus direction, + gint view_col) { ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); if (etgc->children) { @@ -683,7 +719,11 @@ etgc_get_focus_column (ETableGroup *etg) } static void -etgc_compute_location (ETableGroup *etg, gint *x, gint *y, gint *row, gint *col) +etgc_compute_location (ETableGroup *etg, + gint *x, + gint *y, + gint *row, + gint *col) { ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); @@ -709,7 +749,9 @@ 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) +etgc_get_mouse_over (ETableGroup *etg, + gint *row, + gint *col) { ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); @@ -740,7 +782,13 @@ 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) +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); @@ -773,13 +821,16 @@ static void etgc_thaw (ETableGroup *etg) } static void -etgc_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +etgc_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { ETableGroup *etg = E_TABLE_GROUP (object); ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (object); GList *list; - switch (prop_id) { + switch (property_id) { case PROP_FROZEN: if (g_value_get_boolean (value)) etg->frozen = TRUE; @@ -887,12 +938,15 @@ etgc_set_property (GObject *object, guint prop_id, const GValue *value, GParamSp } static void -etgc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +etgc_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { ETableGroup *etg = E_TABLE_GROUP (object); ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (object); - switch (prop_id) { + switch (property_id) { case PROP_FROZEN: g_value_set_boolean (value, etg->frozen); break; @@ -909,7 +963,7 @@ etgc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *ps g_value_set_boolean (value, etgc->uniform_row_height); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -1029,7 +1083,8 @@ etgc_class_init (ETableGroupContainerClass *class) } static void -etgc_reflow (GnomeCanvasItem *item, gint flags) +etgc_reflow (GnomeCanvasItem *item, + gint flags) { ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (item); gboolean frozen; @@ -1136,7 +1191,9 @@ etgc_init (ETableGroupContainer *container) } void -e_table_group_apply_to_leafs (ETableGroup *etg, ETableGroupLeafFn fn, gpointer closure) +e_table_group_apply_to_leafs (ETableGroup *etg, + ETableGroupLeafFn fn, + gpointer closure) { if (E_IS_TABLE_GROUP_CONTAINER (etg)) { ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); @@ -1170,7 +1227,11 @@ typedef struct { #if 0 static gint -gp_draw_rect (GtkPrintContext *context, gdouble x, gdouble y, gdouble width, gdouble height) +gp_draw_rect (GtkPrintContext *context, + gdouble x, + gdouble y, + gdouble width, + gdouble height) { cairo_t *cr; cr = gtk_print_context_get_cairo_context (context); @@ -1184,12 +1245,12 @@ gp_draw_rect (GtkPrintContext *context, gdouble x, gdouble y, gdouble width, gdo #define TEXT_AREA_HEIGHT (TEXT_HEIGHT + 4) static void -e_table_group_container_print_page (EPrintable *ep, - GtkPrintContext *context, - gdouble width, - gdouble height, - gboolean quantize, - ETGCPrintContext *groupcontext) +e_table_group_container_print_page (EPrintable *ep, + GtkPrintContext *context, + gdouble width, + gdouble height, + gboolean quantize, + ETGCPrintContext *groupcontext) { cairo_t *cr; GtkPageSetup *setup; @@ -1283,7 +1344,7 @@ e_table_group_container_print_page (EPrintable *ep, cairo_rectangle (cr, 0, child_margin, width - 2 * TEXT_AREA_HEIGHT, child_height + child_margin + 20); cairo_clip (cr); - e_printable_print_page (child_printable, context, width-2 * TEXT_AREA_HEIGHT, child_margin, quantize); + e_printable_print_page (child_printable, context, width - 2 * TEXT_AREA_HEIGHT, child_margin, quantize); yd -= child_height + TEXT_AREA_HEIGHT; if (e_printable_data_left (child_printable)) { @@ -1319,16 +1380,16 @@ e_table_group_container_print_page (EPrintable *ep, } static gboolean -e_table_group_container_data_left (EPrintable *ep, - ETGCPrintContext *groupcontext) +e_table_group_container_data_left (EPrintable *ep, + ETGCPrintContext *groupcontext) { g_signal_stop_emission_by_name(ep, "data_left"); return groupcontext->child != NULL; } static void -e_table_group_container_reset (EPrintable *ep, - ETGCPrintContext *groupcontext) +e_table_group_container_reset (EPrintable *ep, + ETGCPrintContext *groupcontext) { groupcontext->child = groupcontext->etgc->children; if (groupcontext->child_printable) @@ -1337,12 +1398,12 @@ e_table_group_container_reset (EPrintable *ep, } static gdouble -e_table_group_container_height (EPrintable *ep, - GtkPrintContext *context, - gdouble width, - gdouble max_height, - gboolean quantize, - ETGCPrintContext *groupcontext) +e_table_group_container_height (EPrintable *ep, + GtkPrintContext *context, + gdouble width, + gdouble max_height, + gboolean quantize, + ETGCPrintContext *groupcontext) { gdouble height = 0; gdouble child_height; @@ -1405,12 +1466,12 @@ e_table_group_container_height (EPrintable *ep, } static gboolean -e_table_group_container_will_fit (EPrintable *ep, - GtkPrintContext *context, - gdouble width, - gdouble max_height, - gboolean quantize, - ETGCPrintContext *groupcontext) +e_table_group_container_will_fit (EPrintable *ep, + GtkPrintContext *context, + gdouble width, + gdouble max_height, + gboolean quantize, + ETGCPrintContext *groupcontext) { gboolean will_fit = TRUE; gdouble child_height; @@ -1476,7 +1537,7 @@ e_table_group_container_will_fit (EPrintable *ep, static void e_table_group_container_printable_destroy (gpointer data, - GObject *where_object_was) + GObject *where_object_was) { ETGCPrintContext *groupcontext = data; diff --git a/widgets/table/e-table-group-container.h b/widgets/table/e-table-group-container.h index 5ea0910ef0..ac5f7c9033 100644 --- a/widgets/table/e-table-group-container.h +++ b/widgets/table/e-table-group-container.h @@ -95,7 +95,7 @@ struct _ETableGroupContainer { /* * State: the ETableGroup is open or closed */ - guint open:1; + guint open : 1; }; struct _ETableGroupContainerClass { diff --git a/widgets/table/e-table-group-leaf.c b/widgets/table/e-table-group-leaf.c index bf4f1553aa..27a62bbb16 100644 --- a/widgets/table/e-table-group-leaf.c +++ b/widgets/table/e-table-group-leaf.c @@ -114,11 +114,11 @@ etgl_dispose (GObject *object) static void e_table_group_leaf_construct (GnomeCanvasGroup *parent, - ETableGroupLeaf *etgl, - ETableHeader *full_header, - ETableHeader *header, - ETableModel *model, - ETableSortInfo *sort_info) + ETableGroupLeaf *etgl, + ETableHeader *full_header, + ETableHeader *header, + ETableModel *model, + ETableSortInfo *sort_info) { etgl->is_grouped = (e_table_sort_info_grouping_get_count (sort_info) > 0); @@ -262,7 +262,8 @@ etgl_click (GObject *object, } static void -etgl_reflow (GnomeCanvasItem *item, gint flags) +etgl_reflow (GnomeCanvasItem *item, + gint flags) { ETableGroupLeaf *leaf = E_TABLE_GROUP_LEAF (item); @@ -330,7 +331,8 @@ etgl_realize (GnomeCanvasItem *item) } static void -etgl_add (ETableGroup *etg, gint row) +etgl_add (ETableGroup *etg, + gint row) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg); @@ -341,7 +343,9 @@ etgl_add (ETableGroup *etg, gint row) } static void -etgl_add_array (ETableGroup *etg, const gint *array, gint count) +etgl_add_array (ETableGroup *etg, + const gint *array, + gint count) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg); @@ -363,7 +367,8 @@ etgl_add_all (ETableGroup *etg) } static gboolean -etgl_remove (ETableGroup *etg, gint row) +etgl_remove (ETableGroup *etg, + gint row) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg); @@ -375,7 +380,9 @@ etgl_remove (ETableGroup *etg, gint row) } static void -etgl_increment (ETableGroup *etg, gint position, gint amount) +etgl_increment (ETableGroup *etg, + gint position, + gint amount) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg); @@ -387,7 +394,9 @@ etgl_increment (ETableGroup *etg, gint position, gint amount) } static void -etgl_decrement (ETableGroup *etg, gint position, gint amount) +etgl_decrement (ETableGroup *etg, + gint position, + gint amount) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg); @@ -407,7 +416,9 @@ etgl_row_count (ETableGroup *etg) } static void -etgl_set_focus (ETableGroup *etg, EFocus direction, gint view_col) +etgl_set_focus (ETableGroup *etg, + EFocus direction, + gint view_col) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg); @@ -437,7 +448,11 @@ etgl_get_printable (ETableGroup *etg) } static void -etgl_compute_location (ETableGroup *etg, gint *x, gint *y, gint *row, gint *col) +etgl_compute_location (ETableGroup *etg, + gint *x, + gint *y, + gint *row, + gint *col) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg); @@ -445,7 +460,9 @@ etgl_compute_location (ETableGroup *etg, gint *x, gint *y, gint *row, gint *col) } static void -etgl_get_mouse_over (ETableGroup *etg, gint *row, gint *col) +etgl_get_mouse_over (ETableGroup *etg, + gint *row, + gint *col) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg); @@ -473,14 +490,14 @@ etgl_get_cell_geometry (ETableGroup *etg, static void etgl_set_property (GObject *object, - guint prop_id, + guint property_id, const GValue *value, GParamSpec *pspec) { ETableGroup *etg = E_TABLE_GROUP (object); ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (object); - switch (prop_id) { + switch (property_id) { case PROP_FROZEN: etg->frozen = g_value_get_boolean (value); break; @@ -574,12 +591,15 @@ etgl_set_property (GObject *object, } static void -etgl_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +etgl_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { ETableGroup *etg = E_TABLE_GROUP (object); ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (object); - switch (prop_id) { + switch (property_id) { case PROP_FROZEN: g_value_set_boolean (value, etg->frozen); break; @@ -595,7 +615,7 @@ etgl_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *ps case PROP_UNIFORM_ROW_HEIGHT: g_value_set_boolean (value, etgl->uniform_row_height); default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } diff --git a/widgets/table/e-table-group.c b/widgets/table/e-table-group.c index 8fd56bc7b1..8d820f861a 100644 --- a/widgets/table/e-table-group.c +++ b/widgets/table/e-table-group.c @@ -99,11 +99,11 @@ etg_dispose (GObject *object) */ ETableGroup * e_table_group_new (GnomeCanvasGroup *parent, - ETableHeader *full_header, - ETableHeader *header, - ETableModel *model, - ETableSortInfo *sort_info, - gint n) + ETableHeader *full_header, + ETableHeader *header, + ETableModel *model, + ETableSortInfo *sort_info, + gint n) { g_return_val_if_fail (model != NULL, NULL); @@ -128,10 +128,10 @@ e_table_group_new (GnomeCanvasGroup *parent, */ void e_table_group_construct (GnomeCanvasGroup *parent, - ETableGroup *etg, - ETableHeader *full_header, - ETableHeader *header, - ETableModel *model) + ETableGroup *etg, + ETableHeader *full_header, + ETableHeader *header, + ETableModel *model) { etg->full_header = full_header; g_object_ref (etg->full_header); @@ -139,9 +139,7 @@ e_table_group_construct (GnomeCanvasGroup *parent, g_object_ref (etg->header); etg->model = model; g_object_ref (etg->model); - g_object_set (G_OBJECT (etg), - "parent", parent, - NULL); + g_object_set (etg, "parent", parent, NULL); } /** @@ -154,7 +152,7 @@ e_table_group_construct (GnomeCanvasGroup *parent, */ void e_table_group_add (ETableGroup *etg, - gint row) + gint row) { g_return_if_fail (etg != NULL); g_return_if_fail (E_IS_TABLE_GROUP (etg)); @@ -174,8 +172,8 @@ e_table_group_add (ETableGroup *etg, */ void e_table_group_add_array (ETableGroup *etg, - const gint *array, - gint count) + const gint *array, + gint count) { g_return_if_fail (etg != NULL); g_return_if_fail (E_IS_TABLE_GROUP (etg)); @@ -214,7 +212,7 @@ e_table_group_add_all (ETableGroup *etg) */ gboolean e_table_group_remove (ETableGroup *etg, - gint row) + gint row) { g_return_val_if_fail (etg != NULL, FALSE); g_return_val_if_fail (E_IS_TABLE_GROUP (etg), FALSE); @@ -235,8 +233,8 @@ e_table_group_remove (ETableGroup *etg, */ void e_table_group_increment (ETableGroup *etg, - gint position, - gint amount) + gint position, + gint amount) { g_return_if_fail (etg != NULL); g_return_if_fail (E_IS_TABLE_GROUP (etg)); @@ -257,8 +255,8 @@ e_table_group_increment (ETableGroup *etg, */ void e_table_group_decrement (ETableGroup *etg, - gint position, - gint amount) + gint position, + gint amount) { g_return_if_fail (etg != NULL); g_return_if_fail (E_IS_TABLE_GROUP (etg)); @@ -296,8 +294,8 @@ e_table_group_row_count (ETableGroup *etg) */ void e_table_group_set_focus (ETableGroup *etg, - EFocus direction, - gint view_col) + EFocus direction, + gint view_col) { g_return_if_fail (etg != NULL); g_return_if_fail (E_IS_TABLE_GROUP (etg)); @@ -390,7 +388,9 @@ e_table_group_compute_location (ETableGroup *etg, } void -e_table_group_get_mouse_over (ETableGroup *etg, gint *row, gint *col) +e_table_group_get_mouse_over (ETableGroup *etg, + gint *row, + gint *col) { g_return_if_fail (etg != NULL); g_return_if_fail (E_IS_TABLE_GROUP (etg)); @@ -414,13 +414,13 @@ e_table_group_get_mouse_over (ETableGroup *etg, gint *row, gint *col) * removed from the value row points to. */ void -e_table_group_get_cell_geometry (ETableGroup *etg, - gint *row, - gint *col, - gint *x, - gint *y, - gint *width, - gint *height) +e_table_group_get_cell_geometry (ETableGroup *etg, + gint *row, + gint *col, + gint *x, + gint *y, + gint *width, + gint *height) { g_return_if_fail (etg != NULL); g_return_if_fail (E_IS_TABLE_GROUP (etg)); @@ -437,7 +437,8 @@ e_table_group_get_cell_geometry (ETableGroup *etg, * This routine emits the "cursor_change" signal. */ void -e_table_group_cursor_change (ETableGroup *e_table_group, gint row) +e_table_group_cursor_change (ETableGroup *e_table_group, + gint row) { g_return_if_fail (e_table_group != NULL); g_return_if_fail (E_IS_TABLE_GROUP (e_table_group)); @@ -455,7 +456,8 @@ e_table_group_cursor_change (ETableGroup *e_table_group, gint row) * This routine emits the "cursor_activated" signal. */ void -e_table_group_cursor_activated (ETableGroup *e_table_group, gint row) +e_table_group_cursor_activated (ETableGroup *e_table_group, + gint row) { g_return_if_fail (e_table_group != NULL); g_return_if_fail (E_IS_TABLE_GROUP (e_table_group)); @@ -614,7 +616,8 @@ e_table_group_get_header (ETableGroup *etg) } static gint -etg_event (GnomeCanvasItem *item, GdkEvent *event) +etg_event (GnomeCanvasItem *item, + GdkEvent *event) { ETableGroup *etg = E_TABLE_GROUP (item); gboolean return_val = TRUE; @@ -638,7 +641,7 @@ etg_event (GnomeCanvasItem *item, GdkEvent *event) } static gboolean -etg_get_focus (ETableGroup *etg) +etg_get_focus (ETableGroup *etg) { return etg->has_focus; } diff --git a/widgets/table/e-table-header-item.c b/widgets/table/e-table-header-item.c index 16633f967c..11d8f31f81 100644 --- a/widgets/table/e-table-header-item.c +++ b/widgets/table/e-table-header-item.c @@ -101,7 +101,8 @@ static void scroll_off (ETableHeaderItem *ethi); static void scroll_on (ETableHeaderItem *ethi, guint scroll_direction); static void -ethi_dispose (GObject *object) { +ethi_dispose (GObject *object) +{ ETableHeaderItem *ethi = E_TABLE_HEADER_ITEM (object); ethi_drop_table_header (ethi); @@ -223,7 +224,8 @@ ethi_update (GnomeCanvasItem *item, } static void -ethi_font_set (ETableHeaderItem *ethi, PangoFontDescription *font_desc) +ethi_font_set (ETableHeaderItem *ethi, + PangoFontDescription *font_desc) { if (ethi->font_desc) pango_font_description_free (ethi->font_desc); @@ -252,19 +254,23 @@ ethi_drop_table_header (ETableHeaderItem *ethi) } static void -structure_changed (ETableHeader *header, ETableHeaderItem *ethi) +structure_changed (ETableHeader *header, + ETableHeaderItem *ethi) { gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (ethi)); } static void -dimension_changed (ETableHeader *header, gint col, ETableHeaderItem *ethi) +dimension_changed (ETableHeader *header, + gint col, + ETableHeaderItem *ethi) { gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (ethi)); } static void -ethi_add_table_header (ETableHeaderItem *ethi, ETableHeader *header) +ethi_add_table_header (ETableHeaderItem *ethi, + ETableHeader *header) { ethi->eth = header; g_object_ref (ethi->eth); @@ -282,16 +288,17 @@ ethi_add_table_header (ETableHeaderItem *ethi, ETableHeader *header) } static void -ethi_sort_info_changed (ETableSortInfo *sort_info, ETableHeaderItem *ethi) +ethi_sort_info_changed (ETableSortInfo *sort_info, + ETableHeaderItem *ethi) { gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (ethi)); } static void ethi_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) + guint property_id, + const GValue *value, + GParamSpec *pspec) { GnomeCanvasItem *item; ETableHeaderItem *ethi; @@ -299,7 +306,7 @@ ethi_set_property (GObject *object, item = GNOME_CANVAS_ITEM (object); ethi = E_TABLE_HEADER_ITEM (object); - switch (prop_id) { + switch (property_id) { case PROP_TABLE_HEADER: ethi_drop_table_header (ethi); ethi_add_table_header (ethi, E_TABLE_HEADER (g_value_get_object (value))); @@ -364,15 +371,15 @@ ethi_set_property (GObject *object, static void ethi_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) + guint property_id, + GValue *value, + GParamSpec *pspec) { ETableHeaderItem *ethi; ethi = E_TABLE_HEADER_ITEM (object); - switch (prop_id) { + switch (property_id) { case PROP_FULL_HEADER: g_value_set_object (value, ethi->full_header); break; @@ -380,13 +387,14 @@ ethi_get_property (GObject *object, g_value_set_string (value, ethi->dnd_code); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static gint -ethi_find_col_by_x (ETableHeaderItem *ethi, gint x) +ethi_find_col_by_x (ETableHeaderItem *ethi, + gint x) { const gint cols = e_table_header_count (ethi->eth); gint x1 = 0; @@ -416,7 +424,8 @@ ethi_find_col_by_x (ETableHeaderItem *ethi, gint x) } static gint -ethi_find_col_by_x_nearest (ETableHeaderItem *ethi, gint x) +ethi_find_col_by_x_nearest (ETableHeaderItem *ethi, + gint x) { const gint cols = e_table_header_count (ethi->eth); gint x1 = 0; @@ -473,7 +482,9 @@ make_shaped_window_from_xpm (const gchar **xpm) } static void -ethi_add_drop_marker (ETableHeaderItem *ethi, gint col, gboolean recreate) +ethi_add_drop_marker (ETableHeaderItem *ethi, + gint col, + gboolean recreate) { GnomeCanvas *canvas; GtkAdjustment *adjustment; @@ -536,7 +547,7 @@ ethi_add_destroy_marker (ETableHeaderItem *ethi) "x1", x1 + 1, "y1", (gdouble) 1, "x2", (gdouble) x1 + e_table_header_col_diff ( - ethi->eth, ethi->drag_col, ethi->drag_col+1) - 2, + ethi->eth, ethi->drag_col, ethi->drag_col + 1) - 2, "y2", (gdouble) ethi->height - 2, "fill_color_rgba", 0xFF000080, @@ -555,7 +566,9 @@ ethi_remove_destroy_marker (ETableHeaderItem *ethi) #if 0 static gboolean -moved (ETableHeaderItem *ethi, guint col, guint model_col) +moved (ETableHeaderItem *ethi, + guint col, + guint model_col) { if (col == -1) return TRUE; @@ -667,7 +680,8 @@ scroll_timeout (gpointer data) } static void -scroll_on (ETableHeaderItem *ethi, guint scroll_direction) +scroll_on (ETableHeaderItem *ethi, + guint scroll_direction) { if (ethi->scroll_idle_id == 0 || scroll_direction != ethi->scroll_direction) { if (ethi->scroll_idle_id != 0) @@ -786,13 +800,13 @@ ethi_drag_end (GtkWidget *canvas, static void ethi_drag_data_received (GtkWidget *canvas, - GdkDragContext *drag_context, - gint x, - gint y, - GtkSelectionData *selection_data, - guint info, - guint time, - ETableHeaderItem *ethi) + GdkDragContext *drag_context, + gint x, + gint y, + GtkSelectionData *selection_data, + guint info, + guint time, + ETableHeaderItem *ethi) { const guchar *data; gint found = FALSE; @@ -836,11 +850,11 @@ ethi_drag_data_received (GtkWidget *canvas, static void ethi_drag_data_get (GtkWidget *canvas, - GdkDragContext *context, - GtkSelectionData *selection_data, - guint info, - guint time, - ETableHeaderItem *ethi) + GdkDragContext *context, + GtkSelectionData *selection_data, + guint info, + guint time, + ETableHeaderItem *ethi) { if (ethi->drag_col != -1) { ETableCol *ecol = e_table_header_get_column (ethi->eth, ethi->drag_col); @@ -857,11 +871,11 @@ ethi_drag_data_get (GtkWidget *canvas, static gboolean ethi_drag_drop (GtkWidget *canvas, - GdkDragContext *context, - gint x, - gint y, - guint time, - ETableHeaderItem *ethi) + GdkDragContext *context, + gint x, + gint y, + guint time, + ETableHeaderItem *ethi) { gboolean successful = FALSE; @@ -1059,7 +1073,11 @@ ethi_draw (GnomeCanvasItem *item, } static GnomeCanvasItem * -ethi_point (GnomeCanvasItem *item, gdouble x, gdouble y, gint cx, gint cy) +ethi_point (GnomeCanvasItem *item, + gdouble x, + gdouble y, + gint cx, + gint cy) { return item; } @@ -1089,7 +1107,7 @@ is_pointer_on_division (ETableHeaderItem *ethi, total += ecol->width; - if ((total - TOLERANCE < pos)&& (pos < total + TOLERANCE)) { + if ((total - TOLERANCE < pos) && (pos < total + TOLERANCE)) { if (return_col) *return_col = col; if (the_total) @@ -1110,7 +1128,8 @@ is_pointer_on_division (ETableHeaderItem *ethi, #define convert(c,sx,sy,x,y) gnome_canvas_w2c (c,sx,sy,x,y) static void -set_cursor (ETableHeaderItem *ethi, gint pos) +set_cursor (ETableHeaderItem *ethi, + gint pos) { GnomeCanvas *canvas; GdkWindow *window; @@ -1133,7 +1152,7 @@ set_cursor (ETableHeaderItem *ethi, gint pos) gint c = col + 1; /* Column is not resizable if all columns after it - are also not resizable */ + * are also not resizable */ for (; c <= last_col; c++) { ETableCol *ecol2; @@ -1162,7 +1181,8 @@ ethi_end_resize (ETableHeaderItem *ethi) } static gboolean -ethi_maybe_start_drag (ETableHeaderItem *ethi, GdkEventMotion *event) +ethi_maybe_start_drag (ETableHeaderItem *ethi, + GdkEventMotion *event) { if (!ethi->maybe_drag) return FALSE; @@ -1180,7 +1200,8 @@ ethi_maybe_start_drag (ETableHeaderItem *ethi, GdkEventMotion *event) } static void -ethi_start_drag (ETableHeaderItem *ethi, GdkEvent *event) +ethi_start_drag (ETableHeaderItem *ethi, + GdkEvent *event) { GtkWidget *widget = GTK_WIDGET (GNOME_CANVAS_ITEM (ethi)->canvas); GtkTargetList *list; @@ -1281,7 +1302,8 @@ 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; @@ -1336,7 +1358,8 @@ ethi_popup_sort_ascending (GtkWidget *widget, EthiHeaderInfo *info) } static void -ethi_popup_sort_descending (GtkWidget *widget, EthiHeaderInfo *info) +ethi_popup_sort_descending (GtkWidget *widget, + EthiHeaderInfo *info) { ETableCol *col; gint model_col=-1; @@ -1391,7 +1414,8 @@ 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; @@ -1400,7 +1424,8 @@ ethi_popup_unsort (GtkWidget *widget, EthiHeaderInfo *info) } static void -ethi_popup_group_field (GtkWidget *widget, EthiHeaderInfo *info) +ethi_popup_group_field (GtkWidget *widget, + EthiHeaderInfo *info) { ETableCol *col; gint model_col; @@ -1417,18 +1442,21 @@ ethi_popup_group_field (GtkWidget *widget, EthiHeaderInfo *info) } 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); } static void -ethi_popup_field_chooser (GtkWidget *widget, EthiHeaderInfo *info) +ethi_popup_field_chooser (GtkWidget *widget, + EthiHeaderInfo *info) { GtkWidget *etfcd = info->ethi->etfcd.widget; @@ -1453,12 +1481,14 @@ 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; @@ -1474,19 +1504,22 @@ ethi_popup_best_fit (GtkWidget *widget, EthiHeaderInfo *info) } static void -ethi_popup_format_columns (GtkWidget *widget, EthiHeaderInfo *info) +ethi_popup_format_columns (GtkWidget *widget, + EthiHeaderInfo *info) { } static void -config_destroyed (gpointer data, GObject *where_object_was) +config_destroyed (gpointer data, + GObject *where_object_was) { ETableHeaderItem *ethi = data; ethi->config = NULL; } static void -apply_changes (ETableConfig *config, ETableHeaderItem *ethi) +apply_changes (ETableConfig *config, + ETableHeaderItem *ethi) { gchar *state = e_table_state_save_to_string (config->state); @@ -1501,7 +1534,8 @@ 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; @@ -1531,7 +1565,8 @@ ethi_popup_customize_view (GtkWidget *widget, EthiHeaderInfo *info) } static void -free_popup_info (GtkWidget *w, EthiHeaderInfo *info) +free_popup_info (GtkWidget *w, + EthiHeaderInfo *info) { g_free (info); } @@ -1580,7 +1615,8 @@ static EPopupMenu ethi_context_menu[] = { }; static void -sort_by_id (GtkWidget *menu_item, ETableHeaderItem *ethi) +sort_by_id (GtkWidget *menu_item, + ETableHeaderItem *ethi) { ETableCol *ecol; gboolean clearfirst; @@ -1606,13 +1642,15 @@ sort_by_id (GtkWidget *menu_item, ETableHeaderItem *ethi) } static void -popup_custom (GtkWidget *menu_item, EthiHeaderInfo *info) +popup_custom (GtkWidget *menu_item, + EthiHeaderInfo *info) { ethi_popup_customize_view (menu_item, info); } static void -ethi_header_context_menu (ETableHeaderItem *ethi, GdkEventButton *event) +ethi_header_context_menu (ETableHeaderItem *ethi, + GdkEventButton *event) { EthiHeaderInfo *info = g_new (EthiHeaderInfo, 1); GtkMenu *popup; @@ -1664,9 +1702,9 @@ ethi_header_context_menu (ETableHeaderItem *ethi, GdkEventButton *event) gtk_widget_show (menu_item); gtk_menu_shell_prepend (GTK_MENU_SHELL (sub_menu), menu_item); /* Headers */ - for (ncol = 0; ncol<ethi->full_header->col_count; ncol++) + for (ncol = 0; ncol < ethi->full_header->col_count; ncol++) { - gchar *text=NULL; + gchar *text = NULL; if (!ethi->full_header->columns[ncol]->sortable || ethi->full_header->columns[ncol]->disabled) @@ -1704,14 +1742,15 @@ ethi_header_context_menu (ETableHeaderItem *ethi, GdkEventButton *event) } static void -ethi_button_pressed (ETableHeaderItem *ethi, GdkEventButton *event) +ethi_button_pressed (ETableHeaderItem *ethi, + GdkEventButton *event) { - g_signal_emit (ethi, - ethi_signals[BUTTON_PRESSED], 0, event); + g_signal_emit (ethi, ethi_signals[BUTTON_PRESSED], 0, event); } void -ethi_change_sort_state (ETableHeaderItem *ethi, ETableCol *col) +ethi_change_sort_state (ETableHeaderItem *ethi, + ETableCol *col) { gint model_col = -1; gint length; @@ -1793,7 +1832,8 @@ ethi_change_sort_state (ETableHeaderItem *ethi, ETableCol *col) * Handles the events on the ETableHeaderItem, particularly it handles resizing */ static gint -ethi_event (GnomeCanvasItem *item, GdkEvent *e) +ethi_event (GnomeCanvasItem *item, + GdkEvent *e) { ETableHeaderItem *ethi = E_TABLE_HEADER_ITEM (item); GnomeCanvas *canvas = item->canvas; diff --git a/widgets/table/e-table-header-item.h b/widgets/table/e-table-header-item.h index 96f167b4e8..be8e10820a 100644 --- a/widgets/table/e-table-header-item.h +++ b/widgets/table/e-table-header-item.h @@ -84,8 +84,8 @@ struct _ETableHeaderItem { /* * For dragging columns */ - guint maybe_drag:1; - guint dnd_ready:1; + guint maybe_drag : 1; + guint dnd_ready : 1; gint click_x, click_y; gint drag_col, drop_col, drag_mark; guint drag_motion_id; diff --git a/widgets/table/e-table-header-utils.c b/widgets/table/e-table-header-utils.c index 659677eceb..34f93a701b 100644 --- a/widgets/table/e-table-header-utils.c +++ b/widgets/table/e-table-header-utils.c @@ -35,8 +35,9 @@ #include "e-table-defines.h" #include "e-table-header-utils.h" -static PangoLayout* -build_header_layout (GtkWidget *widget, const gchar *str) +static PangoLayout * +build_header_layout (GtkWidget *widget, + const gchar *str) { PangoLayout *layout; @@ -69,7 +70,8 @@ build_header_layout (GtkWidget *widget, const gchar *str) * Return value: The height of the button, in pixels. **/ gdouble -e_table_header_compute_height (ETableCol *ecol, GtkWidget *widget) +e_table_header_compute_height (ETableCol *ecol, + GtkWidget *widget) { gint ythick; gint height; @@ -112,9 +114,14 @@ e_table_header_width_extras (GtkStyle *style) */ #if 0 static GdkPixmap * -make_composite_pixmap (GdkDrawable *drawable, GdkGC *gc, - GdkPixbuf *pixbuf, GdkColor *bg, gint width, gint height, - gint dither_xofs, gint dither_yofs) +make_composite_pixmap (GdkDrawable *drawable, + GdkGC *gc, + GdkPixbuf *pixbuf, + GdkColor *bg, + gint width, + gint height, + gint dither_xofs, + gint dither_yofs) { gint pwidth, pheight; GdkPixmap *pixmap; @@ -240,12 +247,18 @@ make_composite_pixmap (GdkDrawable *drawable, GdkGC *gc, * Draws a button suitable for a table header. **/ void -e_table_header_draw_button (cairo_t *cr, ETableCol *ecol, - GtkStyle *style, GtkStateType state, - GtkWidget *widget, - gint x, gint y, gint width, gint height, - gint button_width, gint button_height, - ETableColArrow arrow) +e_table_header_draw_button (cairo_t *cr, + ETableCol *ecol, + GtkStyle *style, + GtkStateType state, + GtkWidget *widget, + gint x, + gint y, + gint width, + gint height, + gint button_width, + gint button_height, + ETableColArrow arrow) { gint xthick, ythick; gint inner_x, inner_y; diff --git a/widgets/table/e-table-header-utils.h b/widgets/table/e-table-header-utils.h index cfa568bcdd..c3b2de89c7 100644 --- a/widgets/table/e-table-header-utils.h +++ b/widgets/table/e-table-header-utils.h @@ -34,7 +34,7 @@ gdouble e_table_header_compute_height (ETableCol *ecol, GtkWidget *widget); gdouble e_table_header_width_extras (GtkStyle *style); void e_table_header_draw_button (cairo_t *cr, - ETableCol*ecol, + ETableCol *ecol, GtkStyle *style, GtkStateType state, GtkWidget *widget, diff --git a/widgets/table/e-table-header.c b/widgets/table/e-table-header.c index 90dec061c1..aab0971518 100644 --- a/widgets/table/e-table-header.c +++ b/widgets/table/e-table-header.c @@ -63,13 +63,16 @@ struct two_ints { }; static void -eth_set_width (ETableHeader *eth, gint width) +eth_set_width (ETableHeader *eth, + gint width) { eth->width = width; } static void -dequeue (ETableHeader *eth, gint *column, gint *width) +dequeue (ETableHeader *eth, + gint *column, + gint *width) { GSList *head; struct two_ints *store; @@ -110,7 +113,9 @@ dequeue_idle (ETableHeader *eth) } static void -enqueue (ETableHeader *eth, gint column, gint width) +enqueue (ETableHeader *eth, + gint column, + gint width) { struct two_ints *store; store = g_new (struct two_ints, 1); @@ -129,7 +134,9 @@ enqueue (ETableHeader *eth, gint column, gint width) } void -e_table_header_set_size (ETableHeader *eth, gint idx, gint size) +e_table_header_set_size (ETableHeader *eth, + gint idx, + gint size) { g_return_if_fail (eth != NULL); g_return_if_fail (E_IS_TABLE_HEADER (eth)); @@ -138,12 +145,14 @@ e_table_header_set_size (ETableHeader *eth, gint idx, gint size) } static void -eth_do_remove (ETableHeader *eth, gint idx, gboolean do_unref) +eth_do_remove (ETableHeader *eth, + gint idx, + gboolean do_unref) { if (do_unref) 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--; } @@ -189,17 +198,21 @@ 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); } static void -eth_set_property (GObject *object, guint prop_id, const GValue *val, GParamSpec *pspec) +eth_set_property (GObject *object, + guint property_id, + const GValue *val, + GParamSpec *pspec) { ETableHeader *eth = E_TABLE_HEADER (object); - switch (prop_id) { + switch (property_id) { case PROP_WIDTH: eth->nominal_width = g_value_get_double (val); enqueue (eth, -1, eth->nominal_width); @@ -219,9 +232,9 @@ eth_set_property (GObject *object, guint prop_id, const GValue *val, GParamSpec eth->sort_info = E_TABLE_SORT_INFO (g_value_get_object (val)); if (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); + eth->sort_info_group_change_id = g_signal_connect ( + eth->sort_info, "group_info_changed", + G_CALLBACK (eth_group_info_changed), eth); } enqueue (eth, -1, eth->nominal_width); break; @@ -231,11 +244,14 @@ eth_set_property (GObject *object, guint prop_id, const GValue *val, GParamSpec } static void -eth_get_property (GObject *object, guint prop_id, GValue *val, GParamSpec *pspec) +eth_get_property (GObject *object, + guint property_id, + GValue *val, + GParamSpec *pspec) { ETableHeader *eth = E_TABLE_HEADER (object); - switch (prop_id) { + switch (property_id) { case PROP_SORT_INFO: g_value_set_object (val, G_OBJECT (eth->sort_info)); break; @@ -246,7 +262,7 @@ eth_get_property (GObject *object, guint prop_id, GValue *val, GParamSpec *pspec g_value_set_double (val, eth->width_extras); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -363,9 +379,11 @@ eth_update_offsets (ETableHeader *eth) } static void -eth_do_insert (ETableHeader *eth, gint pos, ETableCol *val) +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->col_count++; @@ -386,7 +404,9 @@ eth_do_insert (ETableHeader *eth, gint pos, ETableCol *val) * The ETableCol is assumed */ void -e_table_header_add_column (ETableHeader *eth, ETableCol *tc, gint pos) +e_table_header_add_column (ETableHeader *eth, + ETableCol *tc, + gint pos) { g_return_if_fail (eth != NULL); g_return_if_fail (E_IS_TABLE_HEADER (eth)); @@ -418,7 +438,8 @@ e_table_header_add_column (ETableHeader *eth, ETableCol *tc, gint pos) * Returns: The ETableCol at @column in the @eth object */ ETableCol * -e_table_header_get_column (ETableHeader *eth, gint column) +e_table_header_get_column (ETableHeader *eth, + gint column) { g_return_val_if_fail (eth != NULL, NULL); g_return_val_if_fail (E_IS_TABLE_HEADER (eth), NULL); @@ -440,7 +461,8 @@ e_table_header_get_column (ETableHeader *eth, gint column) * Returns: The ETableCol with col_idx = @col_idx in the @eth object */ ETableCol * -e_table_header_get_column_by_col_idx (ETableHeader *eth, gint col_idx) +e_table_header_get_column_by_col_idx (ETableHeader *eth, + gint col_idx) { gint i; g_return_val_if_fail (eth != NULL, NULL); @@ -483,7 +505,8 @@ e_table_header_count (ETableHeader *eth) * Returns: the column in the model that the @col column * in the ETableHeader points to. */ gint -e_table_header_index (ETableHeader *eth, gint col) +e_table_header_index (ETableHeader *eth, + gint col) { g_return_val_if_fail (eth != NULL, -1); g_return_val_if_fail (E_IS_TABLE_HEADER (eth), -1); @@ -504,7 +527,8 @@ e_table_header_index (ETableHeader *eth, gint col) * if no column inside this ETableHeader contains that pixel. */ gint -e_table_header_get_index_at (ETableHeader *eth, gint x_offset) +e_table_header_get_index_at (ETableHeader *eth, + gint x_offset) { gint i, total; @@ -629,7 +653,9 @@ e_table_header_min_width (ETableHeader *eth) * and "structure_change" will be emmited */ void -e_table_header_move (ETableHeader *eth, gint source_index, gint target_index) +e_table_header_move (ETableHeader *eth, + gint source_index, + gint target_index) { ETableCol *old; @@ -663,7 +689,8 @@ e_table_header_move (ETableHeader *eth, gint source_index, gint target_index) * This emmits the "structure_change" signal on the @eth object. */ void -e_table_header_remove (ETableHeader *eth, gint idx) +e_table_header_remove (ETableHeader *eth, + gint idx) { g_return_if_fail (eth != NULL); g_return_if_fail (E_IS_TABLE_HEADER (eth)); @@ -679,14 +706,17 @@ e_table_header_remove (ETableHeader *eth, gint idx) * FIXME: deprecated? */ void -e_table_header_set_selection (ETableHeader *eth, gboolean allow_selection) +e_table_header_set_selection (ETableHeader *eth, + gboolean allow_selection) { g_return_if_fail (eth != NULL); g_return_if_fail (E_IS_TABLE_HEADER (eth)); } static void -eth_set_size (ETableHeader *eth, gint idx, gint size) +eth_set_size (ETableHeader *eth, + gint idx, + gint size) { gdouble expansion; gdouble old_expansion; @@ -824,7 +854,9 @@ eth_set_size (ETableHeader *eth, gint idx, gint size) * @eth ETableHeader object */ gint -e_table_header_col_diff (ETableHeader *eth, gint start_col, gint end_col) +e_table_header_col_diff (ETableHeader *eth, + gint start_col, + gint end_col) { gint total, col; diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c index ac46df2cd3..25ea433a66 100644 --- a/widgets/table/e-table-item.c +++ b/widgets/table/e-table-item.c @@ -67,8 +67,8 @@ static void eti_check_cursor_bounds (ETableItem *eti); static void eti_cancel_drag_due_to_model_change (ETableItem *eti); /* FIXME: Do an analysis of which cell functions are needed before - realize and make sure that all of them are doable by all the cells - and that all of the others are only done after realization. */ + * realize and make sure that all of them are doable by all the cells + * and that all of the others are only done after realization. */ enum { CURSOR_CHANGE, @@ -122,9 +122,9 @@ 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))) /* tweak_hsv is a really tweaky function. it modifies its first argument, which - should be the color you want tweaked. delta_h, delta_s and delta_v specify - how much you want their respective channels modified (and in what direction). - if it can't do the specified modification, it does it in the oppositon direction */ + * should be the color you want tweaked. delta_h, delta_s and delta_v specify + * how much you want their respective channels modified (and in what direction). + * if it can't do the specified modification, it does it in the oppositon direction */ static void e_hsv_tweak (GdkColor *color, gdouble delta_h, @@ -165,7 +165,8 @@ e_hsv_tweak (GdkColor *color, } inline static gint -model_to_view_row (ETableItem *eti, gint row) +model_to_view_row (ETableItem *eti, + gint row) { gint i; if (row == -1) @@ -187,7 +188,8 @@ 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); @@ -201,7 +203,8 @@ 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) @@ -215,14 +218,17 @@ 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; } static void -grab_cancelled (ECanvas *canvas, GnomeCanvasItem *item, gpointer data) +grab_cancelled (ECanvas *canvas, + GnomeCanvasItem *item, + gpointer data) { ETableItem *eti = data; @@ -230,7 +236,8 @@ grab_cancelled (ECanvas *canvas, GnomeCanvasItem *item, gpointer data) } inline static void -eti_grab (ETableItem *eti, guint32 time) +eti_grab (ETableItem *eti, + guint32 time) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti); d(g_print ("%s: time: %d\n", __FUNCTION__, time)); @@ -253,7 +260,8 @@ eti_grab (ETableItem *eti, guint32 time) } inline static void -eti_ungrab (ETableItem *eti, guint32 time) +eti_ungrab (ETableItem *eti, + guint32 time) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti); d(g_print ("%s: time: %d\n", __FUNCTION__, time)); @@ -286,7 +294,11 @@ eti_editing (ETableItem *eti) } inline static GdkColor * -eti_get_cell_background_color (ETableItem *eti, gint row, gint col, gboolean selected, gboolean *allocatedp) +eti_get_cell_background_color (ETableItem *eti, + gint row, + gint col, + gboolean selected, + gboolean *allocatedp) { ECellView *ecell_view = eti->cell_views[col]; GtkWidget *canvas; @@ -334,7 +346,11 @@ eti_get_cell_background_color (ETableItem *eti, gint row, gint col, gboolean sel } inline static GdkColor * -eti_get_cell_foreground_color (ETableItem *eti, gint row, gint col, gboolean selected, gboolean *allocated) +eti_get_cell_foreground_color (ETableItem *eti, + gint row, + gint col, + gboolean selected, + gboolean *allocated) { GtkWidget *canvas; GdkColor *foreground; @@ -381,7 +397,7 @@ eti_free_save_state (ETableItem *eti) * we might want to avoid realizing each e-cell. */ static void -eti_realize_cell_views ( ETableItem *eti) +eti_realize_cell_views (ETableItem *eti) { GnomeCanvasItem *item; gint i; @@ -470,7 +486,11 @@ eti_detach_cell_views (ETableItem *eti) } static void -eti_bounds (GnomeCanvasItem *item, gdouble *x1, gdouble *y1, gdouble *x2, gdouble *y2) +eti_bounds (GnomeCanvasItem *item, + gdouble *x1, + gdouble *y1, + gdouble *x2, + gdouble *y2) { cairo_matrix_t i2c; ETableItem *eti = E_TABLE_ITEM (item); @@ -487,7 +507,8 @@ eti_bounds (GnomeCanvasItem *item, gdouble *x1, gdouble *y1, gdouble *x2, gdoubl } static void -eti_reflow (GnomeCanvasItem *item, gint flags) +eti_reflow (GnomeCanvasItem *item, + gint flags) { ETableItem *eti = E_TABLE_ITEM (item); @@ -518,7 +539,9 @@ eti_reflow (GnomeCanvasItem *item, gint flags) * GnomeCanvasItem::update method */ static void -eti_update (GnomeCanvasItem *item, const cairo_matrix_t *i2c, gint flags) +eti_update (GnomeCanvasItem *item, + const cairo_matrix_t *i2c, + gint flags) { ETableItem *eti = E_TABLE_ITEM (item); gdouble x1, x2, y1, y2; @@ -652,7 +675,8 @@ eti_remove_header_model (ETableItem *eti) * used as a separator between rows */ static gint -eti_row_height_real (ETableItem *eti, gint row) +eti_row_height_real (ETableItem *eti, + gint row) { const gint cols = e_table_header_count (eti->header); gint col; @@ -744,7 +768,8 @@ calculate_height_cache (ETableItem *eti) * used as a separator between rows */ static gint -eti_row_height (ETableItem *eti, gint row) +eti_row_height (ETableItem *eti, + gint row) { if (eti->uniform_row_height) { eti->uniform_row_height_cache = eti_row_height_real (eti, -1); @@ -826,7 +851,11 @@ eti_get_height (ETableItem *eti) } static void -eti_item_region_redraw (ETableItem *eti, gint x0, gint y0, gint x1, gint y1) +eti_item_region_redraw (ETableItem *eti, + gint x0, + gint y0, + gint x1, + gint y1) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti); gdouble dx1, dy1, dx2, dy2; @@ -847,7 +876,9 @@ eti_item_region_redraw (ETableItem *eti, gint x0, gint y0, gint x1, gint y1) * Computes the distance between @start_row and @end_row in pixels */ gint -e_table_item_row_diff (ETableItem *eti, gint start_row, gint end_row) +e_table_item_row_diff (ETableItem *eti, + gint start_row, + gint end_row) { gint height_extra = eti->horizontal_draw_grid ? 1 : 0; @@ -870,10 +901,14 @@ e_table_item_row_diff (ETableItem *eti, gint start_row, gint end_row) static void eti_get_region (ETableItem *eti, - gint start_col, gint start_row, - gint end_col, gint end_row, - gint *x1p, gint *y1p, - gint *x2p, gint *y2p) + gint start_col, + gint start_row, + gint end_col, + gint end_row, + gint *x1p, + gint *y1p, + gint *x2p, + gint *y2p) { gint x1, y1, x2, y2; @@ -903,8 +938,11 @@ eti_get_region (ETableItem *eti, */ static void eti_request_region_redraw (ETableItem *eti, - gint start_col, gint start_row, - gint end_col, gint end_row, gint border) + gint start_col, + gint start_row, + gint end_col, + gint end_row, + gint border) { gint x1, y1, x2, y2; @@ -930,8 +968,11 @@ eti_request_region_redraw (ETableItem *eti, */ static void eti_request_region_show (ETableItem *eti, - gint start_col, gint start_row, - gint end_col, gint end_row, gint delay) + gint start_col, + gint start_row, + gint end_col, + gint end_row, + gint delay) { gint x1, y1, x2, y2; @@ -947,7 +988,8 @@ eti_request_region_show (ETableItem *eti, } static void -eti_show_cursor (ETableItem *eti, gint delay) +eti_show_cursor (ETableItem *eti, + gint delay) { GnomeCanvasItem *item; gint cursor_row; @@ -1028,7 +1070,8 @@ eti_check_cursor_bounds (ETableItem *eti) } 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) @@ -1101,7 +1144,8 @@ eti_unfreeze (ETableItem *eti) * Callback routine: invoked before the ETableModel suffers a change */ static void -eti_table_model_pre_change (ETableModel *table_model, ETableItem *eti) +eti_table_model_pre_change (ETableModel *table_model, + ETableItem *eti) { eti_cancel_drag_due_to_model_change (eti); eti_check_cursor_bounds (eti); @@ -1116,7 +1160,8 @@ eti_table_model_pre_change (ETableModel *table_model, ETableItem *eti) * Callback routine: invoked when the ETableModel has not suffered a change */ static void -eti_table_model_no_change (ETableModel *table_model, ETableItem *eti) +eti_table_model_no_change (ETableModel *table_model, + ETableItem *eti) { eti_unfreeze (eti); } @@ -1126,7 +1171,8 @@ eti_table_model_no_change (ETableModel *table_model, ETableItem *eti) */ static void -eti_table_model_changed (ETableModel *table_model, ETableItem *eti) +eti_table_model_changed (ETableModel *table_model, + ETableItem *eti) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti); @@ -1150,7 +1196,9 @@ eti_table_model_changed (ETableModel *table_model, ETableItem *eti) } static void -eti_table_model_row_changed (ETableModel *table_model, gint row, ETableItem *eti) +eti_table_model_row_changed (ETableModel *table_model, + gint row, + ETableItem *eti) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti); @@ -1170,7 +1218,10 @@ eti_table_model_row_changed (ETableModel *table_model, gint row, ETableItem *eti } static void -eti_table_model_cell_changed (ETableModel *table_model, gint col, gint row, ETableItem *eti) +eti_table_model_cell_changed (ETableModel *table_model, + gint col, + gint row, + ETableItem *eti) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti); @@ -1190,7 +1241,10 @@ eti_table_model_cell_changed (ETableModel *table_model, gint col, gint row, ETab } static void -eti_table_model_rows_inserted (ETableModel *table_model, gint row, gint count, ETableItem *eti) +eti_table_model_rows_inserted (ETableModel *table_model, + gint row, + gint count, + ETableItem *eti) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti); @@ -1219,7 +1273,10 @@ eti_table_model_rows_inserted (ETableModel *table_model, gint row, gint count, E } static void -eti_table_model_rows_deleted (ETableModel *table_model, gint row, gint count, ETableItem *eti) +eti_table_model_rows_deleted (ETableModel *table_model, + gint row, + gint count, + ETableItem *eti) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti); @@ -1257,8 +1314,10 @@ eti_table_model_rows_deleted (ETableModel *table_model, gint row, gint count, ET */ void e_table_item_redraw_range (ETableItem *eti, - gint start_col, gint start_row, - gint end_col, gint end_row) + gint start_col, + gint start_row, + gint end_col, + gint end_row) { gint border; gint cursor_col, cursor_row; @@ -1284,14 +1343,15 @@ e_table_item_redraw_range (ETableItem *eti, static void e_table_item_redraw_row (ETableItem *eti, - gint row) + gint row) { if (row != -1) e_table_item_redraw_range (eti, 0, row, eti->cols - 1, row); } static void -eti_add_table_model (ETableItem *eti, ETableModel *table_model) +eti_add_table_model (ETableItem *eti, + ETableModel *table_model) { g_return_if_fail (eti->table_model == NULL); @@ -1344,7 +1404,8 @@ eti_add_table_model (ETableItem *eti, ETableModel *table_model) } static void -eti_add_selection_model (ETableItem *eti, ESelectionModel *selection) +eti_add_selection_model (ETableItem *eti, + ESelectionModel *selection) { g_return_if_fail (eti->selection == NULL); @@ -1373,7 +1434,9 @@ eti_add_selection_model (ETableItem *eti, ESelectionModel *selection) } static void -eti_header_dim_changed (ETableHeader *eth, gint col, ETableItem *eti) +eti_header_dim_changed (ETableHeader *eth, + gint col, + ETableItem *eti) { eti->needs_compute_width = 1; e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (eti)); @@ -1382,7 +1445,8 @@ eti_header_dim_changed (ETableHeader *eth, gint col, ETableItem *eti) } static void -eti_header_structure_changed (ETableHeader *eth, ETableItem *eti) +eti_header_structure_changed (ETableHeader *eth, + ETableItem *eti) { eti->cols = e_table_header_count (eti->header); @@ -1409,7 +1473,9 @@ eti_header_structure_changed (ETableHeader *eth, ETableItem *eti) } static gint -eti_request_column_width (ETableHeader *eth, gint col, ETableItem *eti) +eti_request_column_width (ETableHeader *eth, + gint col, + ETableItem *eti) { gint width = 0; @@ -1421,7 +1487,8 @@ eti_request_column_width (ETableHeader *eth, gint col, ETableItem *eti) } static void -eti_add_header_model (ETableItem *eti, ETableHeader *header) +eti_add_header_model (ETableItem *eti, + ETableHeader *header) { g_return_if_fail (eti->header == NULL); @@ -1475,13 +1542,16 @@ eti_dispose (GObject *object) } static void -eti_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +eti_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (object); ETableItem *eti = E_TABLE_ITEM (object); gint cursor_col; - switch (prop_id) { + switch (property_id) { case PROP_TABLE_HEADER: eti_remove_header_model (eti); eti_add_header_model (eti, E_TABLE_HEADER (g_value_get_object (value))); @@ -1558,14 +1628,17 @@ eti_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpe } static void -eti_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +eti_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { ETableItem *eti; gint row; eti = E_TABLE_ITEM (object); - switch (prop_id) { + switch (property_id) { case PROP_WIDTH: g_value_set_double (value, eti->width); break; @@ -1585,7 +1658,7 @@ eti_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *psp g_value_set_boolean (value, eti->uniform_row_height); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -1666,7 +1739,9 @@ static const gchar gray50_bits[] = { 0x02, 0x01, }; static gboolean -eti_tree_unfreeze (GtkWidget *widget, GdkEvent *event, ETableItem *eti) +eti_tree_unfreeze (GtkWidget *widget, + GdkEvent *event, + ETableItem *eti) { if (widget) @@ -1745,8 +1820,13 @@ eti_unrealize (GnomeCanvasItem *item) } static void -eti_draw_grid_line (ETableItem *eti, cairo_t *cr, GtkStyle *style, - gint x1, gint y1, gint x2, gint y2) +eti_draw_grid_line (ETableItem *eti, + cairo_t *cr, + GtkStyle *style, + gint x1, + gint y1, + gint x2, + gint y2) { cairo_save (cr); @@ -1761,7 +1841,12 @@ eti_draw_grid_line (ETableItem *eti, cairo_t *cr, GtkStyle *style, } static void -eti_draw (GnomeCanvasItem *item, cairo_t *cr, gint x, gint y, gint width, gint height) +eti_draw (GnomeCanvasItem *item, + cairo_t *cr, + gint x, + gint y, + gint width, + gint height) { ETableItem *eti = E_TABLE_ITEM (item); const gint rows = eti->rows; @@ -1915,26 +2000,26 @@ eti_draw (GnomeCanvasItem *item, cairo_t *cr, gint x, gint y, gint width, gint h } x1 = xd; - y1 = yd+1; + y1 = yd + 1; x2 = x1 + ecol->width; - y2 = yd+height; + y2 = yd + height; background = eti_get_cell_background_color (eti, row, col, col_selected, &free_background); cairo_save (cr); pat = cairo_pattern_create_linear (0, y1, 0, y2); - cairo_pattern_add_color_stop_rgba (pat, 0.0, background->red/65535.0 , - background->green/65535.0, - background->blue/65535.0, selected ? 0.8: 1.0); + cairo_pattern_add_color_stop_rgba (pat, 0.0, background->red / 65535.0 , + background->green / 65535.0, + background->blue / 65535.0, selected ? 0.8: 1.0); if (selected) - cairo_pattern_add_color_stop_rgba (pat, 0.5, background->red/65535.0 , - background->green/65535.0, - background->blue/65535.0, 0.9); - - cairo_pattern_add_color_stop_rgba (pat, 1, background->red/65535.0 , - background->green/65535.0, - background->blue/65535.0, selected ? 0.8 : 1.0); - cairo_rectangle (cr, x1, y1, ecol->width, height-1); + cairo_pattern_add_color_stop_rgba (pat, 0.5, background->red / 65535.0 , + background->green / 65535.0, + background->blue / 65535.0, 0.9); + + cairo_pattern_add_color_stop_rgba (pat, 1, background->red / 65535.0 , + background->green / 65535.0, + background->blue / 65535.0, selected ? 0.8 : 1.0); + cairo_rectangle (cr, x1, y1, ecol->width, height - 1); cairo_set_source (cr, pat); cairo_fill_preserve (cr); cairo_pattern_destroy (pat); @@ -1944,17 +2029,17 @@ eti_draw (GnomeCanvasItem *item, cairo_t *cr, gint x, gint y, gint width, gint h cairo_save (cr); cairo_set_line_width (cr, 1.0); - cairo_set_source_rgba (cr, background->red/65535.0 , - background->green/65535.0, - background->blue/65535.0, 1); + cairo_set_source_rgba (cr, background->red / 65535.0 , + background->green / 65535.0, + background->blue / 65535.0, 1); cairo_move_to (cr, x1, y1); cairo_line_to (cr, x2, y1); cairo_stroke (cr); cairo_set_line_width (cr, 1.0); - cairo_set_source_rgba (cr, background->red/65535.0 , - background->green/65535.0, - background->blue/65535.0, 1); + cairo_set_source_rgba (cr, background->red / 65535.0 , + background->green / 65535.0, + background->blue / 65535.0, 1); cairo_move_to (cr, x1, y2); cairo_line_to (cr, x2, y2); cairo_stroke (cr); @@ -1991,7 +2076,7 @@ eti_draw (GnomeCanvasItem *item, cairo_t *cr, gint x, gint y, gint width, gint h 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; + f_y1 = yd + 1; f_y2 = yd + height; f_found = TRUE; } @@ -2055,13 +2140,23 @@ eti_draw (GnomeCanvasItem *item, cairo_t *cr, gint x, gint y, gint width, gint h } static GnomeCanvasItem * -eti_point (GnomeCanvasItem *item, gdouble x, gdouble y, gint cx, gint cy) +eti_point (GnomeCanvasItem *item, + gdouble x, + gdouble y, + gint cx, + gint cy) { return item; } static gboolean -find_cell (ETableItem *eti, gdouble x, gdouble y, gint *view_col_res, gint *view_row_res, gdouble *x1_res, gdouble *y1_res) +find_cell (ETableItem *eti, + gdouble x, + gdouble y, + gint *view_col_res, + gint *view_row_res, + gdouble *x1_res, + gdouble *y1_res) { const gint cols = eti->cols; const gint rows = eti->rows; @@ -2127,7 +2222,9 @@ find_cell (ETableItem *eti, gdouble x, gdouble y, gint *view_col_res, gint *view } static void -eti_cursor_move (ETableItem *eti, gint row, gint column) +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); @@ -2158,7 +2255,14 @@ eti_cursor_move_right (ETableItem *eti) } static gint -eti_e_cell_event (ETableItem *item, ECellView *ecell_view, GdkEvent *event, gint time, gint model_col, gint view_col, gint row, ECellFlags flags) +eti_e_cell_event (ETableItem *item, + ECellView *ecell_view, + GdkEvent *event, + gint time, + gint model_col, + gint view_col, + gint row, + ECellFlags flags) { ECellActions actions = 0; gint ret_val; @@ -2184,7 +2288,8 @@ eti_e_cell_event (ETableItem *item, ECellView *ecell_view, GdkEvent *event, /* FIXME: cursor */ static gint -eti_event (GnomeCanvasItem *item, GdkEvent *e) +eti_event (GnomeCanvasItem *item, + GdkEvent *e) { ETableItem *eti = E_TABLE_ITEM (item); ECellView *ecell_view; @@ -2786,7 +2891,8 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) } static void -eti_style_set (ETableItem *eti, GtkStyle *previous_style) +eti_style_set (ETableItem *eti, + GtkStyle *previous_style) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti); @@ -3057,13 +3163,18 @@ eti_class_init (ETableItemClass *class) * This routine sets the cursor of the %ETableItem canvas item. */ void -e_table_item_set_cursor (ETableItem *eti, gint col, gint row) +e_table_item_set_cursor (ETableItem *eti, + gint col, + gint row) { e_table_item_focus (eti, col, view_to_model_row (eti, row), 0); } static void -e_table_item_focus (ETableItem *eti, gint col, gint row, GdkModifierType state) +e_table_item_focus (ETableItem *eti, + gint col, + gint row, + GdkModifierType state) { g_return_if_fail (eti != NULL); g_return_if_fail (E_IS_TABLE_ITEM (eti)); @@ -3107,7 +3218,10 @@ e_table_item_get_focused_column (ETableItem *eti) } static void -eti_cursor_change (ESelectionModel *selection, gint row, gint col, ETableItem *eti) +eti_cursor_change (ESelectionModel *selection, + gint row, + gint col, + ETableItem *eti) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti); gint view_row; @@ -3146,7 +3260,10 @@ eti_cursor_change (ESelectionModel *selection, gint row, gint col, ETableItem *e } static void -eti_cursor_activated (ESelectionModel *selection, gint row, gint col, ETableItem *eti) +eti_cursor_activated (ESelectionModel *selection, + gint row, + gint col, + ETableItem *eti) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti); gint view_row; @@ -3178,7 +3295,8 @@ eti_cursor_activated (ESelectionModel *selection, gint row, gint col, ETableItem } static void -eti_selection_change (ESelectionModel *selection, ETableItem *eti) +eti_selection_change (ESelectionModel *selection, + ETableItem *eti) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti); @@ -3190,7 +3308,9 @@ eti_selection_change (ESelectionModel *selection, ETableItem *eti) } static void -eti_selection_row_change (ESelectionModel *selection, gint row, ETableItem *eti) +eti_selection_row_change (ESelectionModel *selection, + gint row, + ETableItem *eti) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti); @@ -3212,7 +3332,9 @@ eti_selection_row_change (ESelectionModel *selection, gint row, ETableItem *eti) * column and row. */ void -e_table_item_enter_edit (ETableItem *eti, gint col, gint row) +e_table_item_enter_edit (ETableItem *eti, + gint col, + gint row) { g_return_if_fail (eti != NULL); g_return_if_fail (E_IS_TABLE_ITEM (eti)); @@ -3276,14 +3398,14 @@ e_table_item_leave_edit (ETableItem *eti) * is removed from the value y points to. */ void -e_table_item_compute_location (ETableItem *eti, - gint *x, - gint *y, - gint *row, - gint *col) +e_table_item_compute_location (ETableItem *eti, + gint *x, + gint *y, + gint *row, + gint *col) { /* Save the grabbed row but make sure that we don't get flawed - results because the cursor is grabbed. */ + * results because the cursor is grabbed. */ gint grabbed_row = eti->grabbed_row; eti->grabbed_row = -1; @@ -3300,15 +3422,15 @@ e_table_item_compute_location (ETableItem *eti, * the position inside the item too. **/ void -e_table_item_compute_mouse_over (ETableItem *eti, - gint x, - gint y, - gint *row, - gint *col) +e_table_item_compute_mouse_over (ETableItem *eti, + gint x, + gint y, + gint *row, + gint *col) { gdouble realx, realy; /* Save the grabbed row but make sure that we don't get flawed - results because the cursor is grabbed. */ + * results because the cursor is grabbed. */ gint grabbed_row = eti->grabbed_row; eti->grabbed_row = -1; @@ -3326,13 +3448,13 @@ e_table_item_compute_mouse_over (ETableItem *eti, } void -e_table_item_get_cell_geometry (ETableItem *eti, - gint *row, - gint *col, - gint *x, - gint *y, - gint *width, - gint *height) +e_table_item_get_cell_geometry (ETableItem *eti, + gint *row, + gint *col, + gint *x, + gint *y, + gint *width, + gint *height) { if (eti->rows > *row) { if (x) @@ -3356,7 +3478,8 @@ typedef struct { } ETableItemPrintContext; static gdouble * -e_table_item_calculate_print_widths (ETableHeader *eth, gdouble width) +e_table_item_calculate_print_widths (ETableHeader *eth, + gdouble width) { gint i; gdouble extra; @@ -3375,14 +3498,17 @@ e_table_item_calculate_print_widths (ETableHeader *eth, gdouble width) widths[i] = eth->columns[i]->min_width * scale; } for (i = 0; i <= last_resizable; i++) { - widths[i] += extra * (eth->columns[i]->resizable ? eth->columns[i]->expansion : 0)/expansion; + widths[i] += extra * (eth->columns[i]->resizable ? eth->columns[i]->expansion : 0) / expansion; } return widths; } static gdouble -eti_printed_row_height (ETableItem *eti, gdouble *widths, GtkPrintContext *context, gint row) +eti_printed_row_height (ETableItem *eti, + gdouble *widths, + GtkPrintContext *context, + gint row) { gint col; gint cols = eti->cols; @@ -3400,7 +3526,11 @@ eti_printed_row_height (ETableItem *eti, gdouble *widths, GtkPrintContext *conte #define CHECK(x) if((x) == -1) return -1; static gint -gp_draw_rect (GtkPrintContext *context, gdouble x, gdouble y, gdouble width, gdouble height) +gp_draw_rect (GtkPrintContext *context, + gdouble x, + gdouble y, + gdouble width, + gdouble height) { cairo_t *cr; cr = gtk_print_context_get_cairo_context (context); @@ -3413,12 +3543,12 @@ gp_draw_rect (GtkPrintContext *context, gdouble x, gdouble y, gdouble width, gdo } static void -e_table_item_print_page (EPrintable *ep, - GtkPrintContext *context, - gdouble width, - gdouble height, - gboolean quantize, - ETableItemPrintContext *itemcontext) +e_table_item_print_page (EPrintable *ep, + GtkPrintContext *context, + gdouble width, + gdouble height, + gboolean quantize, + ETableItemPrintContext *itemcontext) { ETableItem *eti = itemcontext->item; const gint rows = eti->rows; @@ -3503,8 +3633,8 @@ e_table_item_print_page (EPrintable *ep, } static gboolean -e_table_item_data_left (EPrintable *ep, - ETableItemPrintContext *itemcontext) +e_table_item_data_left (EPrintable *ep, + ETableItemPrintContext *itemcontext) { ETableItem *item = itemcontext->item; gint rows_printed = itemcontext->rows_printed; @@ -3514,19 +3644,19 @@ e_table_item_data_left (EPrintable *ep, } static void -e_table_item_reset (EPrintable *ep, - ETableItemPrintContext *itemcontext) +e_table_item_reset (EPrintable *ep, + ETableItemPrintContext *itemcontext) { itemcontext->rows_printed = 0; } static gdouble -e_table_item_height (EPrintable *ep, - GtkPrintContext *context, - gdouble width, - gdouble max_height, - gboolean quantize, - ETableItemPrintContext *itemcontext) +e_table_item_height (EPrintable *ep, + GtkPrintContext *context, + gdouble width, + gdouble max_height, + gboolean quantize, + ETableItemPrintContext *itemcontext) { ETableItem *item = itemcontext->item; const gint rows = item->rows; @@ -3571,12 +3701,12 @@ e_table_item_height (EPrintable *ep, } static gboolean -e_table_item_will_fit (EPrintable *ep, - GtkPrintContext *context, - gdouble width, - gdouble max_height, - gboolean quantize, - ETableItemPrintContext *itemcontext) +e_table_item_will_fit (EPrintable *ep, + GtkPrintContext *context, + gdouble width, + gdouble max_height, + gboolean quantize, + ETableItemPrintContext *itemcontext) { ETableItem *item = itemcontext->item; const gint rows = item->rows; @@ -3622,7 +3752,7 @@ e_table_item_will_fit (EPrintable *ep, static void e_table_item_printable_destroy (gpointer data, - GObject *where_object_was) + GObject *where_object_was) { ETableItemPrintContext *itemcontext = data; diff --git a/widgets/table/e-table-item.h b/widgets/table/e-table-item.h index d2fd2c56d6..26a181dd64 100644 --- a/widgets/table/e-table-item.h +++ b/widgets/table/e-table-item.h @@ -94,12 +94,12 @@ struct _ETableItem { /* View row, -1 means unknown */ gint old_cursor_row; - guint alternating_row_colors:1; - guint horizontal_draw_grid:1; - guint vertical_draw_grid:1; - guint draw_focus:1; - guint uniform_row_height:1; - guint cell_views_realized:1; + guint alternating_row_colors : 1; + guint horizontal_draw_grid : 1; + guint vertical_draw_grid : 1; + guint draw_focus : 1; + guint uniform_row_height : 1; + guint cell_views_realized : 1; guint needs_redraw : 1; guint needs_compute_height : 1; diff --git a/widgets/table/e-table-memory-callbacks.c b/widgets/table/e-table-memory-callbacks.c index bc85c7d39a..279d0a505e 100644 --- a/widgets/table/e-table-memory-callbacks.c +++ b/widgets/table/e-table-memory-callbacks.c @@ -43,7 +43,9 @@ etmc_column_count (ETableModel *etm) } static gpointer -etmc_value_at (ETableModel *etm, gint col, gint row) +etmc_value_at (ETableModel *etm, + gint col, + gint row) { ETableMemoryCallbacks *etmc = E_TABLE_MEMORY_CALLBACKS (etm); @@ -54,7 +56,10 @@ etmc_value_at (ETableModel *etm, gint col, gint row) } static void -etmc_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) +etmc_set_value_at (ETableModel *etm, + gint col, + gint row, + gconstpointer val) { ETableMemoryCallbacks *etmc = E_TABLE_MEMORY_CALLBACKS (etm); @@ -63,7 +68,9 @@ etmc_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) } static gboolean -etmc_is_cell_editable (ETableModel *etm, gint col, gint row) +etmc_is_cell_editable (ETableModel *etm, + gint col, + gint row) { ETableMemoryCallbacks *etmc = E_TABLE_MEMORY_CALLBACKS (etm); @@ -75,7 +82,9 @@ etmc_is_cell_editable (ETableModel *etm, gint col, gint row) /* The default for etmc_duplicate_value is to return the raw value. */ static gpointer -etmc_duplicate_value (ETableModel *etm, gint col, gconstpointer value) +etmc_duplicate_value (ETableModel *etm, + gint col, + gconstpointer value) { ETableMemoryCallbacks *etmc = E_TABLE_MEMORY_CALLBACKS (etm); @@ -86,7 +95,9 @@ etmc_duplicate_value (ETableModel *etm, gint col, gconstpointer value) } static void -etmc_free_value (ETableModel *etm, gint col, gpointer value) +etmc_free_value (ETableModel *etm, + gint col, + gpointer value) { ETableMemoryCallbacks *etmc = E_TABLE_MEMORY_CALLBACKS (etm); @@ -95,7 +106,8 @@ etmc_free_value (ETableModel *etm, gint col, gpointer value) } static gpointer -etmc_initialize_value (ETableModel *etm, gint col) +etmc_initialize_value (ETableModel *etm, + gint col) { ETableMemoryCallbacks *etmc = E_TABLE_MEMORY_CALLBACKS (etm); @@ -106,7 +118,9 @@ etmc_initialize_value (ETableModel *etm, gint col) } static gboolean -etmc_value_is_empty (ETableModel *etm, gint col, gconstpointer value) +etmc_value_is_empty (ETableModel *etm, + gint col, + gconstpointer value) { ETableMemoryCallbacks *etmc = E_TABLE_MEMORY_CALLBACKS (etm); @@ -117,7 +131,9 @@ etmc_value_is_empty (ETableModel *etm, gint col, gconstpointer value) } static gchar * -etmc_value_to_string (ETableModel *etm, gint col, gconstpointer value) +etmc_value_to_string (ETableModel *etm, + gint col, + gconstpointer value) { ETableMemoryCallbacks *etmc = E_TABLE_MEMORY_CALLBACKS (etm); @@ -128,7 +144,9 @@ etmc_value_to_string (ETableModel *etm, gint col, gconstpointer value) } static void -etmc_append_row (ETableModel *etm, ETableModel *source, gint row) +etmc_append_row (ETableModel *etm, + ETableModel *source, + gint row) { ETableMemoryCallbacks *etmc = E_TABLE_MEMORY_CALLBACKS (etm); @@ -189,15 +207,15 @@ e_table_memory_callbacks_init (ETableMemoryCallbacks *etmc) */ ETableModel * e_table_memory_callbacks_new (ETableMemoryCallbacksColumnCountFn col_count, - ETableMemoryCallbacksValueAtFn value_at, - ETableMemoryCallbacksSetValueAtFn set_value_at, - ETableMemoryCallbacksIsCellEditableFn is_cell_editable, - ETableMemoryCallbacksDuplicateValueFn duplicate_value, - ETableMemoryCallbacksFreeValueFn free_value, - ETableMemoryCallbacksInitializeValueFn initialize_value, - ETableMemoryCallbacksValueIsEmptyFn value_is_empty, - ETableMemoryCallbacksValueToStringFn value_to_string, - gpointer data) + ETableMemoryCallbacksValueAtFn value_at, + ETableMemoryCallbacksSetValueAtFn set_value_at, + ETableMemoryCallbacksIsCellEditableFn is_cell_editable, + ETableMemoryCallbacksDuplicateValueFn duplicate_value, + ETableMemoryCallbacksFreeValueFn free_value, + ETableMemoryCallbacksInitializeValueFn initialize_value, + ETableMemoryCallbacksValueIsEmptyFn value_is_empty, + ETableMemoryCallbacksValueToStringFn value_to_string, + gpointer data) { ETableMemoryCallbacks *et; diff --git a/widgets/table/e-table-memory-store.c b/widgets/table/e-table-memory-store.c index dc77e13410..55f96f5862 100644 --- a/widgets/table/e-table-memory-store.c +++ b/widgets/table/e-table-memory-store.c @@ -41,7 +41,9 @@ struct _ETableMemoryStorePrivate { G_DEFINE_TYPE (ETableMemoryStore, e_table_memory_store, E_TYPE_TABLE_MEMORY) static gpointer -duplicate_value (ETableMemoryStore *etms, gint col, gconstpointer val) +duplicate_value (ETableMemoryStore *etms, + gint col, + gconstpointer val) { switch (etms->priv->columns[col].type) { case E_TABLE_MEMORY_STORE_COLUMN_TYPE_STRING: @@ -65,7 +67,9 @@ duplicate_value (ETableMemoryStore *etms, gint col, gconstpointer val) } static void -free_value (ETableMemoryStore *etms, gint col, gpointer value) +free_value (ETableMemoryStore *etms, + gint col, + gpointer value) { switch (etms->priv->columns[col].type) { case E_TABLE_MEMORY_STORE_COLUMN_TYPE_STRING: @@ -97,7 +101,9 @@ etms_column_count (ETableModel *etm) } static gpointer -etms_value_at (ETableModel *etm, gint col, gint row) +etms_value_at (ETableModel *etm, + gint col, + gint row) { ETableMemoryStore *etms = E_TABLE_MEMORY_STORE (etm); @@ -105,7 +111,10 @@ etms_value_at (ETableModel *etm, gint col, gint row) } static void -etms_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) +etms_set_value_at (ETableModel *etm, + gint col, + gint row, + gconstpointer val) { ETableMemoryStore *etms = E_TABLE_MEMORY_STORE (etm); @@ -117,7 +126,9 @@ etms_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) } static gboolean -etms_is_cell_editable (ETableModel *etm, gint col, gint row) +etms_is_cell_editable (ETableModel *etm, + gint col, + gint row) { ETableMemoryStore *etms = E_TABLE_MEMORY_STORE (etm); @@ -126,7 +137,9 @@ etms_is_cell_editable (ETableModel *etm, gint col, gint row) /* The default for etms_duplicate_value is to return the raw value. */ static gpointer -etms_duplicate_value (ETableModel *etm, gint col, gconstpointer value) +etms_duplicate_value (ETableModel *etm, + gint col, + gconstpointer value) { ETableMemoryStore *etms = E_TABLE_MEMORY_STORE (etm); @@ -134,7 +147,9 @@ etms_duplicate_value (ETableModel *etm, gint col, gconstpointer value) } static void -etms_free_value (ETableModel *etm, gint col, gpointer value) +etms_free_value (ETableModel *etm, + gint col, + gpointer value) { ETableMemoryStore *etms = E_TABLE_MEMORY_STORE (etm); @@ -142,7 +157,8 @@ etms_free_value (ETableModel *etm, gint col, gpointer value) } static gpointer -etms_initialize_value (ETableModel *etm, gint col) +etms_initialize_value (ETableModel *etm, + gint col) { ETableMemoryStore *etms = E_TABLE_MEMORY_STORE (etm); @@ -163,7 +179,9 @@ etms_initialize_value (ETableModel *etm, gint col) } static gboolean -etms_value_is_empty (ETableModel *etm, gint col, gconstpointer value) +etms_value_is_empty (ETableModel *etm, + gint col, + gconstpointer value) { ETableMemoryStore *etms = E_TABLE_MEMORY_STORE (etm); @@ -184,7 +202,9 @@ etms_value_is_empty (ETableModel *etm, gint col, gconstpointer value) } static gchar * -etms_value_to_string (ETableModel *etm, gint col, gconstpointer value) +etms_value_to_string (ETableModel *etm, + gint col, + gconstpointer value) { ETableMemoryStore *etms = E_TABLE_MEMORY_STORE (etm); @@ -205,7 +225,9 @@ etms_value_to_string (ETableModel *etm, gint col, gconstpointer value) } static void -etms_append_row (ETableModel *etm, ETableModel *source, gint row) +etms_append_row (ETableModel *etm, + ETableModel *source, + gint row) { ETableMemoryStore *etms = E_TABLE_MEMORY_STORE (etm); gpointer *new_data; @@ -310,7 +332,8 @@ e_table_memory_store_new (ETableMemoryStoreColumnInfo *columns) } ETableModel * -e_table_memory_store_construct (ETableMemoryStore *etms, ETableMemoryStoreColumnInfo *columns) +e_table_memory_store_construct (ETableMemoryStore *etms, + ETableMemoryStoreColumnInfo *columns) { gint i; for (i = 0; columns[i].type != E_TABLE_MEMORY_STORE_COLUMN_TYPE_TERMINATOR; i++) @@ -325,7 +348,10 @@ e_table_memory_store_construct (ETableMemoryStore *etms, ETableMemoryStoreColumn } void -e_table_memory_store_adopt_value_at (ETableMemoryStore *etms, gint col, gint row, gpointer value) +e_table_memory_store_adopt_value_at (ETableMemoryStore *etms, + gint col, + gint row, + gpointer value) { e_table_model_pre_change (E_TABLE_MODEL (etms)); @@ -336,7 +362,10 @@ e_table_memory_store_adopt_value_at (ETableMemoryStore *etms, gint col, gint row /* The size of these arrays is the number of columns. */ void -e_table_memory_store_insert_array (ETableMemoryStore *etms, gint row, gpointer *store, gpointer data) +e_table_memory_store_insert_array (ETableMemoryStore *etms, + gint row, + gpointer *store, + gpointer data) { gint row_count; gint i; @@ -357,7 +386,10 @@ e_table_memory_store_insert_array (ETableMemoryStore *etms, gint row, gpointer * } void -e_table_memory_store_insert (ETableMemoryStore *etms, gint row, gpointer data, ...) +e_table_memory_store_insert (ETableMemoryStore *etms, + gint row, + gpointer data, + ...) { gpointer *store; va_list args; @@ -377,7 +409,10 @@ e_table_memory_store_insert (ETableMemoryStore *etms, gint row, gpointer data, . } void -e_table_memory_store_insert_adopt_array (ETableMemoryStore *etms, gint row, gpointer *store, gpointer data) +e_table_memory_store_insert_adopt_array (ETableMemoryStore *etms, + gint row, + gpointer *store, + gpointer data) { gint row_count; gint i; @@ -398,7 +433,10 @@ e_table_memory_store_insert_adopt_array (ETableMemoryStore *etms, gint row, gpoi } void -e_table_memory_store_insert_adopt (ETableMemoryStore *etms, gint row, gpointer data, ...) +e_table_memory_store_insert_adopt (ETableMemoryStore *etms, + gint row, + gpointer data, + ...) { gpointer *store; va_list args; @@ -429,7 +467,10 @@ e_table_memory_store_insert_adopt (ETableMemoryStore *etms, gint row, gpointer d * */ void -e_table_memory_store_change_array (ETableMemoryStore *etms, gint row, gpointer *store, gpointer data) +e_table_memory_store_change_array (ETableMemoryStore *etms, + gint row, + gpointer *store, + gpointer data) { gint i; @@ -456,7 +497,10 @@ e_table_memory_store_change_array (ETableMemoryStore *etms, gint row, gpointer * * pass in etms->col_count args. */ void -e_table_memory_store_change (ETableMemoryStore *etms, gint row, gpointer data, ...) +e_table_memory_store_change (ETableMemoryStore *etms, + gint row, + gpointer data, + ...) { gpointer *store; va_list args; @@ -490,7 +534,10 @@ e_table_memory_store_change (ETableMemoryStore *etms, gint row, gpointer data, . * duplicate the data. */ void -e_table_memory_store_change_adopt_array (ETableMemoryStore *etms, gint row, gpointer *store, gpointer data) +e_table_memory_store_change_adopt_array (ETableMemoryStore *etms, + gint row, + gpointer *store, + gpointer data) { gint i; @@ -515,7 +562,10 @@ e_table_memory_store_change_adopt_array (ETableMemoryStore *etms, gint row, gpoi * must pass in etms->col_count args. */ void -e_table_memory_store_change_adopt (ETableMemoryStore *etms, gint row, gpointer data, ...) +e_table_memory_store_change_adopt (ETableMemoryStore *etms, + gint row, + gpointer data, + ...) { gpointer *store; va_list args; @@ -537,7 +587,8 @@ e_table_memory_store_change_adopt (ETableMemoryStore *etms, gint row, gpointer d } void -e_table_memory_store_remove (ETableMemoryStore *etms, gint row) +e_table_memory_store_remove (ETableMemoryStore *etms, + gint row) { ETableModel *model; gint column_count, row_count; diff --git a/widgets/table/e-table-memory.c b/widgets/table/e-table-memory.c index cc62a6d0b5..28f10264f8 100644 --- a/widgets/table/e-table-memory.c +++ b/widgets/table/e-table-memory.c @@ -113,7 +113,8 @@ e_table_memory_new (void) * Return value: **/ gpointer -e_table_memory_get_data (ETableMemory *etmm, gint row) +e_table_memory_get_data (ETableMemory *etmm, + gint row) { g_return_val_if_fail (row >= 0, NULL); g_return_val_if_fail (row < etmm->priv->num_rows, NULL); @@ -130,7 +131,9 @@ e_table_memory_get_data (ETableMemory *etmm, gint row) * **/ void -e_table_memory_set_data (ETableMemory *etmm, gint row, gpointer data) +e_table_memory_set_data (ETableMemory *etmm, + gint row, + gpointer data) { g_return_if_fail (row >= 0); g_return_if_fail (row < etmm->priv->num_rows); @@ -151,8 +154,8 @@ e_table_memory_set_data (ETableMemory *etmm, gint row, gpointer data) **/ void e_table_memory_insert (ETableMemory *etmm, - gint row, - gpointer data) + gint row, + gpointer data) { g_return_if_fail (row >= -1); g_return_if_fail (row <= etmm->priv->num_rows); @@ -185,7 +188,8 @@ e_table_memory_insert (ETableMemory *etmm, * Return value: **/ gpointer -e_table_memory_remove (ETableMemory *etmm, gint row) +e_table_memory_remove (ETableMemory *etmm, + gint row) { gpointer ret; diff --git a/widgets/table/e-table-model.c b/widgets/table/e-table-model.c index 77b462ec2a..6f44379858 100644 --- a/widgets/table/e-table-model.c +++ b/widgets/table/e-table-model.c @@ -90,7 +90,9 @@ e_table_model_row_count (ETableModel *e_table_model) * */ void -e_table_model_append_row (ETableModel *e_table_model, ETableModel *source, gint row) +e_table_model_append_row (ETableModel *e_table_model, + ETableModel *source, + gint row) { g_return_if_fail (e_table_model != NULL); g_return_if_fail (E_IS_TABLE_MODEL (e_table_model)); @@ -119,7 +121,9 @@ e_table_model_append_row (ETableModel *e_table_model, ETableModel *source, gint * rows_inserted and no_change don't affect any data in this way. **/ gpointer -e_table_model_value_at (ETableModel *e_table_model, gint col, gint row) +e_table_model_value_at (ETableModel *e_table_model, + gint col, + gint row) { g_return_val_if_fail (e_table_model != NULL, NULL); g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), NULL); @@ -143,7 +147,10 @@ e_table_model_value_at (ETableModel *e_table_model, gint col, gint row) * be a pointer to a set of data, or a datum that fits inside a gpointer . */ void -e_table_model_set_value_at (ETableModel *e_table_model, gint col, gint row, gconstpointer value) +e_table_model_set_value_at (ETableModel *e_table_model, + gint col, + gint row, + gconstpointer value) { g_return_if_fail (e_table_model != NULL); g_return_if_fail (E_IS_TABLE_MODEL (e_table_model)); @@ -161,7 +168,9 @@ e_table_model_set_value_at (ETableModel *e_table_model, gint col, gint row, gcon * edited, %FALSE otherwise */ gboolean -e_table_model_is_cell_editable (ETableModel *e_table_model, gint col, gint row) +e_table_model_is_cell_editable (ETableModel *e_table_model, + gint col, + gint row) { g_return_val_if_fail (e_table_model != NULL, FALSE); g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), FALSE); @@ -170,7 +179,9 @@ e_table_model_is_cell_editable (ETableModel *e_table_model, gint col, gint row) } gpointer -e_table_model_duplicate_value (ETableModel *e_table_model, gint col, gconstpointer value) +e_table_model_duplicate_value (ETableModel *e_table_model, + gint col, + gconstpointer value) { g_return_val_if_fail (e_table_model != NULL, NULL); g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), NULL); @@ -182,7 +193,9 @@ e_table_model_duplicate_value (ETableModel *e_table_model, gint col, gconstpoint } void -e_table_model_free_value (ETableModel *e_table_model, gint col, gpointer value) +e_table_model_free_value (ETableModel *e_table_model, + gint col, + gpointer value) { g_return_if_fail (e_table_model != NULL); g_return_if_fail (E_IS_TABLE_MODEL (e_table_model)); @@ -204,7 +217,8 @@ e_table_model_has_save_id (ETableModel *e_table_model) } gchar * -e_table_model_get_save_id (ETableModel *e_table_model, gint row) +e_table_model_get_save_id (ETableModel *e_table_model, + gint row) { g_return_val_if_fail (e_table_model != NULL, NULL); g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), NULL); @@ -228,7 +242,8 @@ e_table_model_has_change_pending (ETableModel *e_table_model) } gpointer -e_table_model_initialize_value (ETableModel *e_table_model, gint col) +e_table_model_initialize_value (ETableModel *e_table_model, + gint col) { g_return_val_if_fail (e_table_model != NULL, NULL); g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), NULL); @@ -240,7 +255,9 @@ e_table_model_initialize_value (ETableModel *e_table_model, gint col) } gboolean -e_table_model_value_is_empty (ETableModel *e_table_model, gint col, gconstpointer value) +e_table_model_value_is_empty (ETableModel *e_table_model, + gint col, + gconstpointer value) { g_return_val_if_fail (e_table_model != NULL, FALSE); g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), FALSE); @@ -252,7 +269,9 @@ e_table_model_value_is_empty (ETableModel *e_table_model, gint col, gconstpointe } gchar * -e_table_model_value_to_string (ETableModel *e_table_model, gint col, gconstpointer value) +e_table_model_value_to_string (ETableModel *e_table_model, + gint col, + gconstpointer value) { g_return_val_if_fail (e_table_model != NULL, NULL); g_return_val_if_fail (E_IS_TABLE_MODEL (e_table_model), NULL); @@ -462,7 +481,8 @@ e_table_model_changed (ETableModel *e_table_model) * object */ void -e_table_model_row_changed (ETableModel *e_table_model, gint row) +e_table_model_row_changed (ETableModel *e_table_model, + gint row) { g_return_if_fail (e_table_model != NULL); g_return_if_fail (E_IS_TABLE_MODEL (e_table_model)); @@ -490,7 +510,9 @@ e_table_model_row_changed (ETableModel *e_table_model, gint row) * object */ void -e_table_model_cell_changed (ETableModel *e_table_model, gint col, gint row) +e_table_model_cell_changed (ETableModel *e_table_model, + gint col, + gint row) { g_return_if_fail (e_table_model != NULL); g_return_if_fail (E_IS_TABLE_MODEL (e_table_model)); @@ -518,7 +540,9 @@ e_table_model_cell_changed (ETableModel *e_table_model, gint col, gint row) * @e_table_model object */ void -e_table_model_rows_inserted (ETableModel *e_table_model, gint row, gint count) +e_table_model_rows_inserted (ETableModel *e_table_model, + gint row, + gint count) { g_return_if_fail (e_table_model != NULL); g_return_if_fail (E_IS_TABLE_MODEL (e_table_model)); @@ -544,7 +568,8 @@ e_table_model_rows_inserted (ETableModel *e_table_model, gint row, gint count) * the "model_rows_inserted" signal on the @e_table_model object */ void -e_table_model_row_inserted (ETableModel *e_table_model, gint row) +e_table_model_row_inserted (ETableModel *e_table_model, + gint row) { e_table_model_rows_inserted (e_table_model, row, 1); } @@ -561,7 +586,9 @@ e_table_model_row_inserted (ETableModel *e_table_model, gint row) * @e_table_model object */ void -e_table_model_rows_deleted (ETableModel *e_table_model, gint row, gint count) +e_table_model_rows_deleted (ETableModel *e_table_model, + gint row, + gint count) { g_return_if_fail (e_table_model != NULL); g_return_if_fail (E_IS_TABLE_MODEL (e_table_model)); @@ -587,7 +614,8 @@ e_table_model_rows_deleted (ETableModel *e_table_model, gint row, gint count) * the "model_rows_deleted" signal on the @e_table_model object */ void -e_table_model_row_deleted (ETableModel *e_table_model, gint row) +e_table_model_row_deleted (ETableModel *e_table_model, + gint row) { e_table_model_rows_deleted (e_table_model, row, 1); } diff --git a/widgets/table/e-table-one.c b/widgets/table/e-table-one.c index 7683b935a4..ff38d94131 100644 --- a/widgets/table/e-table-one.c +++ b/widgets/table/e-table-one.c @@ -49,7 +49,9 @@ one_row_count (ETableModel *etm) } static gpointer -one_value_at (ETableModel *etm, gint col, gint row) +one_value_at (ETableModel *etm, + gint col, + gint row) { ETableOne *one = E_TABLE_ONE (etm); @@ -60,7 +62,10 @@ one_value_at (ETableModel *etm, gint col, gint row) } static void -one_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) +one_set_value_at (ETableModel *etm, + gint col, + gint row, + gconstpointer val) { ETableOne *one = E_TABLE_ONE (etm); @@ -71,7 +76,9 @@ one_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) } static gboolean -one_is_cell_editable (ETableModel *etm, gint col, gint row) +one_is_cell_editable (ETableModel *etm, + gint col, + gint row) { ETableOne *one = E_TABLE_ONE (etm); @@ -83,7 +90,9 @@ one_is_cell_editable (ETableModel *etm, gint col, gint row) /* The default for one_duplicate_value is to return the raw value. */ static gpointer -one_duplicate_value (ETableModel *etm, gint col, gconstpointer value) +one_duplicate_value (ETableModel *etm, + gint col, + gconstpointer value) { ETableOne *one = E_TABLE_ONE (etm); @@ -94,7 +103,9 @@ one_duplicate_value (ETableModel *etm, gint col, gconstpointer value) } static void -one_free_value (ETableModel *etm, gint col, gpointer value) +one_free_value (ETableModel *etm, + gint col, + gpointer value) { ETableOne *one = E_TABLE_ONE (etm); @@ -103,7 +114,8 @@ one_free_value (ETableModel *etm, gint col, gpointer value) } static gpointer -one_initialize_value (ETableModel *etm, gint col) +one_initialize_value (ETableModel *etm, + gint col) { ETableOne *one = E_TABLE_ONE (etm); @@ -114,7 +126,9 @@ one_initialize_value (ETableModel *etm, gint col) } static gboolean -one_value_is_empty (ETableModel *etm, gint col, gconstpointer value) +one_value_is_empty (ETableModel *etm, + gint col, + gconstpointer value) { ETableOne *one = E_TABLE_ONE (etm); @@ -125,7 +139,9 @@ one_value_is_empty (ETableModel *etm, gint col, gconstpointer value) } static gchar * -one_value_to_string (ETableModel *etm, gint col, gconstpointer value) +one_value_to_string (ETableModel *etm, + gint col, + gconstpointer value) { ETableOne *one = E_TABLE_ONE (etm); diff --git a/widgets/table/e-table-search.c b/widgets/table/e-table-search.c index 955547fd7f..99f282c76f 100644 --- a/widgets/table/e-table-search.c +++ b/widgets/table/e-table-search.c @@ -32,8 +32,6 @@ #define d(x) -d (static gint depth = 0) - struct _ETableSearchPrivate { guint timeout_id; @@ -49,6 +47,8 @@ enum { LAST_SIGNAL }; +d (static gint depth = 0) + static guint e_table_search_signals[LAST_SIGNAL] = { 0, }; static gboolean @@ -174,7 +174,8 @@ e_table_search_new (void) * Returns: the number of columns in the table search. */ void -e_table_search_input_character (ETableSearch *ets, gunichar character) +e_table_search_input_character (ETableSearch *ets, + gunichar character) { gchar character_utf8[7]; gchar *temp_string; diff --git a/widgets/table/e-table-selection-model.c b/widgets/table/e-table-selection-model.c index b8f33c639e..0320663e8e 100644 --- a/widgets/table/e-table-selection-model.c +++ b/widgets/table/e-table-selection-model.c @@ -44,7 +44,8 @@ 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); @@ -65,7 +66,8 @@ free_hash (ETableSelectionModel *etsm) } static void -model_pre_change (ETableModel *etm, ETableSelectionModel *etsm) +model_pre_change (ETableModel *etm, + ETableSelectionModel *etsm) { free_hash (etsm); @@ -131,7 +133,8 @@ model_changed_idle (ETableSelectionModel *etsm) } 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)) { @@ -140,27 +143,38 @@ model_changed (ETableModel *etm, ETableSelectionModel *etsm) } static void -model_row_changed (ETableModel *etm, gint row, ETableSelectionModel *etsm) +model_row_changed (ETableModel *etm, + gint row, + ETableSelectionModel *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); } #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); } 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); @@ -169,36 +183,49 @@ model_rows_deleted (ETableModel *etm, gint row, gint count, ETableSelectionModel #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); } 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); } #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); - etsm->model_pre_change_id = g_signal_connect(G_OBJECT(model), "model_pre_change", - G_CALLBACK (model_pre_change), etsm); - etsm->model_changed_id = g_signal_connect(G_OBJECT(model), "model_changed", - 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); - etsm->model_cell_changed_id = g_signal_connect(G_OBJECT(model), "model_cell_changed", - 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); - etsm->model_rows_deleted_id = g_signal_connect(G_OBJECT(model), "model_rows_deleted", - G_CALLBACK (model_rows_deleted), etsm); + etsm->model_pre_change_id = g_signal_connect ( + model, "model_pre_change", + G_CALLBACK (model_pre_change), etsm); + etsm->model_changed_id = g_signal_connect ( + model, "model_changed", + G_CALLBACK (model_changed), etsm); + etsm->model_row_changed_id = g_signal_connect ( + model, "model_row_changed", + G_CALLBACK (model_row_changed), etsm); + etsm->model_cell_changed_id = g_signal_connect ( + model, "model_cell_changed", + G_CALLBACK (model_cell_changed), etsm); + etsm->model_rows_inserted_id = g_signal_connect ( + model, "model_rows_inserted", + G_CALLBACK (model_rows_inserted), etsm); + etsm->model_rows_deleted_id = g_signal_connect ( + model, "model_rows_deleted", + G_CALLBACK (model_rows_deleted), etsm); } e_selection_model_array_confirm_row_count (E_SELECTION_MODEL_ARRAY (etsm)); } @@ -244,11 +271,14 @@ etsm_dispose (GObject *object) } static void -etsm_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +etsm_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { ETableSelectionModel *etsm = E_TABLE_SELECTION_MODEL (object); - switch (prop_id) { + switch (property_id) { case PROP_MODEL: g_value_set_object (value, etsm->model); break; @@ -259,11 +289,14 @@ etsm_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *ps } static void -etsm_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +etsm_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { ETableSelectionModel *etsm = E_TABLE_SELECTION_MODEL (object); - switch (prop_id) { + switch (property_id) { case PROP_MODEL: drop_model (etsm); add_model (etsm, g_value_get_object (value) ? E_TABLE_MODEL (g_value_get_object (value)) : NULL); diff --git a/widgets/table/e-table-selection-model.h b/widgets/table/e-table-selection-model.h index f144980f03..02309c047a 100644 --- a/widgets/table/e-table-selection-model.h +++ b/widgets/table/e-table-selection-model.h @@ -35,7 +35,7 @@ (G_TYPE_CHECK_INSTANCE_CAST \ ((obj), E_TYPE_TABLE_SELECTION_MODEL, ETableSelectionModel)) #define E_TABLE_SELECTION_MODEL_CLASS(cls) \ - (G_TYPE-CHECK_CLASS_CAST \ + (G_TYPE - CHECK_CLASS_CAST \ ((cls), E_TYPE_TABLE_SELECTION_MODEL, ETableSelectionModelClass)) #define E_IS_TABLE_SELECTION_MODEL(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE \ diff --git a/widgets/table/e-table-sort-info.c b/widgets/table/e-table-sort-info.c index b488dbce06..cac2586b8a 100644 --- a/widgets/table/e-table-sort-info.c +++ b/widgets/table/e-table-sort-info.c @@ -141,7 +141,7 @@ e_table_sort_info_group_info_changed (ETableSortInfo *info) * trigger any signals that might have been queued. */ void -e_table_sort_info_freeze (ETableSortInfo *info) +e_table_sort_info_freeze (ETableSortInfo *info) { info->frozen++; } @@ -158,7 +158,7 @@ e_table_sort_info_freeze (ETableSortInfo *info) * this object. */ void -e_table_sort_info_thaw (ETableSortInfo *info) +e_table_sort_info_thaw (ETableSortInfo *info) { info->frozen--; if (info->frozen != 0) @@ -190,7 +190,8 @@ e_table_sort_info_grouping_get_count (ETableSortInfo *info) } static void -e_table_sort_info_grouping_real_truncate (ETableSortInfo *info, gint length) +e_table_sort_info_grouping_real_truncate (ETableSortInfo *info, + gint length) { if (length < info->group_count) { info->group_count = length; @@ -210,7 +211,8 @@ e_table_sort_info_grouping_real_truncate (ETableSortInfo *info, gint length) * criteria in the object. */ void -e_table_sort_info_grouping_truncate (ETableSortInfo *info, gint length) +e_table_sort_info_grouping_truncate (ETableSortInfo *info, + gint length) { e_table_sort_info_grouping_real_truncate (info, length); e_table_sort_info_group_info_changed (info); @@ -224,7 +226,8 @@ e_table_sort_info_grouping_truncate (ETableSortInfo *info, gint length) * Returns: the description of the @n-th grouping criteria in the @info object. */ ETableSortColumn -e_table_sort_info_grouping_get_nth (ETableSortInfo *info, gint n) +e_table_sort_info_grouping_get_nth (ETableSortInfo *info, + gint n) { if (info->can_group && n < info->group_count) { return info->groupings[n]; @@ -244,7 +247,9 @@ e_table_sort_info_grouping_get_nth (ETableSortInfo *info, gint n) * whether it is ascending or descending). */ void -e_table_sort_info_grouping_set_nth (ETableSortInfo *info, gint n, ETableSortColumn column) +e_table_sort_info_grouping_set_nth (ETableSortInfo *info, + gint n, + ETableSortColumn column) { if (n >= info->group_count) { e_table_sort_info_grouping_real_truncate (info, n + 1); @@ -266,7 +271,8 @@ e_table_sort_info_sorting_get_count (ETableSortInfo *info) } static void -e_table_sort_info_sorting_real_truncate (ETableSortInfo *info, gint length) +e_table_sort_info_sorting_real_truncate (ETableSortInfo *info, + gint length) { if (length < info->sort_count) { info->sort_count = length; @@ -286,7 +292,8 @@ e_table_sort_info_sorting_real_truncate (ETableSortInfo *info, gint length) * criteria in the object. */ void -e_table_sort_info_sorting_truncate (ETableSortInfo *info, gint length) +e_table_sort_info_sorting_truncate (ETableSortInfo *info, + gint length) { e_table_sort_info_sorting_real_truncate (info, length); e_table_sort_info_sort_info_changed (info); @@ -300,7 +307,8 @@ e_table_sort_info_sorting_truncate (ETableSortInfo *info, gint length) * Returns: the description of the @n-th grouping criteria in the @info object. */ ETableSortColumn -e_table_sort_info_sorting_get_nth (ETableSortInfo *info, gint n) +e_table_sort_info_sorting_get_nth (ETableSortInfo *info, + gint n) { if (n < info->sort_count) { return info->sortings[n]; @@ -320,7 +328,9 @@ e_table_sort_info_sorting_get_nth (ETableSortInfo *info, gint n) * column number and whether it is ascending or descending). */ void -e_table_sort_info_sorting_set_nth (ETableSortInfo *info, gint n, ETableSortColumn column) +e_table_sort_info_sorting_set_nth (ETableSortInfo *info, + gint n, + ETableSortColumn column) { if (n >= info->sort_count) { e_table_sort_info_sorting_real_truncate (info, n + 1); @@ -356,8 +366,8 @@ e_table_sort_info_new (void) */ void e_table_sort_info_load_from_node (ETableSortInfo *info, - xmlNode *node, - gdouble state_version) + xmlNode *node, + gdouble state_version) { gint i; xmlNode *grouping; @@ -412,7 +422,7 @@ e_table_sort_info_load_from_node (ETableSortInfo *info, */ xmlNode * e_table_sort_info_save_to_node (ETableSortInfo *info, - xmlNode *parent) + xmlNode *parent) { xmlNode *grouping; gint i; @@ -461,14 +471,14 @@ e_table_sort_info_duplicate (ETableSortInfo *info) } void -e_table_sort_info_set_can_group (ETableSortInfo *info, - gboolean can_group) +e_table_sort_info_set_can_group (ETableSortInfo *info, + gboolean can_group) { info->can_group = can_group; } gboolean -e_table_sort_info_get_can_group (ETableSortInfo *info) +e_table_sort_info_get_can_group (ETableSortInfo *info) { return info->can_group; } diff --git a/widgets/table/e-table-sorted-variable.c b/widgets/table/e-table-sorted-variable.c index 0ed35c95a6..7792795477 100644 --- a/widgets/table/e-table-sorted-variable.c +++ b/widgets/table/e-table-sorted-variable.c @@ -122,8 +122,8 @@ etsv_insert_idle (ETableSortedVariable *etsv) } static void -etsv_add (ETableSubsetVariable *etssv, - gint row) +etsv_add (ETableSubsetVariable *etssv, + gint row) { ETableModel *etm = E_TABLE_MODEL (etssv); ETableSubset *etss = E_TABLE_SUBSET (etssv); @@ -139,7 +139,7 @@ etsv_add (ETableSubsetVariable *etssv, i = etss->n_map; if (etsv->sort_idle_id == 0) { /* this is to see if we're inserting a lot of things between idle loops. - If we are, we're busy, its faster to just append and perform a full sort later */ + * If we are, we're busy, its faster to just append and perform a full sort later */ etsv->insert_count++; if (etsv->insert_count > ETSV_INSERT_MAX) { /* schedule a sort, and append instead */ @@ -160,7 +160,7 @@ etsv_add (ETableSubsetVariable *etssv, } static void -etsv_add_all (ETableSubsetVariable *etssv) +etsv_add_all (ETableSubsetVariable *etssv) { ETableModel *etm = E_TABLE_MODEL (etssv); ETableSubset *etss = E_TABLE_SUBSET (etssv); @@ -187,7 +187,9 @@ etsv_add_all (ETableSubsetVariable *etssv) } ETableModel * -e_table_sorted_variable_new (ETableModel *source, ETableHeader *full_header, ETableSortInfo *sort_info) +e_table_sorted_variable_new (ETableModel *source, + ETableHeader *full_header, + ETableSortInfo *sort_info) { ETableSortedVariable *etsv = g_object_new (E_TYPE_TABLE_SORTED_VARIABLE, NULL); ETableSubsetVariable *etssv = E_TABLE_SUBSET_VARIABLE (etsv); @@ -202,14 +204,16 @@ e_table_sorted_variable_new (ETableModel *source, ETableHeader *full_header, ETa etsv->full_header = 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); + etsv->sort_info_changed_id = g_signal_connect ( + sort_info, "sort_info_changed", + G_CALLBACK (etsv_sort_info_changed), etsv); return E_TABLE_MODEL (etsv); } static void -etsv_sort_info_changed (ETableSortInfo *info, ETableSortedVariable *etsv) +etsv_sort_info_changed (ETableSortInfo *info, + ETableSortedVariable *etsv) { etsv_sort (etsv); } diff --git a/widgets/table/e-table-sorted.c b/widgets/table/e-table-sorted.c index 61ea10c082..fe5f644dbf 100644 --- a/widgets/table/e-table-sorted.c +++ b/widgets/table/e-table-sorted.c @@ -125,7 +125,9 @@ ets_insert_idle (ETableSorted *ets) } ETableModel * -e_table_sorted_new (ETableModel *source, ETableHeader *full_header, ETableSortInfo *sort_info) +e_table_sorted_new (ETableModel *source, + ETableHeader *full_header, + ETableSortInfo *sort_info) { ETableSorted *ets = g_object_new (E_TYPE_TABLE_SORTED, NULL); ETableSubset *etss = E_TABLE_SUBSET (ets); @@ -145,20 +147,23 @@ e_table_sorted_new (ETableModel *source, ETableHeader *full_header, ETableSortIn 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); + ets->sort_info_changed_id = g_signal_connect ( + sort_info, "sort_info_changed", + G_CALLBACK (ets_sort_info_changed), ets); return E_TABLE_MODEL (ets); } static void -ets_sort_info_changed (ETableSortInfo *info, ETableSorted *ets) +ets_sort_info_changed (ETableSortInfo *info, + ETableSorted *ets) { ets_sort (ets); } static void -ets_proxy_model_changed (ETableSubset *subset, ETableModel *source) +ets_proxy_model_changed (ETableSubset *subset, + ETableModel *source) { gint rows, i; @@ -179,7 +184,9 @@ ets_proxy_model_changed (ETableSubset *subset, ETableModel *source) } static void -ets_proxy_model_row_changed (ETableSubset *subset, ETableModel *source, gint row) +ets_proxy_model_row_changed (ETableSubset *subset, + ETableModel *source, + gint row) { if (!E_TABLE_SORTED (subset)->sort_idle_id) E_TABLE_SORTED (subset)->sort_idle_id = g_idle_add_full (50, (GSourceFunc) ets_sort_idle, subset, NULL); @@ -189,7 +196,10 @@ 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) +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)) @@ -199,7 +209,10 @@ 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) +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); @@ -228,7 +241,7 @@ ets_proxy_model_rows_inserted (ETableSubset *etss, ETableModel *source, gint row i = etss->n_map; if (ets->sort_idle_id == 0) { /* this is to see if we're inserting a lot of things between idle loops. - If we are, we're busy, its faster to just append and perform a full sort later */ + * If we are, we're busy, its faster to just append and perform a full sort later */ ets->insert_count++; if (ets->insert_count > ETS_INSERT_MAX) { /* schedule a sort, and append instead */ @@ -259,7 +272,10 @@ ets_proxy_model_rows_inserted (ETableSubset *etss, ETableModel *source, gint row } static void -ets_proxy_model_rows_deleted (ETableSubset *etss, ETableModel *source, gint row, gint count) +ets_proxy_model_rows_deleted (ETableSubset *etss, + ETableModel *source, + gint row, + gint count) { ETableModel *etm = E_TABLE_MODEL (etss); gint i; diff --git a/widgets/table/e-table-sorter.c b/widgets/table/e-table-sorter.c index d74dbd3d04..418ce3a5e8 100644 --- a/widgets/table/e-table-sorter.c +++ b/widgets/table/e-table-sorter.c @@ -115,11 +115,14 @@ ets_dispose (GObject *object) } static void -ets_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +ets_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { ETableSorter *ets = E_TABLE_SORTER (object); - switch (prop_id) { + switch (property_id) { case PROP_SORT_INFO: if (ets->sort_info) { if (ets->sort_info_changed_id) @@ -144,10 +147,13 @@ ets_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpe } static void -ets_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +ets_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { ETableSorter *ets = E_TABLE_SORTER (object); - switch (prop_id) { + switch (property_id) { case PROP_SORT_INFO: g_value_set_object (value, ets->sort_info); break; @@ -197,7 +203,9 @@ ets_init (ETableSorter *ets) } ETableSorter * -e_table_sorter_new (ETableModel *source, ETableHeader *full_header, ETableSortInfo *sort_info) +e_table_sorter_new (ETableModel *source, + ETableHeader *full_header, + ETableSortInfo *sort_info) { ETableSorter *ets = g_object_new (E_TYPE_TABLE_SORTER, NULL); @@ -227,37 +235,50 @@ e_table_sorter_new (ETableModel *source, ETableHeader *full_header, ETableSortIn } static void -ets_model_changed (ETableModel *etm, ETableSorter *ets) +ets_model_changed (ETableModel *etm, + ETableSorter *ets) { ets_clean (ets); } static void -ets_model_row_changed (ETableModel *etm, gint row, ETableSorter *ets) +ets_model_row_changed (ETableModel *etm, + gint row, + ETableSorter *ets) { ets_clean (ets); } static void -ets_model_cell_changed (ETableModel *etm, gint col, gint row, ETableSorter *ets) +ets_model_cell_changed (ETableModel *etm, + gint col, + gint row, + ETableSorter *ets) { ets_clean (ets); } static void -ets_model_rows_inserted (ETableModel *etm, gint row, gint count, ETableSorter *ets) +ets_model_rows_inserted (ETableModel *etm, + gint row, + gint count, + ETableSorter *ets) { ets_clean (ets); } static void -ets_model_rows_deleted (ETableModel *etm, gint row, gint count, ETableSorter *ets) +ets_model_rows_deleted (ETableModel *etm, + gint row, + gint count, + ETableSorter *ets) { ets_clean (ets); } static void -ets_sort_info_changed (ETableSortInfo *info, ETableSorter *ets) +ets_sort_info_changed (ETableSortInfo *info, + ETableSorter *ets) { d(g_print ("sort info changed\n")); ets_clean (ets); @@ -275,7 +296,9 @@ 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; @@ -390,7 +413,8 @@ ets_backsort (ETableSorter *ets) } static gint -ets_model_to_sorted (ESorter *es, gint row) +ets_model_to_sorted (ESorter *es, + gint row) { ETableSorter *ets = E_TABLE_SORTER (es); gint rows = e_table_model_row_count (ets->source); @@ -408,7 +432,8 @@ ets_model_to_sorted (ESorter *es, gint row) } static gint -ets_sorted_to_model (ESorter *es, gint row) +ets_sorted_to_model (ESorter *es, + gint row) { ETableSorter *ets = E_TABLE_SORTER (es); gint rows = e_table_model_row_count (ets->source); @@ -426,7 +451,9 @@ ets_sorted_to_model (ESorter *es, gint row) } static void -ets_get_model_to_sorted_array (ESorter *es, gint **array, gint *count) +ets_get_model_to_sorted_array (ESorter *es, + gint **array, + gint *count) { ETableSorter *ets = E_TABLE_SORTER (es); if (array || count) { @@ -440,7 +467,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) +ets_get_sorted_to_model_array (ESorter *es, + gint **array, + gint *count) { ETableSorter *ets = E_TABLE_SORTER (es); if (array || count) { diff --git a/widgets/table/e-table-sorting-utils.c b/widgets/table/e-table-sorting-utils.c index e654f94b9c..a94c45f7b0 100644 --- a/widgets/table/e-table-sorting-utils.c +++ b/widgets/table/e-table-sorting-utils.c @@ -35,7 +35,12 @@ /* 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); @@ -84,7 +89,9 @@ 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; @@ -111,7 +118,11 @@ 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; @@ -158,9 +169,9 @@ e_table_sorting_utils_sort (ETableModel *source, ETableSortInfo *sort_info, ETab } gboolean -e_table_sorting_utils_affects_sort (ETableSortInfo *sort_info, - ETableHeader *full_header, - gint col) +e_table_sorting_utils_affects_sort (ETableSortInfo *sort_info, + ETableHeader *full_header, + gint col) { gint j; gint cols; @@ -186,7 +197,12 @@ 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 (); @@ -203,7 +219,12 @@ e_table_sorting_utils_insert (ETableModel *source, ETableSortInfo *sort_info, ET /* FIXME: This could be done in time log n instead of time n with a binary search. */ gint -e_table_sorting_utils_check_position (ETableModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, gint *map_table, gint rows, gint view_row) +e_table_sorting_utils_check_position (ETableModel *source, + ETableSortInfo *sort_info, + ETableHeader *full_header, + gint *map_table, + gint rows, + gint view_row) { gint i; gint row; @@ -231,7 +252,12 @@ 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); @@ -257,7 +283,9 @@ etsu_tree_compare (ETreeModel *source, ETableSortInfo *sort_info, ETableHeader * } 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; @@ -267,7 +295,11 @@ e_sort_tree_callback (gconstpointer data1, gconstpointer data2, gpointer user_da } 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; @@ -331,7 +363,12 @@ e_table_sorting_utils_tree_sort (ETreeModel *source, 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_tree_check_position (ETreeModel *source, ETableSortInfo *sort_info, ETableHeader *full_header, ETreePath *map_table, gint count, gint old_index) +e_table_sorting_utils_tree_check_position (ETreeModel *source, + ETableSortInfo *sort_info, + ETableHeader *full_header, + ETreePath *map_table, + gint count, + gint old_index) { gint i; ETreePath path; @@ -357,7 +394,12 @@ 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; @@ -418,7 +460,9 @@ e_table_sorting_utils_free_cmp_cache (gpointer cmp_cache) * Note: Given @value will be stolen and later freed with g_free. **/ void -e_table_sorting_utils_add_to_cmp_cache (gpointer cmp_cache, const gchar *key, gchar *value) +e_table_sorting_utils_add_to_cmp_cache (gpointer cmp_cache, + const gchar *key, + gchar *value) { g_return_if_fail (cmp_cache != NULL); g_return_if_fail (key != NULL); @@ -436,7 +480,8 @@ e_table_sorting_utils_add_to_cmp_cache (gpointer cmp_cache, const gchar *key, gc * with a key. **/ const gchar * -e_table_sorting_utils_lookup_cmp_cache (gpointer cmp_cache, const gchar *key) +e_table_sorting_utils_lookup_cmp_cache (gpointer cmp_cache, + const gchar *key) { g_return_val_if_fail (key != NULL, NULL); diff --git a/widgets/table/e-table-specification.c b/widgets/table/e-table-specification.c index 76c268ad11..03f0e4503b 100644 --- a/widgets/table/e-table-specification.c +++ b/widgets/table/e-table-specification.c @@ -129,7 +129,7 @@ e_table_specification_new (void) */ gboolean e_table_specification_load_from_file (ETableSpecification *specification, - const gchar *filename) + const gchar *filename) { xmlDoc *doc; @@ -156,7 +156,7 @@ e_table_specification_load_from_file (ETableSpecification *specification, */ gboolean e_table_specification_load_from_string (ETableSpecification *specification, - const gchar *xml) + const gchar *xml) { xmlDoc *doc; doc = xmlParseMemory ( (gchar *) xml, strlen (xml)); @@ -180,7 +180,7 @@ e_table_specification_load_from_string (ETableSpecification *specification, */ void e_table_specification_load_from_node (ETableSpecification *specification, - const xmlNode *node) + const xmlNode *node) { gchar *temp; xmlNode *children; @@ -285,7 +285,7 @@ e_table_specification_load_from_node (ETableSpecification *specification, */ gint e_table_specification_save_to_file (ETableSpecification *specification, - const gchar *filename) + const gchar *filename) { xmlDoc *doc; gint ret; @@ -349,7 +349,7 @@ e_table_specification_save_to_string (ETableSpecification *specification) */ xmlNode * e_table_specification_save_to_node (ETableSpecification *specification, - xmlDoc *doc) + xmlDoc *doc) { xmlNode *node; const gchar *s; diff --git a/widgets/table/e-table-state.c b/widgets/table/e-table-state.c index 0bb311b8c4..785c807442 100644 --- a/widgets/table/e-table-state.c +++ b/widgets/table/e-table-state.c @@ -116,8 +116,8 @@ e_table_state_vanilla (gint col_count) } gboolean -e_table_state_load_from_file (ETableState *state, - const gchar *filename) +e_table_state_load_from_file (ETableState *state, + const gchar *filename) { xmlDoc *doc; @@ -135,8 +135,8 @@ e_table_state_load_from_file (ETableState *state, } void -e_table_state_load_from_string (ETableState *state, - const gchar *xml) +e_table_state_load_from_string (ETableState *state, + const gchar *xml) { xmlDoc *doc; @@ -158,7 +158,7 @@ typedef struct { void e_table_state_load_from_node (ETableState *state, - const xmlNode *node) + const xmlNode *node) { xmlNode *children; GList *list = NULL, *iterator; @@ -215,8 +215,8 @@ e_table_state_load_from_node (ETableState *state, } void -e_table_state_save_to_file (ETableState *state, - const gchar *filename) +e_table_state_save_to_file (ETableState *state, + const gchar *filename) { xmlDoc *doc; @@ -231,7 +231,7 @@ e_table_state_save_to_file (ETableState *state, } gchar * -e_table_state_save_to_string (ETableState *state) +e_table_state_save_to_string (ETableState *state) { gchar *ret_val; xmlChar *string; @@ -251,8 +251,8 @@ e_table_state_save_to_string (ETableState *state) } xmlNode * -e_table_state_save_to_node (ETableState *state, - xmlNode *parent) +e_table_state_save_to_node (ETableState *state, + xmlNode *parent) { gint i; xmlNode *node; diff --git a/widgets/table/e-table-subset-variable.c b/widgets/table/e-table-subset-variable.c index 99fed4ba02..a40859b492 100644 --- a/widgets/table/e-table-subset-variable.c +++ b/widgets/table/e-table-subset-variable.c @@ -40,8 +40,8 @@ G_DEFINE_TYPE (ETableSubsetVariable, etssv, E_TYPE_TABLE_SUBSET) #define INCREMENT_AMOUNT 10 static void -etssv_add (ETableSubsetVariable *etssv, - gint row) +etssv_add (ETableSubsetVariable *etssv, + gint row) { ETableModel *etm = E_TABLE_MODEL (etssv); ETableSubset *etss = E_TABLE_SUBSET (etssv); @@ -62,8 +62,8 @@ etssv_add (ETableSubsetVariable *etssv, static void etssv_add_array (ETableSubsetVariable *etssv, - const gint *array, - gint count) + const gint *array, + gint count) { ETableModel *etm = E_TABLE_MODEL (etssv); ETableSubset *etss = E_TABLE_SUBSET (etssv); @@ -84,7 +84,7 @@ etssv_add_array (ETableSubsetVariable *etssv, } static void -etssv_add_all (ETableSubsetVariable *etssv) +etssv_add_all (ETableSubsetVariable *etssv) { ETableModel *etm = E_TABLE_MODEL (etssv); ETableSubset *etss = E_TABLE_SUBSET (etssv); @@ -107,8 +107,8 @@ etssv_add_all (ETableSubsetVariable *etssv) } static gboolean -etssv_remove (ETableSubsetVariable *etssv, - gint row) +etssv_remove (ETableSubsetVariable *etssv, + gint row) { ETableModel *etm = E_TABLE_MODEL (etssv); ETableSubset *etss = E_TABLE_SUBSET (etssv); @@ -147,7 +147,7 @@ etssv_init (ETableSubsetVariable *etssv) ETableModel * e_table_subset_variable_construct (ETableSubsetVariable *etssv, - ETableModel *source) + ETableModel *source) { if (e_table_subset_construct (E_TABLE_SUBSET (etssv), source, 1) == NULL) return NULL; @@ -170,8 +170,8 @@ e_table_subset_variable_new (ETableModel *source) } void -e_table_subset_variable_add (ETableSubsetVariable *etssv, - gint row) +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)); @@ -181,9 +181,9 @@ e_table_subset_variable_add (ETableSubsetVariable *etssv, } void -e_table_subset_variable_add_array (ETableSubsetVariable *etssv, - const gint *array, - gint count) +e_table_subset_variable_add_array (ETableSubsetVariable *etssv, + const gint *array, + gint count) { g_return_if_fail (etssv != NULL); g_return_if_fail (E_IS_TABLE_SUBSET_VARIABLE (etssv)); @@ -193,7 +193,7 @@ e_table_subset_variable_add_array (ETableSubsetVariable *etssv, } void -e_table_subset_variable_add_all (ETableSubsetVariable *etssv) +e_table_subset_variable_add_all (ETableSubsetVariable *etssv) { g_return_if_fail (etssv != NULL); g_return_if_fail (E_IS_TABLE_SUBSET_VARIABLE (etssv)); @@ -203,8 +203,8 @@ e_table_subset_variable_add_all (ETableSubsetVariable *etssv) } gboolean -e_table_subset_variable_remove (ETableSubsetVariable *etssv, - gint row) +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); @@ -224,7 +224,7 @@ e_table_subset_variable_clear (ETableSubsetVariable *etssv) e_table_model_pre_change (etm); etss->n_map = 0; g_free (etss->map_table); - etss->map_table = (gint *) g_new (unsigned int, 1); + etss->map_table = (gint *) g_new (guint, 1); etssv->n_vals_allocated = 1; e_table_model_changed (etm); @@ -232,8 +232,8 @@ e_table_subset_variable_clear (ETableSubsetVariable *etssv) void e_table_subset_variable_increment (ETableSubsetVariable *etssv, - gint position, - gint amount) + gint position, + gint amount) { gint i; ETableSubset *etss = E_TABLE_SUBSET (etssv); @@ -245,8 +245,8 @@ e_table_subset_variable_increment (ETableSubsetVariable *etssv, void e_table_subset_variable_decrement (ETableSubsetVariable *etssv, - gint position, - gint amount) + gint position, + gint amount) { gint i; ETableSubset *etss = E_TABLE_SUBSET (etssv); @@ -258,7 +258,7 @@ e_table_subset_variable_decrement (ETableSubsetVariable *etssv, void e_table_subset_variable_set_allocation (ETableSubsetVariable *etssv, - gint total) + gint total) { ETableSubset *etss = E_TABLE_SUBSET (etssv); if (total <= 0) diff --git a/widgets/table/e-table-subset.c b/widgets/table/e-table-subset.c index 03871771f6..9a26020296 100644 --- a/widgets/table/e-table-subset.c +++ b/widgets/table/e-table-subset.c @@ -52,7 +52,8 @@ G_DEFINE_TYPE (ETableSubset, etss, E_TYPE_TABLE_MODEL) #define MAP_ROW(etss, row) (row == -1 ? -1 : etss->map_table[row]) static gint -etss_get_view_row (ETableSubset *etss, gint row) +etss_get_view_row (ETableSubset *etss, + gint row) { const gint n = etss->n_map; const gint * const map_table = etss->map_table; @@ -150,7 +151,9 @@ etss_row_count (ETableModel *etm) } static gpointer -etss_value_at (ETableModel *etm, gint col, gint row) +etss_value_at (ETableModel *etm, + gint col, + gint row) { ETableSubset *etss = (ETableSubset *) etm; @@ -162,7 +165,10 @@ etss_value_at (ETableModel *etm, gint col, gint row) } static void -etss_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) +etss_set_value_at (ETableModel *etm, + gint col, + gint row, + gconstpointer val) { ETableSubset *etss = (ETableSubset *) etm; @@ -174,7 +180,9 @@ etss_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) } static gboolean -etss_is_cell_editable (ETableModel *etm, gint col, gint row) +etss_is_cell_editable (ETableModel *etm, + gint col, + gint row) { ETableSubset *etss = (ETableSubset *) etm; @@ -190,7 +198,8 @@ etss_has_save_id (ETableModel *etm) } static gchar * -etss_get_save_id (ETableModel *etm, gint row) +etss_get_save_id (ETableModel *etm, + gint row) { ETableSubset *etss = (ETableSubset *) etm; @@ -203,14 +212,18 @@ etss_get_save_id (ETableModel *etm, gint row) } static void -etss_append_row (ETableModel *etm, ETableModel *source, gint row) +etss_append_row (ETableModel *etm, + ETableModel *source, + gint row) { ETableSubset *etss = (ETableSubset *) etm; e_table_model_append_row (etss->source, source, row); } static gpointer -etss_duplicate_value (ETableModel *etm, gint col, gconstpointer value) +etss_duplicate_value (ETableModel *etm, + gint col, + gconstpointer value) { ETableSubset *etss = (ETableSubset *) etm; @@ -218,7 +231,9 @@ etss_duplicate_value (ETableModel *etm, gint col, gconstpointer value) } static void -etss_free_value (ETableModel *etm, gint col, gpointer value) +etss_free_value (ETableModel *etm, + gint col, + gpointer value) { ETableSubset *etss = (ETableSubset *) etm; @@ -226,7 +241,8 @@ etss_free_value (ETableModel *etm, gint col, gpointer value) } static gpointer -etss_initialize_value (ETableModel *etm, gint col) +etss_initialize_value (ETableModel *etm, + gint col) { ETableSubset *etss = (ETableSubset *) etm; @@ -234,7 +250,9 @@ etss_initialize_value (ETableModel *etm, gint col) } static gboolean -etss_value_is_empty (ETableModel *etm, gint col, gconstpointer value) +etss_value_is_empty (ETableModel *etm, + gint col, + gconstpointer value) { ETableSubset *etss = (ETableSubset *) etm; @@ -242,7 +260,9 @@ etss_value_is_empty (ETableModel *etm, gint col, gconstpointer value) } static gchar * -etss_value_to_string (ETableModel *etm, gint col, gconstpointer value) +etss_value_to_string (ETableModel *etm, + gint col, + gconstpointer value) { ETableSubset *etss = (ETableSubset *) etm; @@ -291,25 +311,30 @@ etss_init (ETableSubset *etss) } static void -etss_proxy_model_pre_change_real (ETableSubset *etss, ETableModel *etm) +etss_proxy_model_pre_change_real (ETableSubset *etss, + ETableModel *etm) { e_table_model_pre_change (E_TABLE_MODEL (etss)); } static void -etss_proxy_model_no_change_real (ETableSubset *etss, ETableModel *etm) +etss_proxy_model_no_change_real (ETableSubset *etss, + ETableModel *etm) { e_table_model_no_change (E_TABLE_MODEL (etss)); } static void -etss_proxy_model_changed_real (ETableSubset *etss, ETableModel *etm) +etss_proxy_model_changed_real (ETableSubset *etss, + ETableModel *etm) { e_table_model_changed (E_TABLE_MODEL (etss)); } static void -etss_proxy_model_row_changed_real (ETableSubset *etss, ETableModel *etm, gint row) +etss_proxy_model_row_changed_real (ETableSubset *etss, + ETableModel *etm, + gint row) { gint view_row = etss_get_view_row (etss, row); if (view_row != -1) @@ -319,7 +344,10 @@ etss_proxy_model_row_changed_real (ETableSubset *etss, ETableModel *etm, gint ro } static void -etss_proxy_model_cell_changed_real (ETableSubset *etss, ETableModel *etm, gint col, gint row) +etss_proxy_model_cell_changed_real (ETableSubset *etss, + ETableModel *etm, + gint col, + gint row) { gint view_row = etss_get_view_row (etss, row); if (view_row != -1) @@ -329,68 +357,90 @@ etss_proxy_model_cell_changed_real (ETableSubset *etss, ETableModel *etm, gint c } static void -etss_proxy_model_rows_inserted_real (ETableSubset *etss, ETableModel *etm, gint row, gint count) +etss_proxy_model_rows_inserted_real (ETableSubset *etss, + ETableModel *etm, + gint row, + gint count) { e_table_model_no_change (E_TABLE_MODEL (etss)); } static void -etss_proxy_model_rows_deleted_real (ETableSubset *etss, ETableModel *etm, gint row, gint count) +etss_proxy_model_rows_deleted_real (ETableSubset *etss, + ETableModel *etm, + gint row, + gint count) { e_table_model_no_change (E_TABLE_MODEL (etss)); } static void -etss_proxy_model_pre_change (ETableModel *etm, ETableSubset *etss) +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); } static void -etss_proxy_model_no_change (ETableModel *etm, ETableSubset *etss) +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); } static void -etss_proxy_model_changed (ETableModel *etm, ETableSubset *etss) +etss_proxy_model_changed (ETableModel *etm, + ETableSubset *etss) { 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) +etss_proxy_model_row_changed (ETableModel *etm, + gint row, + ETableSubset *etss) { if (ETSS_CLASS (etss)->proxy_model_row_changed) (ETSS_CLASS (etss)->proxy_model_row_changed) (etss, etm, row); } static void -etss_proxy_model_cell_changed (ETableModel *etm, gint col, gint row, ETableSubset *etss) +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); } static void -etss_proxy_model_rows_inserted (ETableModel *etm, gint row, gint col, ETableSubset *etss) +etss_proxy_model_rows_inserted (ETableModel *etm, + gint row, + gint col, + ETableSubset *etss) { if (ETSS_CLASS (etss)->proxy_model_rows_inserted) (ETSS_CLASS (etss)->proxy_model_rows_inserted) (etss, etm, row, col); } static void -etss_proxy_model_rows_deleted (ETableModel *etm, gint row, gint col, ETableSubset *etss) +etss_proxy_model_rows_deleted (ETableModel *etm, + gint row, + gint col, + ETableSubset *etss) { if (ETSS_CLASS (etss)->proxy_model_rows_deleted) (ETSS_CLASS (etss)->proxy_model_rows_deleted) (etss, etm, row, col); } ETableModel * -e_table_subset_construct (ETableSubset *etss, ETableModel *source, gint nvals) +e_table_subset_construct (ETableSubset *etss, + ETableModel *source, + gint nvals) { guint *buffer; gint i; @@ -410,26 +460,34 @@ e_table_subset_construct (ETableSubset *etss, ETableModel *source, gint nvals) for (i = 0; i < nvals; 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); - etss->table_model_no_change_id = g_signal_connect (G_OBJECT (source), "model_no_change", - G_CALLBACK (etss_proxy_model_no_change), etss); - etss->table_model_changed_id = g_signal_connect (G_OBJECT (source), "model_changed", - G_CALLBACK (etss_proxy_model_changed), etss); - etss->table_model_row_changed_id = g_signal_connect (G_OBJECT (source), "model_row_changed", - G_CALLBACK (etss_proxy_model_row_changed), etss); - etss->table_model_cell_changed_id = g_signal_connect (G_OBJECT (source), "model_cell_changed", - G_CALLBACK (etss_proxy_model_cell_changed), etss); - etss->table_model_rows_inserted_id = g_signal_connect (G_OBJECT (source), "model_rows_inserted", - G_CALLBACK (etss_proxy_model_rows_inserted), etss); - etss->table_model_rows_deleted_id = g_signal_connect (G_OBJECT (source), "model_rows_deleted", - G_CALLBACK (etss_proxy_model_rows_deleted), etss); + etss->table_model_pre_change_id = g_signal_connect ( + source, "model_pre_change", + G_CALLBACK (etss_proxy_model_pre_change), etss); + etss->table_model_no_change_id = g_signal_connect ( + source, "model_no_change", + G_CALLBACK (etss_proxy_model_no_change), etss); + etss->table_model_changed_id = g_signal_connect ( + source, "model_changed", + G_CALLBACK (etss_proxy_model_changed), etss); + etss->table_model_row_changed_id = g_signal_connect ( + source, "model_row_changed", + G_CALLBACK (etss_proxy_model_row_changed), etss); + etss->table_model_cell_changed_id = g_signal_connect ( + source, "model_cell_changed", + G_CALLBACK (etss_proxy_model_cell_changed), etss); + etss->table_model_rows_inserted_id = g_signal_connect ( + source, "model_rows_inserted", + G_CALLBACK (etss_proxy_model_rows_inserted), etss); + etss->table_model_rows_deleted_id = g_signal_connect ( + source, "model_rows_deleted", + G_CALLBACK (etss_proxy_model_rows_deleted), etss); return E_TABLE_MODEL (etss); } ETableModel * -e_table_subset_new (ETableModel *source, const gint nvals) +e_table_subset_new (ETableModel *source, + const gint nvals) { ETableSubset *etss = g_object_new (E_TYPE_TABLE_SUBSET, NULL); @@ -442,8 +500,8 @@ e_table_subset_new (ETableModel *source, const gint nvals) } gint -e_table_subset_model_to_view_row (ETableSubset *ets, - gint model_row) +e_table_subset_model_to_view_row (ETableSubset *ets, + gint model_row) { gint i; for (i = 0; i < ets->n_map; i++) { @@ -454,8 +512,8 @@ e_table_subset_model_to_view_row (ETableSubset *ets, } gint -e_table_subset_view_to_model_row (ETableSubset *ets, - gint view_row) +e_table_subset_view_to_model_row (ETableSubset *ets, + gint view_row) { if (view_row >= 0 && view_row < ets->n_map) return ets->map_table[view_row]; @@ -476,7 +534,7 @@ e_table_subset_get_toplevel (ETableSubset *table) } void -e_table_subset_print_debugging (ETableSubset *table_model) +e_table_subset_print_debugging (ETableSubset *table_model) { gint i; for (i = 0; i < table_model->n_map; i++) { diff --git a/widgets/table/e-table-utils.c b/widgets/table/e-table-utils.c index d84b244fdf..007803585e 100644 --- a/widgets/table/e-table-utils.c +++ b/widgets/table/e-table-utils.c @@ -81,8 +81,8 @@ e_table_state_to_header (GtkWidget *widget, static ETableCol * et_col_spec_to_col (ETableColumnSpecification *col_spec, - ETableExtras *ete, - const gchar *domain) + ETableExtras *ete, + const gchar *domain) { ETableCol *col = NULL; ECell *cell = NULL; @@ -146,7 +146,7 @@ et_col_spec_to_col (ETableColumnSpecification *col_spec, ETableHeader * e_table_spec_to_full_header (ETableSpecification *spec, - ETableExtras *ete) + ETableExtras *ete) { ETableHeader *nh; gint column; @@ -170,7 +170,8 @@ e_table_spec_to_full_header (ETableSpecification *spec, } static gboolean -check_col (ETableCol *col, gpointer user_data) +check_col (ETableCol *col, + gpointer user_data) { return col->search ? TRUE : FALSE; } diff --git a/widgets/table/e-table-without.c b/widgets/table/e-table-without.c index 59d254c862..785feb456b 100644 --- a/widgets/table/e-table-without.c +++ b/widgets/table/e-table-without.c @@ -53,7 +53,8 @@ struct _ETableWithoutPrivate { }; static gboolean -check (ETableWithout *etw, gint model_row) +check (ETableWithout *etw, + gint model_row) { gboolean ret_val; gpointer key; @@ -70,7 +71,9 @@ check (ETableWithout *etw, gint model_row) } static gboolean -check_with_key (ETableWithout *etw, gpointer key, gint model_row) +check_with_key (ETableWithout *etw, + gpointer key, + gint model_row) { gboolean ret_val; gpointer key2; @@ -90,14 +93,16 @@ check_with_key (ETableWithout *etw, gpointer key, gint model_row) } static gint -etw_view_to_model_row (ETableWithout *etw, gint view_row) +etw_view_to_model_row (ETableWithout *etw, + gint view_row) { ETableSubset *etss = E_TABLE_SUBSET (etw); return etss->map_table[view_row]; } static void -add_row (ETableWithout *etw, gint model_row) +add_row (ETableWithout *etw, + gint model_row) { ETableSubset *etss = E_TABLE_SUBSET (etw); @@ -111,7 +116,8 @@ add_row (ETableWithout *etw, gint model_row) } static void -remove_row (ETableWithout *etw, gint view_row) +remove_row (ETableWithout *etw, + gint view_row) { ETableSubset *etss = E_TABLE_SUBSET (etw); @@ -126,8 +132,8 @@ remove_row (ETableWithout *etw, gint view_row) static void delete_hash_element (gpointer key, - gpointer value, - gpointer closure) + gpointer value, + gpointer closure) { ETableWithout *etw = closure; if (etw->priv->free_duplicated_key_func) @@ -209,7 +215,8 @@ etw_proxy_model_rows_deleted (ETableSubset *etss, } static void -etw_proxy_model_changed (ETableSubset *etss, ETableModel *etm) +etw_proxy_model_changed (ETableSubset *etss, + ETableModel *etm) { gint i; /* Model row */ gint j; /* View row */ @@ -256,15 +263,15 @@ etw_init (ETableWithout *etw) } ETableModel * -e_table_without_construct (ETableWithout *etw, - ETableModel *source, - GHashFunc hash_func, - GCompareFunc compare_func, - ETableWithoutGetKeyFunc get_key_func, - ETableWithoutDuplicateKeyFunc duplicate_key_func, - ETableWithoutFreeKeyFunc free_gotten_key_func, - ETableWithoutFreeKeyFunc free_duplicated_key_func, - void *closure) +e_table_without_construct (ETableWithout *etw, + ETableModel *source, + GHashFunc hash_func, + GCompareFunc compare_func, + ETableWithoutGetKeyFunc get_key_func, + ETableWithoutDuplicateKeyFunc duplicate_key_func, + ETableWithoutFreeKeyFunc free_gotten_key_func, + ETableWithoutFreeKeyFunc free_duplicated_key_func, + gpointer closure) { if (e_table_subset_construct (E_TABLE_SUBSET (etw), source, 1) == NULL) return NULL; @@ -284,14 +291,14 @@ e_table_without_construct (ETableWithout *etw, } ETableModel * -e_table_without_new (ETableModel *source, - GHashFunc hash_func, - GCompareFunc compare_func, - ETableWithoutGetKeyFunc get_key_func, - ETableWithoutDuplicateKeyFunc duplicate_key_func, - ETableWithoutFreeKeyFunc free_gotten_key_func, - ETableWithoutFreeKeyFunc free_duplicated_key_func, - void *closure) +e_table_without_new (ETableModel *source, + GHashFunc hash_func, + GCompareFunc compare_func, + ETableWithoutGetKeyFunc get_key_func, + ETableWithoutDuplicateKeyFunc duplicate_key_func, + ETableWithoutFreeKeyFunc free_gotten_key_func, + ETableWithoutFreeKeyFunc free_duplicated_key_func, + gpointer closure) { ETableWithout *etw = g_object_new (E_TYPE_TABLE_WITHOUT, NULL); @@ -312,8 +319,9 @@ e_table_without_new (ETableModel *source, return (ETableModel *) etw; } -void e_table_without_hide (ETableWithout *etw, - void *key) +void +e_table_without_hide (ETableWithout *etw, + gpointer key) { gint i; /* View row */ ETableSubset *etss = E_TABLE_SUBSET (etw); @@ -331,8 +339,9 @@ void e_table_without_hide (ETableWithout *etw, } /* An adopted key will later be freed using the free_duplicated_key function. */ -void e_table_without_hide_adopt (ETableWithout *etw, - void *key) +void +e_table_without_hide_adopt (ETableWithout *etw, + gpointer key) { gint i; /* View row */ ETableSubset *etss = E_TABLE_SUBSET (etw); @@ -347,8 +356,8 @@ void e_table_without_hide_adopt (ETableWithout *etw, } void -e_table_without_show (ETableWithout *etw, - void *key) +e_table_without_show (ETableWithout *etw, + gpointer key) { gint i; /* Model row */ ETableSubset *etss = E_TABLE_SUBSET (etw); @@ -372,7 +381,7 @@ e_table_without_show (ETableWithout *etw, } void -e_table_without_show_all (ETableWithout *etw) +e_table_without_show_all (ETableWithout *etw) { gint i; /* Model row */ gint row_count; diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c index f755cbc451..472681796f 100644 --- a/widgets/table/e-table.c +++ b/widgets/table/e-table.c @@ -232,7 +232,9 @@ current_search_col (ETable *et) } static void -et_get_preferred_width (GtkWidget *widget, gint *minimum, gint *natural) +et_get_preferred_width (GtkWidget *widget, + gint *minimum, + gint *natural) { ETable *et = E_TABLE (widget); @@ -246,7 +248,9 @@ et_get_preferred_width (GtkWidget *widget, gint *minimum, gint *natural) } static void -et_get_preferred_height (GtkWidget *widget, gint *minimum, gint *natural) +et_get_preferred_height (GtkWidget *widget, + gint *minimum, + gint *natural) { GTK_WIDGET_CLASS (e_table_parent_class)-> get_preferred_height (widget, minimum, natural); @@ -262,7 +266,8 @@ set_header_width (ETable *et) } static void -structure_changed (ETableHeader *header, ETable *et) +structure_changed (ETableHeader *header, + ETable *et) { e_table_state_change (et); set_header_width (et); @@ -270,14 +275,17 @@ structure_changed (ETableHeader *header, ETable *et) } static void -expansion_changed (ETableHeader *header, ETable *et) +expansion_changed (ETableHeader *header, + ETable *et) { e_table_state_change (et); set_header_width (et); } static void -dimension_changed (ETableHeader *header, gint total_width, ETable *et) +dimension_changed (ETableHeader *header, + gint total_width, + ETable *et) { set_header_width (et); } @@ -303,7 +311,8 @@ disconnect_header (ETable *e_table) } static void -connect_header (ETable *e_table, ETableState *state) +connect_header (ETable *e_table, + ETableState *state) { if (e_table->header != NULL) disconnect_header (e_table); @@ -311,15 +320,15 @@ connect_header (ETable *e_table, ETableState *state) e_table->header = e_table_state_to_header ( GTK_WIDGET (e_table), e_table->full_header, state); - e_table->structure_change_id = - g_signal_connect (G_OBJECT (e_table->header), "structure_change", - G_CALLBACK (structure_changed), e_table); - e_table->expansion_change_id = - g_signal_connect (G_OBJECT (e_table->header), "expansion_change", - G_CALLBACK (expansion_changed), e_table); - e_table->dimension_change_id = - g_signal_connect (G_OBJECT (e_table->header), "dimension_change", - G_CALLBACK (dimension_changed), e_table); + e_table->structure_change_id = g_signal_connect ( + e_table->header, "structure_change", + G_CALLBACK (structure_changed), e_table); + e_table->expansion_change_id = g_signal_connect ( + e_table->header, "expansion_change", + G_CALLBACK (expansion_changed), e_table); + e_table->dimension_change_id = g_signal_connect ( + e_table->header, "dimension_change", + G_CALLBACK (dimension_changed), e_table); } static void @@ -499,7 +508,8 @@ et_search_search (ETableSearch *search, } static void -et_search_accept (ETableSearch *search, ETable *et) +et_search_accept (ETableSearch *search, + ETable *et) { gint cursor; ETableCol *col = current_search_col (et); @@ -521,12 +531,12 @@ init_search (ETable *e_table) e_table->search = e_table_search_new (); - e_table->search_search_id = - g_signal_connect (G_OBJECT (e_table->search), "search", - G_CALLBACK (et_search_search), e_table); - e_table->search_accept_id = - g_signal_connect (G_OBJECT (e_table->search), "accept", - G_CALLBACK (et_search_accept), e_table); + e_table->search_search_id = g_signal_connect ( + e_table->search, "search", + G_CALLBACK (et_search_search), e_table); + e_table->search_accept_id = g_signal_connect ( + e_table->search, "accept", + G_CALLBACK (et_search_accept), e_table); } static void @@ -610,7 +620,8 @@ et_grab_focus (GtkWidget *widget) /* Focus handler for the ETable */ static gint -et_focus (GtkWidget *container, GtkDirectionType direction) +et_focus (GtkWidget *container, + GtkDirectionType direction) { ETable *e_table; @@ -647,7 +658,9 @@ set_header_canvas_width (ETable *e_table) } static void -header_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, ETable *e_table) +header_canvas_size_allocate (GtkWidget *widget, + GtkAllocation *alloc, + ETable *e_table) { GtkAllocation allocation; @@ -657,9 +670,9 @@ header_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, ETable *e_ GTK_WIDGET (e_table->header_canvas), &allocation); /* When the header item is created ->height == 0, - as the font is only created when everything is realized. - So we set the usize here as well, so that the size of the - header is correct */ + * as the font is only created when everything is realized. + * So we set the usize here as well, so that the size of the + * header is correct */ if (allocation.height != E_TABLE_HEADER_ITEM (e_table->header_item)->height) g_object_set ( e_table->header_canvas, "height-request", @@ -668,7 +681,8 @@ header_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, ETable *e_ } static void -group_info_changed (ETableSortInfo *info, ETable *et) +group_info_changed (ETableSortInfo *info, + ETable *et) { gboolean will_be_grouped = e_table_sort_info_grouping_get_count (info) > 0; clear_current_search_col (et); @@ -684,7 +698,8 @@ group_info_changed (ETableSortInfo *info, ETable *et) } static void -sort_info_changed (ETableSortInfo *info, ETable *et) +sort_info_changed (ETableSortInfo *info, + ETable *et) { clear_current_search_col (et); e_table_state_change (et); @@ -751,8 +766,9 @@ table_canvas_reflow_idle (ETable *e_table) } static void -table_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, - ETable *e_table) +table_canvas_size_allocate (GtkWidget *widget, + GtkAllocation *alloc, + ETable *e_table) { gdouble width; gdouble height; @@ -782,7 +798,8 @@ table_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, } static void -table_canvas_reflow (GnomeCanvas *canvas, ETable *e_table) +table_canvas_reflow (GnomeCanvas *canvas, + ETable *e_table) { if (!e_table->reflow_idle_id) e_table->reflow_idle_id = g_idle_add_full ( @@ -791,7 +808,10 @@ table_canvas_reflow (GnomeCanvas *canvas, ETable *e_table) } static void -click_to_add_cursor_change (ETableClickToAdd *etcta, gint row, gint col, ETable *et) +click_to_add_cursor_change (ETableClickToAdd *etcta, + gint row, + gint col, + ETable *et) { if (et->cursor_loc == E_TABLE_CURSOR_LOC_TABLE) { e_selection_model_clear (E_SELECTION_MODEL (et->selection)); @@ -800,7 +820,9 @@ click_to_add_cursor_change (ETableClickToAdd *etcta, gint row, gint col, ETable } static void -group_cursor_change (ETableGroup *etg, gint row, ETable *et) +group_cursor_change (ETableGroup *etg, + gint row, + ETable *et) { ETableCursorLoc old_cursor_loc; @@ -814,19 +836,29 @@ group_cursor_change (ETableGroup *etg, gint row, ETable *et) } static void -group_cursor_activated (ETableGroup *etg, gint row, ETable *et) +group_cursor_activated (ETableGroup *etg, + gint row, + ETable *et) { g_signal_emit (G_OBJECT (et), et_signals[CURSOR_ACTIVATED], 0, row); } static void -group_double_click (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable *et) +group_double_click (ETableGroup *etg, + gint row, + gint col, + GdkEvent *event, + ETable *et) { g_signal_emit (G_OBJECT (et), et_signals[DOUBLE_CLICK], 0, row, col, event); } static gboolean -group_right_click (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable *et) +group_right_click (ETableGroup *etg, + gint row, + gint col, + GdkEvent *event, + ETable *et) { gboolean return_val = FALSE; @@ -838,7 +870,11 @@ group_right_click (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable } static gboolean -group_click (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable *et) +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); @@ -846,7 +882,11 @@ group_click (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable *et) } static gboolean -group_key_press (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable *et) +group_key_press (ETableGroup *etg, + gint row, + gint col, + GdkEvent *event, + ETable *et) { gboolean return_val = FALSE; GdkEventKey *key = (GdkEventKey *) event; @@ -923,7 +963,11 @@ group_key_press (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable * } static gboolean -group_start_drag (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable *et) +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, @@ -932,7 +976,8 @@ group_start_drag (ETableGroup *etg, gint row, gint col, GdkEvent *event, ETable } static void -et_table_model_changed (ETableModel *model, ETable *et) +et_table_model_changed (ETableModel *model, + ETable *et) { et->need_rebuild = TRUE; if (!et->rebuild_idle_id) { @@ -943,7 +988,9 @@ et_table_model_changed (ETableModel *model, ETable *et) } static void -et_table_row_changed (ETableModel *table_model, gint row, ETable *et) +et_table_row_changed (ETableModel *table_model, + gint row, + ETable *et) { if (!et->need_rebuild) { if (e_table_group_remove (et->group, row)) @@ -953,13 +1000,19 @@ et_table_row_changed (ETableModel *table_model, gint row, ETable *et) } static void -et_table_cell_changed (ETableModel *table_model, gint view_col, gint row, ETable *et) +et_table_cell_changed (ETableModel *table_model, + gint view_col, + gint row, + ETable *et) { et_table_row_changed (table_model, row, et); } static void -et_table_rows_inserted (ETableModel *table_model, gint row, gint count, ETable *et) +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); @@ -974,7 +1027,10 @@ et_table_rows_inserted (ETableModel *table_model, gint row, gint count, ETable * } static void -et_table_rows_deleted (ETableModel *table_model, gint row, gint count, ETable *et) +et_table_rows_deleted (ETableModel *table_model, + gint row, + gint count, + ETable *et) { gint row_count = e_table_model_row_count (table_model); if (!et->need_rebuild) { @@ -1022,20 +1078,27 @@ et_build_groups (ETable *et) "selection_model", et->selection, NULL); - g_signal_connect (G_OBJECT (et->group), "cursor_change", - G_CALLBACK (group_cursor_change), et); - g_signal_connect (G_OBJECT (et->group), "cursor_activated", - G_CALLBACK (group_cursor_activated), et); - g_signal_connect (G_OBJECT (et->group), "double_click", - G_CALLBACK (group_double_click), et); - g_signal_connect (G_OBJECT (et->group), "right_click", - G_CALLBACK (group_right_click), et); - g_signal_connect (G_OBJECT (et->group), "click", - G_CALLBACK (group_click), et); - g_signal_connect (G_OBJECT (et->group), "key_press", - G_CALLBACK (group_key_press), et); - g_signal_connect (G_OBJECT (et->group), "start_drag", - G_CALLBACK (group_start_drag), et); + g_signal_connect ( + et->group, "cursor_change", + G_CALLBACK (group_cursor_change), et); + g_signal_connect ( + et->group, "cursor_activated", + G_CALLBACK (group_cursor_activated), et); + g_signal_connect ( + et->group, "double_click", + G_CALLBACK (group_double_click), et); + g_signal_connect ( + et->group, "right_click", + G_CALLBACK (group_right_click), et); + g_signal_connect ( + et->group, "click", + G_CALLBACK (group_click), et); + g_signal_connect ( + et->group, "key_press", + G_CALLBACK (group_key_press), et); + g_signal_connect ( + et->group, "start_drag", + G_CALLBACK (group_start_drag), et); if (!(et->is_grouped) && was_grouped) et_disconnect_model (et); @@ -1102,7 +1165,8 @@ changed_idle (gpointer data) } static void -et_canvas_realize (GtkWidget *canvas, ETable *e_table) +et_canvas_realize (GtkWidget *canvas, + ETable *e_table) { GtkWidget *widget; GtkStyle *style; @@ -1120,7 +1184,9 @@ et_canvas_realize (GtkWidget *canvas, ETable *e_table) } static gboolean -white_item_event (GnomeCanvasItem *white_item, GdkEvent *event, ETable *e_table) +white_item_event (GnomeCanvasItem *white_item, + GdkEvent *event, + ETable *e_table) { gboolean return_val = 0; g_signal_emit (G_OBJECT (e_table), et_signals[WHITE_SPACE_EVENT], 0, @@ -1143,7 +1209,9 @@ et_eti_leave_edit (ETable *et) } static gint -et_canvas_root_event (GnomeCanvasItem *root, GdkEvent *event, ETable *e_table) +et_canvas_root_event (GnomeCanvasItem *root, + GdkEvent *event, + ETable *e_table) { switch (event->type) { case GDK_BUTTON_PRESS: @@ -1188,7 +1256,9 @@ focus_first_etable_item (ETableGroup *group) * always, and also give the focus to some ETableItem if we get focused. */ static gint -table_canvas_focus_event_cb (GtkWidget *widget, GdkEventFocus *event, gpointer data) +table_canvas_focus_event_cb (GtkWidget *widget, + GdkEventFocus *event, + gpointer data) { GnomeCanvas *canvas; ECanvas *ecanvas; @@ -1232,7 +1302,9 @@ table_canvas_focus_event_cb (GtkWidget *widget, GdkEventFocus *event, gpointer d } static gboolean -canvas_vbox_event (ECanvasVbox *vbox, GdkEventKey *key, ETable *etable) +canvas_vbox_event (ECanvasVbox *vbox, + GdkEventKey *key, + ETable *etable) { if (key->type != GDK_KEY_PRESS && key->type != GDK_KEY_RELEASE) { @@ -1254,7 +1326,9 @@ canvas_vbox_event (ECanvasVbox *vbox, GdkEventKey *key, ETable *etable) } static gboolean -click_to_add_event (ETableClickToAdd *etcta, GdkEventKey *key, ETable *etable) +click_to_add_event (ETableClickToAdd *etcta, + GdkEventKey *key, + ETable *etable) { if (key->type != GDK_KEY_PRESS && key->type != GDK_KEY_RELEASE) { @@ -1284,50 +1358,53 @@ click_to_add_event (ETableClickToAdd *etcta, GdkEventKey *key, ETable *etable) } static void -e_table_setup_table (ETable *e_table, ETableHeader *full_header, ETableHeader *header, - ETableModel *model) +e_table_setup_table (ETable *e_table, + ETableHeader *full_header, + ETableHeader *header, + ETableModel *model) { GtkWidget *widget; GtkStyle *style; e_table->table_canvas = GNOME_CANVAS (e_canvas_new ()); g_signal_connect ( - G_OBJECT (e_table->table_canvas), "size_allocate", + e_table->table_canvas, "size_allocate", G_CALLBACK (table_canvas_size_allocate), e_table); g_signal_connect ( - G_OBJECT (e_table->table_canvas), "focus_in_event", + e_table->table_canvas, "focus_in_event", G_CALLBACK (table_canvas_focus_event_cb), e_table); g_signal_connect ( - G_OBJECT (e_table->table_canvas), "focus_out_event", + e_table->table_canvas, "focus_out_event", G_CALLBACK (table_canvas_focus_event_cb), e_table); g_signal_connect ( - G_OBJECT (e_table), "drag_begin", + e_table, "drag_begin", G_CALLBACK (et_drag_begin), e_table); g_signal_connect ( - G_OBJECT (e_table), "drag_end", + e_table, "drag_end", G_CALLBACK (et_drag_end), e_table); g_signal_connect ( - G_OBJECT (e_table), "drag_data_get", + e_table, "drag_data_get", G_CALLBACK (et_drag_data_get), e_table); g_signal_connect ( - G_OBJECT (e_table), "drag_data_delete", + e_table, "drag_data_delete", G_CALLBACK (et_drag_data_delete), e_table); g_signal_connect ( - G_OBJECT (e_table), "drag_motion", + e_table, "drag_motion", G_CALLBACK (et_drag_motion), e_table); g_signal_connect ( - G_OBJECT (e_table), "drag_leave", + e_table, "drag_leave", G_CALLBACK (et_drag_leave), e_table); g_signal_connect ( - G_OBJECT (e_table), "drag_drop", + e_table, "drag_drop", G_CALLBACK (et_drag_drop), e_table); g_signal_connect ( - G_OBJECT (e_table), "drag_data_received", + e_table, "drag_data_received", G_CALLBACK (et_drag_data_received), e_table); - g_signal_connect (G_OBJECT(e_table->table_canvas), "reflow", - G_CALLBACK (table_canvas_reflow), e_table); + g_signal_connect ( + e_table->table_canvas, "reflow", + G_CALLBACK (table_canvas_reflow), e_table); widget = GTK_WIDGET (e_table->table_canvas); style = gtk_widget_get_style (widget); @@ -1340,14 +1417,17 @@ e_table_setup_table (ETable *e_table, ETableHeader *full_header, ETableHeader *h "fill_color_gdk", &style->base[GTK_STATE_NORMAL], NULL); - g_signal_connect (G_OBJECT (e_table->white_item), "event", - G_CALLBACK (white_item_event), e_table); + g_signal_connect ( + e_table->white_item, "event", + 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_signal_connect ( + e_table->table_canvas, "realize", + 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_signal_connect ( + gnome_canvas_root (e_table->table_canvas), "event", + G_CALLBACK (et_canvas_root_event), e_table); e_table->canvas_vbox = gnome_canvas_item_new ( gnome_canvas_root (e_table->table_canvas), @@ -1389,7 +1469,8 @@ e_table_setup_table (ETable *e_table, ETableHeader *full_header, ETableHeader *h } static void -e_table_fill_table (ETable *e_table, ETableModel *model) +e_table_fill_table (ETable *e_table, + ETableModel *model) { e_table_group_add_all (e_table->group); } @@ -1404,7 +1485,8 @@ 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; @@ -1434,12 +1516,13 @@ e_table_set_state_object (ETable *e_table, ETableState *state) if (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", - G_CALLBACK (group_info_changed), e_table); - e_table->sort_info_change_id = - g_signal_connect (G_OBJECT (e_table->sort_info), "sort_info_changed", - G_CALLBACK (sort_info_changed), e_table); + e_table->group_info_change_id = g_signal_connect ( + e_table->sort_info, "group_info_changed", + G_CALLBACK (group_info_changed), e_table); + + e_table->sort_info_change_id = g_signal_connect ( + e_table->sort_info, "sort_info_changed", + G_CALLBACK (sort_info_changed), e_table); } else e_table->sort_info = NULL; @@ -1474,8 +1557,8 @@ e_table_set_state_object (ETable *e_table, ETableState *state) * **/ void -e_table_set_state (ETable *e_table, - const gchar *state_str) +e_table_set_state (ETable *e_table, + const gchar *state_str) { ETableState *state; @@ -1501,8 +1584,8 @@ e_table_set_state (ETable *e_table, * **/ void -e_table_load_state (ETable *e_table, - const gchar *filename) +e_table_load_state (ETable *e_table, + const gchar *filename) { ETableState *state; @@ -1592,8 +1675,8 @@ gchar *e_table_get_state (ETable *e_table * **/ void -e_table_save_state (ETable *e_table, - const gchar *filename) +e_table_save_state (ETable *e_table, + const gchar *filename) { ETableState *state; @@ -1603,20 +1686,26 @@ e_table_save_state (ETable *e_table, } static void -et_selection_model_selection_changed (ETableGroup *etg, ETable *et) +et_selection_model_selection_changed (ETableGroup *etg, + ETable *et) { 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) +et_selection_model_selection_row_changed (ETableGroup *etg, + gint row, + ETable *et) { g_signal_emit (G_OBJECT (et), et_signals[SELECTION_CHANGE], 0); } static ETable * -et_real_construct (ETable *e_table, ETableModel *etm, ETableExtras *ete, - ETableSpecification *specification, ETableState *state) +et_real_construct (ETable *e_table, + ETableModel *etm, + ETableExtras *ete, + ETableSpecification *specification, + ETableState *state) { gint row = 0; gint col_count, i; @@ -1751,8 +1840,11 @@ et_real_construct (ETable *e_table, ETableModel *etm, ETableExtras *ete, * The passed in value @e_table or %NULL if there's an error. **/ ETable * -e_table_construct (ETable *e_table, ETableModel *etm, ETableExtras *ete, - const gchar *spec_str, const gchar *state_str) +e_table_construct (ETable *e_table, + ETableModel *etm, + ETableExtras *ete, + const gchar *spec_str, + const gchar *state_str) { ETableSpecification *specification; ETableState *state; @@ -1811,8 +1903,11 @@ e_table_construct (ETable *e_table, ETableModel *etm, ETableExtras *ete, * The passed in value @e_table or %NULL if there's an error. **/ ETable * -e_table_construct_from_spec_file (ETable *e_table, ETableModel *etm, ETableExtras *ete, - const gchar *spec_fn, const gchar *state_fn) +e_table_construct_from_spec_file (ETable *e_table, + ETableModel *etm, + ETableExtras *ete, + const gchar *spec_fn, + const gchar *state_fn) { ETableSpecification *specification; ETableState *state; @@ -2027,7 +2122,8 @@ e_table_get_specification (ETable *e_table) } gint -e_table_set_specification (ETable *e_table, const gchar *spec) +e_table_set_specification (ETable *e_table, + const gchar *spec) { xmlDoc *xmlSpec; gint ret; @@ -2045,7 +2141,8 @@ e_table_set_specification (ETable *e_table, const gchar *spec) } void -e_table_save_specification (ETable *e_table, const gchar *filename) +e_table_save_specification (ETable *e_table, + const gchar *filename) { xmlDoc *doc = et_build_tree (e_table); @@ -2059,7 +2156,8 @@ e_table_save_specification (ETable *e_table, const gchar *filename) } gint -e_table_load_specification (ETable *e_table, gchar *filename) +e_table_load_specification (ETable *e_table, + gchar *filename) { xmlDoc *xmlSpec; gint ret; @@ -2093,7 +2191,8 @@ e_table_load_specification (ETable *e_table, gchar *filename) * Sets the cursor row and the selection to the given row number. **/ void -e_table_set_cursor_row (ETable *e_table, gint row) +e_table_set_cursor_row (ETable *e_table, + gint row) { g_return_if_fail (e_table != NULL); g_return_if_fail (E_IS_TABLE (e_table)); @@ -2140,9 +2239,9 @@ e_table_get_cursor_row (ETable *e_table) * and then act upon that list. (In inverse order if it's rows.) **/ void -e_table_selected_row_foreach (ETable *e_table, - EForeachFunc callback, - gpointer closure) +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)); @@ -2162,7 +2261,7 @@ e_table_selected_row_foreach (ETable *e_table, * The number of rows selected. **/ gint -e_table_selected_count (ETable *e_table) +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); @@ -2248,13 +2347,13 @@ e_table_commit_click_to_add (ETable *table) static void et_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) + guint property_id, + GValue *value, + GParamSpec *pspec) { ETable *etable = E_TABLE (object); - switch (prop_id) { + switch (property_id) { case PROP_MODEL: g_value_set_object (value, etable->model); break; @@ -2311,13 +2410,13 @@ typedef struct { static void et_set_property (GObject *object, - guint prop_id, + guint property_id, const GValue *value, GParamSpec *pspec) { ETable *etable = E_TABLE (object); - switch (prop_id) { + switch (property_id) { case PROP_LENGTH_THRESHOLD: etable->length_threshold = g_value_get_int (value); if (etable->group) { @@ -2418,8 +2517,8 @@ et_set_property (GObject *object, * The model row number. **/ gint -e_table_get_next_row (ETable *e_table, - gint model_row) +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); @@ -2452,8 +2551,8 @@ e_table_get_next_row (ETable *e_table, * The model row number. **/ gint -e_table_get_prev_row (ETable *e_table, - gint model_row) +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); @@ -2481,8 +2580,8 @@ e_table_get_prev_row (ETable *e_table, * The view row number. **/ gint -e_table_model_to_view_row (ETable *e_table, - gint model_row) +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); @@ -2504,8 +2603,8 @@ e_table_model_to_view_row (ETable *e_table, * The model row number. **/ gint -e_table_view_to_model_row (ETable *e_table, - gint view_row) +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); @@ -2529,8 +2628,10 @@ e_table_view_to_model_row (ETable *e_table, **/ void e_table_get_cell_at (ETable *table, - gint x, gint y, - gint *row_return, gint *col_return) + gint x, + gint y, + gint *row_return, + gint *col_return) { GtkAdjustment *adjustment; GtkScrollable *scrollable; @@ -2571,9 +2672,12 @@ e_table_get_cell_at (ETable *table, **/ void e_table_get_cell_geometry (ETable *table, - gint row, gint col, - gint *x_return, gint *y_return, - gint *width_return, gint *height_return) + gint row, + gint col, + gint *x_return, + gint *y_return, + gint *width_return, + gint *height_return) { GtkAllocation allocation; GtkAdjustment *adjustment; @@ -2614,7 +2718,9 @@ e_table_get_cell_geometry (ETable *table, * based on the mouse motion information in the group. **/ void -e_table_get_mouse_over_cell (ETable *table, gint *row, gint *col) +e_table_get_mouse_over_cell (ETable *table, + gint *row, + gint *col) { g_return_if_fail (table != NULL); g_return_if_fail (E_IS_TABLE (table)); @@ -2724,12 +2830,12 @@ struct _GtkDragSourceInfo * **/ void -e_table_drag_get_data (ETable *table, - gint row, - gint col, - GdkDragContext *context, - GdkAtom target, - guint32 time) +e_table_drag_get_data (ETable *table, + gint row, + gint col, + GdkDragContext *context, + GdkAtom target, + guint32 time) { g_return_if_fail (table != NULL); g_return_if_fail (E_IS_TABLE (table)); @@ -2751,8 +2857,8 @@ e_table_drag_get_data (ETable *table, **/ void e_table_drag_highlight (ETable *table, - gint row, - gint col) + gint row, + gint col) { GtkAllocation allocation; GtkAdjustment *adjustment; @@ -2867,7 +2973,10 @@ e_table_drag_dest_unset (GtkWidget *widget) /* Source side */ static gint -et_real_start_drag (ETable *table, gint row, gint col, GdkEvent *event) +et_real_start_drag (ETable *table, + gint row, + gint col, + GdkEvent *event) { GtkDragSourceInfo *info; GdkDragContext *context; @@ -2910,11 +3019,11 @@ et_real_start_drag (ETable *table, gint row, gint col, GdkEvent *event) * Registers this table as a drag site, and possibly adds default behaviors. **/ void -e_table_drag_source_set (ETable *table, - GdkModifierType start_button_mask, - const GtkTargetEntry *targets, - gint n_targets, - GdkDragAction actions) +e_table_drag_source_set (ETable *table, + GdkModifierType start_button_mask, + const GtkTargetEntry *targets, + gint n_targets, + GdkDragAction actions) { ETableDragSourceSite *site; GtkWidget *canvas; @@ -2995,13 +3104,13 @@ e_table_drag_source_unset (ETable *table) * The drag context. **/ GdkDragContext * -e_table_drag_begin (ETable *table, - gint row, - gint col, - GtkTargetList *targets, - GdkDragAction actions, - gint button, - GdkEvent *event) +e_table_drag_begin (ETable *table, + gint row, + gint col, + GtkTargetList *targets, + GdkDragAction actions, + gint button, + GdkEvent *event) { g_return_val_if_fail (table != NULL, NULL); g_return_val_if_fail (E_IS_TABLE (table), NULL); @@ -3018,8 +3127,8 @@ e_table_drag_begin (ETable *table, static void et_drag_begin (GtkWidget *widget, - GdkDragContext *context, - ETable *et) + GdkDragContext *context, + ETable *et) { g_signal_emit (G_OBJECT (et), et_signals[TABLE_DRAG_BEGIN], 0, et->drag_row, et->drag_col, context); @@ -3027,8 +3136,8 @@ et_drag_begin (GtkWidget *widget, static void et_drag_end (GtkWidget *widget, - GdkDragContext *context, - ETable *et) + GdkDragContext *context, + ETable *et) { g_signal_emit (G_OBJECT (et), et_signals[TABLE_DRAG_END], 0, et->drag_row, et->drag_col, context); @@ -3036,11 +3145,11 @@ et_drag_end (GtkWidget *widget, static void et_drag_data_get (GtkWidget *widget, - GdkDragContext *context, - GtkSelectionData *selection_data, - guint info, - guint time, - ETable *et) + GdkDragContext *context, + GtkSelectionData *selection_data, + guint info, + guint time, + ETable *et) { g_signal_emit (G_OBJECT (et), et_signals[TABLE_DRAG_DATA_GET], 0, et->drag_row, et->drag_col, context, selection_data, @@ -3049,8 +3158,8 @@ et_drag_data_get (GtkWidget *widget, static void et_drag_data_delete (GtkWidget *widget, - GdkDragContext *context, - ETable *et) + GdkDragContext *context, + ETable *et) { g_signal_emit (G_OBJECT (et), et_signals[TABLE_DRAG_DATA_DELETE], 0, et->drag_row, et->drag_col, context); @@ -3058,10 +3167,10 @@ et_drag_data_delete (GtkWidget *widget, static gboolean do_drag_motion (ETable *et, - GdkDragContext *context, - gint x, - gint y, - guint time) + GdkDragContext *context, + gint x, + gint y, + guint time) { gboolean ret_val; gint row = -1, col = -1; @@ -3141,7 +3250,8 @@ scroll_timeout (gpointer data) } static void -scroll_on (ETable *et, guint scroll_direction) +scroll_on (ETable *et, + guint scroll_direction) { if (et->scroll_idle_id == 0 || scroll_direction != et->scroll_direction) { if (et->scroll_idle_id != 0) @@ -3177,7 +3287,8 @@ context_destroyed (gpointer data) } static void -context_connect (ETable *et, GdkDragContext *context) +context_connect (ETable *et, + GdkDragContext *context) { if (g_dataset_get_data (context, "e-table") == NULL) { g_object_ref (et); @@ -3187,9 +3298,9 @@ context_connect (ETable *et, GdkDragContext *context) static void et_drag_leave (GtkWidget *widget, - GdkDragContext *context, - guint time, - ETable *et) + GdkDragContext *context, + guint time, + ETable *et) { g_signal_emit (G_OBJECT (et), et_signals[TABLE_DRAG_LEAVE], 0, et->drop_row, et->drop_col, context, time); @@ -3201,11 +3312,11 @@ et_drag_leave (GtkWidget *widget, static gboolean et_drag_motion (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - guint time, - ETable *et) + GdkDragContext *context, + gint x, + gint y, + guint time, + ETable *et) { GtkAllocation allocation; gboolean ret_val; @@ -3240,11 +3351,11 @@ et_drag_motion (GtkWidget *widget, static gboolean et_drag_drop (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - guint time, - ETable *et) + GdkDragContext *context, + gint x, + gint y, + guint time, + ETable *et) { gboolean ret_val; gint row, col; @@ -3271,13 +3382,13 @@ et_drag_drop (GtkWidget *widget, static void et_drag_data_received (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - GtkSelectionData *selection_data, - guint info, - guint time, - ETable *et) + GdkDragContext *context, + gint x, + gint y, + GtkSelectionData *selection_data, + guint info, + guint time, + ETable *et) { gint row, col; diff --git a/widgets/table/e-table.h b/widgets/table/e-table.h index 99daf6d1e5..e1e4e0eb8f 100644 --- a/widgets/table/e-table.h +++ b/widgets/table/e-table.h @@ -121,8 +121,8 @@ struct _ETable { gint length_threshold; gint rebuild_idle_id; - guint need_rebuild:1; - guint size_allocated:1; + guint need_rebuild : 1; + guint size_allocated : 1; /* * Configuration settings diff --git a/widgets/table/e-tree-memory-callbacks.c b/widgets/table/e-tree-memory-callbacks.c index 7281f3d327..9f8d7d468a 100644 --- a/widgets/table/e-tree-memory-callbacks.c +++ b/widgets/table/e-tree-memory-callbacks.c @@ -34,7 +34,8 @@ G_DEFINE_TYPE (ETreeMemoryCallbacks, e_tree_memory_callbacks, E_TYPE_TREE_MEMORY) static GdkPixbuf * -etmc_icon_at (ETreeModel *etm, ETreePath node) +etmc_icon_at (ETreeModel *etm, + ETreePath node) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); @@ -64,7 +65,8 @@ etmc_has_save_id (ETreeModel *etm) } static gchar * -etmc_get_save_id (ETreeModel *etm, ETreePath node) +etmc_get_save_id (ETreeModel *etm, + ETreePath node) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); @@ -86,7 +88,8 @@ etmc_has_get_node_by_id (ETreeModel *etm) } static ETreePath -etmc_get_node_by_id (ETreeModel *etm, const gchar *save_id) +etmc_get_node_by_id (ETreeModel *etm, + const gchar *save_id) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); @@ -97,7 +100,9 @@ etmc_get_node_by_id (ETreeModel *etm, const gchar *save_id) } static gpointer -etmc_sort_value_at (ETreeModel *etm, ETreePath node, gint col) +etmc_sort_value_at (ETreeModel *etm, + ETreePath node, + gint col) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); @@ -108,7 +113,9 @@ etmc_sort_value_at (ETreeModel *etm, ETreePath node, gint col) } static gpointer -etmc_value_at (ETreeModel *etm, ETreePath node, gint col) +etmc_value_at (ETreeModel *etm, + ETreePath node, + gint col) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); @@ -116,7 +123,10 @@ etmc_value_at (ETreeModel *etm, ETreePath node, gint col) } static void -etmc_set_value_at (ETreeModel *etm, ETreePath node, gint col, gconstpointer val) +etmc_set_value_at (ETreeModel *etm, + ETreePath node, + gint col, + gconstpointer val) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); @@ -124,7 +134,9 @@ etmc_set_value_at (ETreeModel *etm, ETreePath node, gint col, gconstpointer val) } static gboolean -etmc_is_editable (ETreeModel *etm, ETreePath node, gint col) +etmc_is_editable (ETreeModel *etm, + ETreePath node, + gint col) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); @@ -133,7 +145,9 @@ etmc_is_editable (ETreeModel *etm, ETreePath node, gint col) /* The default for etmc_duplicate_value is to return the raw value. */ static gpointer -etmc_duplicate_value (ETreeModel *etm, gint col, gconstpointer value) +etmc_duplicate_value (ETreeModel *etm, + gint col, + gconstpointer value) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); @@ -144,7 +158,9 @@ etmc_duplicate_value (ETreeModel *etm, gint col, gconstpointer value) } static void -etmc_free_value (ETreeModel *etm, gint col, gpointer value) +etmc_free_value (ETreeModel *etm, + gint col, + gpointer value) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); @@ -153,7 +169,8 @@ etmc_free_value (ETreeModel *etm, gint col, gpointer value) } static gpointer -etmc_initialize_value (ETreeModel *etm, gint col) +etmc_initialize_value (ETreeModel *etm, + gint col) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); @@ -164,7 +181,9 @@ etmc_initialize_value (ETreeModel *etm, gint col) } static gboolean -etmc_value_is_empty (ETreeModel *etm, gint col, gconstpointer value) +etmc_value_is_empty (ETreeModel *etm, + gint col, + gconstpointer value) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); @@ -175,7 +194,9 @@ etmc_value_is_empty (ETreeModel *etm, gint col, gconstpointer value) } static gchar * -etmc_value_to_string (ETreeModel *etm, gint col, gconstpointer value) +etmc_value_to_string (ETreeModel *etm, + gint col, + gconstpointer value) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS (etm); @@ -240,28 +261,28 @@ e_tree_memory_callbacks_init (ETreeMemoryCallbacks *etmc) * */ ETreeModel * -e_tree_memory_callbacks_new (ETreeMemoryCallbacksIconAtFn icon_at, +e_tree_memory_callbacks_new (ETreeMemoryCallbacksIconAtFn icon_at, - ETreeMemoryCallbacksColumnCountFn column_count, + ETreeMemoryCallbacksColumnCountFn column_count, - ETreeMemoryCallbacksHasSaveIdFn has_save_id, - ETreeMemoryCallbacksGetSaveIdFn get_save_id, + ETreeMemoryCallbacksHasSaveIdFn has_save_id, + ETreeMemoryCallbacksGetSaveIdFn get_save_id, - ETreeMemoryCallbacksHasGetNodeByIdFn has_get_node_by_id, - ETreeMemoryCallbacksGetNodeByIdFn get_node_by_id, + ETreeMemoryCallbacksHasGetNodeByIdFn has_get_node_by_id, + ETreeMemoryCallbacksGetNodeByIdFn get_node_by_id, - ETreeMemoryCallbacksValueAtFn sort_value_at, - ETreeMemoryCallbacksValueAtFn value_at, - ETreeMemoryCallbacksSetValueAtFn set_value_at, - ETreeMemoryCallbacksIsEditableFn is_editable, + ETreeMemoryCallbacksValueAtFn sort_value_at, + ETreeMemoryCallbacksValueAtFn value_at, + ETreeMemoryCallbacksSetValueAtFn set_value_at, + ETreeMemoryCallbacksIsEditableFn is_editable, - ETreeMemoryCallbacksDuplicateValueFn duplicate_value, - ETreeMemoryCallbacksFreeValueFn free_value, - ETreeMemoryCallbacksInitializeValueFn initialize_value, - ETreeMemoryCallbacksValueIsEmptyFn value_is_empty, - ETreeMemoryCallbacksValueToStringFn value_to_string, + ETreeMemoryCallbacksDuplicateValueFn duplicate_value, + ETreeMemoryCallbacksFreeValueFn free_value, + ETreeMemoryCallbacksInitializeValueFn initialize_value, + ETreeMemoryCallbacksValueIsEmptyFn value_is_empty, + ETreeMemoryCallbacksValueToStringFn value_to_string, - gpointer model_data) + gpointer model_data) { ETreeMemoryCallbacks *etmc; @@ -290,6 +311,6 @@ e_tree_memory_callbacks_new (ETreeMemoryCallbacksIconAtFn icon_at, etmc->model_data = model_data; - return (ETreeModel*) etmc; + return (ETreeModel *) etmc; } diff --git a/widgets/table/e-tree-memory.c b/widgets/table/e-tree-memory.c index 4b9a977f05..43fb41b29c 100644 --- a/widgets/table/e-tree-memory.c +++ b/widgets/table/e-tree-memory.c @@ -81,7 +81,8 @@ struct _ETreeMemoryPrivate { /* ETreeMemoryPath functions */ static inline void -check_children (ETreeMemory *memory, ETreePath node) +check_children (ETreeMemory *memory, + ETreePath node) { ETreeMemoryPath *path = node; if (!path->children_computed) { @@ -236,14 +237,16 @@ etmm_get_root (ETreeModel *etm) } static ETreePath -etmm_get_parent (ETreeModel *etm, ETreePath node) +etmm_get_parent (ETreeModel *etm, + ETreePath node) { ETreeMemoryPath *path = node; return path->parent; } static ETreePath -etmm_get_first_child (ETreeModel *etm, ETreePath node) +etmm_get_first_child (ETreeModel *etm, + ETreePath node) { ETreeMemoryPath *path = node; @@ -252,7 +255,8 @@ etmm_get_first_child (ETreeModel *etm, ETreePath node) } static ETreePath -etmm_get_last_child (ETreeModel *etm, ETreePath node) +etmm_get_last_child (ETreeModel *etm, + ETreePath node) { ETreeMemoryPath *path = node; @@ -261,28 +265,32 @@ etmm_get_last_child (ETreeModel *etm, ETreePath node) } static ETreePath -etmm_get_next (ETreeModel *etm, ETreePath node) +etmm_get_next (ETreeModel *etm, + ETreePath node) { ETreeMemoryPath *path = node; return path->next_sibling; } static ETreePath -etmm_get_prev (ETreeModel *etm, ETreePath node) +etmm_get_prev (ETreeModel *etm, + ETreePath node) { ETreeMemoryPath *path = node; return path->prev_sibling; } static gboolean -etmm_is_root (ETreeModel *etm, ETreePath node) +etmm_is_root (ETreeModel *etm, + ETreePath node) { ETreeMemoryPath *path = node; return e_tree_memory_path_depth (path) == 0; } static gboolean -etmm_is_expandable (ETreeModel *etm, ETreePath node) +etmm_is_expandable (ETreeModel *etm, + ETreePath node) { ETreeMemoryPath *path = node; @@ -291,7 +299,9 @@ etmm_is_expandable (ETreeModel *etm, ETreePath node) } static guint -etmm_get_children (ETreeModel *etm, ETreePath node, ETreePath **nodes) +etmm_get_children (ETreeModel *etm, + ETreePath node, + ETreePath **nodes) { ETreeMemoryPath *path = node; guint n_children; @@ -314,7 +324,8 @@ etmm_get_children (ETreeModel *etm, ETreePath node, ETreePath **nodes) } static guint -etmm_depth (ETreeModel *etm, ETreePath path) +etmm_depth (ETreeModel *etm, + ETreePath path) { return e_tree_memory_path_depth (path); } @@ -338,7 +349,8 @@ etmm_clear_children_computed (ETreeMemoryPath *path) } static void -etmm_node_request_collapse (ETreeModel *etm, ETreePath node) +etmm_node_request_collapse (ETreeModel *etm, + ETreePath node) { ETreeModelClass *parent_class; @@ -430,7 +442,8 @@ e_tree_memory_new (void) * the value of @expanded. */ void -e_tree_memory_set_expanded_default (ETreeMemory *etree, gboolean expanded) +e_tree_memory_set_expanded_default (ETreeMemory *etree, + gboolean expanded) { g_return_if_fail (etree != NULL); @@ -447,7 +460,8 @@ e_tree_memory_set_expanded_default (ETreeMemory *etree, gboolean expande * Return value: **/ gpointer -e_tree_memory_node_get_data (ETreeMemory *etmm, ETreePath node) +e_tree_memory_node_get_data (ETreeMemory *etmm, + ETreePath node) { ETreeMemoryPath *path = node; @@ -465,7 +479,9 @@ e_tree_memory_node_get_data (ETreeMemory *etmm, ETreePath node) * **/ void -e_tree_memory_node_set_data (ETreeMemory *etmm, ETreePath node, gpointer node_data) +e_tree_memory_node_set_data (ETreeMemory *etmm, + ETreePath node, + gpointer node_data) { ETreeMemoryPath *path = node; @@ -487,9 +503,9 @@ e_tree_memory_node_set_data (ETreeMemory *etmm, ETreePath node, gpointer node_da **/ ETreePath e_tree_memory_node_insert (ETreeMemory *tree_model, - ETreePath parent_node, - gint position, - gpointer node_data) + ETreePath parent_node, + gint position, + gpointer node_data) { ETreeMemoryPrivate *priv; ETreeMemoryPath *new_path; @@ -550,9 +566,9 @@ e_tree_memory_node_insert_id (ETreeMemory *etree, **/ ETreePath e_tree_memory_node_insert_before (ETreeMemory *etree, - ETreePath parent, - ETreePath sibling, - gpointer node_data) + ETreePath parent, + ETreePath sibling, + gpointer node_data) { ETreeMemoryPath *child; ETreeMemoryPath *parent_path = parent; @@ -574,7 +590,8 @@ 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; @@ -602,7 +619,8 @@ child_free (ETreeMemory *etree, ETreeMemoryPath *node) * Return value: **/ gpointer -e_tree_memory_node_remove (ETreeMemory *etree, ETreePath node) +e_tree_memory_node_remove (ETreeMemory *etree, + ETreePath node) { ETreeMemoryPath *path = node; ETreeMemoryPath *parent = path->parent; @@ -622,7 +640,7 @@ e_tree_memory_node_remove (ETreeMemory *etree, ETreePath node) } /* unlink this node - we only have to unlink the root node being removed, - since the others are only references from this node */ + * since the others are only references from this node */ e_tree_path_unlink (path); /*printf("removing %d nodes from position %d\n", visible, base);*/ @@ -647,7 +665,9 @@ 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; @@ -656,10 +676,10 @@ sort_callback (gconstpointer data1, gconstpointer data2, gpointer user_data) } void -e_tree_memory_sort_node (ETreeMemory *etmm, - ETreePath node, - ETreeMemorySortCallback callback, - gpointer user_data) +e_tree_memory_sort_node (ETreeMemory *etmm, + ETreePath node, + ETreeMemorySortCallback callback, + gpointer user_data) { ETreeMemoryPath **children; ETreeMemoryPath *child; @@ -716,9 +736,9 @@ e_tree_memory_sort_node (ETreeMemory *etmm, } void -e_tree_memory_set_node_destroy_func (ETreeMemory *etmm, - GFunc destroy_func, - gpointer user_data) +e_tree_memory_set_node_destroy_func (ETreeMemory *etmm, + GFunc destroy_func, + gpointer user_data) { etmm->priv->destroy_func = destroy_func; etmm->priv->destroy_user_data = user_data; diff --git a/widgets/table/e-tree-model.c b/widgets/table/e-tree-model.c index 8772e5309f..b37ce4bf17 100644 --- a/widgets/table/e-tree-model.c +++ b/widgets/table/e-tree-model.c @@ -223,7 +223,7 @@ e_tree_model_init (ETreeModel *tree_model) * Return value: **/ void -e_tree_model_pre_change (ETreeModel *tree_model) +e_tree_model_pre_change (ETreeModel *tree_model) { g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); @@ -243,7 +243,7 @@ e_tree_model_pre_change (ETreeModel *tree_model) * Return value: **/ void -e_tree_model_no_change (ETreeModel *tree_model) +e_tree_model_no_change (ETreeModel *tree_model) { g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); @@ -263,7 +263,7 @@ e_tree_model_no_change (ETreeModel *tree_model) * Return value: **/ void -e_tree_model_rebuilt (ETreeModel *tree_model) +e_tree_model_rebuilt (ETreeModel *tree_model) { g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); @@ -282,7 +282,8 @@ e_tree_model_rebuilt (ETreeModel *tree_model) * Return value: **/ void -e_tree_model_node_changed (ETreeModel *tree_model, ETreePath node) +e_tree_model_node_changed (ETreeModel *tree_model, + ETreePath node) { g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); @@ -302,7 +303,8 @@ e_tree_model_node_changed (ETreeModel *tree_model, ETreePath node) * Return value: **/ void -e_tree_model_node_data_changed (ETreeModel *tree_model, ETreePath node) +e_tree_model_node_data_changed (ETreeModel *tree_model, + ETreePath node) { g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); @@ -322,7 +324,9 @@ e_tree_model_node_data_changed (ETreeModel *tree_model, ETreePath node) * Return value: **/ void -e_tree_model_node_col_changed (ETreeModel *tree_model, ETreePath node, gint col) +e_tree_model_node_col_changed (ETreeModel *tree_model, + ETreePath node, + gint col) { g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); @@ -342,8 +346,8 @@ e_tree_model_node_col_changed (ETreeModel *tree_model, ETreePath node, gint col **/ void e_tree_model_node_inserted (ETreeModel *tree_model, - ETreePath parent_node, - ETreePath inserted_node) + ETreePath parent_node, + ETreePath inserted_node) { g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); @@ -363,7 +367,10 @@ e_tree_model_node_inserted (ETreeModel *tree_model, * **/ void -e_tree_model_node_removed (ETreeModel *tree_model, ETreePath parent_node, ETreePath removed_node, gint old_position) +e_tree_model_node_removed (ETreeModel *tree_model, + ETreePath parent_node, + ETreePath removed_node, + gint old_position) { g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); @@ -382,7 +389,8 @@ e_tree_model_node_removed (ETreeModel *tree_model, ETreePath parent_node, ETree * **/ void -e_tree_model_node_deleted (ETreeModel *tree_model, ETreePath deleted_node) +e_tree_model_node_deleted (ETreeModel *tree_model, + ETreePath deleted_node) { g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); @@ -400,7 +408,8 @@ e_tree_model_node_deleted (ETreeModel *tree_model, ETreePath deleted_node) * **/ void -e_tree_model_node_request_collapse (ETreeModel *tree_model, ETreePath collapsed_node) +e_tree_model_node_request_collapse (ETreeModel *tree_model, + ETreePath collapsed_node) { g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); @@ -455,7 +464,8 @@ e_tree_model_get_root (ETreeModel *etree) * Return value: **/ ETreePath -e_tree_model_node_get_parent (ETreeModel *etree, ETreePath node) +e_tree_model_node_get_parent (ETreeModel *etree, + ETreePath node) { g_return_val_if_fail (etree != NULL, NULL); if (ETM_CLASS (etree)->get_parent) @@ -474,7 +484,8 @@ e_tree_model_node_get_parent (ETreeModel *etree, ETreePath node) * Return value: **/ ETreePath -e_tree_model_node_get_first_child (ETreeModel *etree, ETreePath node) +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); @@ -495,7 +506,8 @@ e_tree_model_node_get_first_child (ETreeModel *etree, ETreePath node) * Return value: **/ ETreePath -e_tree_model_node_get_last_child (ETreeModel *etree, ETreePath node) +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); @@ -516,7 +528,8 @@ e_tree_model_node_get_last_child (ETreeModel *etree, ETreePath node) * Return value: **/ ETreePath -e_tree_model_node_get_next (ETreeModel *etree, ETreePath node) +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); @@ -537,7 +550,8 @@ e_tree_model_node_get_next (ETreeModel *etree, ETreePath node) * Return value: **/ ETreePath -e_tree_model_node_get_prev (ETreeModel *etree, ETreePath node) +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); @@ -558,7 +572,8 @@ e_tree_model_node_get_prev (ETreeModel *etree, ETreePath node) * Return value: **/ gboolean -e_tree_model_node_is_root (ETreeModel *etree, ETreePath node) +e_tree_model_node_is_root (ETreeModel *etree, + ETreePath node) { g_return_val_if_fail (etree != NULL, FALSE); @@ -578,7 +593,8 @@ e_tree_model_node_is_root (ETreeModel *etree, ETreePath node) * Return value: **/ gboolean -e_tree_model_node_is_expandable (ETreeModel *etree, ETreePath node) +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); @@ -590,7 +606,9 @@ e_tree_model_node_is_expandable (ETreeModel *etree, ETreePath node) } guint -e_tree_model_node_get_children (ETreeModel *etree, ETreePath node, ETreePath **nodes) +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) @@ -609,7 +627,8 @@ e_tree_model_node_get_children (ETreeModel *etree, ETreePath node, ETreePath **n * Return value: **/ guint -e_tree_model_node_depth (ETreeModel *etree, ETreePath node) +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); @@ -630,7 +649,8 @@ e_tree_model_node_depth (ETreeModel *etree, ETreePath node) * return values: the GdkPixbuf associated with this node. */ GdkPixbuf * -e_tree_model_icon_at (ETreeModel *etree, ETreePath node) +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); @@ -711,7 +731,8 @@ e_tree_model_has_save_id (ETreeModel *etree) * return values: The save id for this path. */ gchar * -e_tree_model_get_save_id (ETreeModel *etree, ETreePath node) +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); @@ -755,7 +776,8 @@ e_tree_model_has_get_node_by_id (ETreeModel *etree) * return values: The path for this save id. */ ETreePath -e_tree_model_get_node_by_id (ETreeModel *etree, const gchar *save_id) +e_tree_model_get_node_by_id (ETreeModel *etree, + const gchar *save_id) { g_return_val_if_fail (etree != NULL, NULL); g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL); @@ -807,7 +829,9 @@ e_tree_model_has_change_pending (ETreeModel *etree) * node_removed, and no_change don't affect any data in this way. **/ gpointer -e_tree_model_sort_value_at (ETreeModel *etree, ETreePath node, gint col) +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); @@ -838,7 +862,9 @@ e_tree_model_sort_value_at (ETreeModel *etree, ETreePath node, gint col) * node_removed, and no_change don't affect any data in this way. **/ gpointer -e_tree_model_value_at (ETreeModel *etree, ETreePath node, gint col) +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); @@ -850,7 +876,10 @@ e_tree_model_value_at (ETreeModel *etree, ETreePath node, gint col) } void -e_tree_model_set_value_at (ETreeModel *etree, ETreePath node, gint col, gconstpointer val) +e_tree_model_set_value_at (ETreeModel *etree, + ETreePath node, + gint col, + gconstpointer val) { g_return_if_fail (etree != NULL); g_return_if_fail (E_IS_TREE_MODEL (etree)); @@ -869,7 +898,9 @@ e_tree_model_set_value_at (ETreeModel *etree, ETreePath node, gint col, gconstpo * Return value: **/ gboolean -e_tree_model_node_is_editable (ETreeModel *etree, ETreePath node, gint col) +e_tree_model_node_is_editable (ETreeModel *etree, + ETreePath node, + gint col) { g_return_val_if_fail (etree != NULL, FALSE); @@ -889,7 +920,9 @@ e_tree_model_node_is_editable (ETreeModel *etree, ETreePath node, gint col) * Return value: **/ gpointer -e_tree_model_duplicate_value (ETreeModel *etree, gint col, gconstpointer value) +e_tree_model_duplicate_value (ETreeModel *etree, + gint col, + gconstpointer value) { g_return_val_if_fail (etree != NULL, NULL); @@ -909,7 +942,9 @@ e_tree_model_duplicate_value (ETreeModel *etree, gint col, gconstpointer value) * Return value: **/ void -e_tree_model_free_value (ETreeModel *etree, gint col, gpointer value) +e_tree_model_free_value (ETreeModel *etree, + gint col, + gpointer value) { g_return_if_fail (etree != NULL); @@ -927,7 +962,8 @@ e_tree_model_free_value (ETreeModel *etree, gint col, gpointer value) * Return value: **/ gpointer -e_tree_model_initialize_value (ETreeModel *etree, gint col) +e_tree_model_initialize_value (ETreeModel *etree, + gint col) { g_return_val_if_fail (etree != NULL, NULL); @@ -947,7 +983,9 @@ e_tree_model_initialize_value (ETreeModel *etree, gint col) * Return value: **/ gboolean -e_tree_model_value_is_empty (ETreeModel *etree, gint col, gconstpointer value) +e_tree_model_value_is_empty (ETreeModel *etree, + gint col, + gconstpointer value) { g_return_val_if_fail (etree != NULL, TRUE); @@ -967,7 +1005,9 @@ e_tree_model_value_is_empty (ETreeModel *etree, gint col, gconstpointer value) * Return value: **/ gchar * -e_tree_model_value_to_string (ETreeModel *etree, gint col, gconstpointer value) +e_tree_model_value_to_string (ETreeModel *etree, + gint col, + gconstpointer value) { g_return_val_if_fail(etree != NULL, g_strdup("")); @@ -987,7 +1027,10 @@ e_tree_model_value_to_string (ETreeModel *etree, gint col, gconstpointer value) * **/ void -e_tree_model_node_traverse (ETreeModel *model, ETreePath path, ETreePathFunc func, gpointer data) +e_tree_model_node_traverse (ETreeModel *model, + ETreePath path, + ETreePathFunc func, + gpointer data) { ETreePath child; @@ -1019,7 +1062,10 @@ e_tree_model_node_traverse (ETreeModel *model, ETreePath path, ETreePathFunc fun * **/ void -e_tree_model_node_traverse_preorder (ETreeModel *model, ETreePath path, ETreePathFunc func, gpointer data) +e_tree_model_node_traverse_preorder (ETreeModel *model, + ETreePath path, + ETreePathFunc func, + gpointer data) { ETreePath child; @@ -1052,7 +1098,12 @@ e_tree_model_node_traverse_preorder (ETreeModel *model, ETreePath path, ETreePat * **/ static ETreePath -e_tree_model_node_real_traverse (ETreeModel *model, ETreePath path, ETreePath end_path, gboolean forward_direction, ETreePathFunc func, gpointer data) +e_tree_model_node_real_traverse (ETreeModel *model, + ETreePath path, + ETreePath end_path, + gboolean forward_direction, + ETreePathFunc func, + gpointer data) { ETreePath child; @@ -1095,7 +1146,12 @@ e_tree_model_node_real_traverse (ETreeModel *model, ETreePath path, ETreePath en * **/ ETreePath -e_tree_model_node_find (ETreeModel *model, ETreePath path, ETreePath end_path, gboolean forward_direction, ETreePathFunc func, gpointer data) +e_tree_model_node_find (ETreeModel *model, + ETreePath path, + ETreePath end_path, + gboolean forward_direction, + ETreePathFunc func, + gpointer data) { ETreePath result; ETreePath next; diff --git a/widgets/table/e-tree-selection-model.c b/widgets/table/e-tree-selection-model.c index dd00fca2e0..9d04086b2f 100644 --- a/widgets/table/e-tree-selection-model.c +++ b/widgets/table/e-tree-selection-model.c @@ -79,7 +79,9 @@ clear_selection (ETreeSelectionModel *etsm) } static void -change_one_path (ETreeSelectionModel *etsm, ETreePath path, gboolean grow) +change_one_path (ETreeSelectionModel *etsm, + ETreePath path, + gboolean grow) { if (!path) return; @@ -91,7 +93,8 @@ change_one_path (ETreeSelectionModel *etsm, ETreePath path, gboolean grow) } static void -select_single_path (ETreeSelectionModel *etsm, ETreePath path) +select_single_path (ETreeSelectionModel *etsm, + ETreePath path) { clear_selection (etsm); change_one_path (etsm, path, TRUE); @@ -100,7 +103,9 @@ select_single_path (ETreeSelectionModel *etsm, ETreePath path) } static void -select_range (ETreeSelectionModel *etsm, gint start, gint end) +select_range (ETreeSelectionModel *etsm, + gint start, + gint end) { gint i; @@ -125,7 +130,8 @@ free_id (ETreeSelectionModel *etsm) } static void -restore_cursor (ETreeSelectionModel *etsm, ETreeModel *etm) +restore_cursor (ETreeSelectionModel *etsm, + ETreeModel *etm) { clear_selection (etsm); etsm->priv->cursor_path = NULL; @@ -153,7 +159,8 @@ restore_cursor (ETreeSelectionModel *etsm, ETreeModel *etm) } static void -etsm_pre_change (ETreeModel *etm, ETreeSelectionModel *etsm) +etsm_pre_change (ETreeModel *etm, + ETreeSelectionModel *etsm) { g_free (etsm->priv->cursor_save_id); etsm->priv->cursor_save_id = NULL; @@ -164,49 +171,67 @@ etsm_pre_change (ETreeModel *etm, ETreeSelectionModel *etsm) } static void -etsm_no_change (ETreeModel *etm, ETreeSelectionModel *etsm) +etsm_no_change (ETreeModel *etm, + ETreeSelectionModel *etsm) { free_id (etsm); } static void -etsm_node_changed (ETreeModel *etm, ETreePath node, ETreeSelectionModel *etsm) +etsm_node_changed (ETreeModel *etm, + ETreePath node, + ETreeSelectionModel *etsm) { restore_cursor (etsm, etm); } static void -etsm_node_data_changed (ETreeModel *etm, ETreePath node, ETreeSelectionModel *etsm) +etsm_node_data_changed (ETreeModel *etm, + ETreePath node, + ETreeSelectionModel *etsm) { free_id (etsm); } static void -etsm_node_col_changed (ETreeModel *etm, ETreePath node, gint col, ETreeSelectionModel *etsm) +etsm_node_col_changed (ETreeModel *etm, + ETreePath node, + gint col, + ETreeSelectionModel *etsm) { free_id (etsm); } static void -etsm_node_inserted (ETreeModel *etm, ETreePath parent, ETreePath child, ETreeSelectionModel *etsm) +etsm_node_inserted (ETreeModel *etm, + ETreePath parent, + ETreePath child, + ETreeSelectionModel *etsm) { restore_cursor (etsm, etm); } static void -etsm_node_removed (ETreeModel *etm, ETreePath parent, ETreePath child, gint old_position, ETreeSelectionModel *etsm) +etsm_node_removed (ETreeModel *etm, + ETreePath parent, + ETreePath child, + gint old_position, + ETreeSelectionModel *etsm) { restore_cursor (etsm, etm); } static void -etsm_node_deleted (ETreeModel *etm, ETreePath child, ETreeSelectionModel *etsm) +etsm_node_deleted (ETreeModel *etm, + ETreePath child, + ETreeSelectionModel *etsm) { restore_cursor (etsm, etm); } static void -add_model (ETreeSelectionModel *etsm, ETreeModel *model) +add_model (ETreeSelectionModel *etsm, + ETreeModel *model) { ETreeSelectionModelPrivate *priv = etsm->priv; @@ -298,11 +323,14 @@ etsm_finalize (GObject *object) } static void -etsm_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +etsm_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (object); - switch (prop_id) { + switch (property_id) { case PROP_CURSOR_ROW: g_value_set_int (value, get_cursor_row (etsm)); break; @@ -322,12 +350,15 @@ etsm_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *ps } static void -etsm_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +etsm_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { ESelectionModel *esm = E_SELECTION_MODEL (object); ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (object); - switch (prop_id) { + switch (property_id) { case PROP_CURSOR_ROW: e_selection_model_do_something (esm, g_value_get_int (value), etsm->priv->cursor_col, 0); break; @@ -348,7 +379,8 @@ etsm_set_property (GObject *object, guint prop_id, const GValue *value, GParamSp } static gboolean -etsm_is_path_selected (ETreeSelectionModel *etsm, ETreePath path) +etsm_is_path_selected (ETreeSelectionModel *etsm, + ETreePath path) { if (path && g_hash_table_lookup (etsm->priv->paths, path)) return TRUE; @@ -367,7 +399,7 @@ etsm_is_path_selected (ETreeSelectionModel *etsm, ETreePath path) */ static gboolean etsm_is_row_selected (ESelectionModel *selection, - gint row) + gint row) { ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (selection); ETreePath path; @@ -387,7 +419,9 @@ typedef struct { } ModelAndCallback; static void -etsm_row_foreach_cb (gpointer key, gpointer value, gpointer user_data) +etsm_row_foreach_cb (gpointer key, + gpointer value, + gpointer user_data) { ETreePath path = key; ModelAndCallback *mac = user_data; @@ -407,8 +441,8 @@ etsm_row_foreach_cb (gpointer key, gpointer value, gpointer user_data) */ static void etsm_foreach (ESelectionModel *selection, - EForeachFunc callback, - gpointer closure) + EForeachFunc callback, + gpointer closure) { ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (selection); ModelAndCallback mac; @@ -520,7 +554,9 @@ etsm_invert_selection (ESelectionModel *selection) } 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); ETreePath path; @@ -538,7 +574,9 @@ etsm_change_one_row (ESelectionModel *selection, gint row, gboolean grow) } static void -etsm_change_cursor (ESelectionModel *selection, gint row, gint col) +etsm_change_cursor (ESelectionModel *selection, + gint row, + gint col) { ETreeSelectionModel *etsm; @@ -569,7 +607,8 @@ etsm_cursor_col (ESelectionModel *selection) } static void -etsm_get_rows (gint row, gpointer d) +etsm_get_rows (gint row, + gpointer d) { gint **rowp = d; @@ -578,7 +617,8 @@ etsm_get_rows (gint row, gpointer d) } static void -etsm_select_single_row (ESelectionModel *selection, gint row) +etsm_select_single_row (ESelectionModel *selection, + gint row) { ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (selection); ETreePath path = e_tree_table_adapter_node_at_row (etsm->priv->etta, row); @@ -587,7 +627,7 @@ etsm_select_single_row (ESelectionModel *selection, gint row) g_return_if_fail (path != NULL); /* we really only care about the size=1 case (cursor changed), - but this doesn't cost much */ + * but this doesn't cost much */ size = g_hash_table_size (etsm->priv->paths); if (size > 0 && size <= 5) { rowp = rows; @@ -596,13 +636,13 @@ etsm_select_single_row (ESelectionModel *selection, gint row) select_single_path (etsm, path); - if (size>5) { + if (size > 5) { e_selection_model_selection_changed (E_SELECTION_MODEL (etsm)); } else { if (rowp) { gint *p = rows; - while (p<rowp) + while (p < rowp) e_selection_model_selection_row_changed ((ESelectionModel *) etsm, *p++); } e_selection_model_selection_row_changed ((ESelectionModel *) etsm, row); @@ -610,7 +650,8 @@ etsm_select_single_row (ESelectionModel *selection, gint row) } static void -etsm_toggle_single_row (ESelectionModel *selection, gint row) +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); @@ -628,7 +669,8 @@ etsm_toggle_single_row (ESelectionModel *selection, gint row) } static void -etsm_real_move_selection_end (ETreeSelectionModel *etsm, gint row) +etsm_real_move_selection_end (ETreeSelectionModel *etsm, + gint row) { ETreePath end_path = e_tree_table_adapter_node_at_row (etsm->priv->etta, row); gint start; @@ -641,7 +683,8 @@ etsm_real_move_selection_end (ETreeSelectionModel *etsm, gint row) } static void -etsm_move_selection_end (ESelectionModel *selection, gint row) +etsm_move_selection_end (ESelectionModel *selection, + gint row) { ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (selection); @@ -652,7 +695,8 @@ etsm_move_selection_end (ESelectionModel *selection, gint row) } static void -etsm_set_selection_end (ESelectionModel *selection, gint row) +etsm_set_selection_end (ESelectionModel *selection, + gint row) { ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (selection); @@ -670,7 +714,9 @@ struct foreach_path_t { }; static void -foreach_path (gpointer key, gpointer value, gpointer data) +foreach_path (gpointer key, + gpointer value, + gpointer data) { ETreePath path = key; struct foreach_path_t *c = data; @@ -678,7 +724,9 @@ foreach_path (gpointer key, gpointer value, gpointer data) } void -e_tree_selection_model_foreach (ETreeSelectionModel *etsm, ETreeForeachFunc callback, gpointer closure) +e_tree_selection_model_foreach (ETreeSelectionModel *etsm, + ETreeForeachFunc callback, + gpointer closure) { if (etsm->priv->paths) { struct foreach_path_t c; @@ -690,7 +738,8 @@ e_tree_selection_model_foreach (ETreeSelectionModel *etsm, ETreeForeachFunc call } void -e_tree_selection_model_select_single_path (ETreeSelectionModel *etsm, ETreePath path) +e_tree_selection_model_select_single_path (ETreeSelectionModel *etsm, + ETreePath path) { select_single_path (etsm, path); @@ -698,12 +747,13 @@ e_tree_selection_model_select_single_path (ETreeSelectionModel *etsm, ETreePath } void -e_tree_selection_model_select_paths (ETreeSelectionModel *etsm, GPtrArray *paths) +e_tree_selection_model_select_paths (ETreeSelectionModel *etsm, + GPtrArray *paths) { ETreePath path; gint i; - for (i=0;i<paths->len;i++) { + for (i = 0; i < paths->len; i++) { path = paths->pdata[i]; change_one_path (etsm, path, TRUE); } @@ -712,7 +762,8 @@ e_tree_selection_model_select_paths (ETreeSelectionModel *etsm, GPtrArray *paths } void -e_tree_selection_model_add_to_selection (ETreeSelectionModel *etsm, ETreePath path) +e_tree_selection_model_add_to_selection (ETreeSelectionModel *etsm, + ETreePath path) { change_one_path (etsm, path, TRUE); @@ -720,7 +771,8 @@ e_tree_selection_model_add_to_selection (ETreeSelectionModel *etsm, ETreePath pa } void -e_tree_selection_model_change_cursor (ETreeSelectionModel *etsm, ETreePath path) +e_tree_selection_model_change_cursor (ETreeSelectionModel *etsm, + ETreePath path) { gint row; diff --git a/widgets/table/e-tree-sorted.c b/widgets/table/e-tree-sorted.c index c92bb45c65..72b4cba091 100644 --- a/widgets/table/e-tree-sorted.c +++ b/widgets/table/e-tree-sorted.c @@ -169,7 +169,8 @@ ets_insert_idle (ETreeSorted *ets) #define CHECK_AROUND_LAST_ACCESS static inline ETreeSortedPath * -check_last_access (ETreeSorted *ets, ETreePath corresponding) +check_last_access (ETreeSorted *ets, + ETreePath corresponding) { #ifdef CHECK_AROUND_LAST_ACCESS ETreeSortedPath *parent; @@ -211,7 +212,8 @@ 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; @@ -268,7 +270,9 @@ 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; @@ -287,7 +291,8 @@ find_child_path (ETreeSorted *ets, ETreeSortedPath *parent, ETreePath correspond } static ETreeSortedPath * -find_or_create_path (ETreeSorted *ets, ETreePath corresponding) +find_or_create_path (ETreeSorted *ets, + ETreePath corresponding) { gint depth; ETreePath *sequence; @@ -367,7 +372,8 @@ free_path (ETreeSortedPath *path) } static ETreeSortedPath * -new_path (ETreeSortedPath *parent, ETreePath corresponding) +new_path (ETreeSortedPath *parent, + ETreePath corresponding) { ETreeSortedPath *path; @@ -388,7 +394,8 @@ new_path (ETreeSortedPath *parent, ETreePath corresponding) } static gboolean -reposition_path (ETreeSorted *ets, ETreeSortedPath *path) +reposition_path (ETreeSorted *ets, + ETreeSortedPath *path) { gint new_index; gint old_index = path->position; @@ -442,7 +449,8 @@ reposition_path (ETreeSorted *ets, ETreeSortedPath *path) } static void -regenerate_children (ETreeSorted *ets, ETreeSortedPath *path) +regenerate_children (ETreeSorted *ets, + ETreeSortedPath *path) { ETreeSortedPath **children; gint i; @@ -455,7 +463,8 @@ regenerate_children (ETreeSorted *ets, ETreeSortedPath *path) } static void -generate_children (ETreeSorted *ets, ETreeSortedPath *path) +generate_children (ETreeSorted *ets, + ETreeSortedPath *path) { ETreePath child; gint i; @@ -484,7 +493,11 @@ generate_children (ETreeSorted *ets, ETreeSortedPath *path) } static void -resort_node (ETreeSorted *ets, ETreeSortedPath *path, gboolean resort_all_children, gboolean needs_regen, gboolean send_signals) +resort_node (ETreeSorted *ets, + ETreeSortedPath *path, + gboolean resort_all_children, + gboolean needs_regen, + gboolean send_signals) { gboolean needs_resort; if (path) { @@ -532,7 +545,8 @@ resort_node (ETreeSorted *ets, ETreeSortedPath *path, gboolean resort_all_childr } static void -mark_path_child_needs_resort (ETreeSorted *ets, ETreeSortedPath *path) +mark_path_child_needs_resort (ETreeSorted *ets, + ETreeSortedPath *path) { if (path == NULL) return; @@ -543,7 +557,10 @@ mark_path_child_needs_resort (ETreeSorted *ets, ETreeSortedPath *path) } static void -mark_path_needs_resort (ETreeSorted *ets, ETreeSortedPath *path, gboolean needs_regen, gboolean resort_all_children) +mark_path_needs_resort (ETreeSorted *ets, + ETreeSortedPath *path, + gboolean needs_regen, + gboolean resort_all_children) { if (path == NULL) return; @@ -556,7 +573,10 @@ mark_path_needs_resort (ETreeSorted *ets, ETreeSortedPath *path, gboolean needs_ } static void -schedule_resort (ETreeSorted *ets, ETreeSortedPath *path, gboolean needs_regen, gboolean resort_all_children) +schedule_resort (ETreeSorted *ets, + ETreeSortedPath *path, + gboolean needs_regen, + gboolean resort_all_children) { ets->priv->insert_count = 0; if (ets->priv->insert_idle_id != 0) { @@ -681,14 +701,16 @@ ets_get_root (ETreeModel *etm) } static ETreePath -ets_get_parent (ETreeModel *etm, ETreePath node) +ets_get_parent (ETreeModel *etm, + ETreePath node) { ETreeSortedPath *path = node; return path->parent; } static ETreePath -ets_get_first_child (ETreeModel *etm, ETreePath node) +ets_get_first_child (ETreeModel *etm, + ETreePath node) { ETreeSortedPath *path = node; ETreeSorted *ets = E_TREE_SORTED (etm); @@ -703,7 +725,8 @@ ets_get_first_child (ETreeModel *etm, ETreePath node) } static ETreePath -ets_get_last_child (ETreeModel *etm, ETreePath node) +ets_get_last_child (ETreeModel *etm, + ETreePath node) { ETreeSortedPath *path = node; ETreeSorted *ets = E_TREE_SORTED (etm); @@ -718,7 +741,8 @@ ets_get_last_child (ETreeModel *etm, ETreePath node) } static ETreePath -ets_get_next (ETreeModel *etm, ETreePath node) +ets_get_next (ETreeModel *etm, + ETreePath node) { ETreeSortedPath *path = node; ETreeSortedPath *parent = path->parent; @@ -732,7 +756,8 @@ ets_get_next (ETreeModel *etm, ETreePath node) } static ETreePath -ets_get_prev (ETreeModel *etm, ETreePath node) +ets_get_prev (ETreeModel *etm, + ETreePath node) { ETreeSortedPath *path = node; ETreeSortedPath *parent = path->parent; @@ -746,7 +771,8 @@ ets_get_prev (ETreeModel *etm, ETreePath node) } static gboolean -ets_is_root (ETreeModel *etm, ETreePath node) +ets_is_root (ETreeModel *etm, + ETreePath node) { ETreeSortedPath *path = node; ETreeSorted *ets = E_TREE_SORTED (etm); @@ -755,7 +781,8 @@ ets_is_root (ETreeModel *etm, ETreePath node) } static gboolean -ets_is_expandable (ETreeModel *etm, ETreePath node) +ets_is_expandable (ETreeModel *etm, + ETreePath node) { ETreeSortedPath *path = node; ETreeSorted *ets = E_TREE_SORTED (etm); @@ -769,7 +796,9 @@ ets_is_expandable (ETreeModel *etm, ETreePath node) } static guint -ets_get_children (ETreeModel *etm, ETreePath node, ETreePath **nodes) +ets_get_children (ETreeModel *etm, + ETreePath node, + ETreePath **nodes) { ETreeSortedPath *path = node; guint n_children; @@ -793,7 +822,8 @@ ets_get_children (ETreeModel *etm, ETreePath node, ETreePath **nodes) } static guint -ets_depth (ETreeModel *etm, ETreePath node) +ets_depth (ETreeModel *etm, + ETreePath node) { ETreeSortedPath *path = node; ETreeSorted *ets = E_TREE_SORTED (etm); @@ -802,7 +832,8 @@ ets_depth (ETreeModel *etm, ETreePath node) } static GdkPixbuf * -ets_icon_at (ETreeModel *etm, ETreePath node) +ets_icon_at (ETreeModel *etm, + ETreePath node) { ETreeSortedPath *path = node; ETreeSorted *ets = E_TREE_SORTED (etm); @@ -833,7 +864,8 @@ ets_has_save_id (ETreeModel *etm) } static gchar * -ets_get_save_id (ETreeModel *etm, ETreePath node) +ets_get_save_id (ETreeModel *etm, + ETreePath node) { ETreeSorted *ets = E_TREE_SORTED (etm); ETreeSortedPath *path = node; @@ -852,7 +884,8 @@ ets_has_get_node_by_id (ETreeModel *etm) } static ETreePath -ets_get_node_by_id (ETreeModel *etm, const gchar *save_id) +ets_get_node_by_id (ETreeModel *etm, + const gchar *save_id) { ETreeSorted *ets = E_TREE_SORTED (etm); ETreePath node; @@ -871,7 +904,9 @@ ets_has_change_pending (ETreeModel *etm) } static gpointer -ets_value_at (ETreeModel *etm, ETreePath node, gint col) +ets_value_at (ETreeModel *etm, + ETreePath node, + gint col) { ETreeSorted *ets = E_TREE_SORTED (etm); ETreeSortedPath *path = node; @@ -880,7 +915,10 @@ ets_value_at (ETreeModel *etm, ETreePath node, gint col) } static void -ets_set_value_at (ETreeModel *etm, ETreePath node, gint col, gconstpointer val) +ets_set_value_at (ETreeModel *etm, + ETreePath node, + gint col, + gconstpointer val) { ETreeSorted *ets = E_TREE_SORTED (etm); ETreeSortedPath *path = node; @@ -889,7 +927,9 @@ ets_set_value_at (ETreeModel *etm, ETreePath node, gint col, gconstpointer val) } static gboolean -ets_is_editable (ETreeModel *etm, ETreePath node, gint col) +ets_is_editable (ETreeModel *etm, + ETreePath node, + gint col) { ETreeSorted *ets = E_TREE_SORTED (etm); ETreeSortedPath *path = node; @@ -899,7 +939,9 @@ ets_is_editable (ETreeModel *etm, ETreePath node, gint col) /* The default for ets_duplicate_value is to return the raw value. */ static gpointer -ets_duplicate_value (ETreeModel *etm, gint col, gconstpointer value) +ets_duplicate_value (ETreeModel *etm, + gint col, + gconstpointer value) { ETreeSorted *ets = E_TREE_SORTED (etm); @@ -907,7 +949,9 @@ ets_duplicate_value (ETreeModel *etm, gint col, gconstpointer value) } static void -ets_free_value (ETreeModel *etm, gint col, gpointer value) +ets_free_value (ETreeModel *etm, + gint col, + gpointer value) { ETreeSorted *ets = E_TREE_SORTED (etm); @@ -915,7 +959,8 @@ ets_free_value (ETreeModel *etm, gint col, gpointer value) } static gpointer -ets_initialize_value (ETreeModel *etm, gint col) +ets_initialize_value (ETreeModel *etm, + gint col) { ETreeSorted *ets = E_TREE_SORTED (etm); @@ -923,7 +968,9 @@ ets_initialize_value (ETreeModel *etm, gint col) } static gboolean -ets_value_is_empty (ETreeModel *etm, gint col, gconstpointer value) +ets_value_is_empty (ETreeModel *etm, + gint col, + gconstpointer value) { ETreeSorted *ets = E_TREE_SORTED (etm); @@ -931,7 +978,9 @@ ets_value_is_empty (ETreeModel *etm, gint col, gconstpointer value) } static gchar * -ets_value_to_string (ETreeModel *etm, gint col, gconstpointer value) +ets_value_to_string (ETreeModel *etm, + gint col, + gconstpointer value) { ETreeSorted *ets = E_TREE_SORTED (etm); @@ -941,19 +990,23 @@ ets_value_to_string (ETreeModel *etm, gint col, gconstpointer value) /* Proxy functions */ static void -ets_proxy_pre_change (ETreeModel *etm, ETreeSorted *ets) +ets_proxy_pre_change (ETreeModel *etm, + ETreeSorted *ets) { e_tree_model_pre_change (E_TREE_MODEL (ets)); } static void -ets_proxy_no_change (ETreeModel *etm, ETreeSorted *ets) +ets_proxy_no_change (ETreeModel *etm, + ETreeSorted *ets) { e_tree_model_no_change (E_TREE_MODEL (ets)); } static void -ets_proxy_node_changed (ETreeModel *etm, ETreePath node, ETreeSorted *ets) +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)); @@ -984,7 +1037,9 @@ ets_proxy_node_changed (ETreeModel *etm, ETreePath node, ETreeSorted *ets) } static void -ets_proxy_node_data_changed (ETreeModel *etm, ETreePath node, ETreeSorted *ets) +ets_proxy_node_data_changed (ETreeModel *etm, + ETreePath node, + ETreeSorted *ets) { ETreeSortedPath *path = find_path (ets, node); @@ -998,7 +1053,10 @@ ets_proxy_node_data_changed (ETreeModel *etm, ETreePath node, ETreeSorted *ets) } static void -ets_proxy_node_col_changed (ETreeModel *etm, ETreePath node, gint col, ETreeSorted *ets) +ets_proxy_node_col_changed (ETreeModel *etm, + ETreePath node, + gint col, + ETreeSorted *ets) { ETreeSortedPath *path = find_path (ets, node); @@ -1015,7 +1073,10 @@ ets_proxy_node_col_changed (ETreeModel *etm, ETreePath node, gint col, ETreeSort } static void -ets_proxy_node_inserted (ETreeModel *etm, ETreePath parent, ETreePath child, ETreeSorted *ets) +ets_proxy_node_inserted (ETreeModel *etm, + ETreePath parent, + ETreePath child, + ETreeSorted *ets) { ETreeSortedPath *parent_path = find_path (ets, parent); @@ -1083,7 +1144,11 @@ ets_proxy_node_inserted (ETreeModel *etm, ETreePath parent, ETreePath child, ETr } static void -ets_proxy_node_removed (ETreeModel *etm, ETreePath parent, ETreePath child, gint old_position, ETreeSorted *ets) +ets_proxy_node_removed (ETreeModel *etm, + ETreePath parent, + ETreePath child, + gint old_position, + ETreeSorted *ets) { ETreeSortedPath *parent_path = find_path (ets, parent); ETreeSortedPath *path; @@ -1120,13 +1185,17 @@ ets_proxy_node_removed (ETreeModel *etm, ETreePath parent, ETreePath child, gint } static void -ets_proxy_node_deleted (ETreeModel *etm, ETreePath child, ETreeSorted *ets) +ets_proxy_node_deleted (ETreeModel *etm, + ETreePath child, + ETreeSorted *ets) { e_tree_model_node_deleted (E_TREE_MODEL (ets), NULL); } static void -ets_proxy_node_request_collapse (ETreeModel *etm, ETreePath node, ETreeSorted *ets) +ets_proxy_node_request_collapse (ETreeModel *etm, + ETreePath node, + ETreeSorted *ets) { ETreeSortedPath *path = find_path (ets, node); if (path) { @@ -1135,7 +1204,8 @@ ets_proxy_node_request_collapse (ETreeModel *etm, ETreePath node, ETreeSorted *e } static void -ets_sort_info_changed (ETableSortInfo *sort_info, ETreeSorted *ets) +ets_sort_info_changed (ETableSortInfo *sort_info, + ETreeSorted *ets) { schedule_resort (ets, ets->priv->root, TRUE, TRUE); } @@ -1216,7 +1286,10 @@ e_tree_sorted_init (ETreeSorted *ets) * **/ void -e_tree_sorted_construct (ETreeSorted *ets, ETreeModel *source, ETableHeader *full_header, ETableSortInfo *sort_info) +e_tree_sorted_construct (ETreeSorted *ets, + ETreeModel *source, + ETableHeader *full_header, + ETableSortInfo *sort_info) { ets->priv->source = source; if (source) @@ -1228,24 +1301,33 @@ e_tree_sorted_construct (ETreeSorted *ets, ETreeModel *source, ETableHeader *ful e_tree_sorted_set_sort_info (ets, sort_info); - ets->priv->tree_model_pre_change_id = g_signal_connect (G_OBJECT (source), "pre_change", - G_CALLBACK (ets_proxy_pre_change), ets); - ets->priv->tree_model_no_change_id = g_signal_connect (G_OBJECT (source), "no_change", - G_CALLBACK (ets_proxy_no_change), ets); - ets->priv->tree_model_node_changed_id = g_signal_connect (G_OBJECT (source), "node_changed", - G_CALLBACK (ets_proxy_node_changed), ets); - ets->priv->tree_model_node_data_changed_id = g_signal_connect (G_OBJECT (source), "node_data_changed", - G_CALLBACK (ets_proxy_node_data_changed), ets); - ets->priv->tree_model_node_col_changed_id = g_signal_connect (G_OBJECT (source), "node_col_changed", - G_CALLBACK (ets_proxy_node_col_changed), ets); - ets->priv->tree_model_node_inserted_id = g_signal_connect (G_OBJECT (source), "node_inserted", - G_CALLBACK (ets_proxy_node_inserted), ets); - ets->priv->tree_model_node_removed_id = g_signal_connect (G_OBJECT (source), "node_removed", - G_CALLBACK (ets_proxy_node_removed), ets); - ets->priv->tree_model_node_deleted_id = g_signal_connect (G_OBJECT (source), "node_deleted", - G_CALLBACK (ets_proxy_node_deleted), ets); - ets->priv->tree_model_node_request_collapse_id = g_signal_connect (G_OBJECT (source), "node_request_collapse", - G_CALLBACK (ets_proxy_node_request_collapse), ets); + ets->priv->tree_model_pre_change_id = g_signal_connect ( + source, "pre_change", + G_CALLBACK (ets_proxy_pre_change), ets); + ets->priv->tree_model_no_change_id = g_signal_connect ( + source, "no_change", + G_CALLBACK (ets_proxy_no_change), ets); + ets->priv->tree_model_node_changed_id = g_signal_connect ( + source, "node_changed", + G_CALLBACK (ets_proxy_node_changed), ets); + ets->priv->tree_model_node_data_changed_id = g_signal_connect ( + source, "node_data_changed", + G_CALLBACK (ets_proxy_node_data_changed), ets); + ets->priv->tree_model_node_col_changed_id = g_signal_connect ( + source, "node_col_changed", + G_CALLBACK (ets_proxy_node_col_changed), ets); + ets->priv->tree_model_node_inserted_id = g_signal_connect ( + source, "node_inserted", + G_CALLBACK (ets_proxy_node_inserted), ets); + ets->priv->tree_model_node_removed_id = g_signal_connect ( + source, "node_removed", + G_CALLBACK (ets_proxy_node_removed), ets); + ets->priv->tree_model_node_deleted_id = g_signal_connect ( + source, "node_deleted", + G_CALLBACK (ets_proxy_node_deleted), ets); + ets->priv->tree_model_node_request_collapse_id = g_signal_connect ( + source, "node_request_collapse", + G_CALLBACK (ets_proxy_node_request_collapse), ets); } @@ -1257,7 +1339,9 @@ e_tree_sorted_construct (ETreeSorted *ets, ETreeModel *source, ETableHeader *ful * return values: a newly constructed ETreeSorted. */ ETreeSorted * -e_tree_sorted_new (ETreeModel *source, ETableHeader *full_header, ETableSortInfo *sort_info) +e_tree_sorted_new (ETreeModel *source, + ETableHeader *full_header, + ETableSortInfo *sort_info) { ETreeSorted *ets = g_object_new (E_TYPE_TREE_SORTED, NULL); @@ -1267,8 +1351,8 @@ e_tree_sorted_new (ETreeModel *source, ETableHeader *full_header, ETableSortInfo } ETreePath -e_tree_sorted_view_to_model_path (ETreeSorted *ets, - ETreePath view_path) +e_tree_sorted_view_to_model_path (ETreeSorted *ets, + ETreePath view_path) { ETreeSortedPath *path = view_path; if (path) { @@ -1280,23 +1364,23 @@ e_tree_sorted_view_to_model_path (ETreeSorted *ets, } ETreePath -e_tree_sorted_model_to_view_path (ETreeSorted *ets, - ETreePath model_path) +e_tree_sorted_model_to_view_path (ETreeSorted *ets, + ETreePath model_path) { return find_or_create_path (ets, model_path); } gint -e_tree_sorted_orig_position (ETreeSorted *ets, - ETreePath path) +e_tree_sorted_orig_position (ETreeSorted *ets, + ETreePath path) { ETreeSortedPath *sorted_path = path; return sorted_path->orig_position; } gint -e_tree_sorted_node_num_children (ETreeSorted *ets, - ETreePath path) +e_tree_sorted_node_num_children (ETreeSorted *ets, + ETreePath path) { ETreeSortedPath *sorted_path = path; @@ -1308,7 +1392,8 @@ e_tree_sorted_node_num_children (ETreeSorted *ets, } void -e_tree_sorted_node_resorted (ETreeSorted *sorted, ETreePath node) +e_tree_sorted_node_resorted (ETreeSorted *sorted, + ETreePath node) { g_return_if_fail (sorted != NULL); g_return_if_fail (E_IS_TREE_SORTED (sorted)); @@ -1317,7 +1402,8 @@ e_tree_sorted_node_resorted (ETreeSorted *sorted, ETreePath node) } void -e_tree_sorted_set_sort_info (ETreeSorted *ets, ETableSortInfo *sort_info) +e_tree_sorted_set_sort_info (ETreeSorted *ets, + ETableSortInfo *sort_info) { g_return_if_fail (ets != NULL); @@ -1333,15 +1419,16 @@ 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); - 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); + ets->priv->sort_info_changed_id = g_signal_connect ( + ets->priv->sort_info, "sort_info_changed", + G_CALLBACK (ets_sort_info_changed), ets); } if (ets->priv->root) schedule_resort (ets, ets->priv->root, TRUE, TRUE); } -ETableSortInfo* +ETableSortInfo * e_tree_sorted_get_sort_info (ETreeSorted *ets) { return ets->priv->sort_info; diff --git a/widgets/table/e-tree-table-adapter.c b/widgets/table/e-tree-table-adapter.c index 4cfd74fe68..1b87211c7b 100644 --- a/widgets/table/e-tree-table-adapter.c +++ b/widgets/table/e-tree-table-adapter.c @@ -98,7 +98,8 @@ struct _ETreeTableAdapterPrivate { 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; @@ -111,7 +112,8 @@ lookup_gnode (ETreeTableAdapter *etta, ETreePath path) } 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); @@ -122,7 +124,10 @@ 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; @@ -131,7 +136,9 @@ move_map_elements (ETreeTableAdapter *etta, gint to, gint from, gint count) } static gint -fill_map (ETreeTableAdapter *etta, gint index, GNode *gnode) +fill_map (ETreeTableAdapter *etta, + gint index, + GNode *gnode) { GNode *p; @@ -155,7 +162,8 @@ 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); @@ -166,7 +174,9 @@ 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; @@ -217,7 +227,8 @@ resort_node (ETreeTableAdapter *etta, GNode *gnode, gboolean recurse) } static gint -get_row (ETreeTableAdapter *etta, ETreePath path) +get_row (ETreeTableAdapter *etta, + ETreePath path) { node_t *node = get_node (etta, path); if (!node) @@ -230,7 +241,8 @@ get_row (ETreeTableAdapter *etta, ETreePath path) } static ETreePath -get_path (ETreeTableAdapter *etta, gint row) +get_path (ETreeTableAdapter *etta, + gint row) { if (row == -1 && etta->priv->n_map > 0) row = etta->priv->n_map - 1; @@ -241,7 +253,8 @@ get_path (ETreeTableAdapter *etta, gint row) } 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); @@ -258,7 +271,8 @@ kill_gnode (GNode *node, ETreeTableAdapter *etta) } 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; @@ -268,7 +282,8 @@ 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; @@ -286,7 +301,9 @@ 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); @@ -325,7 +342,8 @@ delete_node (ETreeTableAdapter *etta, ETreePath parent, ETreePath path) } static GNode * -create_gnode (ETreeTableAdapter *etta, ETreePath path) +create_gnode (ETreeTableAdapter *etta, + ETreePath path) { GNode *gnode; node_t *node; @@ -343,7 +361,8 @@ create_gnode (ETreeTableAdapter *etta, ETreePath path) } static gint -insert_children (ETreeTableAdapter *etta, GNode *gnode) +insert_children (ETreeTableAdapter *etta, + GNode *gnode) { ETreePath path, tmp; gint count = 0; @@ -365,7 +384,8 @@ insert_children (ETreeTableAdapter *etta, GNode *gnode) } static void -generate_tree (ETreeTableAdapter *etta, ETreePath path) +generate_tree (ETreeTableAdapter *etta, + ETreePath path) { GNode *gnode; node_t *node; @@ -394,7 +414,9 @@ generate_tree (ETreeTableAdapter *etta, ETreePath path) } 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; @@ -467,7 +489,8 @@ 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; @@ -479,7 +502,8 @@ check_expanded (GNode *gnode, gpointer data) } 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); @@ -595,7 +619,8 @@ etta_has_save_id (ETableModel *etm) } static gchar * -etta_get_save_id (ETableModel *etm, gint row) +etta_get_save_id (ETableModel *etm, + gint row) { ETreeTableAdapter *etta = (ETreeTableAdapter *) etm; @@ -619,7 +644,9 @@ etta_row_count (ETableModel *etm) } static gpointer -etta_value_at (ETableModel *etm, gint col, gint row) +etta_value_at (ETableModel *etm, + gint col, + gint row) { ETreeTableAdapter *etta = (ETreeTableAdapter *) etm; @@ -638,7 +665,10 @@ etta_value_at (ETableModel *etm, gint col, gint row) } static void -etta_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) +etta_set_value_at (ETableModel *etm, + gint col, + gint row, + gconstpointer val) { ETreeTableAdapter *etta = (ETreeTableAdapter *) etm; @@ -646,7 +676,9 @@ etta_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) } static gboolean -etta_is_cell_editable (ETableModel *etm, gint col, gint row) +etta_is_cell_editable (ETableModel *etm, + gint col, + gint row) { ETreeTableAdapter *etta = (ETreeTableAdapter *) etm; @@ -654,12 +686,16 @@ etta_is_cell_editable (ETableModel *etm, gint col, gint row) } static void -etta_append_row (ETableModel *etm, ETableModel *source, gint row) +etta_append_row (ETableModel *etm, + ETableModel *source, + gint row) { } static gpointer -etta_duplicate_value (ETableModel *etm, gint col, gconstpointer value) +etta_duplicate_value (ETableModel *etm, + gint col, + gconstpointer value) { ETreeTableAdapter *etta = (ETreeTableAdapter *) etm; @@ -667,7 +703,9 @@ etta_duplicate_value (ETableModel *etm, gint col, gconstpointer value) } static void -etta_free_value (ETableModel *etm, gint col, gpointer value) +etta_free_value (ETableModel *etm, + gint col, + gpointer value) { ETreeTableAdapter *etta = (ETreeTableAdapter *) etm; @@ -675,7 +713,8 @@ etta_free_value (ETableModel *etm, gint col, gpointer value) } static gpointer -etta_initialize_value (ETableModel *etm, gint col) +etta_initialize_value (ETableModel *etm, + gint col) { ETreeTableAdapter *etta = (ETreeTableAdapter *) etm; @@ -683,7 +722,9 @@ etta_initialize_value (ETableModel *etm, gint col) } static gboolean -etta_value_is_empty (ETableModel *etm, gint col, gconstpointer value) +etta_value_is_empty (ETableModel *etm, + gint col, + gconstpointer value) { ETreeTableAdapter *etta = (ETreeTableAdapter *) etm; @@ -691,7 +732,9 @@ etta_value_is_empty (ETableModel *etm, gint col, gconstpointer value) } static gchar * -etta_value_to_string (ETableModel *etm, gint col, gconstpointer value) +etta_value_to_string (ETableModel *etm, + gint col, + gconstpointer value) { ETreeTableAdapter *etta = (ETreeTableAdapter *) etm; @@ -752,19 +795,22 @@ etta_init (ETreeTableAdapter *etta) } static void -etta_proxy_pre_change (ETreeModel *etm, ETreeTableAdapter *etta) +etta_proxy_pre_change (ETreeModel *etm, + ETreeTableAdapter *etta) { e_table_model_pre_change (E_TABLE_MODEL (etta)); } static void -etta_proxy_no_change (ETreeModel *etm, ETreeTableAdapter *etta) +etta_proxy_no_change (ETreeModel *etm, + ETreeTableAdapter *etta) { e_table_model_no_change (E_TABLE_MODEL (etta)); } static void -etta_proxy_rebuilt (ETreeModel *etm, ETreeTableAdapter *etta) +etta_proxy_rebuilt (ETreeModel *etm, + ETreeTableAdapter *etta) { if (!etta->priv->root) return; @@ -783,7 +829,9 @@ resort_model (ETreeTableAdapter *etta) } static void -etta_proxy_node_changed (ETreeModel *etm, ETreePath path, ETreeTableAdapter *etta) +etta_proxy_node_changed (ETreeModel *etm, + ETreePath path, + ETreeTableAdapter *etta) { update_node (etta, path); e_table_model_changed (E_TABLE_MODEL (etta)); @@ -796,7 +844,9 @@ etta_proxy_node_changed (ETreeModel *etm, ETreePath path, ETreeTableAdapter *ett } static void -etta_proxy_node_data_changed (ETreeModel *etm, ETreePath path, ETreeTableAdapter *etta) +etta_proxy_node_data_changed (ETreeModel *etm, + ETreePath path, + ETreeTableAdapter *etta) { gint row = get_row (etta, path); @@ -809,7 +859,10 @@ etta_proxy_node_data_changed (ETreeModel *etm, ETreePath path, ETreeTableAdapter } static void -etta_proxy_node_col_changed (ETreeModel *etm, ETreePath path, gint col, ETreeTableAdapter *etta) +etta_proxy_node_col_changed (ETreeModel *etm, + ETreePath path, + gint col, + ETreeTableAdapter *etta) { gint row = get_row (etta, path); @@ -822,7 +875,10 @@ etta_proxy_node_col_changed (ETreeModel *etm, ETreePath path, gint col, ETreeTab } static void -etta_proxy_node_inserted (ETreeModel *etm, ETreePath parent, ETreePath child, ETreeTableAdapter *etta) +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); @@ -833,26 +889,33 @@ etta_proxy_node_inserted (ETreeModel *etm, ETreePath parent, ETreePath child, ET } static void -etta_proxy_node_removed (ETreeModel *etm, ETreePath parent, ETreePath child, gint old_position, ETreeTableAdapter *etta) +etta_proxy_node_removed (ETreeModel *etm, + ETreePath parent, + ETreePath child, + gint old_position, + ETreeTableAdapter *etta) { delete_node (etta, parent, child); e_table_model_changed (E_TABLE_MODEL (etta)); } static void -etta_proxy_node_request_collapse (ETreeModel *etm, ETreePath node, ETreeTableAdapter *etta) +etta_proxy_node_request_collapse (ETreeModel *etm, + ETreePath node, + ETreeTableAdapter *etta) { e_tree_table_adapter_node_set_expanded (etta, node, FALSE); } static void -etta_sort_info_changed (ETableSortInfo *sort_info, ETreeTableAdapter *etta) +etta_sort_info_changed (ETableSortInfo *sort_info, + ETreeTableAdapter *etta) { if (!etta->priv->root) return; /* the function is called also internally, with sort_info = NULL, - thus skip those in signal emit */ + * thus skip those in signal emit */ if (sort_info) { gboolean handled = FALSE; @@ -869,7 +932,10 @@ etta_sort_info_changed (ETableSortInfo *sort_info, ETreeTableAdapter *etta) } ETableModel * -e_tree_table_adapter_construct (ETreeTableAdapter *etta, ETreeModel *source, ETableSortInfo *sort_info, ETableHeader *header) +e_tree_table_adapter_construct (ETreeTableAdapter *etta, + ETreeModel *source, + ETableSortInfo *sort_info, + ETableHeader *header) { ETreePath root; @@ -879,8 +945,9 @@ e_tree_table_adapter_construct (ETreeTableAdapter *etta, ETreeModel *source, ETa etta->priv->sort_info = sort_info; if (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->sort_info_changed_id = g_signal_connect ( + sort_info, "sort_info_changed", + G_CALLBACK (etta_sort_info_changed), etta); } etta->priv->header = header; @@ -894,30 +961,41 @@ e_tree_table_adapter_construct (ETreeTableAdapter *etta, ETreeModel *source, ETa if (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); - etta->priv->no_change_id = g_signal_connect (G_OBJECT (source), "no_change", - G_CALLBACK (etta_proxy_no_change), etta); - etta->priv->rebuilt_id = g_signal_connect (G_OBJECT (source), "rebuilt", - G_CALLBACK (etta_proxy_rebuilt), etta); - etta->priv->node_changed_id = g_signal_connect (G_OBJECT (source), "node_changed", - G_CALLBACK (etta_proxy_node_changed), etta); - etta->priv->node_data_changed_id = g_signal_connect (G_OBJECT (source), "node_data_changed", - G_CALLBACK (etta_proxy_node_data_changed), etta); - etta->priv->node_col_changed_id = g_signal_connect (G_OBJECT (source), "node_col_changed", - G_CALLBACK (etta_proxy_node_col_changed), etta); - etta->priv->node_inserted_id = g_signal_connect (G_OBJECT (source), "node_inserted", - G_CALLBACK (etta_proxy_node_inserted), etta); - etta->priv->node_removed_id = g_signal_connect (G_OBJECT (source), "node_removed", - G_CALLBACK (etta_proxy_node_removed), etta); - etta->priv->node_request_collapse_id = g_signal_connect (G_OBJECT (source), "node_request_collapse", - G_CALLBACK (etta_proxy_node_request_collapse), etta); + etta->priv->pre_change_id = g_signal_connect ( + source, "pre_change", + G_CALLBACK (etta_proxy_pre_change), etta); + etta->priv->no_change_id = g_signal_connect ( + source, "no_change", + G_CALLBACK (etta_proxy_no_change), etta); + etta->priv->rebuilt_id = g_signal_connect ( + source, "rebuilt", + G_CALLBACK (etta_proxy_rebuilt), etta); + etta->priv->node_changed_id = g_signal_connect ( + source, "node_changed", + G_CALLBACK (etta_proxy_node_changed), etta); + etta->priv->node_data_changed_id = g_signal_connect ( + source, "node_data_changed", + G_CALLBACK (etta_proxy_node_data_changed), etta); + etta->priv->node_col_changed_id = g_signal_connect ( + source, "node_col_changed", + G_CALLBACK (etta_proxy_node_col_changed), etta); + etta->priv->node_inserted_id = g_signal_connect ( + source, "node_inserted", + G_CALLBACK (etta_proxy_node_inserted), etta); + etta->priv->node_removed_id = g_signal_connect ( + source, "node_removed", + G_CALLBACK (etta_proxy_node_removed), etta); + etta->priv->node_request_collapse_id = g_signal_connect ( + source, "node_request_collapse", + G_CALLBACK (etta_proxy_node_request_collapse), etta); return E_TABLE_MODEL (etta); } ETableModel * -e_tree_table_adapter_new (ETreeModel *source, ETableSortInfo *sort_info, ETableHeader *header) +e_tree_table_adapter_new (ETreeModel *source, + ETableSortInfo *sort_info, + ETableHeader *header) { ETreeTableAdapter *etta = g_object_new (E_TYPE_TREE_TABLE_ADAPTER, NULL); @@ -933,7 +1011,9 @@ typedef struct { } TreeAndRoot; static void -save_expanded_state_func (gpointer keyp, gpointer value, gpointer data) +save_expanded_state_func (gpointer keyp, + gpointer value, + gpointer data) { ETreePath path = keyp; node_t *node = ((GNode *) value)->data; @@ -974,7 +1054,8 @@ e_tree_table_adapter_save_expanded_state_xml (ETreeTableAdapter *etta) } void -e_tree_table_adapter_save_expanded_state (ETreeTableAdapter *etta, const gchar *filename) +e_tree_table_adapter_save_expanded_state (ETreeTableAdapter *etta, + const gchar *filename) { xmlDoc *doc; @@ -988,7 +1069,8 @@ e_tree_table_adapter_save_expanded_state (ETreeTableAdapter *etta, const gchar * } static xmlDoc * -open_file (ETreeTableAdapter *etta, const gchar *filename) +open_file (ETreeTableAdapter *etta, + const gchar *filename) { xmlDoc *doc; xmlNode *root; @@ -1034,7 +1116,8 @@ open_file (ETreeTableAdapter *etta, const gchar *filename) /* state: <0 ... collapse; 0 ... use default; >0 ... expand */ void -e_tree_table_adapter_force_expanded_state (ETreeTableAdapter *etta, gint state) +e_tree_table_adapter_force_expanded_state (ETreeTableAdapter *etta, + gint state) { g_return_if_fail (etta != NULL); @@ -1042,7 +1125,8 @@ e_tree_table_adapter_force_expanded_state (ETreeTableAdapter *etta, gint state) } void -e_tree_table_adapter_load_expanded_state_xml (ETreeTableAdapter *etta, xmlDoc *doc) +e_tree_table_adapter_load_expanded_state_xml (ETreeTableAdapter *etta, + xmlDoc *doc) { xmlNode *root, *child; gboolean model_default; @@ -1104,7 +1188,8 @@ e_tree_table_adapter_load_expanded_state_xml (ETreeTableAdapter *etta, xmlDoc *d } void -e_tree_table_adapter_load_expanded_state (ETreeTableAdapter *etta, const gchar *filename) +e_tree_table_adapter_load_expanded_state (ETreeTableAdapter *etta, + const gchar *filename) { xmlDoc *doc; @@ -1120,7 +1205,8 @@ e_tree_table_adapter_load_expanded_state (ETreeTableAdapter *etta, const gchar * } void -e_tree_table_adapter_root_node_set_visible (ETreeTableAdapter *etta, gboolean visible) +e_tree_table_adapter_root_node_set_visible (ETreeTableAdapter *etta, + gboolean visible) { gint size; @@ -1145,7 +1231,9 @@ e_tree_table_adapter_root_node_set_visible (ETreeTableAdapter *etta, gboolean vi } void -e_tree_table_adapter_node_set_expanded (ETreeTableAdapter *etta, ETreePath path, gboolean expanded) +e_tree_table_adapter_node_set_expanded (ETreeTableAdapter *etta, + ETreePath path, + gboolean expanded) { GNode *gnode = lookup_gnode (etta, path); node_t *node; @@ -1203,7 +1291,9 @@ e_tree_table_adapter_node_set_expanded (ETreeTableAdapter *etta, ETreePath path, } void -e_tree_table_adapter_node_set_expanded_recurse (ETreeTableAdapter *etta, ETreePath path, gboolean expanded) +e_tree_table_adapter_node_set_expanded_recurse (ETreeTableAdapter *etta, + ETreePath path, + gboolean expanded) { ETreePath children; @@ -1217,13 +1307,15 @@ e_tree_table_adapter_node_set_expanded_recurse (ETreeTableAdapter *etta, ETreePa } ETreePath -e_tree_table_adapter_node_at_row (ETreeTableAdapter *etta, gint row) +e_tree_table_adapter_node_at_row (ETreeTableAdapter *etta, + gint row) { return get_path (etta, row); } gint -e_tree_table_adapter_row_of_node (ETreeTableAdapter *etta, ETreePath path) +e_tree_table_adapter_row_of_node (ETreeTableAdapter *etta, + ETreePath path) { return get_row (etta, path); } @@ -1235,7 +1327,8 @@ e_tree_table_adapter_root_node_is_visible (ETreeTableAdapter *etta) } void -e_tree_table_adapter_show_node (ETreeTableAdapter *etta, ETreePath path) +e_tree_table_adapter_show_node (ETreeTableAdapter *etta, + ETreePath path) { ETreePath parent; @@ -1248,7 +1341,8 @@ e_tree_table_adapter_show_node (ETreeTableAdapter *etta, ETreePath path) } gboolean -e_tree_table_adapter_node_is_expanded (ETreeTableAdapter *etta, ETreePath path) +e_tree_table_adapter_node_is_expanded (ETreeTableAdapter *etta, + ETreePath path) { node_t *node = get_node (etta, path); if (!e_tree_model_node_is_expandable (etta->priv->source, path) || !node) @@ -1258,7 +1352,8 @@ e_tree_table_adapter_node_is_expanded (ETreeTableAdapter *etta, ETreePath path) } void -e_tree_table_adapter_set_sort_info (ETreeTableAdapter *etta, ETableSortInfo *sort_info) +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), @@ -1269,8 +1364,9 @@ e_tree_table_adapter_set_sort_info (ETreeTableAdapter *etta, ETableSortInfo *sor etta->priv->sort_info = sort_info; if (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->sort_info_changed_id = g_signal_connect ( + sort_info, "sort_info_changed", + G_CALLBACK (etta_sort_info_changed), etta); } if (!etta->priv->root) @@ -1299,7 +1395,8 @@ e_tree_table_adapter_get_header (ETreeTableAdapter *etta) } ETreePath -e_tree_table_adapter_node_get_next (ETreeTableAdapter *etta, ETreePath path) +e_tree_table_adapter_node_get_next (ETreeTableAdapter *etta, + ETreePath path) { GNode *node = lookup_gnode (etta, path); diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c index 996a6b1e51..770b2ad653 100644 --- a/widgets/table/e-tree.c +++ b/widgets/table/e-tree.c @@ -303,13 +303,15 @@ e_tree_state_change (ETree *et) } static void -change_trigger (GObject *object, ETree *et) +change_trigger (GObject *object, + ETree *et) { e_tree_state_change (et); } static void -search_col_change_trigger (GObject *object, ETree *et) +search_col_change_trigger (GObject *object, + ETree *et) { clear_current_search_col (et); e_tree_state_change (et); @@ -343,7 +345,8 @@ disconnect_header (ETree *e_tree) } static void -connect_header (ETree *e_tree, ETableState *state) +connect_header (ETree *e_tree, + ETableState *state) { GValue *val = g_new0 (GValue, 1); @@ -489,7 +492,9 @@ typedef struct { } SearchSearchStruct; static gboolean -search_search_callback (ETreeModel *model, ETreePath path, gpointer data) +search_search_callback (ETreeModel *model, + ETreePath path, + gpointer data) { SearchSearchStruct *cb_data = data; gconstpointer value; @@ -561,7 +566,8 @@ et_search_search (ETableSearch *search, } static void -et_search_accept (ETableSearch *search, ETree *et) +et_search_accept (ETableSearch *search, + ETree *et) { ETableCol *col = current_search_col (et); gint cursor; @@ -609,12 +615,13 @@ e_tree_init (ETree *e_tree) e_tree->priv->search = e_table_search_new (); - e_tree->priv->search_search_id = - g_signal_connect (G_OBJECT (e_tree->priv->search), "search", - G_CALLBACK (et_search_search), e_tree); - e_tree->priv->search_accept_id = - g_signal_connect (G_OBJECT (e_tree->priv->search), "accept", - G_CALLBACK (et_search_accept), e_tree); + e_tree->priv->search_search_id = g_signal_connect ( + e_tree->priv->search, "search", + G_CALLBACK (et_search_search), e_tree); + + e_tree->priv->search_accept_id = g_signal_connect ( + e_tree->priv->search, "accept", + G_CALLBACK (et_search_accept), e_tree); e_tree->priv->always_search = g_getenv ("GAL_ALWAYS_SEARCH") ? TRUE : FALSE; } @@ -632,7 +639,8 @@ et_grab_focus (GtkWidget *widget) /* Focus handler for the ETree */ static gint -et_focus (GtkWidget *container, GtkDirectionType direction) +et_focus (GtkWidget *container, + GtkDirectionType direction) { ETree *e_tree; @@ -670,7 +678,9 @@ set_header_canvas_width (ETree *e_tree) } static void -header_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, ETree *e_tree) +header_canvas_size_allocate (GtkWidget *widget, + GtkAllocation *alloc, + ETree *e_tree) { GtkAllocation allocation; @@ -680,9 +690,9 @@ header_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, ETree *e_t gtk_widget_get_allocation (widget, &allocation); /* When the header item is created ->height == 0, - as the font is only created when everything is realized. - So we set the usize here as well, so that the size of the - header is correct */ + * as the font is only created when everything is realized. + * So we set the usize here as well, so that the size of the + * header is correct */ if (allocation.height != E_TABLE_HEADER_ITEM (e_tree->priv->header_item)->height) gtk_widget_set_size_request ( widget, -1, @@ -804,8 +814,9 @@ tree_canvas_reflow_idle (ETree *e_tree) } static void -tree_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, - ETree *e_tree) +tree_canvas_size_allocate (GtkWidget *widget, + GtkAllocation *alloc, + ETree *e_tree) { gdouble width; gdouble height; @@ -831,7 +842,8 @@ tree_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, } static void -tree_canvas_reflow (GnomeCanvas *canvas, ETree *e_tree) +tree_canvas_reflow (GnomeCanvas *canvas, + ETree *e_tree) { if (!e_tree->priv->reflow_idle_id) e_tree->priv->reflow_idle_id = g_idle_add_full ( @@ -840,7 +852,9 @@ tree_canvas_reflow (GnomeCanvas *canvas, ETree *e_tree) } static void -item_cursor_change (ETableItem *eti, gint row, ETree *et) +item_cursor_change (ETableItem *eti, + gint row, + ETree *et) { ETreePath path = e_tree_table_adapter_node_at_row (et->priv->etta, row); @@ -848,7 +862,9 @@ item_cursor_change (ETableItem *eti, gint row, ETree *et) } static void -item_cursor_activated (ETableItem *eti, gint row, ETree *et) +item_cursor_activated (ETableItem *eti, + gint row, + ETree *et) { ETreePath path = e_tree_table_adapter_node_at_row (et->priv->etta, row); @@ -856,7 +872,11 @@ item_cursor_activated (ETableItem *eti, gint row, ETree *et) } static void -item_double_click (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et) +item_double_click (ETableItem *eti, + gint row, + gint col, + GdkEvent *event, + ETree *et) { ETreePath path = e_tree_table_adapter_node_at_row (et->priv->etta, row); @@ -864,7 +884,11 @@ 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) +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); gboolean return_val = 0; @@ -877,7 +901,11 @@ item_right_click (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *e } static gboolean -item_click (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et) +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); @@ -889,7 +917,11 @@ item_click (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et) } static gint -item_key_press (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et) +item_key_press (ETableItem *eti, + gint row, + gint col, + GdkEvent *event, + ETree *et) { gint return_val = 0; GdkEventKey *key = (GdkEventKey *) event; @@ -1000,7 +1032,11 @@ item_key_press (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et) } static gint -item_start_drag (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et) +item_start_drag (ETableItem *eti, + gint row, + gint col, + GdkEvent *event, + ETree *et) { ETreePath path; gint return_val = 0; @@ -1015,7 +1051,8 @@ item_start_drag (ETableItem *eti, gint row, gint col, GdkEvent *event, ETree *et } static void -et_selection_model_selection_changed (ETableSelectionModel *etsm, ETree *et) +et_selection_model_selection_changed (ETableSelectionModel *etsm, + ETree *et) { g_signal_emit (et, et_signals[SELECTION_CHANGE], 0); } @@ -1064,7 +1101,8 @@ et_build_item (ETree *et) } static void -et_canvas_style_set (GtkWidget *widget, GtkStyle *prev_style) +et_canvas_style_set (GtkWidget *widget, + GtkStyle *prev_style) { GtkStyle *style; @@ -1077,7 +1115,9 @@ et_canvas_style_set (GtkWidget *widget, GtkStyle *prev_style) } static gboolean -white_item_event (GnomeCanvasItem *white_item, GdkEvent *event, ETree *e_tree) +white_item_event (GnomeCanvasItem *white_item, + GdkEvent *event, + ETree *e_tree) { gboolean return_val = 0; g_signal_emit (e_tree, @@ -1087,7 +1127,9 @@ white_item_event (GnomeCanvasItem *white_item, GdkEvent *event, ETree *e_tree) } static gint -et_canvas_root_event (GnomeCanvasItem *root, GdkEvent *event, ETree *e_tree) +et_canvas_root_event (GnomeCanvasItem *root, + GdkEvent *event, + ETree *e_tree) { switch (event->type) { case GDK_BUTTON_PRESS: @@ -1115,7 +1157,9 @@ et_canvas_root_event (GnomeCanvasItem *root, GdkEvent *event, ETree *e_tree) * and give the focus to some ETableItem. */ static gint -table_canvas_focus_event_cb (GtkWidget *widget, GdkEventFocus *event, gpointer data) +table_canvas_focus_event_cb (GtkWidget *widget, + GdkEventFocus *event, + gpointer data) { GnomeCanvas *canvas; ETree *tree; @@ -1213,7 +1257,8 @@ e_tree_setup_table (ETree *e_tree) * search column is cleared. */ void -e_tree_set_search_column (ETree *e_tree, gint col) +e_tree_set_search_column (ETree *e_tree, + gint col) { if (col == -1) { clear_current_search_col (e_tree); @@ -1226,7 +1271,8 @@ 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; @@ -1271,8 +1317,8 @@ e_tree_set_state_object (ETree *e_tree, ETableState *state) * #ETree object. */ void -e_tree_set_state (ETree *e_tree, - const gchar *state_str) +e_tree_set_state (ETree *e_tree, + const gchar *state_str) { ETableState *state; @@ -1298,8 +1344,8 @@ e_tree_set_state (ETree *e_tree, * @e_tree object. */ void -e_tree_load_state (ETree *e_tree, - const gchar *filename) +e_tree_load_state (ETree *e_tree, + const gchar *filename) { ETableState *state; @@ -1388,8 +1434,8 @@ e_tree_get_state (ETree *e_tree) * @filename. **/ void -e_tree_save_state (ETree *e_tree, - const gchar *filename) +e_tree_save_state (ETree *e_tree, + const gchar *filename) { ETableState *state; @@ -1413,26 +1459,35 @@ e_tree_get_spec (ETree *e_tree) } static void -et_table_model_changed (ETableModel *model, ETree *et) +et_table_model_changed (ETableModel *model, + ETree *et) { if (et->priv->horizontal_scrolling) e_table_header_update_horizontal (et->priv->header); } static void -et_table_row_changed (ETableModel *table_model, gint row, ETree *et) +et_table_row_changed (ETableModel *table_model, + gint row, + ETree *et) { et_table_model_changed (table_model, et); } static void -et_table_cell_changed (ETableModel *table_model, gint view_col, gint row, ETree *et) +et_table_cell_changed (ETableModel *table_model, + gint view_col, + gint row, + ETree *et) { et_table_model_changed (table_model, et); } static void -et_table_rows_deleted (ETableModel *table_model, gint row, gint count, ETree *et) +et_table_rows_deleted (ETableModel *table_model, + gint row, + gint count, + ETree *et) { ETreePath * node, * prev_node; @@ -1441,7 +1496,7 @@ et_table_rows_deleted (ETableModel *table_model, gint row, gint count, ETree *et || row == 0) return; - prev_node = e_tree_node_at_row (et, row-1); + prev_node = e_tree_node_at_row (et, row - 1); node = e_tree_get_cursor (et); /* Check if the cursor is a child of the node directly before the @@ -1479,8 +1534,11 @@ et_connect_to_etta (ETree *et) } static gboolean -et_real_construct (ETree *e_tree, ETreeModel *etm, ETableExtras *ete, - ETableSpecification *specification, ETableState *state) +et_real_construct (ETree *e_tree, + ETreeModel *etm, + ETableExtras *ete, + ETableSpecification *specification, + ETableState *state) { GtkAdjustment *adjustment; GtkScrollable *scrollable; @@ -1525,9 +1583,9 @@ et_real_construct (ETree *e_tree, ETreeModel *etm, ETableExtras *ete, "cursor_mode", specification->cursor_mode, NULL); - g_signal_connect(e_tree->priv->selection, "selection_changed", + g_signal_connect (e_tree->priv->selection, "selection_changed", G_CALLBACK (et_selection_model_selection_changed), e_tree); - g_signal_connect(e_tree->priv->selection, "selection_row_changed", + g_signal_connect (e_tree->priv->selection, "selection_row_changed", G_CALLBACK (et_selection_model_selection_row_changed), e_tree); if (!specification->no_headers) { @@ -1578,8 +1636,11 @@ et_real_construct (ETree *e_tree, ETreeModel *etm, ETableExtras *ete, * Return value: %TRUE on success, %FALSE if an error occurred **/ gboolean -e_tree_construct (ETree *e_tree, ETreeModel *etm, ETableExtras *ete, - const gchar *spec_str, const gchar *state_str) +e_tree_construct (ETree *e_tree, + ETreeModel *etm, + ETableExtras *ete, + const gchar *spec_str, + const gchar *state_str) { ETableSpecification *specification; ETableState *state; @@ -1637,8 +1698,11 @@ e_tree_construct (ETree *e_tree, ETreeModel *etm, ETableExtras *ete, * Return value: %TRUE on success, %FALSE if an error occurred **/ gboolean -e_tree_construct_from_spec_file (ETree *e_tree, ETreeModel *etm, ETableExtras *ete, - const gchar *spec_fn, const gchar *state_fn) +e_tree_construct_from_spec_file (ETree *e_tree, + ETreeModel *etm, + ETableExtras *ete, + const gchar *spec_fn, + const gchar *state_fn) { ETableSpecification *specification; ETableState *state; @@ -1707,7 +1771,10 @@ e_tree_construct_from_spec_file (ETree *e_tree, ETreeModel *etm, ETableExtras *e * The newly created #ETree or %NULL if there's an error. **/ GtkWidget * -e_tree_new (ETreeModel *etm, ETableExtras *ete, const gchar *spec, const gchar *state) +e_tree_new (ETreeModel *etm, + ETableExtras *ete, + const gchar *spec, + const gchar *state) { ETree *e_tree; @@ -1779,7 +1846,8 @@ e_tree_show_cursor_after_reflow (ETree *e_tree) } void -e_tree_set_cursor (ETree *e_tree, ETreePath path) +e_tree_set_cursor (ETree *e_tree, + ETreePath path) { #ifndef E_TREE_USE_TREE_SELECTION gint row; @@ -1829,9 +1897,9 @@ e_tree_get_cursor (ETree *e_tree) } void -e_tree_selected_row_foreach (ETree *e_tree, - EForeachFunc callback, - gpointer closure) +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)); @@ -1843,9 +1911,9 @@ e_tree_selected_row_foreach (ETree *e_tree, #ifdef E_TREE_USE_TREE_SELECTION void -e_tree_selected_path_foreach (ETree *e_tree, - ETreeForeachFunc callback, - gpointer closure) +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)); @@ -1858,9 +1926,9 @@ e_tree_selected_path_foreach (ETree *e_tree, /* Standard functions */ static void et_foreach_recurse (ETreeModel *model, - ETreePath path, - ETreeForeachFunc callback, - gpointer closure) + ETreePath path, + ETreeForeachFunc callback, + gpointer closure) { ETreePath child; @@ -1874,8 +1942,8 @@ et_foreach_recurse (ETreeModel *model, void e_tree_path_foreach (ETree *e_tree, - ETreeForeachFunc callback, - gpointer closure) + ETreeForeachFunc callback, + gpointer closure) { ETreePath root; @@ -1903,13 +1971,13 @@ e_tree_get_printable (ETree *e_tree) static void et_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) + guint property_id, + GValue *value, + GParamSpec *pspec) { ETree *etree = E_TREE (object); - switch (prop_id) { + switch (property_id) { case PROP_ETTA: g_value_set_object (value, etree->priv->etta); break; @@ -1952,7 +2020,7 @@ et_get_property (GObject *object, g_value_set_enum (value, 0); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -1964,13 +2032,13 @@ typedef struct { static void et_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) + guint property_id, + const GValue *value, + GParamSpec *pspec) { ETree *etree = E_TREE (object); - switch (prop_id) { + switch (property_id) { case PROP_LENGTH_THRESHOLD: etree->priv->length_threshold = g_value_get_int (value); if (etree->priv->item) { @@ -2051,8 +2119,8 @@ et_set_property (GObject *object, } gint -e_tree_get_next_row (ETree *e_tree, - gint model_row) +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); @@ -2079,8 +2147,8 @@ e_tree_get_next_row (ETree *e_tree, } gint -e_tree_get_prev_row (ETree *e_tree, - gint model_row) +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); @@ -2098,8 +2166,8 @@ e_tree_get_prev_row (ETree *e_tree, } gint -e_tree_model_to_view_row (ETree *e_tree, - gint model_row) +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); @@ -2111,8 +2179,8 @@ e_tree_model_to_view_row (ETree *e_tree, } gint -e_tree_view_to_model_row (ETree *e_tree, - gint view_row) +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); @@ -2124,7 +2192,8 @@ e_tree_view_to_model_row (ETree *e_tree, } gboolean -e_tree_node_is_expanded (ETree *et, ETreePath path) +e_tree_node_is_expanded (ETree *et, + ETreePath path) { g_return_val_if_fail (path, FALSE); @@ -2132,7 +2201,9 @@ e_tree_node_is_expanded (ETree *et, ETreePath path) } void -e_tree_node_set_expanded (ETree *et, ETreePath path, gboolean expanded) +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)); @@ -2141,7 +2212,9 @@ e_tree_node_set_expanded (ETree *et, ETreePath path, gboolean expanded) } void -e_tree_node_set_expanded_recurse (ETree *et, ETreePath path, gboolean expanded) +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)); @@ -2150,7 +2223,8 @@ e_tree_node_set_expanded_recurse (ETree *et, ETreePath path, gboolean expanded) } void -e_tree_root_node_set_visible (ETree *et, gboolean visible) +e_tree_root_node_set_visible (ETree *et, + gboolean visible) { g_return_if_fail (et != NULL); g_return_if_fail (E_IS_TREE (et)); @@ -2159,7 +2233,8 @@ e_tree_root_node_set_visible (ETree *et, gboolean visible) } ETreePath -e_tree_node_at_row (ETree *et, gint row) +e_tree_node_at_row (ETree *et, + gint row) { ETreePath path; @@ -2169,7 +2244,8 @@ e_tree_node_at_row (ETree *et, gint row) } gint -e_tree_row_of_node (ETree *et, ETreePath path) +e_tree_row_of_node (ETree *et, + ETreePath path) { return e_tree_table_adapter_row_of_node (et->priv->etta, path); } @@ -2181,7 +2257,8 @@ e_tree_root_node_is_visible (ETree *et) } void -e_tree_show_node (ETree *et, ETreePath path) +e_tree_show_node (ETree *et, + ETreePath path) { g_return_if_fail (et != NULL); g_return_if_fail (E_IS_TREE (et)); @@ -2190,7 +2267,8 @@ e_tree_show_node (ETree *et, ETreePath path) } void -e_tree_save_expanded_state (ETree *et, gchar *filename) +e_tree_save_expanded_state (ETree *et, + gchar *filename) { g_return_if_fail (et != NULL); g_return_if_fail (E_IS_TREE (et)); @@ -2199,7 +2277,8 @@ e_tree_save_expanded_state (ETree *et, gchar *filename) } void -e_tree_load_expanded_state (ETree *et, gchar *filename) +e_tree_load_expanded_state (ETree *et, + gchar *filename) { e_tree_table_adapter_load_expanded_state (et->priv->etta, filename); } @@ -2214,7 +2293,8 @@ e_tree_save_expanded_state_xml (ETree *et) } void -e_tree_load_expanded_state_xml (ETree *et, xmlDoc *doc) +e_tree_load_expanded_state_xml (ETree *et, + xmlDoc *doc) { g_return_if_fail (et != NULL); g_return_if_fail (E_IS_TREE (et)); @@ -2224,10 +2304,11 @@ e_tree_load_expanded_state_xml (ETree *et, xmlDoc *doc) } /* state: <0 ... collapse; 0 ... no force - use default; >0 ... expand; - when using this, be sure to reset to 0 once no forcing is required - anymore, aka the build of the tree is done */ + * when using this, be sure to reset to 0 once no forcing is required + * anymore, aka the build of the tree is done */ void -e_tree_force_expanded_state (ETree *et, gint state) +e_tree_force_expanded_state (ETree *et, + gint state) { e_tree_table_adapter_force_expanded_state (et->priv->etta, state); } @@ -2245,7 +2326,11 @@ e_tree_get_tooltip (ETree *et) } static ETreePath -find_next_in_range (ETree *et, gint start, gint end, ETreePathFunc func, gpointer data) +find_next_in_range (ETree *et, + gint start, + gint end, + ETreePathFunc func, + gpointer data) { ETreePath path; gint row; @@ -2260,7 +2345,11 @@ find_next_in_range (ETree *et, gint start, gint end, ETreePathFunc func, gpointe } static ETreePath -find_prev_in_range (ETree *et, gint start, gint end, ETreePathFunc func, gpointer data) +find_prev_in_range (ETree *et, + gint start, + gint end, + ETreePathFunc func, + gpointer data) { ETreePath path; gint row; @@ -2372,7 +2461,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); @@ -2381,7 +2470,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); @@ -2458,12 +2547,12 @@ struct _GtkDragSourceInfo /* Target */ void -e_tree_drag_get_data (ETree *tree, - gint row, - gint col, - GdkDragContext *context, - GdkAtom target, - guint32 time) +e_tree_drag_get_data (ETree *tree, + gint row, + gint col, + GdkDragContext *context, + GdkAtom target, + guint32 time) { g_return_if_fail (tree != NULL); g_return_if_fail (E_IS_TREE (tree)); @@ -2486,8 +2575,8 @@ e_tree_drag_get_data (ETree *tree, */ void e_tree_drag_highlight (ETree *tree, - gint row, - gint col) + gint row, + gint col) { GtkAllocation allocation; GtkAdjustment *adjustment; @@ -2596,7 +2685,11 @@ e_tree_drag_dest_unset (GtkWidget *widget) /* Source side */ static gint -et_real_start_drag (ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event) +et_real_start_drag (ETree *tree, + gint row, + ETreePath path, + gint col, + GdkEvent *event) { GtkDragSourceInfo *info; GdkDragContext *context; @@ -2629,11 +2722,11 @@ et_real_start_drag (ETree *tree, gint row, ETreePath path, gint col, GdkEvent *e } void -e_tree_drag_source_set (ETree *tree, - GdkModifierType start_button_mask, - const GtkTargetEntry *targets, - gint n_targets, - GdkDragAction actions) +e_tree_drag_source_set (ETree *tree, + GdkModifierType start_button_mask, + const GtkTargetEntry *targets, + gint n_targets, + GdkDragAction actions) { ETreeDragSourceSite *site; GtkWidget *canvas; @@ -2692,13 +2785,13 @@ e_tree_drag_source_unset (ETree *tree) */ GdkDragContext * -e_tree_drag_begin (ETree *tree, - gint row, - gint col, - GtkTargetList *targets, - GdkDragAction actions, - gint button, - GdkEvent *event) +e_tree_drag_begin (ETree *tree, + gint row, + gint col, + GtkTargetList *targets, + GdkDragAction actions, + gint button, + GdkEvent *event) { ETreePath path; g_return_val_if_fail (tree != NULL, NULL); @@ -2730,8 +2823,10 @@ e_tree_drag_begin (ETree *tree, **/ void e_tree_get_cell_at (ETree *tree, - gint x, gint y, - gint *row_return, gint *col_return) + gint x, + gint y, + gint *row_return, + gint *col_return) { GtkAdjustment *adjustment; GtkScrollable *scrollable; @@ -2777,9 +2872,12 @@ e_tree_get_cell_at (ETree *tree, **/ void e_tree_get_cell_geometry (ETree *tree, - gint row, gint col, - gint *x_return, gint *y_return, - gint *width_return, gint *height_return) + gint row, + gint col, + gint *x_return, + gint *y_return, + gint *width_return, + gint *height_return) { GtkAdjustment *adjustment; GtkScrollable *scrollable; @@ -2811,8 +2909,8 @@ e_tree_get_cell_geometry (ETree *tree, static void et_drag_begin (GtkWidget *widget, - GdkDragContext *context, - ETree *et) + GdkDragContext *context, + ETree *et) { g_signal_emit (et, et_signals[TREE_DRAG_BEGIN], 0, @@ -2824,8 +2922,8 @@ et_drag_begin (GtkWidget *widget, static void et_drag_end (GtkWidget *widget, - GdkDragContext *context, - ETree *et) + GdkDragContext *context, + ETree *et) { g_signal_emit (et, et_signals[TREE_DRAG_END], 0, @@ -2837,11 +2935,11 @@ et_drag_end (GtkWidget *widget, static void et_drag_data_get (GtkWidget *widget, - GdkDragContext *context, - GtkSelectionData *selection_data, - guint info, - guint time, - ETree *et) + GdkDragContext *context, + GtkSelectionData *selection_data, + guint info, + guint time, + ETree *et) { g_signal_emit (et, et_signals[TREE_DRAG_DATA_GET], 0, @@ -2856,8 +2954,8 @@ et_drag_data_get (GtkWidget *widget, static void et_drag_data_delete (GtkWidget *widget, - GdkDragContext *context, - ETree *et) + GdkDragContext *context, + ETree *et) { g_signal_emit (et, et_signals[TREE_DRAG_DATA_DELETE], 0, @@ -2869,10 +2967,10 @@ et_drag_data_delete (GtkWidget *widget, static gboolean do_drag_motion (ETree *et, - GdkDragContext *context, - gint x, - gint y, - guint time) + GdkDragContext *context, + gint x, + gint y, + guint time) { gboolean ret_val = FALSE; gint row, col; @@ -2973,7 +3071,8 @@ scroll_timeout (gpointer data) } static void -scroll_on (ETree *et, guint scroll_direction) +scroll_on (ETree *et, + guint scroll_direction) { if (et->priv->scroll_idle_id == 0 || scroll_direction != et->priv->scroll_direction) { @@ -3027,7 +3126,9 @@ hover_timeout (gpointer data) } static void -hover_on (ETree *et, gint x, gint y) +hover_on (ETree *et, + gint x, + gint y) { et->priv->hover_x = x; et->priv->hover_y = y; @@ -3046,7 +3147,8 @@ hover_off (ETree *et) } static void -collapse_drag (ETree *et, ETreePath drop) +collapse_drag (ETree *et, + ETreePath drop) { GList *list; @@ -3085,7 +3187,8 @@ collapse_drag (ETree *et, ETreePath drop) } static void -context_destroyed (gpointer data, GObject *ctx) +context_destroyed (gpointer data, + GObject *ctx) { ETree *et = data; if (et->priv) { @@ -3101,7 +3204,8 @@ context_destroyed (gpointer data, GObject *ctx) } static void -context_connect (ETree *et, GdkDragContext *context) +context_connect (ETree *et, + GdkDragContext *context) { if (context == et->priv->last_drop_context) return; @@ -3118,9 +3222,9 @@ context_connect (ETree *et, GdkDragContext *context) static void et_drag_leave (GtkWidget *widget, - GdkDragContext *context, - guint time, - ETree *et) + GdkDragContext *context, + guint time, + ETree *et) { g_signal_emit (et, et_signals[TREE_DRAG_LEAVE], 0, @@ -3138,11 +3242,11 @@ et_drag_leave (GtkWidget *widget, static gboolean et_drag_motion (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - guint time, - ETree *et) + GdkDragContext *context, + gint x, + gint y, + guint time, + ETree *et) { GtkAllocation allocation; gint ret_val; @@ -3186,11 +3290,11 @@ et_drag_motion (GtkWidget *widget, static gboolean et_drag_drop (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - guint time, - ETree *et) + GdkDragContext *context, + gint x, + gint y, + guint time, + ETree *et) { gboolean ret_val = FALSE; gint row, col; @@ -3248,13 +3352,13 @@ et_drag_drop (GtkWidget *widget, static void et_drag_data_received (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - GtkSelectionData *selection_data, - guint info, - guint time, - ETree *et) + GdkDragContext *context, + gint x, + gint y, + GtkSelectionData *selection_data, + guint info, + guint time, + ETree *et) { gint row, col; ETreePath path; @@ -3602,7 +3706,9 @@ e_tree_class_init (ETreeClass *class) } static void -tree_size_allocate (GtkWidget *widget, GtkAllocation *alloc, ETree *tree) +tree_size_allocate (GtkWidget *widget, + GtkAllocation *alloc, + ETree *tree) { gdouble width; @@ -3629,7 +3735,8 @@ tree_size_allocate (GtkWidget *widget, GtkAllocation *alloc, ETree *tree) * Creates an info message in table area, or removes old. **/ void -e_tree_set_info_message (ETree *tree, const gchar *info_message) +e_tree_set_info_message (ETree *tree, + const gchar *info_message) { GtkAllocation allocation; GtkWidget *widget; diff --git a/widgets/table/gal-a11y-e-cell-popup.c b/widgets/table/gal-a11y-e-cell-popup.c index f1c2540820..b1232a6b84 100644 --- a/widgets/table/gal-a11y-e-cell-popup.c +++ b/widgets/table/gal-a11y-e-cell-popup.c @@ -83,16 +83,16 @@ gal_a11y_e_cell_popup_class_init (GalA11yECellPopupClass *class) AtkObject * gal_a11y_e_cell_popup_new (ETableItem *item, - ECellView *cell_view, - AtkObject *parent, - gint model_col, - gint view_col, - gint row) + ECellView *cell_view, + AtkObject *parent, + gint model_col, + gint view_col, + gint row) { AtkObject *a11y; GalA11yECell *cell; ECellPopup *popupcell; - ECellView* child_view = NULL; + ECellView * child_view = NULL; popupcell= E_CELL_POPUP (cell_view->ecell); diff --git a/widgets/table/gal-a11y-e-cell-registry.c b/widgets/table/gal-a11y-e-cell-registry.c index 79ad4cacb2..ce533882ab 100644 --- a/widgets/table/gal-a11y-e-cell-registry.c +++ b/widgets/table/gal-a11y-e-cell-registry.c @@ -108,13 +108,13 @@ init_default_registry (void) } AtkObject * -gal_a11y_e_cell_registry_get_object (GalA11yECellRegistry *registry, - ETableItem *item, - ECellView *cell_view, - AtkObject *parent, - gint model_col, - gint view_col, - gint row) +gal_a11y_e_cell_registry_get_object (GalA11yECellRegistry *registry, + ETableItem *item, + ECellView *cell_view, + AtkObject *parent, + gint model_col, + gint view_col, + gint row) { GalA11yECellRegistryFunc func = NULL; GType type; @@ -137,9 +137,9 @@ gal_a11y_e_cell_registry_get_object (GalA11yECellRegistry *registry, } void -gal_a11y_e_cell_registry_add_cell_type (GalA11yECellRegistry *registry, - GType type, - GalA11yECellRegistryFunc func) +gal_a11y_e_cell_registry_add_cell_type (GalA11yECellRegistry *registry, + GType type, + GalA11yECellRegistryFunc func) { if (registry == NULL) { init_default_registry (); diff --git a/widgets/table/gal-a11y-e-cell-toggle.c b/widgets/table/gal-a11y-e-cell-toggle.c index 98fcdcd92f..991d3c0721 100644 --- a/widgets/table/gal-a11y-e-cell-toggle.c +++ b/widgets/table/gal-a11y-e-cell-toggle.c @@ -122,9 +122,9 @@ toggle_cell_action (GalA11yECell *cell) static void model_change_cb (ETableModel *etm, - gint col, - gint row, - GalA11yECell *cell) + gint col, + gint row, + GalA11yECell *cell) { gint value; @@ -143,13 +143,13 @@ model_change_cb (ETableModel *etm, } } -AtkObject* +AtkObject * gal_a11y_e_cell_toggle_new (ETableItem *item, - ECellView *cell_view, - AtkObject *parent, - gint model_col, - gint view_col, - gint row) + ECellView *cell_view, + AtkObject *parent, + gint model_col, + gint view_col, + gint row) { AtkObject *a11y; GalA11yECell *cell; diff --git a/widgets/table/gal-a11y-e-cell-tree.c b/widgets/table/gal-a11y-e-cell-tree.c index 70880fc0cc..148731d4b8 100644 --- a/widgets/table/gal-a11y-e-cell-tree.c +++ b/widgets/table/gal-a11y-e-cell-tree.c @@ -43,8 +43,8 @@ static AtkObjectClass *a11y_parent_class; static void ectr_model_row_changed_cb (ETableModel *etm, - gint row, - GalA11yECell *a11y) + gint row, + GalA11yECell *a11y) { ETreePath node; ETreeModel *tree_model; @@ -88,7 +88,7 @@ kill_view_cb (ECellView *subcell_view, static void ectr_subcell_weak_ref (GalA11yECellTree *a11y, - GalA11yECell *subcell_a11y) + GalA11yECell *subcell_a11y) { ECellView *subcell_view = subcell_a11y ? subcell_a11y->cell_view : NULL; if (subcell_a11y && subcell_view && subcell_view->kill_view_cb_data) @@ -184,11 +184,11 @@ gal_a11y_e_cell_tree_get_type (void) AtkObject * gal_a11y_e_cell_tree_new (ETableItem *item, - ECellView *cell_view, - AtkObject *parent, - gint model_col, - gint view_col, - gint row) + ECellView *cell_view, + AtkObject *parent, + gint model_col, + gint view_col, + gint row) { AtkObject *subcell_a11y; GalA11yECellTree *a11y; @@ -236,8 +236,8 @@ gal_a11y_e_cell_tree_new (ETableItem *item, subcell_a11y = NULL; /* create a companion a11y object, this object has type GalA11yECellTree - and it connects to some signals to determine whether a tree cell is - expanded or collapsed */ + * and it connects to some signals to determine whether a tree cell is + * expanded or collapsed */ a11y = g_object_new (gal_a11y_e_cell_tree_get_type (), NULL); gal_a11y_e_cell_construct (ATK_OBJECT (a11y), item, diff --git a/widgets/table/gal-a11y-e-cell-vbox.c b/widgets/table/gal-a11y-e-cell-vbox.c index e663bb1f1f..d0b9d26036 100644 --- a/widgets/table/gal-a11y-e-cell-vbox.c +++ b/widgets/table/gal-a11y-e-cell-vbox.c @@ -63,8 +63,9 @@ subcell_destroyed (gpointer data) gaev->a11y_subcells[cell->view_col] = NULL; } -static AtkObject* -ecv_ref_child (AtkObject *a11y, gint i) +static AtkObject * +ecv_ref_child (AtkObject *a11y, + gint i) { GalA11yECellVbox *gaev = GAL_A11Y_E_CELL_VBOX (a11y); GalA11yECell *gaec = GAL_A11Y_E_CELL (a11y); @@ -117,11 +118,11 @@ ecv_dispose (GObject *object) } /* AtkComponet interface */ -static AtkObject* +static AtkObject * ecv_ref_accessible_at_point (AtkComponent *component, - gint x, - gint y, - AtkCoordType coord_type) + gint x, + gint y, + AtkCoordType coord_type) { gint x0, y0, width, height; gint subcell_height, i; @@ -227,6 +228,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 e48977f026..4a75c97ce4 100644 --- a/widgets/table/gal-a11y-e-cell.c +++ b/widgets/table/gal-a11y-e-cell.c @@ -42,7 +42,8 @@ static GObjectClass *parent_class; #if 0 static void -unref_item (gpointer user_data, GObject *obj_loc) +unref_item (gpointer user_data, + GObject *obj_loc) { GalA11yECell *a11y = GAL_A11Y_E_CELL (user_data); a11y->item = NULL; @@ -50,7 +51,8 @@ unref_item (gpointer user_data, GObject *obj_loc) } static void -unref_cell (gpointer user_data, GObject *obj_loc) +unref_cell (gpointer user_data, + GObject *obj_loc) { GalA11yECell *a11y = GAL_A11Y_E_CELL (user_data); a11y->cell_view = NULL; @@ -104,7 +106,7 @@ gal_a11y_e_cell_dispose (GObject *object) /* Static functions */ static const gchar * -gal_a11y_e_cell_get_name (AtkObject * a11y) +gal_a11y_e_cell_get_name (AtkObject *a11y) { GalA11yECell *cell = GAL_A11Y_E_CELL (a11y); ETableCol *ecol; @@ -133,7 +135,7 @@ gal_a11y_e_cell_ref_state_set (AtkObject *accessible) return cell->state_set; } -static AtkObject* +static AtkObject * gal_a11y_e_cell_get_parent (AtkObject *accessible) { GalA11yECell *a11y = GAL_A11Y_E_CELL (accessible); @@ -154,11 +156,11 @@ gal_a11y_e_cell_get_index_in_parent (AtkObject *accessible) /* Component IFace */ static void gal_a11y_e_cell_get_extents (AtkComponent *component, - gint *x, - gint *y, - gint *width, - gint *height, - AtkCoordType coord_type) + gint *x, + gint *y, + gint *width, + gint *height, + AtkCoordType coord_type) { GalA11yECell *a11y = GAL_A11Y_E_CELL (component); GtkWidget *tableOrTree; @@ -267,7 +269,7 @@ gal_a11y_e_cell_init (GalA11yECell *a11y) static ActionInfo * _gal_a11y_e_cell_get_action_info (GalA11yECell *cell, - gint index) + gint index) { GList *list_node; @@ -282,7 +284,7 @@ _gal_a11y_e_cell_get_action_info (GalA11yECell *cell, static void _gal_a11y_e_cell_destroy_action_info (gpointer action_info, - gpointer user_data) + gpointer user_data) { ActionInfo *info = (ActionInfo *) action_info; @@ -294,11 +296,11 @@ _gal_a11y_e_cell_destroy_action_info (gpointer action_info, } gboolean -gal_a11y_e_cell_add_action ( GalA11yECell * cell, - const gchar *action_name, - const gchar *action_description, - const gchar *action_keybinding, - ACTION_FUNC action_func) +gal_a11y_e_cell_add_action (GalA11yECell *cell, + const gchar *action_name, + const gchar *action_description, + const gchar *action_keybinding, + ACTION_FUNC action_func) { ActionInfo *info; g_return_val_if_fail (GAL_A11Y_IS_E_CELL (cell), FALSE); @@ -325,7 +327,7 @@ gal_a11y_e_cell_add_action ( GalA11yECell * cell, gboolean gal_a11y_e_cell_remove_action (GalA11yECell *cell, - gint action_index) + gint action_index) { GList *list_node; @@ -342,7 +344,7 @@ gal_a11y_e_cell_remove_action (GalA11yECell *cell, gboolean gal_a11y_e_cell_remove_action_by_name (GalA11yECell *cell, - const gchar *action_name) + const gchar *action_name) { GList *list_node; gboolean action_found= FALSE; @@ -377,7 +379,7 @@ gal_a11y_e_cell_action_get_n_actions (AtkAction *action) static const gchar * gal_a11y_e_cell_action_get_name (AtkAction *action, - gint index) + gint index) { GalA11yECell *cell = GAL_A11Y_E_CELL (action); ActionInfo *info = _gal_a11y_e_cell_get_action_info (cell, index); @@ -389,7 +391,7 @@ gal_a11y_e_cell_action_get_name (AtkAction *action, static const gchar * gal_a11y_e_cell_action_get_description (AtkAction *action, - gint index) + gint index) { GalA11yECell *cell = GAL_A11Y_E_CELL (action); ActionInfo *info = _gal_a11y_e_cell_get_action_info (cell, index); @@ -400,9 +402,9 @@ gal_a11y_e_cell_action_get_description (AtkAction *action, } static gboolean -gal_a11y_e_cell_action_set_description (AtkAction *action, - gint index, - const gchar *desc) +gal_a11y_e_cell_action_set_description (AtkAction *action, + gint index, + const gchar *desc) { GalA11yECell *cell = GAL_A11Y_E_CELL (action); ActionInfo *info = _gal_a11y_e_cell_get_action_info (cell, index); @@ -416,7 +418,7 @@ gal_a11y_e_cell_action_set_description (AtkAction *action, static const gchar * gal_a11y_e_cell_action_get_keybinding (AtkAction *action, - gint index) + gint index) { GalA11yECell *cell = GAL_A11Y_E_CELL (action); ActionInfo *info = _gal_a11y_e_cell_get_action_info (cell, index); @@ -445,7 +447,7 @@ idle_do_action (gpointer data) static gboolean gal_a11y_e_cell_action_do_action (AtkAction *action, - gint index) + gint index) { GalA11yECell *cell = GAL_A11Y_E_CELL (action); ActionInfo *info = _gal_a11y_e_cell_get_action_info (cell, index); @@ -493,9 +495,9 @@ gal_a11y_e_cell_type_add_action_interface (GType type) } gboolean -gal_a11y_e_cell_add_state (GalA11yECell *cell, - AtkStateType state_type, - gboolean emit_signal) +gal_a11y_e_cell_add_state (GalA11yECell *cell, + AtkStateType state_type, + gboolean emit_signal) { if (!atk_state_set_contains_state (cell->state_set, state_type)) { gboolean rc; @@ -510,7 +512,7 @@ gal_a11y_e_cell_add_state (GalA11yECell *cell, if (emit_signal) { atk_object_notify_state_change (ATK_OBJECT (cell), state_type, TRUE); /* If state_type is ATK_STATE_VISIBLE, additional - notification */ + * notification */ if (state_type == ATK_STATE_VISIBLE) g_signal_emit_by_name (cell, "visible_data_changed"); } @@ -522,9 +524,9 @@ gal_a11y_e_cell_add_state (GalA11yECell *cell, } gboolean -gal_a11y_e_cell_remove_state (GalA11yECell *cell, - AtkStateType state_type, - gboolean emit_signal) +gal_a11y_e_cell_remove_state (GalA11yECell *cell, + AtkStateType state_type, + gboolean emit_signal) { if (atk_state_set_contains_state (cell->state_set, state_type)) { gboolean rc; @@ -592,11 +594,11 @@ gal_a11y_e_cell_get_type (void) AtkObject * gal_a11y_e_cell_new (ETableItem *item, - ECellView *cell_view, - AtkObject *parent, - gint model_col, - gint view_col, - gint row) + ECellView *cell_view, + AtkObject *parent, + gint model_col, + gint view_col, + gint row) { AtkObject *a11y; @@ -613,13 +615,13 @@ gal_a11y_e_cell_new (ETableItem *item, } void -gal_a11y_e_cell_construct (AtkObject *object, - ETableItem *item, - ECellView *cell_view, - AtkObject *parent, - gint model_col, - gint view_col, - gint row) +gal_a11y_e_cell_construct (AtkObject *object, + ETableItem *item, + ECellView *cell_view, + AtkObject *parent, + gint model_col, + gint view_col, + gint row) { GalA11yECell *a11y = GAL_A11Y_E_CELL (object); a11y->item = item; 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 c71199cebb..1a4b418adf 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 @@ -45,7 +45,7 @@ gal_a11y_e_table_click_to_add_factory_get_accessible_type (void) return GAL_A11Y_TYPE_E_TABLE_CLICK_TO_ADD; } -static AtkObject* +static AtkObject * gal_a11y_e_table_click_to_add_factory_create_accessible (GObject *obj) { AtkObject * atk_object; 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 a947415c15..e4b5255e4c 100644 --- a/widgets/table/gal-a11y-e-table-click-to-add.c +++ b/widgets/table/gal-a11y-e-table-click-to-add.c @@ -56,7 +56,7 @@ etcta_get_n_actions (AtkAction *action) static const gchar * etcta_get_description (AtkAction *action, - gint i) + gint i) { if (i == 0) return _("click to add"); @@ -65,7 +65,8 @@ etcta_get_description (AtkAction *action, } static const gchar * -etcta_action_get_name (AtkAction *action, gint i) +etcta_action_get_name (AtkAction *action, + gint i) { if (i == 0) return _("click"); @@ -105,7 +106,8 @@ idle_do_action (gpointer data) } static gboolean -etcta_do_action (AtkAction * action, gint i) +etcta_do_action (AtkAction *action, + gint i) { g_return_val_if_fail (i == 0, FALSE); @@ -252,7 +254,9 @@ gal_a11y_e_table_click_to_add_get_type (void) } static gboolean -etcta_event (GnomeCanvasItem *item, GdkEvent *e, gpointer data) +etcta_event (GnomeCanvasItem *item, + GdkEvent *e, + gpointer data) { ETableClickToAdd *etcta = E_TABLE_CLICK_TO_ADD (item); GalA11yETableClickToAdd *a11y; @@ -285,8 +289,10 @@ etcta_event (GnomeCanvasItem *item, GdkEvent *e, gpointer data) } static void -etcta_selection_cursor_changed (ESelectionModel *esm, gint row, gint col, - GalA11yETableClickToAdd *a11y) +etcta_selection_cursor_changed (ESelectionModel *esm, + gint row, + gint col, + GalA11yETableClickToAdd *a11y) { ETableClickToAdd *etcta; AtkObject *row_a11y; diff --git a/widgets/table/gal-a11y-e-table-column-header.c b/widgets/table/gal-a11y-e-table-column-header.c index ccbfffadc9..8e13fd6865 100644 --- a/widgets/table/gal-a11y-e-table-column-header.c +++ b/widgets/table/gal-a11y-e-table-column-header.c @@ -67,7 +67,8 @@ gal_a11y_e_table_column_header_ref_state_set (AtkObject *accessible) } static void -gal_a11y_e_table_column_header_real_initialize (AtkObject *obj, gpointer data) +gal_a11y_e_table_column_header_real_initialize (AtkObject *obj, + gpointer data) { ATK_OBJECT_CLASS (parent_class)->initialize (obj, data); } @@ -110,7 +111,7 @@ etch_a11y_get_gobject (AtkGObjectAccessible *accessible) static gboolean gal_a11y_e_table_column_header_do_action (AtkAction *action, - gint i) + gint i) { gboolean return_value = TRUE; GtkWidget *widget; @@ -148,7 +149,7 @@ gal_a11y_e_table_column_header_get_n_actions (AtkAction *action) static const gchar * gal_a11y_e_table_column_header_action_get_name (AtkAction *action, - gint i) + gint i) { const gchar *return_value; @@ -209,7 +210,8 @@ gal_a11y_e_table_column_header_get_type (void) } AtkObject * -gal_a11y_e_table_column_header_new (ETableCol *ecol, ETableItem *item) +gal_a11y_e_table_column_header_new (ETableCol *ecol, + ETableItem *item) { GalA11yETableColumnHeader *a11y; AtkObject *accessible; diff --git a/widgets/table/gal-a11y-e-table-factory.c b/widgets/table/gal-a11y-e-table-factory.c index e89bb799bb..2270cbaa5b 100644 --- a/widgets/table/gal-a11y-e-table-factory.c +++ b/widgets/table/gal-a11y-e-table-factory.c @@ -39,7 +39,7 @@ gal_a11y_e_table_factory_get_accessible_type (void) return GAL_A11Y_TYPE_E_TABLE; } -static AtkObject* +static AtkObject * gal_a11y_e_table_factory_create_accessible (GObject *obj) { AtkObject *accessible; diff --git a/widgets/table/gal-a11y-e-table-item-factory.c b/widgets/table/gal-a11y-e-table-item-factory.c index 3aeab505f3..a38269bd81 100644 --- a/widgets/table/gal-a11y-e-table-item-factory.c +++ b/widgets/table/gal-a11y-e-table-item-factory.c @@ -45,7 +45,7 @@ gal_a11y_e_table_item_factory_get_accessible_type (void) return GAL_A11Y_TYPE_E_TABLE_ITEM; } -static AtkObject* +static AtkObject * gal_a11y_e_table_item_factory_create_accessible (GObject *obj) { AtkObject *accessible; diff --git a/widgets/table/gal-a11y-e-table-item.c b/widgets/table/gal-a11y-e-table-item.c index e296882e65..5b0e565714 100644 --- a/widgets/table/gal-a11y-e-table-item.c +++ b/widgets/table/gal-a11y-e-table-item.c @@ -68,10 +68,11 @@ static gboolean gal_a11y_e_table_item_ref_selection (GalA11yETableItem *a11y, ESelectionModel *selection); static gboolean gal_a11y_e_table_item_unref_selection (GalA11yETableItem *a11y); -static AtkObject* eti_ref_at (AtkTable *table, gint row, gint column); +static AtkObject * eti_ref_at (AtkTable *table, gint row, gint column); static void -item_finalized (gpointer user_data, GObject *gone_item) +item_finalized (gpointer user_data, + GObject *gone_item) { GalA11yETableItem *a11y; GalA11yETableItemPrivate *priv; @@ -103,7 +104,8 @@ eti_ref_state_set (AtkObject *accessible) } 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); @@ -117,14 +119,16 @@ 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) @@ -146,7 +150,8 @@ 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) @@ -235,8 +240,9 @@ eti_get_n_children (AtkObject *accessible) (atk_table_get_n_rows (ATK_TABLE (accessible)) + 1); } -static AtkObject* -eti_ref_child (AtkObject *accessible, gint index) +static AtkObject * +eti_ref_child (AtkObject *accessible, + gint index) { ETableItem *item; gint col, row; @@ -264,11 +270,11 @@ eti_ref_child (AtkObject *accessible, gint index) static void eti_get_extents (AtkComponent *component, - gint *x, - gint *y, - gint *width, - gint *height, - AtkCoordType coord_type) + gint *x, + gint *y, + gint *width, + gint *height, + AtkCoordType coord_type) { ETableItem *item; AtkObject *parent; @@ -294,11 +300,11 @@ eti_get_extents (AtkComponent *component, } } -static AtkObject* +static AtkObject * eti_ref_accessible_at_point (AtkComponent *component, - gint x, - gint y, - AtkCoordType coord_type) + gint x, + gint y, + AtkCoordType coord_type) { gint row = -1; gint col = -1; @@ -349,11 +355,13 @@ cell_destroyed (gpointer data) } /* atk table */ -static AtkObject* -eti_ref_at (AtkTable *table, gint row, gint column) +static AtkObject * +eti_ref_at (AtkTable *table, + gint row, + gint column) { ETableItem *item; - AtkObject* ret; + AtkObject * ret; GalA11yETableItemPrivate *priv = GET_PRIVATE (table); if (atk_state_set_contains_state (priv->state_set, ATK_STATE_DEFUNCT)) @@ -399,7 +407,9 @@ eti_ref_at (AtkTable *table, gint row, gint column) } static gint -eti_get_index_at (AtkTable *table, gint row, gint column) +eti_get_index_at (AtkTable *table, + gint row, + gint column) { ETableItem *item; @@ -411,7 +421,8 @@ eti_get_index_at (AtkTable *table, gint row, gint column) } static gint -eti_get_column_at_index (AtkTable *table, gint index) +eti_get_column_at_index (AtkTable *table, + gint index) { ETableItem *item; @@ -423,7 +434,8 @@ eti_get_column_at_index (AtkTable *table, gint index) } static gint -eti_get_row_at_index (AtkTable *table, gint index) +eti_get_row_at_index (AtkTable *table, + gint index) { ETableItem *item; @@ -460,8 +472,8 @@ eti_get_n_rows (AtkTable *table) static gint eti_get_column_extent_at (AtkTable *table, - gint row, - gint column) + gint row, + gint column) { ETableItem *item; gint width; @@ -483,8 +495,8 @@ eti_get_column_extent_at (AtkTable *table, static gint eti_get_row_extent_at (AtkTable *table, - gint row, - gint column) + gint row, + gint column) { ETableItem *item; gint height; @@ -513,7 +525,7 @@ eti_get_caption (AtkTable *table) static const gchar * eti_get_column_description (AtkTable *table, - gint column) + gint column) { ETableItem *item; ETableCol *ecol; @@ -528,7 +540,8 @@ eti_get_column_description (AtkTable *table, } static AtkObject * -eti_get_column_header (AtkTable *table, gint column) +eti_get_column_header (AtkTable *table, + gint column) { ETableItem *item; ETableCol *ecol; @@ -548,7 +561,7 @@ eti_get_column_header (AtkTable *table, gint column) static const gchar * eti_get_row_description (AtkTable *table, - gint row) + gint row) { /* Unimplemented */ return NULL; @@ -556,7 +569,7 @@ eti_get_row_description (AtkTable *table, static AtkObject * eti_get_row_header (AtkTable *table, - gint row) + gint row) { /* Unimplemented */ return NULL; @@ -570,7 +583,8 @@ eti_get_summary (AtkTable *table) } static gboolean -table_is_row_selected (AtkTable *table, gint row) +table_is_row_selected (AtkTable *table, + gint row) { ETableItem *item; GalA11yETableItemPrivate *priv = GET_PRIVATE (table); @@ -590,13 +604,16 @@ table_is_row_selected (AtkTable *table, gint row) } static gboolean -table_is_selected (AtkTable *table, gint row, gint column) +table_is_selected (AtkTable *table, + gint row, + gint column) { return table_is_row_selected (table, row); } static gint -table_get_selected_rows (AtkTable *table, gint **rows_selected) +table_get_selected_rows (AtkTable *table, + gint **rows_selected) { ETableItem *item; gint n_selected, row, index_selected; @@ -625,7 +642,8 @@ table_get_selected_rows (AtkTable *table, gint **rows_selected) } static gboolean -table_add_row_selection (AtkTable *table, gint row) +table_add_row_selection (AtkTable *table, + gint row) { ETableItem *item; @@ -642,7 +660,8 @@ table_add_row_selection (AtkTable *table, gint row) } static gboolean -table_remove_row_selection (AtkTable *table, gint row) +table_remove_row_selection (AtkTable *table, + gint row) { ETableItem *item; GalA11yETableItemPrivate *priv = GET_PRIVATE (table); @@ -698,8 +717,10 @@ eti_atk_component_iface_init (AtkComponentIface *iface) } static void -eti_rows_inserted (ETableModel * model, gint row, gint count, - AtkObject * table_item) +eti_rows_inserted (ETableModel *model, + gint row, + gint count, + AtkObject *table_item) { gint n_cols,n_rows,i,j; GalA11yETableItem * item_a11y; @@ -725,7 +746,7 @@ eti_rows_inserted (ETableModel * model, gint row, gint count, for (j = 0; j < n_cols; j++) { g_signal_emit_by_name (table_item, "children_changed::add", - ( ((i + 1)*n_cols) + j), NULL, NULL); + ( ((i + 1) * n_cols) + j), NULL, NULL); } } @@ -733,8 +754,10 @@ eti_rows_inserted (ETableModel * model, gint row, gint count, } static void -eti_rows_deleted (ETableModel * model, gint row, gint count, - AtkObject * table_item) +eti_rows_deleted (ETableModel *model, + gint row, + gint count, + AtkObject *table_item) { gint i,j, n_rows, n_cols, old_nrows; ETableItem *item = E_TABLE_ITEM ( @@ -746,7 +769,7 @@ eti_rows_deleted (ETableModel * model, gint row, gint count, old_nrows = GET_PRIVATE (table_item)->rows; - g_return_if_fail ( row+count <= old_nrows); + g_return_if_fail ( row + count <= old_nrows); g_return_if_fail (old_nrows == n_rows + count); GET_PRIVATE (table_item)->rows = n_rows; @@ -757,7 +780,7 @@ eti_rows_deleted (ETableModel * model, gint row, gint count, for (j = 0; j < n_cols; j++) { g_signal_emit_by_name (table_item, "children_changed::remove", - ( ((i + 1)*n_cols) + j), NULL, NULL); + ( ((i + 1) * n_cols) + j), NULL, NULL); } } g_signal_emit_by_name (table_item, "visible-data-changed"); @@ -765,7 +788,9 @@ eti_rows_deleted (ETableModel * model, gint row, gint count, } static void -eti_tree_model_node_changed_cb (ETreeModel *model, ETreePath node, ETableItem *eti) +eti_tree_model_node_changed_cb (ETreeModel *model, + ETreePath node, + ETableItem *eti) { AtkObject *atk_obj; GalA11yETableItem *a11y; @@ -793,10 +818,11 @@ enum { * 3. Emit signals */ static void -eti_header_structure_changed (ETableHeader *eth, AtkObject *a11y) +eti_header_structure_changed (ETableHeader *eth, + AtkObject *a11y) { - gboolean reorder_found=FALSE, added_found=FALSE, removed_found=FALSE; + gboolean reorder_found = FALSE, added_found = FALSE, removed_found = FALSE; GalA11yETableItem * a11y_item; ETableCol ** cols, **prev_cols; GalA11yETableItemPrivate *priv; @@ -876,7 +902,7 @@ eti_header_structure_changed (ETableHeader *eth, AtkObject *a11y) g_signal_emit_by_name ( G_OBJECT (a11y_item), "children_changed::remove", - ((j+1)*prev_n_cols+i), + ((j + 1) * prev_n_cols + i), NULL, NULL); } } @@ -892,7 +918,7 @@ eti_header_structure_changed (ETableHeader *eth, AtkObject *a11y) g_signal_emit_by_name ( G_OBJECT (a11y_item), "children_changed::add", - ((j+1)*n_cols+i), + ((j + 1) * n_cols + i), NULL, NULL); } } @@ -910,7 +936,7 @@ eti_header_structure_changed (ETableHeader *eth, AtkObject *a11y) static void eti_real_initialize (AtkObject *obj, - gpointer data) + gpointer data) { ETableItem * eti; ETableModel * model; @@ -920,14 +946,15 @@ eti_real_initialize (AtkObject *obj, model = eti->table_model; - g_signal_connect (model, "model-rows-inserted", - G_CALLBACK (eti_rows_inserted), - obj); - g_signal_connect (model, "model-rows-deleted", - G_CALLBACK (eti_rows_deleted), - obj); - g_signal_connect (G_OBJECT (eti->header), "structure_change", - G_CALLBACK (eti_header_structure_changed), obj); + g_signal_connect ( + model, "model-rows-inserted", + G_CALLBACK (eti_rows_inserted), obj); + g_signal_connect ( + model, "model-rows-deleted", + G_CALLBACK (eti_rows_deleted), obj); + g_signal_connect ( + eti->header, "structure_change", + G_CALLBACK (eti_header_structure_changed), obj); } @@ -1084,10 +1111,12 @@ gal_a11y_e_table_item_new (ETableItem *item) return NULL; if (item) { - g_signal_connect (G_OBJECT(item), "selection_model_removed", - G_CALLBACK (eti_a11y_selection_model_removed_cb), NULL); - g_signal_connect (G_OBJECT(item), "selection_model_added", - G_CALLBACK (eti_a11y_selection_model_added_cb), NULL); + g_signal_connect ( + item, "selection_model_removed", + G_CALLBACK (eti_a11y_selection_model_removed_cb), NULL); + g_signal_connect ( + item, "selection_model_added", + G_CALLBACK (eti_a11y_selection_model_added_cb), NULL); if (item->selection) gal_a11y_e_table_item_ref_selection (a11y, item->selection); @@ -1104,8 +1133,9 @@ gal_a11y_e_table_item_new (ETableItem *item) if (E_IS_TREE (GET_PRIVATE (a11y)->widget)) { ETreeModel *model; model = e_tree_get_model (E_TREE (GET_PRIVATE (a11y)->widget)); - g_signal_connect (G_OBJECT(model), "node_changed", - G_CALLBACK (eti_tree_model_node_changed_cb), item); + g_signal_connect ( + model, "node_changed", + G_CALLBACK (eti_tree_model_node_changed_cb), item); accessible->role = ATK_ROLE_TREE_TABLE; } else if (E_IS_TABLE (GET_PRIVATE (a11y)->widget)) { accessible->role = ATK_ROLE_TABLE; @@ -1126,7 +1156,7 @@ gal_a11y_e_table_item_new (ETableItem *item) static gboolean gal_a11y_e_table_item_ref_selection (GalA11yETableItem *a11y, - ESelectionModel *selection) + ESelectionModel *selection) { GalA11yETableItemPrivate *priv; @@ -1174,8 +1204,9 @@ gal_a11y_e_table_item_unref_selection (GalA11yETableItem *a11y) /* callbacks */ static void -eti_a11y_selection_model_removed_cb (ETableItem *eti, ESelectionModel *selection, - gpointer data) +eti_a11y_selection_model_removed_cb (ETableItem *eti, + ESelectionModel *selection, + gpointer data) { AtkObject *atk_obj; GalA11yETableItem *a11y; @@ -1191,8 +1222,9 @@ eti_a11y_selection_model_removed_cb (ETableItem *eti, ESelectionModel *selection } static void -eti_a11y_selection_model_added_cb (ETableItem *eti, ESelectionModel *selection, - gpointer data) +eti_a11y_selection_model_added_cb (ETableItem *eti, + ESelectionModel *selection, + gpointer data) { AtkObject *atk_obj; GalA11yETableItem *a11y; @@ -1209,7 +1241,8 @@ eti_a11y_selection_model_added_cb (ETableItem *eti, ESelectionModel *selection, } static void -eti_a11y_selection_changed_cb (ESelectionModel *selection, GalA11yETableItem *a11y) +eti_a11y_selection_changed_cb (ESelectionModel *selection, + GalA11yETableItem *a11y) { GalA11yETableItemPrivate *priv = GET_PRIVATE (a11y); @@ -1223,7 +1256,9 @@ eti_a11y_selection_changed_cb (ESelectionModel *selection, GalA11yETableItem *a1 static void eti_a11y_cursor_changed_cb (ESelectionModel *selection, - gint row, gint col, GalA11yETableItem *a11y) + gint row, + gint col, + GalA11yETableItem *a11y) { ETableItem *item; GalA11yETableItemPrivate *priv = GET_PRIVATE (a11y); @@ -1255,7 +1290,8 @@ static void atk_selection_interface_init (AtkSelectionIface *iface) } static gboolean -selection_add_selection (AtkSelection *selection, gint index) +selection_add_selection (AtkSelection *selection, + gint index) { AtkTable *table; gint row, col, cursor_row, cursor_col, model_row, model_col; @@ -1315,7 +1351,8 @@ selection_clear_selection (AtkSelection *selection) } static AtkObject * -selection_ref_selection (AtkSelection *selection, gint index) +selection_ref_selection (AtkSelection *selection, + gint index) { AtkTable *table; gint row, col; @@ -1343,7 +1380,8 @@ selection_get_selection_count (AtkSelection *selection) } static gboolean -selection_is_child_selected (AtkSelection *selection, gint i) +selection_is_child_selected (AtkSelection *selection, + gint i) { gint row; diff --git a/widgets/table/gal-a11y-e-table.c b/widgets/table/gal-a11y-e-table.c index 436de1ec0f..6ba51303ed 100644 --- a/widgets/table/gal-a11y-e-table.c +++ b/widgets/table/gal-a11y-e-table.c @@ -70,8 +70,9 @@ find_first_table_item (ETableGroup *group) return NULL; } -static AtkObject* -eti_get_accessible (ETableItem *eti, AtkObject *parent) +static AtkObject * +eti_get_accessible (ETableItem *eti, + AtkObject *parent) { AtkObject *a11y = NULL; @@ -110,11 +111,11 @@ init_child_item (GalA11yETable *a11y) return FALSE; } -static AtkObject* -et_ref_accessible_at_point (AtkComponent *component, - gint x, - gint y, - AtkCoordType coord_type) +static AtkObject * +et_ref_accessible_at_point (AtkComponent *component, + gint x, + gint y, + AtkCoordType coord_type) { GalA11yETable *a11y = GAL_A11Y_E_TABLE (component); if (GET_PRIVATE (a11y)->child_item) @@ -146,9 +147,9 @@ et_get_n_children (AtkObject *accessible) return n; } -static AtkObject* +static AtkObject * et_ref_child (AtkObject *accessible, - gint i) + gint i) { GalA11yETable *a11y = GAL_A11Y_E_TABLE (accessible); ETable * et; diff --git a/widgets/table/gal-a11y-e-tree-factory.c b/widgets/table/gal-a11y-e-tree-factory.c index 4e22c1ca70..00ce55c8c0 100644 --- a/widgets/table/gal-a11y-e-tree-factory.c +++ b/widgets/table/gal-a11y-e-tree-factory.c @@ -38,7 +38,7 @@ gal_a11y_e_tree_factory_get_accessible_type (void) return GAL_A11Y_TYPE_E_TREE; } -static AtkObject* +static AtkObject * gal_a11y_e_tree_factory_create_accessible (GObject *obj) { AtkObject *accessible; diff --git a/widgets/table/gal-a11y-e-tree.c b/widgets/table/gal-a11y-e-tree.c index f26c525550..12697f4535 100644 --- a/widgets/table/gal-a11y-e-tree.c +++ b/widgets/table/gal-a11y-e-tree.c @@ -61,11 +61,11 @@ init_child_item (GalA11yETree *a11y) } } -static AtkObject* -et_ref_accessible_at_point (AtkComponent *component, - gint x, - gint y, - AtkCoordType coord_type) +static AtkObject * +et_ref_accessible_at_point (AtkComponent *component, + gint x, + gint y, + AtkCoordType coord_type) { GalA11yETree *a11y = GAL_A11Y_E_TREE (component); init_child_item (a11y); @@ -78,9 +78,9 @@ et_get_n_children (AtkObject *accessible) return 1; } -static AtkObject* +static AtkObject * et_ref_child (AtkObject *accessible, - gint i) + gint i) { GalA11yETree *a11y = GAL_A11Y_E_TREE (accessible); if (i != 0) diff --git a/widgets/text/e-reflow-model.c b/widgets/text/e-reflow-model.c index f96d512f1e..05457d0145 100644 --- a/widgets/text/e-reflow-model.c +++ b/widgets/text/e-reflow-model.c @@ -52,7 +52,8 @@ static guint e_reflow_model_signals[LAST_SIGNAL] = { 0, }; * @width: The new value for the width of each item. */ void -e_reflow_model_set_width (EReflowModel *e_reflow_model, gint width) +e_reflow_model_set_width (EReflowModel *e_reflow_model, + gint width) { g_return_if_fail (e_reflow_model != NULL); g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model)); @@ -84,7 +85,9 @@ e_reflow_model_count (EReflowModel *e_reflow_model) * Returns: the height of the nth item. */ gint -e_reflow_model_height (EReflowModel *e_reflow_model, gint n, GnomeCanvasGroup *parent) +e_reflow_model_height (EReflowModel *e_reflow_model, + gint n, + GnomeCanvasGroup *parent) { g_return_val_if_fail (e_reflow_model != NULL, 0); g_return_val_if_fail (E_IS_REFLOW_MODEL (e_reflow_model), 0); @@ -103,7 +106,9 @@ e_reflow_model_height (EReflowModel *e_reflow_model, gint n, GnomeCanvasGroup *p * Returns: the new GnomeCanvasItem. */ GnomeCanvasItem * -e_reflow_model_incarnate (EReflowModel *e_reflow_model, gint n, GnomeCanvasGroup *parent) +e_reflow_model_incarnate (EReflowModel *e_reflow_model, + gint n, + GnomeCanvasGroup *parent) { g_return_val_if_fail (e_reflow_model != NULL, NULL); g_return_val_if_fail (E_IS_REFLOW_MODEL (e_reflow_model), NULL); @@ -148,7 +153,10 @@ e_reflow_model_create_cmp_cache (EReflowModel *e_reflow_model) * Returns: strcmp like semantics for the comparison value. */ gint -e_reflow_model_compare (EReflowModel *e_reflow_model, gint n1, gint n2, GHashTable *cmp_cache) +e_reflow_model_compare (EReflowModel *e_reflow_model, + gint n1, + gint n2, + GHashTable *cmp_cache) { #if 0 g_return_val_if_fail (e_reflow_model != NULL, 0); @@ -167,7 +175,9 @@ e_reflow_model_compare (EReflowModel *e_reflow_model, gint n1, gint n2, GHashTab * Update item to represent the nth piece of data. */ void -e_reflow_model_reincarnate (EReflowModel *e_reflow_model, gint n, GnomeCanvasItem *item) +e_reflow_model_reincarnate (EReflowModel *e_reflow_model, + gint n, + GnomeCanvasItem *item) { g_return_if_fail (e_reflow_model != NULL); g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model)); @@ -312,7 +322,9 @@ e_reflow_model_comparison_changed (EReflowModel *e_reflow_model) * Use this function to notify any views of the reflow model that a number of items have been inserted. **/ void -e_reflow_model_items_inserted (EReflowModel *e_reflow_model, gint position, gint count) +e_reflow_model_items_inserted (EReflowModel *e_reflow_model, + gint position, + gint count) { g_return_if_fail (e_reflow_model != NULL); g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model)); @@ -335,8 +347,8 @@ e_reflow_model_items_inserted (EReflowModel *e_reflow_model, gint position, gint * item has been removed. **/ void -e_reflow_model_item_removed (EReflowModel *e_reflow_model, - gint n) +e_reflow_model_item_removed (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)); @@ -362,7 +374,8 @@ e_reflow_model_item_removed (EReflowModel *e_reflow_model, * object */ void -e_reflow_model_item_changed (EReflowModel *e_reflow_model, gint n) +e_reflow_model_item_changed (EReflowModel *e_reflow_model, + gint n) { g_return_if_fail (e_reflow_model != NULL); g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model)); diff --git a/widgets/text/e-reflow.c b/widgets/text/e-reflow.c index 1b99d6aec7..02535d7b34 100644 --- a/widgets/text/e-reflow.c +++ b/widgets/text/e-reflow.c @@ -85,14 +85,18 @@ er_create_cmp_cache (gpointer user_data) } static gint -er_compare (gint i1, gint i2, GHashTable *cmp_cache, gpointer user_data) +er_compare (gint i1, + gint i2, + GHashTable *cmp_cache, + gpointer user_data) { EReflow *reflow = user_data; return e_reflow_model_compare (reflow->model, i1, i2, cmp_cache); } static gint -e_reflow_pick_line (EReflow *reflow, gdouble x) +e_reflow_pick_line (EReflow *reflow, + gdouble x) { x += E_REFLOW_BORDER_WIDTH + E_REFLOW_DIVIDER_WIDTH; x /= reflow->column_width + E_REFLOW_FULL_GUTTER; @@ -100,7 +104,8 @@ e_reflow_pick_line (EReflow *reflow, gdouble x) } static gint -er_find_item (EReflow *reflow, GnomeCanvasItem *item) +er_find_item (EReflow *reflow, + GnomeCanvasItem *item) { gint i; for (i = 0; i < reflow->count; i++) { @@ -129,7 +134,8 @@ e_reflow_resize_children (GnomeCanvasItem *item) } static inline void -e_reflow_update_selection_row (EReflow *reflow, gint row) +e_reflow_update_selection_row (EReflow *reflow, + gint row) { if (reflow->items[row]) { g_object_set (reflow->items[row], @@ -157,13 +163,16 @@ e_reflow_update_selection (EReflow *reflow) } static void -selection_changed (ESelectionModel *selection, EReflow *reflow) +selection_changed (ESelectionModel *selection, + EReflow *reflow) { e_reflow_update_selection (reflow); } static void -selection_row_changed (ESelectionModel *selection, gint row, EReflow *reflow) +selection_row_changed (ESelectionModel *selection, + gint row, + EReflow *reflow) { e_reflow_update_selection_row (reflow, row); } @@ -208,7 +217,10 @@ do_adjustment (gpointer user_data) } static void -cursor_changed (ESelectionModel *selection, gint row, gint col, EReflow *reflow) +cursor_changed (ESelectionModel *selection, + gint row, + gint col, + EReflow *reflow) { gint count = reflow->count; gint old_cursor = reflow->cursor_row; @@ -329,8 +341,8 @@ reflow_columns (EReflow *reflow) } else { /* we start one column before the earliest new entry, - so we can handle the case where the new entry is - inserted at the start of the column */ + * so we can handle the case where the new entry is + * inserted at the start of the column */ column_start = reflow->reflow_from_column - 1; start = reflow->columns[column_start]; column_count = column_start + 1; @@ -371,7 +383,9 @@ reflow_columns (EReflow *reflow) } static void -item_changed (EReflowModel *model, gint i, EReflow *reflow) +item_changed (EReflowModel *model, + gint i, + EReflow *reflow) { if (i < 0 || i >= reflow->count) return; @@ -386,7 +400,9 @@ item_changed (EReflowModel *model, gint i, EReflow *reflow) } static void -item_removed (EReflowModel *model, gint i, EReflow *reflow) +item_removed (EReflowModel *model, + gint i, + EReflow *reflow) { gint c; gint sorted; @@ -428,7 +444,10 @@ item_removed (EReflowModel *model, gint i, EReflow *reflow) } static void -items_inserted (EReflowModel *model, gint position, gint count, EReflow *reflow) +items_inserted (EReflowModel *model, + gint position, + gint count, + EReflow *reflow) { gint i, oldcount; @@ -481,7 +500,8 @@ items_inserted (EReflowModel *model, gint position, gint count, EReflow *reflow) } static void -model_changed (EReflowModel *model, EReflow *reflow) +model_changed (EReflowModel *model, + EReflow *reflow) { gint i; gint count; @@ -518,7 +538,8 @@ model_changed (EReflowModel *model, EReflow *reflow) } static void -comparison_changed (EReflowModel *model, EReflow *reflow) +comparison_changed (EReflowModel *model, + EReflow *reflow) { e_sorter_array_clean (reflow->sorter); reflow->reflow_from_column = -1; @@ -615,7 +636,8 @@ disconnect_selection (EReflow *reflow) } static void -connect_model (EReflow *reflow, EReflowModel *model) +connect_model (EReflow *reflow, + EReflowModel *model) { if (reflow->model != NULL) disconnect_model (reflow); @@ -644,7 +666,8 @@ connect_model (EReflow *reflow, EReflowModel *model) } static void -adjustment_changed (GtkAdjustment *adjustment, EReflow *reflow) +adjustment_changed (GtkAdjustment *adjustment, + EReflow *reflow) { queue_incarnate (reflow); } @@ -668,7 +691,8 @@ disconnect_adjustment (EReflow *reflow) } static void -connect_adjustment (EReflow *reflow, GtkAdjustment *adjustment) +connect_adjustment (EReflow *reflow, + GtkAdjustment *adjustment) { if (reflow->adjustment != NULL) disconnect_adjustment (reflow); @@ -688,7 +712,10 @@ connect_adjustment (EReflow *reflow, GtkAdjustment *adjustment) #if 0 static void -set_scroll_adjustments (GtkLayout *layout, GtkAdjustment *hadj, GtkAdjustment *vadj, EReflow *reflow) +set_scroll_adjustments (GtkLayout *layout, + GtkAdjustment *hadj, + GtkAdjustment *vadj, + EReflow *reflow) { connect_adjustment (reflow, hadj); } @@ -723,7 +750,10 @@ column_width_changed (EReflow *reflow) /* Virtual functions */ static void -e_reflow_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +e_reflow_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) { GnomeCanvasItem *item; EReflow *reflow; @@ -731,7 +761,7 @@ e_reflow_set_property (GObject *object, guint prop_id, const GValue *value, GPar item = GNOME_CANVAS_ITEM (object); reflow = E_REFLOW (object); - switch (prop_id) { + switch (property_id) { case PROP_HEIGHT: reflow->height = g_value_get_double (value); reflow->need_reflow_columns = TRUE; @@ -785,13 +815,16 @@ e_reflow_set_property (GObject *object, guint prop_id, const GValue *value, GPar } static void -e_reflow_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +e_reflow_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) { EReflow *reflow; reflow = E_REFLOW (object); - switch (prop_id) { + switch (property_id) { case PROP_MINIMUM_WIDTH: g_value_set_double (value, reflow->minimum_width); break; @@ -811,7 +844,7 @@ e_reflow_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec g_value_set_double (value, reflow->column_width); break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } @@ -922,7 +955,8 @@ e_reflow_unrealize (GnomeCanvasItem *item) } static gboolean -e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) +e_reflow_event (GnomeCanvasItem *item, + GdkEvent *event) { EReflow *reflow; gint return_val = FALSE; @@ -1054,7 +1088,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; @@ -1094,7 +1128,7 @@ 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) { @@ -1268,7 +1302,9 @@ e_reflow_draw (GnomeCanvasItem *item, } static void -e_reflow_update (GnomeCanvasItem *item, const cairo_matrix_t *i2c, gint flags) +e_reflow_update (GnomeCanvasItem *item, + const cairo_matrix_t *i2c, + gint flags) { EReflow *reflow; gdouble x0, x1, y0, y1; @@ -1359,7 +1395,10 @@ e_reflow_update (GnomeCanvasItem *item, const cairo_matrix_t *i2c, gint flags) static GnomeCanvasItem * e_reflow_point (GnomeCanvasItem *item, - gdouble x, gdouble y, gint cx, gint cy) + gdouble x, + gdouble y, + gint cx, + gint cy) { GnomeCanvasItem *child; @@ -1383,7 +1422,8 @@ 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); gdouble old_width; @@ -1429,7 +1469,9 @@ e_reflow_reflow ( GnomeCanvasItem *item, gint flags ) } static gint -e_reflow_selection_event_real (EReflow *reflow, GnomeCanvasItem *item, GdkEvent *event) +e_reflow_selection_event_real (EReflow *reflow, + GnomeCanvasItem *item, + GdkEvent *event) { gint row; gint return_val = TRUE; @@ -1484,7 +1526,7 @@ e_reflow_class_init (EReflowClass *klass) GObjectClass *object_class; GnomeCanvasItemClass *item_class; - object_class = (GObjectClass*) klass; + object_class = (GObjectClass *) klass; item_class = (GnomeCanvasItemClass *) klass; object_class->set_property = e_reflow_set_property; @@ -1612,13 +1654,13 @@ e_reflow_init (EReflow *reflow) NULL); reflow->selection_changed_id = - g_signal_connect(reflow->selection, "selection_changed", + g_signal_connect (reflow->selection, "selection_changed", G_CALLBACK (selection_changed), reflow); reflow->selection_row_changed_id = - g_signal_connect(reflow->selection, "selection_row_changed", + g_signal_connect (reflow->selection, "selection_row_changed", G_CALLBACK (selection_row_changed), reflow); reflow->cursor_changed_id = - g_signal_connect(reflow->selection, "cursor_changed", + 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); diff --git a/widgets/text/e-text-model-repos.c b/widgets/text/e-text-model-repos.c index 0b7a3433fd..b56a213215 100644 --- a/widgets/text/e-text-model-repos.c +++ b/widgets/text/e-text-model-repos.c @@ -30,7 +30,8 @@ #define MODEL_CLAMP(model, pos) (CLAMP((pos), 0, strlen((model)->text))) gint -e_repos_absolute (gint pos, gpointer data) +e_repos_absolute (gint pos, + gpointer data) { EReposAbsolute *info = (EReposAbsolute *) data; g_return_val_if_fail (data, -1); @@ -45,7 +46,8 @@ e_repos_absolute (gint pos, gpointer data) } gint -e_repos_insert_shift (gint pos, gpointer data) +e_repos_insert_shift (gint pos, + gpointer data) { EReposInsertShift *info = (EReposInsertShift *) data; g_return_val_if_fail (data, -1); @@ -57,7 +59,8 @@ e_repos_insert_shift (gint pos, gpointer data) } gint -e_repos_delete_shift (gint pos, gpointer data) +e_repos_delete_shift (gint pos, + gpointer data) { EReposDeleteShift *info = (EReposDeleteShift *) data; g_return_val_if_fail (data, -1); diff --git a/widgets/text/e-text-model.c b/widgets/text/e-text-model.c index f079346b72..a2c34a7a84 100644 --- a/widgets/text/e-text-model.c +++ b/widgets/text/e-text-model.c @@ -171,7 +171,8 @@ e_text_model_dispose (GObject *object) } static gint -e_text_model_real_validate_position (ETextModel *model, gint pos) +e_text_model_real_validate_position (ETextModel *model, + gint pos) { gint len = e_text_model_get_text_length (model); @@ -199,7 +200,8 @@ e_text_model_real_get_text_length (ETextModel *model) } static void -e_text_model_real_set_text (ETextModel *model, const gchar *text) +e_text_model_real_set_text (ETextModel *model, + const gchar *text) { EReposAbsolute repos; gboolean changed = FALSE; @@ -226,7 +228,9 @@ e_text_model_real_set_text (ETextModel *model, const gchar *text) } static void -e_text_model_real_insert (ETextModel *model, gint position, const gchar *text) +e_text_model_real_insert (ETextModel *model, + gint position, + const gchar *text) { e_text_model_insert_length (model, position, text, strlen (text)); } @@ -268,7 +272,9 @@ e_text_model_real_insert_length (ETextModel *model, } static void -e_text_model_real_delete (ETextModel *model, gint position, gint length) +e_text_model_real_delete (ETextModel *model, + gint position, + gint length) { EReposDeleteShift repos; gint byte_position, byte_length; @@ -322,7 +328,9 @@ e_text_model_cancel_completion (ETextModel *model) } void -e_text_model_reposition (ETextModel *model, ETextModelReposFn fn, gpointer repos_data) +e_text_model_reposition (ETextModel *model, + ETextModelReposFn fn, + gpointer repos_data) { g_return_if_fail (E_IS_TEXT_MODEL (model)); g_return_if_fail (fn != NULL); @@ -333,7 +341,8 @@ e_text_model_reposition (ETextModel *model, ETextModelReposFn fn, gpointer repos } gint -e_text_model_validate_position (ETextModel *model, gint pos) +e_text_model_validate_position (ETextModel *model, + gint pos) { g_return_val_if_fail (E_IS_TEXT_MODEL (model), 0); @@ -380,7 +389,8 @@ e_text_model_get_text_length (ETextModel *model) } void -e_text_model_set_text (ETextModel *model, const gchar *text) +e_text_model_set_text (ETextModel *model, + const gchar *text) { g_return_if_fail (E_IS_TEXT_MODEL (model)); @@ -389,7 +399,9 @@ e_text_model_set_text (ETextModel *model, const gchar *text) } void -e_text_model_insert (ETextModel *model, gint position, const gchar *text) +e_text_model_insert (ETextModel *model, + gint position, + const gchar *text) { g_return_if_fail (E_IS_TEXT_MODEL (model)); @@ -417,7 +429,8 @@ e_text_model_insert_length (ETextModel *model, } void -e_text_model_prepend (ETextModel *model, const gchar *text) +e_text_model_prepend (ETextModel *model, + const gchar *text) { g_return_if_fail (E_IS_TEXT_MODEL (model)); @@ -428,7 +441,8 @@ e_text_model_prepend (ETextModel *model, const gchar *text) } void -e_text_model_append (ETextModel *model, const gchar *text) +e_text_model_append (ETextModel *model, + const gchar *text) { g_return_if_fail (E_IS_TEXT_MODEL (model)); @@ -439,7 +453,9 @@ e_text_model_append (ETextModel *model, const gchar *text) } void -e_text_model_delete (ETextModel *model, gint position, gint length) +e_text_model_delete (ETextModel *model, + gint position, + gint length) { gint txt_len; @@ -469,7 +485,9 @@ e_text_model_object_count (ETextModel *model) } const gchar * -e_text_model_get_nth_object (ETextModel *model, gint n, gint *len) +e_text_model_get_nth_object (ETextModel *model, + gint n, + gint *len) { g_return_val_if_fail (E_IS_TEXT_MODEL (model), NULL); @@ -483,7 +501,8 @@ e_text_model_get_nth_object (ETextModel *model, gint n, gint *len) } gchar * -e_text_model_strdup_nth_object (ETextModel *model, gint n) +e_text_model_strdup_nth_object (ETextModel *model, + gint n) { const gchar *obj; gint len = 0; @@ -503,7 +522,10 @@ e_text_model_strdup_nth_object (ETextModel *model, gint n) } void -e_text_model_get_nth_object_bounds (ETextModel *model, gint n, gint *start, gint *end) +e_text_model_get_nth_object_bounds (ETextModel *model, + gint n, + gint *start, + gint *end) { const gchar *txt = NULL, *obj = NULL; gint len = 0; @@ -522,7 +544,8 @@ e_text_model_get_nth_object_bounds (ETextModel *model, gint n, gint *start, gint } gint -e_text_model_get_object_at_offset (ETextModel *model, gint offset) +e_text_model_get_object_at_offset (ETextModel *model, + gint offset) { g_return_val_if_fail (E_IS_TEXT_MODEL (model), -1); @@ -553,7 +576,8 @@ e_text_model_get_object_at_offset (ETextModel *model, gint offset) } gint -e_text_model_get_object_at_pointer (ETextModel *model, const gchar *s) +e_text_model_get_object_at_pointer (ETextModel *model, + const gchar *s) { g_return_val_if_fail (E_IS_TEXT_MODEL (model), -1); g_return_val_if_fail (s != NULL, -1); @@ -563,7 +587,8 @@ e_text_model_get_object_at_pointer (ETextModel *model, const gchar *s) } void -e_text_model_activate_nth_object (ETextModel *model, gint n) +e_text_model_activate_nth_object (ETextModel *model, + gint n) { g_return_if_fail (model != NULL); g_return_if_fail (E_IS_TEXT_MODEL (model)); diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c index fefc0a3317..b57cec835d 100644 --- a/widgets/text/e-text.c +++ b/widgets/text/e-text.c @@ -191,7 +191,8 @@ disconnect_im_context (EText *text) #if 0 static void -e_text_style_set (EText *text, GtkStyle *previous_style) +e_text_style_set (EText *text, + GtkStyle *previous_style) { if (text->line_wrap) { text->needs_split_into_lines = 1; @@ -463,7 +464,8 @@ reset_layout (EText *text) } static void -e_text_text_model_changed (ETextModel *model, EText *text) +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); @@ -494,7 +496,7 @@ e_text_text_model_reposition (ETextModel *model, text->selection_end = fn (text->selection_end, repos_data); /* Our repos function should make sure we don't overrun the buffer, but it never - hurts to be paranoid. */ + * hurts to be paranoid. */ text->selection_start = CLAMP (text->selection_start, 0, model_len); text->selection_end = CLAMP (text->selection_end, 0, model_len); @@ -506,7 +508,11 @@ e_text_text_model_reposition (ETextModel *model, } static void -get_bounds (EText *text, gdouble *px1, gdouble *py1, gdouble *px2, gdouble *py2) +get_bounds (EText *text, + gdouble *px1, + gdouble *py1, + gdouble *px2, + gdouble *py2) { GnomeCanvasItem *item; gdouble wx, wy, clip_width, clip_height; @@ -608,7 +614,7 @@ split_into_lines (EText *text) /* Set_arg handler for the text item */ static void e_text_set_property (GObject *object, - guint prop_id, + guint property_id, const GValue *value, GParamSpec *pspec) { @@ -623,7 +629,7 @@ e_text_set_property (GObject *object, item = GNOME_CANVAS_ITEM (object); text = E_TEXT (object); - switch (prop_id) { + switch (property_id) { case PROP_MODEL: if (text->model_changed_signal_id) @@ -726,9 +732,9 @@ e_text_set_property (GObject *object, text->clip_height = fabs (g_value_get_double (value)); text->needs_recalc_bounds = 1; /* toshok: kind of a hack - set needs_reset_layout - here so when something about the style/them - changes, we redraw the text at the proper size/with - the proper font. */ + * here so when something about the style/them + * changes, we redraw the text at the proper size/with + * the proper font. */ text->needs_reset_layout = 1; needs_reflow = 1; break; @@ -936,7 +942,7 @@ e_text_set_property (GObject *object, /* Get_arg handler for the text item */ static void e_text_get_property (GObject *object, - guint prop_id, + guint property_id, GValue *value, GParamSpec *pspec) { @@ -944,7 +950,7 @@ e_text_get_property (GObject *object, text = E_TEXT (object); - switch (prop_id) { + switch (property_id) { case PROP_MODEL: g_value_set_object (value, text->model); break; @@ -1070,14 +1076,15 @@ e_text_get_property (GObject *object, break; default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } /* Update handler for the text item */ static void -e_text_reflow (GnomeCanvasItem *item, gint flags) +e_text_reflow (GnomeCanvasItem *item, + gint flags) { EText *text; @@ -1106,7 +1113,9 @@ e_text_reflow (GnomeCanvasItem *item, gint flags) /* Update handler for the text item */ static void -e_text_update (GnomeCanvasItem *item, const cairo_matrix_t *i2c, gint flags) +e_text_update (GnomeCanvasItem *item, + const cairo_matrix_t *i2c, + gint flags) { EText *text; gdouble x1, y1, x2, y2; @@ -1213,7 +1222,8 @@ draw_pango_rectangle (cairo_t *cr, } static gboolean -show_pango_rectangle (EText *text, PangoRectangle rect) +show_pango_rectangle (EText *text, + PangoRectangle rect) { gint x1 = rect.x / PANGO_SCALE; gint x2 = (rect.x + rect.width) / PANGO_SCALE; @@ -1278,8 +1288,12 @@ show_pango_rectangle (EText *text, PangoRectangle rect) /* Draw handler for the text item */ static void -e_text_draw (GnomeCanvasItem *item, cairo_t *cr, - gint x, gint y, gint width, gint height) +e_text_draw (GnomeCanvasItem *item, + cairo_t *cr, + gint x, + gint y, + gint width, + gint height) { EText *text; gint xpos, ypos; @@ -1536,8 +1550,11 @@ e_text_draw (GnomeCanvasItem *item, cairo_t *cr, /* Point handler for the text item */ static GnomeCanvasItem * -e_text_point (GnomeCanvasItem *item, gdouble x, gdouble y, - gint cx, gint cy) +e_text_point (GnomeCanvasItem *item, + gdouble x, + gdouble y, + gint cx, + gint cy) { EText *text; gdouble clip_width; @@ -1609,7 +1626,9 @@ e_text_bounds (GnomeCanvasItem *item, } static gint -get_position_from_xy (EText *text, gint x, gint y) +get_position_from_xy (EText *text, + gint x, + gint y) { gint index; gint trailing; @@ -1801,7 +1820,8 @@ _click (gpointer data) } static gint -e_text_event (GnomeCanvasItem *item, GdkEvent *event) +e_text_event (GnomeCanvasItem *item, + GdkEvent *event) { EText *text = E_TEXT (item); ETextEventProcessorEvent e_tep_event; @@ -1896,7 +1916,7 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) if (text->im_context && gtk_im_context_filter_keypress ( text->im_context, - (GdkEventKey*) event)) { + (GdkEventKey *) event)) { text->need_im_reset = TRUE; return 1; } @@ -1982,7 +2002,7 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) } /* Create our own double and triple click events, - as gnome-canvas doesn't forward them to us */ + * as gnome-canvas doesn't forward them to us */ if (event->type == GDK_BUTTON_PRESS) { if (text->dbl_timeout == 0 && text->tpl_timeout == 0) { @@ -2135,10 +2155,10 @@ e_text_select_all (EText *text) } static void -primary_get_cb (GtkClipboard *clipboard, - GtkSelectionData *selection_data, - guint info, - gpointer data) +primary_get_cb (GtkClipboard *clipboard, + GtkSelectionData *selection_data, + guint info, + gpointer data) { EText *text = E_TEXT (data); gint sel_start, sel_end; @@ -2159,7 +2179,7 @@ primary_get_cb (GtkClipboard *clipboard, static void primary_clear_cb (GtkClipboard *clipboard, - gpointer data) + gpointer data) { #ifdef notyet /* XXX */ @@ -2197,8 +2217,8 @@ e_text_update_primary_selection (EText *text) static void paste_received (GtkClipboard *clipboard, - const gchar *text, - gpointer data) + const gchar *text, + gpointer data) { EText *etext = E_TEXT (data); @@ -2213,7 +2233,8 @@ paste_received (GtkClipboard *clipboard, } static void -e_text_paste (EText *text, GdkAtom selection) +e_text_paste (EText *text, + GdkAtom selection) { g_object_ref (text); gtk_clipboard_request_text ( @@ -2230,7 +2251,7 @@ typedef struct { static void popup_menu_detach (GtkWidget *attach_widget, - GtkMenu *menu) + GtkMenu *menu) { } @@ -2258,9 +2279,9 @@ popup_menu_placement_cb (GtkMenu *menu, } static void -popup_targets_received (GtkClipboard *clipboard, - GtkSelectionData *data, - gpointer user_data) +popup_targets_received (GtkClipboard *clipboard, + GtkSelectionData *data, + gpointer user_data) { PopupClosure *closure = user_data; EText *text = closure->text; @@ -2348,7 +2369,9 @@ popup_targets_received (GtkClipboard *clipboard, } static void -e_text_do_popup (EText *text, GdkEventButton *button, gint position) +e_text_do_popup (EText *text, + GdkEventButton *button, + gint position) { PopupClosure *closure = g_new (PopupClosure, 1); @@ -2377,7 +2400,8 @@ e_text_reset_im_context (EText *text) /* fixme: */ static gint -next_word (EText *text, gint start) +next_word (EText *text, + gint start) { gchar *p = g_utf8_offset_to_pointer (text->text, start); gint length; @@ -2406,7 +2430,9 @@ next_word (EText *text, gint start) } static gint -find_offset_into_line (EText *text, gint offset_into_text, gchar **start_of_line) +find_offset_into_line (EText *text, + gint offset_into_text, + gchar **start_of_line) { gchar *p; @@ -2436,10 +2462,11 @@ 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 - text->selection_end (as deemed fit) */ + * 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) +_get_updated_position (EText *text, + gboolean direction) { PangoLogAttr *log_attrs = NULL; gint n_attrs; @@ -2469,7 +2496,7 @@ _get_updated_position (EText *text, gboolean direction) pango_layout_get_log_attrs (text->layout, &log_attrs, &n_attrs); /* Fetch the current gchar index in the line & keep moving - forward until we can display cursor */ + * forward until we can display cursor */ p = g_utf8_offset_to_pointer (text->text, text->selection_end); new_pos = text->selection_end; @@ -2489,7 +2516,7 @@ _get_updated_position (EText *text, gboolean direction) new_pos = g_utf8_pointer_to_offset (text->text, p); /* if is_cursor_position is set, cursor can appear in front of character. - i.e. this is a grapheme boundary AND make some sanity checks */ + * i.e. this is a grapheme boundary AND make some sanity checks */ if ((new_pos >=0) && (new_pos < n_attrs) && (log_attrs[new_pos].is_cursor_position)) break; @@ -2507,7 +2534,8 @@ _get_updated_position (EText *text, gboolean direction) } static gint -_get_position (EText *text, ETextEventProcessorCommand *command) +_get_position (EText *text, + ETextEventProcessorCommand *command) { gint length, obj_num; gunichar unival; @@ -2636,7 +2664,7 @@ _get_position (EText *text, ETextEventProcessorCommand *command) return text->selection_end; /* now we search forward til we hit a \n, and then - offset_into_line more characters */ + * offset_into_line more characters */ p = g_utf8_offset_to_pointer (text->text, text->selection_end); while (p && *p) { if (*p == '\n') @@ -2645,7 +2673,7 @@ _get_position (EText *text, ETextEventProcessorCommand *command) } if (p && *p == '\n') { /* now we loop forward offset_into_line - characters, or until we hit \n or \0 */ + * characters, or until we hit \n or \0 */ p = g_utf8_next_char (p); while (offset_into_line > 0 && p && *p != '\n' && *p != '\0') { @@ -2655,7 +2683,7 @@ _get_position (EText *text, ETextEventProcessorCommand *command) } /* at this point, p points to the new location, - convert it to an offset and we're done */ + * convert it to an offset and we're done */ new_pos = g_utf8_pointer_to_offset (text->text, p); break; } @@ -2666,8 +2694,8 @@ _get_position (EText *text, ETextEventProcessorCommand *command) return text->selection_end; /* p points to the first character on our line. if we - have a \n before it, skip it and scan til we hit - the next one */ + * have a \n before it, skip it and scan til we hit + * the next one */ if (p != text->text) { p = g_utf8_find_prev_char (text->text, p); if (*p == '\n') { @@ -2683,8 +2711,8 @@ _get_position (EText *text, ETextEventProcessorCommand *command) } /* at this point 'p' points to the start of the - previous line, move forward 'offset_into_line' - times. */ + * previous line, move forward 'offset_into_line' + * times. */ while (offset_into_line > 0 && p && *p != '\n' && *p != '\0') { p = g_utf8_next_char (p); @@ -2692,14 +2720,14 @@ _get_position (EText *text, ETextEventProcessorCommand *command) } /* at this point, p points to the new location, - convert it to an offset and we're done */ + * convert it to an offset and we're done */ new_pos = g_utf8_pointer_to_offset (text->text, p); break; } case E_TEP_SELECT_WORD: /* This is a silly hack to cause double-clicking on an object - to activate that object. - (Normally, double click == select word, which is why this is here.) */ + * to activate that object. + * (Normally, double click == select word, which is why this is here.) */ obj_num = e_text_model_get_object_at_offset ( text->model, text->selection_start); @@ -2781,7 +2809,8 @@ _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); @@ -2820,7 +2849,10 @@ e_text_insert (EText *text, const gchar *string) } static void -capitalize (EText *text, gint start, gint end, ETextEventProcessorCaps type) +capitalize (EText *text, + gint start, + gint end, + ETextEventProcessorCaps type) { gboolean first = TRUE; const gchar *p = g_utf8_offset_to_pointer (text->text, start); @@ -2992,17 +3024,17 @@ e_text_command (ETextEventProcessor *tep, e_text_reset_im_context (text); /* it's possible to get here without ever having been realized - by our canvas (if the e-text started completely obscured.) - so let's create our layout object if we don't already have - one. */ + * by our canvas (if the e-text started completely obscured.) + * so let's create our layout object if we don't already have + * one. */ if (!text->layout) create_layout (text); /* We move cursor only if scroll is TRUE */ if (scroll && !text->button_down) { /* XXX do we really need the @trailing logic here? if - we don't we can scrap the loop and just use - pango_layout_index_to_pos */ + * we don't we can scrap the loop and just use + * pango_layout_index_to_pos */ PangoLayoutLine *cur_line = NULL; gint selection_index; PangoLayoutIter *iter = pango_layout_get_iter (text->layout); @@ -3477,8 +3509,8 @@ e_text_init (EText *text) /* IM Context Callbacks */ static void e_text_commit_cb (GtkIMContext *context, - const gchar *str, - EText *text) + const gchar *str, + EText *text) { if (g_utf8_validate (str, strlen (str), NULL)) { if (text->selection_end != text->selection_start) @@ -3490,7 +3522,7 @@ e_text_commit_cb (GtkIMContext *context, static void e_text_preedit_changed_cb (GtkIMContext *context, - EText *etext) + EText *etext) { gchar *preedit_string = NULL; gint cursor_pos; @@ -3509,7 +3541,7 @@ e_text_preedit_changed_cb (GtkIMContext *context, static gboolean e_text_retrieve_surrounding_cb (GtkIMContext *context, - EText *text) + EText *text) { gtk_im_context_set_surrounding ( context, text->text, strlen (text->text), @@ -3520,10 +3552,10 @@ e_text_retrieve_surrounding_cb (GtkIMContext *context, } static gboolean -e_text_delete_surrounding_cb (GtkIMContext *context, - gint offset, - gint n_chars, - EText *text) +e_text_delete_surrounding_cb (GtkIMContext *context, + gint offset, + gint n_chars, + EText *text) { e_text_model_delete (text->model, MIN (text->selection_start, text->selection_end) + offset, diff --git a/widgets/text/gal-a11y-e-text-factory.c b/widgets/text/gal-a11y-e-text-factory.c index a1ffaa0d90..8da12ee294 100644 --- a/widgets/text/gal-a11y-e-text-factory.c +++ b/widgets/text/gal-a11y-e-text-factory.c @@ -39,7 +39,7 @@ gal_a11y_e_text_factory_get_accessible_type (void) return GAL_A11Y_TYPE_E_TEXT; } -static AtkObject* +static AtkObject * gal_a11y_e_text_factory_create_accessible (GObject *obj) { AtkObject *atk_object; diff --git a/widgets/text/gal-a11y-e-text.c b/widgets/text/gal-a11y-e-text.c index a657543305..609b23a900 100644 --- a/widgets/text/gal-a11y-e-text.c +++ b/widgets/text/gal-a11y-e-text.c @@ -57,11 +57,11 @@ et_dispose (GObject *object) static void et_get_extents (AtkComponent *component, - gint *x, - gint *y, - gint *width, - gint *height, - AtkCoordType coord_type) + gint *x, + gint *y, + gint *width, + gint *height, + AtkCoordType coord_type) { EText *item = E_TEXT (atk_gobject_accessible_get_object ( ATK_GOBJECT_ACCESSIBLE (component))); @@ -107,7 +107,7 @@ et_get_full_text (AtkText *text) static void et_set_full_text (AtkEditableText *text, - const gchar *full_text) + const gchar *full_text) { EText *etext = E_TEXT (atk_gobject_accessible_get_object ( ATK_GOBJECT_ACCESSIBLE (text))); @@ -120,8 +120,8 @@ et_set_full_text (AtkEditableText *text, static gchar * et_get_text (AtkText *text, - gint start_offset, - gint end_offset) + gint start_offset, + gint end_offset) { gint start, end, real_start, real_end, len; const gchar *full_text = et_get_full_text (text); @@ -153,8 +153,8 @@ is_a_seperator (gunichar c) static gint find_word_start (const gchar *text, - gint begin_offset, - gint step) + gint begin_offset, + gint step) { gint offset; gchar *at_offset; @@ -167,7 +167,7 @@ find_word_start (const gchar *text, while (offset > 0 && offset < len) { at_offset = g_utf8_offset_to_pointer (text, offset); current = g_utf8_get_char_validated (at_offset, -1); - at_offset = g_utf8_offset_to_pointer (text, offset-1); + at_offset = g_utf8_offset_to_pointer (text, offset - 1); previous = g_utf8_get_char_validated (at_offset, -1); if ((!is_a_seperator (current)) && is_a_seperator (previous)) break; @@ -179,8 +179,8 @@ find_word_start (const gchar *text, static gint find_word_end (const gchar *text, - gint begin_offset, - gint step) + gint begin_offset, + gint step) { gint offset; gchar *at_offset; @@ -193,7 +193,7 @@ find_word_end (const gchar *text, while (offset > 0 && offset < len) { at_offset = g_utf8_offset_to_pointer (text, offset); current = g_utf8_get_char_validated (at_offset, -1); - at_offset = g_utf8_offset_to_pointer (text, offset-1); + at_offset = g_utf8_offset_to_pointer (text, offset - 1); previous = g_utf8_get_char_validated (at_offset, -1); if (is_a_seperator (current) && (!is_a_seperator (previous))) break; @@ -205,8 +205,8 @@ find_word_end (const gchar *text, static gint find_sentence_start (const gchar *text, - gint begin_offset, - gint step) + gint begin_offset, + gint step) { gint offset, last_word_end, len; gchar *at_offset; @@ -216,7 +216,7 @@ find_sentence_start (const gchar *text, offset = find_word_start (text, begin_offset, step); len = g_utf8_strlen (text, -1); - while (offset>0 && offset <len) { + while (offset > 0 && offset <len) { last_word_end = find_word_end (text, offset - 1, -1); if (last_word_end == 0) break; @@ -307,10 +307,10 @@ find_line_end (const gchar *text, static gchar * et_get_text_after_offset (AtkText *text, - gint offset, - AtkTextBoundary boundary_type, - gint *start_offset, - gint *end_offset) + gint offset, + AtkTextBoundary boundary_type, + gint *start_offset, + gint *end_offset) { gint start, end, len; const gchar *full_text = et_get_full_text (text); @@ -360,10 +360,10 @@ et_get_text_after_offset (AtkText *text, static gchar * et_get_text_at_offset (AtkText *text, - gint offset, - AtkTextBoundary boundary_type, - gint *start_offset, - gint *end_offset) + gint offset, + AtkTextBoundary boundary_type, + gint *start_offset, + gint *end_offset) { gint start, end, len; const gchar *full_text = et_get_full_text (text); @@ -413,7 +413,7 @@ et_get_text_at_offset (AtkText *text, static gunichar et_get_character_at_offset (AtkText *text, - gint offset) + gint offset) { const gchar *full_text = et_get_full_text (text); gchar *at_offset; @@ -424,10 +424,10 @@ et_get_character_at_offset (AtkText *text, static gchar * et_get_text_before_offset (AtkText *text, - gint offset, - AtkTextBoundary boundary_type, - gint *start_offset, - gint *end_offset) + gint offset, + AtkTextBoundary boundary_type, + gint *start_offset, + gint *end_offset) { gint start, end, len; const gchar *full_text = et_get_full_text (text); @@ -494,17 +494,17 @@ et_get_caret_offset (AtkText *text) return offset; } -static AtkAttributeSet* +static AtkAttributeSet * et_get_run_attributes (AtkText *text, - gint offset, - gint *start_offset, - gint *end_offset) + gint offset, + gint *start_offset, + gint *end_offset) { /* Unimplemented */ return NULL; } -static AtkAttributeSet* +static AtkAttributeSet * et_get_default_attributes (AtkText *text) { /* Unimplemented */ @@ -513,12 +513,12 @@ et_get_default_attributes (AtkText *text) static void et_get_character_extents (AtkText *text, - gint offset, - gint *x, - gint *y, - gint *width, - gint *height, - AtkCoordType coords) + gint offset, + gint *x, + gint *y, + gint *width, + gint *height, + AtkCoordType coords) { GObject *obj; EText *etext; @@ -593,9 +593,9 @@ et_get_character_count (AtkText *text) static gint et_get_offset_at_point (AtkText *text, - gint x, - gint y, - AtkCoordType coords) + gint x, + gint y, + AtkCoordType coords) { GObject *obj; EText *etext; @@ -668,9 +668,9 @@ et_get_n_selections (AtkText *text) static gchar * et_get_selection (AtkText *text, - gint selection_num, - gint *start_offset, - gint *end_offset) + gint selection_num, + gint *start_offset, + gint *end_offset) { gint start, end, real_start, real_end, len; EText *etext; @@ -701,8 +701,8 @@ et_get_selection (AtkText *text, static gboolean et_add_selection (AtkText *text, - gint start_offset, - gint end_offset) + gint start_offset, + gint end_offset) { GObject *obj; EText *etext; @@ -739,7 +739,7 @@ et_add_selection (AtkText *text, static gboolean et_remove_selection (AtkText *text, - gint selection_num) + gint selection_num) { GObject *obj; EText *etext; @@ -763,9 +763,9 @@ et_remove_selection (AtkText *text, static gboolean et_set_selection (AtkText *text, - gint selection_num, - gint start_offset, - gint end_offset) + gint selection_num, + gint start_offset, + gint end_offset) { GObject *obj; @@ -781,7 +781,7 @@ et_set_selection (AtkText *text, static gboolean et_set_caret_offset (AtkText *text, - gint offset) + gint offset) { GObject *obj; EText *etext; @@ -813,9 +813,9 @@ et_set_caret_offset (AtkText *text, static gboolean et_set_run_attributes (AtkEditableText *text, - AtkAttributeSet *attrib_set, - gint start_offset, - gint end_offset) + AtkAttributeSet *attrib_set, + gint start_offset, + gint end_offset) { /* Unimplemented */ return FALSE; @@ -823,16 +823,16 @@ et_set_run_attributes (AtkEditableText *text, static void et_set_text_contents (AtkEditableText *text, - const gchar *string) + const gchar *string) { et_set_full_text (text, string); } static void et_insert_text (AtkEditableText *text, - const gchar *string, - gint length, - gint *position) + const gchar *string, + gint length, + gint *position) { /* Utf8 unimplemented */ gchar *result; @@ -854,8 +854,8 @@ et_insert_text (AtkEditableText *text, static void et_copy_text (AtkEditableText *text, - gint start_pos, - gint end_pos) + gint start_pos, + gint end_pos) { GObject *obj; EText *etext; @@ -877,8 +877,8 @@ et_copy_text (AtkEditableText *text, static void et_delete_text (AtkEditableText *text, - gint start_pos, - gint end_pos) + gint start_pos, + gint end_pos) { GObject *obj; EText *etext; @@ -899,8 +899,8 @@ et_delete_text (AtkEditableText *text, static void et_cut_text (AtkEditableText *text, - gint start_pos, - gint end_pos) + gint start_pos, + gint end_pos) { et_copy_text (text, start_pos, end_pos); et_delete_text (text, start_pos, end_pos); @@ -908,7 +908,7 @@ et_cut_text (AtkEditableText *text, static void et_paste_text (AtkEditableText *text, - gint position) + gint position) { GObject *obj; EText *etext; @@ -967,9 +967,9 @@ et_atk_editable_text_iface_init (AtkEditableTextIface *iface) static void _et_reposition_cb (ETextModel *model, - ETextModelReposFn fn, - gpointer repos_data, - gpointer user_data) + ETextModelReposFn fn, + gpointer repos_data, + gpointer user_data) { AtkObject *accessible; AtkText *text; @@ -989,8 +989,8 @@ _et_reposition_cb (ETextModel *model, static void _et_command_cb (ETextEventProcessor *tep, - ETextEventProcessorCommand *command, - gpointer user_data) + ETextEventProcessorCommand *command, + gpointer user_data) { AtkObject *accessible; AtkText *text; @@ -1012,7 +1012,7 @@ _et_command_cb (ETextEventProcessor *tep, static void et_real_initialize (AtkObject *obj, - gpointer data) + gpointer data) { EText *etext; |