Commit 56a2f2c6 authored by Havoc Pennington's avatar Havoc Pennington Committed by Havoc Pennington

Remove draw_focus and draw_default (gtk_widget_draw_focus): remove this

2001-02-28  Havoc Pennington  <hp@redhat.com>

	* gtk/gtkwidget.h (struct _GtkWidgetClass): Remove draw_focus and
	draw_default
	(gtk_widget_draw_focus): remove this function; we could instead
	make it just gtk_widget_draw(), but in most cases I think the
	result would be broken user code, so think it's better to have
	that code not compile and get fixed
	(gtk_widget_draw_default): ditto

	* gtk/gtkwidget.c: Add default handlers for focus_in_event and
	focus_out_event that set/unset GTK_HAS_FOCUS and call queue_draw

	* gtk/gtkwindow.c (gtk_window_set_default): just queue a draw when
	widgets lose/get the default, instead of calling draw_default

	* docs/Changes-2.0.txt: note about all this

	Then fixed every widget in GTK, I won't list all the filenames.
parent c82dc58f
2001-02-28 Havoc Pennington <hp@redhat.com>
* gtk/gtkwidget.h (struct _GtkWidgetClass): Remove draw_focus and
draw_default
(gtk_widget_draw_focus): remove this function; we could instead
make it just gtk_widget_draw(), but in most cases I think the
result would be broken user code, so think it's better to have
that code not compile and get fixed
(gtk_widget_draw_default): ditto
* gtk/gtkwidget.c: Add default handlers for focus_in_event and
focus_out_event that set/unset GTK_HAS_FOCUS and call queue_draw
* gtk/gtkwindow.c (gtk_window_set_default): just queue a draw when
widgets lose/get the default, instead of calling draw_default
* docs/Changes-2.0.txt: note about all this
Then fixed every widget in GTK, I won't list all the filenames.
Tue Feb 27 19:32:53 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreemodel.c (deleted_callback): Proxy out to
......
2001-02-28 Havoc Pennington <hp@redhat.com>
* gtk/gtkwidget.h (struct _GtkWidgetClass): Remove draw_focus and
draw_default
(gtk_widget_draw_focus): remove this function; we could instead
make it just gtk_widget_draw(), but in most cases I think the
result would be broken user code, so think it's better to have
that code not compile and get fixed
(gtk_widget_draw_default): ditto
* gtk/gtkwidget.c: Add default handlers for focus_in_event and
focus_out_event that set/unset GTK_HAS_FOCUS and call queue_draw
* gtk/gtkwindow.c (gtk_window_set_default): just queue a draw when
widgets lose/get the default, instead of calling draw_default
* docs/Changes-2.0.txt: note about all this
Then fixed every widget in GTK, I won't list all the filenames.
Tue Feb 27 19:32:53 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreemodel.c (deleted_callback): Proxy out to
......
2001-02-28 Havoc Pennington <hp@redhat.com>
* gtk/gtkwidget.h (struct _GtkWidgetClass): Remove draw_focus and
draw_default
(gtk_widget_draw_focus): remove this function; we could instead
make it just gtk_widget_draw(), but in most cases I think the
result would be broken user code, so think it's better to have
that code not compile and get fixed
(gtk_widget_draw_default): ditto
* gtk/gtkwidget.c: Add default handlers for focus_in_event and
focus_out_event that set/unset GTK_HAS_FOCUS and call queue_draw
* gtk/gtkwindow.c (gtk_window_set_default): just queue a draw when
widgets lose/get the default, instead of calling draw_default
* docs/Changes-2.0.txt: note about all this
Then fixed every widget in GTK, I won't list all the filenames.
Tue Feb 27 19:32:53 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreemodel.c (deleted_callback): Proxy out to
......
2001-02-28 Havoc Pennington <hp@redhat.com>
* gtk/gtkwidget.h (struct _GtkWidgetClass): Remove draw_focus and
draw_default
(gtk_widget_draw_focus): remove this function; we could instead
make it just gtk_widget_draw(), but in most cases I think the
result would be broken user code, so think it's better to have
that code not compile and get fixed
(gtk_widget_draw_default): ditto
* gtk/gtkwidget.c: Add default handlers for focus_in_event and
focus_out_event that set/unset GTK_HAS_FOCUS and call queue_draw
* gtk/gtkwindow.c (gtk_window_set_default): just queue a draw when
widgets lose/get the default, instead of calling draw_default
* docs/Changes-2.0.txt: note about all this
Then fixed every widget in GTK, I won't list all the filenames.
Tue Feb 27 19:32:53 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreemodel.c (deleted_callback): Proxy out to
......
2001-02-28 Havoc Pennington <hp@redhat.com>
* gtk/gtkwidget.h (struct _GtkWidgetClass): Remove draw_focus and
draw_default
(gtk_widget_draw_focus): remove this function; we could instead
make it just gtk_widget_draw(), but in most cases I think the
result would be broken user code, so think it's better to have
that code not compile and get fixed
(gtk_widget_draw_default): ditto
* gtk/gtkwidget.c: Add default handlers for focus_in_event and
focus_out_event that set/unset GTK_HAS_FOCUS and call queue_draw
* gtk/gtkwindow.c (gtk_window_set_default): just queue a draw when
widgets lose/get the default, instead of calling draw_default
* docs/Changes-2.0.txt: note about all this
Then fixed every widget in GTK, I won't list all the filenames.
Tue Feb 27 19:32:53 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreemodel.c (deleted_callback): Proxy out to
......
2001-02-28 Havoc Pennington <hp@redhat.com>
* gtk/gtkwidget.h (struct _GtkWidgetClass): Remove draw_focus and
draw_default
(gtk_widget_draw_focus): remove this function; we could instead
make it just gtk_widget_draw(), but in most cases I think the
result would be broken user code, so think it's better to have
that code not compile and get fixed
(gtk_widget_draw_default): ditto
* gtk/gtkwidget.c: Add default handlers for focus_in_event and
focus_out_event that set/unset GTK_HAS_FOCUS and call queue_draw
* gtk/gtkwindow.c (gtk_window_set_default): just queue a draw when
widgets lose/get the default, instead of calling draw_default
* docs/Changes-2.0.txt: note about all this
Then fixed every widget in GTK, I won't list all the filenames.
Tue Feb 27 19:32:53 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreemodel.c (deleted_callback): Proxy out to
......
2001-02-28 Havoc Pennington <hp@redhat.com>
* gtk/gtkwidget.h (struct _GtkWidgetClass): Remove draw_focus and
draw_default
(gtk_widget_draw_focus): remove this function; we could instead
make it just gtk_widget_draw(), but in most cases I think the
result would be broken user code, so think it's better to have
that code not compile and get fixed
(gtk_widget_draw_default): ditto
* gtk/gtkwidget.c: Add default handlers for focus_in_event and
focus_out_event that set/unset GTK_HAS_FOCUS and call queue_draw
* gtk/gtkwindow.c (gtk_window_set_default): just queue a draw when
widgets lose/get the default, instead of calling draw_default
* docs/Changes-2.0.txt: note about all this
Then fixed every widget in GTK, I won't list all the filenames.
Tue Feb 27 19:32:53 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreemodel.c (deleted_callback): Proxy out to
......
......@@ -296,3 +296,14 @@ Incompatible Changes from GTK+-1.2 to GTK+-2.0:
- GdkColorContext is gone; you probably weren't using it anyway.
Use GdkColormap and the gdk_rgb_* functions instead.
- The draw_default and draw_focus methods/signals on GtkWidget are
gone; simply draw things in your expose handler.
gtk_widget_draw_focus() and gtk_widget_draw_default() wrapper
functions are also gone; just queue a draw on the widget,
or the part affected by the focus/default anyway.
Also, GtkWidget now has default implementations for focus_in_event
and focus_out_event. These set/unset GTK_HAS_FOCUS, and queue a
draw. So if your focus in/out handler just does that, you can delete
it.
......@@ -72,8 +72,6 @@ static void gtk_button_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static void gtk_button_paint (GtkWidget *widget,
GdkRectangle *area);
static void gtk_button_draw_focus (GtkWidget *widget);
static void gtk_button_draw_default (GtkWidget *widget);
static gint gtk_button_expose (GtkWidget *widget,
GdkEventExpose *event);
static gint gtk_button_button_press (GtkWidget *widget,
......@@ -84,10 +82,6 @@ static gint gtk_button_enter_notify (GtkWidget *widget,
GdkEventCrossing *event);
static gint gtk_button_leave_notify (GtkWidget *widget,
GdkEventCrossing *event);
static gint gtk_button_focus_in (GtkWidget *widget,
GdkEventFocus *event);
static gint gtk_button_focus_out (GtkWidget *widget,
GdkEventFocus *event);
static void gtk_button_add (GtkContainer *container,
GtkWidget *widget);
static void gtk_button_remove (GtkContainer *container,
......@@ -147,8 +141,6 @@ gtk_button_class_init (GtkButtonClass *klass)
object_class->get_arg = gtk_button_get_arg;
widget_class->realize = gtk_button_realize;
widget_class->draw_focus = gtk_button_draw_focus;
widget_class->draw_default = gtk_button_draw_default;
widget_class->size_request = gtk_button_size_request;
widget_class->size_allocate = gtk_button_size_allocate;
widget_class->expose_event = gtk_button_expose;
......@@ -156,8 +148,6 @@ gtk_button_class_init (GtkButtonClass *klass)
widget_class->button_release_event = gtk_button_button_release;
widget_class->enter_notify_event = gtk_button_enter_notify;
widget_class->leave_notify_event = gtk_button_leave_notify;
widget_class->focus_in_event = gtk_button_focus_in;
widget_class->focus_out_event = gtk_button_focus_out;
container_class->add = gtk_button_add;
container_class->remove = gtk_button_remove;
......@@ -690,18 +680,6 @@ gtk_button_paint (GtkWidget *widget,
}
}
static void
gtk_button_draw_focus (GtkWidget *widget)
{
gtk_widget_draw (widget, NULL);
}
static void
gtk_button_draw_default (GtkWidget *widget)
{
gtk_widget_draw (widget, NULL);
}
static gint
gtk_button_expose (GtkWidget *widget,
GdkEventExpose *event)
......@@ -819,34 +797,6 @@ gtk_button_leave_notify (GtkWidget *widget,
return FALSE;
}
static gint
gtk_button_focus_in (GtkWidget *widget,
GdkEventFocus *event)
{
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_BUTTON (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS);
gtk_widget_draw_focus (widget);
return FALSE;
}
static gint
gtk_button_focus_out (GtkWidget *widget,
GdkEventFocus *event)
{
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_BUTTON (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS);
gtk_widget_draw_focus (widget);
return FALSE;
}
static void
gtk_button_add (GtkContainer *container,
GtkWidget *widget)
......
......@@ -284,10 +284,6 @@ static gint gtk_calendar_leave_notify (GtkWidget *widget,
GdkEventCrossing *event);
static gint gtk_calendar_key_press (GtkWidget *widget,
GdkEventKey *event);
static gint gtk_calendar_focus_in (GtkWidget *widget,
GdkEventFocus *event);
static gint gtk_calendar_focus_out (GtkWidget *widget,
GdkEventFocus *event);
static void gtk_calendar_state_changed (GtkWidget *widget,
GtkStateType previous_state);
static void gtk_calendar_style_set (GtkWidget *widget,
......@@ -358,7 +354,6 @@ gtk_calendar_class_init (GtkCalendarClass *class)
widget_class->realize = gtk_calendar_realize;
widget_class->unrealize = gtk_calendar_unrealize;
widget_class->expose_event = gtk_calendar_expose;
widget_class->draw_focus = gtk_calendar_draw_focus;
widget_class->size_request = gtk_calendar_size_request;
widget_class->size_allocate = gtk_calendar_size_allocate;
widget_class->button_press_event = gtk_calendar_button_press;
......@@ -366,8 +361,6 @@ gtk_calendar_class_init (GtkCalendarClass *class)
widget_class->enter_notify_event = gtk_calendar_enter_notify;
widget_class->leave_notify_event = gtk_calendar_leave_notify;
widget_class->key_press_event = gtk_calendar_key_press;
widget_class->focus_in_event = gtk_calendar_focus_in;
widget_class->focus_out_event = gtk_calendar_focus_out;
widget_class->style_set = gtk_calendar_style_set;
widget_class->state_changed = gtk_calendar_state_changed;
......@@ -1484,7 +1477,7 @@ gtk_calendar_expose (GtkWidget *widget,
if (event->window == private_data->week_win)
gtk_calendar_paint_week_numbers (widget);
if (event->window == widget->window)
gtk_widget_draw_focus (widget);
gtk_calendar_draw_focus (widget);
}
return FALSE;
......@@ -1516,7 +1509,7 @@ gtk_calendar_paint (GtkWidget *widget,
if (private_data->week_win != NULL)
gtk_calendar_paint_week_numbers (widget);
gtk_widget_draw_focus (widget);
gtk_calendar_draw_focus (widget);
}
static void
......@@ -2622,25 +2615,6 @@ gtk_calendar_state_changed (GtkWidget *widget,
gtk_calendar_set_background (widget);
}
static gint
gtk_calendar_focus_in (GtkWidget *widget,
GdkEventFocus *event)
{
GtkCalendar *calendar;
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_CALENDAR (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
calendar = GTK_CALENDAR (widget);
GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS);
gtk_widget_draw_focus (widget);
gtk_calendar_paint_day (widget, calendar->focus_row, calendar->focus_col);
return FALSE;
}
static void
gtk_calendar_destroy (GtkObject *object)
{
......@@ -2651,25 +2625,6 @@ gtk_calendar_destroy (GtkObject *object)
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
static gint
gtk_calendar_focus_out (GtkWidget *widget,
GdkEventFocus *event)
{
GtkCalendar *calendar;
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_CALENDAR (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
calendar = GTK_CALENDAR (widget);
GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS);
gtk_widget_draw_focus (widget);
gtk_calendar_paint_day (widget, calendar->focus_row, calendar->focus_col);
return FALSE;
}
static gint
gtk_calendar_key_press (GtkWidget *widget,
GdkEventKey *event)
......
......@@ -34,7 +34,6 @@
static void gtk_check_button_class_init (GtkCheckButtonClass *klass);
static void gtk_check_button_init (GtkCheckButton *check_button);
static void gtk_check_button_draw_focus (GtkWidget *widget);
static void gtk_check_button_size_request (GtkWidget *widget,
GtkRequisition *requisition);
static void gtk_check_button_size_allocate (GtkWidget *widget,
......@@ -84,7 +83,6 @@ gtk_check_button_class_init (GtkCheckButtonClass *class)
widget_class = (GtkWidgetClass*) class;
parent_class = gtk_type_class (gtk_toggle_button_get_type ());
widget_class->draw_focus = gtk_check_button_draw_focus;
widget_class->size_request = gtk_check_button_size_request;
widget_class->size_allocate = gtk_check_button_size_allocate;
widget_class->expose_event = gtk_check_button_expose;
......@@ -156,22 +154,6 @@ gtk_check_button_paint (GtkWidget *widget,
}
}
static void
gtk_check_button_draw_focus (GtkWidget *widget)
{
gint border_width;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_CHECK_BUTTON (widget));
border_width = GTK_CONTAINER (widget)->border_width;
gtk_widget_queue_clear_area (widget->parent,
border_width + widget->allocation.x,
border_width + widget->allocation.y,
widget->allocation.width - 2 * border_width,
widget->allocation.height - 2 * border_width);
}
static void
gtk_check_button_size_request (GtkWidget *widget,
GtkRequisition *requisition)
......
......@@ -523,7 +523,6 @@ gtk_clist_class_init (GtkCListClass *klass)
widget_class->size_allocate = gtk_clist_size_allocate;
widget_class->focus_in_event = gtk_clist_focus_in;
widget_class->focus_out_event = gtk_clist_focus_out;
widget_class->draw_focus = gtk_clist_draw_focus;
widget_class->style_set = gtk_clist_style_set;
widget_class->drag_begin = gtk_clist_drag_begin;
widget_class->drag_end = gtk_clist_drag_end;
......@@ -6637,10 +6636,10 @@ gtk_clist_focus_in (GtkWidget *widget,
gtk_signal_emit (GTK_OBJECT (clist), clist_signals[SELECT_ROW],
clist->focus_row, -1, event);
else
gtk_widget_draw_focus (widget);
gtk_clist_draw_focus (widget);
}
else
gtk_widget_draw_focus (widget);
gtk_clist_draw_focus (widget);
return FALSE;
}
......@@ -6657,7 +6656,7 @@ gtk_clist_focus_out (GtkWidget *widget,
GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS);
gtk_widget_draw_focus (widget);
gtk_clist_draw_focus (widget);
clist = GTK_CLIST (widget);
......
......@@ -5781,9 +5781,8 @@ real_undo_selection (GtkCList *clist)
if (GTK_WIDGET_HAS_FOCUS (clist) && clist->focus_row != clist->undo_anchor)
{
gtk_widget_draw_focus (GTK_WIDGET (clist));
clist->focus_row = clist->undo_anchor;
gtk_widget_draw_focus (GTK_WIDGET (clist));
gtk_widget_queue_draw (GTK_WIDGET (clist));
}
else
clist->focus_row = clist->undo_anchor;
......
......@@ -327,7 +327,6 @@ gtk_entry_class_init (GtkEntryClass *class)
widget_class->realize = gtk_entry_realize;
widget_class->unrealize = gtk_entry_unrealize;
widget_class->draw_focus = gtk_entry_draw_focus;
widget_class->size_request = gtk_entry_size_request;
widget_class->size_allocate = gtk_entry_size_allocate;
widget_class->expose_event = gtk_entry_expose;
......@@ -1033,7 +1032,7 @@ gtk_entry_expose (GtkWidget *widget,
entry = GTK_ENTRY (widget);
if (widget->window == event->window)
gtk_widget_draw_focus (widget);
gtk_entry_draw_focus (widget);
else if (entry->text_area == event->window)
{
gtk_entry_draw_text (GTK_ENTRY (widget));
......@@ -1246,7 +1245,7 @@ gtk_entry_focus_in (GtkWidget *widget,
g_return_val_if_fail (event != NULL, FALSE);
GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS);
gtk_widget_draw_focus (widget);
gtk_entry_draw_focus (widget);
gtk_entry_queue_draw (GTK_ENTRY (widget));
GTK_ENTRY (widget)->need_im_reset = TRUE;
......@@ -1264,7 +1263,7 @@ gtk_entry_focus_out (GtkWidget *widget,
g_return_val_if_fail (event != NULL, FALSE);
GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS);
gtk_widget_draw_focus (widget);
gtk_entry_draw_focus (widget);
gtk_entry_queue_draw (GTK_ENTRY (widget));
GTK_ENTRY (widget)->need_im_reset = TRUE;
......
......@@ -56,15 +56,10 @@ static void gtk_list_item_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static void gtk_list_item_style_set (GtkWidget *widget,
GtkStyle *previous_style);
static void gtk_list_item_draw_focus (GtkWidget *widget);
static gint gtk_list_item_button_press (GtkWidget *widget,
GdkEventButton *event);
static gint gtk_list_item_expose (GtkWidget *widget,
GdkEventExpose *event);
static gint gtk_list_item_focus_in (GtkWidget *widget,
GdkEventFocus *event);
static gint gtk_list_item_focus_out (GtkWidget *widget,
GdkEventFocus *event);
static void gtk_real_list_item_select (GtkItem *item);
static void gtk_real_list_item_deselect (GtkItem *item);
static void gtk_real_list_item_toggle (GtkItem *item);
......@@ -117,11 +112,8 @@ gtk_list_item_class_init (GtkListItemClass *class)
widget_class->size_request = gtk_list_item_size_request;
widget_class->size_allocate = gtk_list_item_size_allocate;
widget_class->style_set = gtk_list_item_style_set;
widget_class->draw_focus = gtk_list_item_draw_focus;
widget_class->button_press_event = gtk_list_item_button_press;
widget_class->expose_event = gtk_list_item_expose;
widget_class->focus_in_event = gtk_list_item_focus_in;
widget_class->focus_out_event = gtk_list_item_focus_out;
item_class->select = gtk_real_list_item_select;
item_class->deselect = gtk_real_list_item_deselect;
......@@ -450,15 +442,6 @@ gtk_list_item_style_set (GtkWidget *widget,
gdk_window_set_background (widget->window, &widget->style->base[GTK_WIDGET_STATE (widget)]);
}
static void
gtk_list_item_draw_focus (GtkWidget *widget)
{
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_LIST_ITEM (widget));
gtk_widget_draw(widget, NULL);
}
static gint
gtk_list_item_button_press (GtkWidget *widget,
GdkEventButton *event)
......@@ -531,34 +514,6 @@ gtk_list_item_expose (GtkWidget *widget,
return FALSE;
}
static gint
gtk_list_item_focus_in (GtkWidget *widget,
GdkEventFocus *event)
{
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_LIST_ITEM (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS);
gtk_widget_draw_focus (widget);
return FALSE;
}
static gint
gtk_list_item_focus_out (GtkWidget *widget,
GdkEventFocus *event)
{
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_LIST_ITEM (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS);
gtk_widget_draw_focus (widget);
return FALSE;
}
static void
gtk_real_list_item_select (GtkItem *item)
{
......
......@@ -143,8 +143,6 @@ static gint gtk_notebook_key_press (GtkWidget *widget,
GdkEventKey *event);
static gint gtk_notebook_focus_in (GtkWidget *widget,
GdkEventFocus *event);
static gint gtk_notebook_focus_out (GtkWidget *widget,
GdkEventFocus *event);
static void gtk_notebook_draw_focus (GtkWidget *widget);
static void gtk_notebook_style_set (GtkWidget *widget,
GtkStyle *previous_style);
......@@ -299,8 +297,6 @@ gtk_notebook_class_init (GtkNotebookClass *class)
widget_class->motion_notify_event = gtk_notebook_motion_notify;
widget_class->key_press_event = gtk_notebook_key_press;
widget_class->focus_in_event = gtk_notebook_focus_in;
widget_class->focus_out_event = gtk_notebook_focus_out;
widget_class->draw_focus = gtk_notebook_draw_focus;
widget_class->style_set = gtk_notebook_style_set;
container_class->add = gtk_notebook_add;
......@@ -979,7 +975,7 @@ gtk_notebook_expose (GtkWidget *widget,
if (notebook->cur_page &&
gtk_widget_intersect (notebook->cur_page->tab_label,
&event->area, &child_area))
gtk_widget_draw_focus (widget);
gtk_notebook_draw_focus (widget);
}
child_event = *event;
......@@ -1278,24 +1274,8 @@ gtk_notebook_focus_in (GtkWidget *widget,
g_return_val_if_fail (event != NULL, FALSE);
GTK_NOTEBOOK (widget)->child_has_focus = FALSE;
GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS);
gtk_widget_draw_focus (widget);
return FALSE;
}
static gint
gtk_notebook_focus_out (GtkWidget *widget,
GdkEventFocus *event)
{
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_NOTEBOOK (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS);
gtk_widget_draw_focus (widget);
return FALSE;
return (* GTK_WIDGET_CLASS (parent_class)->focus_in_event) (widget, event);
}
static void
......
......@@ -49,7 +49,6 @@ static void gtk_range_get_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
static void gtk_range_destroy (GtkObject *object);
static void gtk_range_draw_focus (GtkWidget *widget);
static void gtk_range_unrealize (GtkWidget *widget);
static gint gtk_range_expose (GtkWidget *widget,
GdkEventExpose *event);
......@@ -65,10 +64,6 @@ static gint gtk_range_enter_notify (GtkWidget *widget,
GdkEventCrossing *event);
static gint gtk_range_leave_notify (GtkWidget *widget,
GdkEventCrossing *event);
static gint gtk_range_focus_in (GtkWidget *widget,
GdkEventFocus *event);
static gint gtk_range_focus_out (GtkWidget *widget,
GdkEventFocus *event);
static gint gtk_range_scroll_event (GtkWidget *widget,
GdkEventScroll *event);
static void gtk_range_style_set (GtkWidget *widget,
......@@ -138,7 +133,6 @@ gtk_range_class_init (GtkRangeClass *class)
object_class->get_arg = gtk_range_get_arg;
object_class->destroy = gtk_range_destroy;
widget_class->draw_focus = gtk_range_draw_focus;
widget_class->unrealize = gtk_range_unrealize;
widget_class->expose_event = gtk_range_expose;
widget_class->button_press_event = gtk_range_button_press;
......@@ -148,8 +142,6 @@ gtk_range_class_init (GtkRangeClass *class)
widget_class->key_press_event = gtk_range_key_press;
widget_class->enter_notify_event = gtk_range_enter_notify;
widget_class->leave_notify_event = gtk_range_leave_notify;
widget_class->focus_in_event = gtk_range_focus_in;
widget_class->focus_out_event = gtk_range_focus_out;
widget_class->style_set = gtk_range_style_set;
class->slider_width = 11;
......@@ -797,16 +789,6 @@ gtk_range_destroy (GtkObject *object)
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
static void
gtk_range_draw_focus (GtkWidget *widget)
{
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_RANGE (widget));
if (GTK_WIDGET_DRAWABLE (widget))
_gtk_range_draw_trough (GTK_RANGE (widget));
}
static void
gtk_range_unrealize (GtkWidget *widget)
{
......@@ -1272,32 +1254,6 @@ gtk_range_leave_notify (GtkWidget *widget,
return TRUE;
}
static gint
gtk_range_focus_in (GtkWidget *widget,
GdkEventFocus *event)
{
g_return_val_if_fail (GTK_IS_RANGE (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS);
gtk_widget_draw_focus (widget);
return TRUE;
}
static gint
gtk_range_focus_out (GtkWidget *widget,
GdkEventFocus *event)
{
g_return_val_if_fail (GTK_IS_RANGE (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS);
gtk_widget_draw_focus (widget);
return TRUE;
}
static void
gtk_real_range_draw_trough (GtkRange *range)
{
......
......@@ -553,7 +553,6 @@ gtk_text_class_init (GtkTextClass *class)
widget_class->unrealize = gtk_text_unrealize;