diff options
author | Miguel de Icaza <miguel@src.gnome.org> | 2000-03-30 09:35:18 +0800 |
---|---|---|
committer | Miguel de Icaza <miguel@src.gnome.org> | 2000-03-30 09:35:18 +0800 |
commit | a02608b0784912bebfd13c888cd1f0b32ed3c5e3 (patch) | |
tree | 73de4a81330902fb49e6a5fdf82bd7b61ca6a50a /widgets/e-table | |
parent | 88674ff4013f5b62ecaeaf8021b8f710067b8598 (diff) | |
download | gsoc2013-evolution-a02608b0784912bebfd13c888cd1f0b32ed3c5e3.tar.gz gsoc2013-evolution-a02608b0784912bebfd13c888cd1f0b32ed3c5e3.tar.zst gsoc2013-evolution-a02608b0784912bebfd13c888cd1f0b32ed3c5e3.zip |
Fix indentation
svn path=/trunk/; revision=2252
Diffstat (limited to 'widgets/e-table')
27 files changed, 534 insertions, 534 deletions
diff --git a/widgets/e-table/e-cell-checkbox.c b/widgets/e-table/e-cell-checkbox.c index 431c1663d1..1d7c319f74 100644 --- a/widgets/e-table/e-cell-checkbox.c +++ b/widgets/e-table/e-cell-checkbox.c @@ -20,7 +20,7 @@ #include "check-empty.xpm" #include "check-filled.xpm" -#define PARENT_TYPE e_cell_toggle_get_type() +#define PARENT_TYPE e_cell_toggle_get_type () static GdkPixbuf *checks [2]; diff --git a/widgets/e-table/e-cell-text.c b/widgets/e-table/e-cell-text.c index 8e37f67eef..ac3eb292a9 100644 --- a/widgets/e-table/e-cell-text.c +++ b/widgets/e-table/e-cell-text.c @@ -85,7 +85,7 @@ static GdkAtom clipboard_atom = GDK_NONE; -#define PARENT_TYPE e_cell_get_type() +#define PARENT_TYPE e_cell_get_type () #define TEXT_PAD 4 @@ -173,12 +173,12 @@ struct _CellEdit { guint default_cursor_shown : 1; }; -static void e_cell_text_view_command(ETextEventProcessor *tep, ETextEventProcessorCommand *command, gpointer data); +static void e_cell_text_view_command (ETextEventProcessor *tep, ETextEventProcessorCommand *command, gpointer data); -static void e_cell_text_view_get_selection(CellEdit *edit, GdkAtom selection, guint32 time); +static void e_cell_text_view_get_selection (CellEdit *edit, GdkAtom selection, guint32 time); static void e_cell_text_view_supply_selection (CellEdit *edit, guint time, GdkAtom selection, guchar *data, gint length); -static GtkWidget *e_cell_text_view_get_invisible(CellEdit *edit); +static GtkWidget *e_cell_text_view_get_invisible (CellEdit *edit); static void _selection_clear_event (GtkInvisible *invisible, GdkEventSelection *event, CellEdit *edit); @@ -192,11 +192,11 @@ static void _selection_received (GtkInvisible *invisible, guint time, CellEdit *edit); static void split_into_lines (CurrentCell *cell); -static void unref_lines(CurrentCell *cell); +static void unref_lines (CurrentCell *cell); static void calc_line_widths (CurrentCell *cell); static int get_line_ypos (CurrentCell *cell, struct line *line); static int get_line_xpos (CurrentCell *cell, struct line *line); -static void _get_tep(CellEdit *edit); +static void _get_tep (CellEdit *edit); static gint _get_position_from_xy (CurrentCell *cell, gint x, gint y); static void _get_xy_from_position (CurrentCell *cell, gint position, gint *xp, gint *yp); @@ -235,7 +235,7 @@ ect_stop_editing (ECellTextView *text_view) CellEdit *edit = text_view->edit; int row, view_col; - if ( !edit ) + if (!edit) return; row = edit->cell.row; @@ -250,20 +250,20 @@ ect_stop_editing (ECellTextView *text_view) if (edit->tep) gtk_object_unref (GTK_OBJECT(edit->tep)); if (edit->primary_selection) - g_free(edit->primary_selection); + g_free (edit->primary_selection); if (edit->clipboard_selection) - g_free(edit->clipboard_selection); - if ( ! edit->default_cursor_shown ) { - gdk_window_set_cursor(GTK_WIDGET(text_view->canvas)->window, NULL); + g_free (edit->clipboard_selection); + if (! edit->default_cursor_shown){ + gdk_window_set_cursor (GTK_WIDGET(text_view->canvas)->window, NULL); edit->default_cursor_shown = TRUE; } if (edit->timeout_id) { - g_source_remove(edit->timeout_id); + g_source_remove (edit->timeout_id); edit->timeout_id = 0; } if (edit->timer) { - g_timer_stop(edit->timer); - g_timer_destroy(edit->timer); + g_timer_stop (edit->timer); + g_timer_destroy (edit->timer); edit->timer = NULL; } @@ -324,7 +324,7 @@ ect_kill_view (ECellView *ecv) { ECellTextView *text_view = (ECellTextView *) ecv; - g_free(text_view); + g_free (text_view); } /* @@ -356,7 +356,7 @@ ect_unrealize (ECellView *ecv) gdk_gc_unref (text_view->gc); text_view->gc = NULL; - if ( text_view->edit ) { + if (text_view->edit){ ect_cancel_edit (text_view); } @@ -450,13 +450,13 @@ ect_draw (ECellView *ecell_view, GdkDrawable *drawable, gdk_gc_set_clip_rectangle (fg_gc, &rect); clip_rect = ▭ - if ( edit_display ) { + if (edit_display){ CellEdit *edit = text_view->edit; CurrentCell *cell = CURRENT_CELL(edit); cell->width = x2 - x1; - split_into_lines(cell); + split_into_lines (cell); linebreaks = cell->breaks; @@ -472,16 +472,16 @@ ect_draw (ECellView *ecell_view, GdkDrawable *drawable, end_char = start_char + lines->length; sel_start = edit->selection_start; sel_end = edit->selection_end; - if (sel_start > sel_end ) { + if (sel_start > sel_end){ sel_start ^= sel_end; sel_end ^= sel_start; sel_start ^= sel_end; } - if ( sel_start < start_char ) + if (sel_start < start_char) sel_start = start_char; - if ( sel_end > end_char ) + if (sel_end > end_char) sel_end = end_char; - if ( sel_start < sel_end ) { + if (sel_start < sel_end){ sel_rect.x = xpos + x1 + gdk_text_width (font, lines->text, sel_start - start_char); @@ -490,7 +490,7 @@ ect_draw (ECellView *ecell_view, GdkDrawable *drawable, lines->text + sel_start - start_char, sel_end - sel_start); sel_rect.height = height; - gtk_paint_flat_box(canvas->style, + gtk_paint_flat_box (canvas->style, drawable, edit->has_selection ? GTK_STATE_SELECTED : @@ -552,26 +552,26 @@ ect_draw (ECellView *ecell_view, GdkDrawable *drawable, height); } } - unref_lines(cell); + unref_lines (cell); } else { ECellTextLineBreaks *linebreaks; CurrentCell cell; - build_current_cell ( &cell, text_view, model_col, view_col, row ); + build_current_cell (&cell, text_view, model_col, view_col, row); cell.width = x2 - x1; - split_into_lines(&cell); + split_into_lines (&cell); linebreaks = cell.breaks; lines = linebreaks->lines; - ypos = get_line_ypos(&cell, lines); + ypos = get_line_ypos (&cell, lines); ypos += font->ascent; for (i = 0; i < linebreaks->num_lines; i++) { xpos = get_line_xpos (&cell, lines); - if ( ect->use_ellipsis && lines->ellipsis_length < lines->length) { + if (ect->use_ellipsis && lines->ellipsis_length < lines->length) { gdk_draw_text (drawable, font, text_view->gc, @@ -600,7 +600,7 @@ ect_draw (ECellView *ecell_view, GdkDrawable *drawable, ypos += height; lines++; - unref_lines(&cell); + unref_lines (&cell); } gdk_gc_set_clip_rectangle (text_view->gc, NULL); @@ -743,7 +743,7 @@ ect_edit_select_all (ECellTextView *text_view) g_assert (text_view->edit); text_view->edit->selection_start = 0; - text_view->edit->selection_end = strlen(text_view->edit->cell.text); + text_view->edit->selection_end = strlen (text_view->edit->cell.text); } /* @@ -761,7 +761,7 @@ ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, gint return_val = 0; CurrentCell cell, *cellptr; - build_current_cell ( &cell, text_view, model_col, view_col, row ); + build_current_cell (&cell, text_view, model_col, view_col, row); if (edit){ @@ -795,7 +795,7 @@ ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, } if (edit_display) { GdkEventKey key = event->key; - if ( key.keyval == GDK_KP_Enter || key.keyval == GDK_Return ) { + if (key.keyval == GDK_KP_Enter || key.keyval == GDK_Return){ e_table_item_leave_edit (text_view->cell_view.e_table_item_view); } else { e_tep_event.key.time = key.time; @@ -803,7 +803,7 @@ ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, e_tep_event.key.keyval = key.keyval; e_tep_event.key.length = key.length; e_tep_event.key.string = key.string; - _get_tep(edit); + _get_tep (edit); return e_text_event_processor_handle_event (edit->tep, &e_tep_event); } @@ -831,8 +831,8 @@ ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, e_tep_event.button.time = button.time; e_tep_event.button.state = button.state; e_tep_event.button.button = button.button; - e_tep_event.button.position = _get_position_from_xy(cellptr, button.x, button.y); - _get_tep(edit); + e_tep_event.button.position = _get_position_from_xy (cellptr, button.x, button.y); + _get_tep (edit); return_val = e_text_event_processor_handle_event (edit->tep, &e_tep_event); if (event->button.button == 1) { @@ -852,8 +852,8 @@ ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, e_tep_event.button.time = button.time; e_tep_event.button.state = button.state; e_tep_event.button.button = button.button; - e_tep_event.button.position = _get_position_from_xy(cellptr, button.x, button.y); - _get_tep(edit); + e_tep_event.button.position = _get_position_from_xy (cellptr, button.x, button.y); + _get_tep (edit); return_val = e_text_event_processor_handle_event (edit->tep, &e_tep_event); if (event->button.button == 1) { @@ -874,8 +874,8 @@ ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, GdkEventMotion motion = event->motion; e_tep_event.motion.time = motion.time; e_tep_event.motion.state = motion.state; - e_tep_event.motion.position = _get_position_from_xy(cellptr, motion.x, motion.y); - _get_tep(edit); + e_tep_event.motion.position = _get_position_from_xy (cellptr, motion.x, motion.y); + _get_tep (edit); return_val = e_text_event_processor_handle_event (edit->tep, &e_tep_event); edit->lastx = motion.x; @@ -888,8 +888,8 @@ ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, edit->pointer_in = TRUE; #endif if (edit_display) { - if ( edit->default_cursor_shown ) { - gdk_window_set_cursor(canvas->window, text_view->i_cursor); + if (edit->default_cursor_shown){ + gdk_window_set_cursor (canvas->window, text_view->i_cursor); edit->default_cursor_shown = FALSE; } } @@ -899,8 +899,8 @@ ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, text_view->pointer_in = FALSE; #endif if (edit_display) { - if ( ! edit->default_cursor_shown ) { - gdk_window_set_cursor(canvas->window, NULL); + if (! edit->default_cursor_shown){ + gdk_window_set_cursor (canvas->window, NULL); edit->default_cursor_shown = TRUE; } } @@ -912,7 +912,7 @@ ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, return return_val; #if 0 if (GNOME_CANVAS_ITEM_CLASS(parent_class)->event) - return GNOME_CANVAS_ITEM_CLASS(parent_class)->event(item, event); + return GNOME_CANVAS_ITEM_CLASS(parent_class)->event (item, event); #endif else return 0; @@ -959,12 +959,12 @@ ect_height (ECellView *ecell_view, int model_col, int view_col, int row) CurrentCell cell; int return_val; - build_current_cell ( &cell, text_view, model_col, view_col, row ); - split_into_lines( &cell ); + build_current_cell (&cell, text_view, model_col, view_col, row); + split_into_lines (&cell); return_val = (text_view->font->ascent + text_view->font->descent) * cell.breaks->num_lines + TEXT_PAD; - unref_lines( &cell ); + unref_lines (&cell); return return_val; } @@ -982,7 +982,7 @@ ect_enter_edit (ECellView *ecell_view, int model_col, int view_col, int row) edit = g_new (CellEdit, 1); text_view->edit = edit; - build_current_cell ( CURRENT_CELL(edit), text_view, model_col, view_col, row ); + build_current_cell (CURRENT_CELL(edit), text_view, model_col, view_col, row); edit->xofs_edit = 0.0; edit->yofs_edit = 0.0; @@ -991,10 +991,10 @@ ect_enter_edit (ECellView *ecell_view, int model_col, int view_col, int row) edit->selection_end = 0; edit->select_by_word = FALSE; - edit->timeout_id = g_timeout_add(10, _blink_scroll_timeout, text_view); - edit->timer = g_timer_new(); - g_timer_elapsed(edit->timer, &(edit->scroll_start)); - g_timer_start(edit->timer); + edit->timeout_id = g_timeout_add (10, _blink_scroll_timeout, text_view); + edit->timer = g_timer_new (); + g_timer_elapsed (edit->timer, &(edit->scroll_start)); + g_timer_start (edit->timer); edit->lastx = 0; edit->lasty = 0; @@ -1021,9 +1021,9 @@ ect_enter_edit (ECellView *ecell_view, int model_col, int view_col, int row) edit->cell.text = g_strdup (str); #if 0 - if ( edit->pointer_in ) { - if ( edit->default_cursor_shown ) { - gdk_window_set_cursor(GTK_WIDGET(item->canvas)->window, text_view->i_cursor); + if (edit->pointer_in){ + if (edit->default_cursor_shown){ + gdk_window_set_cursor (GTK_WIDGET(item->canvas)->window, text_view->i_cursor); edit->default_cursor_shown = FALSE; } } @@ -1166,7 +1166,7 @@ _get_xy_from_position (CurrentCell *cell, gint position, gint *xp, gint *yp) GdkFont *font = text_view->font; ECellTextLineBreaks *linebreaks; - split_into_lines(cell); + split_into_lines (cell); linebreaks = cell->breaks; lines = linebreaks->lines; @@ -1184,7 +1184,7 @@ _get_xy_from_position (CurrentCell *cell, gint position, gint *xp, gint *yp) x += gdk_text_width (font, lines->text, position - (lines->text - cell->text)); - if ( (CellEdit *) cell == cell->text_view->edit ) { + if ((CellEdit *) cell == cell->text_view->edit){ x -= ((CellEdit *)cell)->xofs_edit; y -= ((CellEdit *)cell)->yofs_edit; } @@ -1192,7 +1192,7 @@ _get_xy_from_position (CurrentCell *cell, gint position, gint *xp, gint *yp) *xp = x; if (yp) *yp = y; - unref_lines(cell); + unref_lines (cell); } } @@ -1208,13 +1208,13 @@ _get_position_from_xy (CurrentCell *cell, gint x, gint y) GdkFont *font = text_view->font; ECellTextLineBreaks *linebreaks; - split_into_lines(cell); + split_into_lines (cell); linebreaks = cell->breaks; lines = linebreaks->lines; - if ( (CellEdit *) cell == cell->text_view->edit ) { + if ((CellEdit *) cell == cell->text_view->edit){ x += ((CellEdit *)cell)->xofs_edit; y += ((CellEdit *)cell)->yofs_edit; } @@ -1234,8 +1234,8 @@ _get_position_from_xy (CurrentCell *cell, gint x, gint y) lines += j; xpos = get_line_xpos (cell, lines); - for(i = 0; i < lines->length; i++) { - int charwidth = gdk_text_width(font, + for (i = 0; i < lines->length; i++) { + int charwidth = gdk_text_width (font, lines->text + i, 1); xpos += charwidth / 2; @@ -1247,7 +1247,7 @@ _get_position_from_xy (CurrentCell *cell, gint x, gint y) return_val = lines->text + i - cell->text; - unref_lines(cell); + unref_lines (cell); return return_val; } @@ -1267,7 +1267,7 @@ _blink_scroll_timeout (gpointer data) gboolean scroll = FALSE; gboolean redraw = FALSE; - g_timer_elapsed(edit->timer, ¤t_time); + g_timer_elapsed (edit->timer, ¤t_time); if (edit->scroll_start + SCROLL_WAIT_TIME > 1000000) { if (current_time > edit->scroll_start - (1000000 - SCROLL_WAIT_TIME) && @@ -1299,8 +1299,8 @@ _blink_scroll_timeout (gpointer data) e_tep_event.type = GDK_MOTION_NOTIFY; e_tep_event.motion.state = edit->last_state; e_tep_event.motion.time = 0; - e_tep_event.motion.position = _get_position_from_xy(cell, edit->lastx, edit->lasty); - _get_tep(edit); + e_tep_event.motion.position = _get_position_from_xy (cell, edit->lastx, edit->lasty); + _get_tep (edit); e_text_event_processor_handle_event (edit->tep, &e_tep_event); edit->scroll_start = current_time; @@ -1316,14 +1316,14 @@ _blink_scroll_timeout (gpointer data) redraw = TRUE; edit->show_cursor = FALSE; } - if ( redraw ) { + if (redraw){ ect_queue_redraw (text_view, edit->cell.view_col, edit->cell.row); } return TRUE; } static int -_get_position(ECellTextView *text_view, ETextEventProcessorCommand *command) +_get_position (ECellTextView *text_view, ETextEventProcessorCommand *command) { int i; int length; @@ -1342,7 +1342,7 @@ _get_position(ECellTextView *text_view, ETextEventProcessorCommand *command) case E_TEP_START_OF_BUFFER: return 0; case E_TEP_END_OF_BUFFER: - return strlen(cell->text); + return strlen (cell->text); case E_TEP_START_OF_LINE: for (i = edit->selection_end - 2; i > 0; i--) @@ -1352,7 +1352,7 @@ _get_position(ECellTextView *text_view, ETextEventProcessorCommand *command) } return i; case E_TEP_END_OF_LINE: - length = strlen(cell->text); + length = strlen (cell->text); for (i = edit->selection_end + 1; i < length; i++) if (cell->text[i] == '\n') { break; @@ -1362,7 +1362,7 @@ _get_position(ECellTextView *text_view, ETextEventProcessorCommand *command) return i; case E_TEP_FORWARD_CHARACTER: - length = strlen(cell->text); + length = strlen (cell->text); i = edit->selection_end + 1; if (i > length) i = length; @@ -1374,9 +1374,9 @@ _get_position(ECellTextView *text_view, ETextEventProcessorCommand *command) return i; case E_TEP_FORWARD_WORD: - length = strlen(cell->text); + length = strlen (cell->text); for (i = edit->selection_end + 1; i < length; i++) - if (isspace(cell->text[i])) { + if (isspace (cell->text[i])) { break; } if (i > length) @@ -1384,7 +1384,7 @@ _get_position(ECellTextView *text_view, ETextEventProcessorCommand *command) return i; case E_TEP_BACKWARD_WORD: for (i = edit->selection_end - 2; i > 0; i--) - if (isspace(cell->text[i])) { + if (isspace (cell->text[i])) { i++; break; } @@ -1393,13 +1393,13 @@ _get_position(ECellTextView *text_view, ETextEventProcessorCommand *command) return i; case E_TEP_FORWARD_LINE: - _get_xy_from_position(cell, edit->selection_end, &x, &y); + _get_xy_from_position (cell, edit->selection_end, &x, &y); y += text_view->font->ascent + text_view->font->descent; - return _get_position_from_xy(cell, x, y); + return _get_position_from_xy (cell, x, y); case E_TEP_BACKWARD_LINE: - _get_xy_from_position(cell, edit->selection_end, &x, &y); + _get_xy_from_position (cell, edit->selection_end, &x, &y); y -= text_view->font->ascent + text_view->font->descent; - return _get_position_from_xy(cell, x, y); + return _get_position_from_xy (cell, x, y); case E_TEP_FORWARD_PARAGRAPH: case E_TEP_BACKWARD_PARAGRAPH: @@ -1413,11 +1413,11 @@ _get_position(ECellTextView *text_view, ETextEventProcessorCommand *command) } static void -_delete_selection(ECellTextView *text_view) +_delete_selection (ECellTextView *text_view) { CellEdit *edit = text_view->edit; CurrentCell *cell = CURRENT_CELL(edit); - gint length = strlen(cell->text); + gint length = strlen (cell->text); if (edit->selection_end == edit->selection_start) return; if (edit->selection_end < edit->selection_start) { @@ -1425,26 +1425,26 @@ _delete_selection(ECellTextView *text_view) edit->selection_start ^= edit->selection_end; edit->selection_end ^= edit->selection_start; } - memmove( cell->text + edit->selection_start, + memmove (cell->text + edit->selection_start, cell->text + edit->selection_end, - length - edit->selection_end + 1 ); + length - edit->selection_end + 1); length -= edit->selection_end - edit->selection_start; edit->selection_end = edit->selection_start; } static void -_insert(ECellTextView *text_view, char *string, int value) +_insert (ECellTextView *text_view, char *string, int value) { if (value > 0) { char *temp; CellEdit *edit = text_view->edit; CurrentCell *cell = CURRENT_CELL(edit); - gint length = strlen(cell->text); - temp = g_new(gchar, length + value + 1); - strncpy(temp, cell->text, edit->selection_start); - strncpy(temp + edit->selection_start, string, value); - strcpy(temp + edit->selection_start + value, cell->text + edit->selection_start); - g_free(cell->text); + gint length = strlen (cell->text); + temp = g_new (gchar, length + value + 1); + strncpy (temp, cell->text, edit->selection_start); + strncpy (temp + edit->selection_start, string, value); + strcpy (temp + edit->selection_start + value, cell->text + edit->selection_start); + g_free (cell->text); cell->text = temp; edit->selection_start += value; edit->selection_end = edit->selection_start; @@ -1452,7 +1452,7 @@ _insert(ECellTextView *text_view, char *string, int value) } static void -e_cell_text_view_command(ETextEventProcessor *tep, ETextEventProcessorCommand *command, gpointer data) +e_cell_text_view_command (ETextEventProcessor *tep, ETextEventProcessorCommand *command, gpointer data) { CellEdit *edit = (CellEdit *) data; CurrentCell *cell = CURRENT_CELL(edit); @@ -1464,31 +1464,31 @@ e_cell_text_view_command(ETextEventProcessor *tep, ETextEventProcessorCommand *c int sel_start, sel_end; switch (command->action) { case E_TEP_MOVE: - edit->selection_start = _get_position(text_view, command); + edit->selection_start = _get_position (text_view, command); edit->selection_end = edit->selection_start; if (edit->timer) { - g_timer_reset(edit->timer); + g_timer_reset (edit->timer); } redraw = TRUE; break; case E_TEP_SELECT: - edit->selection_end = _get_position(text_view, command); + edit->selection_end = _get_position (text_view, command); sel_start = MIN(edit->selection_start, edit->selection_end); sel_end = MAX(edit->selection_start, edit->selection_end); if (sel_start != sel_end) { e_cell_text_view_supply_selection (edit, command->time, GDK_SELECTION_PRIMARY, cell->text + sel_start, sel_end - sel_start); } else if (edit->timer) { - g_timer_reset(edit->timer); + g_timer_reset (edit->timer); } redraw = TRUE; break; case E_TEP_DELETE: if (edit->selection_end == edit->selection_start) { - edit->selection_end = _get_position(text_view, command); + edit->selection_end = _get_position (text_view, command); } - _delete_selection(text_view); + _delete_selection (text_view); if (edit->timer) { - g_timer_reset(edit->timer); + g_timer_reset (edit->timer); } redraw = TRUE; change = TRUE; @@ -1496,11 +1496,11 @@ e_cell_text_view_command(ETextEventProcessor *tep, ETextEventProcessorCommand *c case E_TEP_INSERT: if (edit->selection_end != edit->selection_start) { - _delete_selection(text_view); + _delete_selection (text_view); } - _insert(text_view, command->string, command->value); + _insert (text_view, command->string, command->value); if (edit->timer) { - g_timer_reset(edit->timer); + g_timer_reset (edit->timer); } redraw = TRUE; change = TRUE; @@ -1512,13 +1512,13 @@ e_cell_text_view_command(ETextEventProcessor *tep, ETextEventProcessorCommand *c e_cell_text_view_supply_selection (edit, command->time, clipboard_atom, cell->text + sel_start, sel_end - sel_start); } if (edit->timer) { - g_timer_reset(edit->timer); + g_timer_reset (edit->timer); } break; case E_TEP_PASTE: e_cell_text_view_get_selection (edit, clipboard_atom, command->time); if (edit->timer) { - g_timer_reset(edit->timer); + g_timer_reset (edit->timer); } redraw = TRUE; change = TRUE; @@ -1554,7 +1554,7 @@ e_cell_text_view_command(ETextEventProcessor *tep, ETextEventProcessorCommand *c struct line *lines; ECellTextLineBreaks *linebreaks; - split_into_lines(cell); + split_into_lines (cell); linebreaks = cell->breaks; @@ -1564,7 +1564,7 @@ e_cell_text_view_command(ETextEventProcessor *tep, ETextEventProcessorCommand *c } } lines --; - x = gdk_text_width(text_view->font, + x = gdk_text_width (text_view->font, lines->text, edit->selection_end - (lines->text - cell->text)); @@ -1578,10 +1578,10 @@ e_cell_text_view_command(ETextEventProcessor *tep, ETextEventProcessorCommand *c edit->xofs_edit = 2 + x - cell->width; redraw = TRUE; } - unref_lines(cell); + unref_lines (cell); } - if ( redraw ) { + if (redraw){ ect_queue_redraw (text_view, edit->cell.view_col, edit->cell.row); } #if 0 @@ -1595,13 +1595,13 @@ static void _invisible_destroy (GtkInvisible *invisible, edit->invisible = NULL; } -static GtkWidget *e_cell_text_view_get_invisible(CellEdit *edit) +static GtkWidget *e_cell_text_view_get_invisible (CellEdit *edit) { GtkWidget *invisible; if (edit->invisible) { invisible = edit->invisible; } else { - invisible = gtk_invisible_new(); + invisible = gtk_invisible_new (); edit->invisible = invisible; gtk_selection_add_target (invisible, @@ -1686,7 +1686,7 @@ _selection_received (GtkInvisible *invisible, command.string = selection_data->data; command.value = selection_data->length; command.time = time; - e_cell_text_view_command(edit->tep, &command, edit); + e_cell_text_view_command (edit->tep, &command, edit); } } @@ -1695,19 +1695,19 @@ static void e_cell_text_view_supply_selection (CellEdit *edit, guint time, GdkAt gboolean successful; GtkWidget *invisible; - invisible = e_cell_text_view_get_invisible(edit); + invisible = e_cell_text_view_get_invisible (edit); - if (selection == GDK_SELECTION_PRIMARY ) { + if (selection == GDK_SELECTION_PRIMARY){ if (edit->primary_selection) { g_free (edit->primary_selection); } - edit->primary_selection = g_strndup(data, length); + edit->primary_selection = g_strndup (data, length); edit->primary_length = length; } else if (selection == clipboard_atom) { if (edit->clipboard_selection) { g_free (edit->clipboard_selection); } - edit->clipboard_selection = g_strndup(data, length); + edit->clipboard_selection = g_strndup (data, length); edit->clipboard_length = length; } @@ -1720,24 +1720,24 @@ static void e_cell_text_view_supply_selection (CellEdit *edit, guint time, GdkAt } static void -e_cell_text_view_get_selection(CellEdit *edit, GdkAtom selection, guint32 time) +e_cell_text_view_get_selection (CellEdit *edit, GdkAtom selection, guint32 time) { GtkWidget *invisible; - invisible = e_cell_text_view_get_invisible(edit); - gtk_selection_convert(invisible, + invisible = e_cell_text_view_get_invisible (edit); + gtk_selection_convert (invisible, selection, GDK_SELECTION_TYPE_STRING, time); } static void -_get_tep(CellEdit *edit) +_get_tep (CellEdit *edit) { if (!edit->tep) { - edit->tep = e_text_event_processor_emacs_like_new(); + edit->tep = e_text_event_processor_emacs_like_new (); gtk_object_ref (GTK_OBJECT (edit->tep)); gtk_object_sink (GTK_OBJECT (edit->tep)); - gtk_signal_connect(GTK_OBJECT(edit->tep), + gtk_signal_connect (GTK_OBJECT(edit->tep), "command", GTK_SIGNAL_FUNC(e_cell_text_view_command), (gpointer) edit); @@ -1756,7 +1756,7 @@ split_into_lines (CurrentCell *cell) ECellTextLineBreaks *linebreaks = cell->breaks; if (! cell->breaks) { - cell->breaks = g_new(ECellTextLineBreaks, 1); + cell->breaks = g_new (ECellTextLineBreaks, 1); cell->breaks->ref_count = 1; } else { cell->breaks->ref_count ++; @@ -1805,13 +1805,13 @@ split_into_lines (CurrentCell *cell) /* Free lines structure. */ static void -unref_lines(CurrentCell *cell) +unref_lines (CurrentCell *cell) { - if ( cell->breaks ) { + if (cell->breaks){ cell->breaks->ref_count --; - if ( cell->breaks->ref_count <= 0 ) { - g_free(cell->breaks->lines); - g_free(cell->breaks); + if (cell->breaks->ref_count <= 0){ + g_free (cell->breaks->lines); + g_free (cell->breaks); cell->breaks = NULL; } } @@ -1865,7 +1865,7 @@ calc_line_widths (CurrentCell *cell) lines->width > cell->width) { if (font) { lines->ellipsis_length = 0; - for (j = 0; j < lines->length; j++ ) { + for (j = 0; j < lines->length; j++){ if (gdk_text_width (font, lines->text, j) + text_view->ellipsis_width <= cell->width) lines->ellipsis_length = j; else @@ -1901,5 +1901,5 @@ build_current_cell (CurrentCell *cell, ECellTextView *text_view, int model_col, cell->row = row; cell->breaks = NULL; cell->text = e_table_model_value_at (ecell_view->e_table_model, model_col, row); - cell->width = e_table_header_get_column(((ETableItem *)ecell_view->e_table_item_view)->header, view_col)->width - 8; + cell->width = e_table_header_get_column (((ETableItem *)ecell_view->e_table_item_view)->header, view_col)->width - 8; } diff --git a/widgets/e-table/e-cell-toggle.c b/widgets/e-table/e-cell-toggle.c index ddca5509ab..676ec44b3a 100644 --- a/widgets/e-table/e-cell-toggle.c +++ b/widgets/e-table/e-cell-toggle.c @@ -17,7 +17,7 @@ #include "e-util/e-util.h" #include "e-table-item.h" -#define PARENT_TYPE e_cell_get_type() +#define PARENT_TYPE e_cell_get_type () typedef struct { ECellView cell_view; diff --git a/widgets/e-table/e-cell.c b/widgets/e-table/e-cell.c index 1d87019007..b472b6f6ff 100644 --- a/widgets/e-table/e-cell.c +++ b/widgets/e-table/e-cell.c @@ -10,7 +10,7 @@ #include "e-cell.h" #include "e-util/e-util.h" -#define PARENT_TYPE gtk_object_get_type() +#define PARENT_TYPE gtk_object_get_type () static ECellView * ec_new_view (ECell *ecell, ETableModel *table_model, void *e_table_item_view) diff --git a/widgets/e-table/e-cell.h b/widgets/e-table/e-cell.h index b21653d6d1..8804d2066f 100644 --- a/widgets/e-table/e-cell.h +++ b/widgets/e-table/e-cell.h @@ -71,7 +71,7 @@ void e_cell_focus (ECellView *ecell_view, int model_col, int view_col, void e_cell_unfocus (ECellView *ecell_view); int e_cell_height (ECellView *ecell_view, int model_col, int view_col, int row); -void *e_cell_enter_edit(ECellView *ecell_view, int model_col, int view_col, int row); -void e_cell_leave_edit(ECellView *ecell_view, int model_col, int view_col, int row, void *edit_context); +void *e_cell_enter_edit (ECellView *ecell_view, int model_col, int view_col, int row); +void e_cell_leave_edit (ECellView *ecell_view, int model_col, int view_col, int row, void *edit_context); #endif /* _E_CELL_H_ */ diff --git a/widgets/e-table/e-table-col.c b/widgets/e-table/e-table-col.c index 457830843d..4e94a33279 100644 --- a/widgets/e-table/e-table-col.c +++ b/widgets/e-table/e-table-col.c @@ -22,10 +22,10 @@ etc_destroy (GtkObject *object) { ETableCol *etc = E_TABLE_COL (object); - gtk_object_unref( GTK_OBJECT(etc->ecell) ); + gtk_object_unref (GTK_OBJECT(etc->ecell)); - if ( etc->is_pixbuf ) - gdk_pixbuf_unref( etc->pixbuf ); + if (etc->is_pixbuf) + gdk_pixbuf_unref (etc->pixbuf); else g_free (etc->text); @@ -69,7 +69,7 @@ e_table_col_new (int col_idx, const char *text, int width, int min_width, etc->selected = 0; etc->resizeable = resizable; - gtk_object_ref(GTK_OBJECT(etc->ecell)); + gtk_object_ref (GTK_OBJECT(etc->ecell)); return etc; } @@ -102,7 +102,7 @@ e_table_col_new_with_pixbuf (int col_idx, GdkPixbuf *pixbuf, int width, int min_ etc->selected = 0; etc->resizeable = resizable; - gdk_pixbuf_ref(etc->pixbuf); + gdk_pixbuf_ref (etc->pixbuf); return etc; } diff --git a/widgets/e-table/e-table-example-1.c b/widgets/e-table/e-table-example-1.c index c1abc70c93..38059c4a4b 100644 --- a/widgets/e-table/e-table-example-1.c +++ b/widgets/e-table/e-table-example-1.c @@ -169,8 +169,8 @@ create_table (void) ETableModel *e_table_model = NULL; /* First we fill in the simple data. */ - for ( i = 0; i < ROWS; i++ ) { - for ( j = 0; j < COLS; j++ ) + for (i = 0; i < ROWS; i++){ + for (j = 0; j < COLS; j++) table_data [i] [j] = g_strdup (""); } /* Next we create our model. This uses the functions we defined @@ -242,7 +242,7 @@ main (int argc, char *argv []) gtk_widget_push_visual (gdk_rgb_get_visual ()); gtk_widget_push_colormap (gdk_rgb_get_cmap ()); - create_table(); + create_table (); gtk_main (); diff --git a/widgets/e-table/e-table-example-2.c b/widgets/e-table/e-table-example-2.c index bb05a1d198..8d7c484580 100644 --- a/widgets/e-table/e-table-example-2.c +++ b/widgets/e-table/e-table-example-2.c @@ -127,13 +127,13 @@ my_row_count (ETableModel *etc, void *data) static void * my_value_at (ETableModel *etc, int col, int row, void *data) { - if ( col == COLOR_COLUMN ) { - if ( importance_data[row] ) { + if (col == COLOR_COLUMN){ + if (importance_data[row]){ return color1; } else { return color2; } - } else if ( col == IMPORTANCE_COLUMN ) { + } else if (col == IMPORTANCE_COLUMN){ return (gpointer) importance_data[row]; } else { return (void *) table_data [row][col]; @@ -143,8 +143,8 @@ my_value_at (ETableModel *etc, int col, int row, void *data) static void my_set_value_at (ETableModel *etc, int col, int row, const void *val, void *data) { - if ( col == COLOR_COLUMN ) { - } else if ( col == IMPORTANCE_COLUMN ) { + if (col == COLOR_COLUMN){ + } else if (col == IMPORTANCE_COLUMN){ importance_data[row] = (gboolean) val; } else { g_free (table_data [row][col]); @@ -155,7 +155,7 @@ my_set_value_at (ETableModel *etc, int col, int row, const void *val, void *data static gboolean my_is_cell_editable (ETableModel *etc, int col, int row, void *data) { - if ( col == IMPORTANCE_COLUMN ) + if (col == IMPORTANCE_COLUMN) return FALSE; else return TRUE; @@ -164,22 +164,22 @@ my_is_cell_editable (ETableModel *etc, int col, int row, void *data) static void * my_duplicate_value (ETableModel *etc, int col, const void *value, void *data) { - if ( col == COLOR_COLUMN ) { + if (col == COLOR_COLUMN){ return (void *) value; - } else if ( col == IMPORTANCE_COLUMN ) { + } else if (col == IMPORTANCE_COLUMN){ return (void *) value; } else { - return g_strdup(value); + return g_strdup (value); } } static void my_free_value (ETableModel *etc, int col, void *value, void *data) { - if ( col == COLOR_COLUMN ) { - } else if ( col == IMPORTANCE_COLUMN ) { + if (col == COLOR_COLUMN){ + } else if (col == IMPORTANCE_COLUMN){ } else { - g_free(value); + g_free (value); } } @@ -190,7 +190,7 @@ my_thaw (ETableModel *etc, void *data) /* We create a window containing our new table. */ static void -create_table() +create_table () { GtkWidget *e_table, *window, *frame; ECell *cell_left_just; @@ -202,9 +202,9 @@ create_table() GdkPixbuf *pixbuf; /* First we fill in the simple data. */ - for ( i = 0; i < ROWS; i++ ) { - for ( j = 0; j < VIEW_COLS; j++ ) { - table_data[i][j] = g_strdup(""); + for (i = 0; i < ROWS; i++){ + for (j = 0; j < VIEW_COLS; j++){ + table_data[i][j] = g_strdup (""); } importance_data[i] = FALSE; } @@ -248,7 +248,7 @@ create_table() /* Next we add a special column for the check box. */ cell_checkbox = e_cell_checkbox_new (); - pixbuf = gdk_pixbuf_new_from_file("clip.png"); + pixbuf = gdk_pixbuf_new_from_file ("clip.png"); ecol = e_table_col_new_with_pixbuf (i, pixbuf, 18, 18, cell_checkbox, g_int_compare, TRUE); e_table_header_add_column (e_table_header, ecol, i); @@ -287,7 +287,7 @@ main (int argc, char *argv []) gtk_widget_push_visual (gdk_rgb_get_visual ()); gtk_widget_push_colormap (gdk_rgb_get_cmap ()); - create_table(); + create_table (); gtk_main (); diff --git a/widgets/e-table/e-table-group-container.c b/widgets/e-table/e-table-group-container.c index c69dbcd93a..f2742c1a1e 100644 --- a/widgets/e-table/e-table-group-container.c +++ b/widgets/e-table/e-table-group-container.c @@ -3,7 +3,7 @@ * E-Table-Group.c: Implements the grouping objects for elements on a table * * Author: - * Miguel de Icaza (miguel@gnu.org() + * Miguel de Icaza (miguel@gnu.org () * * Copyright 1999, 2000 Helix Code, Inc. */ @@ -45,7 +45,7 @@ typedef struct { } ETableGroupContainerChildNode; static void -e_table_group_container_child_node_free(ETableGroupContainer *etgc, +e_table_group_container_child_node_free (ETableGroupContainer *etgc, ETableGroupContainerChildNode *child_node) { ETableGroup *etg = E_TABLE_GROUP (etgc); @@ -59,7 +59,7 @@ e_table_group_container_child_node_free(ETableGroupContainer *etgc, } static void -e_table_group_container_list_free(ETableGroupContainer *etgc) +e_table_group_container_list_free (ETableGroupContainer *etgc) { ETableGroupContainerChildNode *child_node; GList *list; @@ -80,17 +80,17 @@ etgc_destroy (GtkObject *object) { ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (object); - if ( etgc->font ) { - gdk_font_unref(etgc->font); + if (etgc->font){ + gdk_font_unref (etgc->font); etgc->font = NULL; } - if ( etgc->ecol ) { - gtk_object_unref(GTK_OBJECT(etgc->ecol)); + if (etgc->ecol){ + gtk_object_unref (GTK_OBJECT(etgc->ecol)); } - if ( etgc->rect ) { - gtk_object_destroy(GTK_OBJECT(etgc->rect)); + if (etgc->rect){ + gtk_object_destroy (GTK_OBJECT(etgc->rect)); } - e_table_group_container_list_free(etgc); + e_table_group_container_list_free (etgc); GTK_OBJECT_CLASS (etgc_parent_class)->destroy (object); } @@ -129,7 +129,7 @@ e_table_group_add (ETableGroup *etg, GnomeCanvasItem *item) printf ("%d\n", child->y2-child->y1); } - e_canvas_item_move_absolute ( item, x, height); + e_canvas_item_move_absolute (item, x, height); if (E_IS_TABLE_ITEM (item)){ @@ -199,7 +199,7 @@ e_table_group_container_construct (GnomeCanvasGroup *parent, ETableGroupContaine { e_table_group_construct (parent, E_TABLE_GROUP (etgc), full_header, header, model); etgc->ecol = ecol; - gtk_object_ref(GTK_OBJECT(etgc->ecol)); + gtk_object_ref (GTK_OBJECT(etgc->ecol)); etgc->child_rules = child_rules; etgc->ascending = ascending; @@ -286,7 +286,7 @@ etgc_relayout (GnomeCanvasItem *eti, ETableGroupContainer *etgc) if (move){ printf ("Moving item %p\n", child); - gnome_canvas_item_set ( child, + gnome_canvas_item_set (child, "y", (double) height, NULL); } @@ -330,7 +330,7 @@ e_table_group_container_add (ETableGroupContainer *etgc, GnomeCanvasItem *item) printf ("%d\n", child->y2-child->y1); } - e_canvas_item_move_absolute ( item, x, height); + e_canvas_item_move_absolute (item, x, height); if (E_IS_TABLE_ITEM (item)){ @@ -444,7 +444,7 @@ etgc_event (GnomeCanvasItem *item, GdkEvent *event) use_col = FALSE; direction = E_FOCUS_START; } - if ( change_focus ) { + if (change_focus){ GList *list; for (list = etgc->children; list; list = list->next) { ETableGroupContainerChildNode *child_node; @@ -458,7 +458,7 @@ etgc_event (GnomeCanvasItem *item, GdkEvent *event) if (old_col == -1) old_col = 0; if (start_col == -1) - start_col = e_table_header_count (e_table_group_get_header(child)) - 1; + start_col = e_table_header_count (e_table_group_get_header (child)) - 1; if (direction == E_FOCUS_END) list = list->prev; @@ -525,7 +525,7 @@ compute_text (ETableGroupContainer *etgc, ETableGroupContainerChildNode *child_n etgc->ecol->text, (gchar *)child_node->key, (gint) child_node->count, - child_node->count == 1 ? "" : "s" ); + child_node->count == 1 ? "" : "s"); gnome_canvas_item_set (child_node->text, "text", text, NULL); @@ -549,7 +549,7 @@ etgc_add (ETableGroup *etg, gint row) ETableGroup *child; ETableGroupContainerChildNode *child_node; int i = 0; - for ( ; list; list = g_list_next(list), i++ ) { + for (; list; list = g_list_next (list), i++){ int comp_val; child_node = (ETableGroupContainerChildNode *)(list->data); comp_val = (*comp)(child_node->key, val); @@ -657,8 +657,8 @@ etgc_get_focus_column (ETableGroup *etg) for (list = etgc->children; list; list = list->next) { ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *)list->data; ETableGroup *child = child_node->child; - if (e_table_group_get_focus(child)) { - return e_table_group_get_focus_column(child); + if (e_table_group_get_focus (child)) { + return e_table_group_get_focus_column (child); } } } @@ -667,7 +667,7 @@ etgc_get_focus_column (ETableGroup *etg) static void etgc_thaw (ETableGroup *etg) { - e_canvas_item_request_reflow(GNOME_CANVAS_ITEM(etg)); + e_canvas_item_request_reflow (GNOME_CANVAS_ITEM(etg)); } static void @@ -677,16 +677,16 @@ etgc_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) switch (arg_id) { case ARG_FROZEN: - if ( GTK_VALUE_BOOL (*arg) ) + if (GTK_VALUE_BOOL (*arg)) etg->frozen = TRUE; else { etg->frozen = FALSE; - etgc_thaw(etg); + etgc_thaw (etg); } break; case ARG_WIDTH: - if ( E_TABLE_GROUP_CLASS(GTK_OBJECT(etg)->klass)->set_width ) - E_TABLE_GROUP_CLASS(GTK_OBJECT(etg)->klass)->set_width(etg, GTK_VALUE_DOUBLE (*arg)); + if (E_TABLE_GROUP_CLASS(GTK_OBJECT(etg)->klass)->set_width) + E_TABLE_GROUP_CLASS(GTK_OBJECT(etg)->klass)->set_width (etg, GTK_VALUE_DOUBLE (*arg)); break; default: break; @@ -703,14 +703,14 @@ etgc_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) GTK_VALUE_BOOL (*arg) = etg->frozen; break; case ARG_HEIGHT: - if ( E_TABLE_GROUP_CLASS(GTK_OBJECT(etg)->klass)->get_height ) - GTK_VALUE_DOUBLE (*arg) = E_TABLE_GROUP_CLASS(GTK_OBJECT(etg)->klass)->get_height(etg); + if (E_TABLE_GROUP_CLASS(GTK_OBJECT(etg)->klass)->get_height) + GTK_VALUE_DOUBLE (*arg) = E_TABLE_GROUP_CLASS(GTK_OBJECT(etg)->klass)->get_height (etg); else arg->type = GTK_TYPE_INVALID; break; case ARG_WIDTH: - if ( E_TABLE_GROUP_CLASS(GTK_OBJECT(etg)->klass)->get_width ) - GTK_VALUE_DOUBLE (*arg) = E_TABLE_GROUP_CLASS(GTK_OBJECT(etg)->klass)->get_width(etg); + if (E_TABLE_GROUP_CLASS(GTK_OBJECT(etg)->klass)->get_width) + GTK_VALUE_DOUBLE (*arg) = E_TABLE_GROUP_CLASS(GTK_OBJECT(etg)->klass)->get_width (etg); else arg->type = GTK_TYPE_INVALID; break; @@ -726,14 +726,14 @@ static void etgc_set_width (ETableGroup *etg, gdouble width) GList *list = etgc->children; etgc->width = width; - for ( ; list; list = g_list_next(list) ) { + for (; list; list = g_list_next (list)){ gdouble child_width = width - GROUP_INDENT; ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *)list->data; - gtk_object_set(GTK_OBJECT(child_node->child), + gtk_object_set (GTK_OBJECT(child_node->child), "width", child_width, NULL); - gnome_canvas_item_set(GNOME_CANVAS_ITEM(child_node->rect), + gnome_canvas_item_set (GNOME_CANVAS_ITEM(child_node->rect), "x1", (double) 0, "x2", (double) etgc->width, NULL); @@ -756,7 +756,7 @@ static void etgc_class_init (GtkObjectClass *object_class) { GnomeCanvasItemClass *item_class = (GnomeCanvasItemClass *) object_class; - ETableGroupClass *e_group_class = E_TABLE_GROUP_CLASS( object_class ); + ETableGroupClass *e_group_class = E_TABLE_GROUP_CLASS(object_class); object_class->destroy = etgc_destroy; object_class->set_arg = etgc_set_arg; @@ -792,18 +792,18 @@ etgc_reflow (GnomeCanvasItem *item, gint flags) { ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER(item); gboolean frozen; - gtk_object_get(GTK_OBJECT(etgc), + gtk_object_get (GTK_OBJECT(etgc), "frozen", &frozen, NULL); - if ( frozen ) { + if (frozen){ etgc->idle = 0; return; } - if ( GTK_OBJECT_FLAGS( etgc ) & GNOME_CANVAS_ITEM_REALIZED ) { + if (GTK_OBJECT_FLAGS(etgc)& GNOME_CANVAS_ITEM_REALIZED){ gdouble old_height; old_height = etgc->height; - if ( etgc->children == NULL ) { + if (etgc->children == NULL){ } else { GList *list; gdouble extra_height; @@ -819,22 +819,22 @@ etgc_reflow (GnomeCanvasItem *item, gint flags) running_height = extra_height; list = etgc->children; - for ( ; list; list = g_list_next(list) ) { + for (; list; list = g_list_next (list)){ ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *) list->data; ETableGroup *child = child_node->child; - gtk_object_get( GTK_OBJECT(child), + gtk_object_get (GTK_OBJECT(child), "height", &item_height, - NULL ); + NULL); - e_canvas_item_move_absolute(GNOME_CANVAS_ITEM(child_node->text), + e_canvas_item_move_absolute (GNOME_CANVAS_ITEM(child_node->text), GROUP_INDENT, running_height - BUTTON_PADDING); - e_canvas_item_move_absolute(GNOME_CANVAS_ITEM(child), + e_canvas_item_move_absolute (GNOME_CANVAS_ITEM(child), GROUP_INDENT, running_height); - gnome_canvas_item_set(GNOME_CANVAS_ITEM(child_node->rect), + gnome_canvas_item_set (GNOME_CANVAS_ITEM(child_node->rect), "x1", (double) 0, "x2", (double) etgc->width, "y1", (double) running_height - extra_height, @@ -844,9 +844,9 @@ etgc_reflow (GnomeCanvasItem *item, gint flags) running_height += item_height + extra_height; } running_height -= extra_height; - if ( running_height != old_height) { + if (running_height != old_height) { etgc->height = running_height; - e_canvas_item_request_parent_reflow(item); + e_canvas_item_request_parent_reflow (item); } } } @@ -859,7 +859,7 @@ etgc_init (GtkObject *object) ETableGroupContainer *container = E_TABLE_GROUP_CONTAINER(object); container->children = FALSE; - e_canvas_item_set_reflow_callback(GNOME_CANVAS_ITEM(object), etgc_reflow); + e_canvas_item_set_reflow_callback (GNOME_CANVAS_ITEM(object), etgc_reflow); } E_MAKE_TYPE (e_table_group_container, "ETableGroupContainer", ETableGroupContainer, etgc_class_init, etgc_init, PARENT_TYPE); diff --git a/widgets/e-table/e-table-group-leaf.c b/widgets/e-table/e-table-group-leaf.c index 1746d4f075..0c14129031 100644 --- a/widgets/e-table/e-table-group-leaf.c +++ b/widgets/e-table/e-table-group-leaf.c @@ -3,7 +3,7 @@ * E-Table-Group.c: Implements the grouping objects for elements on a table * * Author: - * Miguel de Icaza (miguel@gnu.org() + * Miguel de Icaza (miguel@gnu.org () * * Copyright 1999, Helix Code, Inc. */ @@ -38,11 +38,11 @@ static void etgl_destroy (GtkObject *object) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF(object); - if ( etgl->subset ) - gtk_object_unref(GTK_OBJECT(etgl->subset)); - if ( etgl->item ) - gtk_object_destroy(GTK_OBJECT(etgl->item)); - if ( GTK_OBJECT_CLASS (etgl_parent_class)->destroy ) + if (etgl->subset) + gtk_object_unref (GTK_OBJECT(etgl->subset)); + if (etgl->item) + gtk_object_destroy (GTK_OBJECT(etgl->item)); + if (GTK_OBJECT_CLASS (etgl_parent_class)->destroy) GTK_OBJECT_CLASS (etgl_parent_class)->destroy (object); } @@ -54,7 +54,7 @@ e_table_group_leaf_construct (GnomeCanvasGroup *parent, ETableGroupLeaf *etgl, int col, int ascending) { - etgl->subset = E_TABLE_SUBSET_VARIABLE(e_table_sorted_variable_new(model, col, ascending, e_table_header_get_column(full_header, col)->compare)); + etgl->subset = E_TABLE_SUBSET_VARIABLE(e_table_sorted_variable_new (model, col, ascending, e_table_header_get_column(full_header, col)->compare)); e_table_group_construct (parent, E_TABLE_GROUP (etgl), full_header, header, model); } @@ -79,14 +79,14 @@ e_table_group_leaf_new (GnomeCanvasGroup *parent, ETableHeader *full_heade static void etgl_row_selection (GtkObject *object, gint row, gboolean selected, ETableGroupLeaf *etgl) { - if ( row < E_TABLE_SUBSET(etgl->subset)->n_map ) + if (row < E_TABLE_SUBSET(etgl->subset)->n_map) e_table_group_row_selection (E_TABLE_GROUP(etgl), E_TABLE_SUBSET(etgl->subset)->map_table[row], selected); } static void etgl_reflow (GnomeCanvasItem *item, gint flags) { - e_canvas_item_request_parent_reflow(item); + e_canvas_item_request_parent_reflow (item); } static void @@ -94,10 +94,10 @@ etgl_realize (GnomeCanvasItem *item) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF(item); - if ( GNOME_CANVAS_ITEM_CLASS (etgl_parent_class)->realize ) + if (GNOME_CANVAS_ITEM_CLASS (etgl_parent_class)->realize) GNOME_CANVAS_ITEM_CLASS (etgl_parent_class)->realize (item); - etgl->item = E_TABLE_ITEM(gnome_canvas_item_new(GNOME_CANVAS_GROUP(etgl), + etgl->item = E_TABLE_ITEM(gnome_canvas_item_new (GNOME_CANVAS_GROUP(etgl), e_table_item_get_type (), "ETableHeader", E_TABLE_GROUP(etgl)->header, "ETableModel", etgl->subset, @@ -107,9 +107,9 @@ etgl_realize (GnomeCanvasItem *item) "width", etgl->width, NULL)); - gtk_signal_connect(GTK_OBJECT(etgl->item), "row_selection", + gtk_signal_connect (GTK_OBJECT(etgl->item), "row_selection", GTK_SIGNAL_FUNC(etgl_row_selection), etgl); - e_canvas_item_request_parent_reflow(item); + e_canvas_item_request_parent_reflow (item); } static int @@ -122,9 +122,9 @@ etgl_event (GnomeCanvasItem *item, GdkEvent *event) default: return_val = FALSE; } - if ( return_val == FALSE ) { - if ( GNOME_CANVAS_ITEM_CLASS(etgl_parent_class)->event ) - return GNOME_CANVAS_ITEM_CLASS(etgl_parent_class)->event(item, event); + if (return_val == FALSE){ + if (GNOME_CANVAS_ITEM_CLASS(etgl_parent_class)->event) + return GNOME_CANVAS_ITEM_CLASS(etgl_parent_class)->event (item, event); } return return_val; @@ -134,21 +134,21 @@ static void etgl_add (ETableGroup *etg, gint row) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg); - e_table_subset_variable_add(etgl->subset, row); + e_table_subset_variable_add (etgl->subset, row); } static gboolean etgl_remove (ETableGroup *etg, gint row) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg); - return e_table_subset_variable_remove(etgl->subset, row); + return e_table_subset_variable_remove (etgl->subset, row); } static void etgl_increment (ETableGroup *etg, gint position, gint amount) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg); - e_table_subset_variable_increment(etgl->subset, position, amount); + e_table_subset_variable_increment (etgl->subset, position, amount); } static void @@ -156,9 +156,9 @@ etgl_set_focus (ETableGroup *etg, EFocus direction, gint view_col) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg); if (direction == E_FOCUS_END) { - e_table_item_focus(etgl->item, view_col, e_table_model_row_count(E_TABLE_MODEL(etgl->subset)) - 1); + e_table_item_focus (etgl->item, view_col, e_table_model_row_count(E_TABLE_MODEL(etgl->subset)) - 1); } else { - e_table_item_focus(etgl->item, view_col, 0); + e_table_item_focus (etgl->item, view_col, 0); } } @@ -166,7 +166,7 @@ static gint etgl_get_focus_column (ETableGroup *etg) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg); - return e_table_item_get_focused_column(etgl->item); + return e_table_item_get_focused_column (etgl->item); } static void @@ -175,8 +175,8 @@ etgl_set_width (ETableGroup *etg, gdouble width) ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg); etgl->width = width; #if 0 - if ( etgl->item ) { - gnome_canvas_item_set(GNOME_CANVAS_ITEM(etgl->item), + if (etgl->item){ + gnome_canvas_item_set (GNOME_CANVAS_ITEM(etgl->item), "width", width, NULL); } @@ -187,7 +187,7 @@ static gdouble etgl_get_width (ETableGroup *etg) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg); - gtk_object_get(GTK_OBJECT(etgl->item), + gtk_object_get (GTK_OBJECT(etgl->item), "width", &etgl->width, NULL); return etgl->width; @@ -198,8 +198,8 @@ etgl_get_height (ETableGroup *etg) { ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg); gdouble height; - if ( etgl->item ) - gtk_object_get(GTK_OBJECT(etgl->item), + if (etgl->item) + gtk_object_get (GTK_OBJECT(etgl->item), "height", &height, NULL); else @@ -214,15 +214,15 @@ etgl_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) switch (arg_id) { case ARG_FROZEN: - if ( GTK_VALUE_BOOL (*arg) ) + if (GTK_VALUE_BOOL (*arg)) etg->frozen = TRUE; else { etg->frozen = FALSE; } break; case ARG_WIDTH: - if ( E_TABLE_GROUP_CLASS(GTK_OBJECT(etg)->klass)->set_width ) - E_TABLE_GROUP_CLASS(GTK_OBJECT(etg)->klass)->set_width(etg, GTK_VALUE_DOUBLE (*arg)); + if (E_TABLE_GROUP_CLASS(GTK_OBJECT(etg)->klass)->set_width) + E_TABLE_GROUP_CLASS(GTK_OBJECT(etg)->klass)->set_width (etg, GTK_VALUE_DOUBLE (*arg)); break; default: break; @@ -239,14 +239,14 @@ etgl_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) GTK_VALUE_BOOL (*arg) = etg->frozen; break; case ARG_HEIGHT: - if ( E_TABLE_GROUP_CLASS(GTK_OBJECT(etg)->klass)->get_height ) - GTK_VALUE_DOUBLE (*arg) = E_TABLE_GROUP_CLASS(GTK_OBJECT(etg)->klass)->get_height(etg); + if (E_TABLE_GROUP_CLASS(GTK_OBJECT(etg)->klass)->get_height) + GTK_VALUE_DOUBLE (*arg) = E_TABLE_GROUP_CLASS(GTK_OBJECT(etg)->klass)->get_height (etg); else arg->type = GTK_TYPE_INVALID; break; case ARG_WIDTH: - if ( E_TABLE_GROUP_CLASS(GTK_OBJECT(etg)->klass)->get_width ) - GTK_VALUE_DOUBLE (*arg) = E_TABLE_GROUP_CLASS(GTK_OBJECT(etg)->klass)->get_width(etg); + if (E_TABLE_GROUP_CLASS(GTK_OBJECT(etg)->klass)->get_width) + GTK_VALUE_DOUBLE (*arg) = E_TABLE_GROUP_CLASS(GTK_OBJECT(etg)->klass)->get_width (etg); else arg->type = GTK_TYPE_INVALID; break; @@ -260,7 +260,7 @@ static void etgl_class_init (GtkObjectClass *object_class) { GnomeCanvasItemClass *item_class = (GnomeCanvasItemClass *) object_class; - ETableGroupClass *e_group_class = E_TABLE_GROUP_CLASS( object_class ); + ETableGroupClass *e_group_class = E_TABLE_GROUP_CLASS(object_class); object_class->destroy = etgl_destroy; object_class->set_arg = etgl_set_arg; @@ -298,7 +298,7 @@ etgl_init (GtkObject *object) etgl->subset = NULL; etgl->item = NULL; - e_canvas_item_set_reflow_callback(GNOME_CANVAS_ITEM(object), etgl_reflow); + e_canvas_item_set_reflow_callback (GNOME_CANVAS_ITEM(object), etgl_reflow); } E_MAKE_TYPE (e_table_group_leaf, "ETableGroupLeaf", ETableGroupLeaf, etgl_class_init, etgl_init, PARENT_TYPE); diff --git a/widgets/e-table/e-table-group.c b/widgets/e-table/e-table-group.c index 3729f41293..9d4b899dc2 100644 --- a/widgets/e-table/e-table-group.c +++ b/widgets/e-table/e-table-group.c @@ -3,7 +3,7 @@ * E-Table-Group.c: Implements the grouping objects for elements on a table * * Author: - * Miguel de Icaza (miguel@gnu.org() + * Miguel de Icaza (miguel@gnu.org () * * Copyright 1999, Helix Code, Inc. */ @@ -69,13 +69,13 @@ static void etg_destroy (GtkObject *object) { ETableGroup *etg = E_TABLE_GROUP(object); - if ( etg->header ) - gtk_object_unref(GTK_OBJECT(etg->header)); - if ( etg->full_header ) - gtk_object_unref(GTK_OBJECT(etg->full_header)); - if ( etg->model ) - gtk_object_unref(GTK_OBJECT(etg->model)); - if ( GTK_OBJECT_CLASS (etg_parent_class)->destroy ) + if (etg->header) + gtk_object_unref (GTK_OBJECT(etg->header)); + if (etg->full_header) + gtk_object_unref (GTK_OBJECT(etg->full_header)); + if (etg->model) + gtk_object_unref (GTK_OBJECT(etg->model)); + if (GTK_OBJECT_CLASS (etg_parent_class)->destroy) GTK_OBJECT_CLASS (etg_parent_class)->destroy (object); } @@ -91,17 +91,17 @@ e_table_group_new (GnomeCanvasGroup *parent, g_return_val_if_fail (model != NULL, NULL); - column = e_xml_get_integer_prop_by_name(rules, "column"); - ascending = e_xml_get_integer_prop_by_name(rules, "ascending"); + column = e_xml_get_integer_prop_by_name (rules, "column"); + ascending = e_xml_get_integer_prop_by_name (rules, "ascending"); - if(rules && !xmlStrcmp(rules->name, "group")) { + if (rules && !xmlStrcmp(rules->name, "group")) { ETableCol *col; - if ( column > e_table_header_count(full_header) ) - return e_table_group_leaf_new(parent, full_header, header, model, column, ascending); - col = e_table_header_get_columns(full_header)[column]; - return e_table_group_container_new(parent, full_header, header, model, col, ascending, rules->childs); + if (column > e_table_header_count (full_header)) + return e_table_group_leaf_new (parent, full_header, header, model, column, ascending); + col = e_table_header_get_columns (full_header)[column]; + return e_table_group_container_new (parent, full_header, header, model, col, ascending, rules->childs); } else { - return e_table_group_leaf_new(parent, full_header, header, model, column, ascending); + return e_table_group_leaf_new (parent, full_header, header, model, column, ascending); } return NULL; } @@ -114,11 +114,11 @@ e_table_group_construct (GnomeCanvasGroup *parent, ETableModel *model) { etg->full_header = full_header; - gtk_object_ref(GTK_OBJECT(etg->full_header)); + gtk_object_ref (GTK_OBJECT(etg->full_header)); etg->header = header; - gtk_object_ref(GTK_OBJECT(etg->header)); + gtk_object_ref (GTK_OBJECT(etg->header)); etg->model = model; - gtk_object_ref(GTK_OBJECT(etg->model)); + gtk_object_ref (GTK_OBJECT(etg->model)); gnome_canvas_item_constructv (GNOME_CANVAS_ITEM (etg), parent, 0, NULL); } @@ -129,7 +129,7 @@ e_table_group_add (ETableGroup *etg, g_return_if_fail (etg != NULL); g_return_if_fail (E_IS_TABLE_GROUP (etg)); - if ( ETG_CLASS (etg)->add ) + if (ETG_CLASS (etg)->add) ETG_CLASS (etg)->add (etg, row); } @@ -140,7 +140,7 @@ e_table_group_remove (ETableGroup *etg, g_return_val_if_fail (etg != NULL, FALSE); g_return_val_if_fail (E_IS_TABLE_GROUP (etg), FALSE); - if ( ETG_CLASS (etg)->remove ) + if (ETG_CLASS (etg)->remove) return ETG_CLASS (etg)->remove (etg, row); else return FALSE; @@ -152,7 +152,7 @@ e_table_group_get_count (ETableGroup *etg) g_return_val_if_fail (etg != NULL, 0); g_return_val_if_fail (E_IS_TABLE_GROUP (etg), 0); - if ( ETG_CLASS (etg)->get_count ) + if (ETG_CLASS (etg)->get_count) return ETG_CLASS (etg)->get_count (etg); else return 0; @@ -166,7 +166,7 @@ e_table_group_increment (ETableGroup *etg, g_return_if_fail (etg != NULL); g_return_if_fail (E_IS_TABLE_GROUP (etg)); - if ( ETG_CLASS (etg)->increment ) + if (ETG_CLASS (etg)->increment) ETG_CLASS (etg)->increment (etg, position, amount); } @@ -178,7 +178,7 @@ e_table_group_set_focus (ETableGroup *etg, g_return_if_fail (etg != NULL); g_return_if_fail (E_IS_TABLE_GROUP (etg)); - if ( ETG_CLASS (etg)->set_focus ) + if (ETG_CLASS (etg)->set_focus) ETG_CLASS (etg)->set_focus (etg, direction, row); } @@ -188,7 +188,7 @@ e_table_group_get_focus (ETableGroup *etg) g_return_val_if_fail (etg != NULL, FALSE); g_return_val_if_fail (E_IS_TABLE_GROUP (etg), FALSE); - if ( ETG_CLASS (etg)->get_focus ) + if (ETG_CLASS (etg)->get_focus) return ETG_CLASS (etg)->get_focus (etg); else return FALSE; @@ -200,7 +200,7 @@ e_table_group_get_focus_column (ETableGroup *etg) g_return_val_if_fail (etg != NULL, FALSE); g_return_val_if_fail (E_IS_TABLE_GROUP (etg), FALSE); - if ( ETG_CLASS (etg)->get_focus_column ) + if (ETG_CLASS (etg)->get_focus_column) return ETG_CLASS (etg)->get_focus_column (etg); else return FALSE; @@ -212,7 +212,7 @@ e_table_group_get_ecol (ETableGroup *etg) g_return_val_if_fail (etg != NULL, NULL); g_return_val_if_fail (E_IS_TABLE_GROUP (etg), NULL); - if ( ETG_CLASS (etg)->get_ecol ) + if (ETG_CLASS (etg)->get_ecol) return ETG_CLASS (etg)->get_ecol (etg); else return NULL; @@ -253,21 +253,21 @@ etg_event (GnomeCanvasItem *item, GdkEvent *event) default: return_val = FALSE; } - if ( return_val == FALSE ) { - if ( GNOME_CANVAS_ITEM_CLASS(etg_parent_class)->event ) - return GNOME_CANVAS_ITEM_CLASS(etg_parent_class)->event(item, event); + if (return_val == FALSE){ + if (GNOME_CANVAS_ITEM_CLASS(etg_parent_class)->event) + return GNOME_CANVAS_ITEM_CLASS(etg_parent_class)->event (item, event); } return return_val; } static void -etg_thaw(ETableGroup *etg) +etg_thaw (ETableGroup *etg) { g_return_if_fail (etg != NULL); g_return_if_fail (E_IS_TABLE_GROUP (etg)); - if ( ETG_CLASS (etg)->thaw ) + if (ETG_CLASS (etg)->thaw) ETG_CLASS (etg)->thaw (etg); } @@ -278,16 +278,16 @@ etg_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) switch (arg_id) { case ARG_FROZEN: - if ( GTK_VALUE_BOOL (*arg) ) + if (GTK_VALUE_BOOL (*arg)) etg->frozen = TRUE; else { etg->frozen = FALSE; - etg_thaw(etg); + etg_thaw (etg); } break; case ARG_WIDTH: - if ( ETG_CLASS(etg)->set_width ) - ETG_CLASS(etg)->set_width(etg, GTK_VALUE_DOUBLE (*arg)); + if (ETG_CLASS(etg)->set_width) + ETG_CLASS(etg)->set_width (etg, GTK_VALUE_DOUBLE (*arg)); break; default: break; @@ -304,14 +304,14 @@ etg_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) GTK_VALUE_BOOL (*arg) = etg->frozen; break; case ARG_HEIGHT: - if ( ETG_CLASS(etg)->get_height ) - GTK_VALUE_DOUBLE (*arg) = ETG_CLASS(etg)->get_height(etg); + if (ETG_CLASS(etg)->get_height) + GTK_VALUE_DOUBLE (*arg) = ETG_CLASS(etg)->get_height (etg); else arg->type = GTK_TYPE_INVALID; break; case ARG_WIDTH: - if ( ETG_CLASS(etg)->get_width ) - GTK_VALUE_DOUBLE (*arg) = ETG_CLASS(etg)->get_width(etg); + if (ETG_CLASS(etg)->get_width) + GTK_VALUE_DOUBLE (*arg) = ETG_CLASS(etg)->get_width (etg); else arg->type = GTK_TYPE_INVALID; break; diff --git a/widgets/e-table/e-table-header-item.c b/widgets/e-table/e-table-header-item.c index 5faa0d7da8..b21a260c8f 100644 --- a/widgets/e-table/e-table-header-item.c +++ b/widgets/e-table/e-table-header-item.c @@ -76,10 +76,10 @@ ethi_destroy (GtkObject *object){ ethi_drop_table_header (ethi); - if ( ethi->sort_info ) { - if ( ethi->sort_info_changed_id ) - gtk_signal_disconnect(GTK_OBJECT(ethi->sort_info), ethi->sort_info_changed_id); - gtk_object_unref(GTK_OBJECT(ethi->sort_info)); + if (ethi->sort_info){ + if (ethi->sort_info_changed_id) + gtk_signal_disconnect (GTK_OBJECT(ethi->sort_info), ethi->sort_info_changed_id); + gtk_object_unref (GTK_OBJECT(ethi->sort_info)); } if (GTK_OBJECT_CLASS (ethi_parent_class)->destroy) @@ -94,12 +94,12 @@ ethi_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, int flags if (GNOME_CANVAS_ITEM_CLASS (ethi_parent_class)->update) (*GNOME_CANVAS_ITEM_CLASS (ethi_parent_class)->update)(item, affine, clip_path, flags); - if ( item->x1 != ethi->x1 || + if (item->x1 != ethi->x1 || item->y1 != ethi->y1 || item->x2 != ethi->x1 + ethi->width || - item->y2 != ethi->y1 + ethi->height ) + item->y2 != ethi->y1 + ethi->height) { - 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); item->x1 = ethi->x1; item->y1 = ethi->y1; item->x2 = ethi->x1 + ethi->width; @@ -107,7 +107,7 @@ ethi_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, int flags gnome_canvas_group_child_bounds (GNOME_CANVAS_GROUP (item->parent), item); } - 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); } static void @@ -121,7 +121,7 @@ ethi_font_load (ETableHeaderItem *ethi, char *font) ethi->font = gdk_font_load ("-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-iso8859-1"); ethi->height = ethi->font->ascent + ethi->font->descent + PADDING; - if ( ethi->height < MIN_ARROW_SIZE + 4 + PADDING ) + if (ethi->height < MIN_ARROW_SIZE + 4 + PADDING) ethi->height = MIN_ARROW_SIZE + 4 + PADDING; } @@ -207,14 +207,14 @@ ethi_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) break; case ARG_SORT_INFO: - if ( ethi->sort_info ) { - if ( ethi->sort_info_changed_id ) - gtk_signal_disconnect(GTK_OBJECT(ethi->sort_info), ethi->sort_info_changed_id); - gtk_object_unref(GTK_OBJECT(ethi->sort_info)); + if (ethi->sort_info){ + if (ethi->sort_info_changed_id) + gtk_signal_disconnect (GTK_OBJECT(ethi->sort_info), ethi->sort_info_changed_id); + gtk_object_unref (GTK_OBJECT(ethi->sort_info)); } ethi->sort_info = GTK_VALUE_POINTER (*arg); - gtk_object_ref(GTK_OBJECT(ethi->sort_info)); - ethi->sort_info_changed_id = gtk_signal_connect(GTK_OBJECT(ethi->sort_info), "sort_info_changed", + gtk_object_ref (GTK_OBJECT(ethi->sort_info)); + ethi->sort_info_changed_id = gtk_signal_connect (GTK_OBJECT(ethi->sort_info), "sort_info_changed", GTK_SIGNAL_FUNC(ethi_sort_info_changed), ethi); break; @@ -281,7 +281,7 @@ ethi_add_drop_marker (ETableHeaderItem *ethi, int col) x = e_table_header_col_diff (ethi->eth, 0, col); - if ( col > 0 ) + if (col > 0) x += ethi->group_indent_width; points->coords [0] = ethi->x1 + x - 5; @@ -362,13 +362,13 @@ ethi_drag_motion (GtkObject *canvas, GdkDragContext *context, return FALSE; gdk_drag_status (context, 0, time); - if (GTK_WIDGET(canvas) == gtk_drag_get_source_widget(context)) { + if (GTK_WIDGET(canvas) == gtk_drag_get_source_widget (context)) { if ((x >= ethi->x1) && (x <= (ethi->x1 + ethi->width)) && (y >= ethi->y1) && (y <= (ethi->y1 + ethi->height))){ int col; col = ethi_find_col_by_x (ethi, x); - if ( col < ethi->eth->frozen_count ) + if (col < ethi->eth->frozen_count) col = ethi->eth->frozen_count; if (col != -1){ @@ -394,10 +394,10 @@ ethi_drag_end (GtkWidget *canvas, GdkDragContext *context, ETableHeaderItem *eth if (ethi->drag_col == -1) return; - if (canvas == gtk_drag_get_source_widget(context)) { + if (canvas == gtk_drag_get_source_widget (context)) { if (context->action == 0) { ethi_request_redraw (ethi); - e_table_header_remove(ethi->eth, ethi->drag_col); + e_table_header_remove (ethi->eth, ethi->drag_col); } ethi_remove_drop_marker (ethi); ethi_remove_destroy_marker (ethi); @@ -418,26 +418,26 @@ ethi_drag_drop (GtkWidget *canvas, if (ethi->drag_col == -1) return FALSE; - if (GTK_WIDGET(canvas) == gtk_drag_get_source_widget(context)) { + if (GTK_WIDGET(canvas) == gtk_drag_get_source_widget (context)) { if ((x >= ethi->x1) && (x <= (ethi->x1 + ethi->width)) && (y >= ethi->y1) && (y <= (ethi->y1 + ethi->height))){ int col; col = ethi_find_col_by_x (ethi, x); - if ( col < ethi->eth->frozen_count ) + if (col < ethi->eth->frozen_count) col = ethi->eth->frozen_count; - ethi_add_drop_marker(ethi, col); + ethi_add_drop_marker (ethi, col); if (col != -1) { if (col != ethi->drag_col) { ethi_request_redraw (ethi); - e_table_header_move(ethi->eth, ethi->drag_col, col); + e_table_header_move (ethi->eth, ethi->drag_col, col); } successful = TRUE; } } } - gtk_drag_finish(context, successful, successful, time); + gtk_drag_finish (context, successful, successful, time); return successful; } @@ -447,7 +447,7 @@ ethi_drag_leave (GtkWidget *widget, GdkDragContext *context, guint time, ETableH if (ethi->drag_col == -1) return; - if (widget == gtk_drag_get_source_widget(context)) { + if (widget == gtk_drag_get_source_widget (context)) { ethi_remove_drop_marker (ethi); ethi_add_destroy_marker (ethi); } @@ -542,16 +542,16 @@ draw_button (ETableHeaderItem *ethi, ETableCol *col, gdk_gc_set_clip_rectangle (ethi->gc, &clip); - if ( col->is_pixbuf ) { - xtra = (clip.width - gdk_pixbuf_get_width(col->pixbuf))/2; + if (col->is_pixbuf){ + xtra = (clip.width - gdk_pixbuf_get_width (col->pixbuf))/2; xtra += PADDING / 2; - gdk_pixbuf_render_to_drawable_alpha(col->pixbuf, + gdk_pixbuf_render_to_drawable_alpha (col->pixbuf, drawable, 0, 0, - x + xtra, y + (clip.height - gdk_pixbuf_get_height(col->pixbuf)) / 2, - gdk_pixbuf_get_width(col->pixbuf), gdk_pixbuf_get_height(col->pixbuf), + x + xtra, y + (clip.height - gdk_pixbuf_get_height (col->pixbuf)) / 2, + gdk_pixbuf_get_width (col->pixbuf), gdk_pixbuf_get_height(col->pixbuf), GDK_PIXBUF_ALPHA_FULL, 128, GDK_RGB_DITHER_NORMAL, 0, 0); @@ -571,12 +571,12 @@ draw_button (ETableHeaderItem *ethi, ETableCol *col, col->text, strlen (col->text)); } - switch ( arrow ) { + switch (arrow){ case E_TABLE_COL_ARROW_NONE: break; case E_TABLE_COL_ARROW_UP: case E_TABLE_COL_ARROW_DOWN: - gtk_paint_arrow (gtk_widget_get_style(GTK_WIDGET(GNOME_CANVAS_ITEM(ethi)->canvas)), + gtk_paint_arrow (gtk_widget_get_style (GTK_WIDGET(GNOME_CANVAS_ITEM(ethi)->canvas)), drawable, GTK_STATE_NORMAL, GTK_SHADOW_IN, @@ -602,7 +602,7 @@ ethi_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int width const int cols = e_table_header_count (ethi->eth); int x1, x2; int col; - GHashTable *arrows = g_hash_table_new(NULL, NULL); + GHashTable *arrows = g_hash_table_new (NULL, NULL); xmlNode *node; gint group_indent = 0; @@ -613,21 +613,21 @@ ethi_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int width if (ethi->sort_info) { xmlNode *grouping; - gtk_object_get(GTK_OBJECT(ethi->sort_info), + gtk_object_get (GTK_OBJECT(ethi->sort_info), "grouping", &grouping, NULL); - for (node = grouping->childs; node && strcmp(node->name, "leaf"); node = node->childs) { + for (node = grouping->childs; node && strcmp (node->name, "leaf"); node = node->childs) { group_indent ++; - g_hash_table_insert(arrows, - (gpointer) e_xml_get_integer_prop_by_name(node, "column"), - (gpointer) (e_xml_get_integer_prop_by_name(node, "ascending") ? + g_hash_table_insert (arrows, + (gpointer) e_xml_get_integer_prop_by_name (node, "column"), + (gpointer) (e_xml_get_integer_prop_by_name (node, "ascending") ? E_TABLE_COL_ARROW_DOWN : E_TABLE_COL_ARROW_UP)); } - if ( node ) - g_hash_table_insert(arrows, - (gpointer) e_xml_get_integer_prop_by_name(node, "column"), - (gpointer) (e_xml_get_integer_prop_by_name(node, "ascending") ? + if (node) + g_hash_table_insert (arrows, + (gpointer) e_xml_get_integer_prop_by_name (node, "column"), + (gpointer) (e_xml_get_integer_prop_by_name (node, "ascending") ? E_TABLE_COL_ARROW_DOWN : E_TABLE_COL_ARROW_UP)); } @@ -658,9 +658,9 @@ ethi_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int width draw_button (ethi, ecol, drawable, gc, GTK_WIDGET (canvas)->style, x1 - x, ethi->y1 - y, x2 - x1, ethi->height, - (ETableColArrow) g_hash_table_lookup(arrows, (gpointer) ecol->col_idx) ); + (ETableColArrow) g_hash_table_lookup (arrows, (gpointer) ecol->col_idx)); } - g_hash_table_destroy(arrows); + g_hash_table_destroy (arrows); } static double @@ -690,7 +690,7 @@ is_pointer_on_division (ETableHeaderItem *ethi, int pos, int *the_total, int *re total += ecol->width; - if ((total - TOLERANCE < pos ) && (pos < total + TOLERANCE)){ + if ((total - TOLERANCE < pos)&& (pos < total + TOLERANCE)){ if (return_col) *return_col = col; if (the_total) @@ -706,7 +706,7 @@ is_pointer_on_division (ETableHeaderItem *ethi, int pos, int *the_total, int *re return FALSE; } -#define convert(c,sx,sy,x,y) gnome_canvas_w2c (c,sx,sy,x,y) +#define convert (c,sx,sy,x,y) gnome_canvas_w2c (c,sx,sy,x,y) static void set_cursor (ETableHeaderItem *ethi, int pos) @@ -767,11 +767,11 @@ ethi_start_drag (ETableHeaderItem *ethi, GdkEvent *event) int col_width; GdkPixmap *pixmap; GdkGC *gc; - GHashTable *arrows = g_hash_table_new(NULL, NULL); + GHashTable *arrows = g_hash_table_new (NULL, NULL); xmlNode *node; ethi->drag_col = ethi_find_col_by_x (ethi, event->motion.x); - if ( ethi->drag_col < ethi->eth->frozen_count && ethi->drag_col >= 0 ) { + if (ethi->drag_col < ethi->eth->frozen_count && ethi->drag_col >= 0){ ethi->maybe_drag = FALSE; ethi->drag_col = -1; } @@ -781,20 +781,20 @@ ethi_start_drag (ETableHeaderItem *ethi, GdkEvent *event) if (ethi->sort_info) { xmlNode *grouping; - gtk_object_get(GTK_OBJECT(ethi->sort_info), + gtk_object_get (GTK_OBJECT(ethi->sort_info), "grouping", &grouping, NULL); - for (node = grouping->childs; node && strcmp(node->name, "leaf"); node = node->childs) { - g_hash_table_insert(arrows, - (gpointer) e_xml_get_integer_prop_by_name(node, "column"), - (gpointer) (e_xml_get_integer_prop_by_name(node, "ascending") ? + for (node = grouping->childs; node && strcmp (node->name, "leaf"); node = node->childs) { + g_hash_table_insert (arrows, + (gpointer) e_xml_get_integer_prop_by_name (node, "column"), + (gpointer) (e_xml_get_integer_prop_by_name (node, "ascending") ? E_TABLE_COL_ARROW_DOWN : E_TABLE_COL_ARROW_UP)); } - if ( node ) - g_hash_table_insert(arrows, - (gpointer) e_xml_get_integer_prop_by_name(node, "column"), - (gpointer) (e_xml_get_integer_prop_by_name(node, "ascending") ? + if (node) + g_hash_table_insert (arrows, + (gpointer) e_xml_get_integer_prop_by_name (node, "column"), + (gpointer) (e_xml_get_integer_prop_by_name (node, "ascending") ? E_TABLE_COL_ARROW_DOWN : E_TABLE_COL_ARROW_UP)); } @@ -807,22 +807,22 @@ ethi_start_drag (ETableHeaderItem *ethi, GdkEvent *event) col_width = ethi->resize_width; else col_width = ecol->width; - pixmap = gdk_pixmap_new(widget->window, col_width, ethi->height, -1); + pixmap = gdk_pixmap_new (widget->window, col_width, ethi->height, -1); gc = widget->style->bg_gc [GTK_STATE_ACTIVE]; draw_button (ethi, ecol, pixmap, gc, widget->style, 0, 0, col_width, ethi->height, - (ETableColArrow) g_hash_table_lookup(arrows, (gpointer) ecol->col_idx) ); + (ETableColArrow) g_hash_table_lookup (arrows, (gpointer) ecol->col_idx)); gtk_drag_set_icon_pixmap (context, - gdk_window_get_colormap(widget->window), + gdk_window_get_colormap (widget->window), pixmap, NULL, col_width / 2, ethi->height / 2); - gdk_pixmap_unref(pixmap); + gdk_pixmap_unref (pixmap); ethi->maybe_drag = FALSE; - g_hash_table_destroy(arrows); + g_hash_table_destroy (arrows); } /* @@ -930,33 +930,33 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) xmlNode *node; xmlNode *grouping; - gtk_object_get(GTK_OBJECT(ethi->sort_info), + gtk_object_get (GTK_OBJECT(ethi->sort_info), "grouping", &grouping, NULL); - col = e_table_header_get_column(ethi->eth, ethi_find_col_by_x (ethi, e->button.x)); + col = e_table_header_get_column (ethi->eth, ethi_find_col_by_x (ethi, e->button.x)); model_col = col->col_idx; - for (node = grouping->childs; node->childs && strcmp(node->name, "leaf"); node = node->childs) { - if ( model_col == e_xml_get_integer_prop_by_name(node, "column") ) { - int ascending = e_xml_get_integer_prop_by_name(node, "ascending"); + for (node = grouping->childs; node->childs && strcmp (node->name, "leaf"); node = node->childs) { + if (model_col == e_xml_get_integer_prop_by_name (node, "column")){ + int ascending = e_xml_get_integer_prop_by_name (node, "ascending"); ascending = ! ascending; - e_xml_set_integer_prop_by_name(node, "ascending", ascending); + e_xml_set_integer_prop_by_name (node, "ascending", ascending); break; } } - if ( !node ) { + if (!node){ } - if ( node && !strcmp(node->name, "leaf") ) { - if ( model_col == e_xml_get_integer_prop_by_name(node, "column") ) { - int ascending = e_xml_get_integer_prop_by_name(node, "ascending"); + if (node && !strcmp (node->name, "leaf")){ + if (model_col == e_xml_get_integer_prop_by_name (node, "column")){ + int ascending = e_xml_get_integer_prop_by_name (node, "ascending"); ascending = ! ascending; - e_xml_set_integer_prop_by_name(node, "ascending", ascending); + e_xml_set_integer_prop_by_name (node, "ascending", ascending); } else { - e_xml_set_integer_prop_by_name(node, "ascending", 1); - e_xml_set_integer_prop_by_name(node, "column", model_col); + e_xml_set_integer_prop_by_name (node, "ascending", 1); + e_xml_set_integer_prop_by_name (node, "column", model_col); } } - e_table_sort_info_changed(ethi->sort_info); + e_table_sort_info_changed (ethi->sort_info); } if (needs_ungrab) gnome_canvas_item_ungrab (item, e->button.time); diff --git a/widgets/e-table/e-table-header.c b/widgets/e-table/e-table-header.c index 8a646381e8..5c5632cdc0 100644 --- a/widgets/e-table/e-table-header.c +++ b/widgets/e-table/e-table-header.c @@ -330,9 +330,9 @@ e_table_header_col_diff (ETableHeader *eth, int start_col, int end_col) g_return_val_if_fail (E_IS_TABLE_HEADER (eth), 0); { - if ( start_col < 0 ) + if (start_col < 0) start_col = 0; - if ( end_col > eth->col_count ) + if (end_col > eth->col_count) end_col = eth->col_count - 1; total = 0; @@ -354,22 +354,22 @@ e_table_header_set_frozen_columns (ETableHeader *eth, int idx) /* Forget model-view here. Really, this information belongs in the view anyway. */ #if 0 static void -set_arrows(ETableHeader *eth, ETableHeaderSortInfo info) +set_arrows (ETableHeader *eth, ETableHeaderSortInfo info) { ETableCol *col; for (col = eth->columns, i = 0; i < eth->col_count; i++, col++) { - if ( col->col_idx == info.model_col ) - e_table_column_set_arrow(col, info.ascending ? E_TABLE_COL_ARROW_DOWN : E_TABLE_COL_ARROW_UP); + if (col->col_idx == info.model_col) + e_table_column_set_arrow (col, info.ascending ? E_TABLE_COL_ARROW_DOWN : E_TABLE_COL_ARROW_UP); } } static void -unset_arrows(ETableHeader *eth, ETableHeaderSortInfo info) +unset_arrows (ETableHeader *eth, ETableHeaderSortInfo info) { ETableCol *col; for (col = eth->columns, i = 0; i < eth->col_count; i++, col++) { - if ( col->col_idx == info.model_col ) - e_table_column_set_arrow(col, E_TABLE_COL_ARROW_NONE); + if (col->col_idx == info.model_col) + e_table_column_set_arrow (col, E_TABLE_COL_ARROW_NONE); } } @@ -389,9 +389,9 @@ e_table_header_set_sort_info (ETableHeader *eth, ETableHeaderSortInfo info) g_return_if_fail (eth != NULL); g_return_if_fail (E_IS_TABLE_HEADER (eth)); - unset_arrows(eth, eth->sort_info); + unset_arrows (eth, eth->sort_info); eth->sort_info = info; - set_arrows(eth, eth->sort_info); + set_arrows (eth, eth->sort_info); gtk_signal_emit (GTK_OBJECT (eth), eth_signals [STRUCTURE_CHANGE]); } @@ -436,8 +436,8 @@ e_table_header_grouping_insert (ETableHeader *eth, gint index, ETableHeaderSortI g_return_if_fail (eth != NULL); g_return_if_fail (E_IS_TABLE_HEADER (eth)); - eth->grouping = g_realloc(eth->grouping, sizeof(ETableHeaderSortInfo) * (eth->grouping_count + 1)); - memmove(eth->grouping + index + 1, eth->grouping + index, sizeof(ETableHeaderSortInfo) * (eth->grouping_count - index)); + eth->grouping = g_realloc (eth->grouping, sizeof(ETableHeaderSortInfo) * (eth->grouping_count + 1)); + memmove (eth->grouping + index + 1, eth->grouping + index, sizeof(ETableHeaderSortInfo) * (eth->grouping_count - index)); eth->grouping[index] = info; eth->grouping_count ++; @@ -451,8 +451,8 @@ e_table_header_grouping_delete (ETableHeader *eth, gint index) g_return_if_fail (eth != NULL); g_return_if_fail (E_IS_TABLE_HEADER (eth)); - memmove(eth->grouping + index, eth->grouping + index + 1, sizeof(ETableHeaderSortInfo) * (eth->grouping_count - index)); - eth->grouping = g_realloc(eth->grouping, sizeof(ETableHeaderSortInfo) * (eth->grouping_count - 1)); + memmove (eth->grouping + index, eth->grouping + index + 1, sizeof(ETableHeaderSortInfo) * (eth->grouping_count - index)); + eth->grouping = g_realloc (eth->grouping, sizeof(ETableHeaderSortInfo) * (eth->grouping_count - 1)); eth->grouping_count --; @@ -467,14 +467,14 @@ e_table_header_grouping_move (ETableHeader *eth, gint old_idx, gint new_idx) g_return_if_fail (eth != NULL); g_return_if_fail (E_IS_TABLE_HEADER (eth)); - if ( old_idx == new_idx ) + if (old_idx == new_idx) return; info = eth->grouping[old_idx]; - if ( old_idx < new_idx ) { - memmove(eth->grouping + old_idx, eth->grouping + old_idx + 1, sizeof(ETableHeaderSortInfo) * (new_idx - old_idx)); + if (old_idx < new_idx){ + memmove (eth->grouping + old_idx, eth->grouping + old_idx + 1, sizeof(ETableHeaderSortInfo) * (new_idx - old_idx)); } else { - memmove(eth->grouping + new_idx + 1, eth->grouping + new_idx, sizeof(ETableHeaderSortInfo) * (old_idx - new_idx)); + memmove (eth->grouping + new_idx + 1, eth->grouping + new_idx, sizeof(ETableHeaderSortInfo) * (old_idx - new_idx)); } eth->grouping[new_idx] = info; diff --git a/widgets/e-table/e-table-header.h b/widgets/e-table/e-table-header.h index cfd4d68d4a..77293ed067 100644 --- a/widgets/e-table/e-table-header.h +++ b/widgets/e-table/e-table-header.h @@ -87,7 +87,7 @@ void e_table_header_set_frozen_columns (ETableHeader *eth, int idx); int e_table_header_col_diff (ETableHeader *eth, int start_col, int end_col); -GList *e_table_header_get_selected_indexes(ETableHeader *eth); +GList *e_table_header_get_selected_indexes (ETableHeader *eth); #endif /* _E_TABLE_HEADER_H_ */ diff --git a/widgets/e-table/e-table-item.c b/widgets/e-table/e-table-item.c index 6b467a84c7..2640e2913f 100644 --- a/widgets/e-table/e-table-item.c +++ b/widgets/e-table/e-table-item.c @@ -581,7 +581,7 @@ eti_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) break; } eti->needs_redraw = 1; - gnome_canvas_item_request_update(GNOME_CANVAS_ITEM(eti)); + gnome_canvas_item_request_update (GNOME_CANVAS_ITEM(eti)); } static void @@ -934,25 +934,25 @@ eti_cursor_move (ETableItem *eti, gint row, gint column) static void eti_cursor_move_left (ETableItem *eti) { - eti_cursor_move(eti, eti->focused_row, eti->focused_col - 1); + eti_cursor_move (eti, eti->focused_row, eti->focused_col - 1); } static void eti_cursor_move_right (ETableItem *eti) { - eti_cursor_move(eti, eti->focused_row, eti->focused_col + 1); + eti_cursor_move (eti, eti->focused_row, eti->focused_col + 1); } static void eti_cursor_move_up (ETableItem *eti) { - eti_cursor_move(eti, eti->focused_row - 1, eti->focused_col); + eti_cursor_move (eti, eti->focused_row - 1, eti->focused_col); } static void eti_cursor_move_down (ETableItem *eti) { - eti_cursor_move(eti, eti->focused_row + 1, eti->focused_col); + eti_cursor_move (eti, eti->focused_row + 1, eti->focused_col); } static int @@ -1065,14 +1065,14 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) if (eti->focused_col > 0) eti_cursor_move_left (eti); else if (eti->focused_row > 0) - eti_cursor_move(eti, eti->focused_row - 1, eti->cols - 1); + eti_cursor_move (eti, eti->focused_row - 1, eti->cols - 1); else return_val = FALSE; } else { if (eti->focused_col < eti->cols - 1) eti_cursor_move_right (eti); else if (eti->focused_row < eti->rows - 1) - eti_cursor_move(eti, eti->focused_row + 1, 0); + eti_cursor_move (eti, eti->focused_row + 1, 0); else return_val = FALSE; } @@ -1240,7 +1240,7 @@ e_table_item_unfocus (ETableItem *eti) const int row = eti->focused_row; eti_request_region_redraw (eti, col, row, col, row, FOCUSED_BORDER); - while ( eti->selection ) { + while (eti->selection){ e_table_item_unselect_row (eti, GPOINTER_TO_INT(eti->selection->data)); } } diff --git a/widgets/e-table/e-table-model.c b/widgets/e-table/e-table-model.c index 660ec20f91..d75554f2d0 100644 --- a/widgets/e-table/e-table-model.c +++ b/widgets/e-table/e-table-model.c @@ -13,7 +13,7 @@ #define ETM_CLASS(e) ((ETableModelClass *)((GtkObject *)e)->klass) -#define PARENT_TYPE gtk_object_get_type(); +#define PARENT_TYPE gtk_object_get_type (); static GtkObjectClass *e_table_model_parent_class; @@ -166,7 +166,7 @@ e_table_model_get_type (void) (GtkClassInitFunc) NULL, }; - type = gtk_type_unique (gtk_object_get_type(), &info); + type = gtk_type_unique (gtk_object_get_type (), &info); } return type; diff --git a/widgets/e-table/e-table-simple.c b/widgets/e-table/e-table-simple.c index e90abfcc4f..e8c4d1debb 100644 --- a/widgets/e-table/e-table-simple.c +++ b/widgets/e-table/e-table-simple.c @@ -13,7 +13,7 @@ #include <config.h> #include "e-table-simple.h" -#define PARENT_TYPE e_table_model_get_type() +#define PARENT_TYPE e_table_model_get_type () static int simple_column_count (ETableModel *etm) diff --git a/widgets/e-table/e-table-sort-info.c b/widgets/e-table/e-table-sort-info.c index 1f465be99b..9e8d6e8228 100644 --- a/widgets/e-table/e-table-sort-info.c +++ b/widgets/e-table/e-table-sort-info.c @@ -14,7 +14,7 @@ #define ETM_CLASS(e) ((ETableSortInfoClass *)((GtkObject *)e)->klass) -#define PARENT_TYPE gtk_object_get_type(); +#define PARENT_TYPE gtk_object_get_type (); static GtkObjectClass *e_table_sort_info_parent_class; @@ -101,7 +101,7 @@ e_table_sort_info_get_type (void) (GtkClassInitFunc) NULL, }; - type = gtk_type_unique (gtk_object_get_type(), &info); + type = gtk_type_unique (gtk_object_get_type (), &info); } return type; diff --git a/widgets/e-table/e-table-sorted-variable.c b/widgets/e-table/e-table-sorted-variable.c index 907ec1cc4d..153295fc78 100644 --- a/widgets/e-table/e-table-sorted-variable.c +++ b/widgets/e-table/e-table-sorted-variable.c @@ -71,27 +71,27 @@ etsv_add (ETableSubsetVariable *etssv, GCompareFunc comp = etsv->compare; gint ascending = etsv->ascending; - void *val = e_table_model_value_at(etss->source, col, row); + void *val = e_table_model_value_at (etss->source, col, row); /* FIXME: binary search anyone? */ - for ( i = 0; i < etss->n_map; i++ ) { - int comp_val = (*comp)(val, e_table_model_value_at(etss->source, col, etss->map_table[i])); - if ( (ascending && comp_val < 0) || ((!ascending) && comp_val > 0) ) + for (i = 0; i < etss->n_map; i++){ + int comp_val = (*comp)(val, e_table_model_value_at (etss->source, col, etss->map_table[i])); + if ((ascending && comp_val < 0) || ((!ascending) && comp_val > 0)) break; - if ( comp_val == 0 ) - if ( (ascending && row < etss->map_table[i]) || ((!ascending) && row > etss->map_table[i]) ) + if (comp_val == 0) + if ((ascending && row < etss->map_table[i]) || ((!ascending) && row > etss->map_table[i])) break; } - if ( etss->n_map + 1 > etssv->n_vals_allocated ) { - etss->map_table = g_realloc(etss->map_table, (etssv->n_vals_allocated + INCREMENT_AMOUNT) * sizeof(int)); + if (etss->n_map + 1 > etssv->n_vals_allocated){ + etss->map_table = g_realloc (etss->map_table, (etssv->n_vals_allocated + INCREMENT_AMOUNT) * sizeof(int)); etssv->n_vals_allocated += INCREMENT_AMOUNT; } - if ( i < etss->n_map ) - memmove(etss->map_table + i + 1, etss->map_table + i, (etss->n_map - i) * sizeof(int)); + if (i < etss->n_map) + memmove (etss->map_table + i + 1, etss->map_table + i, (etss->n_map - i) * sizeof(int)); etss->map_table[i] = row; etss->n_map++; - if ( !etm->frozen ) - e_table_model_changed(etm); + if (!etm->frozen) + e_table_model_changed (etm); } ETableModel * @@ -122,8 +122,8 @@ e_table_sorted_variable_new (ETableModel *source, int col, int ascending, GCompa static void etsv_proxy_model_changed (ETableModel *etm, ETableSortedVariable *etsv) { - if ( !E_TABLE_MODEL(etsv)->frozen ) { - /* FIXME: do_resort(); */ + if (!E_TABLE_MODEL(etsv)->frozen){ + /* FIXME: do_resort (); */ } } @@ -131,9 +131,9 @@ static void etsv_proxy_model_row_changed (ETableModel *etm, int row, ETableSortedVariable *etsv) { ETableSubsetVariable *etssv = E_TABLE_SUBSET_VARIABLE(etsv); - if ( !E_TABLE_MODEL(etsv)->frozen ) { - if(e_table_subset_variable_remove(etssv, row)) - e_table_subset_variable_add(etssv, row); + if (!E_TABLE_MODEL(etsv)->frozen){ + if (e_table_subset_variable_remove(etssv, row)) + e_table_subset_variable_add (etssv, row); } } @@ -141,10 +141,10 @@ static void etsv_proxy_model_cell_changed (ETableModel *etm, int col, int row, ETableSortedVariable *etsv) { ETableSubsetVariable *etssv = E_TABLE_SUBSET_VARIABLE(etsv); - if ( !E_TABLE_MODEL(etsv)->frozen ) { - if ( col == etsv->sort_col ) { - if(e_table_subset_variable_remove(etssv, row)) - e_table_subset_variable_add(etssv, row); + if (!E_TABLE_MODEL(etsv)->frozen){ + if (col == etsv->sort_col){ + if (e_table_subset_variable_remove(etssv, row)) + e_table_subset_variable_add (etssv, row); } } } diff --git a/widgets/e-table/e-table-subset-variable.c b/widgets/e-table/e-table-subset-variable.c index 5a3e0f2ddf..35cd4f9deb 100644 --- a/widgets/e-table/e-table-subset-variable.c +++ b/widgets/e-table/e-table-subset-variable.c @@ -29,13 +29,13 @@ etssv_add (ETableSubsetVariable *etssv, ETableModel *etm = E_TABLE_MODEL(etssv); ETableSubset *etss = E_TABLE_SUBSET(etssv); - if ( etss->n_map + 1 > etssv->n_vals_allocated ) { - etss->map_table = g_realloc(etss->map_table, (etssv->n_vals_allocated + INCREMENT_AMOUNT) * sizeof(int)); + if (etss->n_map + 1 > etssv->n_vals_allocated){ + etss->map_table = g_realloc (etss->map_table, (etssv->n_vals_allocated + INCREMENT_AMOUNT) * sizeof(int)); etssv->n_vals_allocated += INCREMENT_AMOUNT; } etss->map_table[etss->n_map++] = row; - if ( !etm->frozen ) - e_table_model_changed(etm); + if (!etm->frozen) + e_table_model_changed (etm); } static gboolean @@ -46,12 +46,12 @@ etssv_remove (ETableSubsetVariable *etssv, ETableSubset *etss = E_TABLE_SUBSET(etssv); int i; - for ( i = 0; i < etss->n_map; i++ ) { + for (i = 0; i < etss->n_map; i++){ if (etss->map_table[i] == row) { - memmove(etss->map_table + i, etss->map_table + i + 1, (etss->n_map - i - 1) * sizeof(int)); + memmove (etss->map_table + i, etss->map_table + i + 1, (etss->n_map - i - 1) * sizeof(int)); etss->n_map --; - if ( !etm->frozen ) - e_table_model_changed(etm); + if (!etm->frozen) + e_table_model_changed (etm); return TRUE; } } @@ -74,7 +74,7 @@ ETableModel * e_table_subset_variable_construct (ETableSubsetVariable *etssv, ETableModel *source) { - if ( e_table_subset_construct(E_TABLE_SUBSET(etssv), source, 1) == NULL ) + if (e_table_subset_construct (E_TABLE_SUBSET(etssv), source, 1) == NULL) return NULL; E_TABLE_SUBSET(etssv)->n_map = 0; @@ -125,8 +125,8 @@ e_table_subset_variable_increment (ETableSubsetVariable *etssv, { int i; ETableSubset *etss = E_TABLE_SUBSET(etssv); - for ( i = 0; i < etss->n_map; i++ ) { - if ( etss->map_table[i] > position ) + for (i = 0; i < etss->n_map; i++){ + if (etss->map_table[i] > position) etss->map_table[i] += amount; } } @@ -136,9 +136,9 @@ e_table_subset_variable_set_allocation (ETableSubsetVariable *etssv, gint total) { ETableSubset *etss = E_TABLE_SUBSET(etssv); - if ( total <= 0 ) + if (total <= 0) total = 1; - if ( total > etss->n_map ) { - etss->map_table = g_realloc(etss->map_table, total * sizeof(int)); + if (total > etss->n_map){ + etss->map_table = g_realloc (etss->map_table, total * sizeof(int)); } } diff --git a/widgets/e-table/e-table-subset.c b/widgets/e-table/e-table-subset.c index b4473b87ef..b0c5671b65 100644 --- a/widgets/e-table/e-table-subset.c +++ b/widgets/e-table/e-table-subset.c @@ -128,14 +128,14 @@ E_MAKE_TYPE(e_table_subset, "ETableSubset", ETableSubset, etss_class_init, NULL, static void etss_proxy_model_changed (ETableModel *etm, ETableSubset *etss) { - if ( !E_TABLE_MODEL(etss)->frozen ) + if (!E_TABLE_MODEL(etss)->frozen) e_table_model_changed (E_TABLE_MODEL (etss)); } static void etss_proxy_model_row_changed (ETableModel *etm, int row, ETableSubset *etss) { - if ( !E_TABLE_MODEL(etss)->frozen ) { + if (!E_TABLE_MODEL(etss)->frozen){ const int n = etss->n_map; const int * const map_table = etss->map_table; int i; @@ -152,7 +152,7 @@ etss_proxy_model_row_changed (ETableModel *etm, int row, ETableSubset *etss) static void etss_proxy_model_cell_changed (ETableModel *etm, int col, int row, ETableSubset *etss) { - if ( !E_TABLE_MODEL(etss)->frozen ) { + if (!E_TABLE_MODEL(etss)->frozen){ const int n = etss->n_map; const int * const map_table = etss->map_table; int i; diff --git a/widgets/e-table/e-table-text-model.c b/widgets/e-table/e-table-text-model.c index 13d0071cc6..c047c75ae3 100644 --- a/widgets/e-table/e-table-text-model.c +++ b/widgets/e-table/e-table-text-model.c @@ -24,11 +24,11 @@ static void e_table_text_model_class_init (ETableTextModelClass *class); static void e_table_text_model_init (ETableTextModel *model); static void e_table_text_model_destroy (GtkObject *object); -static gchar *e_table_text_model_get_text(ETextModel *model); -static void e_table_text_model_set_text(ETextModel *model, gchar *text); -static void e_table_text_model_insert(ETextModel *model, gint postion, gchar *text); -static void e_table_text_model_insert_length(ETextModel *model, gint postion, gchar *text, gint length); -static void e_table_text_model_delete(ETextModel *model, gint postion, gint length); +static gchar *e_table_text_model_get_text (ETextModel *model); +static void e_table_text_model_set_text (ETextModel *model, gchar *text); +static void e_table_text_model_insert (ETextModel *model, gint postion, gchar *text); +static void e_table_text_model_insert_length (ETextModel *model, gint postion, gchar *text, gint length); +static void e_table_text_model_delete (ETextModel *model, gint postion, gint length); static GtkObject *parent_class; @@ -112,102 +112,102 @@ e_table_text_model_destroy (GtkObject *object) g_assert (!model->model || GTK_IS_OBJECT (model->model)); if (model->cell_changed_signal_id) - gtk_signal_disconnect(GTK_OBJECT(model->model), + gtk_signal_disconnect (GTK_OBJECT(model->model), model->cell_changed_signal_id); if (model->row_changed_signal_id) - gtk_signal_disconnect(GTK_OBJECT(model->model), + gtk_signal_disconnect (GTK_OBJECT(model->model), model->row_changed_signal_id); if (model->model) - gtk_object_unref(GTK_OBJECT(model->model)); + gtk_object_unref (GTK_OBJECT(model->model)); if (GTK_OBJECT_CLASS (parent_class)->destroy) (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); } static gchar * -e_table_text_model_get_text(ETextModel *text_model) +e_table_text_model_get_text (ETextModel *text_model) { ETableTextModel *model = E_TABLE_TEXT_MODEL(text_model); - if ( model->model ) - return (gchar *)e_table_model_value_at(model->model, model->model_col, model->row); + if (model->model) + return (gchar *)e_table_model_value_at (model->model, model->model_col, model->row); else return ""; } static void -e_table_text_model_set_text(ETextModel *text_model, gchar *text) +e_table_text_model_set_text (ETextModel *text_model, gchar *text) { ETableTextModel *model = E_TABLE_TEXT_MODEL(text_model); - if ( model->model ) - e_table_model_set_value_at(model->model, model->model_col, model->row, (void *) text); + if (model->model) + e_table_model_set_value_at (model->model, model->model_col, model->row, (void *) text); } static void -e_table_text_model_insert(ETextModel *text_model, gint position, gchar *text) +e_table_text_model_insert (ETextModel *text_model, gint position, gchar *text) { ETableTextModel *model = E_TABLE_TEXT_MODEL(text_model); - if ( model->model ) { - gchar *temp = (gchar *)e_table_model_value_at(model->model, model->model_col, model->row); - temp = g_strdup_printf("%.*s%s%s", position, temp, text, temp + position); - e_table_model_set_value_at(model->model, model->model_col, model->row, temp); - g_free(temp); + if (model->model){ + gchar *temp = (gchar *)e_table_model_value_at (model->model, model->model_col, model->row); + temp = g_strdup_printf ("%.*s%s%s", position, temp, text, temp + position); + e_table_model_set_value_at (model->model, model->model_col, model->row, temp); + g_free (temp); } } static void -e_table_text_model_insert_length(ETextModel *text_model, gint position, gchar *text, gint length) +e_table_text_model_insert_length (ETextModel *text_model, gint position, gchar *text, gint length) { ETableTextModel *model = E_TABLE_TEXT_MODEL(text_model); - if ( model->model ) { - gchar *temp = (gchar *)e_table_model_value_at(model->model, model->model_col, model->row); - temp = g_strdup_printf("%.*s%.*s%s", position, temp, length, text, temp + position); - e_table_model_set_value_at(model->model, model->model_col, model->row, temp); - g_free(temp); + if (model->model){ + gchar *temp = (gchar *)e_table_model_value_at (model->model, model->model_col, model->row); + temp = g_strdup_printf ("%.*s%.*s%s", position, temp, length, text, temp + position); + e_table_model_set_value_at (model->model, model->model_col, model->row, temp); + g_free (temp); } } static void -e_table_text_model_delete(ETextModel *text_model, gint position, gint length) +e_table_text_model_delete (ETextModel *text_model, gint position, gint length) { ETableTextModel *model = E_TABLE_TEXT_MODEL(text_model); - if ( model->model ) { - gchar *temp = (gchar *)e_table_model_value_at(model->model, model->model_col, model->row); - temp = g_strdup_printf("%.*s%s", position, temp, temp + position + length); - e_table_model_set_value_at(model->model, model->model_col, model->row, temp); - g_free(temp); + if (model->model){ + gchar *temp = (gchar *)e_table_model_value_at (model->model, model->model_col, model->row); + temp = g_strdup_printf ("%.*s%s", position, temp, temp + position + length); + e_table_model_set_value_at (model->model, model->model_col, model->row, temp); + g_free (temp); } } static void -cell_changed(ETableModel *table_model, int model_col, int row, ETableTextModel *model) +cell_changed (ETableModel *table_model, int model_col, int row, ETableTextModel *model) { if (model->model_col == model_col && model->row == row) - e_text_model_changed(E_TEXT_MODEL(model)); + e_text_model_changed (E_TEXT_MODEL(model)); } static void -row_changed(ETableModel *table_model, int row, ETableTextModel *model) +row_changed (ETableModel *table_model, int row, ETableTextModel *model) { if (model->row == row) - e_text_model_changed(E_TEXT_MODEL(model)); + e_text_model_changed (E_TEXT_MODEL(model)); } ETableTextModel * -e_table_text_model_new(ETableModel *table_model, int row, int model_col) +e_table_text_model_new (ETableModel *table_model, int row, int model_col) { ETableTextModel *model = gtk_type_new (e_table_text_model_get_type ()); model->model = table_model; - if ( model->model ) { - gtk_object_ref(GTK_OBJECT(model->model)); + if (model->model){ + gtk_object_ref (GTK_OBJECT(model->model)); model->cell_changed_signal_id = - gtk_signal_connect(GTK_OBJECT(model->model), + gtk_signal_connect (GTK_OBJECT(model->model), "model_cell_changed", GTK_SIGNAL_FUNC(cell_changed), model); model->row_changed_signal_id = - gtk_signal_connect(GTK_OBJECT(model->model), + gtk_signal_connect (GTK_OBJECT(model->model), "model_row_changed", GTK_SIGNAL_FUNC(row_changed), model); diff --git a/widgets/e-table/e-table-text-model.h b/widgets/e-table/e-table-text-model.h index 43c82b6bcc..dcc9afde7c 100644 --- a/widgets/e-table/e-table-text-model.h +++ b/widgets/e-table/e-table-text-model.h @@ -54,7 +54,7 @@ struct _ETableTextModelClass { /* Standard Gtk function */ GtkType e_table_text_model_get_type (void); -ETableTextModel *e_table_text_model_new(ETableModel *table_model, int row, int model_col); +ETableTextModel *e_table_text_model_new (ETableModel *table_model, int row, int model_col); END_GNOME_DECLS diff --git a/widgets/e-table/e-table.c b/widgets/e-table/e-table.c index 70efe582ba..fbf0dbfa67 100644 --- a/widgets/e-table/e-table.c +++ b/widgets/e-table/e-table.c @@ -69,7 +69,7 @@ et_destroy (GtkObject *object) gtk_widget_destroy (GTK_WIDGET (et->table_canvas)); if (et->rebuild_idle_id) { - g_source_remove(et->rebuild_idle_id); + g_source_remove (et->rebuild_idle_id); et->rebuild_idle_id = 0; } @@ -113,7 +113,7 @@ e_table_make_header (ETable *e_table, ETableHeader *full_header, xmlNode *xmlCol e_table_header_add_column (nh, e_table_header_get_column (full_header, col), -1); } - e_table_header_set_frozen_columns( nh, e_xml_get_integer_prop_by_name(xmlColumns, "frozen_columns") ); + e_table_header_set_frozen_columns (nh, e_xml_get_integer_prop_by_name(xmlColumns, "frozen_columns")); return nh; } @@ -399,7 +399,7 @@ e_table_create_nodes (ETable *e_table, ETableModel *model, ETableHeader *header, tables = e_table_make_subtables (e_table->model, groups); e_table_destroy_groups (groups); group_item = gnome_canvas_item_new (root, - e_table_group_get_type(), + e_table_group_get_type (), "columns", ecol, TRUE, parent == NULL); group = node_new (group_item, model, parent); @@ -493,7 +493,7 @@ e_table_canvas_realize (GtkWidget *widget) GnomeCanvasItem *group_item; group_item = gnome_canvas_item_new (root, - e_table_group_get_type(), + e_table_group_get_type (), "header", E_TABLE, TRUE, parent == NULL); @@ -674,8 +674,8 @@ et_table_row_changed (ETableModel *table_model, int row, ETable *et) } } - if ( !et->rebuild_idle_id ) - et->rebuild_idle_id = g_idle_add(changed_idle, et); + if (!et->rebuild_idle_id) + et->rebuild_idle_id = g_idle_add (changed_idle, et); } static void @@ -703,7 +703,7 @@ e_table_setup_table (ETable *e_table, ETableHeader *full_header, ETableHeader *h header, model, xml_grouping->childs); - gtk_signal_connect(GTK_OBJECT(e_table->group), "row_selection", + gtk_signal_connect (GTK_OBJECT(e_table->group), "row_selection", GTK_SIGNAL_FUNC(group_row_selection), e_table); e_table->table_model_change_id = gtk_signal_connect ( @@ -727,7 +727,7 @@ e_table_fill_table (ETable *e_table, ETableModel *model) count = e_table_model_row_count (model); gtk_object_set (GTK_OBJECT (e_table->group), "frozen", TRUE, NULL); - for ( i = 0; i < count; i++ ) + for (i = 0; i < count; i++) e_table_group_add (e_table->group, i); gtk_object_set (GTK_OBJECT (e_table->group), @@ -752,9 +752,9 @@ et_real_construct (ETable *e_table, ETableHeader *full_header, ETableModel *etm, gtk_object_ref (GTK_OBJECT (etm)); e_table->specification = xmlSpec; - xmlRoot = xmlDocGetRootElement(xmlSpec); - xmlColumns = e_xml_get_child_by_name(xmlRoot, "columns-shown"); - xmlGrouping = e_xml_get_child_by_name(xmlRoot, "grouping"); + xmlRoot = xmlDocGetRootElement (xmlSpec); + xmlColumns = e_xml_get_child_by_name (xmlRoot, "columns-shown"); + xmlGrouping = e_xml_get_child_by_name (xmlRoot, "grouping"); gtk_widget_push_visual (gdk_rgb_get_visual ()); gtk_widget_push_colormap (gdk_rgb_get_cmap ()); @@ -767,8 +767,8 @@ et_real_construct (ETable *e_table, ETableHeader *full_header, ETableModel *etm, vbox = gtk_vbox_new (FALSE, 0); - gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (e_table->header_canvas), FALSE, FALSE, 0 ); - gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (e_table->table_canvas), TRUE, TRUE, 0 ); + gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (e_table->header_canvas), FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (e_table->table_canvas), TRUE, TRUE, 0); gtk_widget_show (vbox); @@ -776,7 +776,7 @@ et_real_construct (ETable *e_table, ETableHeader *full_header, ETableModel *etm, vscrollbar = gtk_vscrollbar_new (gtk_layout_get_vadjustment (GTK_LAYOUT (e_table->table_canvas))); gtk_widget_show (vscrollbar); - gtk_box_pack_start (GTK_BOX (e_table), vscrollbar, FALSE, FALSE, 0 ); + gtk_box_pack_start (GTK_BOX (e_table), vscrollbar, FALSE, FALSE, 0); gtk_widget_pop_colormap (); gtk_widget_pop_visual (); @@ -788,11 +788,11 @@ e_table_construct (ETable *e_table, ETableHeader *full_header, ETableModel *etm, { xmlDoc *xmlSpec; char *copy; - copy = g_strdup(spec); + copy = g_strdup (spec); - xmlSpec = xmlParseMemory(copy, strlen(copy) + 1); - et_real_construct(e_table, full_header, etm, xmlSpec); - g_free(copy); + xmlSpec = xmlParseMemory (copy, strlen(copy) + 1); + et_real_construct (e_table, full_header, etm, xmlSpec); + g_free (copy); } void @@ -801,8 +801,8 @@ e_table_construct_from_spec_file (ETable *e_table, ETableHeader *full_header, ET { xmlDoc *xmlSpec; - xmlSpec = xmlParseFile(filename); - et_real_construct(e_table, full_header, etm, xmlSpec); + xmlSpec = xmlParseFile (filename); + et_real_construct (e_table, full_header, etm, xmlSpec); } GtkWidget * @@ -830,33 +830,33 @@ e_table_new_from_spec_file (ETableHeader *full_header, ETableModel *etm, const c } static xmlNode * -et_build_column_spec(ETable *e_table) +et_build_column_spec (ETable *e_table) { xmlNode *columns_shown; gint i; gint col_count; - columns_shown = xmlNewNode(NULL, "columns-shown"); + columns_shown = xmlNewNode (NULL, "columns-shown"); - col_count = e_table_header_count(e_table->header); - for ( i = 0; i < col_count; i++ ) { - gchar *text = g_strdup_printf("%d", e_table_header_index(e_table->header, i)); - xmlNewChild(columns_shown, NULL, "column", text); - g_free(text); + col_count = e_table_header_count (e_table->header); + for (i = 0; i < col_count; i++){ + gchar *text = g_strdup_printf ("%d", e_table_header_index(e_table->header, i)); + xmlNewChild (columns_shown, NULL, "column", text); + g_free (text); } - if ( e_table->header->frozen_count != 0 ) - e_xml_set_integer_prop_by_name(columns_shown, "frozen_columns", e_table->header->frozen_count); + if (e_table->header->frozen_count != 0) + e_xml_set_integer_prop_by_name (columns_shown, "frozen_columns", e_table->header->frozen_count); return columns_shown; } static xmlNode * -et_build_grouping_spec(ETable *e_table) +et_build_grouping_spec (ETable *e_table) { xmlNode *grouping; xmlNode *root; - root = xmlDocGetRootElement(e_table->specification); - grouping = xmlCopyNode(e_xml_get_child_by_name(root, "grouping"), TRUE); + root = xmlDocGetRootElement (e_table->specification); + grouping = xmlCopyNode (e_xml_get_child_by_name(root, "grouping"), TRUE); return grouping; } @@ -865,13 +865,13 @@ et_build_tree (ETable *e_table) { xmlDoc *doc; xmlNode *root; - doc = xmlNewDoc( "1.0" ); - if ( doc == NULL ) + doc = xmlNewDoc ("1.0"); + if (doc == NULL) return NULL; - root = xmlNewDocNode(doc, NULL, "ETableSpecification", NULL); - xmlDocSetRootElement(doc, root); - xmlAddChild(root, et_build_column_spec(e_table)); - xmlAddChild(root, et_build_grouping_spec(e_table)); + root = xmlNewDocNode (doc, NULL, "ETableSpecification", NULL); + xmlDocSetRootElement (doc, root); + xmlAddChild (root, et_build_column_spec(e_table)); + xmlAddChild (root, et_build_grouping_spec(e_table)); return doc; } @@ -881,10 +881,10 @@ e_table_get_specification (ETable *e_table) xmlDoc *doc = et_build_tree (e_table); xmlChar *buffer; gint size; - xmlDocDumpMemory(doc, + xmlDocDumpMemory (doc, &buffer, &size); - xmlFreeDoc(doc); + xmlFreeDoc (doc); return buffer; } @@ -892,8 +892,8 @@ void e_table_save_specification (ETable *e_table, gchar *filename) { xmlDoc *doc = et_build_tree (e_table); - xmlSaveFile(filename, doc); - xmlFreeDoc(doc); + xmlSaveFile (filename, doc); + xmlFreeDoc (doc); } diff --git a/widgets/e-table/test-check.c b/widgets/e-table/test-check.c index 6110c367e3..4f5c07d7dd 100644 --- a/widgets/e-table/test-check.c +++ b/widgets/e-table/test-check.c @@ -86,7 +86,7 @@ duplicate_value (ETableModel *etc, int col, const void *value, void *data) if (col == 0){ return (void *) value; } else { - return g_strdup(value); + return g_strdup (value); } } @@ -94,14 +94,14 @@ static void free_value (ETableModel *etc, int col, void *value, void *data) { if (col != 0){ - g_free(value); + g_free (value); } } static void thaw (ETableModel *etc, void *data) { - e_table_model_changed(etc); + e_table_model_changed (etc); } static void @@ -137,14 +137,14 @@ check_test (void) cell_left_just = e_cell_text_new (e_table_model, NULL, GTK_JUSTIFY_LEFT, TRUE); cell_image_check = e_cell_checkbox_new (); - pixbuf = gdk_pixbuf_new_from_file("clip.png"); + pixbuf = gdk_pixbuf_new_from_file ("clip.png"); col_0 = e_table_col_new_with_pixbuf (0, pixbuf, 18, 18, cell_image_check, g_int_compare, TRUE); - gdk_pixbuf_unref(pixbuf); + gdk_pixbuf_unref (pixbuf); e_table_header_add_column (e_table_header, col_0, 0); col_1 = e_table_col_new (1, "Item Name", 180, 20, cell_left_just, g_str_compare, TRUE); e_table_header_add_column (e_table_header, col_1, 1); - e_table_col_set_arrow ( col_1, E_TABLE_COL_ARROW_DOWN ); + e_table_col_set_arrow (col_1, E_TABLE_COL_ARROW_DOWN); /* * GUI @@ -174,6 +174,6 @@ check_test (void) "drawfocus", TRUE, "spreadsheet", TRUE, NULL); - e_canvas_item_move_absolute(item, 0, 30); + e_canvas_item_move_absolute (item, 0, 30); } diff --git a/widgets/e-table/test-cols.c b/widgets/e-table/test-cols.c index f8997ceffd..66ea35d1ce 100644 --- a/widgets/e-table/test-cols.c +++ b/widgets/e-table/test-cols.c @@ -86,7 +86,7 @@ duplicate_value (ETableModel *etc, int col, const void *value, void *data) if (col == 0){ return (void *)value; } else { - return g_strdup(value); + return g_strdup (value); } } @@ -94,7 +94,7 @@ static void free_value (ETableModel *etc, int col, void *value, void *data) { if (col != 0){ - g_free(value); + g_free (value); } } @@ -107,7 +107,7 @@ set_canvas_size (GnomeCanvas *canvas, GtkAllocation *alloc) static void thaw (ETableModel *etc, void *data) { - e_table_model_changed(etc); + e_table_model_changed (etc); } void @@ -196,7 +196,7 @@ multi_cols_test (void) "spreadsheet", TRUE, NULL); - e_canvas_item_move_absolute(item, 0, 30); + e_canvas_item_move_absolute (item, 0, 30); gnome_canvas_item_new ( gnome_canvas_root (GNOME_CANVAS (canvas)), @@ -214,7 +214,7 @@ multi_cols_test (void) "drawfocus", TRUE, "spreadsheet", TRUE, NULL); - e_canvas_item_move_absolute(item, 300, 30); + e_canvas_item_move_absolute (item, 300, 30); } diff --git a/widgets/e-table/test-table.c b/widgets/e-table/test-table.c index 70c1e11ce1..54fe02ae71 100644 --- a/widgets/e-table/test-table.c +++ b/widgets/e-table/test-table.c @@ -56,8 +56,8 @@ parse_headers () p = buffer; for (i = 0; (s = strtok (p, " \t")) != NULL; i++){ column_labels [i] = g_strdup (s); - if ( strchr(column_labels [i], '\n') ) - *strchr(column_labels [i], '\n') = 0; + if (strchr (column_labels [i], '\n')) + *strchr (column_labels [i], '\n') = 0; p = NULL; } @@ -179,19 +179,19 @@ is_cell_editable (ETableModel *etc, int col, int row, void *data) static void * duplicate_value (ETableModel *etc, int col, const void *value, void *data) { - return g_strdup(value); + return g_strdup (value); } static void free_value (ETableModel *etc, int col, void *value, void *data) { - g_free(value); + g_free (value); } static void thaw (ETableModel *etc, void *data) { - e_table_model_changed(etc); + e_table_model_changed (etc); } static void @@ -275,13 +275,13 @@ table_browser_test (void) static void save_spec (GtkWidget *button, ETable *e_table) { - e_table_save_specification(e_table, "e-table-test.xml"); + e_table_save_specification (e_table, "e-table-test.xml"); } static void row_selection_test (ETable *table, int row, gboolean selected) { - if ( selected ) + if (selected) g_print ("Row %d selected\n", row); else g_print ("Row %d unselected\n", row); @@ -300,7 +300,7 @@ do_e_table_demo (const char *spec) */ static ETableModel *e_table_model = NULL; - if ( e_table_model == NULL ) + if (e_table_model == NULL) e_table_model = e_table_simple_new (col_count, row_count, value_at, set_value_at, is_cell_editable, @@ -323,14 +323,14 @@ do_e_table_demo (const char *spec) window = gtk_window_new (GTK_WINDOW_TOPLEVEL); frame = gtk_frame_new (NULL); e_table = e_table_new (full_header, e_table_model, spec); - gtk_signal_connect(GTK_OBJECT(e_table), "row_selection", + gtk_signal_connect (GTK_OBJECT(e_table), "row_selection", GTK_SIGNAL_FUNC(row_selection_test), NULL); - button = gtk_button_new_with_label("Save spec"); + button = gtk_button_new_with_label ("Save spec"); gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (save_spec), e_table); - vbox = gtk_vbox_new(FALSE, 0); + vbox = gtk_vbox_new (FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), e_table, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); |