diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-02-08 01:36:53 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-02-08 02:26:37 +0800 |
commit | 49ef32b76c55cbefba53568f02028dddf23a9bc9 (patch) | |
tree | 682e825cab580d4c401f0a138ee29a8534336591 /e-util | |
parent | 2ef43b4cf40d21c61d39c5a938e428afa9074e2b (diff) | |
download | gsoc2013-evolution-49ef32b76c55cbefba53568f02028dddf23a9bc9.tar gsoc2013-evolution-49ef32b76c55cbefba53568f02028dddf23a9bc9.tar.gz gsoc2013-evolution-49ef32b76c55cbefba53568f02028dddf23a9bc9.tar.bz2 gsoc2013-evolution-49ef32b76c55cbefba53568f02028dddf23a9bc9.tar.lz gsoc2013-evolution-49ef32b76c55cbefba53568f02028dddf23a9bc9.tar.xz gsoc2013-evolution-49ef32b76c55cbefba53568f02028dddf23a9bc9.tar.zst gsoc2013-evolution-49ef32b76c55cbefba53568f02028dddf23a9bc9.zip |
Coding style and whitespace cleanup.
Diffstat (limited to 'e-util')
-rw-r--r-- | e-util/e-bit-array.c | 12 | ||||
-rw-r--r-- | e-util/e-plugin.h | 71 | ||||
-rw-r--r-- | e-util/e-signature-list.c | 30 | ||||
-rw-r--r-- | e-util/e-sorter-array.c | 10 |
4 files changed, 82 insertions, 41 deletions
diff --git a/e-util/e-bit-array.c b/e-util/e-bit-array.c index c986b4cefc..0a5ca37a0c 100644 --- a/e-util/e-bit-array.c +++ b/e-util/e-bit-array.c @@ -58,7 +58,9 @@ e_bit_array_insert_real(EBitArray *eba, gint row) } /* Shift right half of box one bit to the right. */ - eba->data[box] = (eba->data[box] & BITMASK_LEFT(row)) | ((eba->data[box] & BITMASK_RIGHT(row)) >> 1); + eba->data[box] = + (eba->data[box] & BITMASK_LEFT(row)) | + ((eba->data[box] & BITMASK_RIGHT(row)) >> 1); eba->bit_count ++; } } @@ -80,7 +82,9 @@ e_bit_array_delete_real(EBitArray *eba, gint row, gboolean move_selection_mode) if (move_selection_mode) selected = e_bit_array_value_at(eba, row); /* Shift right half of box one bit to the left. */ - eba->data[box] = (eba->data[box] & BITMASK_LEFT(row))| ((eba->data[box] & bitmask) << 1); + eba->data[box] = + (eba->data[box] & BITMASK_LEFT(row)) | + ((eba->data[box] & bitmask) << 1); /* Shift all words to the right of our box left one bit. */ if (box < last) { @@ -297,7 +301,9 @@ e_bit_array_bit_count (EBitArray *eba) return eba->bit_count; } -#define OPERATE(object, i,mask,grow) ((grow) ? (((object)->data[(i)]) |= ((guint32) ~(mask))) : (((object)->data[(i)]) &= (mask))) +#define OPERATE(object, i,mask,grow) \ + ((grow) ? (((object)->data[(i)]) |= ((guint32) ~(mask))) : \ + (((object)->data[(i)]) &= (mask))) void e_bit_array_change_one_row(EBitArray *eba, gint row, gboolean grow) diff --git a/e-util/e-plugin.h b/e-util/e-plugin.h index a90499bf9c..057e80d743 100644 --- a/e-util/e-plugin.h +++ b/e-util/e-plugin.h @@ -126,26 +126,34 @@ struct _EPluginClass { GtkWidget *(*get_configure_widget)(EPlugin *); }; -GType e_plugin_get_type(void); - -gint e_plugin_construct(EPlugin *ep, xmlNodePtr root); -void e_plugin_add_load_path(const gchar *); -gint e_plugin_load_plugins(void); -GSList * e_plugin_list_plugins(void); - -gpointer e_plugin_get_symbol(EPlugin *ep, const gchar *name); -gpointer e_plugin_invoke(EPlugin *ep, const gchar *name, gpointer data); -void e_plugin_enable(EPlugin *eph, gint state); - -GtkWidget *e_plugin_get_configure_widget (EPlugin *ep); +GType e_plugin_get_type (void); +gint e_plugin_construct (EPlugin *plugin, + xmlNodePtr root); +void e_plugin_add_load_path (const gchar *path); +gint e_plugin_load_plugins (void); +GSList * e_plugin_list_plugins (void); +gpointer e_plugin_get_symbol (EPlugin *plugin, + const gchar *name); +gpointer e_plugin_invoke (EPlugin *plugin, + const gchar *name, + gpointer data); +void e_plugin_enable (EPlugin *plugin, + gint state); +GtkWidget * e_plugin_get_configure_widget (EPlugin *plugin); /* static helpers */ /* maps prop or content to 'g memory' */ -gchar *e_plugin_xml_prop(xmlNodePtr node, const gchar *id); -gchar *e_plugin_xml_prop_domain(xmlNodePtr node, const gchar *id, const gchar *domain); -gint e_plugin_xml_int(xmlNodePtr node, const gchar *id, gint def); -gchar *e_plugin_xml_content(xmlNodePtr node); -gchar *e_plugin_xml_content_domain(xmlNodePtr node, const gchar *domain); +gchar * e_plugin_xml_prop (xmlNodePtr node, + const gchar *id); +gchar * e_plugin_xml_prop_domain (xmlNodePtr node, + const gchar *id, + const gchar *domain); +gint e_plugin_xml_int (xmlNodePtr node, + const gchar *id, + gint def); +gchar * e_plugin_xml_content (xmlNodePtr node); +gchar * e_plugin_xml_content_domain (xmlNodePtr node, + const gchar *domain); /* ********************************************************************** */ @@ -204,7 +212,7 @@ struct _EPluginHookTargetKey { struct _EPluginHookTargetMap { const gchar *type; gint id; - const struct _EPluginHookTargetKey *mask_bits; /* null terminated array */ + const EPluginHookTargetKey *mask_bits; /* null terminated array */ }; /** @@ -218,8 +226,7 @@ struct _EPluginHookTargetMap { **/ struct _EPluginHook { GObject object; - - struct _EPlugin *plugin; + EPlugin *plugin; }; /** @@ -244,18 +251,26 @@ struct _EPluginHookClass { const gchar *id; - gint (*construct)(EPluginHook *eph, EPlugin *ep, xmlNodePtr root); - void (*enable)(EPluginHook *eph, gint state); + gint (*construct) (EPluginHook *plugin_hook, + EPlugin *plugin, + xmlNodePtr root); + void (*enable) (EPluginHook *plugin_hook, + gint state); }; -GType e_plugin_hook_get_type(void); - -EPluginHook * e_plugin_hook_new(EPlugin *ep, xmlNodePtr root); -void e_plugin_hook_enable(EPluginHook *eph, gint state); +GType e_plugin_hook_get_type (void); +EPluginHook * e_plugin_hook_new (EPlugin *plugin, + xmlNodePtr root); +void e_plugin_hook_enable (EPluginHook *plugin_hook, + gint state); /* static methods */ -guint32 e_plugin_hook_mask(xmlNodePtr root, const struct _EPluginHookTargetKey *map, const gchar *prop); -guint32 e_plugin_hook_id(xmlNodePtr root, const struct _EPluginHookTargetKey *map, const gchar *prop); +guint32 e_plugin_hook_mask (xmlNodePtr root, + const EPluginHookTargetKey *map, + const gchar *prop); +guint32 e_plugin_hook_id (xmlNodePtr root, + const EPluginHookTargetKey *map, + const gchar *prop); /* README: Currently there is only one flag. But we may need more in the future and hence makes diff --git a/e-util/e-signature-list.c b/e-util/e-signature-list.c index 61076b9d72..79ebb0be46 100644 --- a/e-util/e-signature-list.c +++ b/e-util/e-signature-list.c @@ -161,7 +161,10 @@ add_autogen (ESignatureList *list, GSList *new_sigs) } static void -gconf_signatures_changed (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data) +gconf_signatures_changed (GConfClient *client, + guint cnxn_id, + GConfEntry *entry, + gpointer user_data) { ESignatureList *signature_list = user_data; GSList *list, *l, *n, *new_sigs = NULL; @@ -175,29 +178,36 @@ gconf_signatures_changed (GConfClient *client, guint cnxn_id, GConfEntry *entry, old_sigs = e_list_duplicate (E_LIST (signature_list)); - list = gconf_client_get_list (client, "/apps/evolution/mail/signatures", GCONF_VALUE_STRING, NULL); + list = gconf_client_get_list ( + client, "/apps/evolution/mail/signatures", + GCONF_VALUE_STRING, NULL); for (l = list; l; l = l->next) { found = FALSE; if ((uid = e_signature_uid_from_xml (l->data))) { /* See if this is an existing signature */ - for (iter = e_list_get_iterator (old_sigs); e_iterator_is_valid (iter); e_iterator_next (iter)) { + iter = e_list_get_iterator (old_sigs); + while (e_iterator_is_valid (iter)) { const gchar *signature_uid; signature = (ESignature *) e_iterator_get (iter); signature_uid = e_signature_get_uid (signature); if (!strcmp (signature_uid, uid)) { /* The signature still exists, so remove - * it from "old_sigs" and update it. - */ + * it from "old_sigs" and update it. */ found = TRUE; e_iterator_delete (iter); if (e_signature_set_from_xml (signature, l->data)) - g_signal_emit (signature_list, signals[SIGNATURE_CHANGED], 0, signature); + g_signal_emit ( + signature_list, + signals[SIGNATURE_CHANGED], + 0, signature); have_autogen |= e_signature_get_autogenerated (signature); break; } + + e_iterator_next (iter); } g_object_unref (iter); @@ -238,10 +248,14 @@ gconf_signatures_changed (GConfClient *client, guint cnxn_id, GConfEntry *entry, } /* Anything left in old_sigs must have been deleted */ - for (iter = e_list_get_iterator (old_sigs); e_iterator_is_valid (iter); e_iterator_next (iter)) { + iter = e_list_get_iterator (old_sigs); + while (e_iterator_is_valid (iter)) { signature = (ESignature *) e_iterator_get (iter); e_list_remove (E_LIST (signature_list), signature); - g_signal_emit (signature_list, signals[SIGNATURE_REMOVED], 0, signature); + g_signal_emit ( + signature_list, signals[SIGNATURE_REMOVED], 0, + signature); + e_iterator_next (iter); } g_object_unref (iter); diff --git a/e-util/e-sorter-array.c b/e-util/e-sorter-array.c index 39f3e61fa8..71cd1d83b2 100644 --- a/e-util/e-sorter-array.c +++ b/e-util/e-sorter-array.c @@ -204,8 +204,14 @@ e_sorter_array_append (ESorterArray *esa, gint count) for (i = 0; i < count; i++) { gint value = esa->rows; gsize pos; - e_bsearch (&value, esa->sorted, esa->rows, sizeof (gint), esort_callback, esa, &pos, NULL); - memmove (esa->sorted + pos + 1, esa->sorted + pos, sizeof (gint) * (esa->rows - pos)); + + e_bsearch ( + &value, esa->sorted, esa->rows, + sizeof (gint), esort_callback, esa, &pos, NULL); + memmove ( + esa->sorted + pos + 1, + esa->sorted + pos, + sizeof (gint) * (esa->rows - pos)); esa->sorted[pos] = value; esa->rows ++; } |