pango_layout_get_extents (layout, NULL, &rect);
- g_object_unref (G_OBJECT (layout));
+ g_object_unref (layout);
return PANGO_PIXELS (rect.width);
}
for ( i = first ; i <= first + n_columns ; ++i )
{
gtk_sheet_column_title_button_draw (sheet, i);
- g_signal_emit (G_OBJECT (sheet), sheet_signals[CHANGED], 0, -1, i);
+ g_signal_emit (sheet, sheet_signals[CHANGED], 0, -1, i);
}
}
if (state == GTK_SHEET_NORMAL)
{
gtk_sheet_show_active_cell (sheet);
- g_signal_connect (G_OBJECT (gtk_sheet_get_entry (sheet)),
+ g_signal_connect (gtk_sheet_get_entry (sheet),
"changed",
G_CALLBACK (gtk_sheet_entry_changed),
sheet);
sheet->old_hadjustment = -1.;
if (sheet->hadjustment)
- g_signal_emit_by_name (G_OBJECT (sheet->hadjustment),
+ g_signal_emit_by_name (sheet->hadjustment,
"value_changed");
if (sheet->vadjustment)
- g_signal_emit_by_name (G_OBJECT (sheet->vadjustment),
+ g_signal_emit_by_name (sheet->vadjustment,
"value_changed");
if (sheet->state == GTK_STATE_NORMAL)
sheet->old_hadjustment = -1.;
if (sheet->hadjustment)
- g_signal_emit_by_name (G_OBJECT (sheet->hadjustment),
+ g_signal_emit_by_name (sheet->hadjustment,
"value_changed");
size_allocate_global_button (sheet);
}
sheet->old_vadjustment = -1.;
if (sheet->vadjustment)
- g_signal_emit_by_name (G_OBJECT (sheet->vadjustment),
+ g_signal_emit_by_name (sheet->vadjustment,
"value_changed");
size_allocate_global_button (sheet);
}
sheet->old_vadjustment = -1.;
if (sheet->vadjustment)
- g_signal_emit_by_name (G_OBJECT (sheet->vadjustment),
+ g_signal_emit_by_name (sheet->vadjustment,
"value_changed");
size_allocate_global_button (sheet);
}
sheet->old_hadjustment = -1.;
if (sheet->hadjustment)
- g_signal_emit_by_name (G_OBJECT (sheet->hadjustment),
+ g_signal_emit_by_name (sheet->hadjustment,
"value_changed");
size_allocate_global_button (sheet);
}
sheet->old_vadjustment = -1.;
if (sheet->vadjustment)
- g_signal_emit_by_name (G_OBJECT (sheet->vadjustment),
+ g_signal_emit_by_name (sheet->vadjustment,
"value_changed");
}
sheet->old_hadjustment = -1.;
if (sheet->hadjustment)
- g_signal_emit_by_name (G_OBJECT (sheet->hadjustment),
+ g_signal_emit_by_name (sheet->hadjustment,
"value_changed");
}
sheet->vadjustment->value = y;
sheet->old_vadjustment = -1.;
- g_signal_emit_by_name (G_OBJECT (sheet->vadjustment),
+ g_signal_emit_by_name (sheet->vadjustment,
"value_changed");
}
sheet->hadjustment->value = x;
sheet->old_vadjustment = -1.;
- g_signal_emit_by_name (G_OBJECT (sheet->hadjustment),
+ g_signal_emit_by_name (sheet->hadjustment,
"value_changed");
}
}
sheet->active_cell.row = row;
sheet->active_cell.col = 0;
- g_signal_emit (G_OBJECT (sheet), sheet_signals[SELECT_ROW], 0, row);
+ g_signal_emit (sheet, sheet_signals[SELECT_ROW], 0, row);
gtk_sheet_real_select_range (sheet, NULL);
}
sheet->active_cell.row = 0;
sheet->active_cell.col = column;
- g_signal_emit (G_OBJECT (sheet), sheet_signals[SELECT_COLUMN], 0, column);
+ g_signal_emit (sheet, sheet_signals[SELECT_COLUMN], 0, column);
gtk_sheet_real_select_range (sheet, NULL);
}
if (sheet->vadjustment)
{
- g_signal_handlers_disconnect_matched (G_OBJECT (sheet->vadjustment),
+ g_signal_handlers_disconnect_matched (sheet->vadjustment,
G_SIGNAL_MATCH_DATA,
0, 0, 0, 0,
sheet);
- g_object_unref (G_OBJECT (sheet->vadjustment));
+ g_object_unref (sheet->vadjustment);
}
sheet->vadjustment = adjustment;
if (sheet->vadjustment)
{
- g_object_ref (G_OBJECT (sheet->vadjustment));
- g_object_ref_sink (G_OBJECT (sheet->vadjustment));
+ g_object_ref (sheet->vadjustment);
+ g_object_ref_sink (sheet->vadjustment);
- g_signal_connect (G_OBJECT (sheet->vadjustment), "value_changed",
+ g_signal_connect (sheet->vadjustment, "value_changed",
G_CALLBACK (vadjustment_value_changed),
sheet);
}
if (sheet->hadjustment)
{
- g_signal_handlers_disconnect_matched (G_OBJECT (sheet->hadjustment),
+ g_signal_handlers_disconnect_matched (sheet->hadjustment,
G_SIGNAL_MATCH_DATA,
0, 0, 0, 0,
sheet);
- g_object_unref (G_OBJECT (sheet->hadjustment));
+ g_object_unref (sheet->hadjustment);
}
sheet->hadjustment = adjustment;
if (sheet->hadjustment)
{
- g_object_ref (G_OBJECT (sheet->hadjustment));
- g_object_ref_sink (G_OBJECT (sheet->hadjustment));
+ g_object_ref (sheet->hadjustment);
+ g_object_ref_sink (sheet->hadjustment);
- g_signal_connect (G_OBJECT (sheet->hadjustment), "value_changed",
+ g_signal_connect (sheet->hadjustment, "value_changed",
G_CALLBACK (hadjustment_value_changed),
sheet);
}
/* unref adjustments */
if (sheet->hadjustment)
{
- g_signal_handlers_disconnect_matched (G_OBJECT (sheet->hadjustment),
+ g_signal_handlers_disconnect_matched (sheet->hadjustment,
G_SIGNAL_MATCH_DATA,
0, 0, 0, 0,
sheet);
- g_object_unref (G_OBJECT (sheet->hadjustment));
+ g_object_unref (sheet->hadjustment);
sheet->hadjustment = NULL;
}
if (sheet->vadjustment)
{
- g_signal_handlers_disconnect_matched (G_OBJECT (sheet->vadjustment),
+ g_signal_handlers_disconnect_matched (sheet->vadjustment,
G_SIGNAL_MATCH_DATA,
0, 0, 0, 0,
sheet);
- g_object_unref (G_OBJECT (sheet->vadjustment));
+ g_object_unref (sheet->vadjustment);
sheet->vadjustment = NULL;
}
{
sheet->button = gtk_button_new_with_label (" ");
- g_signal_connect (G_OBJECT (sheet->button),
+ g_signal_connect (sheet->button,
"pressed",
G_CALLBACK (global_button_clicked),
sheet);
layout);
gdk_gc_set_clip_rectangle (fg_gc, NULL);
- g_object_unref (G_OBJECT (layout));
+ g_object_unref (layout);
gdk_draw_pixmap (sheet->sheet_window,
GTK_WIDGET (sheet)->style->fg_gc[GTK_STATE_NORMAL],
}
if ( changed )
- g_signal_emit (G_OBJECT (sheet), sheet_signals[CHANGED], 0, row, col);
+ g_signal_emit (sheet, sheet_signals[CHANGED], 0, row, col);
}
{
g_sheet_model_datum_clear (model, row, column);
- if (GTK_IS_OBJECT (sheet) && G_OBJECT (sheet)->ref_count > 0)
- g_signal_emit (G_OBJECT (sheet), sheet_signals[CLEAR_CELL], 0,
+ if (G_OBJECT (sheet)->ref_count > 0)
+ g_signal_emit (sheet, sheet_signals[CLEAR_CELL], 0,
row, column);
}
if (row < 0 || col < 0) return;
- sheet->active_cell.row =- 1;
- sheet->active_cell.col =- 1;
+ sheet->active_cell.row = -1;
+ sheet->active_cell.col = -1;
text = gtk_entry_get_text (GTK_ENTRY (gtk_sheet_get_entry (sheet)));
if ( sheet->active_cell.row == -1 || sheet->active_cell.col == -1 )
return TRUE;
- g_signal_handlers_disconnect_by_func (G_OBJECT (gtk_sheet_get_entry (sheet)),
+ g_signal_handlers_disconnect_by_func (gtk_sheet_get_entry (sheet),
G_CALLBACK (gtk_sheet_entry_changed),
sheet);
gtk_sheet_show_active_cell (sheet);
- g_signal_connect (G_OBJECT (gtk_sheet_get_entry (sheet)),
+ g_signal_connect (gtk_sheet_get_entry (sheet),
"changed",
G_CALLBACK (gtk_sheet_entry_changed),
sheet);
gdk_gc_set_clip_rectangle (sheet->xor_gc, &area);
- for (i =- 1; i <= 1; ++i)
+ for (i = -1; i <= 1; ++i)
gdk_draw_rectangle (sheet->sheet_window,
sheet->xor_gc,
FALSE,
gtk_sheet_update_primary_selection (sheet);
- g_signal_emit (G_OBJECT (sheet), sheet_signals[SELECT_RANGE], 0, &sheet->range);
+ g_signal_emit (sheet, sheet_signals[SELECT_RANGE], 0, &sheet->range);
}
if (range->row0 < 0 || range->rowi < 0) return;
if (range->col0 < 0 || range->coli < 0) return;
- g_signal_emit (G_OBJECT (sheet), sheet_signals[SELECT_COLUMN], 0, -1);
- g_signal_emit (G_OBJECT (sheet), sheet_signals[SELECT_ROW], 0, -1);
+ g_signal_emit (sheet, sheet_signals[SELECT_COLUMN], 0, -1);
+ g_signal_emit (sheet, sheet_signals[SELECT_ROW], 0, -1);
if (gtk_sheet_range_isvisible (sheet, *range))
gtk_sheet_draw_backing_pixmap (sheet, *range);
if (event->window == sheet->column_title_window)
{
- g_signal_emit (G_OBJECT (sheet),
+ g_signal_emit (sheet,
sheet_signals[BUTTON_EVENT_COLUMN], 0,
column, event);
if ( event->type == GDK_2BUTTON_PRESS && event->button == 1)
- g_signal_emit (G_OBJECT (sheet),
+ g_signal_emit (sheet,
sheet_signals[DOUBLE_CLICK_COLUMN], 0, column);
}
else if (event->window == sheet->row_title_window)
{
- g_signal_emit (G_OBJECT (sheet),
+ g_signal_emit (sheet,
sheet_signals[BUTTON_EVENT_ROW], 0,
row, event);
if ( event->type == GDK_2BUTTON_PRESS && event->button == 1)
- g_signal_emit (G_OBJECT (sheet),
+ g_signal_emit (sheet,
sheet_signals[DOUBLE_CLICK_ROW], 0, row);
}
return;
}
- if (row == - 1 && column == - 1)
+ if (row == -1 && column == -1)
{
sheet->range.row0 = 0;
sheet->range.col0 = 0;
gtk_sheet_set_column_width (sheet, sheet->drag_cell.col,
new_column_width (sheet, sheet->drag_cell.col, &x));
sheet->old_hadjustment = -1.;
- g_signal_emit_by_name (G_OBJECT (sheet->hadjustment), "value_changed");
+ g_signal_emit_by_name (sheet->hadjustment, "value_changed");
return TRUE;
}
gtk_sheet_set_row_height (sheet, sheet->drag_cell.row, new_row_height (sheet, sheet->drag_cell.row, &y));
sheet->old_vadjustment = -1.;
- g_signal_emit_by_name (G_OBJECT (sheet->vadjustment), "value_changed");
+ g_signal_emit_by_name (sheet->vadjustment, "value_changed");
return TRUE;
}
old_range = sheet->range;
sheet->range = sheet->drag_range;
sheet->drag_range = old_range;
- g_signal_emit (G_OBJECT (sheet), sheet_signals[MOVE_RANGE], 0,
+ g_signal_emit (sheet, sheet_signals[MOVE_RANGE], 0,
&sheet->drag_range, &sheet->range);
gtk_sheet_select_range (sheet, &sheet->range);
}
sheet->drag_range = old_range;
if (sheet->state == GTK_STATE_NORMAL) sheet->state = GTK_SHEET_RANGE_SELECTED;
- g_signal_emit (G_OBJECT (sheet), sheet_signals[RESIZE_RANGE], 0,
+ g_signal_emit (sheet, sheet_signals[RESIZE_RANGE], 0,
&sheet->drag_range, &sheet->range);
gtk_sheet_select_range (sheet, &sheet->range);
}
row_move = FALSE;
column_move = FALSE;
- row_align =- 1.;
- col_align =- 1.;
+ row_align = -1.;
+ col_align = -1.;
height = sheet->sheet_window_height;
width = sheet->sheet_window_width;
GdkEventKey *key)
{
gboolean focus;
- g_signal_emit_by_name (G_OBJECT (widget), "key_press_event", key, &focus);
+ g_signal_emit_by_name (widget, "key_press_event", key, &focus);
return focus;
}
gtk_widget_realize (sheet->sheet_entry);
}
- g_signal_connect_swapped (G_OBJECT (entry), "key_press_event",
+ g_signal_connect_swapped (entry, "key_press_event",
G_CALLBACK (gtk_sheet_entry_key_press),
sheet);
"label",
real_x, real_y,
layout);
- g_object_unref (G_OBJECT (layout));
+ g_object_unref (layout);
real_y += text_height + 2;
sheet->vadjustment->step_increment = DEFAULT_ROW_HEIGHT (GTK_WIDGET (sheet));
sheet->vadjustment->lower = 0;
sheet->vadjustment->upper = SHEET_HEIGHT (sheet) + 80;
- g_signal_emit_by_name (G_OBJECT (sheet->vadjustment), "changed");
+ g_signal_emit_by_name (sheet->vadjustment, "changed");
}
sheet->hadjustment->step_increment = DEFAULT_COLUMN_WIDTH;
sheet->hadjustment->lower = 0;
sheet->hadjustment->upper = SHEET_WIDTH (sheet)+ 80;
- g_signal_emit_by_name (G_OBJECT (sheet->hadjustment), "changed");
+ g_signal_emit_by_name (sheet->hadjustment, "changed");
}
}
gdk_gc_set_clip_rectangle (sheet->xor_gc, &clip_area);
- for (i =- 1; i <= 1; ++i)
+ for (i = -1; i <= 1; ++i)
gdk_draw_rectangle (sheet->sheet_window,
sheet->xor_gc,
FALSE,
gtk_sheet_range_draw (sheet, NULL);
}
- g_signal_emit (G_OBJECT (sheet), sheet_signals[CHANGED], 0, -1, column);
- g_signal_emit (G_OBJECT (sheet), sheet_signals[NEW_COL_WIDTH], 0,
+ g_signal_emit (sheet, sheet_signals[CHANGED], 0, -1, column);
+ g_signal_emit (sheet, sheet_signals[NEW_COL_WIDTH], 0,
column, width);
}
gtk_sheet_range_draw (sheet, NULL);
}
- g_signal_emit (G_OBJECT (sheet), sheet_signals[CHANGED], 0, row, - 1);
- g_signal_emit (G_OBJECT (sheet), sheet_signals[NEW_ROW_HEIGHT], 0,
+ g_signal_emit (sheet, sheet_signals[CHANGED], 0, row, - 1);
+ g_signal_emit (sheet, sheet_signals[NEW_ROW_HEIGHT], 0,
row, height);
}
if (!GTK_WIDGET_REALIZED (sheet))
return;
- clipboard = gtk_widget_get_clipboard (GTK_WIDGET (sheet),
+ clipboard = gtk_widget_get_clipboard (GTK_WIDGET (sheet),
GDK_SELECTION_PRIMARY);
-
+
if (gtk_sheet_range_isvisible (sheet, sheet->range))
{
- if (!gtk_clipboard_set_with_owner (clipboard, targets,
+ if (!gtk_clipboard_set_with_owner (clipboard, targets,
G_N_ELEMENTS (targets),
primary_get_cb, primary_clear_cb,
G_OBJECT (sheet)))