aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-02-08 01:36:53 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-02-08 02:26:37 +0800
commit49ef32b76c55cbefba53568f02028dddf23a9bc9 (patch)
tree682e825cab580d4c401f0a138ee29a8534336591 /widgets/misc
parent2ef43b4cf40d21c61d39c5a938e428afa9074e2b (diff)
downloadgsoc2013-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 'widgets/misc')
-rw-r--r--widgets/misc/e-canvas.c39
-rw-r--r--widgets/misc/e-map.c20
-rw-r--r--widgets/misc/e-map.h30
3 files changed, 58 insertions, 31 deletions
diff --git a/widgets/misc/e-canvas.c b/widgets/misc/e-canvas.c
index 6d12cae087..8b1a6d2409 100644
--- a/widgets/misc/e-canvas.c
+++ b/widgets/misc/e-canvas.c
@@ -153,8 +153,10 @@ emit_event (GnomeCanvas *canvas, GdkEvent *event)
item = canvas->current_item;
- if (canvas->focused_item
- && ((event->type == GDK_KEY_PRESS) || (event->type == GDK_KEY_RELEASE) || (event->type == GDK_FOCUS_CHANGE)))
+ if (canvas->focused_item &&
+ ((event->type == GDK_KEY_PRESS) ||
+ (event->type == GDK_KEY_RELEASE) ||
+ (event->type == GDK_FOCUS_CHANGE)))
item = canvas->focused_item;
if (canvas->grabbed_item)
@@ -279,8 +281,12 @@ e_canvas_key (GtkWidget *widget, GdkEventKey *event)
#define HACKISH_AFFINE
static double
-gnome_canvas_item_invoke_point (GnomeCanvasItem *item, gdouble x, gdouble y, gint cx, gint cy,
- GnomeCanvasItem **actual_item)
+gnome_canvas_item_invoke_point (GnomeCanvasItem *item,
+ gdouble x,
+ gdouble y,
+ gint cx,
+ gint cy,
+ GnomeCanvasItem **actual_item)
{
#ifdef HACKISH_AFFINE
gdouble i2w[6], w2c[6], i2c[6], c2i[6];
@@ -327,7 +333,6 @@ pick_current_item (GnomeCanvas *canvas, GdkEvent *event)
| GDK_BUTTON3_MASK
| GDK_BUTTON4_MASK
| GDK_BUTTON5_MASK);
- d(g_print ("%s:%d: button_down = %s\n", __FUNCTION__, __LINE__, button_down ? "TRUE" : "FALSE"));
if (!button_down)
canvas->left_grabbed_item = FALSE;
@@ -630,7 +635,9 @@ ec_style_set_recursive (GnomeCanvasItem *item, GtkStyle *previous_style)
if (signal_id >= 1) {
GSignalQuery query;
g_signal_query (signal_id, &query);
- if (query.return_type == G_TYPE_NONE && query.n_params == 1 && query.param_types[0] == GTK_TYPE_STYLE) {
+ if (query.return_type == G_TYPE_NONE &&
+ query.n_params == 1 &&
+ query.param_types[0] == GTK_TYPE_STYLE) {
g_signal_emit (item, signal_id, 0, previous_style);
}
}
@@ -645,7 +652,9 @@ ec_style_set_recursive (GnomeCanvasItem *item, GtkStyle *previous_style)
static void
e_canvas_style_set (GtkWidget *widget, GtkStyle *previous_style)
{
- ec_style_set_recursive (GNOME_CANVAS_ITEM (gnome_canvas_root (GNOME_CANVAS (widget))), previous_style);
+ ec_style_set_recursive (
+ GNOME_CANVAS_ITEM (gnome_canvas_root (GNOME_CANVAS (widget))),
+ previous_style);
}
static void
@@ -745,7 +754,8 @@ add_idle (ECanvas *canvas)
if (canvas->idle_id != 0)
return;
- canvas->idle_id = g_idle_add_full (G_PRIORITY_HIGH_IDLE, idle_handler, (gpointer) canvas, NULL);
+ canvas->idle_id = g_idle_add_full (
+ G_PRIORITY_HIGH_IDLE, idle_handler, (gpointer) canvas, NULL);
}
static void
@@ -797,12 +807,13 @@ grab_cancelled_check (gpointer data)
}
if (gtk_grab_get_current ()) {
- gnome_canvas_item_ungrab(GNOME_CANVAS (canvas)->grabbed_item, canvas->grab_cancelled_time);
- if (canvas->grab_cancelled_cb) {
- canvas->grab_cancelled_cb (canvas,
- GNOME_CANVAS (canvas)->grabbed_item,
- canvas->grab_cancelled_data);
- }
+ gnome_canvas_item_ungrab (
+ GNOME_CANVAS (canvas)->grabbed_item,
+ canvas->grab_cancelled_time);
+ if (canvas->grab_cancelled_cb)
+ canvas->grab_cancelled_cb (
+ canvas, GNOME_CANVAS (canvas)->grabbed_item,
+ canvas->grab_cancelled_data);
canvas->grab_cancelled_cb = NULL;
canvas->grab_cancelled_check_id = 0;
canvas->grab_cancelled_time = 0;
diff --git a/widgets/misc/e-map.c b/widgets/misc/e-map.c
index f4968432a0..809841b114 100644
--- a/widgets/misc/e-map.c
+++ b/widgets/misc/e-map.c
@@ -223,7 +223,7 @@ e_map_destroy (GtkObject *object)
EMapPrivate *priv;
g_return_if_fail (object != NULL);
- g_return_if_fail (IS_E_MAP (object));
+ g_return_if_fail (E_IS_MAP (object));
view = E_MAP (object);
priv = view->priv;
@@ -244,7 +244,7 @@ e_map_finalize (GObject *object)
EMapPrivate *priv;
g_return_if_fail (object != NULL);
- g_return_if_fail (IS_E_MAP (object));
+ g_return_if_fail (E_IS_MAP (object));
view = E_MAP (object);
priv = view->priv;
@@ -280,7 +280,7 @@ static void
e_map_unmap (GtkWidget *widget)
{
g_return_if_fail (widget != NULL);
- g_return_if_fail (IS_E_MAP (widget));
+ g_return_if_fail (E_IS_MAP (widget));
if (GTK_WIDGET_CLASS (parent_class)->unmap)
(*GTK_WIDGET_CLASS (parent_class)->unmap) (widget);
@@ -298,7 +298,7 @@ e_map_realize (GtkWidget *widget)
gint attr_mask;
g_return_if_fail (widget != NULL);
- g_return_if_fail (IS_E_MAP (widget));
+ g_return_if_fail (E_IS_MAP (widget));
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
@@ -337,7 +337,7 @@ static void
e_map_unrealize (GtkWidget *widget)
{
g_return_if_fail (widget != NULL);
- g_return_if_fail (IS_E_MAP (widget));
+ g_return_if_fail (E_IS_MAP (widget));
if (GTK_WIDGET_CLASS (parent_class)->unrealize)
(*GTK_WIDGET_CLASS (parent_class)->unrealize) (widget);
@@ -352,7 +352,7 @@ e_map_size_request (GtkWidget *widget, GtkRequisition *requisition)
EMapPrivate *priv;
g_return_if_fail (widget != NULL);
- g_return_if_fail (IS_E_MAP (widget));
+ g_return_if_fail (E_IS_MAP (widget));
g_return_if_fail (requisition != NULL);
view = E_MAP (widget);
@@ -373,7 +373,7 @@ e_map_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
GdkRectangle area;
g_return_if_fail (widget != NULL);
- g_return_if_fail (IS_E_MAP (widget));
+ g_return_if_fail (E_IS_MAP (widget));
g_return_if_fail (allocation != NULL);
view = E_MAP (widget);
@@ -449,7 +449,7 @@ e_map_expose (GtkWidget *widget, GdkEventExpose *event)
EMap *view;
g_return_val_if_fail (widget != NULL, FALSE);
- g_return_val_if_fail (IS_E_MAP (widget), FALSE);
+ g_return_val_if_fail (E_IS_MAP (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
view = E_MAP (widget);
@@ -468,7 +468,7 @@ e_map_set_scroll_adjustments (GtkWidget *widget, GtkAdjustment *hadj, GtkAdjustm
gboolean need_adjust;
g_return_if_fail (widget != NULL);
- g_return_if_fail (IS_E_MAP (widget));
+ g_return_if_fail (E_IS_MAP (widget));
view = E_MAP (widget);
priv = view->priv;
@@ -616,7 +616,7 @@ e_map_new (void)
GtkWidget *widget;
AtkObject *a11y;
- widget = g_object_new (TYPE_E_MAP, NULL);
+ widget = g_object_new (E_TYPE_MAP, NULL);
a11y = gtk_widget_get_accessible (widget);
atk_object_set_name (a11y, _("World Map"));
atk_object_set_role (a11y, ATK_ROLE_IMAGE);
diff --git a/widgets/misc/e-map.h b/widgets/misc/e-map.h
index 4730f7662b..059da7c2a5 100644
--- a/widgets/misc/e-map.h
+++ b/widgets/misc/e-map.h
@@ -26,11 +26,26 @@
#include <gtk/gtk.h>
-#define TYPE_E_MAP (e_map_get_type ())
-#define E_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_E_MAP, EMap))
-#define E_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_E_MAP, EMapClass))
-#define IS_E_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_E_MAP))
-#define IS_E_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_E_MAP))
+/* Standard GObject macros */
+#define E_TYPE_MAP \
+ (e_map_get_type ())
+#define E_MAP(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), E_TYPE_MAP, EMap))
+#define E_MAP_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), E_TYPE_MAP, EMapClass))
+#define E_IS_MAP(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), E_TYPE_MAP))
+#define E_IS_MAP_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), E_TYPE_MAP))
+#define E_MAP_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), E_TYPE_MAP, EMapClass))
+
+G_BEGIN_DECLS
typedef struct _EMap EMap;
typedef struct _EMapClass EMapClass;
@@ -56,8 +71,7 @@ struct _EMapClass {
/* The definition of Dot */
-struct _EMapPoint
-{
+struct _EMapPoint {
gchar *name; /* Can be NULL */
gdouble longitude, latitude;
guint32 rgba;
@@ -132,4 +146,6 @@ gboolean e_map_point_is_in_view (EMap *map, EMapPoint *point);
EMapPoint *e_map_get_closest_point (EMap *map, gdouble longitude, gdouble latitude,
gboolean in_view);
+G_END_DECLS
+
#endif