Commit 463aab93 authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen
Browse files

Various cleanups. (#315360, Kjartan Maraas)

2005-09-13  Matthias Clasen  <mclasen@redhat.com>

	* gtk/*.c: Various cleanups.  (#315360, Kjartan Maraas)
parent 9a5d4a2f
2005-09-13 Matthias Clasen <mclasen@redhat.com>
* gtk/*.c: Various cleanups. (#315360, Kjartan Maraas)
* gdk/*.c: Various cleanups. (#315359, Kjartan Maraas)
2005-09-13 Matthias Clasen <mclasen@redhat.com>
......
2005-09-13 Matthias Clasen <mclasen@redhat.com>
* gtk/*.c: Various cleanups. (#315360, Kjartan Maraas)
* gdk/*.c: Various cleanups. (#315359, Kjartan Maraas)
2005-09-13 Matthias Clasen <mclasen@redhat.com>
......
......@@ -179,11 +179,9 @@ gtk_about_dialog_class_init (GtkAboutDialogClass *klass)
{
GObjectClass *object_class;
GtkWidgetClass *widget_class;
GtkDialogClass *dialog_class;
object_class = (GObjectClass *)klass;
widget_class = (GtkWidgetClass *)klass;
dialog_class = (GtkDialogClass *)klass;
object_class->set_property = gtk_about_dialog_set_property;
object_class->get_property = gtk_about_dialog_get_property;
......
......@@ -693,12 +693,8 @@ _gtk_accel_label_class_get_accelerator_label (GtkAccelLabelClass *klass,
gboolean
gtk_accel_label_refetch (GtkAccelLabel *accel_label)
{
GtkAccelLabelClass *class;
g_return_val_if_fail (GTK_IS_ACCEL_LABEL (accel_label), FALSE);
class = GTK_ACCEL_LABEL_GET_CLASS (accel_label);
if (accel_label->accel_string)
{
g_free (accel_label->accel_string);
......
......@@ -387,8 +387,6 @@ internal_change_entry (const gchar *accel_path,
if (change_accel && !simulate)
{
guint old_accel_key, old_accel_mods;
/* ref accel groups */
for (slist = group_list; slist; slist = slist->next)
g_object_ref (slist->data);
......@@ -398,8 +396,6 @@ internal_change_entry (const gchar *accel_path,
internal_change_entry (g_quark_to_string (GPOINTER_TO_UINT (slist->data)), 0, 0, FALSE, FALSE);
/* 9) install new accelerator */
old_accel_key = entry->accel_key;
old_accel_mods = entry->accel_mods;
entry->accel_key = accel_key;
entry->accel_mods = accel_mods;
entry->changed = TRUE;
......
......@@ -441,11 +441,9 @@ static void
gtk_alignment_size_request (GtkWidget *widget,
GtkRequisition *requisition)
{
GtkAlignment *alignment;
GtkBin *bin;
GtkAlignmentPrivate *priv;
alignment = GTK_ALIGNMENT (widget);
bin = GTK_BIN (widget);
priv = GTK_ALIGNMENT_GET_PRIVATE (widget);
......
......@@ -760,12 +760,9 @@ static void
calendar_set_year_next (GtkCalendar *calendar)
{
gint month_len;
GtkWidget *widget;
g_return_if_fail (GTK_IS_WIDGET (calendar));
widget = GTK_WIDGET (calendar);
calendar->year++;
calendar_compute_days (calendar);
g_signal_emit (calendar,
......@@ -1678,16 +1675,10 @@ gtk_calendar_size_allocate (GtkWidget *widget,
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (widget);
gint xthickness = widget->style->xthickness;
gint ythickness = widget->style->xthickness;
gboolean year_left;
guint i;
widget->allocation = *allocation;
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
year_left = priv->year_before;
else
year_left = !priv->year_before;
if (calendar->display_flags & GTK_CALENDAR_SHOW_WEEK_NUMBERS)
{
priv->day_width = (priv->min_day_width
......@@ -1789,7 +1780,7 @@ calendar_paint_header (GtkCalendar *calendar)
cairo_t *cr;
char buffer[255];
int x, y;
gint header_width, cal_height;
gint header_width;
gint max_month_width;
gint max_year_width;
PangoLayout *layout;
......@@ -1807,7 +1798,6 @@ calendar_paint_header (GtkCalendar *calendar)
cr = gdk_cairo_create (priv->header_win);
header_width = widget->allocation.width - 2 * widget->style->xthickness;
cal_height = widget->allocation.height;
max_month_width = priv->max_month_width;
max_year_width = priv->max_year_width;
......@@ -1896,7 +1886,6 @@ calendar_paint_day_names (GtkCalendar *calendar)
char buffer[255];
int day,i;
int day_width, cal_width;
gint cal_height;
int day_wid_sep;
PangoLayout *layout;
PangoRectangle logical_rect;
......@@ -1912,7 +1901,6 @@ calendar_paint_day_names (GtkCalendar *calendar)
day_width = priv->day_width;
cal_width = widget->allocation.width;
cal_height = widget->allocation.height;
day_wid_sep = day_width + DAY_XSEP;
/*
......@@ -2125,14 +2113,14 @@ calendar_paint_day (GtkCalendar *calendar,
}
else
{
/*
#if 0
if (calendar->highlight_row == row && calendar->highlight_col == col)
{
cairo_set_source_color (cr, HIGHLIGHT_BG_COLOR (widget));
gdk_cairo_rectangle (cr, &day_rect);
cairo_fill (cr);
}
*/
#endif
if (calendar->selected_day == day)
{
gdk_cairo_set_source_color (cr, SELECTED_BG_COLOR (widget));
......
......@@ -330,11 +330,9 @@ static gint
gtk_check_button_expose (GtkWidget *widget,
GdkEventExpose *event)
{
GtkCheckButton *check_button;
GtkToggleButton *toggle_button;
GtkBin *bin;
check_button = GTK_CHECK_BUTTON (widget);
toggle_button = GTK_TOGGLE_BUTTON (widget);
bin = GTK_BIN (widget);
......
......@@ -2814,7 +2814,7 @@ static void
real_remove_row (GtkCList *clist,
gint row)
{
gint was_visible, was_selected;
gint was_visible;
GList *list;
GtkCListRow *clist_row;
......@@ -2825,7 +2825,6 @@ real_remove_row (GtkCList *clist,
return;
was_visible = (gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE);
was_selected = 0;
/* get the row we're going to delete */
list = ROW_ELEMENT (clist, row);
......
......@@ -170,12 +170,10 @@ static void
gtk_color_button_class_init (GtkColorButtonClass *klass)
{
GObjectClass *gobject_class;
GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
GtkButtonClass *button_class;
gobject_class = G_OBJECT_CLASS (klass);
object_class = GTK_OBJECT_CLASS (klass);
widget_class = GTK_WIDGET_CLASS (klass);
button_class = GTK_BUTTON_CLASS (klass);
......
......@@ -1290,8 +1290,6 @@ mouse_release (GtkWidget *invisible,
gpointer data)
{
GtkColorSelection *colorsel = data;
ColorSelectionPrivate *priv;
priv = colorsel->private_data;
if (event->button != 1)
return FALSE;
......@@ -1394,8 +1392,6 @@ mouse_press (GtkWidget *invisible,
gpointer data)
{
GtkColorSelection *colorsel = data;
ColorSelectionPrivate *priv;
priv = colorsel->private_data;
if (event->type == GDK_BUTTON_PRESS &&
event->button == 1)
......@@ -2335,7 +2331,6 @@ gtk_color_selection_set_current_color (GtkColorSelection *colorsel,
{
ColorSelectionPrivate *priv;
gint i;
gboolean previous_changed;
g_return_if_fail (GTK_IS_COLOR_SELECTION (colorsel));
g_return_if_fail (color != NULL);
......@@ -2353,7 +2348,6 @@ gtk_color_selection_set_current_color (GtkColorSelection *colorsel,
&priv->color[COLORSEL_VALUE]);
if (priv->default_set == FALSE)
{
previous_changed = TRUE;
for (i = 0; i < COLORSEL_NUM_CHANNELS; i++)
priv->old_color[i] = priv->color[i];
}
......
......@@ -81,7 +81,7 @@ gtk_color_selection_dialog_class_init (GtkColorSelectionDialogClass *klass)
static void
gtk_color_selection_dialog_init (GtkColorSelectionDialog *colorseldiag)
{
GtkWidget *action_area_button_box, *frame;
GtkWidget *frame;
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE);
......@@ -95,8 +95,6 @@ gtk_color_selection_dialog_init (GtkColorSelectionDialog *colorseldiag)
gtk_container_add (GTK_CONTAINER (frame), colorseldiag->colorsel);
gtk_widget_show (colorseldiag->colorsel);
action_area_button_box = GTK_DIALOG (colorseldiag)->action_area;
colorseldiag->cancel_button = gtk_dialog_add_button (GTK_DIALOG (colorseldiag),
GTK_STOCK_CANCEL,
GTK_RESPONSE_CANCEL);
......
......@@ -486,13 +486,10 @@ static void
gtk_combo_box_class_init (GtkComboBoxClass *klass)
{
GObjectClass *object_class;
GtkBindingSet *binding_set;
GtkObjectClass *gtk_object_class;
GtkContainerClass *container_class;
GtkWidgetClass *widget_class;
binding_set = gtk_binding_set_by_class (klass);
klass->get_active_text = gtk_combo_box_real_get_active_text;
container_class = (GtkContainerClass *)klass;
......
......@@ -497,7 +497,6 @@ gtk_container_child_set_valist (GtkContainer *container,
const gchar *first_property_name,
va_list var_args)
{
GObject *object;
GObjectNotifyQueue *nqueue;
const gchar *name;
......@@ -508,7 +507,6 @@ gtk_container_child_set_valist (GtkContainer *container,
g_object_ref (container);
g_object_ref (child);
object = G_OBJECT (container);
nqueue = g_object_notify_queue_freeze (G_OBJECT (child), _gtk_widget_child_property_notify_context);
name = first_property_name;
while (name)
......@@ -572,7 +570,6 @@ gtk_container_child_set_property (GtkContainer *container,
const gchar *property_name,
const GValue *value)
{
GObject *object;
GObjectNotifyQueue *nqueue;
GParamSpec *pspec;
......@@ -585,7 +582,6 @@ gtk_container_child_set_property (GtkContainer *container,
g_object_ref (container);
g_object_ref (child);
object = G_OBJECT (container);
nqueue = g_object_notify_queue_freeze (G_OBJECT (child), _gtk_widget_child_property_notify_context);
pspec = g_param_spec_pool_lookup (_gtk_widget_child_property_pool, property_name,
G_OBJECT_TYPE (container), TRUE);
......
......@@ -427,7 +427,6 @@ gtk_curve_graph_events (GtkWidget *widget, GdkEvent *event, GtkCurve *c)
{
GdkCursorType new_type = c->cursor_type;
gint i, src, dst, leftbound, rightbound;
GdkEventButton *bevent;
GdkEventMotion *mevent;
GtkWidget *w;
gint tx, ty;
......@@ -481,7 +480,6 @@ gtk_curve_graph_events (GtkWidget *widget, GdkEvent *event, GtkCurve *c)
case GDK_BUTTON_PRESS:
gtk_grab_add (widget);
bevent = (GdkEventButton *) event;
new_type = GDK_TCROSS;
switch (c->curve_type)
......
......@@ -3451,12 +3451,10 @@ gtk_drag_source_event_cb (GtkWidget *widget,
if (gtk_drag_check_threshold (widget, site->x, site->y,
event->motion.x, event->motion.y))
{
GdkDragContext *context;
site->state = 0;
context = gtk_drag_begin_internal (widget, site, site->target_list,
site->actions,
i, event);
gtk_drag_begin_internal (widget, site, site->target_list,
site->actions,
i, event);
retval = TRUE;
}
......
......@@ -1127,13 +1127,11 @@ static void
gtk_entry_realize (GtkWidget *widget)
{
GtkEntry *entry;
GtkEditable *editable;
GdkWindowAttr attributes;
gint attributes_mask;
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
entry = GTK_ENTRY (widget);
editable = GTK_EDITABLE (widget);
attributes.window_type = GDK_WINDOW_CHILD;
......@@ -1704,12 +1702,7 @@ drag_begin_cb (GtkWidget *widget,
GdkDragContext *context,
gpointer data)
{
GtkEntry *entry;
g_signal_handlers_disconnect_by_func (widget, drag_begin_cb, NULL);
entry = GTK_ENTRY (widget);
}
static gint
......
......@@ -266,12 +266,10 @@ gtk_event_box_set_visible_window (GtkEventBox *event_box,
gboolean visible_window)
{
GtkWidget *widget;
GtkEventBoxPrivate *priv;
g_return_if_fail (GTK_IS_EVENT_BOX (event_box));
widget = GTK_WIDGET (event_box);
priv = GTK_EVENT_BOX_GET_PRIVATE (event_box);
visible_window = visible_window != FALSE;
......@@ -470,10 +468,8 @@ gtk_event_box_realize (GtkWidget *widget)
static void
gtk_event_box_unrealize (GtkWidget *widget)
{
GtkEventBox *event_box;
GtkEventBoxPrivate *priv;
event_box = GTK_EVENT_BOX (widget);
priv = GTK_EVENT_BOX_GET_PRIVATE (widget);
if (priv->event_window != NULL)
......
......@@ -501,7 +501,6 @@ get_expander_bounds (GtkExpander *expander,
GdkRectangle *rect)
{
GtkWidget *widget;
GtkBin *bin;
GtkExpanderPrivate *priv;
gint border_width;
gint expander_size;
......@@ -512,7 +511,6 @@ get_expander_bounds (GtkExpander *expander,
gboolean ltr;
widget = GTK_WIDGET (expander);
bin = GTK_BIN (expander);
priv = expander->priv;
border_width = GTK_CONTAINER (expander)->border_width;
......
......@@ -1124,14 +1124,10 @@ static void
gtk_file_chooser_button_style_set (GtkWidget *widget,
GtkStyle *old_style)
{
GtkFileChooserButtonPrivate *priv;
if (GTK_WIDGET_CLASS (gtk_file_chooser_button_parent_class)->style_set)
(*GTK_WIDGET_CLASS (gtk_file_chooser_button_parent_class)->style_set) (widget,
old_style);
priv = GTK_FILE_CHOOSER_BUTTON_GET_PRIVATE (widget);
if (gtk_widget_has_screen (widget))
change_icon_theme (GTK_FILE_CHOOSER_BUTTON (widget));
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment