Commit 58af2b56 authored by Tim Janik's avatar Tim Janik Committed by Tim Janik

deprecated gtk_widget_freeze_accelerators and

Sat Nov 28 00:06:49 1998  Tim Janik  <timj@gtk.org>

        * gtk/gtkwidget.h:
        * gtk/gtkwidget.c: deprecated gtk_widget_freeze_accelerators and
        gtk_widget_thaw_accelerators, we provide gtk_widget_lock_accelerators
        and gtk_widget_unlock_accelerators.

        * gtk/gtklayout.h:
        * gtk/gtklayout.c: implemented incremental freezing facility.

        * gtk/gtktext.h:
        * gtk/gtktext.c: implemented incremental freezing facility.

        * gtk/gtkenums.h:
        * gtk/gtkaccelgroup.h: moved enum GtkAccelFlags into this place.

        * gtk/gtkentry.h:
        * gtk/gtkentry.c:
        deprecated gtk_entry_adjust_scroll().

        * random GtkType, macro and indentation fixes.

Fri Nov 27 22:50:15 1998  Tim Janik  <timj@gtk.org>

        * gtk/gtkclist.h:
        * gtk/gtkclist.c: implemented incremental freezing facility, added
        a new class member (*refresh)() which takes over the thaw
        functionality. the clist FROZEN flag got removed on the way.
        * gtk/gtkctree.c: adaptions to feature the clist refresh functionality
        and incremental freezing.

        * gtk/gtkcalendar.c: implemented incremental freezing facility.
