diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2012-11-10 11:40:00 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2012-11-11 04:54:43 +0800 |
commit | 2c4ae5e7685c462f8d464448e4617b8dea029e72 (patch) | |
tree | c34f0cbb7c500ff70f10fce846631b0a948b341c /widgets/misc | |
parent | 583da46b8caf4b2a8b548b03c38fe0e84164abfb (diff) | |
download | gsoc2013-evolution-2c4ae5e7685c462f8d464448e4617b8dea029e72.tar.gz gsoc2013-evolution-2c4ae5e7685c462f8d464448e4617b8dea029e72.tar.zst gsoc2013-evolution-2c4ae5e7685c462f8d464448e4617b8dea029e72.zip |
Coding style and whitespace cleanup.
Diffstat (limited to 'widgets/misc')
34 files changed, 1049 insertions, 781 deletions
diff --git a/widgets/misc/e-alert-bar.c b/widgets/misc/e-alert-bar.c index 7700ef5f2a..2022af99f1 100644 --- a/widgets/misc/e-alert-bar.c +++ b/widgets/misc/e-alert-bar.c @@ -353,10 +353,12 @@ alert_bar_find_duplicate_cb (EAlert *alert, dd->found |= ( e_alert_get_message_type (alert) == e_alert_get_message_type (dd->looking_for) && - g_strcmp0 (e_alert_get_primary_text (alert), - e_alert_get_primary_text (dd->looking_for)) == 0 && - g_strcmp0 (e_alert_get_secondary_text (alert), - e_alert_get_secondary_text (dd->looking_for)) == 0); + g_strcmp0 ( + e_alert_get_primary_text (alert), + e_alert_get_primary_text (dd->looking_for)) == 0 && + g_strcmp0 ( + e_alert_get_secondary_text (alert), + e_alert_get_secondary_text (dd->looking_for)) == 0); } void diff --git a/widgets/misc/e-attachment-bar.c b/widgets/misc/e-attachment-bar.c index 2f57a7f339..3fc4753055 100644 --- a/widgets/misc/e-attachment-bar.c +++ b/widgets/misc/e-attachment-bar.c @@ -126,9 +126,11 @@ attachment_bar_set_store (EAttachmentBar *bar, bar->priv->model = g_object_ref (store); - gtk_icon_view_set_model (GTK_ICON_VIEW (bar->priv->icon_view), + gtk_icon_view_set_model ( + GTK_ICON_VIEW (bar->priv->icon_view), bar->priv->model); - gtk_tree_view_set_model (GTK_TREE_VIEW (bar->priv->tree_view), + gtk_tree_view_set_model ( + GTK_TREE_VIEW (bar->priv->tree_view), bar->priv->model); g_signal_connect_object ( @@ -759,7 +761,7 @@ e_attachment_bar_set_expanded (EAttachmentBar *bar, { g_return_if_fail (E_IS_ATTACHMENT_BAR (bar)); - if ((bar->priv->expanded ? 1 : 0) == (expanded ? 1 : 0)) + if (bar->priv->expanded == expanded) return; bar->priv->expanded = expanded; diff --git a/widgets/misc/e-attachment-button.c b/widgets/misc/e-attachment-button.c index d3fda0985a..a2057e3354 100644 --- a/widgets/misc/e-attachment-button.c +++ b/widgets/misc/e-attachment-button.c @@ -834,7 +834,7 @@ e_attachment_button_set_expandable (EAttachmentButton *button, { g_return_if_fail (E_IS_ATTACHMENT_BUTTON (button)); - if ((button->priv->expandable ? 1 : 0) == (expandable ? 1 : 0)) + if (button->priv->expandable == expandable) return; button->priv->expandable = expandable; @@ -859,7 +859,7 @@ e_attachment_button_set_expanded (EAttachmentButton *button, { g_return_if_fail (E_IS_ATTACHMENT_BUTTON (button)); - if ((button->priv->expanded ? 1 : 0) == (expanded ? 1 : 0)) + if (button->priv->expanded == expanded) return; button->priv->expanded = expanded; diff --git a/widgets/misc/e-attachment-paned.c b/widgets/misc/e-attachment-paned.c index 565d91c4de..a3c4efb187 100644 --- a/widgets/misc/e-attachment-paned.c +++ b/widgets/misc/e-attachment-paned.c @@ -843,7 +843,7 @@ e_attachment_paned_set_expanded (EAttachmentPaned *paned, { g_return_if_fail (E_IS_ATTACHMENT_PANED (paned)); - if ((paned->priv->expanded ? 1 : 0) == (expanded ? 1 : 0)) + if (paned->priv->expanded == expanded) return; paned->priv->expanded = expanded; @@ -865,7 +865,7 @@ e_attachment_paned_set_resize_toplevel (EAttachmentPaned *paned, { g_return_if_fail (E_IS_ATTACHMENT_PANED (paned)); - if ((paned->priv->resize_toplevel ? 1 : 0) == (resize_toplevel ? 1 : 0)) + if (paned->priv->resize_toplevel == resize_toplevel) return; paned->priv->resize_toplevel = resize_toplevel; diff --git a/widgets/misc/e-attachment.c b/widgets/misc/e-attachment.c index 7b245e8b0d..113312ac48 100644 --- a/widgets/misc/e-attachment.c +++ b/widgets/misc/e-attachment.c @@ -1916,7 +1916,8 @@ e_attachment_load_async (EAttachment *attachment, } else if (mime_part != NULL) { g_object_set_data (G_OBJECT (load_context->simple), ATTACHMENT_LOAD_CONTEXT, load_context); - g_simple_async_result_run_in_thread (load_context->simple, + g_simple_async_result_run_in_thread ( + load_context->simple, attachment_load_from_mime_part_thread, G_PRIORITY_DEFAULT, cancellable); diff --git a/widgets/misc/e-buffer-tagger.c b/widgets/misc/e-buffer-tagger.c index c57632ea69..650abb3d9d 100644 --- a/widgets/misc/e-buffer-tagger.c +++ b/widgets/misc/e-buffer-tagger.c @@ -374,9 +374,10 @@ textview_query_tooltip (GtkTextView *text_view, gchar *url; GtkTextIter iter; - gtk_text_view_window_to_buffer_coords (text_view, - GTK_TEXT_WINDOW_WIDGET, - x, y, &x, &y); + gtk_text_view_window_to_buffer_coords ( + text_view, + GTK_TEXT_WINDOW_WIDGET, + x, y, &x, &y); gtk_text_view_get_iter_at_location (text_view, &iter, x, y); url = get_url_at_iter (buffer, &iter); @@ -493,9 +494,10 @@ textview_event_after (GtkTextView *textview, if (gtk_text_iter_get_offset (&start) != gtk_text_iter_get_offset (&end)) return FALSE; - gtk_text_view_window_to_buffer_coords (textview, - GTK_TEXT_WINDOW_WIDGET, - event->x, event->y, &x, &y); + gtk_text_view_window_to_buffer_coords ( + textview, + GTK_TEXT_WINDOW_WIDGET, + event->x, event->y, &x, &y); gtk_text_view_get_iter_at_location (textview, &iter, x, y); @@ -513,7 +515,8 @@ textview_motion_notify_event (GtkTextView *textview, g_return_val_if_fail (GTK_IS_TEXT_VIEW (textview), FALSE); - gtk_text_view_window_to_buffer_coords (textview, + gtk_text_view_window_to_buffer_coords ( + textview, GTK_TEXT_WINDOW_WIDGET, event->x, event->y, &x, &y); @@ -532,7 +535,8 @@ textview_visibility_notify_event (GtkTextView *textview, gdk_window_get_pointer (gtk_text_view_get_window (textview, GTK_TEXT_WINDOW_WIDGET), &wx, &wy, NULL); - gtk_text_view_window_to_buffer_coords (textview, + gtk_text_view_window_to_buffer_coords ( + textview, GTK_TEXT_WINDOW_WIDGET, wx, wy, &bx, &by); @@ -560,7 +564,8 @@ e_buffer_tagger_connect (GtkTextView *textview) /* if tag is there already, then it is connected, thus claim */ g_return_if_fail (tag == NULL); - gtk_text_buffer_create_tag (buffer, E_BUFFER_TAGGER_LINK_TAG, + gtk_text_buffer_create_tag ( + buffer, E_BUFFER_TAGGER_LINK_TAG, "foreground", "blue", "underline", PANGO_UNDERLINE_SINGLE, NULL); diff --git a/widgets/misc/e-calendar-item.c b/widgets/misc/e-calendar-item.c index 34f1696c5b..0f38c7b16a 100644 --- a/widgets/misc/e-calendar-item.c +++ b/widgets/misc/e-calendar-item.c @@ -528,30 +528,32 @@ e_calendar_item_class_init (ECalendarItemClass *class) TRUE, G_PARAM_READWRITE)); - e_calendar_item_signals[DATE_RANGE_CHANGED] = - g_signal_new ("date_range_changed", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (ECalendarItemClass, date_range_changed), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - e_calendar_item_signals[SELECTION_CHANGED] = - g_signal_new ("selection_changed", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (ECalendarItemClass, selection_changed), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - e_calendar_item_signals[SELECTION_PREVIEW_CHANGED] = - g_signal_new ("selection_preview_changed", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ECalendarItemClass, selection_preview_changed), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); + e_calendar_item_signals[DATE_RANGE_CHANGED] = g_signal_new ( + "date_range_changed", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (ECalendarItemClass, date_range_changed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + e_calendar_item_signals[SELECTION_CHANGED] = g_signal_new ( + "selection_changed", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (ECalendarItemClass, selection_changed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + e_calendar_item_signals[SELECTION_PREVIEW_CHANGED] = g_signal_new ( + "selection_preview_changed", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ECalendarItemClass, selection_preview_changed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); e_calendar_item_a11y_init (); } @@ -751,13 +753,13 @@ e_calendar_item_set_property (GObject *object, switch (property_id) { case PROP_YEAR: ivalue = g_value_get_int (value); - e_calendar_item_set_first_month (calitem, ivalue, - calitem->month); + e_calendar_item_set_first_month ( + calitem, ivalue, calitem->month); return; case PROP_MONTH: ivalue = g_value_get_int (value); - e_calendar_item_set_first_month (calitem, calitem->year, - ivalue); + e_calendar_item_set_first_month ( + calitem, calitem->year, ivalue); return; case PROP_X1: dvalue = g_value_get_double (value); @@ -935,8 +937,9 @@ e_calendar_item_update (GnomeCanvasItem *item, /* Set up Pango prerequisites */ font_desc = style->font_desc; pango_context = gtk_widget_get_pango_context (GTK_WIDGET (item->canvas)); - font_metrics = pango_context_get_metrics (pango_context, font_desc, - pango_context_get_language (pango_context)); + font_metrics = pango_context_get_metrics ( + pango_context, font_desc, + pango_context_get_language (pango_context)); /* * Calculate the new layout of the calendar. @@ -1029,8 +1032,9 @@ e_calendar_item_update (GnomeCanvasItem *item, space = MAX (0, space); calitem->x_offset = space / 2; - gnome_canvas_request_redraw (item->canvas, item->x1, item->y1, - item->x2, item->y2); + gnome_canvas_request_redraw ( + item->canvas, item->x1, item->y1, + item->x2, item->y2); pango_font_metrics_unref (font_metrics); } @@ -1056,8 +1060,9 @@ e_calendar_item_draw (GnomeCanvasItem *canvas_item, GdkColor base, bg; #if 0 - g_print ("In e_calendar_item_draw %i,%i %ix%i\n", - x, y, width, height); + g_print ( + "In e_calendar_item_draw %i,%i %ix%i\n", + x, y, width, height); #endif calitem = E_CALENDAR_ITEM (canvas_item); style = gtk_widget_get_style (GTK_WIDGET (canvas_item->canvas)); @@ -1067,8 +1072,9 @@ e_calendar_item_draw (GnomeCanvasItem *canvas_item, if (!font_desc) font_desc = style->font_desc; pango_context = gtk_widget_get_pango_context (GTK_WIDGET (canvas_item->canvas)); - font_metrics = pango_context_get_metrics (pango_context, font_desc, - pango_context_get_language (pango_context)); + font_metrics = pango_context_get_metrics ( + pango_context, font_desc, + pango_context_get_language (pango_context)); char_height = PANGO_PIXELS (pango_font_metrics_get_ascent (font_metrics)) + @@ -1082,18 +1088,20 @@ e_calendar_item_draw (GnomeCanvasItem *canvas_item, /* Clear the entire background. */ cairo_save (cr); gdk_cairo_set_source_color (cr, &base); - cairo_rectangle (cr, calitem->x1 - x, calitem->y1 - y, - calitem->x2 - calitem->x1 + 1, - calitem->y2 - calitem->y1 + 1); + cairo_rectangle ( + cr, calitem->x1 - x, calitem->y1 - y, + calitem->x2 - calitem->x1 + 1, + calitem->y2 - calitem->y1 + 1); cairo_fill (cr); cairo_restore (cr); /* Draw the shadow around the entire item. */ - gtk_paint_shadow (style, cr, GTK_STATE_NORMAL, GTK_SHADOW_IN, - NULL, "entry", - calitem->x1 - x, calitem->y1 - y, - calitem->x2 - calitem->x1 + 1, - calitem->y2 - calitem->y1 + 1); + gtk_paint_shadow ( + style, cr, GTK_STATE_NORMAL, GTK_SHADOW_IN, + NULL, "entry", + calitem->x1 - x, calitem->y1 - y, + calitem->x2 - calitem->x1 + 1, + calitem->y2 - calitem->y1 + 1); row_y = canvas_item->y1 + ythickness; bar_height = ythickness * 2 @@ -1106,36 +1114,40 @@ e_calendar_item_draw (GnomeCanvasItem *canvas_item, cairo_save (cr); gdk_cairo_set_source_color (cr, &bg); - cairo_rectangle (cr, calitem->x1 + xthickness - x, row_y - y, - calitem->x2 - calitem->x1 + 1 - - xthickness * 2, - bar_height); + cairo_rectangle ( + cr, calitem->x1 + xthickness - x, row_y - y, + calitem->x2 - calitem->x1 + 1 + - xthickness * 2, + bar_height); cairo_fill (cr); cairo_restore (cr); - gtk_paint_shadow (style, cr, - GTK_STATE_NORMAL, GTK_SHADOW_OUT, - NULL, "calendar-header", - calitem->x1 + xthickness - x, row_y - y, - calitem->x2 - calitem->x1 + 1 - - xthickness * 2, - bar_height); + gtk_paint_shadow ( + style, cr, + GTK_STATE_NORMAL, GTK_SHADOW_OUT, + NULL, "calendar-header", + calitem->x1 + xthickness - x, row_y - y, + calitem->x2 - calitem->x1 + 1 + - xthickness * 2, + bar_height); for (col = 0; col < calitem->cols; col++) { if (col != 0) { col_x = calitem->x1 + calitem->x_offset + calitem->month_width * col; - gtk_paint_vline (style, cr, - GTK_STATE_NORMAL, NULL, - "calendar-separator", - row_y + ythickness + 1 - y, - row_y + bar_height - - ythickness - 2 - y, - col_x - 1 - x); + gtk_paint_vline ( + style, cr, + GTK_STATE_NORMAL, NULL, + "calendar-separator", + row_y + ythickness + 1 - y, + row_y + bar_height + - ythickness - 2 - y, + col_x - 1 - x); } - e_calendar_item_draw_month (calitem, cr, x, y, - width, height, row, col); + e_calendar_item_draw_month ( + calitem, cr, x, y, + width, height, row, col); } row_y += calitem->month_height; @@ -1184,8 +1196,9 @@ e_calendar_item_draw_month (ECalendarItem *calitem, PangoLayout *layout; #if 0 - g_print ("In e_calendar_item_draw_month: %i,%i %ix%i row:%i col:%i\n", - x, y, width, height, row, col); + g_print ( + "In e_calendar_item_draw_month: %i,%i %ix%i row:%i col:%i\n", + x, y, width, height, row, col); #endif item = GNOME_CANVAS_ITEM (calitem); widget = GTK_WIDGET (item->canvas); @@ -1196,8 +1209,9 @@ e_calendar_item_draw_month (ECalendarItem *calitem, if (!font_desc) font_desc = style->font_desc; pango_context = gtk_widget_get_pango_context (widget); - font_metrics = pango_context_get_metrics (pango_context, font_desc, - pango_context_get_language (pango_context)); + font_metrics = pango_context_get_metrics ( + pango_context, font_desc, + pango_context_get_language (pango_context)); char_height = PANGO_PIXELS (pango_font_metrics_get_ascent (font_metrics)) + @@ -1215,8 +1229,8 @@ 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; + + ((gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) + ? (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; @@ -1379,9 +1393,10 @@ e_calendar_item_draw_month (ECalendarItem *calitem, cairo_save (cr); gdk_cairo_set_source_color (cr, &style->base[GTK_STATE_SELECTED]); - cairo_rectangle (cr, cells_x , - text_y - E_CALENDAR_ITEM_YPAD_ABOVE_CELLS - 1, - calitem->cell_width * 7 , cells_y - text_y ); + cairo_rectangle ( + cr, cells_x , + text_y - E_CALENDAR_ITEM_YPAD_ABOVE_CELLS - 1, + calitem->cell_width * 7 , cells_y - text_y); cairo_fill (cr); cairo_restore (cr); @@ -1393,9 +1408,10 @@ e_calendar_item_draw_month (ECalendarItem *calitem, for (day = 0; day < 7; day++) { cairo_save (cr); layout_set_day_text (calitem, layout, day_index); - cairo_move_to (cr, - text_x - calitem->day_widths[day_index], - text_y); + cairo_move_to ( + cr, + text_x - calitem->day_widths[day_index], + text_y); pango_cairo_show_layout (cr, layout); text_x += (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) ? -calitem->cell_width : calitem->cell_width; @@ -1409,7 +1425,8 @@ e_calendar_item_draw_month (ECalendarItem *calitem, if (calitem->show_week_numbers) { cairo_save (cr); gdk_cairo_set_source_color (cr, &style->base[GTK_STATE_SELECTED]); - cairo_rectangle (cr, cells_x, cells_y - (cells_y - text_y + 2) , + cairo_rectangle ( + cr, cells_x, cells_y - (cells_y - text_y + 2) , -20, E_CALENDAR_ROWS_PER_MONTH * calitem->cell_height + 18); cairo_fill (cr); cairo_restore (cr); @@ -1496,8 +1513,9 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem, font_desc = style->font_desc; pango_context = gtk_widget_get_pango_context (widget); - font_metrics = pango_context_get_metrics (pango_context, font_desc, - pango_context_get_language (pango_context)); + font_metrics = pango_context_get_metrics ( + pango_context, font_desc, + pango_context_get_language (pango_context)); char_height = PANGO_PIXELS (pango_font_metrics_get_ascent (font_metrics)) + @@ -1607,8 +1625,8 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem, for (dcol = 0; dcol < 7; dcol++) { if (draw_day) { day_x = cells_x + - ( (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) - ? 7 - 1 - dcol : dcol ) * calitem->cell_width; + ((gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) + ? 7 - 1 - dcol : dcol) * calitem->cell_width; day_y = cells_y + drow * calitem->cell_height; @@ -1658,20 +1676,20 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem, else e_calendar_item_get_day_style ( calitem, - years[mon], - months[mon], - day_num, - day_style, - today, - mon != 1, - selected, - has_focus, - drop_target, - &bg_color, - &fg_color, - &box_color, - &bold, - &italic); + years[mon], + months[mon], + day_num, + day_style, + today, + mon != 1, + selected, + has_focus, + drop_target, + &bg_color, + &fg_color, + &box_color, + &bold, + &italic); /* Draw the background, if set. */ if (bg_color) { @@ -1860,11 +1878,13 @@ e_calendar_item_stop_selecting (ECalendarItem *calitem, * 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); + e_calendar_item_set_first_month ( + calitem, calitem->year, + calitem->month - 1); else if (calitem->selection_start_month_offset == calitem->rows * calitem->cols) - e_calendar_item_set_first_month (calitem, calitem->year, - calitem->month + 1); + e_calendar_item_set_first_month ( + calitem, calitem->year, + calitem->month + 1); calitem->selection_changed = TRUE; if (calitem->selecting_axis) { @@ -1931,11 +1951,10 @@ e_calendar_item_selection_add_days (ECalendarItem *calitem, calitem->selecting = TRUE; - e_calendar_item_set_selection_if_emission (calitem, - &gdate_start, &gdate_end, - FALSE); - g_signal_emit_by_name (G_OBJECT (calitem), - "selection_preview_changed"); + e_calendar_item_set_selection_if_emission ( + calitem, &gdate_start, &gdate_end, FALSE); + + g_signal_emit_by_name (calitem, "selection_preview_changed"); } static gint @@ -1952,20 +1971,24 @@ e_calendar_item_key_press_event (ECalendarItem *calitem, multi_selection = event->key.state & GDK_SHIFT_MASK; switch (keyval) { case GDK_KEY_Up: - e_calendar_item_selection_add_days (calitem, -7, - multi_selection); + e_calendar_item_selection_add_days ( + calitem, -7, + multi_selection); break; case GDK_KEY_Down: - e_calendar_item_selection_add_days (calitem, 7, - multi_selection); + e_calendar_item_selection_add_days ( + calitem, 7, + multi_selection); break; case GDK_KEY_Left: - e_calendar_item_selection_add_days (calitem, -1, - multi_selection); + e_calendar_item_selection_add_days ( + calitem, -1, + multi_selection); break; case GDK_KEY_Right: - e_calendar_item_selection_add_days (calitem, 1, - multi_selection); + e_calendar_item_selection_add_days ( + calitem, 1, + multi_selection); break; case GDK_KEY_space: case GDK_KEY_Return: @@ -2211,11 +2234,13 @@ e_calendar_item_button_press (ECalendarItem *calitem, gboolean all_week, round_up_end = FALSE, round_down_start = FALSE; if (event->button.button == 4) - e_calendar_item_set_first_month (calitem, calitem->year, - calitem->month - 1); + e_calendar_item_set_first_month ( + calitem, calitem->year, + calitem->month - 1); else if (event->button.button == 5) - e_calendar_item_set_first_month (calitem, calitem->year, - calitem->month + 1); + e_calendar_item_set_first_month ( + calitem, calitem->year, + calitem->month + 1); if (!e_calendar_item_convert_position_to_day (calitem, event->button.x, @@ -2227,9 +2252,10 @@ 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, - month_offset); + e_calendar_item_show_popup_menu ( + calitem, + (GdkEventButton *) event, + month_offset); return TRUE; } @@ -2398,25 +2424,29 @@ e_calendar_item_motion (ECalendarItem *calitem, } if (round_up_end) - e_calendar_item_round_up_selection (calitem, &end_month, - &end_day); + e_calendar_item_round_up_selection ( + calitem, &end_month, + &end_day); if (round_down_start) - e_calendar_item_round_down_selection (calitem, &start_month, - &start_day); + e_calendar_item_round_down_selection ( + calitem, &start_month, + &start_day); /* Check we don't go over the maximum number of days to select. */ if (calitem->selection_dragging_end) { - e_calendar_item_check_selection_end (calitem, - start_month, - start_day, - &end_month, - &end_day); + e_calendar_item_check_selection_end ( + calitem, + start_month, + start_day, + &end_month, + &end_day); } else { - e_calendar_item_check_selection_start (calitem, - &start_month, - &start_day, - end_month, - end_day); + e_calendar_item_check_selection_start ( + calitem, + &start_month, + &start_day, + end_month, + end_day); } if (start_month == calitem->selection_start_month_offset @@ -2547,8 +2577,9 @@ e_calendar_item_convert_position_to_day (ECalendarItem *calitem, if (!font_desc) font_desc = style->font_desc; pango_context = gtk_widget_create_pango_context (widget); - font_metrics = pango_context_get_metrics (pango_context, font_desc, - pango_context_get_language (pango_context)); + font_metrics = pango_context_get_metrics ( + pango_context, font_desc, + pango_context_get_language (pango_context)); char_height = PANGO_PIXELS (pango_font_metrics_get_ascent (font_metrics)) + @@ -2625,8 +2656,9 @@ e_calendar_item_convert_position_to_day (ECalendarItem *calitem, *day = day_row * E_CALENDAR_COLS_PER_MONTH + day_col; - e_calendar_item_get_month_info (calitem, row, col, &first_day_offset, - &days_in_month, &days_in_prev_month); + e_calendar_item_get_month_info ( + calitem, row, col, &first_day_offset, + &days_in_month, &days_in_prev_month); if (*day < first_day_offset) { if (*entire_week || (row == 0 && col == 0)) { (*month_offset)--; @@ -2957,8 +2989,9 @@ e_calendar_item_get_date_range (ECalendarItem *calitem, /* Calculate the first day shown. This will be one of the greyed-out * 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); + e_calendar_item_get_month_info ( + calitem, 0, 0, &first_day_offset, + &days_in_month, &days_in_prev_month); *start_year = calitem->year; *start_month = calitem->month - 1; if (*start_month == -1) { @@ -2969,9 +3002,10 @@ e_calendar_item_get_date_range (ECalendarItem *calitem, /* Calculate the last day shown. This will be one of the greyed-out * 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); + e_calendar_item_get_month_info ( + calitem, calitem->rows - 1, + calitem->cols - 1, &first_day_offset, + &days_in_month, &days_in_prev_month); *end_month = calitem->month + calitem->rows * calitem->cols; *end_year = calitem->year + *end_month / 12; *end_month %= 12; @@ -2993,8 +3027,9 @@ e_calendar_item_clear_marks (ECalendarItem *calitem) g_free (calitem->styles); calitem->styles = NULL; - gnome_canvas_request_redraw (item->canvas, item->x1, item->y1, - item->x2, item->y2); + gnome_canvas_request_redraw ( + item->canvas, item->x1, item->y1, + item->x2, item->y2); } /* add_day_style - whether bit-or with the actual style or change the style fully */ @@ -3277,14 +3312,15 @@ e_calendar_item_set_selection_if_emission (ECalendarItem *calitem, end_month = g_date_get_month (end_date) - 1; end_day = g_date_get_day (end_date); - need_update = e_calendar_item_ensure_days_visible (calitem, - start_year, - start_month, - start_day, - end_year, - end_month, - end_day, - emission); + need_update = e_calendar_item_ensure_days_visible ( + calitem, + start_year, + start_month, + start_day, + end_year, + end_month, + end_day, + emission); new_start_month_offset = (start_year - calitem->year) * 12 + start_month - calitem->month; @@ -3358,8 +3394,9 @@ e_calendar_item_set_selection (ECalendarItem *calitem, { /* If the user is in the middle of a selection, we must abort it. */ if (calitem->selecting) { - gnome_canvas_item_ungrab (GNOME_CANVAS_ITEM (calitem), - GDK_CURRENT_TIME); + gnome_canvas_item_ungrab ( + GNOME_CANVAS_ITEM (calitem), + GDK_CURRENT_TIME); calitem->selecting = FALSE; } @@ -3392,8 +3429,9 @@ e_calendar_item_ensure_days_visible (ECalendarItem *calitem, /* Calculate the range of months currently displayed. */ current_end_year = calitem->year; current_end_month = calitem->month + months_shown - 1; - e_calendar_item_normalize_date (calitem, ¤t_end_year, - ¤t_end_month); + e_calendar_item_normalize_date ( + calitem, ¤t_end_year, + ¤t_end_month); /* Try to ensure that the end month is shown. */ if ((end_year == current_end_year + 1 && @@ -3402,13 +3440,15 @@ e_calendar_item_ensure_days_visible (ECalendarItem *calitem, /* See if the end of the selection will fit in the * 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); + e_calendar_item_normalize_date ( + calitem, &calitem->year, + &calitem->month); - e_calendar_item_get_month_info (calitem, 0, 0, - &first_day_offset, - &days_in_month, - &days_in_prev_month); + e_calendar_item_get_month_info ( + calitem, 0, 0, + &first_day_offset, + &days_in_month, + &days_in_prev_month); if (end_day >= E_CALENDAR_ROWS_PER_MONTH * E_CALENDAR_COLS_PER_MONTH - first_day_offset - days_in_month) { @@ -3420,8 +3460,9 @@ e_calendar_item_ensure_days_visible (ECalendarItem *calitem, calitem->month -= (months_shown - 1); } - e_calendar_item_normalize_date (calitem, &calitem->year, - &calitem->month); + e_calendar_item_normalize_date ( + calitem, &calitem->year, + &calitem->month); } else if (end_year > current_end_year || (end_year == current_end_year && end_month > current_end_month)) { @@ -3432,8 +3473,9 @@ e_calendar_item_ensure_days_visible (ECalendarItem *calitem, calitem->year = end_year; calitem->month = end_month - months_shown + 1; - e_calendar_item_normalize_date (calitem, &calitem->year, - &calitem->month); + e_calendar_item_normalize_date ( + calitem, &calitem->year, + &calitem->month); } /* Now try to ensure that the start month is shown. We do this after @@ -3447,13 +3489,15 @@ e_calendar_item_ensure_days_visible (ECalendarItem *calitem, * 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, - &calitem->month); + e_calendar_item_normalize_date ( + calitem, &calitem->year, + &calitem->month); - e_calendar_item_get_month_info (calitem, 0, 0, - &first_day_offset, - &days_in_month, - &days_in_prev_month); + e_calendar_item_get_month_info ( + calitem, 0, 0, + &first_day_offset, + &days_in_month, + &days_in_prev_month); if (start_day <= days_in_prev_month - first_day_offset) { calitem->year = start_year; @@ -3504,10 +3548,12 @@ e_calendar_item_show_popup_menu (ECalendarItem *calitem, submenu = gtk_menu_new (); gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), submenu); - g_object_set_data (G_OBJECT (submenu), "year", - GINT_TO_POINTER (year)); - g_object_set_data (G_OBJECT (submenu), "month_offset", - GINT_TO_POINTER (month_offset)); + g_object_set_data ( + G_OBJECT (submenu), "year", + GINT_TO_POINTER (year)); + g_object_set_data ( + G_OBJECT (submenu), "month_offset", + GINT_TO_POINTER (month_offset)); for (month = 0; month < 12; month++) { name = e_get_month_name (month + 1, FALSE); diff --git a/widgets/misc/e-calendar.c b/widgets/misc/e-calendar.c index fcad4edb4b..38336cb618 100644 --- a/widgets/misc/e-calendar.c +++ b/widgets/misc/e-calendar.c @@ -154,10 +154,12 @@ e_calendar_init (ECalendar *cal) canvas_group = GNOME_CANVAS_GROUP (GNOME_CANVAS (cal)->root); - cal->calitem = E_CALENDAR_ITEM (gnome_canvas_item_new (canvas_group, - e_calendar_item_get_type (), - "week_number_font_desc", small_font_desc, - NULL)); + cal->calitem = E_CALENDAR_ITEM ( + gnome_canvas_item_new ( + canvas_group, + e_calendar_item_get_type (), + "week_number_font_desc", small_font_desc, + NULL)); pango_font_description_free (small_font_desc); @@ -179,10 +181,11 @@ e_calendar_init (ECalendar *cal) gtk_widget_show (pixmap); gtk_container_add (GTK_CONTAINER (button), pixmap); - cal->prev_item = gnome_canvas_item_new (canvas_group, - gnome_canvas_widget_get_type (), - "widget", button, - NULL); + cal->prev_item = gnome_canvas_item_new ( + canvas_group, + gnome_canvas_widget_get_type (), + "widget", button, + NULL); a11y = gtk_widget_get_accessible (button); atk_object_set_name (a11y, _("Previous month")); @@ -203,10 +206,11 @@ e_calendar_init (ECalendar *cal) gtk_widget_show (pixmap); gtk_container_add (GTK_CONTAINER (button), pixmap); - cal->next_item = gnome_canvas_item_new (canvas_group, - gnome_canvas_widget_get_type (), - "widget", button, - NULL); + cal->next_item = gnome_canvas_item_new ( + canvas_group, + gnome_canvas_widget_get_type (), + "widget", button, + NULL); a11y = gtk_widget_get_accessible (button); atk_object_set_name (a11y, _("Next month")); @@ -214,42 +218,50 @@ e_calendar_init (ECalendar *cal) button = gtk_button_new (); gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE); gtk_widget_show (button); - g_signal_connect_swapped (button, "pressed", - G_CALLBACK (e_calendar_on_prev_year_pressed), cal); - g_signal_connect_swapped (button, "released", - G_CALLBACK (e_calendar_on_prev_year_released), cal); - g_signal_connect_swapped (button, "clicked", - G_CALLBACK (e_calendar_on_prev_year_clicked), cal); + g_signal_connect_swapped ( + button, "pressed", + G_CALLBACK (e_calendar_on_prev_year_pressed), cal); + g_signal_connect_swapped ( + button, "released", + G_CALLBACK (e_calendar_on_prev_year_released), cal); + g_signal_connect_swapped ( + button, "clicked", + G_CALLBACK (e_calendar_on_prev_year_clicked), cal); pixmap = gtk_arrow_new (GTK_ARROW_LEFT, GTK_SHADOW_NONE); gtk_widget_show (pixmap); gtk_container_add (GTK_CONTAINER (button), pixmap); - cal->prev_item_year = gnome_canvas_item_new (canvas_group, - gnome_canvas_widget_get_type (), - "widget", button, - NULL); + cal->prev_item_year = gnome_canvas_item_new ( + canvas_group, + gnome_canvas_widget_get_type (), + "widget", button, + NULL); a11y = gtk_widget_get_accessible (button); atk_object_set_name (a11y, _("Previous year")); button = gtk_button_new (); gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE); gtk_widget_show (button); - g_signal_connect_swapped (button, "pressed", - G_CALLBACK (e_calendar_on_next_year_pressed), cal); - g_signal_connect_swapped (button, "released", - G_CALLBACK (e_calendar_on_next_year_released), cal); - g_signal_connect_swapped (button, "clicked", - G_CALLBACK (e_calendar_on_next_year_clicked), cal); + g_signal_connect_swapped ( + button, "pressed", + G_CALLBACK (e_calendar_on_next_year_pressed), cal); + g_signal_connect_swapped ( + button, "released", + G_CALLBACK (e_calendar_on_next_year_released), cal); + g_signal_connect_swapped ( + button, "clicked", + G_CALLBACK (e_calendar_on_next_year_clicked), cal); pixmap = gtk_arrow_new (GTK_ARROW_RIGHT, GTK_SHADOW_NONE); gtk_widget_show (pixmap); gtk_container_add (GTK_CONTAINER (button), pixmap); - cal->next_item_year = gnome_canvas_item_new (canvas_group, - gnome_canvas_widget_get_type (), - "widget", button, - NULL); + cal->next_item_year = gnome_canvas_item_new ( + canvas_group, + gnome_canvas_widget_get_type (), + "widget", button, + NULL); a11y = gtk_widget_get_accessible (button); atk_object_set_name (a11y, _("Next year")); @@ -396,26 +408,30 @@ e_calendar_size_allocate (GtkWidget *widget, /* Set up Pango prerequisites */ font_desc = gtk_widget_get_style (widget)->font_desc; pango_context = gtk_widget_get_pango_context (widget); - font_metrics = pango_context_get_metrics (pango_context, font_desc, - pango_context_get_language (pango_context)); + font_metrics = pango_context_get_metrics ( + pango_context, font_desc, + pango_context_get_language (pango_context)); /* Set the scroll region to its allocated size, if changed. */ - gnome_canvas_get_scroll_region (GNOME_CANVAS (cal), - NULL, NULL, &old_x2, &old_y2); + gnome_canvas_get_scroll_region ( + GNOME_CANVAS (cal), + NULL, NULL, &old_x2, &old_y2); gtk_widget_get_allocation (widget, &old_allocation); new_x2 = old_allocation.width - 1; new_y2 = old_allocation.height - 1; if (old_x2 != new_x2 || old_y2 != new_y2) - gnome_canvas_set_scroll_region (GNOME_CANVAS (cal), - 0, 0, new_x2, new_y2); + gnome_canvas_set_scroll_region ( + GNOME_CANVAS (cal), + 0, 0, new_x2, new_y2); /* Take off space for line & buttons if shown. */ - gnome_canvas_item_set (GNOME_CANVAS_ITEM (cal->calitem), - "x1", 0.0, - "y1", 0.0, - "x2", new_x2, - "y2", new_y2, - NULL); + gnome_canvas_item_set ( + GNOME_CANVAS_ITEM (cal->calitem), + "x1", 0.0, + "y1", 0.0, + "x2", new_x2, + "y2", new_y2, + NULL); if (cal->calitem->month_width > 0) month_width = cal->calitem->month_width; @@ -436,41 +452,45 @@ e_calendar_size_allocate (GtkWidget *widget, (month_width - 2 * xthickness - E_CALENDAR_ARROW_BUTTON_X_PAD - arrow_button_size) : (xthickness); - gnome_canvas_item_set (cal->prev_item, - "x", current_x, - "y", ythickness + E_CALENDAR_ARROW_BUTTON_Y_PAD, - "width", arrow_button_size, - "height", arrow_button_size, - NULL); + gnome_canvas_item_set ( + cal->prev_item, + "x", current_x, + "y", ythickness + E_CALENDAR_ARROW_BUTTON_Y_PAD, + "width", arrow_button_size, + "height", arrow_button_size, + NULL); current_x += (is_rtl ? -1.0 : +1.0) * (cal->calitem->max_month_name_width - xthickness + 2 * arrow_button_size); - gnome_canvas_item_set (cal->next_item, - "x", current_x, - "y", ythickness + E_CALENDAR_ARROW_BUTTON_Y_PAD, - "width", arrow_button_size, - "height", arrow_button_size, - NULL); + gnome_canvas_item_set ( + cal->next_item, + "x", current_x, + "y", ythickness + E_CALENDAR_ARROW_BUTTON_Y_PAD, + "width", arrow_button_size, + "height", arrow_button_size, + NULL); current_x = is_rtl ? (xthickness) : (month_width - 2 * xthickness - E_CALENDAR_ARROW_BUTTON_X_PAD - arrow_button_size); - gnome_canvas_item_set (cal->next_item_year, - "x", current_x, - "y", ythickness + E_CALENDAR_ARROW_BUTTON_Y_PAD, - "width", arrow_button_size, - "height", arrow_button_size, - NULL); + gnome_canvas_item_set ( + cal->next_item_year, + "x", current_x, + "y", ythickness + E_CALENDAR_ARROW_BUTTON_Y_PAD, + "width", arrow_button_size, + "height", arrow_button_size, + NULL); current_x += (is_rtl ? +1.0 : -1.0) * (cal->calitem->max_digit_width * 5 - xthickness + 2 * arrow_button_size); - gnome_canvas_item_set (cal->prev_item_year, - "x", current_x, - "y", ythickness + E_CALENDAR_ARROW_BUTTON_Y_PAD, - "width", arrow_button_size, - "height", arrow_button_size, - NULL); + gnome_canvas_item_set ( + cal->prev_item_year, + "x", current_x, + "y", ythickness + E_CALENDAR_ARROW_BUTTON_Y_PAD, + "width", arrow_button_size, + "height", arrow_button_size, + NULL); pango_font_metrics_unref (font_metrics); } @@ -485,10 +505,11 @@ e_calendar_set_minimum_size (ECalendar *cal, cal->min_rows = rows; cal->min_cols = cols; - gnome_canvas_item_set (GNOME_CANVAS_ITEM (cal->calitem), - "minimum_rows", rows, - "minimum_columns", cols, - NULL); + gnome_canvas_item_set ( + GNOME_CANVAS_ITEM (cal->calitem), + "minimum_rows", rows, + "minimum_columns", cols, + NULL); gtk_widget_queue_resize (GTK_WIDGET (cal)); } @@ -503,10 +524,11 @@ e_calendar_set_maximum_size (ECalendar *cal, cal->max_rows = rows; cal->max_cols = cols; - gnome_canvas_item_set (GNOME_CANVAS_ITEM (cal->calitem), - "maximum_rows", rows, - "maximum_columns", cols, - NULL); + gnome_canvas_item_set ( + GNOME_CANVAS_ITEM (cal->calitem), + "maximum_rows", rows, + "maximum_columns", cols, + NULL); gtk_widget_queue_resize (GTK_WIDGET (cal)); } @@ -564,9 +586,10 @@ 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, - e_calendar_auto_move_handler, - cal); + cal->timeout_id = g_timeout_add ( + E_CALENDAR_AUTO_MOVE_TIMEOUT, + e_calendar_auto_move_handler, + cal); } cal->timeout_delay = E_CALENDAR_AUTO_MOVE_TIMEOUT_DELAY; cal->moving_forward = moving_forward; @@ -578,9 +601,10 @@ e_calendar_start_auto_move_year (ECalendar *cal, gboolean moving_forward) { if (cal->timeout_id == 0) { - cal->timeout_id = g_timeout_add (E_CALENDAR_AUTO_MOVE_TIMEOUT, - e_calendar_auto_move_year_handler, - cal); + cal->timeout_id = g_timeout_add ( + E_CALENDAR_AUTO_MOVE_TIMEOUT, + e_calendar_auto_move_year_handler, + cal); } cal->timeout_delay = E_CALENDAR_AUTO_MOVE_TIMEOUT_DELAY; cal->moving_forward = moving_forward; @@ -602,8 +626,9 @@ e_calendar_auto_move_year_handler (gpointer data) cal->timeout_delay--; } else { offset = cal->moving_forward ? 12 : -12; - e_calendar_item_set_first_month (calitem, calitem->year, - calitem->month + offset); + e_calendar_item_set_first_month ( + calitem, calitem->year, + calitem->month + offset); } return TRUE; @@ -625,8 +650,9 @@ e_calendar_auto_move_handler (gpointer data) cal->timeout_delay--; } else { offset = cal->moving_forward ? 1 : -1; - e_calendar_item_set_first_month (calitem, calitem->year, - calitem->month + offset); + e_calendar_item_set_first_month ( + calitem, calitem->year, + calitem->month + offset); } return TRUE; @@ -668,29 +694,33 @@ e_calendar_stop_auto_move (ECalendar *cal) static void e_calendar_on_prev_clicked (ECalendar *cal) { - e_calendar_item_set_first_month (cal->calitem, cal->calitem->year, - cal->calitem->month - 1); + 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_item_set_first_month (cal->calitem, cal->calitem->year, - cal->calitem->month + 1); + e_calendar_item_set_first_month ( + cal->calitem, cal->calitem->year, + cal->calitem->month + 1); } static void e_calendar_on_prev_year_clicked (ECalendar *cal) { - e_calendar_item_set_first_month (cal->calitem, cal->calitem->year, - cal->calitem->month - 12); + e_calendar_item_set_first_month ( + cal->calitem, cal->calitem->year, + cal->calitem->month - 12); } static void e_calendar_on_next_year_clicked (ECalendar *cal) { - e_calendar_item_set_first_month (cal->calitem, cal->calitem->year, - cal->calitem->month + 12); + e_calendar_item_set_first_month ( + cal->calitem, cal->calitem->year, + cal->calitem->month + 12); } static gint diff --git a/widgets/misc/e-canvas-background.c b/widgets/misc/e-canvas-background.c index a12a36471d..0b1f05a6b8 100644 --- a/widgets/misc/e-canvas-background.c +++ b/widgets/misc/e-canvas-background.c @@ -188,11 +188,12 @@ ecb_draw (GnomeCanvasItem *item, ECanvasBackground *ecb = E_CANVAS_BACKGROUND (item); cairo_save (cr); - cairo_set_source_rgba (cr, - ((ecb->priv->rgba >> 24) & 0xff) / 255.0, - ((ecb->priv->rgba >> 16) & 0xff) / 255.0, - ((ecb->priv->rgba >> 8) & 0xff) / 255.0, - ( ecb->priv->rgba & 0xff) / 255.0); + cairo_set_source_rgba ( + cr, + ((ecb->priv->rgba >> 24) & 0xff) / 255.0, + ((ecb->priv->rgba >> 16) & 0xff) / 255.0, + ((ecb->priv->rgba >> 8) & 0xff) / 255.0, + ( ecb->priv->rgba & 0xff) / 255.0); cairo_paint (cr); cairo_restore (cr); } @@ -235,34 +236,44 @@ ecb_class_init (ECanvasBackgroundClass *ecb_class) ecb_class->style_set = ecb_style_set; - g_object_class_install_property (object_class, PROP_FILL_COLOR, - g_param_spec_string ("fill_color", - "Fill color", - "Fill color", - NULL, - G_PARAM_WRITABLE)); - - g_object_class_install_property (object_class, PROP_FILL_COLOR_GDK, - g_param_spec_boxed ("fill_color_gdk", - "GDK fill color", - "GDK fill color", - GDK_TYPE_COLOR, - G_PARAM_WRITABLE)); - - g_object_class_install_property (object_class, PROP_FILL_COLOR_RGBA, - g_param_spec_uint ("fill_color_rgba", - "GDK fill color", - "GDK fill color", - 0, G_MAXUINT, 0, - G_PARAM_READWRITE)); - - ecb_signals[STYLE_SET] = - g_signal_new ("style_set", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ECanvasBackgroundClass, style_set), - NULL, NULL, - g_cclosure_marshal_VOID__OBJECT, - G_TYPE_NONE, 1, GTK_TYPE_STYLE); + g_object_class_install_property ( + object_class, + PROP_FILL_COLOR, + g_param_spec_string ( + "fill_color", + "Fill color", + "Fill color", + NULL, + G_PARAM_WRITABLE)); + + g_object_class_install_property ( + object_class, + PROP_FILL_COLOR_GDK, + g_param_spec_boxed ( + "fill_color_gdk", + "GDK fill color", + "GDK fill color", + GDK_TYPE_COLOR, + G_PARAM_WRITABLE)); + + g_object_class_install_property ( + object_class, + PROP_FILL_COLOR_RGBA, + g_param_spec_uint ( + "fill_color_rgba", + "GDK fill color", + "GDK fill color", + 0, G_MAXUINT, 0, + G_PARAM_READWRITE)); + + ecb_signals[STYLE_SET] = g_signal_new ( + "style_set", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ECanvasBackgroundClass, style_set), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + GTK_TYPE_STYLE); } diff --git a/widgets/misc/e-canvas-vbox.c b/widgets/misc/e-canvas-vbox.c index 888563c0d8..1767c1ac14 100644 --- a/widgets/misc/e-canvas-vbox.c +++ b/widgets/misc/e-canvas-vbox.c @@ -82,30 +82,42 @@ e_canvas_vbox_class_init (ECanvasVboxClass *class) item_class->event = e_canvas_vbox_event; item_class->realize = e_canvas_vbox_realize; - g_object_class_install_property (object_class, PROP_WIDTH, - g_param_spec_double ("width", - "Width", - "Width", - 0.0, G_MAXDOUBLE, 0.0, - G_PARAM_READWRITE)); - g_object_class_install_property (object_class, PROP_MINIMUM_WIDTH, - g_param_spec_double ("minimum_width", - "Minimum width", - "Minimum Width", - 0.0, G_MAXDOUBLE, 0.0, - G_PARAM_READWRITE)); - g_object_class_install_property (object_class, PROP_HEIGHT, - g_param_spec_double ("height", - "Height", - "Height", - 0.0, G_MAXDOUBLE, 0.0, - G_PARAM_READABLE)); - g_object_class_install_property (object_class, PROP_SPACING, - g_param_spec_double ("spacing", - "Spacing", - "Spacing", - 0.0, G_MAXDOUBLE, 0.0, - G_PARAM_READWRITE)); + g_object_class_install_property ( + object_class, + PROP_WIDTH, + g_param_spec_double ( + "width", + "Width", + "Width", + 0.0, G_MAXDOUBLE, 0.0, + G_PARAM_READWRITE)); + g_object_class_install_property ( + object_class, + PROP_MINIMUM_WIDTH, + g_param_spec_double ( + "minimum_width", + "Minimum width", + "Minimum Width", + 0.0, G_MAXDOUBLE, 0.0, + G_PARAM_READWRITE)); + g_object_class_install_property ( + object_class, + PROP_HEIGHT, + g_param_spec_double ( + "height", + "Height", + "Height", + 0.0, G_MAXDOUBLE, 0.0, + G_PARAM_READABLE)); + g_object_class_install_property ( + object_class, + PROP_SPACING, + g_param_spec_double ( + "spacing", + "Spacing", + "Spacing", + 0.0, G_MAXDOUBLE, 0.0, + G_PARAM_READWRITE)); } static void @@ -187,10 +199,11 @@ disconnect_item_cb (gpointer data, vbox = E_CANVAS_VBOX (user_data); item = GNOME_CANVAS_ITEM (data); - g_signal_handlers_disconnect_matched (item, - G_SIGNAL_MATCH_DATA, - 0, 0, NULL, NULL, - vbox); + g_signal_handlers_disconnect_matched ( + item, + G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, + vbox); } static void @@ -268,12 +281,14 @@ 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), - e_canvas_vbox_remove_item, e_canvas_vbox); + g_object_weak_ref ( + G_OBJECT (item), + e_canvas_vbox_remove_item, e_canvas_vbox); if (GNOME_CANVAS_ITEM (e_canvas_vbox)->flags & GNOME_CANVAS_ITEM_REALIZED) { - gnome_canvas_item_set (item, - "width", (gdouble) e_canvas_vbox->minimum_width, - NULL); + gnome_canvas_item_set ( + item, + "width", (gdouble) e_canvas_vbox->minimum_width, + NULL); e_canvas_item_request_reflow (item); } } @@ -283,12 +298,14 @@ 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), - e_canvas_vbox_remove_item, e_canvas_vbox); + g_object_weak_ref ( + G_OBJECT (item), + e_canvas_vbox_remove_item, e_canvas_vbox); if (GNOME_CANVAS_ITEM (e_canvas_vbox)->flags & GNOME_CANVAS_ITEM_REALIZED) { - gnome_canvas_item_set (item, - "width", (gdouble) e_canvas_vbox->minimum_width, - NULL); + gnome_canvas_item_set ( + item, + "width", (gdouble) e_canvas_vbox->minimum_width, + NULL); e_canvas_item_request_reflow (item); } } @@ -302,9 +319,10 @@ e_canvas_vbox_resize_children (GnomeCanvasItem *item) e_canvas_vbox = E_CANVAS_VBOX (item); for (list = e_canvas_vbox->items; list; list = list->next) { GnomeCanvasItem *child = GNOME_CANVAS_ITEM (list->data); - gnome_canvas_item_set (child, - "width", (gdouble) e_canvas_vbox->minimum_width, - NULL); + gnome_canvas_item_set ( + child, + "width", (gdouble) e_canvas_vbox->minimum_width, + NULL); } } @@ -333,13 +351,15 @@ e_canvas_vbox_reflow (GnomeCanvasItem *item, gdouble item_width; list = e_canvas_vbox->items; - g_object_get (list->data, - "height", &item_height, - "width", &item_width, - NULL); - e_canvas_item_move_absolute (GNOME_CANVAS_ITEM (list->data), - (gdouble) 0, - (gdouble) running_height); + g_object_get ( + list->data, + "height", &item_height, + "width", &item_width, + NULL); + e_canvas_item_move_absolute ( + GNOME_CANVAS_ITEM (list->data), + (gdouble) 0, + (gdouble) running_height); running_height += item_height; if (max_width < item_width) max_width = item_width; @@ -348,14 +368,16 @@ e_canvas_vbox_reflow (GnomeCanvasItem *item, for (; list; list = g_list_next (list)) { running_height += e_canvas_vbox->spacing; - g_object_get (list->data, - "height", &item_height, - "width", &item_width, - NULL); + g_object_get ( + list->data, + "height", &item_height, + "width", &item_width, + NULL); - e_canvas_item_move_absolute (GNOME_CANVAS_ITEM (list->data), - (gdouble) 0, - (gdouble) running_height); + e_canvas_item_move_absolute ( + GNOME_CANVAS_ITEM (list->data), + (gdouble) 0, + (gdouble) running_height); running_height += item_height; if (max_width < item_width) diff --git a/widgets/misc/e-canvas.c b/widgets/misc/e-canvas.c index 8cd1338db6..e2e9ddd0cc 100644 --- a/widgets/misc/e-canvas.c +++ b/widgets/misc/e-canvas.c @@ -356,7 +356,7 @@ canvas_style_set_recursive (GnomeCanvasItem *item, } } - if (GNOME_IS_CANVAS_GROUP (item) ) { + if (GNOME_IS_CANVAS_GROUP (item)) { GList *items = GNOME_CANVAS_GROUP (item)->item_list; for (; items; items = items->next) canvas_style_set_recursive ( @@ -379,8 +379,9 @@ canvas_dispose (GObject *object) if (canvas->toplevel) { if (canvas->visibility_notify_id) - g_signal_handler_disconnect (canvas->toplevel, - canvas->visibility_notify_id); + g_signal_handler_disconnect ( + canvas->toplevel, + canvas->visibility_notify_id); canvas->visibility_notify_id = 0; g_object_unref (canvas->toplevel); @@ -454,11 +455,12 @@ canvas_button_event (GtkWidget *widget, canvas = GNOME_CANVAS (widget); bin_window = gtk_layout_get_bin_window (GTK_LAYOUT (canvas)); - d (g_print ("button %d, event type %d, grabbed=%p, current=%p\n", - event->button, - event->type, - canvas->grabbed_item, - canvas->current_item)); + d ( + g_print ("button %d, event type %d, grabbed=%p, current=%p\n", + event->button, + event->type, + canvas->grabbed_item, + canvas->current_item)); /* dispatch normally regardless of the event's window if an item has has a pointer grab in effect */ @@ -709,8 +711,9 @@ e_canvas_item_invoke_reflow (GnomeCanvasItem *item, if (item->flags & E_CANVAS_ITEM_NEEDS_REFLOW) { ECanvasItemReflowFunc func; func = (ECanvasItemReflowFunc) - g_object_get_data (G_OBJECT (item), - "ECanvasItem::reflow_callback"); + g_object_get_data ( + G_OBJECT (item), + "ECanvasItem::reflow_callback"); if (func) func (item, flags); } diff --git a/widgets/misc/e-contact-map-window.c b/widgets/misc/e-contact-map-window.c index 2d31cc8592..2e3aec5bcb 100644 --- a/widgets/misc/e-contact-map-window.c +++ b/widgets/misc/e-contact-map-window.c @@ -136,10 +136,12 @@ zoom_level_changed_cb (ChamplainView *view, EContactMapWindow *window = user_data; gint zoom_level = champlain_view_get_zoom_level (view); - gtk_widget_set_sensitive (window->priv->zoom_in_btn, + gtk_widget_set_sensitive ( + window->priv->zoom_in_btn, (zoom_level < champlain_view_get_max_zoom_level (view))); - gtk_widget_set_sensitive (window->priv->zoom_out_btn, + gtk_widget_set_sensitive ( + window->priv->zoom_out_btn, (zoom_level > champlain_view_get_min_zoom_level (view))); } @@ -158,11 +160,13 @@ map_contact_added_cb (EContactMap *map, name = champlain_label_get_text (CHAMPLAIN_LABEL (marker)); - g_hash_table_insert (priv->hash_table, + g_hash_table_insert ( + priv->hash_table, g_strdup (name), marker); gtk_list_store_append (priv->completion_model, &iter); - gtk_list_store_set (priv->completion_model, &iter, + gtk_list_store_set ( + priv->completion_model, &iter, 0, name, -1); g_signal_connect ( @@ -236,8 +240,9 @@ contact_map_window_find_contact_cb (GtkButton *button, EContactMapWindowPrivate *priv = E_CONTACT_MAP_WINDOW (user_data)->priv; ClutterActor *marker; - marker = g_hash_table_lookup (priv->hash_table, - gtk_entry_get_text (GTK_ENTRY (priv->search_entry))); + marker = g_hash_table_lookup ( + priv->hash_table, + gtk_entry_get_text (GTK_ENTRY (priv->search_entry))); if (marker) e_contact_map_zoom_on_marker (priv->map, marker); @@ -349,8 +354,11 @@ e_contact_map_window_init (EContactMapWindow *window) priv->tasks_cnt = 0; - hash_table = g_hash_table_new_full (g_str_hash, g_str_equal, - (GDestroyNotify) g_free, NULL); + hash_table = g_hash_table_new_full ( + (GHashFunc) g_str_hash, + (GEqualFunc) g_str_equal, + (GDestroyNotify) g_free, + (GDestroyNotify) NULL); priv->hash_table = hash_table; gtk_window_set_title (GTK_WINDOW (window), _("Contacts Map")); diff --git a/widgets/misc/e-contact-map.c b/widgets/misc/e-contact-map.c index 38ca2d9609..3ad17b441f 100644 --- a/widgets/misc/e-contact-map.c +++ b/widgets/misc/e-contact-map.c @@ -266,7 +266,8 @@ e_contact_map_init (EContactMap *map) map->priv = E_CONTACT_MAP_GET_PRIVATE (map); - hash_table = g_hash_table_new_full (g_str_hash, g_str_equal, + hash_table = g_hash_table_new_full ( + g_str_hash, g_str_equal, (GDestroyNotify) g_free, NULL); map->priv->markers = hash_table; diff --git a/widgets/misc/e-contact-marker.c b/widgets/misc/e-contact-marker.c index 98f1ea1cd4..9ac9417c9f 100644 --- a/widgets/misc/e-contact-marker.c +++ b/widgets/misc/e-contact-marker.c @@ -106,7 +106,8 @@ texture_new_from_pixbuf (GdkPixbuf *pixbuf, rowstride = gdk_pixbuf_get_rowstride (pixbuf); texture = clutter_texture_new (); - success = clutter_texture_set_from_rgb_data (CLUTTER_TEXTURE (texture), + success = clutter_texture_set_from_rgb_data ( + CLUTTER_TEXTURE (texture), data, has_alpha, width, height, rowstride, (has_alpha ? 4: 3), flags, NULL); @@ -227,7 +228,8 @@ draw_shadow (EContactMarker *marker, clutter_container_add_actor (CLUTTER_CONTAINER (priv->content_group), shadow); if (priv->shadow != NULL) { - clutter_container_remove_actor (CLUTTER_CONTAINER (priv->content_group), + clutter_container_remove_actor ( + CLUTTER_CONTAINER (priv->content_group), priv->shadow); } @@ -263,7 +265,8 @@ draw_background (EContactMarker *marker, clutter_color_darken (color, &darker_color); - cairo_set_source_rgba (cr, + cairo_set_source_rgba ( + cr, color->red / 255.0, color->green / 255.0, color->blue / 255.0, @@ -271,7 +274,8 @@ draw_background (EContactMarker *marker, cairo_fill_preserve (cr); cairo_set_line_width (cr, 1.0); - cairo_set_source_rgba (cr, + cairo_set_source_rgba ( + cr, darker_color.red / 255.0, darker_color.green / 255.0, darker_color.blue / 255.0, @@ -282,7 +286,8 @@ draw_background (EContactMarker *marker, clutter_container_add_actor (CLUTTER_CONTAINER (priv->content_group), bg); if (priv->background != NULL) { - clutter_container_remove_actor (CLUTTER_CONTAINER (priv->content_group), + clutter_container_remove_actor ( + CLUTTER_CONTAINER (priv->content_group), priv->background); } @@ -307,33 +312,41 @@ draw_marker (EContactMarker *marker) } if (priv->text_actor == NULL) { - priv->text_actor = clutter_text_new_with_text ("Serif 8", - champlain_label_get_text (label)); + priv->text_actor = clutter_text_new_with_text ( + "Serif 8", + champlain_label_get_text (label)); champlain_label_set_font_name (label, "Serif 8"); } text = CLUTTER_TEXT (priv->text_actor); - clutter_text_set_text (text, + clutter_text_set_text ( + text, champlain_label_get_text (label)); - clutter_text_set_font_name (text, + clutter_text_set_font_name ( + text, champlain_label_get_font_name (label)); clutter_text_set_line_alignment (text, PANGO_ALIGN_CENTER); clutter_text_set_line_wrap (text, TRUE); clutter_text_set_line_wrap_mode (text, PANGO_WRAP_WORD); - clutter_text_set_ellipsize (text, + clutter_text_set_ellipsize ( + text, champlain_label_get_ellipsize (label)); - clutter_text_set_attributes (text, + clutter_text_set_attributes ( + text, champlain_label_get_attributes (label)); - clutter_text_set_use_markup (text, + clutter_text_set_use_markup ( + text, champlain_label_get_use_markup (label)); if (priv->image) { - clutter_actor_set_width (priv->text_actor, + 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; - clutter_actor_set_position (priv->text_actor, PADDING, + clutter_actor_set_position ( + priv->text_actor, PADDING, clutter_actor_get_height (priv->image) + 2 *PADDING + 3); } else { total_height = clutter_actor_get_height (priv->text_actor) + 2 *PADDING; @@ -345,8 +358,9 @@ draw_marker (EContactMarker *marker) if (height > total_height) total_height = height; - clutter_text_set_color (CLUTTER_TEXT (priv->text_actor), - (champlain_marker_get_selected (CHAMPLAIN_MARKER (marker)) ? + clutter_text_set_color ( + CLUTTER_TEXT (priv->text_actor), + (champlain_marker_get_selected (CHAMPLAIN_MARKER (marker)) ? champlain_marker_get_selection_text_color () : champlain_label_get_text_color (CHAMPLAIN_LABEL (marker)))); if (clutter_actor_get_parent (priv->text_actor) == NULL) @@ -390,7 +404,8 @@ queue_redraw (EContactMarker *marker) EContactMarkerPrivate *priv = marker->priv; if (!priv->redraw_id) { - priv->redraw_id = g_idle_add_full (G_PRIORITY_DEFAULT, + priv->redraw_id = g_idle_add_full ( + G_PRIORITY_DEFAULT, (GSourceFunc) redraw_on_idle, g_object_ref (marker), (GDestroyNotify) g_object_unref); @@ -457,7 +472,8 @@ pick (ClutterActor *self, cogl_path_new (); - cogl_set_source_color4ub (color->red, + cogl_set_source_color4ub ( + color->red, color->green, color->blue, color->alpha); diff --git a/widgets/misc/e-dateedit.c b/widgets/misc/e-dateedit.c index 7418a7f4a9..45c4f7148b 100644 --- a/widgets/misc/e-dateedit.c +++ b/widgets/misc/e-dateedit.c @@ -541,8 +541,9 @@ create_children (EDateEdit *dedit) g_signal_connect ( priv->date_button, "clicked", G_CALLBACK (on_date_button_clicked), dedit); - gtk_box_pack_start (GTK_BOX (dedit), priv->date_button, - FALSE, FALSE, 0); + gtk_box_pack_start ( + GTK_BOX (dedit), priv->date_button, + FALSE, FALSE, 0); a11y = gtk_widget_get_accessible (priv->date_button); atk_object_set_description (a11y, _("Click this button to show a calendar")); atk_object_set_name (a11y, _("Date")); @@ -618,11 +619,13 @@ create_children (EDateEdit *dedit) gtk_widget_show (priv->space); priv->cal_popup = gtk_window_new (GTK_WINDOW_POPUP); - gtk_window_set_type_hint (GTK_WINDOW (priv->cal_popup), - GDK_WINDOW_TYPE_HINT_COMBO); - gtk_widget_set_events (priv->cal_popup, - gtk_widget_get_events (priv->cal_popup) - | GDK_KEY_PRESS_MASK); + gtk_window_set_type_hint ( + GTK_WINDOW (priv->cal_popup), + GDK_WINDOW_TYPE_HINT_COMBO); + gtk_widget_set_events ( + priv->cal_popup, + gtk_widget_get_events (priv->cal_popup) + | GDK_KEY_PRESS_MASK); g_signal_connect ( priv->cal_popup, "delete_event", G_CALLBACK (on_date_popup_delete_event), dedit); @@ -645,10 +648,11 @@ create_children (EDateEdit *dedit) priv->calendar = e_calendar_new (); calendar = E_CALENDAR (priv->calendar); - gnome_canvas_item_set (GNOME_CANVAS_ITEM (calendar->calitem), - "maximum_days_selected", 1, - "move_selection_when_moving", FALSE, - NULL); + gnome_canvas_item_set ( + GNOME_CANVAS_ITEM (calendar->calitem), + "maximum_days_selected", 1, + "move_selection_when_moving", FALSE, + NULL); g_signal_connect ( calendar->calitem, "selection_changed", @@ -813,10 +817,12 @@ e_date_edit_set_time (EDateEdit *dedit, priv = dedit->priv; if (the_time == -1) { - date_changed = e_date_edit_set_date_internal (dedit, TRUE, - TRUE, 0, 0, 0); - time_changed = e_date_edit_set_time_internal (dedit, TRUE, - TRUE, 0, 0); + date_changed = e_date_edit_set_date_internal ( + dedit, TRUE, + TRUE, 0, 0, 0); + time_changed = e_date_edit_set_time_internal ( + dedit, TRUE, + TRUE, 0, 0); } else { if (the_time == 0) { if (priv->time_callback) { @@ -829,15 +835,17 @@ e_date_edit_set_time (EDateEdit *dedit, tmp_tm = *localtime (&the_time); } - date_changed = e_date_edit_set_date_internal (dedit, TRUE, - FALSE, - tmp_tm.tm_year, - tmp_tm.tm_mon, - tmp_tm.tm_mday); - time_changed = e_date_edit_set_time_internal (dedit, TRUE, - FALSE, - tmp_tm.tm_hour, - tmp_tm.tm_min); + date_changed = e_date_edit_set_date_internal ( + dedit, TRUE, + FALSE, + tmp_tm.tm_year, + tmp_tm.tm_mon, + tmp_tm.tm_mday); + time_changed = e_date_edit_set_time_internal ( + dedit, TRUE, + FALSE, + tmp_tm.tm_hour, + tmp_tm.tm_min); } e_date_edit_update_date_entry (dedit); @@ -904,9 +912,10 @@ e_date_edit_set_date (EDateEdit *dedit, g_return_if_fail (E_IS_DATE_EDIT (dedit)); - date_changed = e_date_edit_set_date_internal (dedit, TRUE, FALSE, - year - 1900, month - 1, - day); + date_changed = e_date_edit_set_date_internal ( + dedit, TRUE, FALSE, + year - 1900, month - 1, + day); e_date_edit_update_date_entry (dedit); e_date_edit_update_time_combo_state (dedit); @@ -1004,10 +1013,12 @@ e_date_edit_set_date_and_time_of_day (EDateEdit *dedit, g_return_if_fail (E_IS_DATE_EDIT (dedit)); - date_changed = e_date_edit_set_date_internal (dedit, TRUE, FALSE, - year - 1900, month - 1, day); - time_changed = e_date_edit_set_time_internal (dedit, TRUE, FALSE, - hour, minute); + date_changed = e_date_edit_set_date_internal ( + dedit, TRUE, FALSE, + year - 1900, month - 1, day); + time_changed = e_date_edit_set_time_internal ( + dedit, TRUE, FALSE, + hour, minute); e_date_edit_update_date_entry (dedit); e_date_edit_update_time_entry (dedit); @@ -1050,7 +1061,7 @@ e_date_edit_set_show_date (EDateEdit *dedit, priv = dedit->priv; - if ((priv->show_date ? 1 : 0) == (show_date ? 1 : 0)) + if (priv->show_date == show_date) return; priv->show_date = show_date; @@ -1107,7 +1118,7 @@ e_date_edit_set_show_time (EDateEdit *dedit, priv = dedit->priv; - if ((priv->show_time ? 1 : 0) == (show_time ? 1 : 0)) + if (priv->show_time == show_time) return; priv->show_time = show_time; @@ -1250,7 +1261,7 @@ e_date_edit_set_use_24_hour_format (EDateEdit *dedit, { g_return_if_fail (E_IS_DATE_EDIT (dedit)); - if ((dedit->priv->use_24_hour_format ? 1 : 0) == (use_24_hour_format ? 1 : 0)) + if (dedit->priv->use_24_hour_format == use_24_hour_format) return; dedit->priv->use_24_hour_format = use_24_hour_format; @@ -1278,7 +1289,7 @@ e_date_edit_set_allow_no_date_set (EDateEdit *dedit, { g_return_if_fail (E_IS_DATE_EDIT (dedit)); - if ((dedit->priv->allow_no_date_set ? 1 : 0) == (allow_no_date_set ? 1 : 0)) + if (dedit->priv->allow_no_date_set == allow_no_date_set) return; dedit->priv->allow_no_date_set = allow_no_date_set; @@ -1369,10 +1380,12 @@ e_date_edit_show_date_popup (EDateEdit *dedit) e_calendar_item_set_selection (calendar->calitem, NULL, NULL); } else { g_date_clear (&selected_day, 1); - g_date_set_dmy (&selected_day, mtm.tm_mday, mtm.tm_mon + 1, - mtm.tm_year + 1900); - e_calendar_item_set_selection (calendar->calitem, - &selected_day, NULL); + g_date_set_dmy ( + &selected_day, mtm.tm_mday, mtm.tm_mon + 1, + mtm.tm_year + 1900); + e_calendar_item_set_selection ( + calendar->calitem, + &selected_day, NULL); } /* FIXME: Hack. Change ECalendarItem so it doesn't queue signal @@ -1450,9 +1463,10 @@ on_date_popup_date_selected (ECalendarItem *calitem, if (!e_calendar_item_get_selection (calitem, &start_date, &end_date)) return; - e_date_edit_set_date (dedit, g_date_get_year (&start_date), - g_date_get_month (&start_date), - g_date_get_day (&start_date)); + e_date_edit_set_date ( + dedit, g_date_get_year (&start_date), + g_date_get_month (&start_date), + g_date_get_day (&start_date)); } static void @@ -1482,8 +1496,9 @@ on_date_popup_today_button_clicked (GtkWidget *button, tmp_tm = *localtime (&t); } - e_date_edit_set_date (dedit, tmp_tm.tm_year + 1900, - tmp_tm.tm_mon + 1, tmp_tm.tm_mday); + e_date_edit_set_date ( + dedit, tmp_tm.tm_year + 1900, + tmp_tm.tm_mon + 1, tmp_tm.tm_mday); } static void @@ -1728,8 +1743,8 @@ on_date_entry_key_press (GtkWidget *widget, if (event->state & GDK_MOD1_MASK && (event->keyval == GDK_KEY_Up || event->keyval == GDK_KEY_Down || event->keyval == GDK_KEY_Return)) { - g_signal_stop_emission_by_name (widget, - "key_press_event"); + g_signal_stop_emission_by_name ( + widget, "key_press_event"); e_date_edit_show_date_popup (dedit); return TRUE; } @@ -1769,7 +1784,8 @@ 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 (event->keyval == GDK_KEY_Return) { - g_signal_stop_emission_by_name (widget, + g_signal_stop_emission_by_name ( + widget, "key_press_event"); e_date_edit_check_time_changed (dedit); return TRUE; @@ -1793,7 +1809,8 @@ on_time_entry_key_release (GtkWidget *widget, EDateEdit *dedit) { if (event->keyval == GDK_KEY_Up || event->keyval == GDK_KEY_Down) { - g_signal_stop_emission_by_name (widget, + g_signal_stop_emission_by_name ( + widget, "key_release_event"); e_date_edit_check_time_changed (dedit); return TRUE; @@ -1817,11 +1834,12 @@ on_date_entry_focus_out (GtkEntry *entry, e_date_edit_check_date_changed (dedit); if (!e_date_edit_date_is_valid (dedit)) { - msg_dialog = gtk_message_dialog_new (NULL, - GTK_DIALOG_MODAL, - GTK_MESSAGE_WARNING, - GTK_BUTTONS_OK, - "%s", _("Invalid Date Value")); + msg_dialog = gtk_message_dialog_new ( + NULL, + GTK_DIALOG_MODAL, + GTK_MESSAGE_WARNING, + GTK_BUTTONS_OK, + "%s", _("Invalid Date Value")); gtk_dialog_run (GTK_DIALOG (msg_dialog)); gtk_widget_destroy (msg_dialog); e_date_edit_get_date ( @@ -1861,11 +1879,12 @@ on_time_entry_focus_out (GtkEntry *entry, e_date_edit_check_time_changed (dedit); if (!e_date_edit_time_is_valid (dedit)) { - msg_dialog = gtk_message_dialog_new (NULL, - GTK_DIALOG_MODAL, - GTK_MESSAGE_WARNING, - GTK_BUTTONS_OK, - "%s", _("Invalid Time Value")); + msg_dialog = gtk_message_dialog_new ( + NULL, + GTK_DIALOG_MODAL, + GTK_MESSAGE_WARNING, + GTK_BUTTONS_OK, + "%s", _("Invalid Time Value")); gtk_dialog_run (GTK_DIALOG (msg_dialog)); gtk_widget_destroy (msg_dialog); e_date_edit_set_time (dedit,e_date_edit_get_time (dedit)); @@ -1892,8 +1911,8 @@ add_relation (EDateEdit *dedit, set = atk_object_ref_relation_set (a11yWidget); if (set != NULL) { - relation = atk_relation_set_get_relation_by_type (set, - ATK_RELATION_LABELLED_BY); + relation = atk_relation_set_get_relation_by_type ( + set, ATK_RELATION_LABELLED_BY); /* check whether has a labelled_by relation already */ if (relation != NULL) return; @@ -1903,13 +1922,14 @@ add_relation (EDateEdit *dedit, if (!set) return; - relation = atk_relation_set_get_relation_by_type (set, - ATK_RELATION_LABELLED_BY); + relation = atk_relation_set_get_relation_by_type ( + set, ATK_RELATION_LABELLED_BY); if (relation != NULL) { target = atk_relation_get_target (relation); target_object = g_ptr_array_index (target, 0); if (ATK_IS_OBJECT (target_object)) { - atk_object_add_relationship (a11yWidget, + atk_object_add_relationship ( + a11yWidget, ATK_RELATION_LABELLED_BY, ATK_OBJECT (target_object)); } @@ -2127,10 +2147,11 @@ e_date_edit_check_date_changed (EDateEdit *dedit) tmp_tm.tm_mday = 0; } - date_changed = e_date_edit_set_date_internal (dedit, valid, none, - tmp_tm.tm_year, - tmp_tm.tm_mon, - tmp_tm.tm_mday); + date_changed = e_date_edit_set_date_internal ( + dedit, valid, none, + tmp_tm.tm_year, + tmp_tm.tm_mon, + tmp_tm.tm_mday); if (date_changed) { priv->has_been_changed = TRUE; @@ -2161,9 +2182,10 @@ e_date_edit_check_time_changed (EDateEdit *dedit) else if (!e_date_edit_parse_time (dedit, time_text, &tmp_tm)) valid = FALSE; - time_changed = e_date_edit_set_time_internal (dedit, valid, none, - tmp_tm.tm_hour, - tmp_tm.tm_min); + time_changed = e_date_edit_set_time_internal ( + dedit, valid, none, + tmp_tm.tm_hour, + tmp_tm.tm_min); if (time_changed) { e_date_edit_update_time_entry (dedit); diff --git a/widgets/misc/e-import-assistant.c b/widgets/misc/e-import-assistant.c index 75cee65e3c..9e06324ab6 100644 --- a/widgets/misc/e-import-assistant.c +++ b/widgets/misc/e-import-assistant.c @@ -914,7 +914,8 @@ prepare_simple_page (GtkAssistant *assistant, gchar *title; /* only one importer found, make it even simpler */ - gtk_label_set_text (GTK_LABEL (page->actionlabel), + gtk_label_set_text ( + GTK_LABEL (page->actionlabel), page->has_preview ? _("Preview data to be imported") : _("Choose the destination for this import")); @@ -931,7 +932,7 @@ prepare_simple_page (GtkAssistant *assistant, gtk_label_set_text ( GTK_LABEL (page->actionlabel), _("Select what type of file you " - "want to import from the list.")); + "want to import from the list.")); gtk_widget_show (page->filetypetable); diff --git a/widgets/misc/e-mail-signature-manager.c b/widgets/misc/e-mail-signature-manager.c index 56237541dd..66463336ea 100644 --- a/widgets/misc/e-mail-signature-manager.c +++ b/widgets/misc/e-mail-signature-manager.c @@ -691,7 +691,7 @@ e_mail_signature_manager_set_prefer_html (EMailSignatureManager *manager, { g_return_if_fail (E_IS_MAIL_SIGNATURE_MANAGER (manager)); - if ((manager->priv->prefer_html ? 1 : 0) == (prefer_html ? 1 : 0)) + if (manager->priv->prefer_html == prefer_html) return; manager->priv->prefer_html = prefer_html; diff --git a/widgets/misc/e-map.c b/widgets/misc/e-map.c index d35988cb50..40fe589a8c 100644 --- a/widgets/misc/e-map.c +++ b/widgets/misc/e-map.c @@ -342,9 +342,10 @@ e_map_tweens_compute_matrix (EMap *map, } gtk_widget_get_allocation (GTK_WIDGET (map), &allocation); - cairo_matrix_init_translate (matrix, - allocation.width / 2.0, - allocation.height / 2.0); + cairo_matrix_init_translate ( + matrix, + allocation.width / 2.0, + allocation.height / 2.0); e_map_world_to_render_surface (map, longitude, latitude, &x, &y); cairo_matrix_scale (matrix, zoom, zoom); @@ -385,7 +386,8 @@ e_map_set_hadjustment_values (EMap *map) old_value = gtk_adjustment_get_value (adj); new_upper = MAX (allocation.width, gdk_pixbuf_get_width (priv->map_pixbuf)); - g_object_set (adj, + g_object_set ( + adj, "lower", 0.0, "upper", new_upper, "page-size", (gdouble) allocation.height, @@ -413,7 +415,8 @@ e_map_set_vadjustment_values (EMap *map) old_value = gtk_adjustment_get_value (adj); new_upper = MAX (allocation.height, gdk_pixbuf_get_height (priv->map_pixbuf)); - g_object_set (adj, + g_object_set ( + adj, "lower", 0.0, "upper", new_upper, "page-size", (gdouble) allocation.height, @@ -1305,11 +1308,12 @@ update_render_point (EMap *map, cairo_mask_surface (cr, mask, px - 2, py - 2); cairo_surface_destroy (mask); - cairo_set_source_rgba (cr, - ((point->rgba >> 24) & 0xff) / 255.0, - ((point->rgba >> 16) & 0xff) / 255.0, - ((point->rgba >> 8) & 0xff) / 255.0, - ( point->rgba & 0xff) / 255.0); + cairo_set_source_rgba ( + cr, + ((point->rgba >> 24) & 0xff) / 255.0, + ((point->rgba >> 16) & 0xff) / 255.0, + ((point->rgba >> 8) & 0xff) / 255.0, + ( point->rgba & 0xff) / 255.0); mask = cairo_image_surface_create_for_data (mask2, CAIRO_FORMAT_A8, 3, 3, 4); cairo_mask_surface (cr, mask, px - 1, py - 1); cairo_surface_destroy (mask); @@ -1330,9 +1334,10 @@ repaint_point (EMap *map, e_map_world_to_window (map, point->longitude, point->latitude, &px, &py); - gtk_widget_queue_draw_area (GTK_WIDGET (map), - (gint) px - 2, (gint) py - 2, - 5, 5); + gtk_widget_queue_draw_area ( + GTK_WIDGET (map), + (gint) px - 2, (gint) py - 2, + 5, 5); } static void @@ -1407,18 +1412,20 @@ set_scroll_area (EMap *view, priv->xofs = CLAMP (priv->xofs, 0, width - allocation.width); priv->yofs = CLAMP (priv->yofs, 0, height - allocation.height); - gtk_adjustment_configure (priv->hadjustment, - priv->xofs, - 0, width, - SCROLL_STEP_SIZE, - allocation.width / 2, - allocation.width); - gtk_adjustment_configure (priv->vadjustment, - priv->yofs, - 0, height, - SCROLL_STEP_SIZE, - allocation.height / 2, - allocation.height); + gtk_adjustment_configure ( + priv->hadjustment, + priv->xofs, + 0, width, + SCROLL_STEP_SIZE, + allocation.width / 2, + allocation.width); + gtk_adjustment_configure ( + priv->vadjustment, + priv->yofs, + 0, height, + SCROLL_STEP_SIZE, + allocation.height / 2, + allocation.height); g_object_thaw_notify (G_OBJECT (priv->hadjustment)); g_object_thaw_notify (G_OBJECT (priv->vadjustment)); diff --git a/widgets/misc/e-online-button.c b/widgets/misc/e-online-button.c index 41b81f4b94..a3921a779f 100644 --- a/widgets/misc/e-online-button.c +++ b/widgets/misc/e-online-button.c @@ -190,7 +190,7 @@ e_online_button_set_online (EOnlineButton *button, g_return_if_fail (E_IS_ONLINE_BUTTON (button)); - if ((button->priv->online ? 1 : 0) == (online ? 1 : 0)) + if (button->priv->online == online) return; button->priv->online = online; diff --git a/widgets/misc/e-picture-gallery.c b/widgets/misc/e-picture-gallery.c index dc455400b3..40e621b1ca 100644 --- a/widgets/misc/e-picture-gallery.c +++ b/widgets/misc/e-picture-gallery.c @@ -66,7 +66,8 @@ update_file_iter (GtkListStore *list_store, uri = g_file_get_uri (file); - file_info = g_file_query_info (file, + file_info = g_file_query_info ( + file, G_FILE_ATTRIBUTE_THUMBNAIL_PATH "," G_FILE_ATTRIBUTE_THUMBNAILING_FAILED "," G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME "," @@ -111,7 +112,8 @@ update_file_iter (GtkListStore *list_store, } res = TRUE; - gtk_list_store_set (list_store, iter, + gtk_list_store_set ( + list_store, iter, COL_PIXBUF, pixbuf, COL_URI, uri, COL_FILENAME_TEXT, filename_text ? filename_text : filename, @@ -165,7 +167,8 @@ find_file_uri (GtkListStore *list_store, do { gchar *iter_uri = NULL; - gtk_tree_model_get (model, iter, + gtk_tree_model_get ( + model, iter, COL_URI, &iter_uri, -1); diff --git a/widgets/misc/e-popup-action.c b/widgets/misc/e-popup-action.c index f5d8445d77..27c90f67c3 100644 --- a/widgets/misc/e-popup-action.c +++ b/widgets/misc/e-popup-action.c @@ -139,7 +139,7 @@ popup_action_set_use_action_appearance (EPopupAction *popup_action, GtkActivatable *activatable; GtkAction *related_action; - if ((popup_action->priv->use_action_appearance ? 1 : 0) == (use_action_appearance ? 1 : 0)) + if (popup_action->priv->use_action_appearance == use_action_appearance) return; popup_action->priv->use_action_appearance = use_action_appearance; diff --git a/widgets/misc/e-preferences-window.c b/widgets/misc/e-preferences-window.c index 741cd74fd8..83c5ed0fd6 100644 --- a/widgets/misc/e-preferences-window.c +++ b/widgets/misc/e-preferences-window.c @@ -595,7 +595,8 @@ e_preferences_window_setup (EPreferencesWindow *window) gtk_scrolled_window_set_policy (scrolled, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_scrolled_window_set_shadow_type (scrolled, GTK_SHADOW_NONE); - gtk_viewport_set_shadow_type (GTK_VIEWPORT (gtk_bin_get_child (GTK_BIN (scrolled))), + gtk_viewport_set_shadow_type ( + GTK_VIEWPORT (gtk_bin_get_child (GTK_BIN (scrolled))), GTK_SHADOW_NONE); gtk_widget_show (content); diff --git a/widgets/misc/e-printable.c b/widgets/misc/e-printable.c index 29c85c5b29..2e98143b1a 100644 --- a/widgets/misc/e-printable.c +++ b/widgets/misc/e-printable.c @@ -53,53 +53,64 @@ e_printable_class_init (EPrintableClass *class) { GObjectClass *object_class = G_OBJECT_CLASS (class); - e_printable_signals[PRINT_PAGE] = - g_signal_new ("print_page", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EPrintableClass, print_page), - NULL, NULL, - e_marshal_NONE__OBJECT_DOUBLE_DOUBLE_BOOLEAN, - G_TYPE_NONE, 4, G_TYPE_OBJECT, G_TYPE_DOUBLE, - G_TYPE_DOUBLE, G_TYPE_BOOLEAN); - - e_printable_signals[DATA_LEFT] = - g_signal_new ("data_left", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EPrintableClass, data_left), - NULL, NULL, - e_marshal_BOOLEAN__NONE, - G_TYPE_BOOLEAN, 0, G_TYPE_NONE); - - e_printable_signals[RESET] = - g_signal_new ("reset", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EPrintableClass, reset), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0, G_TYPE_NONE); - - e_printable_signals[HEIGHT] = - g_signal_new ("height", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EPrintableClass, height), - NULL, NULL, - e_marshal_DOUBLE__OBJECT_DOUBLE_DOUBLE_BOOLEAN, - G_TYPE_DOUBLE, 4, G_TYPE_OBJECT, G_TYPE_DOUBLE, - G_TYPE_DOUBLE, G_TYPE_BOOLEAN); - - e_printable_signals[WILL_FIT] = - g_signal_new ("will_fit", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EPrintableClass, will_fit), - NULL, NULL, - e_marshal_BOOLEAN__OBJECT_DOUBLE_DOUBLE_BOOLEAN, - G_TYPE_BOOLEAN, 4, G_TYPE_OBJECT, G_TYPE_DOUBLE, - G_TYPE_DOUBLE, G_TYPE_BOOLEAN); + e_printable_signals[PRINT_PAGE] = g_signal_new ( + "print_page", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EPrintableClass, print_page), + NULL, NULL, + e_marshal_NONE__OBJECT_DOUBLE_DOUBLE_BOOLEAN, + G_TYPE_NONE, 4, + G_TYPE_OBJECT, + G_TYPE_DOUBLE, + G_TYPE_DOUBLE, + G_TYPE_BOOLEAN); + + e_printable_signals[DATA_LEFT] = g_signal_new ( + "data_left", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EPrintableClass, data_left), + NULL, NULL, + e_marshal_BOOLEAN__NONE, + G_TYPE_BOOLEAN, 0, + G_TYPE_NONE); + + e_printable_signals[RESET] = g_signal_new ( + "reset", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EPrintableClass, reset), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0, + G_TYPE_NONE); + + e_printable_signals[HEIGHT] = g_signal_new ( + "height", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EPrintableClass, height), + NULL, NULL, + e_marshal_DOUBLE__OBJECT_DOUBLE_DOUBLE_BOOLEAN, + G_TYPE_DOUBLE, 4, + G_TYPE_OBJECT, + G_TYPE_DOUBLE, + G_TYPE_DOUBLE, + G_TYPE_BOOLEAN); + + e_printable_signals[WILL_FIT] = g_signal_new ( + "will_fit", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EPrintableClass, will_fit), + NULL, NULL, + e_marshal_BOOLEAN__OBJECT_DOUBLE_DOUBLE_BOOLEAN, + G_TYPE_BOOLEAN, 4, + G_TYPE_OBJECT, + G_TYPE_DOUBLE, + G_TYPE_DOUBLE, + G_TYPE_BOOLEAN); class->print_page = NULL; class->data_left = NULL; @@ -130,12 +141,13 @@ e_printable_print_page (EPrintable *e_printable, g_return_if_fail (e_printable != NULL); g_return_if_fail (E_IS_PRINTABLE (e_printable)); - g_signal_emit (e_printable, - e_printable_signals[PRINT_PAGE], 0, - context, - width, - height, - quantized); + g_signal_emit ( + e_printable, + e_printable_signals[PRINT_PAGE], 0, + context, + width, + height, + quantized); } gboolean @@ -146,9 +158,10 @@ e_printable_data_left (EPrintable *e_printable) g_return_val_if_fail (e_printable != NULL, FALSE); g_return_val_if_fail (E_IS_PRINTABLE (e_printable), FALSE); - g_signal_emit (e_printable, - e_printable_signals[DATA_LEFT], 0, - &ret_val); + g_signal_emit ( + e_printable, + e_printable_signals[DATA_LEFT], 0, + &ret_val); return ret_val; } @@ -159,8 +172,9 @@ e_printable_reset (EPrintable *e_printable) g_return_if_fail (e_printable != NULL); g_return_if_fail (E_IS_PRINTABLE (e_printable)); - g_signal_emit (e_printable, - e_printable_signals[RESET], 0); + g_signal_emit ( + e_printable, + e_printable_signals[RESET], 0); } gdouble @@ -175,13 +189,14 @@ e_printable_height (EPrintable *e_printable, g_return_val_if_fail (e_printable != NULL, -1); g_return_val_if_fail (E_IS_PRINTABLE (e_printable), -1); - g_signal_emit (e_printable, - e_printable_signals[HEIGHT], 0, - context, - width, - max_height, - quantized, - &ret_val); + g_signal_emit ( + e_printable, + e_printable_signals[HEIGHT], 0, + context, + width, + max_height, + quantized, + &ret_val); return ret_val; } @@ -198,13 +213,14 @@ e_printable_will_fit (EPrintable *e_printable, g_return_val_if_fail (e_printable != NULL, FALSE); g_return_val_if_fail (E_IS_PRINTABLE (e_printable), FALSE); - g_signal_emit (e_printable, - e_printable_signals[WILL_FIT], 0, - context, - width, - max_height, - quantized, - &ret_val); + g_signal_emit ( + e_printable, + e_printable_signals[WILL_FIT], 0, + context, + width, + max_height, + quantized, + &ret_val); return ret_val; } diff --git a/widgets/misc/e-selection-model-array.c b/widgets/misc/e-selection-model-array.c index 71990f1bd3..f2f5b93379 100644 --- a/widgets/misc/e-selection-model-array.c +++ b/widgets/misc/e-selection-model-array.c @@ -421,7 +421,7 @@ esma_change_range (ESelectionModel *selection, ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY (selection); if (start != end) { if (selection->sorter && e_sorter_needs_sorting (selection->sorter)) { - for ( i = start; i < end; i++) { + for (i = start; i < end; i++) { e_bit_array_change_one_row (esma->eba, e_sorter_sorted_to_model (selection->sorter, i), grow); } } else { @@ -503,14 +503,18 @@ esma_real_move_selection_end (ESelectionModel *selection, gint new_start; gint new_end; if (selection->sorter && e_sorter_needs_sorting (selection->sorter)) { - old_start = MIN (e_sorter_model_to_sorted (selection->sorter, esma->selection_start_row), - e_sorter_model_to_sorted (selection->sorter, esma->cursor_row)); - old_end = MAX (e_sorter_model_to_sorted (selection->sorter, esma->selection_start_row), - e_sorter_model_to_sorted (selection->sorter, esma->cursor_row)) + 1; - new_start = MIN (e_sorter_model_to_sorted (selection->sorter, esma->selection_start_row), - e_sorter_model_to_sorted (selection->sorter, row)); - new_end = MAX (e_sorter_model_to_sorted (selection->sorter, esma->selection_start_row), - e_sorter_model_to_sorted (selection->sorter, row)) + 1; + old_start = MIN ( + e_sorter_model_to_sorted (selection->sorter, esma->selection_start_row), + e_sorter_model_to_sorted (selection->sorter, esma->cursor_row)); + old_end = MAX ( + e_sorter_model_to_sorted (selection->sorter, esma->selection_start_row), + e_sorter_model_to_sorted (selection->sorter, esma->cursor_row)) + 1; + new_start = MIN ( + e_sorter_model_to_sorted (selection->sorter, esma->selection_start_row), + e_sorter_model_to_sorted (selection->sorter, row)); + new_end = MAX ( + e_sorter_model_to_sorted (selection->sorter, esma->selection_start_row), + e_sorter_model_to_sorted (selection->sorter, row)) + 1; } else { old_start = MIN (esma->selection_start_row, esma->cursor_row); old_end = MAX (esma->selection_start_row, esma->cursor_row) + 1; @@ -620,18 +624,24 @@ e_selection_model_array_class_init (ESelectionModelArrayClass *class) class->get_row_count = NULL; - g_object_class_install_property (object_class, PROP_CURSOR_ROW, - g_param_spec_int ("cursor_row", - "Cursor Row", - NULL, - 0, G_MAXINT, 0, - G_PARAM_READWRITE)); - - g_object_class_install_property (object_class, PROP_CURSOR_COL, - g_param_spec_int ("cursor_col", - "Cursor Column", - NULL, - 0, G_MAXINT, 0, - G_PARAM_READWRITE)); + g_object_class_install_property ( + object_class, + PROP_CURSOR_ROW, + g_param_spec_int ( + "cursor_row", + "Cursor Row", + NULL, + 0, G_MAXINT, 0, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_CURSOR_COL, + g_param_spec_int ( + "cursor_col", + "Cursor Column", + NULL, + 0, G_MAXINT, 0, + G_PARAM_READWRITE)); } diff --git a/widgets/misc/e-selection-model.c b/widgets/misc/e-selection-model.c index fc73df6b5e..fece615838 100644 --- a/widgets/misc/e-selection-model.c +++ b/widgets/misc/e-selection-model.c @@ -538,12 +538,14 @@ e_selection_model_do_something (ESelectionModel *selection, break; } e_selection_model_change_cursor (selection, row, col); - g_signal_emit (selection, - signals[CURSOR_CHANGED], 0, - row, col); - g_signal_emit (selection, - signals[CURSOR_ACTIVATED], 0, - row, col); + g_signal_emit ( + selection, + signals[CURSOR_CHANGED], 0, + row, col); + g_signal_emit ( + selection, + signals[CURSOR_ACTIVATED], 0, + row, col); } } @@ -572,9 +574,10 @@ e_selection_model_maybe_do_something (ESelectionModel *selection, if (e_selection_model_is_row_selected (selection, row)) { e_selection_model_change_cursor (selection, row, col); - g_signal_emit (selection, - signals[CURSOR_CHANGED], 0, - row, col); + g_signal_emit ( + selection, + signals[CURSOR_CHANGED], 0, + row, col); return FALSE; } else { e_selection_model_do_something (selection, row, col, state); @@ -649,13 +652,15 @@ e_selection_model_select_as_key_press (ESelectionModel *selection, } if (row != -1) { e_selection_model_change_cursor (selection, row, col); - g_signal_emit (selection, - signals[CURSOR_CHANGED], 0, - row, col); + g_signal_emit ( + selection, + signals[CURSOR_CHANGED], 0, + row, col); if (cursor_activated) - g_signal_emit (selection, - signals[CURSOR_ACTIVATED], 0, - row, col); + g_signal_emit ( + selection, + signals[CURSOR_ACTIVATED], 0, + row, col); } } @@ -722,9 +727,10 @@ e_selection_model_key_press (ESelectionModel *selection, break; e_selection_model_toggle_single_row (selection, row); - g_signal_emit (selection, - signals[CURSOR_ACTIVATED], 0, - row, col); + g_signal_emit ( + selection, + signals[CURSOR_ACTIVATED], 0, + row, col); return TRUE; } break; @@ -734,9 +740,10 @@ e_selection_model_key_press (ESelectionModel *selection, gint row = e_selection_model_cursor_row (selection); gint col = e_selection_model_cursor_col (selection); e_selection_model_select_single_row (selection, row); - g_signal_emit (selection, - signals[CURSOR_ACTIVATED], 0, - row, col); + g_signal_emit ( + selection, + signals[CURSOR_ACTIVATED], 0, + row, col); return TRUE; } break; diff --git a/widgets/misc/e-send-options.c b/widgets/misc/e-send-options.c index 4b54c58157..748f7b83b5 100644 --- a/widgets/misc/e-send-options.c +++ b/widgets/misc/e-send-options.c @@ -648,7 +648,7 @@ e_send_options_cb (GtkDialog *dialog, break; } - g_signal_emit (G_OBJECT (func_data), signals[SOD_RESPONSE], 0, state); + g_signal_emit (func_data, signals[SOD_RESPONSE], 0, state); } gboolean diff --git a/widgets/misc/e-source-config.c b/widgets/misc/e-source-config.c index 9b4ad13f26..f5ef35287c 100644 --- a/widgets/misc/e-source-config.c +++ b/widgets/misc/e-source-config.c @@ -1335,9 +1335,9 @@ e_source_config_add_secure_connection (ESourceConfig *config, static gboolean secure_to_port_cb (GBinding *binding, - const GValue *source_value, - GValue *target_value, - gpointer user_data) + const GValue *source_value, + GValue *target_value, + gpointer user_data) { GObject *authentication_extension; guint16 port; diff --git a/widgets/misc/e-spell-entry.c b/widgets/misc/e-spell-entry.c index afc8c0e3bf..56f7c14f8c 100644 --- a/widgets/misc/e-spell-entry.c +++ b/widgets/misc/e-spell-entry.c @@ -323,8 +323,9 @@ replace_word (GtkWidget *menuitem, gtk_editable_delete_text (GTK_EDITABLE (entry), start, end); gtk_editable_set_position (GTK_EDITABLE (entry), start); - gtk_editable_insert_text (GTK_EDITABLE (entry), newword, strlen (newword), - &start); + gtk_editable_insert_text ( + GTK_EDITABLE (entry), newword, strlen (newword), + &start); gtk_editable_set_position (GTK_EDITABLE (entry), cursor); checker = g_object_get_data (G_OBJECT (menuitem), "spell-entry-checker"); @@ -382,7 +383,7 @@ build_suggestion_menu (ESpellEntry *entry, mi = gtk_menu_item_new_with_label (iter->data); g_object_set_data (G_OBJECT (mi), "spell-entry-checker", checker); - g_signal_connect (G_OBJECT (mi), "activate", G_CALLBACK (replace_word), entry); + g_signal_connect (mi, "activate", G_CALLBACK (replace_word), entry); gtk_widget_show (mi); gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi); } @@ -450,7 +451,7 @@ build_spelling_menu (ESpellEntry *entry, if (!entry->priv->checkers->next) { checker = entry->priv->checkers->data; g_object_set_data (G_OBJECT (mi), "spell-entry-checker", checker); - g_signal_connect (G_OBJECT (mi), "activate", G_CALLBACK (add_to_dictionary), entry); + g_signal_connect (mi, "activate", G_CALLBACK (add_to_dictionary), entry); } else { GSList *li; GtkWidget *menu, *submi; @@ -473,7 +474,7 @@ build_spelling_menu (ESpellEntry *entry, submi = gtk_menu_item_new_with_label (lang_name ? lang_name : "???"); g_object_set_data (G_OBJECT (submi), "spell-entry-checker", checker); - g_signal_connect (G_OBJECT (submi), "activate", G_CALLBACK (add_to_dictionary), entry); + g_signal_connect (submi, "activate", G_CALLBACK (add_to_dictionary), entry); gtk_widget_show (submi); gtk_menu_shell_append (GTK_MENU_SHELL (menu), submi); @@ -486,7 +487,7 @@ build_spelling_menu (ESpellEntry *entry, /* - Ignore All */ mi = gtk_image_menu_item_new_with_label (_("Ignore All")); gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (mi), gtk_image_new_from_stock (GTK_STOCK_REMOVE, GTK_ICON_SIZE_MENU)); - g_signal_connect (G_OBJECT (mi), "activate", G_CALLBACK (ignore_all), entry); + g_signal_connect (mi, "activate", G_CALLBACK (ignore_all), entry); gtk_widget_show_all (mi); gtk_menu_shell_append (GTK_MENU_SHELL (topmenu), mi); @@ -829,7 +830,8 @@ e_spell_entry_set_languages (ESpellEntry *spell_entry, const GtkhtmlSpellLanguage *language = iter->data; if (language) - spell_entry->priv->checkers = g_slist_prepend (spell_entry->priv->checkers, + spell_entry->priv->checkers = g_slist_prepend ( + spell_entry->priv->checkers, gtkhtml_spell_checker_new (language)); } @@ -853,7 +855,7 @@ e_spell_entry_set_checking_enabled (ESpellEntry *spell_entry, { g_return_if_fail (spell_entry != NULL); - if ((enable_checking ? 1 : 0) == (spell_entry->priv->checking_enabled ? 1 : 0)) + if (spell_entry->priv->checking_enabled == enable_checking) return; spell_entry->priv->checking_enabled = enable_checking; diff --git a/widgets/misc/e-web-view.c b/widgets/misc/e-web-view.c index 9c434d6cf8..0d0903c7bd 100644 --- a/widgets/misc/e-web-view.c +++ b/widgets/misc/e-web-view.c @@ -480,7 +480,8 @@ web_view_update_document_highlights (EWebView *web_view) webkit_dom_node_append_child ( WEBKIT_DOM_NODE (frag), WEBKIT_DOM_NODE (span), NULL); - replace_text (WEBKIT_DOM_NODE (document), + replace_text ( + WEBKIT_DOM_NODE (document), iter->data, WEBKIT_DOM_NODE (frag)); } } @@ -868,9 +869,9 @@ web_view_constructed (GObject *object) static gboolean web_view_context_menu_cb (WebKitWebView *webkit_web_view, - GtkWidget *default_menu, - WebKitHitTestResult *hit_test_result, - gboolean triggered_with_keyboard) + GtkWidget *default_menu, + WebKitHitTestResult *hit_test_result, + gboolean triggered_with_keyboard) { WebKitHitTestResultContext context; EWebView *web_view; @@ -1447,10 +1448,10 @@ web_view_selectable_select_all (ESelectable *selectable) static gboolean web_view_drag_motion (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - guint time_) + GdkDragContext *context, + gint x, + gint y, + guint time_) { return FALSE; } @@ -2109,7 +2110,8 @@ e_web_view_set_enable_frame_flattening (EWebView *web_view, settings = webkit_web_view_get_settings (WEBKIT_WEB_VIEW (web_view)); g_return_if_fail (settings != NULL); - g_object_set (G_OBJECT (settings), "enable-frame-flattening", + g_object_set ( + G_OBJECT (settings), "enable-frame-flattening", enable_frame_flattening, NULL); } @@ -2816,7 +2818,8 @@ e_web_view_update_fonts (EWebView *web_view) } stylesheet = g_string_new (""); - g_string_append_printf (stylesheet, + g_string_append_printf ( + stylesheet, "body {\n" " font-family: '%s';\n" " font-size: %dpt;\n" @@ -2848,7 +2851,8 @@ e_web_view_update_fonts (EWebView *web_view) g_string_append (stylesheet, "}\n"); - g_string_append_printf (stylesheet, + g_string_append_printf ( + stylesheet, "pre,code,.pre {\n" " font-family: '%s';\n" " font-size: %dpt;\n" @@ -2861,7 +2865,8 @@ e_web_view_update_fonts (EWebView *web_view) styles[pango_font_description_get_style (ms)]); context = gtk_widget_get_style_context (GTK_WIDGET (web_view)); - gtk_style_context_get_style (context, + gtk_style_context_get_style ( + context, "link-color", &link, "visited-link-color", &visited, NULL); @@ -2876,7 +2881,8 @@ e_web_view_update_fonts (EWebView *web_view) visited->red = G_MAXINT16; } - g_string_append_printf (stylesheet, + g_string_append_printf ( + stylesheet, "a {\n" " color: #%06x;\n" "}\n" @@ -2897,7 +2903,8 @@ e_web_view_update_fonts (EWebView *web_view) g_free (base64); settings = webkit_web_view_get_settings (WEBKIT_WEB_VIEW (web_view)); - g_object_set (G_OBJECT (settings), + g_object_set ( + G_OBJECT (settings), "default-font-size", pango_font_description_get_size (vw) / PANGO_SCALE, "default-font-family", pango_font_description_get_family (vw), "monospace-font-family", pango_font_description_get_family (ms), diff --git a/widgets/misc/ea-calendar-cell.c b/widgets/misc/ea-calendar-cell.c index b66a991bba..90a889ef18 100644 --- a/widgets/misc/ea-calendar-cell.c +++ b/widgets/misc/ea-calendar-cell.c @@ -56,8 +56,9 @@ e_calendar_cell_get_type (void) NULL /* value table */ }; - type = g_type_register_static (G_TYPE_OBJECT, - "ECalendarCell", &tinfo, 0); + type = g_type_register_static ( + G_TYPE_OBJECT, + "ECalendarCell", &tinfo, 0); } return type; @@ -143,10 +144,12 @@ ea_calendar_cell_get_type (void) NULL }; - type = g_type_register_static (ATK_TYPE_GOBJECT_ACCESSIBLE, - "EaCalendarCell", &tinfo, 0); - g_type_add_interface_static (type, ATK_TYPE_COMPONENT, - &atk_component_info); + type = g_type_register_static ( + ATK_TYPE_GOBJECT_ACCESSIBLE, + "EaCalendarCell", &tinfo, 0); + g_type_add_interface_static ( + type, ATK_TYPE_COMPONENT, + &atk_component_info); } return type; @@ -198,7 +201,8 @@ ea_calendar_cell_new (GObject *obj) #ifdef ACC_DEBUG ++n_ea_calendar_cell_created; - g_print ("ACC_DEBUG: n_ea_calendar_cell_created = %d\n", + g_print ( + "ACC_DEBUG: n_ea_calendar_cell_created = %d\n", n_ea_calendar_cell_created); #endif return atk_object; @@ -210,7 +214,8 @@ static void ea_calendar_cell_finalize (GObject *object) G_OBJECT_CLASS (parent_class)->finalize (object); ++n_ea_calendar_cell_destroyed; - g_print ("ACC_DEBUG: n_ea_calendar_cell_destroyed = %d\n", + g_print ( + "ACC_DEBUG: n_ea_calendar_cell_destroyed = %d\n", n_ea_calendar_cell_destroyed); } #endif @@ -238,8 +243,9 @@ ea_calendar_cell_get_name (AtkObject *accessible) cell = E_CALENDAR_CELL (g_obj); atk_obj = ea_calendar_cell_get_parent (accessible); ea_calitem = EA_CALENDAR_ITEM (atk_obj); - day_index = atk_table_get_index_at (ATK_TABLE (ea_calitem), - cell->row, cell->column); + day_index = atk_table_get_index_at ( + ATK_TABLE (ea_calitem), + cell->row, cell->column); e_calendar_item_get_date_for_offset (cell->calitem, day_index, &year, &month, &day); @@ -288,8 +294,9 @@ ea_calendar_cell_get_index_in_parent (AtkObject *accessible) return -1; cell = E_CALENDAR_CELL (g_obj); parent = atk_object_get_parent (accessible); - return atk_table_get_index_at (ATK_TABLE (parent), - cell->row, cell->column); + return atk_table_get_index_at ( + ATK_TABLE (parent), + cell->row, cell->column); } static AtkStateSet * @@ -346,8 +353,9 @@ component_interface_get_extents (AtkComponent *component, calitem = cell->calitem; atk_obj = atk_gobject_accessible_for_object (G_OBJECT (calitem)); ea_calitem = EA_CALENDAR_ITEM (atk_obj); - day_index = atk_table_get_index_at (ATK_TABLE (ea_calitem), - cell->row, cell->column); + day_index = atk_table_get_index_at ( + ATK_TABLE (ea_calitem), + cell->row, cell->column); e_calendar_item_get_date_for_offset (calitem, day_index, &year, &month, &day); @@ -356,10 +364,11 @@ component_interface_get_extents (AtkComponent *component, x, y, width, height)) return; atk_canvas = atk_object_get_parent (ATK_OBJECT (ea_calitem)); - atk_component_get_extents (ATK_COMPONENT (atk_canvas), - &canvas_x, &canvas_y, - &canvas_width, &canvas_height, - coord_type); + atk_component_get_extents ( + ATK_COMPONENT (atk_canvas), + &canvas_x, &canvas_y, + &canvas_width, &canvas_height, + coord_type); *x += canvas_x; *y += canvas_y; } diff --git a/widgets/misc/ea-calendar-item.c b/widgets/misc/ea-calendar-item.c index 80b90105d4..dc878c4e1d 100644 --- a/widgets/misc/ea-calendar-item.c +++ b/widgets/misc/ea-calendar-item.c @@ -182,20 +182,24 @@ ea_calendar_item_get_type (void) * we are run-time deriving from (GailCanvasItem, in this case) */ - factory = atk_registry_get_factory (atk_get_default_registry (), - GNOME_TYPE_CANVAS_ITEM); + factory = atk_registry_get_factory ( + atk_get_default_registry (), + GNOME_TYPE_CANVAS_ITEM); derived_atk_type = atk_object_factory_get_accessible_type (factory); g_type_query (derived_atk_type, &query); tinfo.class_size = query.class_size; tinfo.instance_size = query.instance_size; - type = g_type_register_static (derived_atk_type, - "EaCalendarItem", &tinfo, 0); - g_type_add_interface_static (type, ATK_TYPE_TABLE, - &atk_table_info); - g_type_add_interface_static (type, ATK_TYPE_SELECTION, - &atk_selection_info); + type = g_type_register_static ( + derived_atk_type, + "EaCalendarItem", &tinfo, 0); + g_type_add_interface_static ( + type, ATK_TYPE_TABLE, + &atk_table_info); + g_type_add_interface_static ( + type, ATK_TYPE_SELECTION, + &atk_selection_info); } return type; @@ -231,14 +235,15 @@ ea_calendar_item_new (GObject *obj) atk_object_initialize (atk_object, obj); atk_object->role = ATK_ROLE_CALENDAR; - item_cell = atk_selection_ref_selection (ATK_SELECTION (atk_object), - 0); + item_cell = atk_selection_ref_selection ( + ATK_SELECTION (atk_object), 0); if (item_cell) ea_calendar_set_focus_object (EA_CALENDAR_ITEM (atk_object), item_cell); #ifdef ACC_DEBUG ++n_ea_calendar_item_created; - g_print ("ACC_DEBUG: n_ea_calendar_item_created = %d\n", + g_print ( + "ACC_DEBUG: n_ea_calendar_item_created = %d\n", n_ea_calendar_item_created); #endif /* connect signal handlers */ @@ -267,7 +272,8 @@ ea_calendar_item_finalize (GObject *object) G_OBJECT_CLASS (parent_class)->finalize (object); #ifdef ACC_DEBUG ++n_ea_calendar_item_destroyed; - printf ("ACC_DEBUG: n_ea_calendar_item_destroyed = %d\n", + printf ( + "ACC_DEBUG: n_ea_calendar_item_destroyed = %d\n", n_ea_calendar_item_destroyed); #endif } @@ -334,10 +340,11 @@ ea_calendar_item_get_name (AtkObject *accessible) month2 = g_date_get_month (&select_end); day2 = g_date_get_day (&select_end); - sprintf (new_name + strlen (new_name), - " : current selection: from %d-%d-%d to %d-%d-%d.", - year1, month1, day1, - year2, month2, day2); + sprintf ( + new_name + strlen (new_name), + " : current selection: from %d-%d-%d to %d-%d-%d.", + year1, month1, day1, + year2, month2, day2); } #endif @@ -440,16 +447,18 @@ ea_calendar_item_ref_child (AtkObject *accessible, cell = ea_cell_table_get_cell_at_index (cell_data, index); if (!cell) { - cell = e_calendar_cell_new (calitem, - index / EA_CALENDAR_COLUMN_NUM, - index % EA_CALENDAR_COLUMN_NUM); + cell = e_calendar_cell_new ( + calitem, + index / EA_CALENDAR_COLUMN_NUM, + index % EA_CALENDAR_COLUMN_NUM); ea_cell_table_set_cell_at_index (cell_data, index, cell); g_object_unref (cell); } #ifdef ACC_DEBUG - g_print ("AccDebug: ea_calendar_item children[%d]=%p\n", index, - (gpointer) cell); + g_print ( + "AccDebug: ea_calendar_item children[%d]=%p\n", index, + (gpointer) cell); #endif return g_object_ref (atk_gobject_accessible_for_object (G_OBJECT (cell))); } @@ -829,11 +838,12 @@ table_interface_get_column_description (AtkTable *table, description = ea_cell_table_get_column_label (cell_data, in_col); if (!description) { gchar buffer[128] = "column description"; - ea_calendar_item_get_column_label (ea_calitem, in_col, - buffer, sizeof (buffer)); + ea_calendar_item_get_column_label ( + ea_calitem, in_col, + buffer, sizeof (buffer)); ea_cell_table_set_column_label (cell_data, in_col, buffer); - description = ea_cell_table_get_column_label (cell_data, - in_col); + description = ea_cell_table_get_column_label ( + cell_data, in_col); } return description; } @@ -864,11 +874,13 @@ table_interface_get_row_description (AtkTable *table, description = ea_cell_table_get_row_label (cell_data, row); if (!description) { gchar buffer[128] = "row description"; - ea_calendar_item_get_row_label (ea_calitem, row, + ea_calendar_item_get_row_label ( + ea_calitem, row, buffer, sizeof (buffer)); ea_cell_table_set_row_label (cell_data, row, buffer); - description = ea_cell_table_get_row_label (cell_data, - row); + description = ea_cell_table_get_row_label ( + cell_data, + row); } return description; } @@ -1028,15 +1040,16 @@ selection_preview_change_cb (ECalendarItem *calitem) ea_calendar_item_destory_cell_data (EA_CALENDAR_ITEM (atk_obj)); /* only deal with the first selected child, for now */ - item_cell = atk_selection_ref_selection (ATK_SELECTION (atk_obj), - 0); + item_cell = atk_selection_ref_selection ( + ATK_SELECTION (atk_obj), 0); if (item_cell) ea_calendar_set_focus_object (EA_CALENDAR_ITEM (atk_obj), item_cell); - g_signal_emit_by_name (atk_obj, - "active-descendant-changed", - item_cell); + g_signal_emit_by_name ( + atk_obj, + "active-descendant-changed", + item_cell); g_signal_emit_by_name (atk_obj, "selection_changed"); } @@ -1050,8 +1063,8 @@ date_range_changed_cb (ECalendarItem *calitem) atk_obj = atk_gobject_accessible_for_object (G_OBJECT (calitem)); ea_calendar_item_destory_cell_data (EA_CALENDAR_ITEM (atk_obj)); - item_cell = atk_selection_ref_selection (ATK_SELECTION (atk_obj), - 0); + item_cell = atk_selection_ref_selection ( + ATK_SELECTION (atk_obj), 0); if (item_cell) ea_calendar_set_focus_object (EA_CALENDAR_ITEM (atk_obj), item_cell); @@ -1074,16 +1087,19 @@ ea_calendar_item_get_cell_data (EaCalendarItem *ea_calitem) if (!g_obj) return NULL; - cell_data = g_object_get_data (G_OBJECT (ea_calitem), - "ea-calendar-cell-table"); + cell_data = g_object_get_data ( + G_OBJECT (ea_calitem), + "ea-calendar-cell-table"); 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, - EA_CALENDAR_COLUMN_NUM, - FALSE); - g_object_set_data (G_OBJECT (ea_calitem), - "ea-calendar-cell-table", cell_data); + 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), + "ea-calendar-cell-table", cell_data); } return cell_data; } @@ -1095,11 +1111,13 @@ ea_calendar_item_destory_cell_data (EaCalendarItem *ea_calitem) g_return_if_fail (ea_calitem); - cell_data = g_object_get_data (G_OBJECT (ea_calitem), - "ea-calendar-cell-table"); + cell_data = g_object_get_data ( + G_OBJECT (ea_calitem), + "ea-calendar-cell-table"); if (cell_data) { - g_object_set_data (G_OBJECT (ea_calitem), - "ea-calendar-cell-table", NULL); + g_object_set_data ( + G_OBJECT (ea_calitem), + "ea-calendar-cell-table", NULL); ea_cell_table_destroy (cell_data); } } @@ -1130,8 +1148,8 @@ ea_calendar_item_get_row_label (EaCalendarItem *ea_calitem, &year, &month, &day)) return FALSE; - week_num = e_calendar_item_get_week_number (calitem, - day, month, year); + week_num = e_calendar_item_get_week_number ( + calitem, day, month, year); g_snprintf (buffer, buffer_size, "week number : %d", week_num); return TRUE; @@ -1196,8 +1214,9 @@ e_calendar_item_get_day_extents (ECalendarItem *calitem, if (!font_desc) font_desc = style->font_desc; pango_context = gtk_widget_get_pango_context (widget); - font_metrics = pango_context_get_metrics (pango_context, font_desc, - pango_context_get_language (pango_context)); + font_metrics = pango_context_get_metrics ( + pango_context, font_desc, + pango_context_get_language (pango_context)); char_height = PANGO_PIXELS (pango_font_metrics_get_ascent (font_metrics)) + @@ -1234,9 +1253,8 @@ e_calendar_item_get_day_extents (ECalendarItem *calitem, + E_CALENDAR_ITEM_YPAD_BELOW_DAY_LETTERS + 1 + E_CALENDAR_ITEM_YPAD_ABOVE_CELLS; - days_from_week_start = - e_calendar_item_get_n_days_from_week_start (calitem, new_year, - new_month); + days_from_week_start = e_calendar_item_get_n_days_from_week_start ( + calitem, new_year, new_month); day_row = (date + days_from_week_start - 1) / EA_CALENDAR_COLUMN_NUM; day_col = (date + days_from_week_start - 1) % EA_CALENDAR_COLUMN_NUM; diff --git a/widgets/misc/test-calendar.c b/widgets/misc/test-calendar.c index 2127fc0715..7d3584a424 100644 --- a/widgets/misc/test-calendar.c +++ b/widgets/misc/test-calendar.c @@ -85,10 +85,11 @@ main (gint argc, calitem, "selection_changed", G_CALLBACK (on_selection_changed), NULL); - gtk_drag_dest_set (cal, - GTK_DEST_DEFAULT_ALL, - target_table, G_N_ELEMENTS (target_table), - GDK_ACTION_COPY | GDK_ACTION_MOVE); + gtk_drag_dest_set ( + cal, + GTK_DEST_DEFAULT_ALL, + target_table, G_N_ELEMENTS (target_table), + GDK_ACTION_COPY | GDK_ACTION_MOVE); vbox = gtk_vbox_new (FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), cal, TRUE, TRUE, 0); @@ -108,19 +109,23 @@ on_date_range_changed (ECalendarItem *calitem) gint start_year, start_month, start_day; gint end_year, end_month, end_day; - e_calendar_item_get_date_range (calitem, - &start_year, &start_month, &start_day, - &end_year, &end_month, &end_day); + e_calendar_item_get_date_range ( + calitem, + &start_year, &start_month, &start_day, + &end_year, &end_month, &end_day); - g_print ("Date range changed (D/M/Y): %i/%i/%i - %i/%i/%i\n", - start_day, start_month + 1, start_year, - end_day, end_month + 1, end_year); + g_print ( + "Date range changed (D/M/Y): %i/%i/%i - %i/%i/%i\n", + start_day, start_month + 1, start_year, + end_day, end_month + 1, end_year); /* These days should windowear bold. Remember month is 0 to 11. */ - e_calendar_item_mark_day (calitem, 2000, 7, 26, /* 26th Aug 2000. */ - E_CALENDAR_ITEM_MARK_BOLD, FALSE); - e_calendar_item_mark_day (calitem, 2000, 8, 13, /* 13th Sep 2000. */ - E_CALENDAR_ITEM_MARK_BOLD, FALSE); + e_calendar_item_mark_day ( + calitem, 2000, 7, 26, /* 26th Aug 2000. */ + E_CALENDAR_ITEM_MARK_BOLD, FALSE); + e_calendar_item_mark_day ( + calitem, 2000, 8, 13, /* 13th Sep 2000. */ + E_CALENDAR_ITEM_MARK_BOLD, FALSE); } static void @@ -130,11 +135,12 @@ on_selection_changed (ECalendarItem *calitem) e_calendar_item_get_selection (calitem, &start_date, &end_date); - g_print ("Selection changed (D/M/Y): %i/%i/%i - %i/%i/%i\n", - g_date_get_day (&start_date), - g_date_get_month (&start_date), - g_date_get_year (&start_date), - g_date_get_day (&end_date), - g_date_get_month (&end_date), - g_date_get_year (&end_date)); + g_print ( + "Selection changed (D/M/Y): %i/%i/%i - %i/%i/%i\n", + g_date_get_day (&start_date), + g_date_get_month (&start_date), + g_date_get_year (&start_date), + g_date_get_day (&end_date), + g_date_get_month (&end_date), + g_date_get_year (&end_date)); } diff --git a/widgets/misc/test-dateedit.c b/widgets/misc/test-dateedit.c index 46c853cea6..5592afbc70 100644 --- a/widgets/misc/test-dateedit.c +++ b/widgets/misc/test-dateedit.c @@ -78,8 +78,9 @@ main (gint argc, /* EDateEdit 1. */ dedit = E_DATE_EDIT (e_date_edit_new ()); - gtk_table_attach (GTK_TABLE (table), GTK_WIDGET (dedit), - 0, 1, 0, 1, GTK_FILL, GTK_EXPAND, 0, 0); + gtk_table_attach ( + GTK_TABLE (table), GTK_WIDGET (dedit), + 0, 1, 0, 1, GTK_FILL, GTK_EXPAND, 0, 0); gtk_widget_show (GTK_WIDGET (dedit)); #if 0 @@ -96,8 +97,9 @@ main (gint argc, #endif button = gtk_button_new_with_label ("Print Date"); - gtk_table_attach (GTK_TABLE (table), button, - 1, 2, 0, 1, 0, 0, 0, 0); + gtk_table_attach ( + GTK_TABLE (table), button, + 1, 2, 0, 1, 0, 0, 0, 0); gtk_widget_show (button); g_signal_connect ( button, "clicked", @@ -105,8 +107,9 @@ main (gint argc, /* EDateEdit 2. */ dedit = E_DATE_EDIT (e_date_edit_new ()); - gtk_table_attach (GTK_TABLE (table), (GtkWidget *) dedit, - 0, 1, 1, 2, GTK_FILL, GTK_EXPAND, 0, 0); + gtk_table_attach ( + GTK_TABLE (table), (GtkWidget *) dedit, + 0, 1, 1, 2, GTK_FILL, GTK_EXPAND, 0, 0); gtk_widget_show ((GtkWidget *) (dedit)); e_date_edit_set_week_start_day (dedit, 1); e_date_edit_set_show_week_numbers (dedit, TRUE); @@ -128,8 +131,9 @@ main (gint argc, #endif button = gtk_button_new_with_label ("Print Date"); - gtk_table_attach (GTK_TABLE (table), button, - 1, 2, 1, 2, 0, 0, 0, 0); + gtk_table_attach ( + GTK_TABLE (table), button, + 1, 2, 1, 2, 0, 0, 0, 0); gtk_widget_show (button); g_signal_connect ( button, "clicked", @@ -137,8 +141,9 @@ main (gint argc, /* EDateEdit 3. */ dedit = E_DATE_EDIT (e_date_edit_new ()); - gtk_table_attach (GTK_TABLE (table), (GtkWidget *) dedit, - 0, 1, 2, 3, GTK_FILL, GTK_EXPAND, 0, 0); + gtk_table_attach ( + GTK_TABLE (table), (GtkWidget *) dedit, + 0, 1, 2, 3, GTK_FILL, GTK_EXPAND, 0, 0); gtk_widget_show ((GtkWidget *) (dedit)); e_date_edit_set_week_start_day (dedit, 1); e_date_edit_set_show_week_numbers (dedit, TRUE); @@ -160,16 +165,18 @@ main (gint argc, #endif button = gtk_button_new_with_label ("Print Date"); - gtk_table_attach (GTK_TABLE (table), button, - 1, 2, 2, 3, 0, 0, 0, 0); + gtk_table_attach ( + GTK_TABLE (table), button, + 1, 2, 2, 3, 0, 0, 0, 0); gtk_widget_show (button); g_signal_connect ( button, "clicked", G_CALLBACK (on_get_date_clicked), dedit); button = gtk_button_new_with_label ("Toggle 24-hour"); - gtk_table_attach (GTK_TABLE (table), button, - 2, 3, 2, 3, 0, 0, 0, 0); + gtk_table_attach ( + GTK_TABLE (table), button, + 2, 3, 2, 3, 0, 0, 0, 0); gtk_widget_show (button); g_signal_connect ( button, "clicked", @@ -230,8 +237,9 @@ on_date_changed (EDateEdit *dedit, if (e_date_edit_date_is_valid (dedit)) { if (e_date_edit_get_date (dedit, &year, &month, &day)) { - g_print ("Date %s changed to: %i/%i/%i (M/D/Y)\n", - name, month, day, year); + g_print ( + "Date %s changed to: %i/%i/%i (M/D/Y)\n", + name, month, day, year); } else { g_print ("Date %s changed to: None\n", name); } @@ -248,8 +256,9 @@ on_time_changed (EDateEdit *dedit, if (e_date_edit_time_is_valid (dedit)) { if (e_date_edit_get_time_of_day (dedit, &hour, &minute)) { - g_print ("Time %s changed to: %02i:%02i\n", name, - hour, minute); + g_print ( + "Time %s changed to: %02i:%02i\n", name, + hour, minute); } else { g_print ("Time %s changed to: None\n", name); } diff --git a/widgets/misc/test-preferences-window.c b/widgets/misc/test-preferences-window.c index ae0a570c6d..4ad30e2245 100644 --- a/widgets/misc/test-preferences-window.c +++ b/widgets/misc/test-preferences-window.c @@ -58,15 +58,18 @@ create_page_two (EPreferencesWindow *preferences_window) static void add_pages (EPreferencesWindow *preferences_window) { - e_preferences_window_add_page (preferences_window, "page-0", - "gtk-properties", "title 0", NULL, - create_page_zero, 0); - e_preferences_window_add_page (preferences_window, "page-1", - "gtk-properties", "title 1", NULL, - create_page_one, 1); - e_preferences_window_add_page (preferences_window, "page-2", - "gtk-properties", "title 2", NULL, - create_page_two, 2); + e_preferences_window_add_page ( + preferences_window, "page-0", + "gtk-properties", "title 0", NULL, + create_page_zero, 0); + e_preferences_window_add_page ( + preferences_window, "page-1", + "gtk-properties", "title 1", NULL, + create_page_one, 1); + e_preferences_window_add_page ( + preferences_window, "page-2", + "gtk-properties", "title 2", NULL, + create_page_two, 2); } static gint |