parent 36d80dc3
Sat Nov 28 00:06:49 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: deprecated gtk_widget_freeze_accelerators and
gtk_widget_thaw_accelerators, we provide gtk_widget_lock_accelerators
and gtk_widget_unlock_accelerators.
* gtk/gtklayout.h:
* gtk/gtklayout.c: implemented incremental freezing facility.
* gtk/gtktext.h:
* gtk/gtktext.c: implemented incremental freezing facility.
* gtk/gtkenums.h:
* gtk/gtkaccelgroup.h: moved enum GtkAccelFlags into this place.
* gtk/gtkentry.h:
* gtk/gtkentry.c:
deprecated gtk_entry_adjust_scroll().
* random GtkType, macro and indentation fixes.
Fri Nov 27 22:50:15 1998 Tim Janik <timj@gtk.org>
* gtk/gtkclist.h:
* gtk/gtkclist.c: implemented incremental freezing facility, added
a new class member (*refresh)() which takes over the thaw
functionality. the clist FROZEN flag got removed on the way.
* gtk/gtkctree.c: adaptions to feature the clist refresh functionality
and incremental freezing.
* gtk/gtkcalendar.c: implemented incremental freezing facility.
Fri Nov 27 11:41:27 1998 Raph Levien <raph@gimp.org>
* gdk/gdkinputcommon.h (gdk_input_common_init): Fixed it so that
......
Sat Nov 28 00:06:49 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: deprecated gtk_widget_freeze_accelerators and
gtk_widget_thaw_accelerators, we provide gtk_widget_lock_accelerators
and gtk_widget_unlock_accelerators.
* gtk/gtklayout.h:
* gtk/gtklayout.c: implemented incremental freezing facility.
* gtk/gtktext.h:
* gtk/gtktext.c: implemented incremental freezing facility.
* gtk/gtkenums.h:
* gtk/gtkaccelgroup.h: moved enum GtkAccelFlags into this place.
* gtk/gtkentry.h:
* gtk/gtkentry.c:
deprecated gtk_entry_adjust_scroll().
* random GtkType, macro and indentation fixes.
Fri Nov 27 22:50:15 1998 Tim Janik <timj@gtk.org>
* gtk/gtkclist.h:
* gtk/gtkclist.c: implemented incremental freezing facility, added
a new class member (*refresh)() which takes over the thaw
functionality. the clist FROZEN flag got removed on the way.
* gtk/gtkctree.c: adaptions to feature the clist refresh functionality
and incremental freezing.
* gtk/gtkcalendar.c: implemented incremental freezing facility.
Fri Nov 27 11:41:27 1998 Raph Levien <raph@gimp.org>
* gdk/gdkinputcommon.h (gdk_input_common_init): Fixed it so that
......
Sat Nov 28 00:06:49 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: deprecated gtk_widget_freeze_accelerators and
gtk_widget_thaw_accelerators, we provide gtk_widget_lock_accelerators
and gtk_widget_unlock_accelerators.
* gtk/gtklayout.h:
* gtk/gtklayout.c: implemented incremental freezing facility.
* gtk/gtktext.h:
* gtk/gtktext.c: implemented incremental freezing facility.
* gtk/gtkenums.h:
* gtk/gtkaccelgroup.h: moved enum GtkAccelFlags into this place.
* gtk/gtkentry.h:
* gtk/gtkentry.c:
deprecated gtk_entry_adjust_scroll().
* random GtkType, macro and indentation fixes.
Fri Nov 27 22:50:15 1998 Tim Janik <timj@gtk.org>
* gtk/gtkclist.h:
* gtk/gtkclist.c: implemented incremental freezing facility, added
a new class member (*refresh)() which takes over the thaw
functionality. the clist FROZEN flag got removed on the way.
* gtk/gtkctree.c: adaptions to feature the clist refresh functionality
and incremental freezing.
* gtk/gtkcalendar.c: implemented incremental freezing facility.
Fri Nov 27 11:41:27 1998 Raph Levien <raph@gimp.org>
* gdk/gdkinputcommon.h (gdk_input_common_init): Fixed it so that
......
Sat Nov 28 00:06:49 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: deprecated gtk_widget_freeze_accelerators and
gtk_widget_thaw_accelerators, we provide gtk_widget_lock_accelerators
and gtk_widget_unlock_accelerators.
* gtk/gtklayout.h:
* gtk/gtklayout.c: implemented incremental freezing facility.
* gtk/gtktext.h:
* gtk/gtktext.c: implemented incremental freezing facility.
* gtk/gtkenums.h:
* gtk/gtkaccelgroup.h: moved enum GtkAccelFlags into this place.
* gtk/gtkentry.h:
* gtk/gtkentry.c:
deprecated gtk_entry_adjust_scroll().
* random GtkType, macro and indentation fixes.
Fri Nov 27 22:50:15 1998 Tim Janik <timj@gtk.org>
* gtk/gtkclist.h:
* gtk/gtkclist.c: implemented incremental freezing facility, added
a new class member (*refresh)() which takes over the thaw
functionality. the clist FROZEN flag got removed on the way.
* gtk/gtkctree.c: adaptions to feature the clist refresh functionality
and incremental freezing.
* gtk/gtkcalendar.c: implemented incremental freezing facility.
Fri Nov 27 11:41:27 1998 Raph Levien <raph@gimp.org>
* gdk/gdkinputcommon.h (gdk_input_common_init): Fixed it so that
......
Sat Nov 28 00:06:49 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: deprecated gtk_widget_freeze_accelerators and
gtk_widget_thaw_accelerators, we provide gtk_widget_lock_accelerators
and gtk_widget_unlock_accelerators.
* gtk/gtklayout.h:
* gtk/gtklayout.c: implemented incremental freezing facility.
* gtk/gtktext.h:
* gtk/gtktext.c: implemented incremental freezing facility.
* gtk/gtkenums.h:
* gtk/gtkaccelgroup.h: moved enum GtkAccelFlags into this place.
* gtk/gtkentry.h:
* gtk/gtkentry.c:
deprecated gtk_entry_adjust_scroll().
* random GtkType, macro and indentation fixes.
Fri Nov 27 22:50:15 1998 Tim Janik <timj@gtk.org>
* gtk/gtkclist.h:
* gtk/gtkclist.c: implemented incremental freezing facility, added
a new class member (*refresh)() which takes over the thaw
functionality. the clist FROZEN flag got removed on the way.
* gtk/gtkctree.c: adaptions to feature the clist refresh functionality
and incremental freezing.
* gtk/gtkcalendar.c: implemented incremental freezing facility.
Fri Nov 27 11:41:27 1998 Raph Levien <raph@gimp.org>
* gdk/gdkinputcommon.h (gdk_input_common_init): Fixed it so that
......
Sat Nov 28 00:06:49 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: deprecated gtk_widget_freeze_accelerators and
gtk_widget_thaw_accelerators, we provide gtk_widget_lock_accelerators
and gtk_widget_unlock_accelerators.
* gtk/gtklayout.h:
* gtk/gtklayout.c: implemented incremental freezing facility.
* gtk/gtktext.h:
* gtk/gtktext.c: implemented incremental freezing facility.
* gtk/gtkenums.h:
* gtk/gtkaccelgroup.h: moved enum GtkAccelFlags into this place.
* gtk/gtkentry.h:
* gtk/gtkentry.c:
deprecated gtk_entry_adjust_scroll().
* random GtkType, macro and indentation fixes.
Fri Nov 27 22:50:15 1998 Tim Janik <timj@gtk.org>
* gtk/gtkclist.h:
* gtk/gtkclist.c: implemented incremental freezing facility, added
a new class member (*refresh)() which takes over the thaw
functionality. the clist FROZEN flag got removed on the way.
* gtk/gtkctree.c: adaptions to feature the clist refresh functionality
and incremental freezing.
* gtk/gtkcalendar.c: implemented incremental freezing facility.
Fri Nov 27 11:41:27 1998 Raph Levien <raph@gimp.org>
* gdk/gdkinputcommon.h (gdk_input_common_init): Fixed it so that
......
Sat Nov 28 00:06:49 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: deprecated gtk_widget_freeze_accelerators and
gtk_widget_thaw_accelerators, we provide gtk_widget_lock_accelerators
and gtk_widget_unlock_accelerators.
* gtk/gtklayout.h:
* gtk/gtklayout.c: implemented incremental freezing facility.
* gtk/gtktext.h:
* gtk/gtktext.c: implemented incremental freezing facility.
* gtk/gtkenums.h:
* gtk/gtkaccelgroup.h: moved enum GtkAccelFlags into this place.
* gtk/gtkentry.h:
* gtk/gtkentry.c:
deprecated gtk_entry_adjust_scroll().
* random GtkType, macro and indentation fixes.
Fri Nov 27 22:50:15 1998 Tim Janik <timj@gtk.org>
* gtk/gtkclist.h:
* gtk/gtkclist.c: implemented incremental freezing facility, added
a new class member (*refresh)() which takes over the thaw
functionality. the clist FROZEN flag got removed on the way.
* gtk/gtkctree.c: adaptions to feature the clist refresh functionality
and incremental freezing.
* gtk/gtkcalendar.c: implemented incremental freezing facility.
Fri Nov 27 11:41:27 1998 Raph Levien <raph@gimp.org>
* gdk/gdkinputcommon.h (gdk_input_common_init): Fixed it so that
......
......@@ -36,14 +36,22 @@ extern "C" {
typedef struct _GtkAccelGroup GtkAccelGroup;
typedef struct _GtkAccelEntry GtkAccelEntry;
/* enum GtkAccelFlags:
*
* GTK_ACCEL_VISIBLE - should the accelerator appear in
* the widget's display?
* GTK_ACCEL_SIGNAL_VISIBLE - should the signal associated
* with this accelerator be also visible?
* GTK_ACCEL_LOCKED - may the accelerator be removed again?
*/
typedef enum
{
/* should the accelerator appear in
* the widget's display?
*/
GTK_ACCEL_VISIBLE = 1 << 0,
/* should the signal associated with
* this accelerator be also visible?
*/
GTK_ACCEL_SIGNAL_VISIBLE = 1 << 1,
/* may the accelerator be removed
* again?
*/
GTK_ACCEL_LOCKED = 1 << 2,
GTK_ACCEL_MASK = 0x07
} GtkAccelFlags;
struct _GtkAccelGroup
{
......
......@@ -216,7 +216,9 @@ struct _GtkCalendarPrivateData
GdkWindow *week_win;
GdkWindow *arrow_win[4];
guint header_h, day_name_h, main_h;
guint header_h;
guint day_name_h;
guint main_h;
guint arrow_state[4];
guint arrow_width;
......@@ -234,12 +236,13 @@ struct _GtkCalendarPrivateData
guint max_label_char_descent;
guint max_week_char_width;
guint freeze_count;
/* flags */
unsigned int dirty_header:1;
unsigned int dirty_day_names:1;
unsigned int dirty_main:1;
unsigned int dirty_week:1;
unsigned int frozen;
guint dirty_header : 1;
guint dirty_day_names : 1;
guint dirty_main : 1;
guint dirty_week : 1;
};
#define GTK_CALENDAR_PRIVATE_DATA(widget) (((GtkCalendarPrivateData*)(GTK_CALENDAR (widget)->private_data)))
......@@ -466,12 +469,13 @@ gtk_calendar_init (GtkCalendar *calendar)
private_data->max_label_char_descent = 0;
private_data->arrow_width = 10;
private_data->freeze_count = 0;
private_data->dirty_header = 0;
private_data->dirty_day_names = 0;
private_data->dirty_week = 0;
private_data->dirty_main = 0;
private_data->frozen = 0;
}
GtkWidget*
......@@ -1519,7 +1523,7 @@ gtk_calendar_paint_header (GtkWidget *widget)
calendar = GTK_CALENDAR (widget);
private_data = GTK_CALENDAR_PRIVATE_DATA (widget);
if (private_data->frozen)
if (private_data->freeze_count)
{
private_data->dirty_header = 1;
return;
......@@ -1609,7 +1613,7 @@ gtk_calendar_paint_day_names (GtkWidget *widget)
* Handle freeze/thaw functionality
*/
if (private_data->frozen)
if (private_data->freeze_count)
{
private_data->dirty_day_names = 1;
return;
......@@ -1688,7 +1692,7 @@ gtk_calendar_paint_week_numbers (GtkWidget *widget)
* Handle freeze/thaw functionality
*/
if (private_data->frozen)
if (private_data->freeze_count)
{
private_data->dirty_week = 1;
return;
......@@ -1811,7 +1815,7 @@ gtk_calendar_paint_day (GtkWidget *widget,
* Handle freeze/thaw functionality
*/
if (private_data->frozen)
if (private_data->freeze_count)
{
private_data->dirty_main = 1;
return;
......@@ -1908,7 +1912,7 @@ gtk_calendar_paint_main (GtkWidget *widget)
calendar = GTK_CALENDAR (widget);
private_data = GTK_CALENDAR_PRIVATE_DATA (widget);
if (private_data->frozen)
if (private_data->freeze_count)
{
private_data->dirty_main = 1;
return;
......@@ -2453,7 +2457,7 @@ gtk_calendar_paint_arrow (GtkWidget *widget,
calendar = GTK_CALENDAR (widget);
private_data = GTK_CALENDAR_PRIVATE_DATA (widget);
if (private_data->frozen)
if (private_data->freeze_count)
{
private_data->dirty_header = 1;
return;
......@@ -2487,7 +2491,7 @@ gtk_calendar_freeze (GtkCalendar *calendar)
g_return_if_fail (calendar != NULL);
g_return_if_fail (GTK_IS_CALENDAR (calendar));
GTK_CALENDAR_PRIVATE_DATA (calendar)->frozen++;
GTK_CALENDAR_PRIVATE_DATA (calendar)->freeze_count++;
}
void
......@@ -2499,29 +2503,26 @@ gtk_calendar_thaw (GtkCalendar *calendar)
g_return_if_fail (GTK_IS_CALENDAR (calendar));
private_data = GTK_CALENDAR_PRIVATE_DATA (calendar);
if (private_data->frozen)
{
private_data->frozen--;
if (private_data->frozen)
return;
if (private_data->dirty_header)
if (GTK_WIDGET_DRAWABLE (calendar))
gtk_calendar_paint_header (GTK_WIDGET (calendar));
if (private_data->dirty_day_names)
if (GTK_WIDGET_DRAWABLE (calendar))
gtk_calendar_paint_day_names (GTK_WIDGET (calendar));
if (private_data->dirty_week)
if (GTK_WIDGET_DRAWABLE (calendar))
gtk_calendar_paint_week_numbers (GTK_WIDGET (calendar));
if (private_data->dirty_main)
if (GTK_WIDGET_DRAWABLE (calendar))
gtk_calendar_paint_main (GTK_WIDGET (calendar));
}
if (private_data->freeze_count)
if (!(--private_data->freeze_count))
{
if (private_data->dirty_header)
if (GTK_WIDGET_DRAWABLE (calendar))
gtk_calendar_paint_header (GTK_WIDGET (calendar));
if (private_data->dirty_day_names)
if (GTK_WIDGET_DRAWABLE (calendar))
gtk_calendar_paint_day_names (GTK_WIDGET (calendar));
if (private_data->dirty_week)
if (GTK_WIDGET_DRAWABLE (calendar))
gtk_calendar_paint_week_numbers (GTK_WIDGET (calendar));
if (private_data->dirty_main)
if (GTK_WIDGET_DRAWABLE (calendar))
gtk_calendar_paint_main (GTK_WIDGET (calendar));
}
}
static void
......
......@@ -79,7 +79,7 @@ struct _GtkCalendar
gint highlight_col;
gpointer private_data;
char grow_space [32];
gchar grow_space [32];
};
struct _GtkCalendarClass
......
......@@ -110,7 +110,14 @@ LIST_WIDTH (GtkCList * clist)
return 0;
}
#define GTK_CLIST_CLASS_FW(_widget_) GTK_CLIST_CLASS (GTK_OBJECT (_widget_)->klass)
#define GTK_CLIST_CLASS_FW(_widget_) GTK_CLIST_CLASS (((GtkObject*) (_widget_))->klass)
/* redraw the list if it's not frozen */
#define CLIST_UNFROZEN(clist) (((GtkCList*) (clist))->freeze_count == 0)
#define CLIST_REFRESH(clist) G_STMT_START { \
if (CLIST_UNFROZEN (clist)) \
GTK_CLIST_CLASS_FW (clist)->refresh ((GtkCList*) (clist)); \
} G_STMT_END
/* Signals */
......@@ -324,7 +331,8 @@ static void draw_row (GtkCList *clist,
GtkCListRow *clist_row);
static void draw_rows (GtkCList *clist,
GdkRectangle *area);
static void clist_refresh (GtkCList *clist);
/* Size Allocation / Requisition */
static void size_allocate_title_buttons (GtkCList *clist);
static void size_allocate_columns (GtkCList *clist,
......@@ -587,6 +595,7 @@ gtk_clist_class_init (GtkCListClass *klass)
container_class->set_focus_child = gtk_clist_set_focus_child;
klass->scroll_adjustments = gtk_clist_scroll_adjustments;
klass->refresh = clist_refresh;
klass->select_row = real_select_row;
klass->unselect_row = real_unselect_row;
klass->undo_selection = real_undo_selection;
......@@ -875,11 +884,12 @@ gtk_clist_init (GtkCList *clist)
clist->flags = 0;
GTK_WIDGET_UNSET_FLAGS (clist, GTK_NO_WINDOW);
GTK_CLIST_SET_FLAG (clist, CLIST_FROZEN);
clist->row_mem_chunk = NULL;
clist->cell_mem_chunk = NULL;
clist->freeze_count = 0;
clist->rows = 0;
clist->row_center_offset = 0;
clist->row_height = 0;
......@@ -1191,7 +1201,7 @@ gtk_clist_freeze (GtkCList *clist)
g_return_if_fail (clist != NULL);
g_return_if_fail (GTK_IS_CLIST (clist));
GTK_CLIST_SET_FLAG (clist, CLIST_FROZEN);
clist->freeze_count++;
}
void
......@@ -1200,9 +1210,11 @@ gtk_clist_thaw (GtkCList *clist)
g_return_if_fail (clist != NULL);
g_return_if_fail (GTK_IS_CLIST (clist));
GTK_CLIST_UNSET_FLAG (clist, CLIST_FROZEN);
adjust_adjustments (clist, FALSE);
draw_rows (clist, NULL);
if (clist->freeze_count)
{
clist->freeze_count--;
CLIST_REFRESH (clist);
}
}
/* PUBLIC COLUMN FUNCTIONS
......@@ -1501,7 +1513,7 @@ gtk_clist_set_column_justification (GtkCList *clist,
}
}
if (!GTK_CLIST_FROZEN (clist))
if (CLIST_UNFROZEN (clist))
draw_rows (clist, NULL);
}
......@@ -1768,11 +1780,7 @@ real_resize_column (GtkCList *clist,
size_allocate_columns (clist, TRUE);
size_allocate_title_buttons (clist);
if (!GTK_CLIST_FROZEN (clist))
{
adjust_adjustments (clist, FALSE);
draw_rows (clist, NULL);
}
CLIST_REFRESH (clist);
}
static void
......@@ -2069,11 +2077,7 @@ gtk_clist_set_row_height (GtkCList *clist,
widget->style->font->descent - 1) / 2;
}
if (!GTK_CLIST_FROZEN (clist))
{
adjust_adjustments (clist, FALSE);
draw_rows (clist, NULL);
}
CLIST_REFRESH (clist);
}
void
......@@ -2169,7 +2173,7 @@ gtk_clist_set_text (GtkCList *clist,
(clist, clist_row, column, GTK_CELL_TEXT, text, 0, NULL, NULL);
/* redraw the list if it's not frozen */
if (!GTK_CLIST_FROZEN (clist))
if (CLIST_UNFROZEN (clist))
{
if (gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE)
GTK_CLIST_CLASS_FW (clist)->draw_row (clist, NULL, row, clist_row);
......@@ -2230,7 +2234,7 @@ gtk_clist_set_pixmap (GtkCList *clist,
(clist, clist_row, column, GTK_CELL_PIXMAP, NULL, 0, pixmap, mask);
/* redraw the list if it's not frozen */
if (!GTK_CLIST_FROZEN (clist))
if (CLIST_UNFROZEN (clist))
{
if (gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE)
GTK_CLIST_CLASS_FW (clist)->draw_row (clist, NULL, row, clist_row);
......@@ -2296,7 +2300,7 @@ gtk_clist_set_pixtext (GtkCList *clist,
(clist, clist_row, column, GTK_CELL_PIXTEXT, text, spacing, pixmap, mask);
/* redraw the list if it's not frozen */
if (!GTK_CLIST_FROZEN (clist))
if (CLIST_UNFROZEN (clist))
{
if (gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE)
GTK_CLIST_CLASS_FW (clist)->draw_row (clist, NULL, row, clist_row);
......@@ -2370,8 +2374,7 @@ gtk_clist_set_shift (GtkCList *clist,
column_auto_resize (clist, clist_row, column, requisition.width);
if (!GTK_CLIST_FROZEN (clist)
&& (gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE))
if (CLIST_UNFROZEN (clist) && gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE)
GTK_CLIST_CLASS_FW (clist)->draw_row (clist, NULL, row, clist_row);
}
......@@ -2660,7 +2663,7 @@ real_insert_row (GtkCList *clist,
sync_selection (clist, row, SYNC_INSERT);
/* redraw the list if it isn't frozen */
if (!GTK_CLIST_FROZEN (clist))
if (CLIST_UNFROZEN (clist))
{
adjust_adjustments (clist, FALSE);
......@@ -2726,7 +2729,7 @@ real_remove_row (GtkCList *clist,
row_delete (clist, clist_row);
/* redraw the row if it isn't frozen */
if (!GTK_CLIST_FROZEN (clist))
if (CLIST_UNFROZEN (clist))
{
adjust_adjustments (clist, FALSE);
......@@ -2785,8 +2788,7 @@ real_clear (GtkCList *clist)
if (clist->vadjustment)
{
gtk_adjustment_set_value (clist->vadjustment, 0.0);
if (!GTK_CLIST_FROZEN (clist))
gtk_clist_thaw (clist);
CLIST_REFRESH (clist);
}
else
gtk_widget_queue_resize (GTK_WIDGET (clist));
......@@ -2905,15 +2907,13 @@ gtk_clist_swap_rows (GtkCList *clist,
list = list->next;
}
if (!GTK_CLIST_FROZEN (clist))
if (CLIST_UNFROZEN (clist))
{
if (gtk_clist_row_is_visible (clist, last) != GTK_VISIBILITY_NONE)
GTK_CLIST_CLASS_FW (clist)->draw_row
(clist, NULL, last, GTK_CLIST_ROW (link2));
GTK_CLIST_CLASS_FW (clist)->draw_row (clist, NULL, last, GTK_CLIST_ROW (link2));
if (gtk_clist_row_is_visible (clist, first) != GTK_VISIBILITY_NONE)
GTK_CLIST_CLASS_FW (clist)->draw_row
(clist, NULL, first, GTK_CLIST_ROW (link1));
GTK_CLIST_CLASS_FW (clist)->draw_row (clist, NULL, first, GTK_CLIST_ROW (link1));
}
}
......@@ -2973,8 +2973,7 @@ gtk_clist_set_foreground (GtkCList *clist,
else
clist_row->fg_set = FALSE;
if (!GTK_CLIST_FROZEN (clist)
&& (gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE))
if (CLIST_UNFROZEN (clist) && gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE)
GTK_CLIST_CLASS_FW (clist)->draw_row (clist, NULL, row, clist_row);
}
......@@ -3004,7 +3003,7 @@ gtk_clist_set_background (GtkCList *clist,
else
clist_row->bg_set = FALSE;
if (!GTK_CLIST_FROZEN (clist)
if (CLIST_UNFROZEN (clist)
&& (gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE))
GTK_CLIST_CLASS_FW (clist)->draw_row (clist, NULL, row, clist_row);
}
......@@ -3064,7 +3063,7 @@ gtk_clist_set_cell_style (GtkCList *clist,
column_auto_resize (clist, clist_row, column, requisition.width);
/* redraw the list if it's not frozen */
if (!GTK_CLIST_FROZEN (clist))
if (CLIST_UNFROZEN (clist))
{
if (gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE)
GTK_CLIST_CLASS_FW (clist)->draw_row (clist, NULL, row, clist_row);
......@@ -3148,7 +3147,7 @@ gtk_clist_set_row_style (GtkCList *clist,
g_free (old_width);
/* redraw the list if it's not frozen */
if (!GTK_CLIST_FROZEN (clist))
if (CLIST_UNFROZEN (clist))
{
if (gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE)
GTK_CLIST_CLASS_FW (clist)->draw_row (clist, NULL, row, clist_row);
......@@ -3375,7 +3374,7 @@ fake_toggle_row (GtkCList *clist,
else
clist->anchor_state = GTK_CLIST_ROW (work)->state = GTK_STATE_NORMAL;
if (!GTK_CLIST_FROZEN (clist) &&
if (CLIST_UNFROZEN (clist) &&
gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE)
GTK_CLIST_CLASS_FW (clist)->draw_row (clist, NULL, row,
GTK_CLIST_ROW (work));
......@@ -3506,7 +3505,7 @@ real_select_row (GtkCList *clist,
clist->selection_end =
g_list_append (clist->selection_end, GINT_TO_POINTER (row))->next;
if (!GTK_CLIST_FROZEN (clist)
if (CLIST_UNFROZEN (clist)
&& (gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE))
GTK_CLIST_CLASS_FW (clist)->draw_row (clist, NULL, row, clist_row);
}
......@@ -3538,7 +3537,7 @@ real_unselect_row (GtkCList *clist,
clist->selection = g_list_remove (clist->selection,
GINT_TO_POINTER (row));
if (!GTK_CLIST_FROZEN (clist)
if (CLIST_UNFROZEN (clist)
&& (gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE))
GTK_CLIST_CLASS_FW (clist)->draw_row (clist, NULL, row, clist_row);
}
......@@ -3654,7 +3653,7 @@ fake_unselect_all (GtkCList *clist,
{
GTK_CLIST_ROW (work)->state = GTK_STATE_SELECTED;
if (!GTK_CLIST_FROZEN (clist) &&
if (CLIST_UNFROZEN (clist) &&
gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE)
GTK_CLIST_CLASS_FW (clist)->draw_row (clist, NULL, row,
GTK_CLIST_ROW (work));
......@@ -3672,7 +3671,7 @@ fake_unselect_all (GtkCList *clist,
continue;
GTK_CLIST_ROW (work)->state = GTK_STATE_NORMAL;
if (!GTK_CLIST_FROZEN (clist) &&
if (CLIST_UNFROZEN (clist) &&
gtk_clist_row_is_visible (clist, i) != GTK_VISIBILITY_NONE)
GTK_CLIST_CLASS_FW (clist)->draw_row (clist, NULL, i,
GTK_CLIST_ROW (work));
......@@ -3768,18 +3767,13 @@ resync_selection (GtkCList *clist,
gint i;
gint e;
gint row;
gboolean thaw = FALSE;
GList *list;
GtkCListRow *clist_row;
if (clist->anchor < 0)
return;
if (!GTK_CLIST_FROZEN (clist))
{
GTK_CLIST_SET_FLAG (clist, CLIST_FROZEN);
thaw = TRUE;
}
gtk_clist_freeze (clist);
i = MIN (clist->anchor, clist->drag_pos);
e = MAX (clist->anchor, clist->drag_pos);
......@@ -3840,8 +3834,7 @@ resync_selection (GtkCList *clist,
clist->anchor = -1;
clist->drag_pos = -1;
if (thaw)
GTK_CLIST_UNSET_FLAG (clist, CLIST_FROZEN);
gtk_clist_thaw (clist);
}
static void
......@@ -4117,7 +4110,7 @@ gtk_clist_destroy (GtkObject *object)
clist = GTK_CLIST (object);
/* freeze the list */
GTK_CLIST_SET_FLAG (clist, CLIST_FROZEN);
clist->freeze_count++;
/* get rid of all the rows */
gtk_clist_clear (clist);
......@@ -4371,7 +4364,8 @@ gtk_clist_unrealize (GtkWidget *widget)
clist = GTK_CLIST (widget);
GTK_CLIST_SET_FLAG (clist, CLIST_FROZEN);
/* freeze the list */