1998-01-03 03:31:03 +00:00
|
|
|
/* GTK - The GIMP Toolkit
|
|
|
|
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball, Josh MacDonald,
|
1998-01-19 09:59:20 +00:00
|
|
|
* Copyright (C) 1997-1998 Jay Painter <jpaint@serv.net><jpaint@gimp.org>
|
1998-01-09 08:52:01 +00:00
|
|
|
*
|
1998-01-03 03:31:03 +00:00
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
1998-04-13 02:02:47 +00:00
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
1998-01-03 03:31:03 +00:00
|
|
|
*/
|
1999-02-24 07:37:18 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Modified by the GTK+ Team and others 1997-1999. See the AUTHORS
|
|
|
|
* file for a list of people on the GTK+ Team. See the ChangeLog
|
|
|
|
* files for a list of changes. These files are distributed with
|
|
|
|
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
|
|
|
*/
|
|
|
|
|
1998-01-03 03:31:03 +00:00
|
|
|
#include <stdlib.h>
|
1998-07-15 23:40:00 +00:00
|
|
|
#include <string.h>
|
Removed DEFS "+=" mess that breaks recent automakes. INCLUDES is the
* gdk/Makefile.am, gtk/Makefile.am:
Removed DEFS "+=" mess that breaks recent automakes.
INCLUDES is the correct way to add to CFLAGS from Makefile.am.
* gdk/gdk.c, gdk/gdkglobals.c, gdk/gdkimage.c, gdk/gdkinput.c,
gdk/gdkpixmap.c, gdk/gdkthreads.c, gdk/gdkwindow.c,
gdk/gxid_lib.c, gtk/fnmatch.c, gtk/gtkclist.c, gtk/gtkmain.c,
gtk/testthreads.c:
Include "config.h" instead of "../config.h".
Now that DEFS works again, automake will automatically pass us
the location of config.h in -I.
1998-11-24 05:58:53 +00:00
|
|
|
#include "config.h"
|
1998-07-15 23:40:00 +00:00
|
|
|
#include "gtkmain.h"
|
1998-01-03 03:31:03 +00:00
|
|
|
#include "gtkclist.h"
|
1998-07-15 23:40:00 +00:00
|
|
|
#include "gtkbindings.h"
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
#include "gtkdnd.h"
|
1998-07-15 23:40:00 +00:00
|
|
|
#include <gdk/gdkkeysyms.h>
|
1998-01-03 03:31:03 +00:00
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
/* length of button_actions array */
|
|
|
|
#define MAX_BUTTON 5
|
|
|
|
|
1998-01-24 19:14:42 +00:00
|
|
|
/* the number rows memchunk expands at a time */
|
Tue Mar 16 17:43:33 1999 Tim Janik <timj@gtk.org>
Wed Mar 17 01:46:28 1999 Tim Janik <timj@gtk.org>
* merges from gtk-1-2:
Tue Mar 16 17:43:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_string): ensure the
item factory class has been created.
(gtk_item_factory_parse_rc): likewise.
* gtk/gtkmenu.c:
keep proper references for old_active_menu_item.
(gtk_menu_reparent): unset the usize of the new parent,
so the menu can sanely be size requested and we don't get nasty screen
artefacts upon next reparentation.
(gtk_menu_motion_notify): set send_event to TRUE if we synthesize an
enter notify. only synthesize enter notifies if the pointer really is
inside the event window.
(gtk_menu_popdown): use gtk_menu_shell_deselect().
(gtk_menu_popup): move the background setting stuff into
gtk_menu_tearoff_bg_copy() so it can be called from other places as well.
* gtk/gtkmenushell.c (gtk_menu_shell_button_press): use
gtk_menu_shell_select_item() to select the new item.
(gtk_menu_shell_deselect): export this function, so gtkmenu.c can
do the right thing for deselection as well.
Sat Mar 15 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.[hc]:
(gtk_widget_accelerators_locked): return whether a widget's accelerators
are locked.
* gtk/gtkmenu.c (gtk_menu_key_press): don't remove or install new or
existing accelerators if the widget's accelerators are locked.
Sat Mar 14 19:44:05 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.[hc]: allow managing of foreign menu items.
* gtk/gtkmenu.c: truely forward key press and key release events to
the menu widget from the toplevel or tearoff window. we can't simply
connect to that, we need to stop further processing of the events as
well.
Sat Mar 13 13:14:17 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.c:
(gtk_menu_key_press): pass event->keyval, event->state to
gtk_accelerator_valid, instead of event->keyval twice.
refuse to install single letter accelerators for menus that use
single letter shortcuts.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): use
gtk_menu_ensure_uline_accel_group().
* gtk/gtkmenu.[hc]: added gtk_menu_ensure_uline_accel_group()
which will always return an uline accel group, made
gtk_menu_get_uline_accel_group() return NULL if the group isn't
yet created.
Mon Mar 15 01:03:27 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h (struct _GtkCListColumn): added button_passive flag.
* gtk/gtkclist.c (gtk_clist_column_title_passive):
Leave button sensitive, trap button_press, button_release,
motion_notify, enter_notify and leave_notify events instead.
(gtk_clist_column_title_active): disconnect event handler.
(gtk_clist_drag_data_get): fixed memory leak. Reported by
Guillaume Laurent <glaurent@worldnet.fr>
Wed Mar 10 23:49:55 1999 Lars Hamann <lars@gtk.org>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): fixed a few
width/height mixups.
* gtk/gtkctree.c (tree_delete): emit an tree_unselect_row signal
if needed.
Wed Mar 10 00:11:32 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c (create_item_factory): unref the item factory after
window's destruction.
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): keep a reference
count on the menu shell around the menu item's activation, since the
signal emission may cause menu shell destruction.
* gtk/gtkitemfactory.c:
the previous code leaked one accel group per menu. we use
gtk_menu_get_uline_accel_group() now to fix that, and with that
also create the underline accelerator group of the menus only if
required (i.e. an underline accelerator has been specified).
(gtk_item_factory_construct):
(gtk_item_factory_create_item): removed code that would create an
extra accel group for the menu (and leak references).
(gtk_item_factory_create_item): adapted the underline accelerator
installation code to properly feature gtk_menu_get_uline_accel_group().
* gtk/gtkmenu.[hc]: added gtk_menu_get_accel_group() to retrive
menu->accel_group, this may return NULL if the accelerator group
hasn't been set yet.
added gtk_menu_get_uline_accel_group() to retrive the underline
accelerator group of the menu, this will be created on demand
and proper care is taken about its reference count.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c:
dumped the approach of keeping a widgets by action list on the
factory since the factory<->widget destroy negotiation didn't work
and would be hard to get going at all. instead we keep a list of
GtkItemFactoryItem items on the factory (GtkItemFactoryItems are
persistant throughout a program's life time).
also, i removed the static const gchar *key_* variables, and made
them inline strings (they weren't actually used anyways).
(gtk_item_factory_add_item): update ifactory->items.
(gtk_item_factory_destroy): destroy ifactory->items (and remove
the item factory pointer from the remaining ifactory widgets).
(gtk_item_factory_get_widget_by_action): walk the GtkItemFactoryItem
list to find the widget.
(gtk_item_factory_get_item): new function that works around
gtk_item_factory_get_widget() limitations, this function will only
return menu items, even for <Branch> entries.
Tue Mar 9 01:01:28 1999 Tim Janik <timj@gtk.org>
* gdk/gdkfont.c (gdk_font_load): first lookup the xfont ID in our
font hash table, if we have a GdkFontPrivate entry for this font
already, simply increment its reference count, provided by Olaf Dietsche
<olaf.dietsche+list.gtk@netcologne.de>.
* gtk/gtkstyle.c (gtk_style_copy): plug a GdkFont reference leak, fix
provided by Olaf Dietsche <olaf.dietsche+list.gtk@netcologne.de>.
Sun Mar 7 06:13:29 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c:
(gtk_container_add_with_args):
(gtk_container_addv):
(gtk_container_add): before adding a child to a conatiner, make sure
it is (default) constructed, this is neccessary because under certain
circumstances the child will get relized and mapped immediatedly, in
which case it has to be constructed already.
Mon Mar 1 17:58:21 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_connect_by_type): count object_signal
values > 1 as TRUE also.
1999-03-17 01:39:42 +00:00
|
|
|
#define CLIST_OPTIMUM_SIZE 64
|
1998-01-24 19:14:42 +00:00
|
|
|
|
1998-01-03 03:31:03 +00:00
|
|
|
/* the width of the column resize windows */
|
1998-01-19 09:59:20 +00:00
|
|
|
#define DRAG_WIDTH 6
|
1998-01-03 03:31:03 +00:00
|
|
|
|
|
|
|
/* minimum allowed width of a column */
|
|
|
|
#define COLUMN_MIN_WIDTH 5
|
|
|
|
|
|
|
|
/* this defigns the base grid spacing */
|
|
|
|
#define CELL_SPACING 1
|
|
|
|
|
|
|
|
/* added the horizontal space at the beginning and end of a row*/
|
|
|
|
#define COLUMN_INSET 3
|
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
/* used for auto-scrolling */
|
|
|
|
#define SCROLL_TIME 100
|
|
|
|
|
1998-01-03 03:31:03 +00:00
|
|
|
/* gives the top pixel of the given row in context of
|
|
|
|
* the clist's voffset */
|
1998-01-06 06:48:48 +00:00
|
|
|
#define ROW_TOP_YPIXEL(clist, row) (((clist)->row_height * (row)) + \
|
|
|
|
(((row) + 1) * CELL_SPACING) + \
|
1998-01-03 03:31:03 +00:00
|
|
|
(clist)->voffset)
|
|
|
|
|
|
|
|
/* returns the row index from a y pixel location in the
|
|
|
|
* context of the clist's voffset */
|
1998-01-06 06:48:48 +00:00
|
|
|
#define ROW_FROM_YPIXEL(clist, y) (((y) - (clist)->voffset) / \
|
1998-01-03 03:31:03 +00:00
|
|
|
((clist)->row_height + CELL_SPACING))
|
|
|
|
|
|
|
|
/* gives the left pixel of the given column in context of
|
|
|
|
* the clist's hoffset */
|
1998-07-15 23:40:00 +00:00
|
|
|
#define COLUMN_LEFT_XPIXEL(clist, colnum) ((clist)->column[(colnum)].area.x + \
|
1998-01-03 03:31:03 +00:00
|
|
|
(clist)->hoffset)
|
|
|
|
|
|
|
|
/* returns the column index from a x pixel location in the
|
|
|
|
* context of the clist's hoffset */
|
1998-01-09 01:48:19 +00:00
|
|
|
static inline gint
|
1998-01-03 03:31:03 +00:00
|
|
|
COLUMN_FROM_XPIXEL (GtkCList * clist,
|
|
|
|
gint x)
|
|
|
|
{
|
|
|
|
gint i, cx;
|
|
|
|
|
|
|
|
for (i = 0; i < clist->columns; i++)
|
1998-10-22 14:54:28 +00:00
|
|
|
if (clist->column[i].visible)
|
|
|
|
{
|
|
|
|
cx = clist->column[i].area.x + clist->hoffset;
|
|
|
|
|
|
|
|
if (x >= (cx - (COLUMN_INSET + CELL_SPACING)) &&
|
|
|
|
x <= (cx + clist->column[i].area.width + COLUMN_INSET))
|
|
|
|
return i;
|
|
|
|
}
|
1998-01-03 03:31:03 +00:00
|
|
|
|
|
|
|
/* no match */
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* returns the top pixel of the given row in the context of
|
|
|
|
* the list height */
|
|
|
|
#define ROW_TOP(clist, row) (((clist)->row_height + CELL_SPACING) * (row))
|
|
|
|
|
|
|
|
/* returns the left pixel of the given column in the context of
|
|
|
|
* the list width */
|
1998-07-15 23:40:00 +00:00
|
|
|
#define COLUMN_LEFT(clist, colnum) ((clist)->column[(colnum)].area.x)
|
1998-01-03 03:31:03 +00:00
|
|
|
|
|
|
|
/* returns the total height of the list */
|
|
|
|
#define LIST_HEIGHT(clist) (((clist)->row_height * ((clist)->rows)) + \
|
|
|
|
(CELL_SPACING * ((clist)->rows + 1)))
|
|
|
|
|
1998-10-07 00:03:24 +00:00
|
|
|
|
1998-01-03 03:31:03 +00:00
|
|
|
/* returns the total width of the list */
|
1998-10-07 00:03:24 +00:00
|
|
|
static inline gint
|
|
|
|
LIST_WIDTH (GtkCList * clist)
|
|
|
|
{
|
|
|
|
gint last_column;
|
|
|
|
|
|
|
|
for (last_column = clist->columns - 1;
|
|
|
|
last_column >= 0 && !clist->column[last_column].visible; last_column--);
|
|
|
|
|
|
|
|
if (last_column >= 0)
|
|
|
|
return (clist->column[last_column].area.x +
|
|
|
|
clist->column[last_column].area.width +
|
|
|
|
COLUMN_INSET + CELL_SPACING);
|
|
|
|
return 0;
|
|
|
|
}
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
#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
|
1998-07-15 23:40:00 +00:00
|
|
|
|
|
|
|
|
1998-01-03 03:31:03 +00:00
|
|
|
/* Signals */
|
Adapt cast macros to standard.
Fri Nov 19 10:34:41 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkgamma.h: Adapt cast macros to standard.
[ Merges from 1.2 ]
Tue Nov 16 10:15:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_path):
If translation does not include a '/', use entire
translation instead of crashing.
Sun Oct 31 22:21:11 1999 Tim Janik <timj@gtk.org>
* docs/gtk_tut.sgml:
s/gtk_accel_group_attach/gtk_window_add_accel_group/.
Sat Oct 30 09:09:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_target_list_remove): Use
g_list_remove_link, not g_list_remove.
[ From Geert Bevin <gbevin@thunderstorms.org> ]
Sun Oct 24 07:41:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkclist.c (real_undo_selection): commented out g_print()
statement upon unselection (how the heck did that slip in?).
Sat Oct 23 03:03:08 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_freeze):
(gtk_text_thaw): undraw/draw cursor here to avoid unnecessary scrolling
in frozen state (and aparently crashes). patch provided by Anders
Melchiorsen <and@kampsax.dtu.dk>.
Sat Oct 23 02:53:20 1999 Tim Janik <timj@gtk.org>
* fix insensitive default/focus widget activation,
reported by Matt Goodall <mgg@isotek.co.uk>.
* gtk/gtkwindow.c (gtk_window_key_press_event):
(gtk_window_activate_default):
(gtk_window_activate_focus):
return handled=FALSE for actiavtion of insensitive default
widgets. return handled=TRUE for activation of insensitive
focus widgets. don't activate in either case.
Tue Oct 19 09:55:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk-config.in (lib_gtk): Switch order of @x_cflags@
and $glib_cflags to match library order and in the
theory that an old version of GLib is more likely to
be in the include directory for X then vice-versa.
(Bug #2776)
Tue Oct 19 09:46:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always use LC_CTYPE
to determine the locale for fontsets, not LC_MESSAGES;
the user may want English messages with a handling
for non-English languages. (LC_CTYPE=ru_RU LC_MESSAGES=fr_FR
will still be broken) (Bug #2891)
Tue Oct 19 20:36:42 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Fixed the wrong number of "*"'s.
Tue Oct 19 12:15:13 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Changed the Korean default fontset.
Fri Oct 8 02:32:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): Fix bug
where when scrolling to the left or top double exposes
were done, causing major slowdowns.
Thu Oct 7 18:31:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always normalize codeset
names to lowercase and alphanumeric, before looking
them up.
* gtk/Makefile.am: Install codeset variant gtkrc files
with normalized names.
Thu Oct 7 22:52:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_popup_with_data): even
popup menus when the menu is already visible, but its parent
is still hidden, (happens after tornoff window got hidden).
Thu Oct 7 11:09:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (install-data-local): Fix
a typo where gtkrc.vi_VN.tcvn5712 wasn't getting
deleted, causing error messages on install.
Thu Oct 7 11:03:06 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtk[hv]paned.c (gtk_{h,v}paned_draw): Redraw
the handle as well, since we now sometimes ignore
exposes on the handle while resizing.
Wed Oct 6 18:02:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_append_default_pixmap_path): Fix stupid
extra g_free introduced in one of the last one or two
commits.
Wed Oct 6 16:38:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc*: Make naming of gtkrc files
consistent, put each style that a gtkrc.* file creates
in a unique namespace, remove old files before installing.
Wed Oct 6 14:31:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Avoid leaking memory when
gtk_rc_init is called multiple times. (Yes, people who
do that have bugs in their code.)
Tue Oct 5 11:36:57 PDT 1999 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: listing gtkrc in gtkconf_DATA seems to barf.
Remove it since it's generated by the Makefile anyway
Tue Oct 5 02:43:41 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputcommon.h (gdk_input_device_new): Free
device->info.axes for core pointer.
Thu Sep 30 13:55:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (destroy_idle_test): Rename idle to
idle_id, to deal with obsolete, broken C libraries.
Mon Sep 27 02:50:15 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkvscale.c (gtk_vscale_draw): Don't add in
allocation->x/y twice!
* gtk/gtkhscale.c: Make usage of gtk_hscale_pos_trough()
consistent with gtk_vscale_pos_trough().
Sun Sep 26 19:44:34 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_queue_resize): We may
be queueing a resize on a toplevel container between
the time we show it and when we map it. So, we need
to test GTK_WIDGET_VISIBLE() for toplevels, and only
use GTK_WIDGET_DRAWABLE() for child windows.
Thu Sep 23 16:41:03 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDADDS): Add GDK_WLIBS to LDADDS
(fixes bug #2144)
Fri Sep 24 00:51:45 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c (gtk_container_queue_resize): check for
container DRAWABLE (instead of VISIBLE), so we don't queue
resizes on non-toplevel containers.
Sun Sep 19 18:13:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.[ch]: Make the data argument
const guchar *.
Sat Sep 18 21:27:40 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: Try to behave sensibly if
the focus widget is the window itself. (Should
we allow this at all?)
Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_set_sensitive):
* gtk/gtknotebook.c (gtk_notebook_set_scrollable):
* gtk/gtknotebook.c (gtk_notebook_set_show_border):
* gtk/gtkclist.c (gtk_notebook_set_show_border): make gboolean args
in prototypes and implementations consistent (Tomas Ogren).
* gtk/gtklayout.c (gtk_layout_remove): unset GTK_IS_OFFSCREEN flag
before the widget is unparented (reported by damon).
* gtk/gtkdnd.c: make the cursor and icon data _unsigned_ char,
since we provide unsigned data anyways.
Thu Sep 16 21:32:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_set_tip): Delay
the call to gtk_tooltips_layout_text() until later.
* gtk/gtktooltips.c (gtk_tooltips_draw_tips):
Call gtk_widget_ensure_style() before using the style.
Wed Sep 15 02:52:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_event): Added workaround
for old widgets that don't propagate draws to all
children. (Namely gnome-dock for gnome-libs <= 1.0.16)
Tue Sep 14 19:22:19 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_queue_resize): don't queue the parent
for a redraw but just the widget that requested the resize.
Tue Sep 14 18:29:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c: added new widget level method
gtk_container_set_reallocate_redraws() and a GtkContainer flag
reallocate_redraws : 1 to reflect the setting, exported this through
the argument system as a boolean ::reallocate_redraws.
* gtk/gtkwidget.c (gtk_widget_size_allocate): when queueing redraws
on the widget because the allocation changes, do so as well for
widget->parent if the parent has reallocate_redraws set to TRUE.
with that containers requesting reallocation redraws get automatically
redrawn if their children changed allocation (this unfortunately
affects also other children that didn't change allocation, but we
cannot work around that before 1.3).
Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_idle_draw): only emit ::draw if width
_and_ height are >0 (not _or_).
* gtk/gtktable.c (gtk_table_remove): use gtk_widget_queue_resize()
instead of gtk_container_queue_resize(), which is a core gtk internal
function (must have been on crack when i queued that).
* gtk/gtkprivate.h: added new private flag GTK_FULLDRAW_PENDING, so
we can check more reliably if we want to discard expose events.
* gtk/gtkwidget.c: added setting/unsetting of the GTK_FULLDRAW_PENDING
flag.
* gtk/gtkwidget.c (gtk_widget_event): don't discard synthesized exposes,
we simply trust these events. for deciding whether to discard exposes,
check GTK_FULLDRAW_PENDING instead of RESIZE_PENDING.
Mon Sep 13 15:01:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore
queues of areas that are completely off screen.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fix broken
logic for handleboxes.
* gtk/gtkwidget.c (gtk_widget_queue_draw_data): Add santity
check on width/height.
Mon Sep 13 02:22:47 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: backed out Raja's recent VPATH build "improvements",
we are fine with using $@ the way we do (if we actually encounter
brokeness with $@ in VPATH builds because of additional path prefixes,
we need to use $(@F) actually).
Mon Sep 13 01:34:53 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c: renamed two variables, hopefully didn't introduce
short lived bugs, that would allow language bindings to do surgeries
to our guts.
Fri Sep 10 15:22:50 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_size_allocate): Fix typo
where comparison was being done against an uninitialized
value causing intermittant results depending on
compiler flags. Also make it clearer that we aren't
ever initializing the child as 0x0 (though this will
be caught in gtk_widget_size_allocate())
Fri Sep 10 10:06:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_transient_for): Move
gtk_window_unset_transient_for() call after we do checks
involving the old transient parent.
[ From Lance Capser <lmc@cyberhighway.net> ]
1999-09-07 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gtk.defs): Go back to using `touch' to create
an empty file.
Mon Sep 6 00:11:56 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (gtk_ctree_is_ancestor): return FALSE if node has
no children. (Reported by: Chris Rogers <gandalf@pobox.com>)
1999-09-03 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gen_sources): Improve VPATH builds.
`$@' is valid only in the build dir, not after we've done
`cd $srcdir'. Also use `test -f' instead of less portable
`test -e'.
Fri Sep 3 15:59:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (correct_cache_insert): Rewrite
for simplicity, and hopefully correctness.
(Fixes bug #1322, which was a segfault when
on some insertions with the properties around
the insertion set up just wrong.)
* gtk/gtktext.c (gtk_text_adjustment): When we receive
a "changed" signal, clamp the new value to the adjustment
bounds to avoid segfaulting if someone tries to change
the adjustment to a bogus value. (Bug #1795)
Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c: Ignore unexpected destroy notifies
for children, for toplevel windows handle them
like delete_event.
* gtk/gtkplug.c: Add an unrealize handler so that
we unref plug->socket_window when we are done
with it.
Fri Sep 3 14:52:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_area): Fix stupid signedness
problem that was causing background to sometimes
be misaligned.
Fri Sep 3 12:26:33 1999 Owen Taylor <otaylor@redhat.com>
[ Fixes pointed out by Ettore Perazzoli <ettore@comm2000.it> ]
* gtk/gtkmenu.c (gtk_menu_position): Make
sure we never position menus with negative x, y,
since gtk_widget_set_uposition() can't handle that.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu):
Modify the positioning code a bit so that we always
put the top-left corner onscreen. (This is for
UI reasons, gtk_menu_position() now takes care of
gtk_widet_set_uposition() brokeness.)
Fri Sep 3 03:06:30 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: fixed up things for -jx, x > 1.
Sun Sep 5 08:48:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_style): Ref the
RC style that is passed in. The lack of the ref
before was a bug. If people worked around this
bug, this will introduce a slight memory leak
in their code. The code should typically look like:
rc_style = gtk_rc_style_new ();
[...]
gtk_widget_modify_style (widget, rc_style);
gtk_rc_style_unref (rc_style);
* gtk/gtkwidget.c (gtk_widget_modify_style): Reset
the style if it was already set.
* gtk/gtkwidget.c (gtk_widget_set_name): Only set the
style if it was set before.
Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (main): Add a check to see if we
are being run from the correct directory and
to quit nicely if we are not.
* gtk/gtkrc.c (gtk_rc_slist_remove_all): Make function
static.
Thu Sep 2 23:00:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkenums.h (GtkWindowPosition): added GTK_WIN_POS_CENTER_ALWAYS.
* gtk/gtkwindow.c:
queue resizes unconditionally (gtk_widget_queue_resize will figure
what to do if the window is not realized).
(gtk_window_move_resize): only recenter the window
for GTK_WIN_POS_CENTER_ALWAYS.
(gtk_window_compute_reposition): handle GTK_WIN_POS_CENTER_ALWAYS in
the same way as GTK_WIN_POS_CENTER.
Thu Sep 2 22:39:27 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_reposition): check for the last position
with (!(info->last_flags & GDK_HINT_POS)) instead of
(!info->last_flags & GDK_HINT_POS).
* gtk/gtkwindow.c (gtk_window_move_resize): constrain new_width and
new_height unconditionally, because we use these values even if
!default_size_changed && !hints_changed.
comented the (default_size_changed || hints_changed) case with
respect to resize rejects from the window manager.
* gtk/gtkwindow.c (gtk_window_move_resize): save info->last values
in the zvt condition hack, since this includes the window hints, set
the hints after the handling_resize case.
* gtk/gtkwindow.c (gtk_window_show): constrain the default size that a
window is initially shown with to the geometry.
Thu Sep 2 07:38:56 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize):
s/size_changed/default_size_changed/g so i know what's
really going on (frying brain on smaller flame now).
Thu Sep 2 05:47:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): queue a new resize if
we have size_changed upon handling_resize. this is a gross
workaround for the broken zvt widget and should be removed in
1.3 again (search for FIXME).
Owen provided an accurate comment for this:
/* We could be here for two reasons
* 1) We coincidentally got a resize while handling
* another resize.
* 2) Our computation of size_changed was completely
* screwed up, probably because one of our children
* is broken. It's probably a zvt widget.
*
* For 1), we could just go ahead and ask for the
* new size right now, but doing that for 2)
* might well be fighting the user (and can even
* trigger a loop). Since we really don't want to
* do that, we requeue a resize in hopes that
* by the time it gets handled, the child has seen
* the light and is willing to go along with the
* new size. (this happens for the zvt widget, since
* the size_allocate() above will have stored the
* requisition corresponding to the new size in the
* zvt widget)
*
* This doesn't buy us anything for 1), but it shouldn't
* hurt us too badly, since it is what would have
* happened if we had gotten the configure event before
* the new size had been set.
*/
Wed Sep 1 20:46:11 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: deal properly with the fact that RC
style lists may include rc styles more than once.
* gtk/gtkrc.c (gtk_rc_append_pixmap_path): Removed
unused static function.
* gtk/gtkrc.c (gtk_rc_find_pixmap_in_path): Keep a
stack of directories of RC files currently being
parsed and implicitely add them to pixmap path.
This fixes a bug where the directory would get
appended then overwritten by pixmap_path declarations.
(bug #1462, from Peter Wainright <prw@wainpr.demon.co.uk>)
* gtk/gtkthemes.c (gtk_theme_engine_unref): Call
theme's exit function. (Patch from Peter Wainwright,
bug #1454)
* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_destroy):
Add a destroy() handler to take care of removing
group for menu item. (Fixes bug #1197)
* gtk/gtkwidget.c (gtk_widget_size_request): Fixed thinko
in warning message.
Wed Sep 1 21:27:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): don't require a server
roundtrip to figure window's width and height, since we know that
anyways from widget->allocation.
Wed Sep 1 12:37:44 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Compute
the hints after we request the new size.
Wed Sep 1 10:38:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_compute_hints): Removed
GTK_WIDGET_REALIZED() assertion - we can compute the
hints before we are realized.
* gtk/gtkwindow.c (gtk_window_move_resize): Reorder
hint changing so that we have a value of hints_changed
when we decide whether to constrain the window size.
* gtk/gtkwindow.c (gtk_window_move_resize): Spelling fix.
* gtk/gtkwindow.c (gtk_window_constrain_size): cleanups,
change back to G_MAXINT.
Wed Sep 1 06:54:59 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_get_geometry_info): zero initialize
new GtkWindowGeometryInfo, so fields like GdkGeometry geometry
contain uncluttered values.
(gtk_window_compute_hints): simply assert that window is realized
and that geometry_info is valid, since we rely on this anyways.
(gtk_window_constrain_size): major cleanups to the code.
if (flags & GDK_HINT_BASE_SIZE) use geometry's base width and height
for the base size, instead of the minimums. use 32767 as max width
and height (like in gtkwindow.c) instead of G_MAXINT.
Wed Sep 1 04:41:25 1999 Tim Janik <timj@gtk.org>
* cleaned up the GtkContainer.need_resize flag handling mess, we
only need to force resize requests when we were prematurely
realized, or our widget tree was modified when we were temporarily
hidden. handling these cases directly upon showing the window (i.e.
while the GdkWindow is still unmapped) avoids the need to wait for
a configure event response and therefore makes the GUI more snappier
and avoids blank windows during the roundtrip.
* gtk/gtkwidget.c:
(gtk_widget_hide):
(gtk_widget_show): don't queue resizes on toplevels, they know how
to deal with matters.
* gtk/gtkcontainer.c (gtk_container_queue_resize): set the ->need_resize
flag directly for not visible resize containers and spare us unecessary
signal emissions.
* gtk/gtkwindow.c:
(gtk_window_realize): if we need to enforce premature size allocation,
queue a container resize so we are correctly resized later on.
(gtk_window_init):
(gtk_window_size_request):
don't freak around with the ->need_resize flag,
gtk_container_queue_resize() will care about that.
(gtk_window_show):
handle initial resizing issues here, we can handle matters better in
this place, especially since we know that our GdkWindow is still
unmapped.
(gtk_window_move_resize):
don't care about ->need_resize at all.
handle size changes properly that occoured while we waited for a
configure event.
Tue Aug 31 15:58:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_uposition):
* gtk/gtkwindow.[hc] (gtk_window_reposition):
Move the hint setting code from gtk_widget_set_uposition
to here; set the hints so that we respect any previously
set geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Don't
change the window hints here or move the window here,
let that happen in gtk_window_move_resize().
Tue Aug 31 06:58:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): when discarding exposes due
to already queued resizes (and therefore redraws) on a widget, check
its anchestry as well.
* gtk/gtkcontainer.c:
(gtk_container_queue_resize): clear resize widgets for resize
containers before aborting prematurely. this is especially important
for toplevels which may need imemdiate processing or their resize
handler to be queued.
(gtk_container_dequeue_resize_handler): added new internal function for
gtkwindow.c.
* gtk/gtkwindow.c (gtk_window_move_resize): if we are resizing due to a
configure event, take possible changes in window position into account
as well.
if we request a new window size, queue up a resize handler that will
last until the configure event response arrives.
combined the ->need_resize case (initial show) with the general size
(hints) changed case and added even more comments.
if !auto_shrink, only revert to the old allocation if the new size
is smaller than the current allocation.
Tue Aug 31 11:55:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_arg, gtk_window_set_policy,
gtk_window_set_geometry_hints
gtk_window_set_default_size):
When hints are set, queue a resize so that the hints will
be eventually reset on the toplevel.
* gtk/gtkwindow.c (gtk_window_show): Use
gtk_window_compute_default_size(). Clear the need_resize flag
on the initail map so that we don't unnecessarily trigger the
resize code.
* gtk/gtkwindow.c (gtk_window_move_resize): Split apart
into separate functions. Compare the hints we are setting
with what we set last time so that we can accurately
tell when we need to reset the hints.
* gtk/gtkwindow.c (gtk_window_compute_default_size): New
function to figure out the size from requisition
and default_size.
* gtk/gtkwindow.c (gtk_window_constrain_size): Function
from fvwm to constrain a size to the geometry hints.
* gtk/gtkwindow.c (gtk_window_compare_hints): New function
to compare two sets of geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_hints): Renamed
from gtk_window_set_hints(), just compute the hints,
don't set them.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Move
code from gtk_window_move_resize() to separate function,
rationalize a bit.
Tue Aug 31 13:05:03 1999 Owen Taylor <otaylor@redhat.com>
* gtkrc.h: Move the ref_count member out of the GtkRcStyle
structure into a new private structure.
* gtkrc.c: Split GtkRcStyle into public/private.
In the private part, add a list of pointers to the
RcStyle lists this RcStyle participates in.
* gtkrc.c: When a RcStyle is free, remove all
lists referencing it from the
realized_style_ht hash, and free those lists.
* gtk/gtkrc.c (gtk_rc_clear_styles): Don't call
gtk_rc_init(), since that adds the default styles
to the list of parsed RC files again.
* gtk/gtkrc.c: Use gtk_rc_style_find() consistently.
Thu Aug 26 14:14:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): reactivated the sanity
checks that ensure that a widget's allocation is at least 1 in width
and height. (GNOME note: this doesn't affect old panel code anymore,
because GtkSocket will request width and height of at least 1 since
Fri Jul 23).
* gtk/gtkwindow.c (gtk_window_realize): if the widget hasn't been
allocated yet (happens if the user realizes the window prematurely),
size request and allocate it.
(gtk_window_size_allocate): guard against guint underflows.
Wed Aug 25 19:01:36 1999 Lars Hamann <lars@gtk.org>
* gtk/Makefile.am (gtk_built_sources): reordered stamp-gtk.defs
in gtk_built_sources, so gtk.defs gets built prior to all other
sources.
Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am:
invoke indent on gtkmarshal.*.
rewrote source generation rules, use COPYING as oldest source tag for
a piggyback rule to generate all sources from (don't touch it ;).
major cleanups, strip spaces on build rules for GNU Make.
* gtk/genmarshal.pl: don't operate on hardcoded filenames but take
source and target files from commandline arguments. don't invoke indent.
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Wed Aug 18 09:20:10 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c:
we use window->need_resize from configure_event now, to indicate that
the gtkwindow should keep its allocation (e.g. because the user resized
the window through window manager handles). resize_count is now reliably
used to figure whether we got the allocation we requested from the
window manager.
configure events get queued as resizes now, the real stuff (size
computation and allocation) now only goes on in gtk_window_move_resize().
GtkWindow's requisition now contains its *real* requisition (like all
other widgets), *not* taking usize into account.
geometry_info->last_{width|height} is now updated from set_hints() only
so it always contains the last hints we set for the window manager.
made some event handlers return TRUE instead of FALSE.
the overall code should be much more straight forward now, and the
significant code portions are accompanied by comments now.
(gtk_window_set_hints):
removed requisition argument and made it
fetch the requisition through gtk_widget_get_child_requisition.
we also don't move the gdkwindow here anymore, gtk_window_move_resize()
does that now.
(gtk_window_show):
ensure that the widget is realized before calling
gtk_container_check_resize() (and thus gtk_window_move_resize()), also
ensure that we got properly size requested and allocated before
realization.
(gtk_window_configure_event):
ignore plain window moves, or reallocate the widget tree through the
resize queue otherwise.
(gtk_window_move_resize):
mostly rewrote this function to figure window manager hints more
reliably, coalesce window moves and resizes to reduce configure events
and do actuall size allocations.
Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): discard expose events for widgets
that have a resize pending, because a redraw is already queued for them.
* gtk/gtkcontainer.c: removed ugly connect_to ::size_allocate signal
hack to clear resize_widgets.
* gtk/gtkwidget.c (gtk_widget_size_allocate): call clear_resize_widgets
for resize containers prior to size allocation. (this is also a bit
ugly, but avoids side effects for stopped emissions and is thus more
reliable).
(gtk_widget_unparent): removed disconnect call for clear_resize_widgets.
* gtk/gtktooltips.c (gtk_tooltips_paint_window): renamed this
function from gtk_tooltips_expose, as we connect to ::expose_event
*and* ::draw now.
1999-08-18 Federico Mena Quintero <federico@redhat.com>
* gtk/gtkselection.c (gtk_target_list_ref): Added missing sanity
checks.
(gtk_target_list_unref): Likewise.
* gtk/gtkthemes.c (gtk_theme_engine_unref): Likewise.
Tue Aug 17 15:47:07 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_draw_value_bar):
guard against division by zero. (Fixes bug #1339)
Tue Aug 17 10:56:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_move_{forward,backward}_word):
Prevent the trivial leak of information of allowing
word motion when the entry is not visible.
Tue Aug 17 10:28:52 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_fileop_error): Propagate
modality to error dialog as well as confirmation dialogs.
(Bug #1803, reported by Rosanna Wing Sze Yuen)
Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktreeitem.c (gtk_tree_item_draw_lines): Honor
tree->view_lines.
(gtk-guy-990611-3.patch: Guy Harris <guy@netapp.com>)
* gtk/Makefile.am (install-data-local): Solaris apparently
has various troubles with ln -f; use rm first instead.
(gtk-guy-990611-2.patch: Guy Harris <guy@netapp.com>)
1999-07-30 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (stamp-m): Don't `mv' from builddir to srcdir,
use `cp' followed by `rm' (the `rm' was already there).
July 30, 1999 Elliot Lee <sopwith@redhat.com>
* configure.in: Fix autoconf warnings about cross compilation by
trying to provide sane defaults for AC_TRY_RUN.
* gtk/Makefile.am: If we refer to gtkmarshal.[ch] in $(srcdir),
put them into $(srcdir) when generated. Also add a dependency of
gtksignal.h on gtkmarshal.h for -j builds.
* gtk/gtk(dnd,style,gamma).c: Minor warning fixes.
Wed Jul 28 09:29:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration_do): Added missing
GDK_THREADS_{LEAVE,ENTER} pair.
(From Paul Fisher <pnfisher@redhat.com>)
Fri Jul 23 01:00:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtksocket.c (gtk_socket_size_request): asure that the requested
width and height are always >0 (owen).
Fri Jul 23 00:00:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): backed out my recent
change that assured that a widget's allocated with and height are
always >1, since this breaks *buggy* panel code. unfortunately this
back-breaks the gimp's color selector.
* gtk/gtkdrawingarea.c (gtk_drawing_area_size_allocate): asure that our
allocation is always >0 in width and height, before sending the
configure event; this is a *gross* hack to get the gimp back to work.
* marked both cases with TODO-1.3
Wed Jul 21 15:47:39 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Don't display wrap indicators when
text is not editable and word wrap is on.
Wed Jul 21 08:21:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): special case
option menus here as they are not derived from menu shell, assure that
the option menu has a menu we can add items to.
Tue Jul 20 23:29:48 1999 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_page_allocate): convert allocation->
width/height to (gint) before calculations and check against < 0 to
avoid guint wraparounds.
Sun Jul 18 00:35:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): ensure that the allocated
width and height is never zero. sanity check both dimensions against
32767 and issue a warning if the allocation is greater than that.
Wed Jul 7 15:03:30 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_events_pending): Unlock around call
to g_main_pending() as well.
Wed Jul 7 14:59:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration): Unlock around
call to g_main_iteration() - since that will regrab
GTK+ lock to process events.
Thu Jul 1 15:01:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c
- Regularize with the rest of GTK+ by making widget->requisition
not reflect the set_usize()
- Always recompute geometry hints, then check if they
changed before sending them to the X server. The
previous checks for changes would fail in a number
of circumstances.
Thu Jul 1 11:55:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Include <stdlib.h> for strcmp().
Wed Jun 30 19:26:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c:
- Code cleanups
- Instantaneously update on modifier key presses
- Allow cancellation of the drag with Escape.
Tue Jun 29 17:04:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_handle_box): Set the policy
to auto_shrink - otherwise the appearance is rather
strange when flipping between horizontal and vertical.
Mon Jun 28 09:29:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: add ::default_width and ::default_height arguments.
(gtk_window_set_default_size): don't change a value if it's < 0.
queue a resize.
Sun Jun 27 11:00:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_insert): don't segfault on NULL inserts.
Mon Jun 28 12:08:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (cmpl_completion_fullname): Don't
add an extra "/" when concating "/" + filename.
(From Matt Grossman <mattg@oz.net>)
Mon Jun 28 10:57:12 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (draw_cell_pixmap): Reset clip mask
for fg_gc if we set it for drawing pixmap.
Tue Jun 15 12:45:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes from Peter Wainwright <prw@wainpr.demon.co.uk>
* gtk/gtkrc.c (gtk_rc_parse_engine): If rc_style->engine is
already set, call old engine's destroy function and
unref the old engine.
Thu Jun 10 17:59:38 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.c (gtk_drawing_area_size): queue a resize.
Wed Jun 9 15:13:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h: mark certain functions as internal.
Wed Jun 9 13:48:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpreview.c (gtk_preview_set_expand): queue a resize if the
expand behaviour changed.
* gtk/gtklabel.c (gtk_label_set_pattern):
(gtk_label_set_justify):
(gtk_label_set_line_wrap):
don't bother invoking queue_clear, the reallocation does
that for us, always free_words so the upcoming resize will
relayout the label's contents.
Wed Jun 9 12:50:48 1999 Tim Janik <timj@gtk.org>
* applied argument implementation patches from Elena Devdariani
<elena@cogent.ca>.
* gtk/gtktoolbar.c: ::orientation, ::toolbar_style, ::space_size,
::space_style, ::relief
* gtk/gtkruler.c: ::lower, ::upper, ::position, ::max_size
* gtk/gtkpreview.c: ::expand
* gtk/gtkpaned.c: ::handle_size, ::gutter_size
* gtk/gtknotebook.c: ::homogeneous
* gtk/gtklabel.c: ::wrap
* gtk/gtklist.c: ::selection_mode
* gtk/gtkhandlebox.c: ::handle_position, ::snap_edge
* gtk/gtkcurve.c: ::curve_type, ::min_x, ::max_x, ::min_y, ::max_y
* gtk/gtkcolorsel.c: ::update_policy, ::use_opacity
* gtk/gtkclist.c: ::sort_type
* gtk/gtkcheckmenuitem.c: ::active, ::show_toggle
* gtk/gtkaspectframe.c: ::xalign, ::yalign, ::ratio, ::obey_child
Tue Jun 1 23:38:38 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Removed ill-thought-out part of last
comment.
Tue Jun 1 23:30:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_attach): Get the reference
counting right when we have to attach a new style
for a different visual. (Chi-Deok Hwang <cdhwang@sr.hei.co.kr>)
* gtk/gtkstyle.c: Documented the refcounting
peculularities of gtk_style_attach.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkwindow.c (gtk_window_new): added return if fail for invalid
window types.
* examples/packer/pack.c (main): use GTK_WINDOW_TOPLEVEL instead
of GTK_TOPLEVEL for creating the window.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkmain.c (gtk_init_check): don't segfault when --gtk-module is
the last argument (reported by Per Winkvist).
Tue May 25 13:13:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes for invisible XOR lines (Frank Loemker
<floemker@TechFak.Uni-Bielefeld.DE>)
* gtk/gtkclist.c (gtk_clist_realize): Always use
a non-zero pixel for GDK_XOR.
* gtk/gtkvpaned.c gtk/gtkhpaned.c:
Use GDK_INVERT instead of GDK_XOR.
Wed May 12 21:56:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (adjust_adjustments): signal emit value_changed
signals if h/voffsets differ from adjustment values.
Reportet by Jerome Bolliet <bolliet@in2p3.fr>
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
the user data on the window before destroying it.
* gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
unrealize handler to take care of destroying
notebook->panel properly.
(Bug #1198 - Morten Welinder <terra@diku.dk>)
* gtk/gtktext.c (expand_scratch_buffer): Fix reversal
of g_new and g_realloc to stop memory leak. (Actually,
we could just use g_realloc(), but I'm not 100% sure
that is portable).
(Bug #1196 - Morten Welinder <terra@diku.dk>)
Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.h: Removed stray GtkPlugButton declaration.
* gdk/gdkfont.c (gdk_text_measure): Fix the return value
for fontsets.
* gtk/gtkbutton.c (gtkbutton_expose): Fix warning
with bin/button confusion.
Thu May 6 04:53:26 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: in the ItemFactory test, link radio items together,
and show how preselection of radio items is done.
Sun May 2 13:31:14 1999 Tim Janik <timj@gtk.org>
* gtk/gtktreeitem.c (gtk_tree_item_set_subtree):
* gtk/gtktree.c (gtk_tree_add) (gtk_tree_insert):
* gtk/gtktoolbar.c (gtk_toolbar_insert_element):
* gtk/gtkpaned.c (gtk_paned_pack2) (gtk_paned_pack1):
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_add):
* gtk/gtktable.c (gtk_table_attach):
* gtk/gtklist.c (gtk_list_insert_items):
* gtk/gtkmenushell.c (gtk_menu_shell_insert):
* gtk/gtknotebook.c (gtk_notebook_insert_page_menu):
* gtk/gtkpacker.c (gtk_packer_add_defaults) (gtk_packer_add):
* gtk/gtkbin.c (gtk_bin_add):
* gtk/gtkbox.c (gtk_box_pack_start) (gtk_box_pack_end):
* gtk/gtkfixed.c (gtk_fixed_put):
* gtk/gtklayout.c (gtk_layout_put):
general fixups to container_add logic. always realize child if
child->parent is realized, only map the child and queue a resize
if child and child->parent are both visible.
Fri Apr 30 09:02:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_unrealize): use gtk_container_forall
instead of gtk_container_foreach to walk and unrealize children, so
composite children get also unrealized.
(gtk_widget_real_show): don't call gtk_widget_map() if we don't need to.
(gtk_widget_map): assert that the widget is visible (basic constrain).
(gtk_widget_real_map): assert that the widget is realized (basic
constrain).
Fri Apr 29 00:53:20 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbindings.c (gtk_pattern_spec_init): plugged a memory leak.
Tue May 4 09:32:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc.iso-8859-2: Add a gtkrc
file for iso-8859-2 locales.
* configure.in (ALL_LINGUAS): ALL_LINGUAS update.
Tue Apr 27 16:38:32 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Fix typo of static_sources for static_SOURCES.
(Pointed out by andy@rz.uni-karlsruhe.de and others).
Remove some suspicious and useless lines.
Tue May 4 08:44:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c (gtk_clist_draw, draw_rows): Use
width,height = 0, 0 to mean - here to edge of window,
instead of -1, -1, since the former is all we support.
Tue May 4 08:34:43 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main): Correctly free list nodes
when removing from quit_functions list.
Tue Apr 27 14:17:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpacker.c (gtk_packer_size_request): remove unused variable.
Tue Apr 27 18:23:35 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable):
When redrawing characters on non-visible entry, use appropriate
'*' character. (Bug #1130 - Jean-Marc Jacquet <jm@littleigloo.org>)
Tue Apr 27 01:31:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (drag_dest_cell): compute destination cell
from drag coordinates.
(gtk_clist_drag_data_received) (gtk_clist_drag_motion):
use drag_dest_cell.
* gtk/gtktree (drag_dest_cell)
(gtk_ctree_drag_data_received) (gtk_ctree_drag_motion): likewise.
(Bug #1129)
Wed Apr 21 21:26:11 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_init): properly initialize
translate_* fields.
(gtk_item_factory_finalize): invoke translate_notify independant from
translate_data.
(gtk_item_factory_set_translate_func): likewise.
(gtk_item_factory_destroy): only remove ifactory pointer from those
widgets that belong to us (stupid me).
Mon Apr 19 12:05:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Fixed leak of
rc_style list when lookup succeeeds.
Thu Apr 15 01:11:24 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (resync_selection):
* gtk/gtkclist.c (resync_selection): fixed undo_selection bug.
* gtk/gtkclist.c (gtk_clist_button_release): fixed resync_selection
bug.
Fri Apr 9 19:22:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c gtk/gtkdnd.c gtk/gtkmenuitem.c:
Add some missing GDK_THREADS_ENTER()/LEAVE around
timeouts. (Patches from Sebastian Wilhelmi <wilhelmi@ira.uka.de>)
Thu Apr 8 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkentry.c (gtk_entry_key_press): use gtk_widget_activate()
rather than emit_by_name.
* gtk/gtkeditable.c (gtk_editable_insert_text): keep a reference
on the widget across multiple signal emissions.
(gtk_editable_delete_text): same here.
(gtk_editable_class_init): set widget_class->activate_signal after
editable_signals[ACTIVATE] has been created.
Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
position here prematurely -- we might not have the
right ->min_position and ->max_position yet.
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
Add error traps so if the other end of the connection
dies, we survive.
* gtk/gtkselection.c (gtk_selection_notify): Clean
up properly when selection property retrieval fails.
* gtk/gtkselection.c (gtk_selection_request): Correctly
reject SelectionRequest notifies where the handler
returns no data.
Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_dest_leave): Only unhighlight
when we've previously highlighted.
* gtk/gtkdnd.c (gtk_drag_dest_handle_event): Don't
emit two "drag_leave" signals for Motif drops.
* gtk/gtkdnd.c (gtk_drag_source_handle_event): Send
back the correct status messages when dropping from
Motif onto a proxy window that is rejecting the
drop.
Sat Mar 27 23:32:13 1999 Tim Janik <timj@gtk.org>
* gtk/gtkarg.[hc]: added functions from GLE, gtk_arg_reset() to free
the value and reset type to GTK_TYPE_INVALID, and gtk_arg_values_equal()
to compare two argument values. added gtk_arg_to_valueloc() to set a
variable from an arg through its location (pointer).
* gtk/gtkobject.[hc]: implemented gtk_object_get() in terms of
gtk_object_arg_get() and gtk_arg_to_valueloc(), floats are collected
as gfloat*, uchars are collected as guchar*, ints are collected as
gint*, etc...
Mon Mar 29 17:45:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccelgroup.c gtk/gtkgtkbindings.c:
Include <string.h> instead of <strings.h>.
* gtk/gtkstyle.c: Fix double include of gtkthemes.h
(actually, a lot more duplicate includes occur if
you trace through the sequence of #include's)
gtk-jbb-990320-0: John Bley, jbb6@acpub.duke.edu
Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com>
Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp>
gtk-a-higuti-990322-[0-3]
* configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS
that was causing -DX_LOCALE not to work.
* gtk/gtkrc.c (gtk_rc_init):
X_LOCALE will never have LC_MESSAGES defined
Thu Mar 25 12:38:31 1999 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_append_default_module_path): get $HOME from
g_get_home_dir() (gtk-pmc-990123-0.patch.gz).
* gtk/gtkwindow.c (gtk_window_key_press_event): feature keypad up/down/
left/right as well (gtk-michael-980726-0.patch.gz).
* gtk/gtklabel.[hc]: bunch of miscellaneous cleanups, such as s/0/NULL/
for pointer values, use gchar instead of char. fixed uline allocation
leaks, changed the allocation pattern so we use G_ALLOC_AND_FREE mem
chunks instead of G_ALLOC_ONLY.
(gtk_label_size_request): always alter requisition as passed and leave
widget->requisition alone.
(gtk_label_set_text): allow NULL strings.
(gtk_label_new): likewise.
Wed Mar 24 09:24:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.[hc]: type/macro fixups.
Mon Mar 22 05:51:34 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbin.c (gtk_bin_draw): only redraw children that are visible
*and* mapped (i.e. drawable).
(gtk_bin_expose): only send exposes to drawable children.
* gtk/gtkbox.c (gtk_box_draw): only redraw children that are drawable.
(gtk_box_expose): only send exposes to drawable children.
* gtk/gtkhscale.c (gtk_hscale_draw):
* gtk/gtkvscale.c (gtk_vscale_draw):
hm, this is an ugly one. we first compute the size of our trough area
here (window relative) and then check intersection with the draw_area
which is parent relative because we're a NO_WINDOW widget, so we need
to offset the trough area by allocation.x and allocation.y before the
check. (this must not be done for the background area though, since
that's already computed parent relative).
Mon Mar 22 00:41:39 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_unrealize): unmap clist if neccessary,
unrealize title buttons.
Fri Mar 19 00:00:22 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_column_title_passive)
(gtk_clist_column_title_active):
only connect/disconnect to GtkWidgetClass::event to block mouse events.
* gtk/gtkclist.c (vertical_timeout) (horizontal_timeout):
zero initialize event, removed superfluous gdk_window_get_pointer call
* gtk/gtklist.c (gtk_list_vertical_timeout)
(gtk_list_horizontal_timeout): removed superfluous
gdk_window_get_pointer call
Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org>
* plugging problems reported by "Bruce Mitchener, Jr."
<bruce@puremagic.com> due to a purify session.
* gtk/gtkstyle.c:
(gtk_style_ref):
(gtk_style_unref): assert ref_count to be > 0.
* gtk/gtkclist.c (gtk_clist_set_cell_style): { 0 } initilaize
the requisition.
(gtk_clist_set_shift): likewise.
* gtk/gtklayout.c: introduce gtk_layout_finalize() to unref the
adjustments.
* gtk/gtklist.c (gtk_list_horizontal_timeout): zero initialize the
event before sending it and set send_event to TRUE (which needs to
be done for *all* synthesized events).
(gtk_list_vertical_timeout): likewise.
* gtk/gtktipsquery.c (gtk_tips_query_destroy): plug small memory
leaks.
* gtk/gtkdrawingarea.c (gtk_drawing_area_send_configure): set send_event
to TRUE when synthesizing events.
[ *** end of merges from 1.2 *** ]
1999-11-22 21:52:50 +00:00
|
|
|
enum {
|
1998-01-03 03:31:03 +00:00
|
|
|
SELECT_ROW,
|
|
|
|
UNSELECT_ROW,
|
1998-12-02 00:52:14 +00:00
|
|
|
ROW_MOVE,
|
1998-01-03 03:31:03 +00:00
|
|
|
CLICK_COLUMN,
|
1998-10-07 00:03:24 +00:00
|
|
|
RESIZE_COLUMN,
|
1998-07-15 23:40:00 +00:00
|
|
|
TOGGLE_FOCUS_ROW,
|
|
|
|
SELECT_ALL,
|
|
|
|
UNSELECT_ALL,
|
|
|
|
UNDO_SELECTION,
|
|
|
|
START_SELECTION,
|
|
|
|
END_SELECTION,
|
|
|
|
TOGGLE_ADD_MODE,
|
|
|
|
EXTEND_SELECTION,
|
|
|
|
SCROLL_VERTICAL,
|
|
|
|
SCROLL_HORIZONTAL,
|
|
|
|
ABORT_COLUMN_RESIZE,
|
1998-01-03 03:31:03 +00:00
|
|
|
LAST_SIGNAL
|
|
|
|
};
|
|
|
|
|
Adapt cast macros to standard.
Fri Nov 19 10:34:41 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkgamma.h: Adapt cast macros to standard.
[ Merges from 1.2 ]
Tue Nov 16 10:15:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_path):
If translation does not include a '/', use entire
translation instead of crashing.
Sun Oct 31 22:21:11 1999 Tim Janik <timj@gtk.org>
* docs/gtk_tut.sgml:
s/gtk_accel_group_attach/gtk_window_add_accel_group/.
Sat Oct 30 09:09:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_target_list_remove): Use
g_list_remove_link, not g_list_remove.
[ From Geert Bevin <gbevin@thunderstorms.org> ]
Sun Oct 24 07:41:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkclist.c (real_undo_selection): commented out g_print()
statement upon unselection (how the heck did that slip in?).
Sat Oct 23 03:03:08 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_freeze):
(gtk_text_thaw): undraw/draw cursor here to avoid unnecessary scrolling
in frozen state (and aparently crashes). patch provided by Anders
Melchiorsen <and@kampsax.dtu.dk>.
Sat Oct 23 02:53:20 1999 Tim Janik <timj@gtk.org>
* fix insensitive default/focus widget activation,
reported by Matt Goodall <mgg@isotek.co.uk>.
* gtk/gtkwindow.c (gtk_window_key_press_event):
(gtk_window_activate_default):
(gtk_window_activate_focus):
return handled=FALSE for actiavtion of insensitive default
widgets. return handled=TRUE for activation of insensitive
focus widgets. don't activate in either case.
Tue Oct 19 09:55:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk-config.in (lib_gtk): Switch order of @x_cflags@
and $glib_cflags to match library order and in the
theory that an old version of GLib is more likely to
be in the include directory for X then vice-versa.
(Bug #2776)
Tue Oct 19 09:46:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always use LC_CTYPE
to determine the locale for fontsets, not LC_MESSAGES;
the user may want English messages with a handling
for non-English languages. (LC_CTYPE=ru_RU LC_MESSAGES=fr_FR
will still be broken) (Bug #2891)
Tue Oct 19 20:36:42 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Fixed the wrong number of "*"'s.
Tue Oct 19 12:15:13 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Changed the Korean default fontset.
Fri Oct 8 02:32:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): Fix bug
where when scrolling to the left or top double exposes
were done, causing major slowdowns.
Thu Oct 7 18:31:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always normalize codeset
names to lowercase and alphanumeric, before looking
them up.
* gtk/Makefile.am: Install codeset variant gtkrc files
with normalized names.
Thu Oct 7 22:52:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_popup_with_data): even
popup menus when the menu is already visible, but its parent
is still hidden, (happens after tornoff window got hidden).
Thu Oct 7 11:09:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (install-data-local): Fix
a typo where gtkrc.vi_VN.tcvn5712 wasn't getting
deleted, causing error messages on install.
Thu Oct 7 11:03:06 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtk[hv]paned.c (gtk_{h,v}paned_draw): Redraw
the handle as well, since we now sometimes ignore
exposes on the handle while resizing.
Wed Oct 6 18:02:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_append_default_pixmap_path): Fix stupid
extra g_free introduced in one of the last one or two
commits.
Wed Oct 6 16:38:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc*: Make naming of gtkrc files
consistent, put each style that a gtkrc.* file creates
in a unique namespace, remove old files before installing.
Wed Oct 6 14:31:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Avoid leaking memory when
gtk_rc_init is called multiple times. (Yes, people who
do that have bugs in their code.)
Tue Oct 5 11:36:57 PDT 1999 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: listing gtkrc in gtkconf_DATA seems to barf.
Remove it since it's generated by the Makefile anyway
Tue Oct 5 02:43:41 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputcommon.h (gdk_input_device_new): Free
device->info.axes for core pointer.
Thu Sep 30 13:55:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (destroy_idle_test): Rename idle to
idle_id, to deal with obsolete, broken C libraries.
Mon Sep 27 02:50:15 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkvscale.c (gtk_vscale_draw): Don't add in
allocation->x/y twice!
* gtk/gtkhscale.c: Make usage of gtk_hscale_pos_trough()
consistent with gtk_vscale_pos_trough().
Sun Sep 26 19:44:34 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_queue_resize): We may
be queueing a resize on a toplevel container between
the time we show it and when we map it. So, we need
to test GTK_WIDGET_VISIBLE() for toplevels, and only
use GTK_WIDGET_DRAWABLE() for child windows.
Thu Sep 23 16:41:03 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDADDS): Add GDK_WLIBS to LDADDS
(fixes bug #2144)
Fri Sep 24 00:51:45 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c (gtk_container_queue_resize): check for
container DRAWABLE (instead of VISIBLE), so we don't queue
resizes on non-toplevel containers.
Sun Sep 19 18:13:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.[ch]: Make the data argument
const guchar *.
Sat Sep 18 21:27:40 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: Try to behave sensibly if
the focus widget is the window itself. (Should
we allow this at all?)
Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_set_sensitive):
* gtk/gtknotebook.c (gtk_notebook_set_scrollable):
* gtk/gtknotebook.c (gtk_notebook_set_show_border):
* gtk/gtkclist.c (gtk_notebook_set_show_border): make gboolean args
in prototypes and implementations consistent (Tomas Ogren).
* gtk/gtklayout.c (gtk_layout_remove): unset GTK_IS_OFFSCREEN flag
before the widget is unparented (reported by damon).
* gtk/gtkdnd.c: make the cursor and icon data _unsigned_ char,
since we provide unsigned data anyways.
Thu Sep 16 21:32:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_set_tip): Delay
the call to gtk_tooltips_layout_text() until later.
* gtk/gtktooltips.c (gtk_tooltips_draw_tips):
Call gtk_widget_ensure_style() before using the style.
Wed Sep 15 02:52:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_event): Added workaround
for old widgets that don't propagate draws to all
children. (Namely gnome-dock for gnome-libs <= 1.0.16)
Tue Sep 14 19:22:19 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_queue_resize): don't queue the parent
for a redraw but just the widget that requested the resize.
Tue Sep 14 18:29:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c: added new widget level method
gtk_container_set_reallocate_redraws() and a GtkContainer flag
reallocate_redraws : 1 to reflect the setting, exported this through
the argument system as a boolean ::reallocate_redraws.
* gtk/gtkwidget.c (gtk_widget_size_allocate): when queueing redraws
on the widget because the allocation changes, do so as well for
widget->parent if the parent has reallocate_redraws set to TRUE.
with that containers requesting reallocation redraws get automatically
redrawn if their children changed allocation (this unfortunately
affects also other children that didn't change allocation, but we
cannot work around that before 1.3).
Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_idle_draw): only emit ::draw if width
_and_ height are >0 (not _or_).
* gtk/gtktable.c (gtk_table_remove): use gtk_widget_queue_resize()
instead of gtk_container_queue_resize(), which is a core gtk internal
function (must have been on crack when i queued that).
* gtk/gtkprivate.h: added new private flag GTK_FULLDRAW_PENDING, so
we can check more reliably if we want to discard expose events.
* gtk/gtkwidget.c: added setting/unsetting of the GTK_FULLDRAW_PENDING
flag.
* gtk/gtkwidget.c (gtk_widget_event): don't discard synthesized exposes,
we simply trust these events. for deciding whether to discard exposes,
check GTK_FULLDRAW_PENDING instead of RESIZE_PENDING.
Mon Sep 13 15:01:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore
queues of areas that are completely off screen.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fix broken
logic for handleboxes.
* gtk/gtkwidget.c (gtk_widget_queue_draw_data): Add santity
check on width/height.
Mon Sep 13 02:22:47 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: backed out Raja's recent VPATH build "improvements",
we are fine with using $@ the way we do (if we actually encounter
brokeness with $@ in VPATH builds because of additional path prefixes,
we need to use $(@F) actually).
Mon Sep 13 01:34:53 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c: renamed two variables, hopefully didn't introduce
short lived bugs, that would allow language bindings to do surgeries
to our guts.
Fri Sep 10 15:22:50 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_size_allocate): Fix typo
where comparison was being done against an uninitialized
value causing intermittant results depending on
compiler flags. Also make it clearer that we aren't
ever initializing the child as 0x0 (though this will
be caught in gtk_widget_size_allocate())
Fri Sep 10 10:06:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_transient_for): Move
gtk_window_unset_transient_for() call after we do checks
involving the old transient parent.
[ From Lance Capser <lmc@cyberhighway.net> ]
1999-09-07 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gtk.defs): Go back to using `touch' to create
an empty file.
Mon Sep 6 00:11:56 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (gtk_ctree_is_ancestor): return FALSE if node has
no children. (Reported by: Chris Rogers <gandalf@pobox.com>)
1999-09-03 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gen_sources): Improve VPATH builds.
`$@' is valid only in the build dir, not after we've done
`cd $srcdir'. Also use `test -f' instead of less portable
`test -e'.
Fri Sep 3 15:59:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (correct_cache_insert): Rewrite
for simplicity, and hopefully correctness.
(Fixes bug #1322, which was a segfault when
on some insertions with the properties around
the insertion set up just wrong.)
* gtk/gtktext.c (gtk_text_adjustment): When we receive
a "changed" signal, clamp the new value to the adjustment
bounds to avoid segfaulting if someone tries to change
the adjustment to a bogus value. (Bug #1795)
Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c: Ignore unexpected destroy notifies
for children, for toplevel windows handle them
like delete_event.
* gtk/gtkplug.c: Add an unrealize handler so that
we unref plug->socket_window when we are done
with it.
Fri Sep 3 14:52:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_area): Fix stupid signedness
problem that was causing background to sometimes
be misaligned.
Fri Sep 3 12:26:33 1999 Owen Taylor <otaylor@redhat.com>
[ Fixes pointed out by Ettore Perazzoli <ettore@comm2000.it> ]
* gtk/gtkmenu.c (gtk_menu_position): Make
sure we never position menus with negative x, y,
since gtk_widget_set_uposition() can't handle that.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu):
Modify the positioning code a bit so that we always
put the top-left corner onscreen. (This is for
UI reasons, gtk_menu_position() now takes care of
gtk_widet_set_uposition() brokeness.)
Fri Sep 3 03:06:30 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: fixed up things for -jx, x > 1.
Sun Sep 5 08:48:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_style): Ref the
RC style that is passed in. The lack of the ref
before was a bug. If people worked around this
bug, this will introduce a slight memory leak
in their code. The code should typically look like:
rc_style = gtk_rc_style_new ();
[...]
gtk_widget_modify_style (widget, rc_style);
gtk_rc_style_unref (rc_style);
* gtk/gtkwidget.c (gtk_widget_modify_style): Reset
the style if it was already set.
* gtk/gtkwidget.c (gtk_widget_set_name): Only set the
style if it was set before.
Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (main): Add a check to see if we
are being run from the correct directory and
to quit nicely if we are not.
* gtk/gtkrc.c (gtk_rc_slist_remove_all): Make function
static.
Thu Sep 2 23:00:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkenums.h (GtkWindowPosition): added GTK_WIN_POS_CENTER_ALWAYS.
* gtk/gtkwindow.c:
queue resizes unconditionally (gtk_widget_queue_resize will figure
what to do if the window is not realized).
(gtk_window_move_resize): only recenter the window
for GTK_WIN_POS_CENTER_ALWAYS.
(gtk_window_compute_reposition): handle GTK_WIN_POS_CENTER_ALWAYS in
the same way as GTK_WIN_POS_CENTER.
Thu Sep 2 22:39:27 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_reposition): check for the last position
with (!(info->last_flags & GDK_HINT_POS)) instead of
(!info->last_flags & GDK_HINT_POS).
* gtk/gtkwindow.c (gtk_window_move_resize): constrain new_width and
new_height unconditionally, because we use these values even if
!default_size_changed && !hints_changed.
comented the (default_size_changed || hints_changed) case with
respect to resize rejects from the window manager.
* gtk/gtkwindow.c (gtk_window_move_resize): save info->last values
in the zvt condition hack, since this includes the window hints, set
the hints after the handling_resize case.
* gtk/gtkwindow.c (gtk_window_show): constrain the default size that a
window is initially shown with to the geometry.
Thu Sep 2 07:38:56 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize):
s/size_changed/default_size_changed/g so i know what's
really going on (frying brain on smaller flame now).
Thu Sep 2 05:47:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): queue a new resize if
we have size_changed upon handling_resize. this is a gross
workaround for the broken zvt widget and should be removed in
1.3 again (search for FIXME).
Owen provided an accurate comment for this:
/* We could be here for two reasons
* 1) We coincidentally got a resize while handling
* another resize.
* 2) Our computation of size_changed was completely
* screwed up, probably because one of our children
* is broken. It's probably a zvt widget.
*
* For 1), we could just go ahead and ask for the
* new size right now, but doing that for 2)
* might well be fighting the user (and can even
* trigger a loop). Since we really don't want to
* do that, we requeue a resize in hopes that
* by the time it gets handled, the child has seen
* the light and is willing to go along with the
* new size. (this happens for the zvt widget, since
* the size_allocate() above will have stored the
* requisition corresponding to the new size in the
* zvt widget)
*
* This doesn't buy us anything for 1), but it shouldn't
* hurt us too badly, since it is what would have
* happened if we had gotten the configure event before
* the new size had been set.
*/
Wed Sep 1 20:46:11 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: deal properly with the fact that RC
style lists may include rc styles more than once.
* gtk/gtkrc.c (gtk_rc_append_pixmap_path): Removed
unused static function.
* gtk/gtkrc.c (gtk_rc_find_pixmap_in_path): Keep a
stack of directories of RC files currently being
parsed and implicitely add them to pixmap path.
This fixes a bug where the directory would get
appended then overwritten by pixmap_path declarations.
(bug #1462, from Peter Wainright <prw@wainpr.demon.co.uk>)
* gtk/gtkthemes.c (gtk_theme_engine_unref): Call
theme's exit function. (Patch from Peter Wainwright,
bug #1454)
* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_destroy):
Add a destroy() handler to take care of removing
group for menu item. (Fixes bug #1197)
* gtk/gtkwidget.c (gtk_widget_size_request): Fixed thinko
in warning message.
Wed Sep 1 21:27:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): don't require a server
roundtrip to figure window's width and height, since we know that
anyways from widget->allocation.
Wed Sep 1 12:37:44 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Compute
the hints after we request the new size.
Wed Sep 1 10:38:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_compute_hints): Removed
GTK_WIDGET_REALIZED() assertion - we can compute the
hints before we are realized.
* gtk/gtkwindow.c (gtk_window_move_resize): Reorder
hint changing so that we have a value of hints_changed
when we decide whether to constrain the window size.
* gtk/gtkwindow.c (gtk_window_move_resize): Spelling fix.
* gtk/gtkwindow.c (gtk_window_constrain_size): cleanups,
change back to G_MAXINT.
Wed Sep 1 06:54:59 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_get_geometry_info): zero initialize
new GtkWindowGeometryInfo, so fields like GdkGeometry geometry
contain uncluttered values.
(gtk_window_compute_hints): simply assert that window is realized
and that geometry_info is valid, since we rely on this anyways.
(gtk_window_constrain_size): major cleanups to the code.
if (flags & GDK_HINT_BASE_SIZE) use geometry's base width and height
for the base size, instead of the minimums. use 32767 as max width
and height (like in gtkwindow.c) instead of G_MAXINT.
Wed Sep 1 04:41:25 1999 Tim Janik <timj@gtk.org>
* cleaned up the GtkContainer.need_resize flag handling mess, we
only need to force resize requests when we were prematurely
realized, or our widget tree was modified when we were temporarily
hidden. handling these cases directly upon showing the window (i.e.
while the GdkWindow is still unmapped) avoids the need to wait for
a configure event response and therefore makes the GUI more snappier
and avoids blank windows during the roundtrip.
* gtk/gtkwidget.c:
(gtk_widget_hide):
(gtk_widget_show): don't queue resizes on toplevels, they know how
to deal with matters.
* gtk/gtkcontainer.c (gtk_container_queue_resize): set the ->need_resize
flag directly for not visible resize containers and spare us unecessary
signal emissions.
* gtk/gtkwindow.c:
(gtk_window_realize): if we need to enforce premature size allocation,
queue a container resize so we are correctly resized later on.
(gtk_window_init):
(gtk_window_size_request):
don't freak around with the ->need_resize flag,
gtk_container_queue_resize() will care about that.
(gtk_window_show):
handle initial resizing issues here, we can handle matters better in
this place, especially since we know that our GdkWindow is still
unmapped.
(gtk_window_move_resize):
don't care about ->need_resize at all.
handle size changes properly that occoured while we waited for a
configure event.
Tue Aug 31 15:58:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_uposition):
* gtk/gtkwindow.[hc] (gtk_window_reposition):
Move the hint setting code from gtk_widget_set_uposition
to here; set the hints so that we respect any previously
set geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Don't
change the window hints here or move the window here,
let that happen in gtk_window_move_resize().
Tue Aug 31 06:58:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): when discarding exposes due
to already queued resizes (and therefore redraws) on a widget, check
its anchestry as well.
* gtk/gtkcontainer.c:
(gtk_container_queue_resize): clear resize widgets for resize
containers before aborting prematurely. this is especially important
for toplevels which may need imemdiate processing or their resize
handler to be queued.
(gtk_container_dequeue_resize_handler): added new internal function for
gtkwindow.c.
* gtk/gtkwindow.c (gtk_window_move_resize): if we are resizing due to a
configure event, take possible changes in window position into account
as well.
if we request a new window size, queue up a resize handler that will
last until the configure event response arrives.
combined the ->need_resize case (initial show) with the general size
(hints) changed case and added even more comments.
if !auto_shrink, only revert to the old allocation if the new size
is smaller than the current allocation.
Tue Aug 31 11:55:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_arg, gtk_window_set_policy,
gtk_window_set_geometry_hints
gtk_window_set_default_size):
When hints are set, queue a resize so that the hints will
be eventually reset on the toplevel.
* gtk/gtkwindow.c (gtk_window_show): Use
gtk_window_compute_default_size(). Clear the need_resize flag
on the initail map so that we don't unnecessarily trigger the
resize code.
* gtk/gtkwindow.c (gtk_window_move_resize): Split apart
into separate functions. Compare the hints we are setting
with what we set last time so that we can accurately
tell when we need to reset the hints.
* gtk/gtkwindow.c (gtk_window_compute_default_size): New
function to figure out the size from requisition
and default_size.
* gtk/gtkwindow.c (gtk_window_constrain_size): Function
from fvwm to constrain a size to the geometry hints.
* gtk/gtkwindow.c (gtk_window_compare_hints): New function
to compare two sets of geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_hints): Renamed
from gtk_window_set_hints(), just compute the hints,
don't set them.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Move
code from gtk_window_move_resize() to separate function,
rationalize a bit.
Tue Aug 31 13:05:03 1999 Owen Taylor <otaylor@redhat.com>
* gtkrc.h: Move the ref_count member out of the GtkRcStyle
structure into a new private structure.
* gtkrc.c: Split GtkRcStyle into public/private.
In the private part, add a list of pointers to the
RcStyle lists this RcStyle participates in.
* gtkrc.c: When a RcStyle is free, remove all
lists referencing it from the
realized_style_ht hash, and free those lists.
* gtk/gtkrc.c (gtk_rc_clear_styles): Don't call
gtk_rc_init(), since that adds the default styles
to the list of parsed RC files again.
* gtk/gtkrc.c: Use gtk_rc_style_find() consistently.
Thu Aug 26 14:14:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): reactivated the sanity
checks that ensure that a widget's allocation is at least 1 in width
and height. (GNOME note: this doesn't affect old panel code anymore,
because GtkSocket will request width and height of at least 1 since
Fri Jul 23).
* gtk/gtkwindow.c (gtk_window_realize): if the widget hasn't been
allocated yet (happens if the user realizes the window prematurely),
size request and allocate it.
(gtk_window_size_allocate): guard against guint underflows.
Wed Aug 25 19:01:36 1999 Lars Hamann <lars@gtk.org>
* gtk/Makefile.am (gtk_built_sources): reordered stamp-gtk.defs
in gtk_built_sources, so gtk.defs gets built prior to all other
sources.
Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am:
invoke indent on gtkmarshal.*.
rewrote source generation rules, use COPYING as oldest source tag for
a piggyback rule to generate all sources from (don't touch it ;).
major cleanups, strip spaces on build rules for GNU Make.
* gtk/genmarshal.pl: don't operate on hardcoded filenames but take
source and target files from commandline arguments. don't invoke indent.
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Wed Aug 18 09:20:10 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c:
we use window->need_resize from configure_event now, to indicate that
the gtkwindow should keep its allocation (e.g. because the user resized
the window through window manager handles). resize_count is now reliably
used to figure whether we got the allocation we requested from the
window manager.
configure events get queued as resizes now, the real stuff (size
computation and allocation) now only goes on in gtk_window_move_resize().
GtkWindow's requisition now contains its *real* requisition (like all
other widgets), *not* taking usize into account.
geometry_info->last_{width|height} is now updated from set_hints() only
so it always contains the last hints we set for the window manager.
made some event handlers return TRUE instead of FALSE.
the overall code should be much more straight forward now, and the
significant code portions are accompanied by comments now.
(gtk_window_set_hints):
removed requisition argument and made it
fetch the requisition through gtk_widget_get_child_requisition.
we also don't move the gdkwindow here anymore, gtk_window_move_resize()
does that now.
(gtk_window_show):
ensure that the widget is realized before calling
gtk_container_check_resize() (and thus gtk_window_move_resize()), also
ensure that we got properly size requested and allocated before
realization.
(gtk_window_configure_event):
ignore plain window moves, or reallocate the widget tree through the
resize queue otherwise.
(gtk_window_move_resize):
mostly rewrote this function to figure window manager hints more
reliably, coalesce window moves and resizes to reduce configure events
and do actuall size allocations.
Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): discard expose events for widgets
that have a resize pending, because a redraw is already queued for them.
* gtk/gtkcontainer.c: removed ugly connect_to ::size_allocate signal
hack to clear resize_widgets.
* gtk/gtkwidget.c (gtk_widget_size_allocate): call clear_resize_widgets
for resize containers prior to size allocation. (this is also a bit
ugly, but avoids side effects for stopped emissions and is thus more
reliable).
(gtk_widget_unparent): removed disconnect call for clear_resize_widgets.
* gtk/gtktooltips.c (gtk_tooltips_paint_window): renamed this
function from gtk_tooltips_expose, as we connect to ::expose_event
*and* ::draw now.
1999-08-18 Federico Mena Quintero <federico@redhat.com>
* gtk/gtkselection.c (gtk_target_list_ref): Added missing sanity
checks.
(gtk_target_list_unref): Likewise.
* gtk/gtkthemes.c (gtk_theme_engine_unref): Likewise.
Tue Aug 17 15:47:07 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_draw_value_bar):
guard against division by zero. (Fixes bug #1339)
Tue Aug 17 10:56:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_move_{forward,backward}_word):
Prevent the trivial leak of information of allowing
word motion when the entry is not visible.
Tue Aug 17 10:28:52 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_fileop_error): Propagate
modality to error dialog as well as confirmation dialogs.
(Bug #1803, reported by Rosanna Wing Sze Yuen)
Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktreeitem.c (gtk_tree_item_draw_lines): Honor
tree->view_lines.
(gtk-guy-990611-3.patch: Guy Harris <guy@netapp.com>)
* gtk/Makefile.am (install-data-local): Solaris apparently
has various troubles with ln -f; use rm first instead.
(gtk-guy-990611-2.patch: Guy Harris <guy@netapp.com>)
1999-07-30 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (stamp-m): Don't `mv' from builddir to srcdir,
use `cp' followed by `rm' (the `rm' was already there).
July 30, 1999 Elliot Lee <sopwith@redhat.com>
* configure.in: Fix autoconf warnings about cross compilation by
trying to provide sane defaults for AC_TRY_RUN.
* gtk/Makefile.am: If we refer to gtkmarshal.[ch] in $(srcdir),
put them into $(srcdir) when generated. Also add a dependency of
gtksignal.h on gtkmarshal.h for -j builds.
* gtk/gtk(dnd,style,gamma).c: Minor warning fixes.
Wed Jul 28 09:29:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration_do): Added missing
GDK_THREADS_{LEAVE,ENTER} pair.
(From Paul Fisher <pnfisher@redhat.com>)
Fri Jul 23 01:00:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtksocket.c (gtk_socket_size_request): asure that the requested
width and height are always >0 (owen).
Fri Jul 23 00:00:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): backed out my recent
change that assured that a widget's allocated with and height are
always >1, since this breaks *buggy* panel code. unfortunately this
back-breaks the gimp's color selector.
* gtk/gtkdrawingarea.c (gtk_drawing_area_size_allocate): asure that our
allocation is always >0 in width and height, before sending the
configure event; this is a *gross* hack to get the gimp back to work.
* marked both cases with TODO-1.3
Wed Jul 21 15:47:39 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Don't display wrap indicators when
text is not editable and word wrap is on.
Wed Jul 21 08:21:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): special case
option menus here as they are not derived from menu shell, assure that
the option menu has a menu we can add items to.
Tue Jul 20 23:29:48 1999 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_page_allocate): convert allocation->
width/height to (gint) before calculations and check against < 0 to
avoid guint wraparounds.
Sun Jul 18 00:35:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): ensure that the allocated
width and height is never zero. sanity check both dimensions against
32767 and issue a warning if the allocation is greater than that.
Wed Jul 7 15:03:30 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_events_pending): Unlock around call
to g_main_pending() as well.
Wed Jul 7 14:59:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration): Unlock around
call to g_main_iteration() - since that will regrab
GTK+ lock to process events.
Thu Jul 1 15:01:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c
- Regularize with the rest of GTK+ by making widget->requisition
not reflect the set_usize()
- Always recompute geometry hints, then check if they
changed before sending them to the X server. The
previous checks for changes would fail in a number
of circumstances.
Thu Jul 1 11:55:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Include <stdlib.h> for strcmp().
Wed Jun 30 19:26:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c:
- Code cleanups
- Instantaneously update on modifier key presses
- Allow cancellation of the drag with Escape.
Tue Jun 29 17:04:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_handle_box): Set the policy
to auto_shrink - otherwise the appearance is rather
strange when flipping between horizontal and vertical.
Mon Jun 28 09:29:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: add ::default_width and ::default_height arguments.
(gtk_window_set_default_size): don't change a value if it's < 0.
queue a resize.
Sun Jun 27 11:00:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_insert): don't segfault on NULL inserts.
Mon Jun 28 12:08:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (cmpl_completion_fullname): Don't
add an extra "/" when concating "/" + filename.
(From Matt Grossman <mattg@oz.net>)
Mon Jun 28 10:57:12 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (draw_cell_pixmap): Reset clip mask
for fg_gc if we set it for drawing pixmap.
Tue Jun 15 12:45:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes from Peter Wainwright <prw@wainpr.demon.co.uk>
* gtk/gtkrc.c (gtk_rc_parse_engine): If rc_style->engine is
already set, call old engine's destroy function and
unref the old engine.
Thu Jun 10 17:59:38 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.c (gtk_drawing_area_size): queue a resize.
Wed Jun 9 15:13:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h: mark certain functions as internal.
Wed Jun 9 13:48:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpreview.c (gtk_preview_set_expand): queue a resize if the
expand behaviour changed.
* gtk/gtklabel.c (gtk_label_set_pattern):
(gtk_label_set_justify):
(gtk_label_set_line_wrap):
don't bother invoking queue_clear, the reallocation does
that for us, always free_words so the upcoming resize will
relayout the label's contents.
Wed Jun 9 12:50:48 1999 Tim Janik <timj@gtk.org>
* applied argument implementation patches from Elena Devdariani
<elena@cogent.ca>.
* gtk/gtktoolbar.c: ::orientation, ::toolbar_style, ::space_size,
::space_style, ::relief
* gtk/gtkruler.c: ::lower, ::upper, ::position, ::max_size
* gtk/gtkpreview.c: ::expand
* gtk/gtkpaned.c: ::handle_size, ::gutter_size
* gtk/gtknotebook.c: ::homogeneous
* gtk/gtklabel.c: ::wrap
* gtk/gtklist.c: ::selection_mode
* gtk/gtkhandlebox.c: ::handle_position, ::snap_edge
* gtk/gtkcurve.c: ::curve_type, ::min_x, ::max_x, ::min_y, ::max_y
* gtk/gtkcolorsel.c: ::update_policy, ::use_opacity
* gtk/gtkclist.c: ::sort_type
* gtk/gtkcheckmenuitem.c: ::active, ::show_toggle
* gtk/gtkaspectframe.c: ::xalign, ::yalign, ::ratio, ::obey_child
Tue Jun 1 23:38:38 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Removed ill-thought-out part of last
comment.
Tue Jun 1 23:30:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_attach): Get the reference
counting right when we have to attach a new style
for a different visual. (Chi-Deok Hwang <cdhwang@sr.hei.co.kr>)
* gtk/gtkstyle.c: Documented the refcounting
peculularities of gtk_style_attach.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkwindow.c (gtk_window_new): added return if fail for invalid
window types.
* examples/packer/pack.c (main): use GTK_WINDOW_TOPLEVEL instead
of GTK_TOPLEVEL for creating the window.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkmain.c (gtk_init_check): don't segfault when --gtk-module is
the last argument (reported by Per Winkvist).
Tue May 25 13:13:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes for invisible XOR lines (Frank Loemker
<floemker@TechFak.Uni-Bielefeld.DE>)
* gtk/gtkclist.c (gtk_clist_realize): Always use
a non-zero pixel for GDK_XOR.
* gtk/gtkvpaned.c gtk/gtkhpaned.c:
Use GDK_INVERT instead of GDK_XOR.
Wed May 12 21:56:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (adjust_adjustments): signal emit value_changed
signals if h/voffsets differ from adjustment values.
Reportet by Jerome Bolliet <bolliet@in2p3.fr>
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
the user data on the window before destroying it.
* gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
unrealize handler to take care of destroying
notebook->panel properly.
(Bug #1198 - Morten Welinder <terra@diku.dk>)
* gtk/gtktext.c (expand_scratch_buffer): Fix reversal
of g_new and g_realloc to stop memory leak. (Actually,
we could just use g_realloc(), but I'm not 100% sure
that is portable).
(Bug #1196 - Morten Welinder <terra@diku.dk>)
Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.h: Removed stray GtkPlugButton declaration.
* gdk/gdkfont.c (gdk_text_measure): Fix the return value
for fontsets.
* gtk/gtkbutton.c (gtkbutton_expose): Fix warning
with bin/button confusion.
Thu May 6 04:53:26 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: in the ItemFactory test, link radio items together,
and show how preselection of radio items is done.
Sun May 2 13:31:14 1999 Tim Janik <timj@gtk.org>
* gtk/gtktreeitem.c (gtk_tree_item_set_subtree):
* gtk/gtktree.c (gtk_tree_add) (gtk_tree_insert):
* gtk/gtktoolbar.c (gtk_toolbar_insert_element):
* gtk/gtkpaned.c (gtk_paned_pack2) (gtk_paned_pack1):
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_add):
* gtk/gtktable.c (gtk_table_attach):
* gtk/gtklist.c (gtk_list_insert_items):
* gtk/gtkmenushell.c (gtk_menu_shell_insert):
* gtk/gtknotebook.c (gtk_notebook_insert_page_menu):
* gtk/gtkpacker.c (gtk_packer_add_defaults) (gtk_packer_add):
* gtk/gtkbin.c (gtk_bin_add):
* gtk/gtkbox.c (gtk_box_pack_start) (gtk_box_pack_end):
* gtk/gtkfixed.c (gtk_fixed_put):
* gtk/gtklayout.c (gtk_layout_put):
general fixups to container_add logic. always realize child if
child->parent is realized, only map the child and queue a resize
if child and child->parent are both visible.
Fri Apr 30 09:02:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_unrealize): use gtk_container_forall
instead of gtk_container_foreach to walk and unrealize children, so
composite children get also unrealized.
(gtk_widget_real_show): don't call gtk_widget_map() if we don't need to.
(gtk_widget_map): assert that the widget is visible (basic constrain).
(gtk_widget_real_map): assert that the widget is realized (basic
constrain).
Fri Apr 29 00:53:20 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbindings.c (gtk_pattern_spec_init): plugged a memory leak.
Tue May 4 09:32:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc.iso-8859-2: Add a gtkrc
file for iso-8859-2 locales.
* configure.in (ALL_LINGUAS): ALL_LINGUAS update.
Tue Apr 27 16:38:32 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Fix typo of static_sources for static_SOURCES.
(Pointed out by andy@rz.uni-karlsruhe.de and others).
Remove some suspicious and useless lines.
Tue May 4 08:44:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c (gtk_clist_draw, draw_rows): Use
width,height = 0, 0 to mean - here to edge of window,
instead of -1, -1, since the former is all we support.
Tue May 4 08:34:43 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main): Correctly free list nodes
when removing from quit_functions list.
Tue Apr 27 14:17:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpacker.c (gtk_packer_size_request): remove unused variable.
Tue Apr 27 18:23:35 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable):
When redrawing characters on non-visible entry, use appropriate
'*' character. (Bug #1130 - Jean-Marc Jacquet <jm@littleigloo.org>)
Tue Apr 27 01:31:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (drag_dest_cell): compute destination cell
from drag coordinates.
(gtk_clist_drag_data_received) (gtk_clist_drag_motion):
use drag_dest_cell.
* gtk/gtktree (drag_dest_cell)
(gtk_ctree_drag_data_received) (gtk_ctree_drag_motion): likewise.
(Bug #1129)
Wed Apr 21 21:26:11 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_init): properly initialize
translate_* fields.
(gtk_item_factory_finalize): invoke translate_notify independant from
translate_data.
(gtk_item_factory_set_translate_func): likewise.
(gtk_item_factory_destroy): only remove ifactory pointer from those
widgets that belong to us (stupid me).
Mon Apr 19 12:05:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Fixed leak of
rc_style list when lookup succeeeds.
Thu Apr 15 01:11:24 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (resync_selection):
* gtk/gtkclist.c (resync_selection): fixed undo_selection bug.
* gtk/gtkclist.c (gtk_clist_button_release): fixed resync_selection
bug.
Fri Apr 9 19:22:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c gtk/gtkdnd.c gtk/gtkmenuitem.c:
Add some missing GDK_THREADS_ENTER()/LEAVE around
timeouts. (Patches from Sebastian Wilhelmi <wilhelmi@ira.uka.de>)
Thu Apr 8 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkentry.c (gtk_entry_key_press): use gtk_widget_activate()
rather than emit_by_name.
* gtk/gtkeditable.c (gtk_editable_insert_text): keep a reference
on the widget across multiple signal emissions.
(gtk_editable_delete_text): same here.
(gtk_editable_class_init): set widget_class->activate_signal after
editable_signals[ACTIVATE] has been created.
Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
position here prematurely -- we might not have the
right ->min_position and ->max_position yet.
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
Add error traps so if the other end of the connection
dies, we survive.
* gtk/gtkselection.c (gtk_selection_notify): Clean
up properly when selection property retrieval fails.
* gtk/gtkselection.c (gtk_selection_request): Correctly
reject SelectionRequest notifies where the handler
returns no data.
Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_dest_leave): Only unhighlight
when we've previously highlighted.
* gtk/gtkdnd.c (gtk_drag_dest_handle_event): Don't
emit two "drag_leave" signals for Motif drops.
* gtk/gtkdnd.c (gtk_drag_source_handle_event): Send
back the correct status messages when dropping from
Motif onto a proxy window that is rejecting the
drop.
Sat Mar 27 23:32:13 1999 Tim Janik <timj@gtk.org>
* gtk/gtkarg.[hc]: added functions from GLE, gtk_arg_reset() to free
the value and reset type to GTK_TYPE_INVALID, and gtk_arg_values_equal()
to compare two argument values. added gtk_arg_to_valueloc() to set a
variable from an arg through its location (pointer).
* gtk/gtkobject.[hc]: implemented gtk_object_get() in terms of
gtk_object_arg_get() and gtk_arg_to_valueloc(), floats are collected
as gfloat*, uchars are collected as guchar*, ints are collected as
gint*, etc...
Mon Mar 29 17:45:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccelgroup.c gtk/gtkgtkbindings.c:
Include <string.h> instead of <strings.h>.
* gtk/gtkstyle.c: Fix double include of gtkthemes.h
(actually, a lot more duplicate includes occur if
you trace through the sequence of #include's)
gtk-jbb-990320-0: John Bley, jbb6@acpub.duke.edu
Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com>
Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp>
gtk-a-higuti-990322-[0-3]
* configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS
that was causing -DX_LOCALE not to work.
* gtk/gtkrc.c (gtk_rc_init):
X_LOCALE will never have LC_MESSAGES defined
Thu Mar 25 12:38:31 1999 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_append_default_module_path): get $HOME from
g_get_home_dir() (gtk-pmc-990123-0.patch.gz).
* gtk/gtkwindow.c (gtk_window_key_press_event): feature keypad up/down/
left/right as well (gtk-michael-980726-0.patch.gz).
* gtk/gtklabel.[hc]: bunch of miscellaneous cleanups, such as s/0/NULL/
for pointer values, use gchar instead of char. fixed uline allocation
leaks, changed the allocation pattern so we use G_ALLOC_AND_FREE mem
chunks instead of G_ALLOC_ONLY.
(gtk_label_size_request): always alter requisition as passed and leave
widget->requisition alone.
(gtk_label_set_text): allow NULL strings.
(gtk_label_new): likewise.
Wed Mar 24 09:24:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.[hc]: type/macro fixups.
Mon Mar 22 05:51:34 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbin.c (gtk_bin_draw): only redraw children that are visible
*and* mapped (i.e. drawable).
(gtk_bin_expose): only send exposes to drawable children.
* gtk/gtkbox.c (gtk_box_draw): only redraw children that are drawable.
(gtk_box_expose): only send exposes to drawable children.
* gtk/gtkhscale.c (gtk_hscale_draw):
* gtk/gtkvscale.c (gtk_vscale_draw):
hm, this is an ugly one. we first compute the size of our trough area
here (window relative) and then check intersection with the draw_area
which is parent relative because we're a NO_WINDOW widget, so we need
to offset the trough area by allocation.x and allocation.y before the
check. (this must not be done for the background area though, since
that's already computed parent relative).
Mon Mar 22 00:41:39 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_unrealize): unmap clist if neccessary,
unrealize title buttons.
Fri Mar 19 00:00:22 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_column_title_passive)
(gtk_clist_column_title_active):
only connect/disconnect to GtkWidgetClass::event to block mouse events.
* gtk/gtkclist.c (vertical_timeout) (horizontal_timeout):
zero initialize event, removed superfluous gdk_window_get_pointer call
* gtk/gtklist.c (gtk_list_vertical_timeout)
(gtk_list_horizontal_timeout): removed superfluous
gdk_window_get_pointer call
Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org>
* plugging problems reported by "Bruce Mitchener, Jr."
<bruce@puremagic.com> due to a purify session.
* gtk/gtkstyle.c:
(gtk_style_ref):
(gtk_style_unref): assert ref_count to be > 0.
* gtk/gtkclist.c (gtk_clist_set_cell_style): { 0 } initilaize
the requisition.
(gtk_clist_set_shift): likewise.
* gtk/gtklayout.c: introduce gtk_layout_finalize() to unref the
adjustments.
* gtk/gtklist.c (gtk_list_horizontal_timeout): zero initialize the
event before sending it and set send_event to TRUE (which needs to
be done for *all* synthesized events).
(gtk_list_vertical_timeout): likewise.
* gtk/gtktipsquery.c (gtk_tips_query_destroy): plug small memory
leaks.
* gtk/gtkdrawingarea.c (gtk_drawing_area_send_configure): set send_event
to TRUE when synthesizing events.
[ *** end of merges from 1.2 *** ]
1999-11-22 21:52:50 +00:00
|
|
|
enum {
|
1998-03-08 20:44:01 +00:00
|
|
|
SYNC_REMOVE,
|
|
|
|
SYNC_INSERT
|
|
|
|
};
|
|
|
|
|
1998-11-05 15:44:22 +00:00
|
|
|
enum {
|
|
|
|
ARG_0,
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
ARG_N_COLUMNS,
|
|
|
|
ARG_SHADOW_TYPE,
|
|
|
|
ARG_SELECTION_MODE,
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
ARG_ROW_HEIGHT,
|
1999-02-18 00:35:11 +00:00
|
|
|
ARG_TITLES_ACTIVE,
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
ARG_REORDERABLE,
|
Adapt cast macros to standard.
Fri Nov 19 10:34:41 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkgamma.h: Adapt cast macros to standard.
[ Merges from 1.2 ]
Tue Nov 16 10:15:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_path):
If translation does not include a '/', use entire
translation instead of crashing.
Sun Oct 31 22:21:11 1999 Tim Janik <timj@gtk.org>
* docs/gtk_tut.sgml:
s/gtk_accel_group_attach/gtk_window_add_accel_group/.
Sat Oct 30 09:09:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_target_list_remove): Use
g_list_remove_link, not g_list_remove.
[ From Geert Bevin <gbevin@thunderstorms.org> ]
Sun Oct 24 07:41:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkclist.c (real_undo_selection): commented out g_print()
statement upon unselection (how the heck did that slip in?).
Sat Oct 23 03:03:08 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_freeze):
(gtk_text_thaw): undraw/draw cursor here to avoid unnecessary scrolling
in frozen state (and aparently crashes). patch provided by Anders
Melchiorsen <and@kampsax.dtu.dk>.
Sat Oct 23 02:53:20 1999 Tim Janik <timj@gtk.org>
* fix insensitive default/focus widget activation,
reported by Matt Goodall <mgg@isotek.co.uk>.
* gtk/gtkwindow.c (gtk_window_key_press_event):
(gtk_window_activate_default):
(gtk_window_activate_focus):
return handled=FALSE for actiavtion of insensitive default
widgets. return handled=TRUE for activation of insensitive
focus widgets. don't activate in either case.
Tue Oct 19 09:55:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk-config.in (lib_gtk): Switch order of @x_cflags@
and $glib_cflags to match library order and in the
theory that an old version of GLib is more likely to
be in the include directory for X then vice-versa.
(Bug #2776)
Tue Oct 19 09:46:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always use LC_CTYPE
to determine the locale for fontsets, not LC_MESSAGES;
the user may want English messages with a handling
for non-English languages. (LC_CTYPE=ru_RU LC_MESSAGES=fr_FR
will still be broken) (Bug #2891)
Tue Oct 19 20:36:42 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Fixed the wrong number of "*"'s.
Tue Oct 19 12:15:13 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Changed the Korean default fontset.
Fri Oct 8 02:32:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): Fix bug
where when scrolling to the left or top double exposes
were done, causing major slowdowns.
Thu Oct 7 18:31:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always normalize codeset
names to lowercase and alphanumeric, before looking
them up.
* gtk/Makefile.am: Install codeset variant gtkrc files
with normalized names.
Thu Oct 7 22:52:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_popup_with_data): even
popup menus when the menu is already visible, but its parent
is still hidden, (happens after tornoff window got hidden).
Thu Oct 7 11:09:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (install-data-local): Fix
a typo where gtkrc.vi_VN.tcvn5712 wasn't getting
deleted, causing error messages on install.
Thu Oct 7 11:03:06 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtk[hv]paned.c (gtk_{h,v}paned_draw): Redraw
the handle as well, since we now sometimes ignore
exposes on the handle while resizing.
Wed Oct 6 18:02:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_append_default_pixmap_path): Fix stupid
extra g_free introduced in one of the last one or two
commits.
Wed Oct 6 16:38:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc*: Make naming of gtkrc files
consistent, put each style that a gtkrc.* file creates
in a unique namespace, remove old files before installing.
Wed Oct 6 14:31:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Avoid leaking memory when
gtk_rc_init is called multiple times. (Yes, people who
do that have bugs in their code.)
Tue Oct 5 11:36:57 PDT 1999 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: listing gtkrc in gtkconf_DATA seems to barf.
Remove it since it's generated by the Makefile anyway
Tue Oct 5 02:43:41 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputcommon.h (gdk_input_device_new): Free
device->info.axes for core pointer.
Thu Sep 30 13:55:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (destroy_idle_test): Rename idle to
idle_id, to deal with obsolete, broken C libraries.
Mon Sep 27 02:50:15 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkvscale.c (gtk_vscale_draw): Don't add in
allocation->x/y twice!
* gtk/gtkhscale.c: Make usage of gtk_hscale_pos_trough()
consistent with gtk_vscale_pos_trough().
Sun Sep 26 19:44:34 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_queue_resize): We may
be queueing a resize on a toplevel container between
the time we show it and when we map it. So, we need
to test GTK_WIDGET_VISIBLE() for toplevels, and only
use GTK_WIDGET_DRAWABLE() for child windows.
Thu Sep 23 16:41:03 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDADDS): Add GDK_WLIBS to LDADDS
(fixes bug #2144)
Fri Sep 24 00:51:45 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c (gtk_container_queue_resize): check for
container DRAWABLE (instead of VISIBLE), so we don't queue
resizes on non-toplevel containers.
Sun Sep 19 18:13:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.[ch]: Make the data argument
const guchar *.
Sat Sep 18 21:27:40 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: Try to behave sensibly if
the focus widget is the window itself. (Should
we allow this at all?)
Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_set_sensitive):
* gtk/gtknotebook.c (gtk_notebook_set_scrollable):
* gtk/gtknotebook.c (gtk_notebook_set_show_border):
* gtk/gtkclist.c (gtk_notebook_set_show_border): make gboolean args
in prototypes and implementations consistent (Tomas Ogren).
* gtk/gtklayout.c (gtk_layout_remove): unset GTK_IS_OFFSCREEN flag
before the widget is unparented (reported by damon).
* gtk/gtkdnd.c: make the cursor and icon data _unsigned_ char,
since we provide unsigned data anyways.
Thu Sep 16 21:32:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_set_tip): Delay
the call to gtk_tooltips_layout_text() until later.
* gtk/gtktooltips.c (gtk_tooltips_draw_tips):
Call gtk_widget_ensure_style() before using the style.
Wed Sep 15 02:52:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_event): Added workaround
for old widgets that don't propagate draws to all
children. (Namely gnome-dock for gnome-libs <= 1.0.16)
Tue Sep 14 19:22:19 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_queue_resize): don't queue the parent
for a redraw but just the widget that requested the resize.
Tue Sep 14 18:29:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c: added new widget level method
gtk_container_set_reallocate_redraws() and a GtkContainer flag
reallocate_redraws : 1 to reflect the setting, exported this through
the argument system as a boolean ::reallocate_redraws.
* gtk/gtkwidget.c (gtk_widget_size_allocate): when queueing redraws
on the widget because the allocation changes, do so as well for
widget->parent if the parent has reallocate_redraws set to TRUE.
with that containers requesting reallocation redraws get automatically
redrawn if their children changed allocation (this unfortunately
affects also other children that didn't change allocation, but we
cannot work around that before 1.3).
Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_idle_draw): only emit ::draw if width
_and_ height are >0 (not _or_).
* gtk/gtktable.c (gtk_table_remove): use gtk_widget_queue_resize()
instead of gtk_container_queue_resize(), which is a core gtk internal
function (must have been on crack when i queued that).
* gtk/gtkprivate.h: added new private flag GTK_FULLDRAW_PENDING, so
we can check more reliably if we want to discard expose events.
* gtk/gtkwidget.c: added setting/unsetting of the GTK_FULLDRAW_PENDING
flag.
* gtk/gtkwidget.c (gtk_widget_event): don't discard synthesized exposes,
we simply trust these events. for deciding whether to discard exposes,
check GTK_FULLDRAW_PENDING instead of RESIZE_PENDING.
Mon Sep 13 15:01:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore
queues of areas that are completely off screen.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fix broken
logic for handleboxes.
* gtk/gtkwidget.c (gtk_widget_queue_draw_data): Add santity
check on width/height.
Mon Sep 13 02:22:47 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: backed out Raja's recent VPATH build "improvements",
we are fine with using $@ the way we do (if we actually encounter
brokeness with $@ in VPATH builds because of additional path prefixes,
we need to use $(@F) actually).
Mon Sep 13 01:34:53 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c: renamed two variables, hopefully didn't introduce
short lived bugs, that would allow language bindings to do surgeries
to our guts.
Fri Sep 10 15:22:50 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_size_allocate): Fix typo
where comparison was being done against an uninitialized
value causing intermittant results depending on
compiler flags. Also make it clearer that we aren't
ever initializing the child as 0x0 (though this will
be caught in gtk_widget_size_allocate())
Fri Sep 10 10:06:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_transient_for): Move
gtk_window_unset_transient_for() call after we do checks
involving the old transient parent.
[ From Lance Capser <lmc@cyberhighway.net> ]
1999-09-07 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gtk.defs): Go back to using `touch' to create
an empty file.
Mon Sep 6 00:11:56 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (gtk_ctree_is_ancestor): return FALSE if node has
no children. (Reported by: Chris Rogers <gandalf@pobox.com>)
1999-09-03 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gen_sources): Improve VPATH builds.
`$@' is valid only in the build dir, not after we've done
`cd $srcdir'. Also use `test -f' instead of less portable
`test -e'.
Fri Sep 3 15:59:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (correct_cache_insert): Rewrite
for simplicity, and hopefully correctness.
(Fixes bug #1322, which was a segfault when
on some insertions with the properties around
the insertion set up just wrong.)
* gtk/gtktext.c (gtk_text_adjustment): When we receive
a "changed" signal, clamp the new value to the adjustment
bounds to avoid segfaulting if someone tries to change
the adjustment to a bogus value. (Bug #1795)
Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c: Ignore unexpected destroy notifies
for children, for toplevel windows handle them
like delete_event.
* gtk/gtkplug.c: Add an unrealize handler so that
we unref plug->socket_window when we are done
with it.
Fri Sep 3 14:52:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_area): Fix stupid signedness
problem that was causing background to sometimes
be misaligned.
Fri Sep 3 12:26:33 1999 Owen Taylor <otaylor@redhat.com>
[ Fixes pointed out by Ettore Perazzoli <ettore@comm2000.it> ]
* gtk/gtkmenu.c (gtk_menu_position): Make
sure we never position menus with negative x, y,
since gtk_widget_set_uposition() can't handle that.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu):
Modify the positioning code a bit so that we always
put the top-left corner onscreen. (This is for
UI reasons, gtk_menu_position() now takes care of
gtk_widet_set_uposition() brokeness.)
Fri Sep 3 03:06:30 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: fixed up things for -jx, x > 1.
Sun Sep 5 08:48:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_style): Ref the
RC style that is passed in. The lack of the ref
before was a bug. If people worked around this
bug, this will introduce a slight memory leak
in their code. The code should typically look like:
rc_style = gtk_rc_style_new ();
[...]
gtk_widget_modify_style (widget, rc_style);
gtk_rc_style_unref (rc_style);
* gtk/gtkwidget.c (gtk_widget_modify_style): Reset
the style if it was already set.
* gtk/gtkwidget.c (gtk_widget_set_name): Only set the
style if it was set before.
Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (main): Add a check to see if we
are being run from the correct directory and
to quit nicely if we are not.
* gtk/gtkrc.c (gtk_rc_slist_remove_all): Make function
static.
Thu Sep 2 23:00:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkenums.h (GtkWindowPosition): added GTK_WIN_POS_CENTER_ALWAYS.
* gtk/gtkwindow.c:
queue resizes unconditionally (gtk_widget_queue_resize will figure
what to do if the window is not realized).
(gtk_window_move_resize): only recenter the window
for GTK_WIN_POS_CENTER_ALWAYS.
(gtk_window_compute_reposition): handle GTK_WIN_POS_CENTER_ALWAYS in
the same way as GTK_WIN_POS_CENTER.
Thu Sep 2 22:39:27 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_reposition): check for the last position
with (!(info->last_flags & GDK_HINT_POS)) instead of
(!info->last_flags & GDK_HINT_POS).
* gtk/gtkwindow.c (gtk_window_move_resize): constrain new_width and
new_height unconditionally, because we use these values even if
!default_size_changed && !hints_changed.
comented the (default_size_changed || hints_changed) case with
respect to resize rejects from the window manager.
* gtk/gtkwindow.c (gtk_window_move_resize): save info->last values
in the zvt condition hack, since this includes the window hints, set
the hints after the handling_resize case.
* gtk/gtkwindow.c (gtk_window_show): constrain the default size that a
window is initially shown with to the geometry.
Thu Sep 2 07:38:56 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize):
s/size_changed/default_size_changed/g so i know what's
really going on (frying brain on smaller flame now).
Thu Sep 2 05:47:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): queue a new resize if
we have size_changed upon handling_resize. this is a gross
workaround for the broken zvt widget and should be removed in
1.3 again (search for FIXME).
Owen provided an accurate comment for this:
/* We could be here for two reasons
* 1) We coincidentally got a resize while handling
* another resize.
* 2) Our computation of size_changed was completely
* screwed up, probably because one of our children
* is broken. It's probably a zvt widget.
*
* For 1), we could just go ahead and ask for the
* new size right now, but doing that for 2)
* might well be fighting the user (and can even
* trigger a loop). Since we really don't want to
* do that, we requeue a resize in hopes that
* by the time it gets handled, the child has seen
* the light and is willing to go along with the
* new size. (this happens for the zvt widget, since
* the size_allocate() above will have stored the
* requisition corresponding to the new size in the
* zvt widget)
*
* This doesn't buy us anything for 1), but it shouldn't
* hurt us too badly, since it is what would have
* happened if we had gotten the configure event before
* the new size had been set.
*/
Wed Sep 1 20:46:11 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: deal properly with the fact that RC
style lists may include rc styles more than once.
* gtk/gtkrc.c (gtk_rc_append_pixmap_path): Removed
unused static function.
* gtk/gtkrc.c (gtk_rc_find_pixmap_in_path): Keep a
stack of directories of RC files currently being
parsed and implicitely add them to pixmap path.
This fixes a bug where the directory would get
appended then overwritten by pixmap_path declarations.
(bug #1462, from Peter Wainright <prw@wainpr.demon.co.uk>)
* gtk/gtkthemes.c (gtk_theme_engine_unref): Call
theme's exit function. (Patch from Peter Wainwright,
bug #1454)
* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_destroy):
Add a destroy() handler to take care of removing
group for menu item. (Fixes bug #1197)
* gtk/gtkwidget.c (gtk_widget_size_request): Fixed thinko
in warning message.
Wed Sep 1 21:27:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): don't require a server
roundtrip to figure window's width and height, since we know that
anyways from widget->allocation.
Wed Sep 1 12:37:44 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Compute
the hints after we request the new size.
Wed Sep 1 10:38:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_compute_hints): Removed
GTK_WIDGET_REALIZED() assertion - we can compute the
hints before we are realized.
* gtk/gtkwindow.c (gtk_window_move_resize): Reorder
hint changing so that we have a value of hints_changed
when we decide whether to constrain the window size.
* gtk/gtkwindow.c (gtk_window_move_resize): Spelling fix.
* gtk/gtkwindow.c (gtk_window_constrain_size): cleanups,
change back to G_MAXINT.
Wed Sep 1 06:54:59 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_get_geometry_info): zero initialize
new GtkWindowGeometryInfo, so fields like GdkGeometry geometry
contain uncluttered values.
(gtk_window_compute_hints): simply assert that window is realized
and that geometry_info is valid, since we rely on this anyways.
(gtk_window_constrain_size): major cleanups to the code.
if (flags & GDK_HINT_BASE_SIZE) use geometry's base width and height
for the base size, instead of the minimums. use 32767 as max width
and height (like in gtkwindow.c) instead of G_MAXINT.
Wed Sep 1 04:41:25 1999 Tim Janik <timj@gtk.org>
* cleaned up the GtkContainer.need_resize flag handling mess, we
only need to force resize requests when we were prematurely
realized, or our widget tree was modified when we were temporarily
hidden. handling these cases directly upon showing the window (i.e.
while the GdkWindow is still unmapped) avoids the need to wait for
a configure event response and therefore makes the GUI more snappier
and avoids blank windows during the roundtrip.
* gtk/gtkwidget.c:
(gtk_widget_hide):
(gtk_widget_show): don't queue resizes on toplevels, they know how
to deal with matters.
* gtk/gtkcontainer.c (gtk_container_queue_resize): set the ->need_resize
flag directly for not visible resize containers and spare us unecessary
signal emissions.
* gtk/gtkwindow.c:
(gtk_window_realize): if we need to enforce premature size allocation,
queue a container resize so we are correctly resized later on.
(gtk_window_init):
(gtk_window_size_request):
don't freak around with the ->need_resize flag,
gtk_container_queue_resize() will care about that.
(gtk_window_show):
handle initial resizing issues here, we can handle matters better in
this place, especially since we know that our GdkWindow is still
unmapped.
(gtk_window_move_resize):
don't care about ->need_resize at all.
handle size changes properly that occoured while we waited for a
configure event.
Tue Aug 31 15:58:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_uposition):
* gtk/gtkwindow.[hc] (gtk_window_reposition):
Move the hint setting code from gtk_widget_set_uposition
to here; set the hints so that we respect any previously
set geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Don't
change the window hints here or move the window here,
let that happen in gtk_window_move_resize().
Tue Aug 31 06:58:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): when discarding exposes due
to already queued resizes (and therefore redraws) on a widget, check
its anchestry as well.
* gtk/gtkcontainer.c:
(gtk_container_queue_resize): clear resize widgets for resize
containers before aborting prematurely. this is especially important
for toplevels which may need imemdiate processing or their resize
handler to be queued.
(gtk_container_dequeue_resize_handler): added new internal function for
gtkwindow.c.
* gtk/gtkwindow.c (gtk_window_move_resize): if we are resizing due to a
configure event, take possible changes in window position into account
as well.
if we request a new window size, queue up a resize handler that will
last until the configure event response arrives.
combined the ->need_resize case (initial show) with the general size
(hints) changed case and added even more comments.
if !auto_shrink, only revert to the old allocation if the new size
is smaller than the current allocation.
Tue Aug 31 11:55:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_arg, gtk_window_set_policy,
gtk_window_set_geometry_hints
gtk_window_set_default_size):
When hints are set, queue a resize so that the hints will
be eventually reset on the toplevel.
* gtk/gtkwindow.c (gtk_window_show): Use
gtk_window_compute_default_size(). Clear the need_resize flag
on the initail map so that we don't unnecessarily trigger the
resize code.
* gtk/gtkwindow.c (gtk_window_move_resize): Split apart
into separate functions. Compare the hints we are setting
with what we set last time so that we can accurately
tell when we need to reset the hints.
* gtk/gtkwindow.c (gtk_window_compute_default_size): New
function to figure out the size from requisition
and default_size.
* gtk/gtkwindow.c (gtk_window_constrain_size): Function
from fvwm to constrain a size to the geometry hints.
* gtk/gtkwindow.c (gtk_window_compare_hints): New function
to compare two sets of geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_hints): Renamed
from gtk_window_set_hints(), just compute the hints,
don't set them.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Move
code from gtk_window_move_resize() to separate function,
rationalize a bit.
Tue Aug 31 13:05:03 1999 Owen Taylor <otaylor@redhat.com>
* gtkrc.h: Move the ref_count member out of the GtkRcStyle
structure into a new private structure.
* gtkrc.c: Split GtkRcStyle into public/private.
In the private part, add a list of pointers to the
RcStyle lists this RcStyle participates in.
* gtkrc.c: When a RcStyle is free, remove all
lists referencing it from the
realized_style_ht hash, and free those lists.
* gtk/gtkrc.c (gtk_rc_clear_styles): Don't call
gtk_rc_init(), since that adds the default styles
to the list of parsed RC files again.
* gtk/gtkrc.c: Use gtk_rc_style_find() consistently.
Thu Aug 26 14:14:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): reactivated the sanity
checks that ensure that a widget's allocation is at least 1 in width
and height. (GNOME note: this doesn't affect old panel code anymore,
because GtkSocket will request width and height of at least 1 since
Fri Jul 23).
* gtk/gtkwindow.c (gtk_window_realize): if the widget hasn't been
allocated yet (happens if the user realizes the window prematurely),
size request and allocate it.
(gtk_window_size_allocate): guard against guint underflows.
Wed Aug 25 19:01:36 1999 Lars Hamann <lars@gtk.org>
* gtk/Makefile.am (gtk_built_sources): reordered stamp-gtk.defs
in gtk_built_sources, so gtk.defs gets built prior to all other
sources.
Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am:
invoke indent on gtkmarshal.*.
rewrote source generation rules, use COPYING as oldest source tag for
a piggyback rule to generate all sources from (don't touch it ;).
major cleanups, strip spaces on build rules for GNU Make.
* gtk/genmarshal.pl: don't operate on hardcoded filenames but take
source and target files from commandline arguments. don't invoke indent.
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Wed Aug 18 09:20:10 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c:
we use window->need_resize from configure_event now, to indicate that
the gtkwindow should keep its allocation (e.g. because the user resized
the window through window manager handles). resize_count is now reliably
used to figure whether we got the allocation we requested from the
window manager.
configure events get queued as resizes now, the real stuff (size
computation and allocation) now only goes on in gtk_window_move_resize().
GtkWindow's requisition now contains its *real* requisition (like all
other widgets), *not* taking usize into account.
geometry_info->last_{width|height} is now updated from set_hints() only
so it always contains the last hints we set for the window manager.
made some event handlers return TRUE instead of FALSE.
the overall code should be much more straight forward now, and the
significant code portions are accompanied by comments now.
(gtk_window_set_hints):
removed requisition argument and made it
fetch the requisition through gtk_widget_get_child_requisition.
we also don't move the gdkwindow here anymore, gtk_window_move_resize()
does that now.
(gtk_window_show):
ensure that the widget is realized before calling
gtk_container_check_resize() (and thus gtk_window_move_resize()), also
ensure that we got properly size requested and allocated before
realization.
(gtk_window_configure_event):
ignore plain window moves, or reallocate the widget tree through the
resize queue otherwise.
(gtk_window_move_resize):
mostly rewrote this function to figure window manager hints more
reliably, coalesce window moves and resizes to reduce configure events
and do actuall size allocations.
Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): discard expose events for widgets
that have a resize pending, because a redraw is already queued for them.
* gtk/gtkcontainer.c: removed ugly connect_to ::size_allocate signal
hack to clear resize_widgets.
* gtk/gtkwidget.c (gtk_widget_size_allocate): call clear_resize_widgets
for resize containers prior to size allocation. (this is also a bit
ugly, but avoids side effects for stopped emissions and is thus more
reliable).
(gtk_widget_unparent): removed disconnect call for clear_resize_widgets.
* gtk/gtktooltips.c (gtk_tooltips_paint_window): renamed this
function from gtk_tooltips_expose, as we connect to ::expose_event
*and* ::draw now.
1999-08-18 Federico Mena Quintero <federico@redhat.com>
* gtk/gtkselection.c (gtk_target_list_ref): Added missing sanity
checks.
(gtk_target_list_unref): Likewise.
* gtk/gtkthemes.c (gtk_theme_engine_unref): Likewise.
Tue Aug 17 15:47:07 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_draw_value_bar):
guard against division by zero. (Fixes bug #1339)
Tue Aug 17 10:56:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_move_{forward,backward}_word):
Prevent the trivial leak of information of allowing
word motion when the entry is not visible.
Tue Aug 17 10:28:52 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_fileop_error): Propagate
modality to error dialog as well as confirmation dialogs.
(Bug #1803, reported by Rosanna Wing Sze Yuen)
Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktreeitem.c (gtk_tree_item_draw_lines): Honor
tree->view_lines.
(gtk-guy-990611-3.patch: Guy Harris <guy@netapp.com>)
* gtk/Makefile.am (install-data-local): Solaris apparently
has various troubles with ln -f; use rm first instead.
(gtk-guy-990611-2.patch: Guy Harris <guy@netapp.com>)
1999-07-30 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (stamp-m): Don't `mv' from builddir to srcdir,
use `cp' followed by `rm' (the `rm' was already there).
July 30, 1999 Elliot Lee <sopwith@redhat.com>
* configure.in: Fix autoconf warnings about cross compilation by
trying to provide sane defaults for AC_TRY_RUN.
* gtk/Makefile.am: If we refer to gtkmarshal.[ch] in $(srcdir),
put them into $(srcdir) when generated. Also add a dependency of
gtksignal.h on gtkmarshal.h for -j builds.
* gtk/gtk(dnd,style,gamma).c: Minor warning fixes.
Wed Jul 28 09:29:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration_do): Added missing
GDK_THREADS_{LEAVE,ENTER} pair.
(From Paul Fisher <pnfisher@redhat.com>)
Fri Jul 23 01:00:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtksocket.c (gtk_socket_size_request): asure that the requested
width and height are always >0 (owen).
Fri Jul 23 00:00:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): backed out my recent
change that assured that a widget's allocated with and height are
always >1, since this breaks *buggy* panel code. unfortunately this
back-breaks the gimp's color selector.
* gtk/gtkdrawingarea.c (gtk_drawing_area_size_allocate): asure that our
allocation is always >0 in width and height, before sending the
configure event; this is a *gross* hack to get the gimp back to work.
* marked both cases with TODO-1.3
Wed Jul 21 15:47:39 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Don't display wrap indicators when
text is not editable and word wrap is on.
Wed Jul 21 08:21:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): special case
option menus here as they are not derived from menu shell, assure that
the option menu has a menu we can add items to.
Tue Jul 20 23:29:48 1999 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_page_allocate): convert allocation->
width/height to (gint) before calculations and check against < 0 to
avoid guint wraparounds.
Sun Jul 18 00:35:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): ensure that the allocated
width and height is never zero. sanity check both dimensions against
32767 and issue a warning if the allocation is greater than that.
Wed Jul 7 15:03:30 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_events_pending): Unlock around call
to g_main_pending() as well.
Wed Jul 7 14:59:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration): Unlock around
call to g_main_iteration() - since that will regrab
GTK+ lock to process events.
Thu Jul 1 15:01:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c
- Regularize with the rest of GTK+ by making widget->requisition
not reflect the set_usize()
- Always recompute geometry hints, then check if they
changed before sending them to the X server. The
previous checks for changes would fail in a number
of circumstances.
Thu Jul 1 11:55:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Include <stdlib.h> for strcmp().
Wed Jun 30 19:26:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c:
- Code cleanups
- Instantaneously update on modifier key presses
- Allow cancellation of the drag with Escape.
Tue Jun 29 17:04:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_handle_box): Set the policy
to auto_shrink - otherwise the appearance is rather
strange when flipping between horizontal and vertical.
Mon Jun 28 09:29:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: add ::default_width and ::default_height arguments.
(gtk_window_set_default_size): don't change a value if it's < 0.
queue a resize.
Sun Jun 27 11:00:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_insert): don't segfault on NULL inserts.
Mon Jun 28 12:08:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (cmpl_completion_fullname): Don't
add an extra "/" when concating "/" + filename.
(From Matt Grossman <mattg@oz.net>)
Mon Jun 28 10:57:12 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (draw_cell_pixmap): Reset clip mask
for fg_gc if we set it for drawing pixmap.
Tue Jun 15 12:45:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes from Peter Wainwright <prw@wainpr.demon.co.uk>
* gtk/gtkrc.c (gtk_rc_parse_engine): If rc_style->engine is
already set, call old engine's destroy function and
unref the old engine.
Thu Jun 10 17:59:38 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.c (gtk_drawing_area_size): queue a resize.
Wed Jun 9 15:13:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h: mark certain functions as internal.
Wed Jun 9 13:48:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpreview.c (gtk_preview_set_expand): queue a resize if the
expand behaviour changed.
* gtk/gtklabel.c (gtk_label_set_pattern):
(gtk_label_set_justify):
(gtk_label_set_line_wrap):
don't bother invoking queue_clear, the reallocation does
that for us, always free_words so the upcoming resize will
relayout the label's contents.
Wed Jun 9 12:50:48 1999 Tim Janik <timj@gtk.org>
* applied argument implementation patches from Elena Devdariani
<elena@cogent.ca>.
* gtk/gtktoolbar.c: ::orientation, ::toolbar_style, ::space_size,
::space_style, ::relief
* gtk/gtkruler.c: ::lower, ::upper, ::position, ::max_size
* gtk/gtkpreview.c: ::expand
* gtk/gtkpaned.c: ::handle_size, ::gutter_size
* gtk/gtknotebook.c: ::homogeneous
* gtk/gtklabel.c: ::wrap
* gtk/gtklist.c: ::selection_mode
* gtk/gtkhandlebox.c: ::handle_position, ::snap_edge
* gtk/gtkcurve.c: ::curve_type, ::min_x, ::max_x, ::min_y, ::max_y
* gtk/gtkcolorsel.c: ::update_policy, ::use_opacity
* gtk/gtkclist.c: ::sort_type
* gtk/gtkcheckmenuitem.c: ::active, ::show_toggle
* gtk/gtkaspectframe.c: ::xalign, ::yalign, ::ratio, ::obey_child
Tue Jun 1 23:38:38 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Removed ill-thought-out part of last
comment.
Tue Jun 1 23:30:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_attach): Get the reference
counting right when we have to attach a new style
for a different visual. (Chi-Deok Hwang <cdhwang@sr.hei.co.kr>)
* gtk/gtkstyle.c: Documented the refcounting
peculularities of gtk_style_attach.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkwindow.c (gtk_window_new): added return if fail for invalid
window types.
* examples/packer/pack.c (main): use GTK_WINDOW_TOPLEVEL instead
of GTK_TOPLEVEL for creating the window.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkmain.c (gtk_init_check): don't segfault when --gtk-module is
the last argument (reported by Per Winkvist).
Tue May 25 13:13:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes for invisible XOR lines (Frank Loemker
<floemker@TechFak.Uni-Bielefeld.DE>)
* gtk/gtkclist.c (gtk_clist_realize): Always use
a non-zero pixel for GDK_XOR.
* gtk/gtkvpaned.c gtk/gtkhpaned.c:
Use GDK_INVERT instead of GDK_XOR.
Wed May 12 21:56:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (adjust_adjustments): signal emit value_changed
signals if h/voffsets differ from adjustment values.
Reportet by Jerome Bolliet <bolliet@in2p3.fr>
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
the user data on the window before destroying it.
* gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
unrealize handler to take care of destroying
notebook->panel properly.
(Bug #1198 - Morten Welinder <terra@diku.dk>)
* gtk/gtktext.c (expand_scratch_buffer): Fix reversal
of g_new and g_realloc to stop memory leak. (Actually,
we could just use g_realloc(), but I'm not 100% sure
that is portable).
(Bug #1196 - Morten Welinder <terra@diku.dk>)
Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.h: Removed stray GtkPlugButton declaration.
* gdk/gdkfont.c (gdk_text_measure): Fix the return value
for fontsets.
* gtk/gtkbutton.c (gtkbutton_expose): Fix warning
with bin/button confusion.
Thu May 6 04:53:26 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: in the ItemFactory test, link radio items together,
and show how preselection of radio items is done.
Sun May 2 13:31:14 1999 Tim Janik <timj@gtk.org>
* gtk/gtktreeitem.c (gtk_tree_item_set_subtree):
* gtk/gtktree.c (gtk_tree_add) (gtk_tree_insert):
* gtk/gtktoolbar.c (gtk_toolbar_insert_element):
* gtk/gtkpaned.c (gtk_paned_pack2) (gtk_paned_pack1):
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_add):
* gtk/gtktable.c (gtk_table_attach):
* gtk/gtklist.c (gtk_list_insert_items):
* gtk/gtkmenushell.c (gtk_menu_shell_insert):
* gtk/gtknotebook.c (gtk_notebook_insert_page_menu):
* gtk/gtkpacker.c (gtk_packer_add_defaults) (gtk_packer_add):
* gtk/gtkbin.c (gtk_bin_add):
* gtk/gtkbox.c (gtk_box_pack_start) (gtk_box_pack_end):
* gtk/gtkfixed.c (gtk_fixed_put):
* gtk/gtklayout.c (gtk_layout_put):
general fixups to container_add logic. always realize child if
child->parent is realized, only map the child and queue a resize
if child and child->parent are both visible.
Fri Apr 30 09:02:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_unrealize): use gtk_container_forall
instead of gtk_container_foreach to walk and unrealize children, so
composite children get also unrealized.
(gtk_widget_real_show): don't call gtk_widget_map() if we don't need to.
(gtk_widget_map): assert that the widget is visible (basic constrain).
(gtk_widget_real_map): assert that the widget is realized (basic
constrain).
Fri Apr 29 00:53:20 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbindings.c (gtk_pattern_spec_init): plugged a memory leak.
Tue May 4 09:32:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc.iso-8859-2: Add a gtkrc
file for iso-8859-2 locales.
* configure.in (ALL_LINGUAS): ALL_LINGUAS update.
Tue Apr 27 16:38:32 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Fix typo of static_sources for static_SOURCES.
(Pointed out by andy@rz.uni-karlsruhe.de and others).
Remove some suspicious and useless lines.
Tue May 4 08:44:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c (gtk_clist_draw, draw_rows): Use
width,height = 0, 0 to mean - here to edge of window,
instead of -1, -1, since the former is all we support.
Tue May 4 08:34:43 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main): Correctly free list nodes
when removing from quit_functions list.
Tue Apr 27 14:17:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpacker.c (gtk_packer_size_request): remove unused variable.
Tue Apr 27 18:23:35 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable):
When redrawing characters on non-visible entry, use appropriate
'*' character. (Bug #1130 - Jean-Marc Jacquet <jm@littleigloo.org>)
Tue Apr 27 01:31:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (drag_dest_cell): compute destination cell
from drag coordinates.
(gtk_clist_drag_data_received) (gtk_clist_drag_motion):
use drag_dest_cell.
* gtk/gtktree (drag_dest_cell)
(gtk_ctree_drag_data_received) (gtk_ctree_drag_motion): likewise.
(Bug #1129)
Wed Apr 21 21:26:11 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_init): properly initialize
translate_* fields.
(gtk_item_factory_finalize): invoke translate_notify independant from
translate_data.
(gtk_item_factory_set_translate_func): likewise.
(gtk_item_factory_destroy): only remove ifactory pointer from those
widgets that belong to us (stupid me).
Mon Apr 19 12:05:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Fixed leak of
rc_style list when lookup succeeeds.
Thu Apr 15 01:11:24 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (resync_selection):
* gtk/gtkclist.c (resync_selection): fixed undo_selection bug.
* gtk/gtkclist.c (gtk_clist_button_release): fixed resync_selection
bug.
Fri Apr 9 19:22:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c gtk/gtkdnd.c gtk/gtkmenuitem.c:
Add some missing GDK_THREADS_ENTER()/LEAVE around
timeouts. (Patches from Sebastian Wilhelmi <wilhelmi@ira.uka.de>)
Thu Apr 8 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkentry.c (gtk_entry_key_press): use gtk_widget_activate()
rather than emit_by_name.
* gtk/gtkeditable.c (gtk_editable_insert_text): keep a reference
on the widget across multiple signal emissions.
(gtk_editable_delete_text): same here.
(gtk_editable_class_init): set widget_class->activate_signal after
editable_signals[ACTIVATE] has been created.
Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
position here prematurely -- we might not have the
right ->min_position and ->max_position yet.
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
Add error traps so if the other end of the connection
dies, we survive.
* gtk/gtkselection.c (gtk_selection_notify): Clean
up properly when selection property retrieval fails.
* gtk/gtkselection.c (gtk_selection_request): Correctly
reject SelectionRequest notifies where the handler
returns no data.
Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_dest_leave): Only unhighlight
when we've previously highlighted.
* gtk/gtkdnd.c (gtk_drag_dest_handle_event): Don't
emit two "drag_leave" signals for Motif drops.
* gtk/gtkdnd.c (gtk_drag_source_handle_event): Send
back the correct status messages when dropping from
Motif onto a proxy window that is rejecting the
drop.
Sat Mar 27 23:32:13 1999 Tim Janik <timj@gtk.org>
* gtk/gtkarg.[hc]: added functions from GLE, gtk_arg_reset() to free
the value and reset type to GTK_TYPE_INVALID, and gtk_arg_values_equal()
to compare two argument values. added gtk_arg_to_valueloc() to set a
variable from an arg through its location (pointer).
* gtk/gtkobject.[hc]: implemented gtk_object_get() in terms of
gtk_object_arg_get() and gtk_arg_to_valueloc(), floats are collected
as gfloat*, uchars are collected as guchar*, ints are collected as
gint*, etc...
Mon Mar 29 17:45:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccelgroup.c gtk/gtkgtkbindings.c:
Include <string.h> instead of <strings.h>.
* gtk/gtkstyle.c: Fix double include of gtkthemes.h
(actually, a lot more duplicate includes occur if
you trace through the sequence of #include's)
gtk-jbb-990320-0: John Bley, jbb6@acpub.duke.edu
Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com>
Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp>
gtk-a-higuti-990322-[0-3]
* configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS
that was causing -DX_LOCALE not to work.
* gtk/gtkrc.c (gtk_rc_init):
X_LOCALE will never have LC_MESSAGES defined
Thu Mar 25 12:38:31 1999 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_append_default_module_path): get $HOME from
g_get_home_dir() (gtk-pmc-990123-0.patch.gz).
* gtk/gtkwindow.c (gtk_window_key_press_event): feature keypad up/down/
left/right as well (gtk-michael-980726-0.patch.gz).
* gtk/gtklabel.[hc]: bunch of miscellaneous cleanups, such as s/0/NULL/
for pointer values, use gchar instead of char. fixed uline allocation
leaks, changed the allocation pattern so we use G_ALLOC_AND_FREE mem
chunks instead of G_ALLOC_ONLY.
(gtk_label_size_request): always alter requisition as passed and leave
widget->requisition alone.
(gtk_label_set_text): allow NULL strings.
(gtk_label_new): likewise.
Wed Mar 24 09:24:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.[hc]: type/macro fixups.
Mon Mar 22 05:51:34 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbin.c (gtk_bin_draw): only redraw children that are visible
*and* mapped (i.e. drawable).
(gtk_bin_expose): only send exposes to drawable children.
* gtk/gtkbox.c (gtk_box_draw): only redraw children that are drawable.
(gtk_box_expose): only send exposes to drawable children.
* gtk/gtkhscale.c (gtk_hscale_draw):
* gtk/gtkvscale.c (gtk_vscale_draw):
hm, this is an ugly one. we first compute the size of our trough area
here (window relative) and then check intersection with the draw_area
which is parent relative because we're a NO_WINDOW widget, so we need
to offset the trough area by allocation.x and allocation.y before the
check. (this must not be done for the background area though, since
that's already computed parent relative).
Mon Mar 22 00:41:39 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_unrealize): unmap clist if neccessary,
unrealize title buttons.
Fri Mar 19 00:00:22 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_column_title_passive)
(gtk_clist_column_title_active):
only connect/disconnect to GtkWidgetClass::event to block mouse events.
* gtk/gtkclist.c (vertical_timeout) (horizontal_timeout):
zero initialize event, removed superfluous gdk_window_get_pointer call
* gtk/gtklist.c (gtk_list_vertical_timeout)
(gtk_list_horizontal_timeout): removed superfluous
gdk_window_get_pointer call
Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org>
* plugging problems reported by "Bruce Mitchener, Jr."
<bruce@puremagic.com> due to a purify session.
* gtk/gtkstyle.c:
(gtk_style_ref):
(gtk_style_unref): assert ref_count to be > 0.
* gtk/gtkclist.c (gtk_clist_set_cell_style): { 0 } initilaize
the requisition.
(gtk_clist_set_shift): likewise.
* gtk/gtklayout.c: introduce gtk_layout_finalize() to unref the
adjustments.
* gtk/gtklist.c (gtk_list_horizontal_timeout): zero initialize the
event before sending it and set send_event to TRUE (which needs to
be done for *all* synthesized events).
(gtk_list_vertical_timeout): likewise.
* gtk/gtktipsquery.c (gtk_tips_query_destroy): plug small memory
leaks.
* gtk/gtkdrawingarea.c (gtk_drawing_area_send_configure): set send_event
to TRUE when synthesizing events.
[ *** end of merges from 1.2 *** ]
1999-11-22 21:52:50 +00:00
|
|
|
ARG_USE_DRAG_ICONS,
|
|
|
|
ARG_SORT_TYPE
|
1998-11-05 15:44:22 +00:00
|
|
|
};
|
|
|
|
|
1998-01-03 03:31:03 +00:00
|
|
|
/* GtkCList Methods */
|
1998-10-19 22:46:38 +00:00
|
|
|
static void gtk_clist_class_init (GtkCListClass *klass);
|
|
|
|
static void gtk_clist_init (GtkCList *clist);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
|
|
|
/* GtkObject Methods */
|
1998-10-19 22:46:38 +00:00
|
|
|
static void gtk_clist_destroy (GtkObject *object);
|
|
|
|
static void gtk_clist_finalize (GtkObject *object);
|
1998-12-02 00:52:14 +00:00
|
|
|
static void gtk_clist_set_arg (GtkObject *object,
|
|
|
|
GtkArg *arg,
|
|
|
|
guint arg_id);
|
|
|
|
static void gtk_clist_get_arg (GtkObject *object,
|
|
|
|
GtkArg *arg,
|
|
|
|
guint arg_id);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
|
|
|
/* GtkWidget Methods */
|
1998-12-02 03:40:03 +00:00
|
|
|
static void gtk_clist_set_scroll_adjustments (GtkCList *clist,
|
|
|
|
GtkAdjustment *hadjustment,
|
|
|
|
GtkAdjustment *vadjustment);
|
1998-10-19 22:46:38 +00:00
|
|
|
static void gtk_clist_realize (GtkWidget *widget);
|
|
|
|
static void gtk_clist_unrealize (GtkWidget *widget);
|
|
|
|
static void gtk_clist_map (GtkWidget *widget);
|
|
|
|
static void gtk_clist_unmap (GtkWidget *widget);
|
|
|
|
static void gtk_clist_draw (GtkWidget *widget,
|
|
|
|
GdkRectangle *area);
|
|
|
|
static gint gtk_clist_expose (GtkWidget *widget,
|
|
|
|
GdkEventExpose *event);
|
|
|
|
static gint gtk_clist_key_press (GtkWidget *widget,
|
|
|
|
GdkEventKey *event);
|
|
|
|
static gint gtk_clist_button_press (GtkWidget *widget,
|
|
|
|
GdkEventButton *event);
|
|
|
|
static gint gtk_clist_button_release (GtkWidget *widget,
|
|
|
|
GdkEventButton *event);
|
|
|
|
static gint gtk_clist_motion (GtkWidget *widget,
|
|
|
|
GdkEventMotion *event);
|
|
|
|
static void gtk_clist_size_request (GtkWidget *widget,
|
|
|
|
GtkRequisition *requisition);
|
|
|
|
static void gtk_clist_size_allocate (GtkWidget *widget,
|
|
|
|
GtkAllocation *allocation);
|
|
|
|
static void gtk_clist_draw_focus (GtkWidget *widget);
|
|
|
|
static gint gtk_clist_focus_in (GtkWidget *widget,
|
|
|
|
GdkEventFocus *event);
|
|
|
|
static gint gtk_clist_focus_out (GtkWidget *widget,
|
|
|
|
GdkEventFocus *event);
|
|
|
|
static gint gtk_clist_focus (GtkContainer *container,
|
|
|
|
GtkDirectionType direction);
|
|
|
|
static void gtk_clist_style_set (GtkWidget *widget,
|
|
|
|
GtkStyle *previous_style);
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
static void gtk_clist_drag_begin (GtkWidget *widget,
|
|
|
|
GdkDragContext *context);
|
|
|
|
static gint gtk_clist_drag_motion (GtkWidget *widget,
|
|
|
|
GdkDragContext *context,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
guint time);
|
|
|
|
static void gtk_clist_drag_leave (GtkWidget *widget,
|
|
|
|
GdkDragContext *context,
|
|
|
|
guint time);
|
|
|
|
static void gtk_clist_drag_end (GtkWidget *widget,
|
|
|
|
GdkDragContext *context);
|
|
|
|
static gboolean gtk_clist_drag_drop (GtkWidget *widget,
|
|
|
|
GdkDragContext *context,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
guint time);
|
|
|
|
static void gtk_clist_drag_data_get (GtkWidget *widget,
|
|
|
|
GdkDragContext *context,
|
|
|
|
GtkSelectionData *selection_data,
|
|
|
|
guint info,
|
|
|
|
guint time);
|
|
|
|
static void gtk_clist_drag_data_received (GtkWidget *widget,
|
|
|
|
GdkDragContext *context,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
GtkSelectionData *selection_data,
|
|
|
|
guint info,
|
1999-02-25 04:06:15 +00:00
|
|
|
guint time);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
|
|
|
/* GtkContainer Methods */
|
1998-10-19 22:46:38 +00:00
|
|
|
static void gtk_clist_set_focus_child (GtkContainer *container,
|
|
|
|
GtkWidget *child);
|
|
|
|
static void gtk_clist_forall (GtkContainer *container,
|
|
|
|
gboolean include_internals,
|
|
|
|
GtkCallback callback,
|
|
|
|
gpointer callback_data);
|
1998-01-24 19:14:42 +00:00
|
|
|
|
|
|
|
/* Selection */
|
1998-10-19 22:46:38 +00:00
|
|
|
static void toggle_row (GtkCList *clist,
|
|
|
|
gint row,
|
|
|
|
gint column,
|
|
|
|
GdkEvent *event);
|
|
|
|
static void real_select_row (GtkCList *clist,
|
|
|
|
gint row,
|
|
|
|
gint column,
|
|
|
|
GdkEvent *event);
|
|
|
|
static void real_unselect_row (GtkCList *clist,
|
|
|
|
gint row,
|
|
|
|
gint column,
|
|
|
|
GdkEvent *event);
|
|
|
|
static void update_extended_selection (GtkCList *clist,
|
|
|
|
gint row);
|
|
|
|
static GList *selection_find (GtkCList *clist,
|
|
|
|
gint row_number,
|
|
|
|
GList *row_list_element);
|
|
|
|
static void real_select_all (GtkCList *clist);
|
|
|
|
static void real_unselect_all (GtkCList *clist);
|
|
|
|
static void move_vertical (GtkCList *clist,
|
|
|
|
gint row,
|
|
|
|
gfloat align);
|
|
|
|
static void move_horizontal (GtkCList *clist,
|
|
|
|
gint diff);
|
|
|
|
static void real_undo_selection (GtkCList *clist);
|
|
|
|
static void fake_unselect_all (GtkCList *clist,
|
|
|
|
gint row);
|
|
|
|
static void fake_toggle_row (GtkCList *clist,
|
|
|
|
gint row);
|
|
|
|
static void resync_selection (GtkCList *clist,
|
|
|
|
GdkEvent *event);
|
|
|
|
static void sync_selection (GtkCList *clist,
|
|
|
|
gint row,
|
|
|
|
gint mode);
|
|
|
|
static void set_anchor (GtkCList *clist,
|
|
|
|
gboolean add_mode,
|
|
|
|
gint anchor,
|
|
|
|
gint undo_anchor);
|
|
|
|
static void start_selection (GtkCList *clist);
|
|
|
|
static void end_selection (GtkCList *clist);
|
|
|
|
static void toggle_add_mode (GtkCList *clist);
|
|
|
|
static void toggle_focus_row (GtkCList *clist);
|
|
|
|
static void extend_selection (GtkCList *clist,
|
|
|
|
GtkScrollType scroll_type,
|
|
|
|
gfloat position,
|
|
|
|
gboolean auto_start_selection);
|
|
|
|
static gint get_selection_info (GtkCList *clist,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint *row,
|
|
|
|
gint *column);
|
1998-03-05 09:34:36 +00:00
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
/* Scrolling */
|
|
|
|
static void move_focus_row (GtkCList *clist,
|
|
|
|
GtkScrollType scroll_type,
|
|
|
|
gfloat position);
|
|
|
|
static void scroll_horizontal (GtkCList *clist,
|
|
|
|
GtkScrollType scroll_type,
|
|
|
|
gfloat position);
|
|
|
|
static void scroll_vertical (GtkCList *clist,
|
|
|
|
GtkScrollType scroll_type,
|
|
|
|
gfloat position);
|
|
|
|
static void move_horizontal (GtkCList *clist,
|
|
|
|
gint diff);
|
|
|
|
static void move_vertical (GtkCList *clist,
|
|
|
|
gint row,
|
|
|
|
gfloat align);
|
|
|
|
static gint horizontal_timeout (GtkCList *clist);
|
|
|
|
static gint vertical_timeout (GtkCList *clist);
|
|
|
|
static void remove_grab (GtkCList *clist);
|
|
|
|
|
|
|
|
|
1998-01-24 19:14:42 +00:00
|
|
|
/* Resize Columns */
|
1998-10-19 22:46:38 +00:00
|
|
|
static void draw_xor_line (GtkCList *clist);
|
|
|
|
static gint new_column_width (GtkCList *clist,
|
|
|
|
gint column,
|
|
|
|
gint *x);
|
|
|
|
static void column_auto_resize (GtkCList *clist,
|
|
|
|
GtkCListRow *clist_row,
|
|
|
|
gint column,
|
|
|
|
gint old_width);
|
|
|
|
static void real_resize_column (GtkCList *clist,
|
|
|
|
gint column,
|
|
|
|
gint width);
|
|
|
|
static void abort_column_resize (GtkCList *clist);
|
|
|
|
static void cell_size_request (GtkCList *clist,
|
|
|
|
GtkCListRow *clist_row,
|
|
|
|
gint column,
|
|
|
|
GtkRequisition *requisition);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
|
|
|
/* Buttons */
|
1998-10-19 22:46:38 +00:00
|
|
|
static void column_button_create (GtkCList *clist,
|
|
|
|
gint column);
|
|
|
|
static void column_button_clicked (GtkWidget *widget,
|
|
|
|
gpointer data);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-11-07 14:29:22 +00:00
|
|
|
/* Adjustments */
|
|
|
|
static void adjust_adjustments (GtkCList *clist,
|
|
|
|
gboolean block_resize);
|
1998-10-19 22:46:38 +00:00
|
|
|
static void check_exposures (GtkCList *clist);
|
|
|
|
static void vadjustment_changed (GtkAdjustment *adjustment,
|
|
|
|
gpointer data);
|
|
|
|
static void vadjustment_value_changed (GtkAdjustment *adjustment,
|
|
|
|
gpointer data);
|
|
|
|
static void hadjustment_changed (GtkAdjustment *adjustment,
|
|
|
|
gpointer data);
|
|
|
|
static void hadjustment_value_changed (GtkAdjustment *adjustment,
|
|
|
|
gpointer data);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* Drawing */
|
|
|
|
static void get_cell_style (GtkCList *clist,
|
|
|
|
GtkCListRow *clist_row,
|
|
|
|
gint state,
|
|
|
|
gint column,
|
|
|
|
GtkStyle **style,
|
|
|
|
GdkGC **fg_gc,
|
|
|
|
GdkGC **bg_gc);
|
|
|
|
static gint draw_cell_pixmap (GdkWindow *window,
|
|
|
|
GdkRectangle *clip_rectangle,
|
|
|
|
GdkGC *fg_gc,
|
|
|
|
GdkPixmap *pixmap,
|
|
|
|
GdkBitmap *mask,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height);
|
|
|
|
static void draw_row (GtkCList *clist,
|
|
|
|
GdkRectangle *area,
|
|
|
|
gint row,
|
|
|
|
GtkCListRow *clist_row);
|
|
|
|
static void draw_rows (GtkCList *clist,
|
|
|
|
GdkRectangle *area);
|
1998-11-28 01:56:09 +00:00
|
|
|
static void clist_refresh (GtkCList *clist);
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
static void draw_drag_highlight (GtkCList *clist,
|
|
|
|
GtkCListRow *dest_row,
|
|
|
|
gint dest_row_number,
|
|
|
|
GtkCListDragPos drag_pos);
|
1998-11-28 01:56:09 +00:00
|
|
|
|
1998-11-07 14:29:22 +00:00
|
|
|
/* Size Allocation / Requisition */
|
1998-10-19 22:46:38 +00:00
|
|
|
static void size_allocate_title_buttons (GtkCList *clist);
|
1998-11-11 20:46:51 +00:00
|
|
|
static void size_allocate_columns (GtkCList *clist,
|
|
|
|
gboolean block_resize);
|
1998-11-07 14:29:22 +00:00
|
|
|
static gint list_requisition_width (GtkCList *clist);
|
1998-08-05 20:02:32 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* Memory Allocation/Distruction Routines */
|
|
|
|
static GtkCListColumn *columns_new (GtkCList *clist);
|
|
|
|
static void column_title_new (GtkCList *clist,
|
|
|
|
gint column,
|
|
|
|
const gchar *title);
|
|
|
|
static void columns_delete (GtkCList *clist);
|
|
|
|
static GtkCListRow *row_new (GtkCList *clist);
|
|
|
|
static void row_delete (GtkCList *clist,
|
|
|
|
GtkCListRow *clist_row);
|
|
|
|
static void set_cell_contents (GtkCList *clist,
|
|
|
|
GtkCListRow *clist_row,
|
|
|
|
gint column,
|
|
|
|
GtkCellType type,
|
|
|
|
const gchar *text,
|
|
|
|
guint8 spacing,
|
|
|
|
GdkPixmap *pixmap,
|
|
|
|
GdkBitmap *mask);
|
|
|
|
static gint real_insert_row (GtkCList *clist,
|
|
|
|
gint row,
|
|
|
|
gchar *text[]);
|
|
|
|
static void real_remove_row (GtkCList *clist,
|
|
|
|
gint row);
|
|
|
|
static void real_clear (GtkCList *clist);
|
1998-02-19 02:59:55 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* Sorting */
|
|
|
|
static gint default_compare (GtkCList *clist,
|
|
|
|
gconstpointer row1,
|
|
|
|
gconstpointer row2);
|
|
|
|
static void real_sort_list (GtkCList *clist);
|
|
|
|
static GList *gtk_clist_merge (GtkCList *clist,
|
|
|
|
GList *a,
|
|
|
|
GList *b);
|
|
|
|
static GList *gtk_clist_mergesort (GtkCList *clist,
|
|
|
|
GList *list,
|
|
|
|
gint num);
|
|
|
|
/* Misc */
|
Tue Mar 16 17:43:33 1999 Tim Janik <timj@gtk.org>
Wed Mar 17 01:46:28 1999 Tim Janik <timj@gtk.org>
* merges from gtk-1-2:
Tue Mar 16 17:43:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_string): ensure the
item factory class has been created.
(gtk_item_factory_parse_rc): likewise.
* gtk/gtkmenu.c:
keep proper references for old_active_menu_item.
(gtk_menu_reparent): unset the usize of the new parent,
so the menu can sanely be size requested and we don't get nasty screen
artefacts upon next reparentation.
(gtk_menu_motion_notify): set send_event to TRUE if we synthesize an
enter notify. only synthesize enter notifies if the pointer really is
inside the event window.
(gtk_menu_popdown): use gtk_menu_shell_deselect().
(gtk_menu_popup): move the background setting stuff into
gtk_menu_tearoff_bg_copy() so it can be called from other places as well.
* gtk/gtkmenushell.c (gtk_menu_shell_button_press): use
gtk_menu_shell_select_item() to select the new item.
(gtk_menu_shell_deselect): export this function, so gtkmenu.c can
do the right thing for deselection as well.
Sat Mar 15 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.[hc]:
(gtk_widget_accelerators_locked): return whether a widget's accelerators
are locked.
* gtk/gtkmenu.c (gtk_menu_key_press): don't remove or install new or
existing accelerators if the widget's accelerators are locked.
Sat Mar 14 19:44:05 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.[hc]: allow managing of foreign menu items.
* gtk/gtkmenu.c: truely forward key press and key release events to
the menu widget from the toplevel or tearoff window. we can't simply
connect to that, we need to stop further processing of the events as
well.
Sat Mar 13 13:14:17 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.c:
(gtk_menu_key_press): pass event->keyval, event->state to
gtk_accelerator_valid, instead of event->keyval twice.
refuse to install single letter accelerators for menus that use
single letter shortcuts.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): use
gtk_menu_ensure_uline_accel_group().
* gtk/gtkmenu.[hc]: added gtk_menu_ensure_uline_accel_group()
which will always return an uline accel group, made
gtk_menu_get_uline_accel_group() return NULL if the group isn't
yet created.
Mon Mar 15 01:03:27 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h (struct _GtkCListColumn): added button_passive flag.
* gtk/gtkclist.c (gtk_clist_column_title_passive):
Leave button sensitive, trap button_press, button_release,
motion_notify, enter_notify and leave_notify events instead.
(gtk_clist_column_title_active): disconnect event handler.
(gtk_clist_drag_data_get): fixed memory leak. Reported by
Guillaume Laurent <glaurent@worldnet.fr>
Wed Mar 10 23:49:55 1999 Lars Hamann <lars@gtk.org>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): fixed a few
width/height mixups.
* gtk/gtkctree.c (tree_delete): emit an tree_unselect_row signal
if needed.
Wed Mar 10 00:11:32 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c (create_item_factory): unref the item factory after
window's destruction.
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): keep a reference
count on the menu shell around the menu item's activation, since the
signal emission may cause menu shell destruction.
* gtk/gtkitemfactory.c:
the previous code leaked one accel group per menu. we use
gtk_menu_get_uline_accel_group() now to fix that, and with that
also create the underline accelerator group of the menus only if
required (i.e. an underline accelerator has been specified).
(gtk_item_factory_construct):
(gtk_item_factory_create_item): removed code that would create an
extra accel group for the menu (and leak references).
(gtk_item_factory_create_item): adapted the underline accelerator
installation code to properly feature gtk_menu_get_uline_accel_group().
* gtk/gtkmenu.[hc]: added gtk_menu_get_accel_group() to retrive
menu->accel_group, this may return NULL if the accelerator group
hasn't been set yet.
added gtk_menu_get_uline_accel_group() to retrive the underline
accelerator group of the menu, this will be created on demand
and proper care is taken about its reference count.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c:
dumped the approach of keeping a widgets by action list on the
factory since the factory<->widget destroy negotiation didn't work
and would be hard to get going at all. instead we keep a list of
GtkItemFactoryItem items on the factory (GtkItemFactoryItems are
persistant throughout a program's life time).
also, i removed the static const gchar *key_* variables, and made
them inline strings (they weren't actually used anyways).
(gtk_item_factory_add_item): update ifactory->items.
(gtk_item_factory_destroy): destroy ifactory->items (and remove
the item factory pointer from the remaining ifactory widgets).
(gtk_item_factory_get_widget_by_action): walk the GtkItemFactoryItem
list to find the widget.
(gtk_item_factory_get_item): new function that works around
gtk_item_factory_get_widget() limitations, this function will only
return menu items, even for <Branch> entries.
Tue Mar 9 01:01:28 1999 Tim Janik <timj@gtk.org>
* gdk/gdkfont.c (gdk_font_load): first lookup the xfont ID in our
font hash table, if we have a GdkFontPrivate entry for this font
already, simply increment its reference count, provided by Olaf Dietsche
<olaf.dietsche+list.gtk@netcologne.de>.
* gtk/gtkstyle.c (gtk_style_copy): plug a GdkFont reference leak, fix
provided by Olaf Dietsche <olaf.dietsche+list.gtk@netcologne.de>.
Sun Mar 7 06:13:29 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c:
(gtk_container_add_with_args):
(gtk_container_addv):
(gtk_container_add): before adding a child to a conatiner, make sure
it is (default) constructed, this is neccessary because under certain
circumstances the child will get relized and mapped immediatedly, in
which case it has to be constructed already.
Mon Mar 1 17:58:21 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_connect_by_type): count object_signal
values > 1 as TRUE also.
1999-03-17 01:39:42 +00:00
|
|
|
static gboolean title_focus (GtkCList *clist,
|
|
|
|
gint dir);
|
|
|
|
static void real_row_move (GtkCList *clist,
|
|
|
|
gint source_row,
|
|
|
|
gint dest_row);
|
|
|
|
static gint column_title_passive_func (GtkWidget *widget,
|
|
|
|
GdkEvent *event,
|
|
|
|
gpointer data);
|
1999-04-30 11:48:42 +00:00
|
|
|
static void drag_dest_cell (GtkCList *clist,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
GtkCListDestInfo *dest_info);
|
1998-01-31 03:33:02 +00:00
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
|
Adapt cast macros to standard.
Fri Nov 19 10:34:41 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkgamma.h: Adapt cast macros to standard.
[ Merges from 1.2 ]
Tue Nov 16 10:15:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_path):
If translation does not include a '/', use entire
translation instead of crashing.
Sun Oct 31 22:21:11 1999 Tim Janik <timj@gtk.org>
* docs/gtk_tut.sgml:
s/gtk_accel_group_attach/gtk_window_add_accel_group/.
Sat Oct 30 09:09:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_target_list_remove): Use
g_list_remove_link, not g_list_remove.
[ From Geert Bevin <gbevin@thunderstorms.org> ]
Sun Oct 24 07:41:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkclist.c (real_undo_selection): commented out g_print()
statement upon unselection (how the heck did that slip in?).
Sat Oct 23 03:03:08 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_freeze):
(gtk_text_thaw): undraw/draw cursor here to avoid unnecessary scrolling
in frozen state (and aparently crashes). patch provided by Anders
Melchiorsen <and@kampsax.dtu.dk>.
Sat Oct 23 02:53:20 1999 Tim Janik <timj@gtk.org>
* fix insensitive default/focus widget activation,
reported by Matt Goodall <mgg@isotek.co.uk>.
* gtk/gtkwindow.c (gtk_window_key_press_event):
(gtk_window_activate_default):
(gtk_window_activate_focus):
return handled=FALSE for actiavtion of insensitive default
widgets. return handled=TRUE for activation of insensitive
focus widgets. don't activate in either case.
Tue Oct 19 09:55:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk-config.in (lib_gtk): Switch order of @x_cflags@
and $glib_cflags to match library order and in the
theory that an old version of GLib is more likely to
be in the include directory for X then vice-versa.
(Bug #2776)
Tue Oct 19 09:46:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always use LC_CTYPE
to determine the locale for fontsets, not LC_MESSAGES;
the user may want English messages with a handling
for non-English languages. (LC_CTYPE=ru_RU LC_MESSAGES=fr_FR
will still be broken) (Bug #2891)
Tue Oct 19 20:36:42 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Fixed the wrong number of "*"'s.
Tue Oct 19 12:15:13 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Changed the Korean default fontset.
Fri Oct 8 02:32:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): Fix bug
where when scrolling to the left or top double exposes
were done, causing major slowdowns.
Thu Oct 7 18:31:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always normalize codeset
names to lowercase and alphanumeric, before looking
them up.
* gtk/Makefile.am: Install codeset variant gtkrc files
with normalized names.
Thu Oct 7 22:52:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_popup_with_data): even
popup menus when the menu is already visible, but its parent
is still hidden, (happens after tornoff window got hidden).
Thu Oct 7 11:09:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (install-data-local): Fix
a typo where gtkrc.vi_VN.tcvn5712 wasn't getting
deleted, causing error messages on install.
Thu Oct 7 11:03:06 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtk[hv]paned.c (gtk_{h,v}paned_draw): Redraw
the handle as well, since we now sometimes ignore
exposes on the handle while resizing.
Wed Oct 6 18:02:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_append_default_pixmap_path): Fix stupid
extra g_free introduced in one of the last one or two
commits.
Wed Oct 6 16:38:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc*: Make naming of gtkrc files
consistent, put each style that a gtkrc.* file creates
in a unique namespace, remove old files before installing.
Wed Oct 6 14:31:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Avoid leaking memory when
gtk_rc_init is called multiple times. (Yes, people who
do that have bugs in their code.)
Tue Oct 5 11:36:57 PDT 1999 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: listing gtkrc in gtkconf_DATA seems to barf.
Remove it since it's generated by the Makefile anyway
Tue Oct 5 02:43:41 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputcommon.h (gdk_input_device_new): Free
device->info.axes for core pointer.
Thu Sep 30 13:55:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (destroy_idle_test): Rename idle to
idle_id, to deal with obsolete, broken C libraries.
Mon Sep 27 02:50:15 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkvscale.c (gtk_vscale_draw): Don't add in
allocation->x/y twice!
* gtk/gtkhscale.c: Make usage of gtk_hscale_pos_trough()
consistent with gtk_vscale_pos_trough().
Sun Sep 26 19:44:34 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_queue_resize): We may
be queueing a resize on a toplevel container between
the time we show it and when we map it. So, we need
to test GTK_WIDGET_VISIBLE() for toplevels, and only
use GTK_WIDGET_DRAWABLE() for child windows.
Thu Sep 23 16:41:03 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDADDS): Add GDK_WLIBS to LDADDS
(fixes bug #2144)
Fri Sep 24 00:51:45 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c (gtk_container_queue_resize): check for
container DRAWABLE (instead of VISIBLE), so we don't queue
resizes on non-toplevel containers.
Sun Sep 19 18:13:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.[ch]: Make the data argument
const guchar *.
Sat Sep 18 21:27:40 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: Try to behave sensibly if
the focus widget is the window itself. (Should
we allow this at all?)
Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_set_sensitive):
* gtk/gtknotebook.c (gtk_notebook_set_scrollable):
* gtk/gtknotebook.c (gtk_notebook_set_show_border):
* gtk/gtkclist.c (gtk_notebook_set_show_border): make gboolean args
in prototypes and implementations consistent (Tomas Ogren).
* gtk/gtklayout.c (gtk_layout_remove): unset GTK_IS_OFFSCREEN flag
before the widget is unparented (reported by damon).
* gtk/gtkdnd.c: make the cursor and icon data _unsigned_ char,
since we provide unsigned data anyways.
Thu Sep 16 21:32:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_set_tip): Delay
the call to gtk_tooltips_layout_text() until later.
* gtk/gtktooltips.c (gtk_tooltips_draw_tips):
Call gtk_widget_ensure_style() before using the style.
Wed Sep 15 02:52:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_event): Added workaround
for old widgets that don't propagate draws to all
children. (Namely gnome-dock for gnome-libs <= 1.0.16)
Tue Sep 14 19:22:19 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_queue_resize): don't queue the parent
for a redraw but just the widget that requested the resize.
Tue Sep 14 18:29:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c: added new widget level method
gtk_container_set_reallocate_redraws() and a GtkContainer flag
reallocate_redraws : 1 to reflect the setting, exported this through
the argument system as a boolean ::reallocate_redraws.
* gtk/gtkwidget.c (gtk_widget_size_allocate): when queueing redraws
on the widget because the allocation changes, do so as well for
widget->parent if the parent has reallocate_redraws set to TRUE.
with that containers requesting reallocation redraws get automatically
redrawn if their children changed allocation (this unfortunately
affects also other children that didn't change allocation, but we
cannot work around that before 1.3).
Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_idle_draw): only emit ::draw if width
_and_ height are >0 (not _or_).
* gtk/gtktable.c (gtk_table_remove): use gtk_widget_queue_resize()
instead of gtk_container_queue_resize(), which is a core gtk internal
function (must have been on crack when i queued that).
* gtk/gtkprivate.h: added new private flag GTK_FULLDRAW_PENDING, so
we can check more reliably if we want to discard expose events.
* gtk/gtkwidget.c: added setting/unsetting of the GTK_FULLDRAW_PENDING
flag.
* gtk/gtkwidget.c (gtk_widget_event): don't discard synthesized exposes,
we simply trust these events. for deciding whether to discard exposes,
check GTK_FULLDRAW_PENDING instead of RESIZE_PENDING.
Mon Sep 13 15:01:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore
queues of areas that are completely off screen.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fix broken
logic for handleboxes.
* gtk/gtkwidget.c (gtk_widget_queue_draw_data): Add santity
check on width/height.
Mon Sep 13 02:22:47 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: backed out Raja's recent VPATH build "improvements",
we are fine with using $@ the way we do (if we actually encounter
brokeness with $@ in VPATH builds because of additional path prefixes,
we need to use $(@F) actually).
Mon Sep 13 01:34:53 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c: renamed two variables, hopefully didn't introduce
short lived bugs, that would allow language bindings to do surgeries
to our guts.
Fri Sep 10 15:22:50 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_size_allocate): Fix typo
where comparison was being done against an uninitialized
value causing intermittant results depending on
compiler flags. Also make it clearer that we aren't
ever initializing the child as 0x0 (though this will
be caught in gtk_widget_size_allocate())
Fri Sep 10 10:06:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_transient_for): Move
gtk_window_unset_transient_for() call after we do checks
involving the old transient parent.
[ From Lance Capser <lmc@cyberhighway.net> ]
1999-09-07 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gtk.defs): Go back to using `touch' to create
an empty file.
Mon Sep 6 00:11:56 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (gtk_ctree_is_ancestor): return FALSE if node has
no children. (Reported by: Chris Rogers <gandalf@pobox.com>)
1999-09-03 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gen_sources): Improve VPATH builds.
`$@' is valid only in the build dir, not after we've done
`cd $srcdir'. Also use `test -f' instead of less portable
`test -e'.
Fri Sep 3 15:59:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (correct_cache_insert): Rewrite
for simplicity, and hopefully correctness.
(Fixes bug #1322, which was a segfault when
on some insertions with the properties around
the insertion set up just wrong.)
* gtk/gtktext.c (gtk_text_adjustment): When we receive
a "changed" signal, clamp the new value to the adjustment
bounds to avoid segfaulting if someone tries to change
the adjustment to a bogus value. (Bug #1795)
Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c: Ignore unexpected destroy notifies
for children, for toplevel windows handle them
like delete_event.
* gtk/gtkplug.c: Add an unrealize handler so that
we unref plug->socket_window when we are done
with it.
Fri Sep 3 14:52:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_area): Fix stupid signedness
problem that was causing background to sometimes
be misaligned.
Fri Sep 3 12:26:33 1999 Owen Taylor <otaylor@redhat.com>
[ Fixes pointed out by Ettore Perazzoli <ettore@comm2000.it> ]
* gtk/gtkmenu.c (gtk_menu_position): Make
sure we never position menus with negative x, y,
since gtk_widget_set_uposition() can't handle that.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu):
Modify the positioning code a bit so that we always
put the top-left corner onscreen. (This is for
UI reasons, gtk_menu_position() now takes care of
gtk_widet_set_uposition() brokeness.)
Fri Sep 3 03:06:30 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: fixed up things for -jx, x > 1.
Sun Sep 5 08:48:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_style): Ref the
RC style that is passed in. The lack of the ref
before was a bug. If people worked around this
bug, this will introduce a slight memory leak
in their code. The code should typically look like:
rc_style = gtk_rc_style_new ();
[...]
gtk_widget_modify_style (widget, rc_style);
gtk_rc_style_unref (rc_style);
* gtk/gtkwidget.c (gtk_widget_modify_style): Reset
the style if it was already set.
* gtk/gtkwidget.c (gtk_widget_set_name): Only set the
style if it was set before.
Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (main): Add a check to see if we
are being run from the correct directory and
to quit nicely if we are not.
* gtk/gtkrc.c (gtk_rc_slist_remove_all): Make function
static.
Thu Sep 2 23:00:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkenums.h (GtkWindowPosition): added GTK_WIN_POS_CENTER_ALWAYS.
* gtk/gtkwindow.c:
queue resizes unconditionally (gtk_widget_queue_resize will figure
what to do if the window is not realized).
(gtk_window_move_resize): only recenter the window
for GTK_WIN_POS_CENTER_ALWAYS.
(gtk_window_compute_reposition): handle GTK_WIN_POS_CENTER_ALWAYS in
the same way as GTK_WIN_POS_CENTER.
Thu Sep 2 22:39:27 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_reposition): check for the last position
with (!(info->last_flags & GDK_HINT_POS)) instead of
(!info->last_flags & GDK_HINT_POS).
* gtk/gtkwindow.c (gtk_window_move_resize): constrain new_width and
new_height unconditionally, because we use these values even if
!default_size_changed && !hints_changed.
comented the (default_size_changed || hints_changed) case with
respect to resize rejects from the window manager.
* gtk/gtkwindow.c (gtk_window_move_resize): save info->last values
in the zvt condition hack, since this includes the window hints, set
the hints after the handling_resize case.
* gtk/gtkwindow.c (gtk_window_show): constrain the default size that a
window is initially shown with to the geometry.
Thu Sep 2 07:38:56 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize):
s/size_changed/default_size_changed/g so i know what's
really going on (frying brain on smaller flame now).
Thu Sep 2 05:47:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): queue a new resize if
we have size_changed upon handling_resize. this is a gross
workaround for the broken zvt widget and should be removed in
1.3 again (search for FIXME).
Owen provided an accurate comment for this:
/* We could be here for two reasons
* 1) We coincidentally got a resize while handling
* another resize.
* 2) Our computation of size_changed was completely
* screwed up, probably because one of our children
* is broken. It's probably a zvt widget.
*
* For 1), we could just go ahead and ask for the
* new size right now, but doing that for 2)
* might well be fighting the user (and can even
* trigger a loop). Since we really don't want to
* do that, we requeue a resize in hopes that
* by the time it gets handled, the child has seen
* the light and is willing to go along with the
* new size. (this happens for the zvt widget, since
* the size_allocate() above will have stored the
* requisition corresponding to the new size in the
* zvt widget)
*
* This doesn't buy us anything for 1), but it shouldn't
* hurt us too badly, since it is what would have
* happened if we had gotten the configure event before
* the new size had been set.
*/
Wed Sep 1 20:46:11 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: deal properly with the fact that RC
style lists may include rc styles more than once.
* gtk/gtkrc.c (gtk_rc_append_pixmap_path): Removed
unused static function.
* gtk/gtkrc.c (gtk_rc_find_pixmap_in_path): Keep a
stack of directories of RC files currently being
parsed and implicitely add them to pixmap path.
This fixes a bug where the directory would get
appended then overwritten by pixmap_path declarations.
(bug #1462, from Peter Wainright <prw@wainpr.demon.co.uk>)
* gtk/gtkthemes.c (gtk_theme_engine_unref): Call
theme's exit function. (Patch from Peter Wainwright,
bug #1454)
* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_destroy):
Add a destroy() handler to take care of removing
group for menu item. (Fixes bug #1197)
* gtk/gtkwidget.c (gtk_widget_size_request): Fixed thinko
in warning message.
Wed Sep 1 21:27:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): don't require a server
roundtrip to figure window's width and height, since we know that
anyways from widget->allocation.
Wed Sep 1 12:37:44 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Compute
the hints after we request the new size.
Wed Sep 1 10:38:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_compute_hints): Removed
GTK_WIDGET_REALIZED() assertion - we can compute the
hints before we are realized.
* gtk/gtkwindow.c (gtk_window_move_resize): Reorder
hint changing so that we have a value of hints_changed
when we decide whether to constrain the window size.
* gtk/gtkwindow.c (gtk_window_move_resize): Spelling fix.
* gtk/gtkwindow.c (gtk_window_constrain_size): cleanups,
change back to G_MAXINT.
Wed Sep 1 06:54:59 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_get_geometry_info): zero initialize
new GtkWindowGeometryInfo, so fields like GdkGeometry geometry
contain uncluttered values.
(gtk_window_compute_hints): simply assert that window is realized
and that geometry_info is valid, since we rely on this anyways.
(gtk_window_constrain_size): major cleanups to the code.
if (flags & GDK_HINT_BASE_SIZE) use geometry's base width and height
for the base size, instead of the minimums. use 32767 as max width
and height (like in gtkwindow.c) instead of G_MAXINT.
Wed Sep 1 04:41:25 1999 Tim Janik <timj@gtk.org>
* cleaned up the GtkContainer.need_resize flag handling mess, we
only need to force resize requests when we were prematurely
realized, or our widget tree was modified when we were temporarily
hidden. handling these cases directly upon showing the window (i.e.
while the GdkWindow is still unmapped) avoids the need to wait for
a configure event response and therefore makes the GUI more snappier
and avoids blank windows during the roundtrip.
* gtk/gtkwidget.c:
(gtk_widget_hide):
(gtk_widget_show): don't queue resizes on toplevels, they know how
to deal with matters.
* gtk/gtkcontainer.c (gtk_container_queue_resize): set the ->need_resize
flag directly for not visible resize containers and spare us unecessary
signal emissions.
* gtk/gtkwindow.c:
(gtk_window_realize): if we need to enforce premature size allocation,
queue a container resize so we are correctly resized later on.
(gtk_window_init):
(gtk_window_size_request):
don't freak around with the ->need_resize flag,
gtk_container_queue_resize() will care about that.
(gtk_window_show):
handle initial resizing issues here, we can handle matters better in
this place, especially since we know that our GdkWindow is still
unmapped.
(gtk_window_move_resize):
don't care about ->need_resize at all.
handle size changes properly that occoured while we waited for a
configure event.
Tue Aug 31 15:58:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_uposition):
* gtk/gtkwindow.[hc] (gtk_window_reposition):
Move the hint setting code from gtk_widget_set_uposition
to here; set the hints so that we respect any previously
set geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Don't
change the window hints here or move the window here,
let that happen in gtk_window_move_resize().
Tue Aug 31 06:58:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): when discarding exposes due
to already queued resizes (and therefore redraws) on a widget, check
its anchestry as well.
* gtk/gtkcontainer.c:
(gtk_container_queue_resize): clear resize widgets for resize
containers before aborting prematurely. this is especially important
for toplevels which may need imemdiate processing or their resize
handler to be queued.
(gtk_container_dequeue_resize_handler): added new internal function for
gtkwindow.c.
* gtk/gtkwindow.c (gtk_window_move_resize): if we are resizing due to a
configure event, take possible changes in window position into account
as well.
if we request a new window size, queue up a resize handler that will
last until the configure event response arrives.
combined the ->need_resize case (initial show) with the general size
(hints) changed case and added even more comments.
if !auto_shrink, only revert to the old allocation if the new size
is smaller than the current allocation.
Tue Aug 31 11:55:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_arg, gtk_window_set_policy,
gtk_window_set_geometry_hints
gtk_window_set_default_size):
When hints are set, queue a resize so that the hints will
be eventually reset on the toplevel.
* gtk/gtkwindow.c (gtk_window_show): Use
gtk_window_compute_default_size(). Clear the need_resize flag
on the initail map so that we don't unnecessarily trigger the
resize code.
* gtk/gtkwindow.c (gtk_window_move_resize): Split apart
into separate functions. Compare the hints we are setting
with what we set last time so that we can accurately
tell when we need to reset the hints.
* gtk/gtkwindow.c (gtk_window_compute_default_size): New
function to figure out the size from requisition
and default_size.
* gtk/gtkwindow.c (gtk_window_constrain_size): Function
from fvwm to constrain a size to the geometry hints.
* gtk/gtkwindow.c (gtk_window_compare_hints): New function
to compare two sets of geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_hints): Renamed
from gtk_window_set_hints(), just compute the hints,
don't set them.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Move
code from gtk_window_move_resize() to separate function,
rationalize a bit.
Tue Aug 31 13:05:03 1999 Owen Taylor <otaylor@redhat.com>
* gtkrc.h: Move the ref_count member out of the GtkRcStyle
structure into a new private structure.
* gtkrc.c: Split GtkRcStyle into public/private.
In the private part, add a list of pointers to the
RcStyle lists this RcStyle participates in.
* gtkrc.c: When a RcStyle is free, remove all
lists referencing it from the
realized_style_ht hash, and free those lists.
* gtk/gtkrc.c (gtk_rc_clear_styles): Don't call
gtk_rc_init(), since that adds the default styles
to the list of parsed RC files again.
* gtk/gtkrc.c: Use gtk_rc_style_find() consistently.
Thu Aug 26 14:14:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): reactivated the sanity
checks that ensure that a widget's allocation is at least 1 in width
and height. (GNOME note: this doesn't affect old panel code anymore,
because GtkSocket will request width and height of at least 1 since
Fri Jul 23).
* gtk/gtkwindow.c (gtk_window_realize): if the widget hasn't been
allocated yet (happens if the user realizes the window prematurely),
size request and allocate it.
(gtk_window_size_allocate): guard against guint underflows.
Wed Aug 25 19:01:36 1999 Lars Hamann <lars@gtk.org>
* gtk/Makefile.am (gtk_built_sources): reordered stamp-gtk.defs
in gtk_built_sources, so gtk.defs gets built prior to all other
sources.
Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am:
invoke indent on gtkmarshal.*.
rewrote source generation rules, use COPYING as oldest source tag for
a piggyback rule to generate all sources from (don't touch it ;).
major cleanups, strip spaces on build rules for GNU Make.
* gtk/genmarshal.pl: don't operate on hardcoded filenames but take
source and target files from commandline arguments. don't invoke indent.
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Wed Aug 18 09:20:10 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c:
we use window->need_resize from configure_event now, to indicate that
the gtkwindow should keep its allocation (e.g. because the user resized
the window through window manager handles). resize_count is now reliably
used to figure whether we got the allocation we requested from the
window manager.
configure events get queued as resizes now, the real stuff (size
computation and allocation) now only goes on in gtk_window_move_resize().
GtkWindow's requisition now contains its *real* requisition (like all
other widgets), *not* taking usize into account.
geometry_info->last_{width|height} is now updated from set_hints() only
so it always contains the last hints we set for the window manager.
made some event handlers return TRUE instead of FALSE.
the overall code should be much more straight forward now, and the
significant code portions are accompanied by comments now.
(gtk_window_set_hints):
removed requisition argument and made it
fetch the requisition through gtk_widget_get_child_requisition.
we also don't move the gdkwindow here anymore, gtk_window_move_resize()
does that now.
(gtk_window_show):
ensure that the widget is realized before calling
gtk_container_check_resize() (and thus gtk_window_move_resize()), also
ensure that we got properly size requested and allocated before
realization.
(gtk_window_configure_event):
ignore plain window moves, or reallocate the widget tree through the
resize queue otherwise.
(gtk_window_move_resize):
mostly rewrote this function to figure window manager hints more
reliably, coalesce window moves and resizes to reduce configure events
and do actuall size allocations.
Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): discard expose events for widgets
that have a resize pending, because a redraw is already queued for them.
* gtk/gtkcontainer.c: removed ugly connect_to ::size_allocate signal
hack to clear resize_widgets.
* gtk/gtkwidget.c (gtk_widget_size_allocate): call clear_resize_widgets
for resize containers prior to size allocation. (this is also a bit
ugly, but avoids side effects for stopped emissions and is thus more
reliable).
(gtk_widget_unparent): removed disconnect call for clear_resize_widgets.
* gtk/gtktooltips.c (gtk_tooltips_paint_window): renamed this
function from gtk_tooltips_expose, as we connect to ::expose_event
*and* ::draw now.
1999-08-18 Federico Mena Quintero <federico@redhat.com>
* gtk/gtkselection.c (gtk_target_list_ref): Added missing sanity
checks.
(gtk_target_list_unref): Likewise.
* gtk/gtkthemes.c (gtk_theme_engine_unref): Likewise.
Tue Aug 17 15:47:07 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_draw_value_bar):
guard against division by zero. (Fixes bug #1339)
Tue Aug 17 10:56:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_move_{forward,backward}_word):
Prevent the trivial leak of information of allowing
word motion when the entry is not visible.
Tue Aug 17 10:28:52 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_fileop_error): Propagate
modality to error dialog as well as confirmation dialogs.
(Bug #1803, reported by Rosanna Wing Sze Yuen)
Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktreeitem.c (gtk_tree_item_draw_lines): Honor
tree->view_lines.
(gtk-guy-990611-3.patch: Guy Harris <guy@netapp.com>)
* gtk/Makefile.am (install-data-local): Solaris apparently
has various troubles with ln -f; use rm first instead.
(gtk-guy-990611-2.patch: Guy Harris <guy@netapp.com>)
1999-07-30 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (stamp-m): Don't `mv' from builddir to srcdir,
use `cp' followed by `rm' (the `rm' was already there).
July 30, 1999 Elliot Lee <sopwith@redhat.com>
* configure.in: Fix autoconf warnings about cross compilation by
trying to provide sane defaults for AC_TRY_RUN.
* gtk/Makefile.am: If we refer to gtkmarshal.[ch] in $(srcdir),
put them into $(srcdir) when generated. Also add a dependency of
gtksignal.h on gtkmarshal.h for -j builds.
* gtk/gtk(dnd,style,gamma).c: Minor warning fixes.
Wed Jul 28 09:29:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration_do): Added missing
GDK_THREADS_{LEAVE,ENTER} pair.
(From Paul Fisher <pnfisher@redhat.com>)
Fri Jul 23 01:00:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtksocket.c (gtk_socket_size_request): asure that the requested
width and height are always >0 (owen).
Fri Jul 23 00:00:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): backed out my recent
change that assured that a widget's allocated with and height are
always >1, since this breaks *buggy* panel code. unfortunately this
back-breaks the gimp's color selector.
* gtk/gtkdrawingarea.c (gtk_drawing_area_size_allocate): asure that our
allocation is always >0 in width and height, before sending the
configure event; this is a *gross* hack to get the gimp back to work.
* marked both cases with TODO-1.3
Wed Jul 21 15:47:39 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Don't display wrap indicators when
text is not editable and word wrap is on.
Wed Jul 21 08:21:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): special case
option menus here as they are not derived from menu shell, assure that
the option menu has a menu we can add items to.
Tue Jul 20 23:29:48 1999 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_page_allocate): convert allocation->
width/height to (gint) before calculations and check against < 0 to
avoid guint wraparounds.
Sun Jul 18 00:35:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): ensure that the allocated
width and height is never zero. sanity check both dimensions against
32767 and issue a warning if the allocation is greater than that.
Wed Jul 7 15:03:30 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_events_pending): Unlock around call
to g_main_pending() as well.
Wed Jul 7 14:59:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration): Unlock around
call to g_main_iteration() - since that will regrab
GTK+ lock to process events.
Thu Jul 1 15:01:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c
- Regularize with the rest of GTK+ by making widget->requisition
not reflect the set_usize()
- Always recompute geometry hints, then check if they
changed before sending them to the X server. The
previous checks for changes would fail in a number
of circumstances.
Thu Jul 1 11:55:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Include <stdlib.h> for strcmp().
Wed Jun 30 19:26:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c:
- Code cleanups
- Instantaneously update on modifier key presses
- Allow cancellation of the drag with Escape.
Tue Jun 29 17:04:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_handle_box): Set the policy
to auto_shrink - otherwise the appearance is rather
strange when flipping between horizontal and vertical.
Mon Jun 28 09:29:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: add ::default_width and ::default_height arguments.
(gtk_window_set_default_size): don't change a value if it's < 0.
queue a resize.
Sun Jun 27 11:00:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_insert): don't segfault on NULL inserts.
Mon Jun 28 12:08:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (cmpl_completion_fullname): Don't
add an extra "/" when concating "/" + filename.
(From Matt Grossman <mattg@oz.net>)
Mon Jun 28 10:57:12 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (draw_cell_pixmap): Reset clip mask
for fg_gc if we set it for drawing pixmap.
Tue Jun 15 12:45:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes from Peter Wainwright <prw@wainpr.demon.co.uk>
* gtk/gtkrc.c (gtk_rc_parse_engine): If rc_style->engine is
already set, call old engine's destroy function and
unref the old engine.
Thu Jun 10 17:59:38 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.c (gtk_drawing_area_size): queue a resize.
Wed Jun 9 15:13:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h: mark certain functions as internal.
Wed Jun 9 13:48:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpreview.c (gtk_preview_set_expand): queue a resize if the
expand behaviour changed.
* gtk/gtklabel.c (gtk_label_set_pattern):
(gtk_label_set_justify):
(gtk_label_set_line_wrap):
don't bother invoking queue_clear, the reallocation does
that for us, always free_words so the upcoming resize will
relayout the label's contents.
Wed Jun 9 12:50:48 1999 Tim Janik <timj@gtk.org>
* applied argument implementation patches from Elena Devdariani
<elena@cogent.ca>.
* gtk/gtktoolbar.c: ::orientation, ::toolbar_style, ::space_size,
::space_style, ::relief
* gtk/gtkruler.c: ::lower, ::upper, ::position, ::max_size
* gtk/gtkpreview.c: ::expand
* gtk/gtkpaned.c: ::handle_size, ::gutter_size
* gtk/gtknotebook.c: ::homogeneous
* gtk/gtklabel.c: ::wrap
* gtk/gtklist.c: ::selection_mode
* gtk/gtkhandlebox.c: ::handle_position, ::snap_edge
* gtk/gtkcurve.c: ::curve_type, ::min_x, ::max_x, ::min_y, ::max_y
* gtk/gtkcolorsel.c: ::update_policy, ::use_opacity
* gtk/gtkclist.c: ::sort_type
* gtk/gtkcheckmenuitem.c: ::active, ::show_toggle
* gtk/gtkaspectframe.c: ::xalign, ::yalign, ::ratio, ::obey_child
Tue Jun 1 23:38:38 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Removed ill-thought-out part of last
comment.
Tue Jun 1 23:30:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_attach): Get the reference
counting right when we have to attach a new style
for a different visual. (Chi-Deok Hwang <cdhwang@sr.hei.co.kr>)
* gtk/gtkstyle.c: Documented the refcounting
peculularities of gtk_style_attach.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkwindow.c (gtk_window_new): added return if fail for invalid
window types.
* examples/packer/pack.c (main): use GTK_WINDOW_TOPLEVEL instead
of GTK_TOPLEVEL for creating the window.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkmain.c (gtk_init_check): don't segfault when --gtk-module is
the last argument (reported by Per Winkvist).
Tue May 25 13:13:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes for invisible XOR lines (Frank Loemker
<floemker@TechFak.Uni-Bielefeld.DE>)
* gtk/gtkclist.c (gtk_clist_realize): Always use
a non-zero pixel for GDK_XOR.
* gtk/gtkvpaned.c gtk/gtkhpaned.c:
Use GDK_INVERT instead of GDK_XOR.
Wed May 12 21:56:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (adjust_adjustments): signal emit value_changed
signals if h/voffsets differ from adjustment values.
Reportet by Jerome Bolliet <bolliet@in2p3.fr>
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
the user data on the window before destroying it.
* gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
unrealize handler to take care of destroying
notebook->panel properly.
(Bug #1198 - Morten Welinder <terra@diku.dk>)
* gtk/gtktext.c (expand_scratch_buffer): Fix reversal
of g_new and g_realloc to stop memory leak. (Actually,
we could just use g_realloc(), but I'm not 100% sure
that is portable).
(Bug #1196 - Morten Welinder <terra@diku.dk>)
Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.h: Removed stray GtkPlugButton declaration.
* gdk/gdkfont.c (gdk_text_measure): Fix the return value
for fontsets.
* gtk/gtkbutton.c (gtkbutton_expose): Fix warning
with bin/button confusion.
Thu May 6 04:53:26 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: in the ItemFactory test, link radio items together,
and show how preselection of radio items is done.
Sun May 2 13:31:14 1999 Tim Janik <timj@gtk.org>
* gtk/gtktreeitem.c (gtk_tree_item_set_subtree):
* gtk/gtktree.c (gtk_tree_add) (gtk_tree_insert):
* gtk/gtktoolbar.c (gtk_toolbar_insert_element):
* gtk/gtkpaned.c (gtk_paned_pack2) (gtk_paned_pack1):
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_add):
* gtk/gtktable.c (gtk_table_attach):
* gtk/gtklist.c (gtk_list_insert_items):
* gtk/gtkmenushell.c (gtk_menu_shell_insert):
* gtk/gtknotebook.c (gtk_notebook_insert_page_menu):
* gtk/gtkpacker.c (gtk_packer_add_defaults) (gtk_packer_add):
* gtk/gtkbin.c (gtk_bin_add):
* gtk/gtkbox.c (gtk_box_pack_start) (gtk_box_pack_end):
* gtk/gtkfixed.c (gtk_fixed_put):
* gtk/gtklayout.c (gtk_layout_put):
general fixups to container_add logic. always realize child if
child->parent is realized, only map the child and queue a resize
if child and child->parent are both visible.
Fri Apr 30 09:02:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_unrealize): use gtk_container_forall
instead of gtk_container_foreach to walk and unrealize children, so
composite children get also unrealized.
(gtk_widget_real_show): don't call gtk_widget_map() if we don't need to.
(gtk_widget_map): assert that the widget is visible (basic constrain).
(gtk_widget_real_map): assert that the widget is realized (basic
constrain).
Fri Apr 29 00:53:20 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbindings.c (gtk_pattern_spec_init): plugged a memory leak.
Tue May 4 09:32:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc.iso-8859-2: Add a gtkrc
file for iso-8859-2 locales.
* configure.in (ALL_LINGUAS): ALL_LINGUAS update.
Tue Apr 27 16:38:32 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Fix typo of static_sources for static_SOURCES.
(Pointed out by andy@rz.uni-karlsruhe.de and others).
Remove some suspicious and useless lines.
Tue May 4 08:44:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c (gtk_clist_draw, draw_rows): Use
width,height = 0, 0 to mean - here to edge of window,
instead of -1, -1, since the former is all we support.
Tue May 4 08:34:43 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main): Correctly free list nodes
when removing from quit_functions list.
Tue Apr 27 14:17:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpacker.c (gtk_packer_size_request): remove unused variable.
Tue Apr 27 18:23:35 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable):
When redrawing characters on non-visible entry, use appropriate
'*' character. (Bug #1130 - Jean-Marc Jacquet <jm@littleigloo.org>)
Tue Apr 27 01:31:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (drag_dest_cell): compute destination cell
from drag coordinates.
(gtk_clist_drag_data_received) (gtk_clist_drag_motion):
use drag_dest_cell.
* gtk/gtktree (drag_dest_cell)
(gtk_ctree_drag_data_received) (gtk_ctree_drag_motion): likewise.
(Bug #1129)
Wed Apr 21 21:26:11 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_init): properly initialize
translate_* fields.
(gtk_item_factory_finalize): invoke translate_notify independant from
translate_data.
(gtk_item_factory_set_translate_func): likewise.
(gtk_item_factory_destroy): only remove ifactory pointer from those
widgets that belong to us (stupid me).
Mon Apr 19 12:05:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Fixed leak of
rc_style list when lookup succeeeds.
Thu Apr 15 01:11:24 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (resync_selection):
* gtk/gtkclist.c (resync_selection): fixed undo_selection bug.
* gtk/gtkclist.c (gtk_clist_button_release): fixed resync_selection
bug.
Fri Apr 9 19:22:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c gtk/gtkdnd.c gtk/gtkmenuitem.c:
Add some missing GDK_THREADS_ENTER()/LEAVE around
timeouts. (Patches from Sebastian Wilhelmi <wilhelmi@ira.uka.de>)
Thu Apr 8 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkentry.c (gtk_entry_key_press): use gtk_widget_activate()
rather than emit_by_name.
* gtk/gtkeditable.c (gtk_editable_insert_text): keep a reference
on the widget across multiple signal emissions.
(gtk_editable_delete_text): same here.
(gtk_editable_class_init): set widget_class->activate_signal after
editable_signals[ACTIVATE] has been created.
Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
position here prematurely -- we might not have the
right ->min_position and ->max_position yet.
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
Add error traps so if the other end of the connection
dies, we survive.
* gtk/gtkselection.c (gtk_selection_notify): Clean
up properly when selection property retrieval fails.
* gtk/gtkselection.c (gtk_selection_request): Correctly
reject SelectionRequest notifies where the handler
returns no data.
Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_dest_leave): Only unhighlight
when we've previously highlighted.
* gtk/gtkdnd.c (gtk_drag_dest_handle_event): Don't
emit two "drag_leave" signals for Motif drops.
* gtk/gtkdnd.c (gtk_drag_source_handle_event): Send
back the correct status messages when dropping from
Motif onto a proxy window that is rejecting the
drop.
Sat Mar 27 23:32:13 1999 Tim Janik <timj@gtk.org>
* gtk/gtkarg.[hc]: added functions from GLE, gtk_arg_reset() to free
the value and reset type to GTK_TYPE_INVALID, and gtk_arg_values_equal()
to compare two argument values. added gtk_arg_to_valueloc() to set a
variable from an arg through its location (pointer).
* gtk/gtkobject.[hc]: implemented gtk_object_get() in terms of
gtk_object_arg_get() and gtk_arg_to_valueloc(), floats are collected
as gfloat*, uchars are collected as guchar*, ints are collected as
gint*, etc...
Mon Mar 29 17:45:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccelgroup.c gtk/gtkgtkbindings.c:
Include <string.h> instead of <strings.h>.
* gtk/gtkstyle.c: Fix double include of gtkthemes.h
(actually, a lot more duplicate includes occur if
you trace through the sequence of #include's)
gtk-jbb-990320-0: John Bley, jbb6@acpub.duke.edu
Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com>
Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp>
gtk-a-higuti-990322-[0-3]
* configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS
that was causing -DX_LOCALE not to work.
* gtk/gtkrc.c (gtk_rc_init):
X_LOCALE will never have LC_MESSAGES defined
Thu Mar 25 12:38:31 1999 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_append_default_module_path): get $HOME from
g_get_home_dir() (gtk-pmc-990123-0.patch.gz).
* gtk/gtkwindow.c (gtk_window_key_press_event): feature keypad up/down/
left/right as well (gtk-michael-980726-0.patch.gz).
* gtk/gtklabel.[hc]: bunch of miscellaneous cleanups, such as s/0/NULL/
for pointer values, use gchar instead of char. fixed uline allocation
leaks, changed the allocation pattern so we use G_ALLOC_AND_FREE mem
chunks instead of G_ALLOC_ONLY.
(gtk_label_size_request): always alter requisition as passed and leave
widget->requisition alone.
(gtk_label_set_text): allow NULL strings.
(gtk_label_new): likewise.
Wed Mar 24 09:24:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.[hc]: type/macro fixups.
Mon Mar 22 05:51:34 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbin.c (gtk_bin_draw): only redraw children that are visible
*and* mapped (i.e. drawable).
(gtk_bin_expose): only send exposes to drawable children.
* gtk/gtkbox.c (gtk_box_draw): only redraw children that are drawable.
(gtk_box_expose): only send exposes to drawable children.
* gtk/gtkhscale.c (gtk_hscale_draw):
* gtk/gtkvscale.c (gtk_vscale_draw):
hm, this is an ugly one. we first compute the size of our trough area
here (window relative) and then check intersection with the draw_area
which is parent relative because we're a NO_WINDOW widget, so we need
to offset the trough area by allocation.x and allocation.y before the
check. (this must not be done for the background area though, since
that's already computed parent relative).
Mon Mar 22 00:41:39 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_unrealize): unmap clist if neccessary,
unrealize title buttons.
Fri Mar 19 00:00:22 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_column_title_passive)
(gtk_clist_column_title_active):
only connect/disconnect to GtkWidgetClass::event to block mouse events.
* gtk/gtkclist.c (vertical_timeout) (horizontal_timeout):
zero initialize event, removed superfluous gdk_window_get_pointer call
* gtk/gtklist.c (gtk_list_vertical_timeout)
(gtk_list_horizontal_timeout): removed superfluous
gdk_window_get_pointer call
Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org>
* plugging problems reported by "Bruce Mitchener, Jr."
<bruce@puremagic.com> due to a purify session.
* gtk/gtkstyle.c:
(gtk_style_ref):
(gtk_style_unref): assert ref_count to be > 0.
* gtk/gtkclist.c (gtk_clist_set_cell_style): { 0 } initilaize
the requisition.
(gtk_clist_set_shift): likewise.
* gtk/gtklayout.c: introduce gtk_layout_finalize() to unref the
adjustments.
* gtk/gtklist.c (gtk_list_horizontal_timeout): zero initialize the
event before sending it and set send_event to TRUE (which needs to
be done for *all* synthesized events).
(gtk_list_vertical_timeout): likewise.
* gtk/gtktipsquery.c (gtk_tips_query_destroy): plug small memory
leaks.
* gtk/gtkdrawingarea.c (gtk_drawing_area_send_configure): set send_event
to TRUE when synthesizing events.
[ *** end of merges from 1.2 *** ]
1999-11-22 21:52:50 +00:00
|
|
|
|
1998-01-03 03:31:03 +00:00
|
|
|
static GtkContainerClass *parent_class = NULL;
|
1998-03-09 15:16:28 +00:00
|
|
|
static guint clist_signals[LAST_SIGNAL] = {0};
|
1998-01-03 03:31:03 +00:00
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
static GtkTargetEntry clist_target_table = { "gtk-clist-drag-reorder", 0, 0};
|
1998-02-19 02:59:55 +00:00
|
|
|
|
1998-05-01 13:16:49 +00:00
|
|
|
GtkType
|
1998-05-03 22:41:32 +00:00
|
|
|
gtk_clist_get_type (void)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-05-01 13:16:49 +00:00
|
|
|
static GtkType clist_type = 0;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
|
|
|
if (!clist_type)
|
|
|
|
{
|
1998-11-30 19:07:15 +00:00
|
|
|
static const GtkTypeInfo clist_info =
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
|
|
|
"GtkCList",
|
|
|
|
sizeof (GtkCList),
|
|
|
|
sizeof (GtkCListClass),
|
|
|
|
(GtkClassInitFunc) gtk_clist_class_init,
|
|
|
|
(GtkObjectInitFunc) gtk_clist_init,
|
1998-07-04 15:31:30 +00:00
|
|
|
/* reserved_1 */ NULL,
|
1998-07-15 23:40:00 +00:00
|
|
|
/* reserved_2 */ NULL,
|
|
|
|
(GtkClassInitFunc) NULL,
|
1998-01-03 03:31:03 +00:00
|
|
|
};
|
|
|
|
|
1998-07-16 02:47:15 +00:00
|
|
|
clist_type = gtk_type_unique (GTK_TYPE_CONTAINER, &clist_info);
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return clist_type;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_clist_class_init (GtkCListClass *klass)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
|
|
|
GtkObjectClass *object_class;
|
|
|
|
GtkWidgetClass *widget_class;
|
|
|
|
GtkContainerClass *container_class;
|
1999-02-11 23:47:48 +00:00
|
|
|
GtkBindingSet *binding_set;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
|
|
|
object_class = (GtkObjectClass *) klass;
|
|
|
|
widget_class = (GtkWidgetClass *) klass;
|
|
|
|
container_class = (GtkContainerClass *) klass;
|
|
|
|
|
1998-07-16 02:47:15 +00:00
|
|
|
parent_class = gtk_type_class (GTK_TYPE_CONTAINER);
|
1998-02-19 02:59:55 +00:00
|
|
|
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
gtk_object_add_arg_type ("GtkCList::n_columns",
|
|
|
|
GTK_TYPE_UINT,
|
|
|
|
GTK_ARG_READWRITE | GTK_ARG_CONSTRUCT_ONLY,
|
|
|
|
ARG_N_COLUMNS);
|
|
|
|
gtk_object_add_arg_type ("GtkCList::shadow_type",
|
|
|
|
GTK_TYPE_SHADOW_TYPE,
|
1998-11-05 15:44:22 +00:00
|
|
|
GTK_ARG_READWRITE,
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
ARG_SHADOW_TYPE);
|
|
|
|
gtk_object_add_arg_type ("GtkCList::selection_mode",
|
|
|
|
GTK_TYPE_SELECTION_MODE,
|
1998-11-05 15:44:22 +00:00
|
|
|
GTK_ARG_READWRITE,
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
ARG_SELECTION_MODE);
|
|
|
|
gtk_object_add_arg_type ("GtkCList::row_height",
|
|
|
|
GTK_TYPE_UINT,
|
|
|
|
GTK_ARG_READWRITE,
|
|
|
|
ARG_ROW_HEIGHT);
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
gtk_object_add_arg_type ("GtkCList::reorderable",
|
|
|
|
GTK_TYPE_BOOL,
|
|
|
|
GTK_ARG_READWRITE,
|
|
|
|
ARG_REORDERABLE);
|
1999-02-18 00:35:11 +00:00
|
|
|
gtk_object_add_arg_type ("GtkCList::titles_active",
|
|
|
|
GTK_TYPE_BOOL,
|
|
|
|
GTK_ARG_READWRITE,
|
|
|
|
ARG_TITLES_ACTIVE);
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
gtk_object_add_arg_type ("GtkCList::use_drag_icons",
|
|
|
|
GTK_TYPE_BOOL,
|
|
|
|
GTK_ARG_READWRITE,
|
|
|
|
ARG_USE_DRAG_ICONS);
|
Adapt cast macros to standard.
Fri Nov 19 10:34:41 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkgamma.h: Adapt cast macros to standard.
[ Merges from 1.2 ]
Tue Nov 16 10:15:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_path):
If translation does not include a '/', use entire
translation instead of crashing.
Sun Oct 31 22:21:11 1999 Tim Janik <timj@gtk.org>
* docs/gtk_tut.sgml:
s/gtk_accel_group_attach/gtk_window_add_accel_group/.
Sat Oct 30 09:09:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_target_list_remove): Use
g_list_remove_link, not g_list_remove.
[ From Geert Bevin <gbevin@thunderstorms.org> ]
Sun Oct 24 07:41:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkclist.c (real_undo_selection): commented out g_print()
statement upon unselection (how the heck did that slip in?).
Sat Oct 23 03:03:08 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_freeze):
(gtk_text_thaw): undraw/draw cursor here to avoid unnecessary scrolling
in frozen state (and aparently crashes). patch provided by Anders
Melchiorsen <and@kampsax.dtu.dk>.
Sat Oct 23 02:53:20 1999 Tim Janik <timj@gtk.org>
* fix insensitive default/focus widget activation,
reported by Matt Goodall <mgg@isotek.co.uk>.
* gtk/gtkwindow.c (gtk_window_key_press_event):
(gtk_window_activate_default):
(gtk_window_activate_focus):
return handled=FALSE for actiavtion of insensitive default
widgets. return handled=TRUE for activation of insensitive
focus widgets. don't activate in either case.
Tue Oct 19 09:55:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk-config.in (lib_gtk): Switch order of @x_cflags@
and $glib_cflags to match library order and in the
theory that an old version of GLib is more likely to
be in the include directory for X then vice-versa.
(Bug #2776)
Tue Oct 19 09:46:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always use LC_CTYPE
to determine the locale for fontsets, not LC_MESSAGES;
the user may want English messages with a handling
for non-English languages. (LC_CTYPE=ru_RU LC_MESSAGES=fr_FR
will still be broken) (Bug #2891)
Tue Oct 19 20:36:42 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Fixed the wrong number of "*"'s.
Tue Oct 19 12:15:13 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Changed the Korean default fontset.
Fri Oct 8 02:32:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): Fix bug
where when scrolling to the left or top double exposes
were done, causing major slowdowns.
Thu Oct 7 18:31:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always normalize codeset
names to lowercase and alphanumeric, before looking
them up.
* gtk/Makefile.am: Install codeset variant gtkrc files
with normalized names.
Thu Oct 7 22:52:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_popup_with_data): even
popup menus when the menu is already visible, but its parent
is still hidden, (happens after tornoff window got hidden).
Thu Oct 7 11:09:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (install-data-local): Fix
a typo where gtkrc.vi_VN.tcvn5712 wasn't getting
deleted, causing error messages on install.
Thu Oct 7 11:03:06 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtk[hv]paned.c (gtk_{h,v}paned_draw): Redraw
the handle as well, since we now sometimes ignore
exposes on the handle while resizing.
Wed Oct 6 18:02:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_append_default_pixmap_path): Fix stupid
extra g_free introduced in one of the last one or two
commits.
Wed Oct 6 16:38:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc*: Make naming of gtkrc files
consistent, put each style that a gtkrc.* file creates
in a unique namespace, remove old files before installing.
Wed Oct 6 14:31:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Avoid leaking memory when
gtk_rc_init is called multiple times. (Yes, people who
do that have bugs in their code.)
Tue Oct 5 11:36:57 PDT 1999 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: listing gtkrc in gtkconf_DATA seems to barf.
Remove it since it's generated by the Makefile anyway
Tue Oct 5 02:43:41 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputcommon.h (gdk_input_device_new): Free
device->info.axes for core pointer.
Thu Sep 30 13:55:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (destroy_idle_test): Rename idle to
idle_id, to deal with obsolete, broken C libraries.
Mon Sep 27 02:50:15 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkvscale.c (gtk_vscale_draw): Don't add in
allocation->x/y twice!
* gtk/gtkhscale.c: Make usage of gtk_hscale_pos_trough()
consistent with gtk_vscale_pos_trough().
Sun Sep 26 19:44:34 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_queue_resize): We may
be queueing a resize on a toplevel container between
the time we show it and when we map it. So, we need
to test GTK_WIDGET_VISIBLE() for toplevels, and only
use GTK_WIDGET_DRAWABLE() for child windows.
Thu Sep 23 16:41:03 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDADDS): Add GDK_WLIBS to LDADDS
(fixes bug #2144)
Fri Sep 24 00:51:45 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c (gtk_container_queue_resize): check for
container DRAWABLE (instead of VISIBLE), so we don't queue
resizes on non-toplevel containers.
Sun Sep 19 18:13:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.[ch]: Make the data argument
const guchar *.
Sat Sep 18 21:27:40 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: Try to behave sensibly if
the focus widget is the window itself. (Should
we allow this at all?)
Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_set_sensitive):
* gtk/gtknotebook.c (gtk_notebook_set_scrollable):
* gtk/gtknotebook.c (gtk_notebook_set_show_border):
* gtk/gtkclist.c (gtk_notebook_set_show_border): make gboolean args
in prototypes and implementations consistent (Tomas Ogren).
* gtk/gtklayout.c (gtk_layout_remove): unset GTK_IS_OFFSCREEN flag
before the widget is unparented (reported by damon).
* gtk/gtkdnd.c: make the cursor and icon data _unsigned_ char,
since we provide unsigned data anyways.
Thu Sep 16 21:32:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_set_tip): Delay
the call to gtk_tooltips_layout_text() until later.
* gtk/gtktooltips.c (gtk_tooltips_draw_tips):
Call gtk_widget_ensure_style() before using the style.
Wed Sep 15 02:52:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_event): Added workaround
for old widgets that don't propagate draws to all
children. (Namely gnome-dock for gnome-libs <= 1.0.16)
Tue Sep 14 19:22:19 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_queue_resize): don't queue the parent
for a redraw but just the widget that requested the resize.
Tue Sep 14 18:29:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c: added new widget level method
gtk_container_set_reallocate_redraws() and a GtkContainer flag
reallocate_redraws : 1 to reflect the setting, exported this through
the argument system as a boolean ::reallocate_redraws.
* gtk/gtkwidget.c (gtk_widget_size_allocate): when queueing redraws
on the widget because the allocation changes, do so as well for
widget->parent if the parent has reallocate_redraws set to TRUE.
with that containers requesting reallocation redraws get automatically
redrawn if their children changed allocation (this unfortunately
affects also other children that didn't change allocation, but we
cannot work around that before 1.3).
Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_idle_draw): only emit ::draw if width
_and_ height are >0 (not _or_).
* gtk/gtktable.c (gtk_table_remove): use gtk_widget_queue_resize()
instead of gtk_container_queue_resize(), which is a core gtk internal
function (must have been on crack when i queued that).
* gtk/gtkprivate.h: added new private flag GTK_FULLDRAW_PENDING, so
we can check more reliably if we want to discard expose events.
* gtk/gtkwidget.c: added setting/unsetting of the GTK_FULLDRAW_PENDING
flag.
* gtk/gtkwidget.c (gtk_widget_event): don't discard synthesized exposes,
we simply trust these events. for deciding whether to discard exposes,
check GTK_FULLDRAW_PENDING instead of RESIZE_PENDING.
Mon Sep 13 15:01:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore
queues of areas that are completely off screen.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fix broken
logic for handleboxes.
* gtk/gtkwidget.c (gtk_widget_queue_draw_data): Add santity
check on width/height.
Mon Sep 13 02:22:47 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: backed out Raja's recent VPATH build "improvements",
we are fine with using $@ the way we do (if we actually encounter
brokeness with $@ in VPATH builds because of additional path prefixes,
we need to use $(@F) actually).
Mon Sep 13 01:34:53 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c: renamed two variables, hopefully didn't introduce
short lived bugs, that would allow language bindings to do surgeries
to our guts.
Fri Sep 10 15:22:50 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_size_allocate): Fix typo
where comparison was being done against an uninitialized
value causing intermittant results depending on
compiler flags. Also make it clearer that we aren't
ever initializing the child as 0x0 (though this will
be caught in gtk_widget_size_allocate())
Fri Sep 10 10:06:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_transient_for): Move
gtk_window_unset_transient_for() call after we do checks
involving the old transient parent.
[ From Lance Capser <lmc@cyberhighway.net> ]
1999-09-07 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gtk.defs): Go back to using `touch' to create
an empty file.
Mon Sep 6 00:11:56 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (gtk_ctree_is_ancestor): return FALSE if node has
no children. (Reported by: Chris Rogers <gandalf@pobox.com>)
1999-09-03 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gen_sources): Improve VPATH builds.
`$@' is valid only in the build dir, not after we've done
`cd $srcdir'. Also use `test -f' instead of less portable
`test -e'.
Fri Sep 3 15:59:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (correct_cache_insert): Rewrite
for simplicity, and hopefully correctness.
(Fixes bug #1322, which was a segfault when
on some insertions with the properties around
the insertion set up just wrong.)
* gtk/gtktext.c (gtk_text_adjustment): When we receive
a "changed" signal, clamp the new value to the adjustment
bounds to avoid segfaulting if someone tries to change
the adjustment to a bogus value. (Bug #1795)
Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c: Ignore unexpected destroy notifies
for children, for toplevel windows handle them
like delete_event.
* gtk/gtkplug.c: Add an unrealize handler so that
we unref plug->socket_window when we are done
with it.
Fri Sep 3 14:52:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_area): Fix stupid signedness
problem that was causing background to sometimes
be misaligned.
Fri Sep 3 12:26:33 1999 Owen Taylor <otaylor@redhat.com>
[ Fixes pointed out by Ettore Perazzoli <ettore@comm2000.it> ]
* gtk/gtkmenu.c (gtk_menu_position): Make
sure we never position menus with negative x, y,
since gtk_widget_set_uposition() can't handle that.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu):
Modify the positioning code a bit so that we always
put the top-left corner onscreen. (This is for
UI reasons, gtk_menu_position() now takes care of
gtk_widet_set_uposition() brokeness.)
Fri Sep 3 03:06:30 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: fixed up things for -jx, x > 1.
Sun Sep 5 08:48:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_style): Ref the
RC style that is passed in. The lack of the ref
before was a bug. If people worked around this
bug, this will introduce a slight memory leak
in their code. The code should typically look like:
rc_style = gtk_rc_style_new ();
[...]
gtk_widget_modify_style (widget, rc_style);
gtk_rc_style_unref (rc_style);
* gtk/gtkwidget.c (gtk_widget_modify_style): Reset
the style if it was already set.
* gtk/gtkwidget.c (gtk_widget_set_name): Only set the
style if it was set before.
Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (main): Add a check to see if we
are being run from the correct directory and
to quit nicely if we are not.
* gtk/gtkrc.c (gtk_rc_slist_remove_all): Make function
static.
Thu Sep 2 23:00:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkenums.h (GtkWindowPosition): added GTK_WIN_POS_CENTER_ALWAYS.
* gtk/gtkwindow.c:
queue resizes unconditionally (gtk_widget_queue_resize will figure
what to do if the window is not realized).
(gtk_window_move_resize): only recenter the window
for GTK_WIN_POS_CENTER_ALWAYS.
(gtk_window_compute_reposition): handle GTK_WIN_POS_CENTER_ALWAYS in
the same way as GTK_WIN_POS_CENTER.
Thu Sep 2 22:39:27 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_reposition): check for the last position
with (!(info->last_flags & GDK_HINT_POS)) instead of
(!info->last_flags & GDK_HINT_POS).
* gtk/gtkwindow.c (gtk_window_move_resize): constrain new_width and
new_height unconditionally, because we use these values even if
!default_size_changed && !hints_changed.
comented the (default_size_changed || hints_changed) case with
respect to resize rejects from the window manager.
* gtk/gtkwindow.c (gtk_window_move_resize): save info->last values
in the zvt condition hack, since this includes the window hints, set
the hints after the handling_resize case.
* gtk/gtkwindow.c (gtk_window_show): constrain the default size that a
window is initially shown with to the geometry.
Thu Sep 2 07:38:56 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize):
s/size_changed/default_size_changed/g so i know what's
really going on (frying brain on smaller flame now).
Thu Sep 2 05:47:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): queue a new resize if
we have size_changed upon handling_resize. this is a gross
workaround for the broken zvt widget and should be removed in
1.3 again (search for FIXME).
Owen provided an accurate comment for this:
/* We could be here for two reasons
* 1) We coincidentally got a resize while handling
* another resize.
* 2) Our computation of size_changed was completely
* screwed up, probably because one of our children
* is broken. It's probably a zvt widget.
*
* For 1), we could just go ahead and ask for the
* new size right now, but doing that for 2)
* might well be fighting the user (and can even
* trigger a loop). Since we really don't want to
* do that, we requeue a resize in hopes that
* by the time it gets handled, the child has seen
* the light and is willing to go along with the
* new size. (this happens for the zvt widget, since
* the size_allocate() above will have stored the
* requisition corresponding to the new size in the
* zvt widget)
*
* This doesn't buy us anything for 1), but it shouldn't
* hurt us too badly, since it is what would have
* happened if we had gotten the configure event before
* the new size had been set.
*/
Wed Sep 1 20:46:11 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: deal properly with the fact that RC
style lists may include rc styles more than once.
* gtk/gtkrc.c (gtk_rc_append_pixmap_path): Removed
unused static function.
* gtk/gtkrc.c (gtk_rc_find_pixmap_in_path): Keep a
stack of directories of RC files currently being
parsed and implicitely add them to pixmap path.
This fixes a bug where the directory would get
appended then overwritten by pixmap_path declarations.
(bug #1462, from Peter Wainright <prw@wainpr.demon.co.uk>)
* gtk/gtkthemes.c (gtk_theme_engine_unref): Call
theme's exit function. (Patch from Peter Wainwright,
bug #1454)
* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_destroy):
Add a destroy() handler to take care of removing
group for menu item. (Fixes bug #1197)
* gtk/gtkwidget.c (gtk_widget_size_request): Fixed thinko
in warning message.
Wed Sep 1 21:27:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): don't require a server
roundtrip to figure window's width and height, since we know that
anyways from widget->allocation.
Wed Sep 1 12:37:44 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Compute
the hints after we request the new size.
Wed Sep 1 10:38:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_compute_hints): Removed
GTK_WIDGET_REALIZED() assertion - we can compute the
hints before we are realized.
* gtk/gtkwindow.c (gtk_window_move_resize): Reorder
hint changing so that we have a value of hints_changed
when we decide whether to constrain the window size.
* gtk/gtkwindow.c (gtk_window_move_resize): Spelling fix.
* gtk/gtkwindow.c (gtk_window_constrain_size): cleanups,
change back to G_MAXINT.
Wed Sep 1 06:54:59 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_get_geometry_info): zero initialize
new GtkWindowGeometryInfo, so fields like GdkGeometry geometry
contain uncluttered values.
(gtk_window_compute_hints): simply assert that window is realized
and that geometry_info is valid, since we rely on this anyways.
(gtk_window_constrain_size): major cleanups to the code.
if (flags & GDK_HINT_BASE_SIZE) use geometry's base width and height
for the base size, instead of the minimums. use 32767 as max width
and height (like in gtkwindow.c) instead of G_MAXINT.
Wed Sep 1 04:41:25 1999 Tim Janik <timj@gtk.org>
* cleaned up the GtkContainer.need_resize flag handling mess, we
only need to force resize requests when we were prematurely
realized, or our widget tree was modified when we were temporarily
hidden. handling these cases directly upon showing the window (i.e.
while the GdkWindow is still unmapped) avoids the need to wait for
a configure event response and therefore makes the GUI more snappier
and avoids blank windows during the roundtrip.
* gtk/gtkwidget.c:
(gtk_widget_hide):
(gtk_widget_show): don't queue resizes on toplevels, they know how
to deal with matters.
* gtk/gtkcontainer.c (gtk_container_queue_resize): set the ->need_resize
flag directly for not visible resize containers and spare us unecessary
signal emissions.
* gtk/gtkwindow.c:
(gtk_window_realize): if we need to enforce premature size allocation,
queue a container resize so we are correctly resized later on.
(gtk_window_init):
(gtk_window_size_request):
don't freak around with the ->need_resize flag,
gtk_container_queue_resize() will care about that.
(gtk_window_show):
handle initial resizing issues here, we can handle matters better in
this place, especially since we know that our GdkWindow is still
unmapped.
(gtk_window_move_resize):
don't care about ->need_resize at all.
handle size changes properly that occoured while we waited for a
configure event.
Tue Aug 31 15:58:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_uposition):
* gtk/gtkwindow.[hc] (gtk_window_reposition):
Move the hint setting code from gtk_widget_set_uposition
to here; set the hints so that we respect any previously
set geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Don't
change the window hints here or move the window here,
let that happen in gtk_window_move_resize().
Tue Aug 31 06:58:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): when discarding exposes due
to already queued resizes (and therefore redraws) on a widget, check
its anchestry as well.
* gtk/gtkcontainer.c:
(gtk_container_queue_resize): clear resize widgets for resize
containers before aborting prematurely. this is especially important
for toplevels which may need imemdiate processing or their resize
handler to be queued.
(gtk_container_dequeue_resize_handler): added new internal function for
gtkwindow.c.
* gtk/gtkwindow.c (gtk_window_move_resize): if we are resizing due to a
configure event, take possible changes in window position into account
as well.
if we request a new window size, queue up a resize handler that will
last until the configure event response arrives.
combined the ->need_resize case (initial show) with the general size
(hints) changed case and added even more comments.
if !auto_shrink, only revert to the old allocation if the new size
is smaller than the current allocation.
Tue Aug 31 11:55:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_arg, gtk_window_set_policy,
gtk_window_set_geometry_hints
gtk_window_set_default_size):
When hints are set, queue a resize so that the hints will
be eventually reset on the toplevel.
* gtk/gtkwindow.c (gtk_window_show): Use
gtk_window_compute_default_size(). Clear the need_resize flag
on the initail map so that we don't unnecessarily trigger the
resize code.
* gtk/gtkwindow.c (gtk_window_move_resize): Split apart
into separate functions. Compare the hints we are setting
with what we set last time so that we can accurately
tell when we need to reset the hints.
* gtk/gtkwindow.c (gtk_window_compute_default_size): New
function to figure out the size from requisition
and default_size.
* gtk/gtkwindow.c (gtk_window_constrain_size): Function
from fvwm to constrain a size to the geometry hints.
* gtk/gtkwindow.c (gtk_window_compare_hints): New function
to compare two sets of geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_hints): Renamed
from gtk_window_set_hints(), just compute the hints,
don't set them.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Move
code from gtk_window_move_resize() to separate function,
rationalize a bit.
Tue Aug 31 13:05:03 1999 Owen Taylor <otaylor@redhat.com>
* gtkrc.h: Move the ref_count member out of the GtkRcStyle
structure into a new private structure.
* gtkrc.c: Split GtkRcStyle into public/private.
In the private part, add a list of pointers to the
RcStyle lists this RcStyle participates in.
* gtkrc.c: When a RcStyle is free, remove all
lists referencing it from the
realized_style_ht hash, and free those lists.
* gtk/gtkrc.c (gtk_rc_clear_styles): Don't call
gtk_rc_init(), since that adds the default styles
to the list of parsed RC files again.
* gtk/gtkrc.c: Use gtk_rc_style_find() consistently.
Thu Aug 26 14:14:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): reactivated the sanity
checks that ensure that a widget's allocation is at least 1 in width
and height. (GNOME note: this doesn't affect old panel code anymore,
because GtkSocket will request width and height of at least 1 since
Fri Jul 23).
* gtk/gtkwindow.c (gtk_window_realize): if the widget hasn't been
allocated yet (happens if the user realizes the window prematurely),
size request and allocate it.
(gtk_window_size_allocate): guard against guint underflows.
Wed Aug 25 19:01:36 1999 Lars Hamann <lars@gtk.org>
* gtk/Makefile.am (gtk_built_sources): reordered stamp-gtk.defs
in gtk_built_sources, so gtk.defs gets built prior to all other
sources.
Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am:
invoke indent on gtkmarshal.*.
rewrote source generation rules, use COPYING as oldest source tag for
a piggyback rule to generate all sources from (don't touch it ;).
major cleanups, strip spaces on build rules for GNU Make.
* gtk/genmarshal.pl: don't operate on hardcoded filenames but take
source and target files from commandline arguments. don't invoke indent.
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Wed Aug 18 09:20:10 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c:
we use window->need_resize from configure_event now, to indicate that
the gtkwindow should keep its allocation (e.g. because the user resized
the window through window manager handles). resize_count is now reliably
used to figure whether we got the allocation we requested from the
window manager.
configure events get queued as resizes now, the real stuff (size
computation and allocation) now only goes on in gtk_window_move_resize().
GtkWindow's requisition now contains its *real* requisition (like all
other widgets), *not* taking usize into account.
geometry_info->last_{width|height} is now updated from set_hints() only
so it always contains the last hints we set for the window manager.
made some event handlers return TRUE instead of FALSE.
the overall code should be much more straight forward now, and the
significant code portions are accompanied by comments now.
(gtk_window_set_hints):
removed requisition argument and made it
fetch the requisition through gtk_widget_get_child_requisition.
we also don't move the gdkwindow here anymore, gtk_window_move_resize()
does that now.
(gtk_window_show):
ensure that the widget is realized before calling
gtk_container_check_resize() (and thus gtk_window_move_resize()), also
ensure that we got properly size requested and allocated before
realization.
(gtk_window_configure_event):
ignore plain window moves, or reallocate the widget tree through the
resize queue otherwise.
(gtk_window_move_resize):
mostly rewrote this function to figure window manager hints more
reliably, coalesce window moves and resizes to reduce configure events
and do actuall size allocations.
Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): discard expose events for widgets
that have a resize pending, because a redraw is already queued for them.
* gtk/gtkcontainer.c: removed ugly connect_to ::size_allocate signal
hack to clear resize_widgets.
* gtk/gtkwidget.c (gtk_widget_size_allocate): call clear_resize_widgets
for resize containers prior to size allocation. (this is also a bit
ugly, but avoids side effects for stopped emissions and is thus more
reliable).
(gtk_widget_unparent): removed disconnect call for clear_resize_widgets.
* gtk/gtktooltips.c (gtk_tooltips_paint_window): renamed this
function from gtk_tooltips_expose, as we connect to ::expose_event
*and* ::draw now.
1999-08-18 Federico Mena Quintero <federico@redhat.com>
* gtk/gtkselection.c (gtk_target_list_ref): Added missing sanity
checks.
(gtk_target_list_unref): Likewise.
* gtk/gtkthemes.c (gtk_theme_engine_unref): Likewise.
Tue Aug 17 15:47:07 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_draw_value_bar):
guard against division by zero. (Fixes bug #1339)
Tue Aug 17 10:56:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_move_{forward,backward}_word):
Prevent the trivial leak of information of allowing
word motion when the entry is not visible.
Tue Aug 17 10:28:52 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_fileop_error): Propagate
modality to error dialog as well as confirmation dialogs.
(Bug #1803, reported by Rosanna Wing Sze Yuen)
Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktreeitem.c (gtk_tree_item_draw_lines): Honor
tree->view_lines.
(gtk-guy-990611-3.patch: Guy Harris <guy@netapp.com>)
* gtk/Makefile.am (install-data-local): Solaris apparently
has various troubles with ln -f; use rm first instead.
(gtk-guy-990611-2.patch: Guy Harris <guy@netapp.com>)
1999-07-30 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (stamp-m): Don't `mv' from builddir to srcdir,
use `cp' followed by `rm' (the `rm' was already there).
July 30, 1999 Elliot Lee <sopwith@redhat.com>
* configure.in: Fix autoconf warnings about cross compilation by
trying to provide sane defaults for AC_TRY_RUN.
* gtk/Makefile.am: If we refer to gtkmarshal.[ch] in $(srcdir),
put them into $(srcdir) when generated. Also add a dependency of
gtksignal.h on gtkmarshal.h for -j builds.
* gtk/gtk(dnd,style,gamma).c: Minor warning fixes.
Wed Jul 28 09:29:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration_do): Added missing
GDK_THREADS_{LEAVE,ENTER} pair.
(From Paul Fisher <pnfisher@redhat.com>)
Fri Jul 23 01:00:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtksocket.c (gtk_socket_size_request): asure that the requested
width and height are always >0 (owen).
Fri Jul 23 00:00:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): backed out my recent
change that assured that a widget's allocated with and height are
always >1, since this breaks *buggy* panel code. unfortunately this
back-breaks the gimp's color selector.
* gtk/gtkdrawingarea.c (gtk_drawing_area_size_allocate): asure that our
allocation is always >0 in width and height, before sending the
configure event; this is a *gross* hack to get the gimp back to work.
* marked both cases with TODO-1.3
Wed Jul 21 15:47:39 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Don't display wrap indicators when
text is not editable and word wrap is on.
Wed Jul 21 08:21:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): special case
option menus here as they are not derived from menu shell, assure that
the option menu has a menu we can add items to.
Tue Jul 20 23:29:48 1999 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_page_allocate): convert allocation->
width/height to (gint) before calculations and check against < 0 to
avoid guint wraparounds.
Sun Jul 18 00:35:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): ensure that the allocated
width and height is never zero. sanity check both dimensions against
32767 and issue a warning if the allocation is greater than that.
Wed Jul 7 15:03:30 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_events_pending): Unlock around call
to g_main_pending() as well.
Wed Jul 7 14:59:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration): Unlock around
call to g_main_iteration() - since that will regrab
GTK+ lock to process events.
Thu Jul 1 15:01:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c
- Regularize with the rest of GTK+ by making widget->requisition
not reflect the set_usize()
- Always recompute geometry hints, then check if they
changed before sending them to the X server. The
previous checks for changes would fail in a number
of circumstances.
Thu Jul 1 11:55:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Include <stdlib.h> for strcmp().
Wed Jun 30 19:26:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c:
- Code cleanups
- Instantaneously update on modifier key presses
- Allow cancellation of the drag with Escape.
Tue Jun 29 17:04:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_handle_box): Set the policy
to auto_shrink - otherwise the appearance is rather
strange when flipping between horizontal and vertical.
Mon Jun 28 09:29:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: add ::default_width and ::default_height arguments.
(gtk_window_set_default_size): don't change a value if it's < 0.
queue a resize.
Sun Jun 27 11:00:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_insert): don't segfault on NULL inserts.
Mon Jun 28 12:08:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (cmpl_completion_fullname): Don't
add an extra "/" when concating "/" + filename.
(From Matt Grossman <mattg@oz.net>)
Mon Jun 28 10:57:12 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (draw_cell_pixmap): Reset clip mask
for fg_gc if we set it for drawing pixmap.
Tue Jun 15 12:45:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes from Peter Wainwright <prw@wainpr.demon.co.uk>
* gtk/gtkrc.c (gtk_rc_parse_engine): If rc_style->engine is
already set, call old engine's destroy function and
unref the old engine.
Thu Jun 10 17:59:38 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.c (gtk_drawing_area_size): queue a resize.
Wed Jun 9 15:13:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h: mark certain functions as internal.
Wed Jun 9 13:48:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpreview.c (gtk_preview_set_expand): queue a resize if the
expand behaviour changed.
* gtk/gtklabel.c (gtk_label_set_pattern):
(gtk_label_set_justify):
(gtk_label_set_line_wrap):
don't bother invoking queue_clear, the reallocation does
that for us, always free_words so the upcoming resize will
relayout the label's contents.
Wed Jun 9 12:50:48 1999 Tim Janik <timj@gtk.org>
* applied argument implementation patches from Elena Devdariani
<elena@cogent.ca>.
* gtk/gtktoolbar.c: ::orientation, ::toolbar_style, ::space_size,
::space_style, ::relief
* gtk/gtkruler.c: ::lower, ::upper, ::position, ::max_size
* gtk/gtkpreview.c: ::expand
* gtk/gtkpaned.c: ::handle_size, ::gutter_size
* gtk/gtknotebook.c: ::homogeneous
* gtk/gtklabel.c: ::wrap
* gtk/gtklist.c: ::selection_mode
* gtk/gtkhandlebox.c: ::handle_position, ::snap_edge
* gtk/gtkcurve.c: ::curve_type, ::min_x, ::max_x, ::min_y, ::max_y
* gtk/gtkcolorsel.c: ::update_policy, ::use_opacity
* gtk/gtkclist.c: ::sort_type
* gtk/gtkcheckmenuitem.c: ::active, ::show_toggle
* gtk/gtkaspectframe.c: ::xalign, ::yalign, ::ratio, ::obey_child
Tue Jun 1 23:38:38 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Removed ill-thought-out part of last
comment.
Tue Jun 1 23:30:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_attach): Get the reference
counting right when we have to attach a new style
for a different visual. (Chi-Deok Hwang <cdhwang@sr.hei.co.kr>)
* gtk/gtkstyle.c: Documented the refcounting
peculularities of gtk_style_attach.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkwindow.c (gtk_window_new): added return if fail for invalid
window types.
* examples/packer/pack.c (main): use GTK_WINDOW_TOPLEVEL instead
of GTK_TOPLEVEL for creating the window.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkmain.c (gtk_init_check): don't segfault when --gtk-module is
the last argument (reported by Per Winkvist).
Tue May 25 13:13:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes for invisible XOR lines (Frank Loemker
<floemker@TechFak.Uni-Bielefeld.DE>)
* gtk/gtkclist.c (gtk_clist_realize): Always use
a non-zero pixel for GDK_XOR.
* gtk/gtkvpaned.c gtk/gtkhpaned.c:
Use GDK_INVERT instead of GDK_XOR.
Wed May 12 21:56:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (adjust_adjustments): signal emit value_changed
signals if h/voffsets differ from adjustment values.
Reportet by Jerome Bolliet <bolliet@in2p3.fr>
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
the user data on the window before destroying it.
* gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
unrealize handler to take care of destroying
notebook->panel properly.
(Bug #1198 - Morten Welinder <terra@diku.dk>)
* gtk/gtktext.c (expand_scratch_buffer): Fix reversal
of g_new and g_realloc to stop memory leak. (Actually,
we could just use g_realloc(), but I'm not 100% sure
that is portable).
(Bug #1196 - Morten Welinder <terra@diku.dk>)
Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.h: Removed stray GtkPlugButton declaration.
* gdk/gdkfont.c (gdk_text_measure): Fix the return value
for fontsets.
* gtk/gtkbutton.c (gtkbutton_expose): Fix warning
with bin/button confusion.
Thu May 6 04:53:26 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: in the ItemFactory test, link radio items together,
and show how preselection of radio items is done.
Sun May 2 13:31:14 1999 Tim Janik <timj@gtk.org>
* gtk/gtktreeitem.c (gtk_tree_item_set_subtree):
* gtk/gtktree.c (gtk_tree_add) (gtk_tree_insert):
* gtk/gtktoolbar.c (gtk_toolbar_insert_element):
* gtk/gtkpaned.c (gtk_paned_pack2) (gtk_paned_pack1):
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_add):
* gtk/gtktable.c (gtk_table_attach):
* gtk/gtklist.c (gtk_list_insert_items):
* gtk/gtkmenushell.c (gtk_menu_shell_insert):
* gtk/gtknotebook.c (gtk_notebook_insert_page_menu):
* gtk/gtkpacker.c (gtk_packer_add_defaults) (gtk_packer_add):
* gtk/gtkbin.c (gtk_bin_add):
* gtk/gtkbox.c (gtk_box_pack_start) (gtk_box_pack_end):
* gtk/gtkfixed.c (gtk_fixed_put):
* gtk/gtklayout.c (gtk_layout_put):
general fixups to container_add logic. always realize child if
child->parent is realized, only map the child and queue a resize
if child and child->parent are both visible.
Fri Apr 30 09:02:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_unrealize): use gtk_container_forall
instead of gtk_container_foreach to walk and unrealize children, so
composite children get also unrealized.
(gtk_widget_real_show): don't call gtk_widget_map() if we don't need to.
(gtk_widget_map): assert that the widget is visible (basic constrain).
(gtk_widget_real_map): assert that the widget is realized (basic
constrain).
Fri Apr 29 00:53:20 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbindings.c (gtk_pattern_spec_init): plugged a memory leak.
Tue May 4 09:32:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc.iso-8859-2: Add a gtkrc
file for iso-8859-2 locales.
* configure.in (ALL_LINGUAS): ALL_LINGUAS update.
Tue Apr 27 16:38:32 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Fix typo of static_sources for static_SOURCES.
(Pointed out by andy@rz.uni-karlsruhe.de and others).
Remove some suspicious and useless lines.
Tue May 4 08:44:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c (gtk_clist_draw, draw_rows): Use
width,height = 0, 0 to mean - here to edge of window,
instead of -1, -1, since the former is all we support.
Tue May 4 08:34:43 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main): Correctly free list nodes
when removing from quit_functions list.
Tue Apr 27 14:17:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpacker.c (gtk_packer_size_request): remove unused variable.
Tue Apr 27 18:23:35 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable):
When redrawing characters on non-visible entry, use appropriate
'*' character. (Bug #1130 - Jean-Marc Jacquet <jm@littleigloo.org>)
Tue Apr 27 01:31:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (drag_dest_cell): compute destination cell
from drag coordinates.
(gtk_clist_drag_data_received) (gtk_clist_drag_motion):
use drag_dest_cell.
* gtk/gtktree (drag_dest_cell)
(gtk_ctree_drag_data_received) (gtk_ctree_drag_motion): likewise.
(Bug #1129)
Wed Apr 21 21:26:11 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_init): properly initialize
translate_* fields.
(gtk_item_factory_finalize): invoke translate_notify independant from
translate_data.
(gtk_item_factory_set_translate_func): likewise.
(gtk_item_factory_destroy): only remove ifactory pointer from those
widgets that belong to us (stupid me).
Mon Apr 19 12:05:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Fixed leak of
rc_style list when lookup succeeeds.
Thu Apr 15 01:11:24 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (resync_selection):
* gtk/gtkclist.c (resync_selection): fixed undo_selection bug.
* gtk/gtkclist.c (gtk_clist_button_release): fixed resync_selection
bug.
Fri Apr 9 19:22:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c gtk/gtkdnd.c gtk/gtkmenuitem.c:
Add some missing GDK_THREADS_ENTER()/LEAVE around
timeouts. (Patches from Sebastian Wilhelmi <wilhelmi@ira.uka.de>)
Thu Apr 8 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkentry.c (gtk_entry_key_press): use gtk_widget_activate()
rather than emit_by_name.
* gtk/gtkeditable.c (gtk_editable_insert_text): keep a reference
on the widget across multiple signal emissions.
(gtk_editable_delete_text): same here.
(gtk_editable_class_init): set widget_class->activate_signal after
editable_signals[ACTIVATE] has been created.
Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
position here prematurely -- we might not have the
right ->min_position and ->max_position yet.
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
Add error traps so if the other end of the connection
dies, we survive.
* gtk/gtkselection.c (gtk_selection_notify): Clean
up properly when selection property retrieval fails.
* gtk/gtkselection.c (gtk_selection_request): Correctly
reject SelectionRequest notifies where the handler
returns no data.
Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_dest_leave): Only unhighlight
when we've previously highlighted.
* gtk/gtkdnd.c (gtk_drag_dest_handle_event): Don't
emit two "drag_leave" signals for Motif drops.
* gtk/gtkdnd.c (gtk_drag_source_handle_event): Send
back the correct status messages when dropping from
Motif onto a proxy window that is rejecting the
drop.
Sat Mar 27 23:32:13 1999 Tim Janik <timj@gtk.org>
* gtk/gtkarg.[hc]: added functions from GLE, gtk_arg_reset() to free
the value and reset type to GTK_TYPE_INVALID, and gtk_arg_values_equal()
to compare two argument values. added gtk_arg_to_valueloc() to set a
variable from an arg through its location (pointer).
* gtk/gtkobject.[hc]: implemented gtk_object_get() in terms of
gtk_object_arg_get() and gtk_arg_to_valueloc(), floats are collected
as gfloat*, uchars are collected as guchar*, ints are collected as
gint*, etc...
Mon Mar 29 17:45:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccelgroup.c gtk/gtkgtkbindings.c:
Include <string.h> instead of <strings.h>.
* gtk/gtkstyle.c: Fix double include of gtkthemes.h
(actually, a lot more duplicate includes occur if
you trace through the sequence of #include's)
gtk-jbb-990320-0: John Bley, jbb6@acpub.duke.edu
Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com>
Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp>
gtk-a-higuti-990322-[0-3]
* configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS
that was causing -DX_LOCALE not to work.
* gtk/gtkrc.c (gtk_rc_init):
X_LOCALE will never have LC_MESSAGES defined
Thu Mar 25 12:38:31 1999 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_append_default_module_path): get $HOME from
g_get_home_dir() (gtk-pmc-990123-0.patch.gz).
* gtk/gtkwindow.c (gtk_window_key_press_event): feature keypad up/down/
left/right as well (gtk-michael-980726-0.patch.gz).
* gtk/gtklabel.[hc]: bunch of miscellaneous cleanups, such as s/0/NULL/
for pointer values, use gchar instead of char. fixed uline allocation
leaks, changed the allocation pattern so we use G_ALLOC_AND_FREE mem
chunks instead of G_ALLOC_ONLY.
(gtk_label_size_request): always alter requisition as passed and leave
widget->requisition alone.
(gtk_label_set_text): allow NULL strings.
(gtk_label_new): likewise.
Wed Mar 24 09:24:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.[hc]: type/macro fixups.
Mon Mar 22 05:51:34 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbin.c (gtk_bin_draw): only redraw children that are visible
*and* mapped (i.e. drawable).
(gtk_bin_expose): only send exposes to drawable children.
* gtk/gtkbox.c (gtk_box_draw): only redraw children that are drawable.
(gtk_box_expose): only send exposes to drawable children.
* gtk/gtkhscale.c (gtk_hscale_draw):
* gtk/gtkvscale.c (gtk_vscale_draw):
hm, this is an ugly one. we first compute the size of our trough area
here (window relative) and then check intersection with the draw_area
which is parent relative because we're a NO_WINDOW widget, so we need
to offset the trough area by allocation.x and allocation.y before the
check. (this must not be done for the background area though, since
that's already computed parent relative).
Mon Mar 22 00:41:39 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_unrealize): unmap clist if neccessary,
unrealize title buttons.
Fri Mar 19 00:00:22 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_column_title_passive)
(gtk_clist_column_title_active):
only connect/disconnect to GtkWidgetClass::event to block mouse events.
* gtk/gtkclist.c (vertical_timeout) (horizontal_timeout):
zero initialize event, removed superfluous gdk_window_get_pointer call
* gtk/gtklist.c (gtk_list_vertical_timeout)
(gtk_list_horizontal_timeout): removed superfluous
gdk_window_get_pointer call
Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org>
* plugging problems reported by "Bruce Mitchener, Jr."
<bruce@puremagic.com> due to a purify session.
* gtk/gtkstyle.c:
(gtk_style_ref):
(gtk_style_unref): assert ref_count to be > 0.
* gtk/gtkclist.c (gtk_clist_set_cell_style): { 0 } initilaize
the requisition.
(gtk_clist_set_shift): likewise.
* gtk/gtklayout.c: introduce gtk_layout_finalize() to unref the
adjustments.
* gtk/gtklist.c (gtk_list_horizontal_timeout): zero initialize the
event before sending it and set send_event to TRUE (which needs to
be done for *all* synthesized events).
(gtk_list_vertical_timeout): likewise.
* gtk/gtktipsquery.c (gtk_tips_query_destroy): plug small memory
leaks.
* gtk/gtkdrawingarea.c (gtk_drawing_area_send_configure): set send_event
to TRUE when synthesizing events.
[ *** end of merges from 1.2 *** ]
1999-11-22 21:52:50 +00:00
|
|
|
gtk_object_add_arg_type ("GtkCList::sort_type",
|
|
|
|
GTK_TYPE_SORT_TYPE,
|
|
|
|
GTK_ARG_READWRITE,
|
|
|
|
ARG_SORT_TYPE);
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
object_class->set_arg = gtk_clist_set_arg;
|
|
|
|
object_class->get_arg = gtk_clist_get_arg;
|
|
|
|
object_class->destroy = gtk_clist_destroy;
|
|
|
|
object_class->finalize = gtk_clist_finalize;
|
|
|
|
|
|
|
|
|
1998-12-02 03:40:03 +00:00
|
|
|
widget_class->set_scroll_adjustments_signal =
|
|
|
|
gtk_signal_new ("set_scroll_adjustments",
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
GTK_RUN_LAST,
|
|
|
|
object_class->type,
|
1998-12-02 03:40:03 +00:00
|
|
|
GTK_SIGNAL_OFFSET (GtkCListClass, set_scroll_adjustments),
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
gtk_marshal_NONE__POINTER_POINTER,
|
|
|
|
GTK_TYPE_NONE, 2, GTK_TYPE_ADJUSTMENT, GTK_TYPE_ADJUSTMENT);
|
1998-11-05 15:44:22 +00:00
|
|
|
|
1998-01-03 03:31:03 +00:00
|
|
|
clist_signals[SELECT_ROW] =
|
|
|
|
gtk_signal_new ("select_row",
|
1998-03-05 09:34:36 +00:00
|
|
|
GTK_RUN_FIRST,
|
1998-01-03 03:31:03 +00:00
|
|
|
object_class->type,
|
|
|
|
GTK_SIGNAL_OFFSET (GtkCListClass, select_row),
|
1998-07-21 04:13:42 +00:00
|
|
|
gtk_marshal_NONE__INT_INT_POINTER,
|
|
|
|
GTK_TYPE_NONE, 3,
|
|
|
|
GTK_TYPE_INT,
|
|
|
|
GTK_TYPE_INT,
|
|
|
|
GTK_TYPE_GDK_EVENT);
|
1998-01-03 03:31:03 +00:00
|
|
|
clist_signals[UNSELECT_ROW] =
|
|
|
|
gtk_signal_new ("unselect_row",
|
1998-03-05 09:34:36 +00:00
|
|
|
GTK_RUN_FIRST,
|
1998-01-03 03:31:03 +00:00
|
|
|
object_class->type,
|
|
|
|
GTK_SIGNAL_OFFSET (GtkCListClass, unselect_row),
|
1998-07-21 04:13:42 +00:00
|
|
|
gtk_marshal_NONE__INT_INT_POINTER,
|
1998-12-02 00:52:14 +00:00
|
|
|
GTK_TYPE_NONE, 3, GTK_TYPE_INT,
|
|
|
|
GTK_TYPE_INT, GTK_TYPE_GDK_EVENT);
|
|
|
|
clist_signals[ROW_MOVE] =
|
|
|
|
gtk_signal_new ("row_move",
|
|
|
|
GTK_RUN_LAST,
|
|
|
|
object_class->type,
|
|
|
|
GTK_SIGNAL_OFFSET (GtkCListClass, row_move),
|
|
|
|
gtk_marshal_NONE__INT_INT,
|
|
|
|
GTK_TYPE_NONE, 2, GTK_TYPE_INT, GTK_TYPE_INT);
|
1998-01-03 03:31:03 +00:00
|
|
|
clist_signals[CLICK_COLUMN] =
|
|
|
|
gtk_signal_new ("click_column",
|
1998-03-05 09:34:36 +00:00
|
|
|
GTK_RUN_FIRST,
|
1998-01-03 03:31:03 +00:00
|
|
|
object_class->type,
|
|
|
|
GTK_SIGNAL_OFFSET (GtkCListClass, click_column),
|
1998-07-21 04:13:42 +00:00
|
|
|
gtk_marshal_NONE__INT,
|
1998-01-03 03:31:03 +00:00
|
|
|
GTK_TYPE_NONE, 1, GTK_TYPE_INT);
|
1998-10-07 00:03:24 +00:00
|
|
|
clist_signals[RESIZE_COLUMN] =
|
|
|
|
gtk_signal_new ("resize_column",
|
|
|
|
GTK_RUN_LAST,
|
|
|
|
object_class->type,
|
|
|
|
GTK_SIGNAL_OFFSET (GtkCListClass, resize_column),
|
|
|
|
gtk_marshal_NONE__INT_INT,
|
|
|
|
GTK_TYPE_NONE, 2, GTK_TYPE_INT, GTK_TYPE_INT);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
clist_signals[TOGGLE_FOCUS_ROW] =
|
|
|
|
gtk_signal_new ("toggle_focus_row",
|
|
|
|
GTK_RUN_LAST | GTK_RUN_ACTION,
|
|
|
|
object_class->type,
|
|
|
|
GTK_SIGNAL_OFFSET (GtkCListClass, toggle_focus_row),
|
1998-07-21 04:13:42 +00:00
|
|
|
gtk_marshal_NONE__NONE,
|
1998-07-15 23:40:00 +00:00
|
|
|
GTK_TYPE_NONE, 0);
|
|
|
|
clist_signals[SELECT_ALL] =
|
|
|
|
gtk_signal_new ("select_all",
|
|
|
|
GTK_RUN_LAST | GTK_RUN_ACTION,
|
|
|
|
object_class->type,
|
|
|
|
GTK_SIGNAL_OFFSET (GtkCListClass, select_all),
|
1998-07-21 04:13:42 +00:00
|
|
|
gtk_marshal_NONE__NONE,
|
1998-07-15 23:40:00 +00:00
|
|
|
GTK_TYPE_NONE, 0);
|
|
|
|
clist_signals[UNSELECT_ALL] =
|
|
|
|
gtk_signal_new ("unselect_all",
|
|
|
|
GTK_RUN_LAST | GTK_RUN_ACTION,
|
|
|
|
object_class->type,
|
|
|
|
GTK_SIGNAL_OFFSET (GtkCListClass, unselect_all),
|
1998-07-21 04:13:42 +00:00
|
|
|
gtk_marshal_NONE__NONE,
|
1998-07-15 23:40:00 +00:00
|
|
|
GTK_TYPE_NONE, 0);
|
|
|
|
clist_signals[UNDO_SELECTION] =
|
|
|
|
gtk_signal_new ("undo_selection",
|
|
|
|
GTK_RUN_LAST | GTK_RUN_ACTION,
|
|
|
|
object_class->type,
|
|
|
|
GTK_SIGNAL_OFFSET (GtkCListClass, undo_selection),
|
1998-07-21 04:13:42 +00:00
|
|
|
gtk_marshal_NONE__NONE,
|
1998-07-15 23:40:00 +00:00
|
|
|
GTK_TYPE_NONE, 0);
|
|
|
|
clist_signals[START_SELECTION] =
|
|
|
|
gtk_signal_new ("start_selection",
|
|
|
|
GTK_RUN_LAST | GTK_RUN_ACTION,
|
|
|
|
object_class->type,
|
|
|
|
GTK_SIGNAL_OFFSET (GtkCListClass, start_selection),
|
1998-07-21 04:13:42 +00:00
|
|
|
gtk_marshal_NONE__NONE,
|
1998-07-15 23:40:00 +00:00
|
|
|
GTK_TYPE_NONE, 0);
|
|
|
|
clist_signals[END_SELECTION] =
|
|
|
|
gtk_signal_new ("end_selection",
|
|
|
|
GTK_RUN_LAST | GTK_RUN_ACTION,
|
|
|
|
object_class->type,
|
|
|
|
GTK_SIGNAL_OFFSET (GtkCListClass, end_selection),
|
1998-07-21 04:13:42 +00:00
|
|
|
gtk_marshal_NONE__NONE,
|
1998-07-15 23:40:00 +00:00
|
|
|
GTK_TYPE_NONE, 0);
|
|
|
|
clist_signals[TOGGLE_ADD_MODE] =
|
|
|
|
gtk_signal_new ("toggle_add_mode",
|
|
|
|
GTK_RUN_LAST | GTK_RUN_ACTION,
|
|
|
|
object_class->type,
|
|
|
|
GTK_SIGNAL_OFFSET (GtkCListClass, toggle_add_mode),
|
1998-07-21 04:13:42 +00:00
|
|
|
gtk_marshal_NONE__NONE,
|
1998-07-15 23:40:00 +00:00
|
|
|
GTK_TYPE_NONE, 0);
|
|
|
|
clist_signals[EXTEND_SELECTION] =
|
|
|
|
gtk_signal_new ("extend_selection",
|
|
|
|
GTK_RUN_LAST | GTK_RUN_ACTION,
|
|
|
|
object_class->type,
|
|
|
|
GTK_SIGNAL_OFFSET (GtkCListClass, extend_selection),
|
1998-07-21 04:13:42 +00:00
|
|
|
gtk_marshal_NONE__ENUM_FLOAT_BOOL,
|
1998-07-15 23:40:00 +00:00
|
|
|
GTK_TYPE_NONE, 3,
|
1998-07-27 01:50:16 +00:00
|
|
|
GTK_TYPE_SCROLL_TYPE, GTK_TYPE_FLOAT, GTK_TYPE_BOOL);
|
1998-07-15 23:40:00 +00:00
|
|
|
clist_signals[SCROLL_VERTICAL] =
|
|
|
|
gtk_signal_new ("scroll_vertical",
|
|
|
|
GTK_RUN_LAST | GTK_RUN_ACTION,
|
|
|
|
object_class->type,
|
|
|
|
GTK_SIGNAL_OFFSET (GtkCListClass, scroll_vertical),
|
1998-07-21 04:13:42 +00:00
|
|
|
gtk_marshal_NONE__ENUM_FLOAT,
|
1998-07-27 01:50:16 +00:00
|
|
|
GTK_TYPE_NONE, 2, GTK_TYPE_SCROLL_TYPE, GTK_TYPE_FLOAT);
|
1998-07-15 23:40:00 +00:00
|
|
|
clist_signals[SCROLL_HORIZONTAL] =
|
|
|
|
gtk_signal_new ("scroll_horizontal",
|
|
|
|
GTK_RUN_LAST | GTK_RUN_ACTION,
|
|
|
|
object_class->type,
|
|
|
|
GTK_SIGNAL_OFFSET (GtkCListClass, scroll_horizontal),
|
1998-07-21 04:13:42 +00:00
|
|
|
gtk_marshal_NONE__ENUM_FLOAT,
|
1998-07-27 01:50:16 +00:00
|
|
|
GTK_TYPE_NONE, 2, GTK_TYPE_SCROLL_TYPE, GTK_TYPE_FLOAT);
|
1998-07-15 23:40:00 +00:00
|
|
|
clist_signals[ABORT_COLUMN_RESIZE] =
|
|
|
|
gtk_signal_new ("abort_column_resize",
|
|
|
|
GTK_RUN_LAST | GTK_RUN_ACTION,
|
|
|
|
object_class->type,
|
|
|
|
GTK_SIGNAL_OFFSET (GtkCListClass, abort_column_resize),
|
1998-07-21 04:13:42 +00:00
|
|
|
gtk_marshal_NONE__NONE,
|
1998-07-15 23:40:00 +00:00
|
|
|
GTK_TYPE_NONE, 0);
|
1998-01-03 03:31:03 +00:00
|
|
|
gtk_object_class_add_signals (object_class, clist_signals, LAST_SIGNAL);
|
|
|
|
|
|
|
|
widget_class->realize = gtk_clist_realize;
|
|
|
|
widget_class->unrealize = gtk_clist_unrealize;
|
|
|
|
widget_class->map = gtk_clist_map;
|
|
|
|
widget_class->unmap = gtk_clist_unmap;
|
|
|
|
widget_class->draw = gtk_clist_draw;
|
|
|
|
widget_class->button_press_event = gtk_clist_button_press;
|
1998-01-19 09:59:20 +00:00
|
|
|
widget_class->button_release_event = gtk_clist_button_release;
|
|
|
|
widget_class->motion_notify_event = gtk_clist_motion;
|
1998-01-03 03:31:03 +00:00
|
|
|
widget_class->expose_event = gtk_clist_expose;
|
|
|
|
widget_class->size_request = gtk_clist_size_request;
|
|
|
|
widget_class->size_allocate = gtk_clist_size_allocate;
|
1998-07-15 23:40:00 +00:00
|
|
|
widget_class->key_press_event = gtk_clist_key_press;
|
|
|
|
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;
|
1998-10-19 22:46:38 +00:00
|
|
|
widget_class->style_set = gtk_clist_style_set;
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
widget_class->drag_begin = gtk_clist_drag_begin;
|
|
|
|
widget_class->drag_end = gtk_clist_drag_end;
|
|
|
|
widget_class->drag_motion = gtk_clist_drag_motion;
|
|
|
|
widget_class->drag_leave = gtk_clist_drag_leave;
|
|
|
|
widget_class->drag_drop = gtk_clist_drag_drop;
|
|
|
|
widget_class->drag_data_get = gtk_clist_drag_data_get;
|
|
|
|
widget_class->drag_data_received = gtk_clist_drag_data_received;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-03-23 03:31:11 +00:00
|
|
|
/* container_class->add = NULL; use the default GtkContainerClass warning */
|
1998-10-19 22:46:38 +00:00
|
|
|
/* container_class->remove=NULL; use the default GtkContainerClass warning */
|
|
|
|
|
GTK_MENU_DIR_CHILD: check for the existance of
Thu Sep 3 04:22:20 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current):
GTK_MENU_DIR_CHILD: check for the existance of
menu_shell->active_menu_item before accessing its child.
GTK_MENU_DIR_PREV:
GTK_MENU_DIR_NEXT: if we haven't had an active item and still
don't, make a default selection.
Wed Sep 2 00:28:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_propagate_state): iterate
the children with _forall for sensitivity changes and with
_foreach on pure state changes. this fixes a lot of the
old inclusions of internal widgets into _foreach calls.
* gtk/gtktree.c: removed gtk_tree_foreach, let gtk_tree_forall
do the work. don't walk the subtrees of first level children.
* gtk/gtktreeitem.c: provide a _forall implementation,
which walks the subtrees as well for include_internals.
* gtk/gtkmenuitem.c: provide a _forall implementation, which walks
the submenus as well for include_internals.
* gtk/gtkscrolledwindow.c: removed gtk_scrolled_window_foreach and
implemented gtk_scrolled_window_forall, which will iterate over
the viewport and the scrollbars for gtk_container_forall or
iterate over the viewports children for gtk_container_foreach.
* gtk/gtktoolbar.c:
* gtk/gtktable.c:
* gtk/gtkpaned.c:
* gtk/gtkpacker.c:
* gtk/gtkmenushell.c:
* gtk/gtklist.c:
* gtk/gtkfixed.c:
* gtk/gtkclist.c:
* gtk/gtkbox.c:
* gtk/gtkbin.c:
* gtk/gtknotebook.c:
removed the old gtk_*_foreach functions and provided gtk_*_forall.
* gtk/gtknotebook.c:
(gtk_notebook_real_switch_page): expose tabs.
(gtk_notebook_page_num): new function to return the page number
of a distinct child.
(gtk_notebook_focus): minor fixups. foxus handling is still screwed
under some circumstances.
* gtk/gtktreeitem.c:
(gtk_real_tree_item_select):
(gtk_real_tree_item_deselect): major fixes.
some general fixups wrt queue_redraw, and tree items not being
NO_WINDOW widgets.
* gtk/gtklistitem.c:
(gtk_real_list_item_select):
(gtk_real_list_item_deselect):
(gtk_real_list_item_toggle):
removed unneccessary queue_redraw calls.
Wed Aug 30 09:42:07 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c: allow optionmenus to have the focus and
automatically popup the menu on space bar.
Wed Aug 26 06:40:34 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: implemented gtk_container_forall() (as a class
method), which acts similar to gtk_container_foreach(), but iterates
over internal children. the GtkContainer::foreach signal vanished in
favour of a new class method ->forall() that optionally includes
internal widgets.
* gtk/gtkclist.c (gtk_clist_init): provide no _foreach implementation
but a _forall implementation, since all child widgets we have are
internal ones.
(column_button_create): set the parent window prior
to gtk_widget_set_parent().
* gtk/gtkwidget.c:
exchanged all calls to gtk_container_foreach() with
gtk_container_forall().
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: added the GTK_COMPOSITE_CHILD, exported through
the GtkWidget::composite_child argument. to have a widget created
with the flag initially, two new functions got added to wrap a widgets
creation:
gtk_widget_push_composite_flag() and gtk_widget_pop_composite_flag().
Wed Aug 25 23:37:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktooltips.h:
* gtk/gtktooltips.c: exported gtk_tooltips_create_window() as
gtk_tooltips_force_window(), so tooltips->tip_window can be accessed
prior to the first tip being set.
don't put an extra reference on the window, since it is a toplevel,
it wont get destroyed from anywhere else.
* overall macro and GtkType fixups.
1998-09-03 02:38:53 +00:00
|
|
|
container_class->forall = gtk_clist_forall;
|
1998-07-15 23:40:00 +00:00
|
|
|
container_class->focus = gtk_clist_focus;
|
|
|
|
container_class->set_focus_child = gtk_clist_set_focus_child;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-12-02 03:40:03 +00:00
|
|
|
klass->set_scroll_adjustments = gtk_clist_set_scroll_adjustments;
|
1998-11-28 01:56:09 +00:00
|
|
|
klass->refresh = clist_refresh;
|
1998-01-24 19:14:42 +00:00
|
|
|
klass->select_row = real_select_row;
|
|
|
|
klass->unselect_row = real_unselect_row;
|
1998-12-02 00:52:14 +00:00
|
|
|
klass->row_move = real_row_move;
|
1998-07-15 23:40:00 +00:00
|
|
|
klass->undo_selection = real_undo_selection;
|
|
|
|
klass->resync_selection = resync_selection;
|
|
|
|
klass->selection_find = selection_find;
|
1998-01-03 03:31:03 +00:00
|
|
|
klass->click_column = NULL;
|
1998-10-07 00:03:24 +00:00
|
|
|
klass->resize_column = real_resize_column;
|
1998-05-01 13:16:49 +00:00
|
|
|
klass->draw_row = draw_row;
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
klass->draw_drag_highlight = draw_drag_highlight;
|
1998-08-17 23:48:04 +00:00
|
|
|
klass->insert_row = real_insert_row;
|
|
|
|
klass->remove_row = real_remove_row;
|
1998-07-15 23:40:00 +00:00
|
|
|
klass->clear = real_clear;
|
1998-08-17 23:48:04 +00:00
|
|
|
klass->sort_list = real_sort_list;
|
1998-07-15 23:40:00 +00:00
|
|
|
klass->select_all = real_select_all;
|
|
|
|
klass->unselect_all = real_unselect_all;
|
|
|
|
klass->fake_unselect_all = fake_unselect_all;
|
|
|
|
klass->scroll_horizontal = scroll_horizontal;
|
|
|
|
klass->scroll_vertical = scroll_vertical;
|
|
|
|
klass->extend_selection = extend_selection;
|
|
|
|
klass->toggle_focus_row = toggle_focus_row;
|
|
|
|
klass->toggle_add_mode = toggle_add_mode;
|
|
|
|
klass->start_selection = start_selection;
|
|
|
|
klass->end_selection = end_selection;
|
|
|
|
klass->abort_column_resize = abort_column_resize;
|
1998-08-17 23:48:04 +00:00
|
|
|
klass->set_cell_contents = set_cell_contents;
|
1998-10-19 22:46:38 +00:00
|
|
|
klass->cell_size_request = cell_size_request;
|
1998-05-01 13:16:49 +00:00
|
|
|
|
1999-02-11 23:47:48 +00:00
|
|
|
binding_set = gtk_binding_set_by_class (klass);
|
|
|
|
gtk_binding_entry_add_signal (binding_set, GDK_Up, 0,
|
|
|
|
"scroll_vertical", 2,
|
|
|
|
GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD,
|
|
|
|
GTK_TYPE_FLOAT, 0.0);
|
|
|
|
gtk_binding_entry_add_signal (binding_set, GDK_Down, 0,
|
|
|
|
"scroll_vertical", 2,
|
|
|
|
GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD,
|
|
|
|
GTK_TYPE_FLOAT, 0.0);
|
|
|
|
gtk_binding_entry_add_signal (binding_set, GDK_Page_Up, 0,
|
|
|
|
"scroll_vertical", 2,
|
|
|
|
GTK_TYPE_ENUM, GTK_SCROLL_PAGE_BACKWARD,
|
|
|
|
GTK_TYPE_FLOAT, 0.0);
|
|
|
|
gtk_binding_entry_add_signal (binding_set, GDK_Page_Down, 0,
|
|
|
|
"scroll_vertical", 2,
|
|
|
|
GTK_TYPE_ENUM, GTK_SCROLL_PAGE_FORWARD,
|
|
|
|
GTK_TYPE_FLOAT, 0.0);
|
|
|
|
gtk_binding_entry_add_signal (binding_set, GDK_Home, GDK_CONTROL_MASK,
|
|
|
|
"scroll_vertical", 2,
|
|
|
|
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
|
|
|
|
GTK_TYPE_FLOAT, 0.0);
|
|
|
|
gtk_binding_entry_add_signal (binding_set, GDK_End, GDK_CONTROL_MASK,
|
|
|
|
"scroll_vertical", 2,
|
|
|
|
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
|
|
|
|
GTK_TYPE_FLOAT, 1.0);
|
|
|
|
|
|
|
|
gtk_binding_entry_add_signal (binding_set, GDK_Up, GDK_SHIFT_MASK,
|
|
|
|
"extend_selection", 3,
|
|
|
|
GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD,
|
|
|
|
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
|
|
|
|
gtk_binding_entry_add_signal (binding_set, GDK_Down, GDK_SHIFT_MASK,
|
|
|
|
"extend_selection", 3,
|
|
|
|
GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD,
|
|
|
|
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
|
|
|
|
gtk_binding_entry_add_signal (binding_set, GDK_Page_Up, GDK_SHIFT_MASK,
|
|
|
|
"extend_selection", 3,
|
|
|
|
GTK_TYPE_ENUM, GTK_SCROLL_PAGE_BACKWARD,
|
|
|
|
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
|
|
|
|
gtk_binding_entry_add_signal (binding_set, GDK_Page_Down, GDK_SHIFT_MASK,
|
|
|
|
"extend_selection", 3,
|
|
|
|
GTK_TYPE_ENUM, GTK_SCROLL_PAGE_FORWARD,
|
|
|
|
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
|
|
|
|
gtk_binding_entry_add_signal (binding_set, GDK_Home,
|
|
|
|
GDK_SHIFT_MASK | GDK_CONTROL_MASK,
|
|
|
|
"extend_selection", 3,
|
|
|
|
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
|
|
|
|
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
|
|
|
|
gtk_binding_entry_add_signal (binding_set, GDK_End,
|
|
|
|
GDK_SHIFT_MASK | GDK_CONTROL_MASK,
|
|
|
|
"extend_selection", 3,
|
|
|
|
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
|
|
|
|
GTK_TYPE_FLOAT, 1.0, GTK_TYPE_BOOL, TRUE);
|
|
|
|
|
|
|
|
gtk_binding_entry_add_signal (binding_set, GDK_Left, 0,
|
|
|
|
"scroll_horizontal", 2,
|
|
|
|
GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD,
|
|
|
|
GTK_TYPE_FLOAT, 0.0);
|
|
|
|
gtk_binding_entry_add_signal (binding_set, GDK_Right, 0,
|
|
|
|
"scroll_horizontal", 2,
|
|
|
|
GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD,
|
|
|
|
GTK_TYPE_FLOAT, 0.0);
|
|
|
|
gtk_binding_entry_add_signal (binding_set, GDK_Home, 0,
|
|
|
|
"scroll_horizontal", 2,
|
|
|
|
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
|
|
|
|
GTK_TYPE_FLOAT, 0.0);
|
|
|
|
gtk_binding_entry_add_signal (binding_set, GDK_End, 0,
|
|
|
|
"scroll_horizontal", 2,
|
|
|
|
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
|
|
|
|
GTK_TYPE_FLOAT, 1.0);
|
|
|
|
|
|
|
|
gtk_binding_entry_add_signal (binding_set, GDK_Escape, 0,
|
|
|
|
"undo_selection", 0);
|
|
|
|
gtk_binding_entry_add_signal (binding_set, GDK_Escape, 0,
|
|
|
|
"abort_column_resize", 0);
|
|
|
|
gtk_binding_entry_add_signal (binding_set, GDK_space, 0,
|
|
|
|
"toggle_focus_row", 0);
|
|
|
|
gtk_binding_entry_add_signal (binding_set, GDK_space, GDK_CONTROL_MASK,
|
|
|
|
"toggle_add_mode", 0);
|
|
|
|
gtk_binding_entry_add_signal (binding_set, '/', GDK_CONTROL_MASK,
|
|
|
|
"select_all", 0);
|
|
|
|
gtk_binding_entry_add_signal (binding_set, '\\', GDK_CONTROL_MASK,
|
|
|
|
"unselect_all", 0);
|
|
|
|
gtk_binding_entry_add_signal (binding_set, GDK_Shift_L,
|
|
|
|
GDK_RELEASE_MASK | GDK_SHIFT_MASK,
|
|
|
|
"end_selection", 0);
|
|
|
|
gtk_binding_entry_add_signal (binding_set, GDK_Shift_R,
|
|
|
|
GDK_RELEASE_MASK | GDK_SHIFT_MASK,
|
|
|
|
"end_selection", 0);
|
|
|
|
gtk_binding_entry_add_signal (binding_set, GDK_Shift_L,
|
|
|
|
GDK_RELEASE_MASK | GDK_SHIFT_MASK |
|
|
|
|
GDK_CONTROL_MASK,
|
|
|
|
"end_selection", 0);
|
|
|
|
gtk_binding_entry_add_signal (binding_set, GDK_Shift_R,
|
|
|
|
GDK_RELEASE_MASK | GDK_SHIFT_MASK |
|
|
|
|
GDK_CONTROL_MASK,
|
|
|
|
"end_selection", 0);
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
|
1998-11-05 15:44:22 +00:00
|
|
|
static void
|
|
|
|
gtk_clist_set_arg (GtkObject *object,
|
|
|
|
GtkArg *arg,
|
|
|
|
guint arg_id)
|
|
|
|
{
|
|
|
|
GtkCList *clist;
|
|
|
|
|
|
|
|
clist = GTK_CLIST (object);
|
|
|
|
|
|
|
|
switch (arg_id)
|
|
|
|
{
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
case ARG_N_COLUMNS: /* construct-only arg, only set when !GTK_CONSTRUCTED */
|
|
|
|
gtk_clist_construct (clist, MAX (1, GTK_VALUE_UINT (*arg)), NULL);
|
1998-11-05 15:44:22 +00:00
|
|
|
break;
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
case ARG_SHADOW_TYPE:
|
|
|
|
gtk_clist_set_shadow_type (clist, GTK_VALUE_ENUM (*arg));
|
|
|
|
break;
|
|
|
|
case ARG_SELECTION_MODE:
|
|
|
|
gtk_clist_set_selection_mode (clist, GTK_VALUE_ENUM (*arg));
|
|
|
|
break;
|
|
|
|
case ARG_ROW_HEIGHT:
|
|
|
|
gtk_clist_set_row_height (clist, GTK_VALUE_UINT (*arg));
|
1998-11-05 15:44:22 +00:00
|
|
|
break;
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
case ARG_REORDERABLE:
|
|
|
|
gtk_clist_set_reorderable (clist, GTK_VALUE_BOOL (*arg));
|
|
|
|
break;
|
1999-02-18 00:35:11 +00:00
|
|
|
case ARG_TITLES_ACTIVE:
|
|
|
|
if (GTK_VALUE_BOOL (*arg))
|
|
|
|
gtk_clist_column_titles_active (clist);
|
|
|
|
else
|
|
|
|
gtk_clist_column_titles_passive (clist);
|
|
|
|
break;
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
case ARG_USE_DRAG_ICONS:
|
|
|
|
gtk_clist_set_use_drag_icons (clist, GTK_VALUE_BOOL (*arg));
|
|
|
|
break;
|
Adapt cast macros to standard.
Fri Nov 19 10:34:41 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkgamma.h: Adapt cast macros to standard.
[ Merges from 1.2 ]
Tue Nov 16 10:15:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_path):
If translation does not include a '/', use entire
translation instead of crashing.
Sun Oct 31 22:21:11 1999 Tim Janik <timj@gtk.org>
* docs/gtk_tut.sgml:
s/gtk_accel_group_attach/gtk_window_add_accel_group/.
Sat Oct 30 09:09:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_target_list_remove): Use
g_list_remove_link, not g_list_remove.
[ From Geert Bevin <gbevin@thunderstorms.org> ]
Sun Oct 24 07:41:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkclist.c (real_undo_selection): commented out g_print()
statement upon unselection (how the heck did that slip in?).
Sat Oct 23 03:03:08 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_freeze):
(gtk_text_thaw): undraw/draw cursor here to avoid unnecessary scrolling
in frozen state (and aparently crashes). patch provided by Anders
Melchiorsen <and@kampsax.dtu.dk>.
Sat Oct 23 02:53:20 1999 Tim Janik <timj@gtk.org>
* fix insensitive default/focus widget activation,
reported by Matt Goodall <mgg@isotek.co.uk>.
* gtk/gtkwindow.c (gtk_window_key_press_event):
(gtk_window_activate_default):
(gtk_window_activate_focus):
return handled=FALSE for actiavtion of insensitive default
widgets. return handled=TRUE for activation of insensitive
focus widgets. don't activate in either case.
Tue Oct 19 09:55:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk-config.in (lib_gtk): Switch order of @x_cflags@
and $glib_cflags to match library order and in the
theory that an old version of GLib is more likely to
be in the include directory for X then vice-versa.
(Bug #2776)
Tue Oct 19 09:46:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always use LC_CTYPE
to determine the locale for fontsets, not LC_MESSAGES;
the user may want English messages with a handling
for non-English languages. (LC_CTYPE=ru_RU LC_MESSAGES=fr_FR
will still be broken) (Bug #2891)
Tue Oct 19 20:36:42 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Fixed the wrong number of "*"'s.
Tue Oct 19 12:15:13 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Changed the Korean default fontset.
Fri Oct 8 02:32:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): Fix bug
where when scrolling to the left or top double exposes
were done, causing major slowdowns.
Thu Oct 7 18:31:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always normalize codeset
names to lowercase and alphanumeric, before looking
them up.
* gtk/Makefile.am: Install codeset variant gtkrc files
with normalized names.
Thu Oct 7 22:52:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_popup_with_data): even
popup menus when the menu is already visible, but its parent
is still hidden, (happens after tornoff window got hidden).
Thu Oct 7 11:09:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (install-data-local): Fix
a typo where gtkrc.vi_VN.tcvn5712 wasn't getting
deleted, causing error messages on install.
Thu Oct 7 11:03:06 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtk[hv]paned.c (gtk_{h,v}paned_draw): Redraw
the handle as well, since we now sometimes ignore
exposes on the handle while resizing.
Wed Oct 6 18:02:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_append_default_pixmap_path): Fix stupid
extra g_free introduced in one of the last one or two
commits.
Wed Oct 6 16:38:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc*: Make naming of gtkrc files
consistent, put each style that a gtkrc.* file creates
in a unique namespace, remove old files before installing.
Wed Oct 6 14:31:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Avoid leaking memory when
gtk_rc_init is called multiple times. (Yes, people who
do that have bugs in their code.)
Tue Oct 5 11:36:57 PDT 1999 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: listing gtkrc in gtkconf_DATA seems to barf.
Remove it since it's generated by the Makefile anyway
Tue Oct 5 02:43:41 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputcommon.h (gdk_input_device_new): Free
device->info.axes for core pointer.
Thu Sep 30 13:55:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (destroy_idle_test): Rename idle to
idle_id, to deal with obsolete, broken C libraries.
Mon Sep 27 02:50:15 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkvscale.c (gtk_vscale_draw): Don't add in
allocation->x/y twice!
* gtk/gtkhscale.c: Make usage of gtk_hscale_pos_trough()
consistent with gtk_vscale_pos_trough().
Sun Sep 26 19:44:34 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_queue_resize): We may
be queueing a resize on a toplevel container between
the time we show it and when we map it. So, we need
to test GTK_WIDGET_VISIBLE() for toplevels, and only
use GTK_WIDGET_DRAWABLE() for child windows.
Thu Sep 23 16:41:03 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDADDS): Add GDK_WLIBS to LDADDS
(fixes bug #2144)
Fri Sep 24 00:51:45 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c (gtk_container_queue_resize): check for
container DRAWABLE (instead of VISIBLE), so we don't queue
resizes on non-toplevel containers.
Sun Sep 19 18:13:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.[ch]: Make the data argument
const guchar *.
Sat Sep 18 21:27:40 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: Try to behave sensibly if
the focus widget is the window itself. (Should
we allow this at all?)
Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_set_sensitive):
* gtk/gtknotebook.c (gtk_notebook_set_scrollable):
* gtk/gtknotebook.c (gtk_notebook_set_show_border):
* gtk/gtkclist.c (gtk_notebook_set_show_border): make gboolean args
in prototypes and implementations consistent (Tomas Ogren).
* gtk/gtklayout.c (gtk_layout_remove): unset GTK_IS_OFFSCREEN flag
before the widget is unparented (reported by damon).
* gtk/gtkdnd.c: make the cursor and icon data _unsigned_ char,
since we provide unsigned data anyways.
Thu Sep 16 21:32:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_set_tip): Delay
the call to gtk_tooltips_layout_text() until later.
* gtk/gtktooltips.c (gtk_tooltips_draw_tips):
Call gtk_widget_ensure_style() before using the style.
Wed Sep 15 02:52:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_event): Added workaround
for old widgets that don't propagate draws to all
children. (Namely gnome-dock for gnome-libs <= 1.0.16)
Tue Sep 14 19:22:19 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_queue_resize): don't queue the parent
for a redraw but just the widget that requested the resize.
Tue Sep 14 18:29:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c: added new widget level method
gtk_container_set_reallocate_redraws() and a GtkContainer flag
reallocate_redraws : 1 to reflect the setting, exported this through
the argument system as a boolean ::reallocate_redraws.
* gtk/gtkwidget.c (gtk_widget_size_allocate): when queueing redraws
on the widget because the allocation changes, do so as well for
widget->parent if the parent has reallocate_redraws set to TRUE.
with that containers requesting reallocation redraws get automatically
redrawn if their children changed allocation (this unfortunately
affects also other children that didn't change allocation, but we
cannot work around that before 1.3).
Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_idle_draw): only emit ::draw if width
_and_ height are >0 (not _or_).
* gtk/gtktable.c (gtk_table_remove): use gtk_widget_queue_resize()
instead of gtk_container_queue_resize(), which is a core gtk internal
function (must have been on crack when i queued that).
* gtk/gtkprivate.h: added new private flag GTK_FULLDRAW_PENDING, so
we can check more reliably if we want to discard expose events.
* gtk/gtkwidget.c: added setting/unsetting of the GTK_FULLDRAW_PENDING
flag.
* gtk/gtkwidget.c (gtk_widget_event): don't discard synthesized exposes,
we simply trust these events. for deciding whether to discard exposes,
check GTK_FULLDRAW_PENDING instead of RESIZE_PENDING.
Mon Sep 13 15:01:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore
queues of areas that are completely off screen.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fix broken
logic for handleboxes.
* gtk/gtkwidget.c (gtk_widget_queue_draw_data): Add santity
check on width/height.
Mon Sep 13 02:22:47 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: backed out Raja's recent VPATH build "improvements",
we are fine with using $@ the way we do (if we actually encounter
brokeness with $@ in VPATH builds because of additional path prefixes,
we need to use $(@F) actually).
Mon Sep 13 01:34:53 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c: renamed two variables, hopefully didn't introduce
short lived bugs, that would allow language bindings to do surgeries
to our guts.
Fri Sep 10 15:22:50 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_size_allocate): Fix typo
where comparison was being done against an uninitialized
value causing intermittant results depending on
compiler flags. Also make it clearer that we aren't
ever initializing the child as 0x0 (though this will
be caught in gtk_widget_size_allocate())
Fri Sep 10 10:06:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_transient_for): Move
gtk_window_unset_transient_for() call after we do checks
involving the old transient parent.
[ From Lance Capser <lmc@cyberhighway.net> ]
1999-09-07 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gtk.defs): Go back to using `touch' to create
an empty file.
Mon Sep 6 00:11:56 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (gtk_ctree_is_ancestor): return FALSE if node has
no children. (Reported by: Chris Rogers <gandalf@pobox.com>)
1999-09-03 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gen_sources): Improve VPATH builds.
`$@' is valid only in the build dir, not after we've done
`cd $srcdir'. Also use `test -f' instead of less portable
`test -e'.
Fri Sep 3 15:59:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (correct_cache_insert): Rewrite
for simplicity, and hopefully correctness.
(Fixes bug #1322, which was a segfault when
on some insertions with the properties around
the insertion set up just wrong.)
* gtk/gtktext.c (gtk_text_adjustment): When we receive
a "changed" signal, clamp the new value to the adjustment
bounds to avoid segfaulting if someone tries to change
the adjustment to a bogus value. (Bug #1795)
Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c: Ignore unexpected destroy notifies
for children, for toplevel windows handle them
like delete_event.
* gtk/gtkplug.c: Add an unrealize handler so that
we unref plug->socket_window when we are done
with it.
Fri Sep 3 14:52:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_area): Fix stupid signedness
problem that was causing background to sometimes
be misaligned.
Fri Sep 3 12:26:33 1999 Owen Taylor <otaylor@redhat.com>
[ Fixes pointed out by Ettore Perazzoli <ettore@comm2000.it> ]
* gtk/gtkmenu.c (gtk_menu_position): Make
sure we never position menus with negative x, y,
since gtk_widget_set_uposition() can't handle that.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu):
Modify the positioning code a bit so that we always
put the top-left corner onscreen. (This is for
UI reasons, gtk_menu_position() now takes care of
gtk_widet_set_uposition() brokeness.)
Fri Sep 3 03:06:30 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: fixed up things for -jx, x > 1.
Sun Sep 5 08:48:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_style): Ref the
RC style that is passed in. The lack of the ref
before was a bug. If people worked around this
bug, this will introduce a slight memory leak
in their code. The code should typically look like:
rc_style = gtk_rc_style_new ();
[...]
gtk_widget_modify_style (widget, rc_style);
gtk_rc_style_unref (rc_style);
* gtk/gtkwidget.c (gtk_widget_modify_style): Reset
the style if it was already set.
* gtk/gtkwidget.c (gtk_widget_set_name): Only set the
style if it was set before.
Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (main): Add a check to see if we
are being run from the correct directory and
to quit nicely if we are not.
* gtk/gtkrc.c (gtk_rc_slist_remove_all): Make function
static.
Thu Sep 2 23:00:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkenums.h (GtkWindowPosition): added GTK_WIN_POS_CENTER_ALWAYS.
* gtk/gtkwindow.c:
queue resizes unconditionally (gtk_widget_queue_resize will figure
what to do if the window is not realized).
(gtk_window_move_resize): only recenter the window
for GTK_WIN_POS_CENTER_ALWAYS.
(gtk_window_compute_reposition): handle GTK_WIN_POS_CENTER_ALWAYS in
the same way as GTK_WIN_POS_CENTER.
Thu Sep 2 22:39:27 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_reposition): check for the last position
with (!(info->last_flags & GDK_HINT_POS)) instead of
(!info->last_flags & GDK_HINT_POS).
* gtk/gtkwindow.c (gtk_window_move_resize): constrain new_width and
new_height unconditionally, because we use these values even if
!default_size_changed && !hints_changed.
comented the (default_size_changed || hints_changed) case with
respect to resize rejects from the window manager.
* gtk/gtkwindow.c (gtk_window_move_resize): save info->last values
in the zvt condition hack, since this includes the window hints, set
the hints after the handling_resize case.
* gtk/gtkwindow.c (gtk_window_show): constrain the default size that a
window is initially shown with to the geometry.
Thu Sep 2 07:38:56 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize):
s/size_changed/default_size_changed/g so i know what's
really going on (frying brain on smaller flame now).
Thu Sep 2 05:47:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): queue a new resize if
we have size_changed upon handling_resize. this is a gross
workaround for the broken zvt widget and should be removed in
1.3 again (search for FIXME).
Owen provided an accurate comment for this:
/* We could be here for two reasons
* 1) We coincidentally got a resize while handling
* another resize.
* 2) Our computation of size_changed was completely
* screwed up, probably because one of our children
* is broken. It's probably a zvt widget.
*
* For 1), we could just go ahead and ask for the
* new size right now, but doing that for 2)
* might well be fighting the user (and can even
* trigger a loop). Since we really don't want to
* do that, we requeue a resize in hopes that
* by the time it gets handled, the child has seen
* the light and is willing to go along with the
* new size. (this happens for the zvt widget, since
* the size_allocate() above will have stored the
* requisition corresponding to the new size in the
* zvt widget)
*
* This doesn't buy us anything for 1), but it shouldn't
* hurt us too badly, since it is what would have
* happened if we had gotten the configure event before
* the new size had been set.
*/
Wed Sep 1 20:46:11 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: deal properly with the fact that RC
style lists may include rc styles more than once.
* gtk/gtkrc.c (gtk_rc_append_pixmap_path): Removed
unused static function.
* gtk/gtkrc.c (gtk_rc_find_pixmap_in_path): Keep a
stack of directories of RC files currently being
parsed and implicitely add them to pixmap path.
This fixes a bug where the directory would get
appended then overwritten by pixmap_path declarations.
(bug #1462, from Peter Wainright <prw@wainpr.demon.co.uk>)
* gtk/gtkthemes.c (gtk_theme_engine_unref): Call
theme's exit function. (Patch from Peter Wainwright,
bug #1454)
* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_destroy):
Add a destroy() handler to take care of removing
group for menu item. (Fixes bug #1197)
* gtk/gtkwidget.c (gtk_widget_size_request): Fixed thinko
in warning message.
Wed Sep 1 21:27:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): don't require a server
roundtrip to figure window's width and height, since we know that
anyways from widget->allocation.
Wed Sep 1 12:37:44 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Compute
the hints after we request the new size.
Wed Sep 1 10:38:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_compute_hints): Removed
GTK_WIDGET_REALIZED() assertion - we can compute the
hints before we are realized.
* gtk/gtkwindow.c (gtk_window_move_resize): Reorder
hint changing so that we have a value of hints_changed
when we decide whether to constrain the window size.
* gtk/gtkwindow.c (gtk_window_move_resize): Spelling fix.
* gtk/gtkwindow.c (gtk_window_constrain_size): cleanups,
change back to G_MAXINT.
Wed Sep 1 06:54:59 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_get_geometry_info): zero initialize
new GtkWindowGeometryInfo, so fields like GdkGeometry geometry
contain uncluttered values.
(gtk_window_compute_hints): simply assert that window is realized
and that geometry_info is valid, since we rely on this anyways.
(gtk_window_constrain_size): major cleanups to the code.
if (flags & GDK_HINT_BASE_SIZE) use geometry's base width and height
for the base size, instead of the minimums. use 32767 as max width
and height (like in gtkwindow.c) instead of G_MAXINT.
Wed Sep 1 04:41:25 1999 Tim Janik <timj@gtk.org>
* cleaned up the GtkContainer.need_resize flag handling mess, we
only need to force resize requests when we were prematurely
realized, or our widget tree was modified when we were temporarily
hidden. handling these cases directly upon showing the window (i.e.
while the GdkWindow is still unmapped) avoids the need to wait for
a configure event response and therefore makes the GUI more snappier
and avoids blank windows during the roundtrip.
* gtk/gtkwidget.c:
(gtk_widget_hide):
(gtk_widget_show): don't queue resizes on toplevels, they know how
to deal with matters.
* gtk/gtkcontainer.c (gtk_container_queue_resize): set the ->need_resize
flag directly for not visible resize containers and spare us unecessary
signal emissions.
* gtk/gtkwindow.c:
(gtk_window_realize): if we need to enforce premature size allocation,
queue a container resize so we are correctly resized later on.
(gtk_window_init):
(gtk_window_size_request):
don't freak around with the ->need_resize flag,
gtk_container_queue_resize() will care about that.
(gtk_window_show):
handle initial resizing issues here, we can handle matters better in
this place, especially since we know that our GdkWindow is still
unmapped.
(gtk_window_move_resize):
don't care about ->need_resize at all.
handle size changes properly that occoured while we waited for a
configure event.
Tue Aug 31 15:58:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_uposition):
* gtk/gtkwindow.[hc] (gtk_window_reposition):
Move the hint setting code from gtk_widget_set_uposition
to here; set the hints so that we respect any previously
set geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Don't
change the window hints here or move the window here,
let that happen in gtk_window_move_resize().
Tue Aug 31 06:58:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): when discarding exposes due
to already queued resizes (and therefore redraws) on a widget, check
its anchestry as well.
* gtk/gtkcontainer.c:
(gtk_container_queue_resize): clear resize widgets for resize
containers before aborting prematurely. this is especially important
for toplevels which may need imemdiate processing or their resize
handler to be queued.
(gtk_container_dequeue_resize_handler): added new internal function for
gtkwindow.c.
* gtk/gtkwindow.c (gtk_window_move_resize): if we are resizing due to a
configure event, take possible changes in window position into account
as well.
if we request a new window size, queue up a resize handler that will
last until the configure event response arrives.
combined the ->need_resize case (initial show) with the general size
(hints) changed case and added even more comments.
if !auto_shrink, only revert to the old allocation if the new size
is smaller than the current allocation.
Tue Aug 31 11:55:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_arg, gtk_window_set_policy,
gtk_window_set_geometry_hints
gtk_window_set_default_size):
When hints are set, queue a resize so that the hints will
be eventually reset on the toplevel.
* gtk/gtkwindow.c (gtk_window_show): Use
gtk_window_compute_default_size(). Clear the need_resize flag
on the initail map so that we don't unnecessarily trigger the
resize code.
* gtk/gtkwindow.c (gtk_window_move_resize): Split apart
into separate functions. Compare the hints we are setting
with what we set last time so that we can accurately
tell when we need to reset the hints.
* gtk/gtkwindow.c (gtk_window_compute_default_size): New
function to figure out the size from requisition
and default_size.
* gtk/gtkwindow.c (gtk_window_constrain_size): Function
from fvwm to constrain a size to the geometry hints.
* gtk/gtkwindow.c (gtk_window_compare_hints): New function
to compare two sets of geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_hints): Renamed
from gtk_window_set_hints(), just compute the hints,
don't set them.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Move
code from gtk_window_move_resize() to separate function,
rationalize a bit.
Tue Aug 31 13:05:03 1999 Owen Taylor <otaylor@redhat.com>
* gtkrc.h: Move the ref_count member out of the GtkRcStyle
structure into a new private structure.
* gtkrc.c: Split GtkRcStyle into public/private.
In the private part, add a list of pointers to the
RcStyle lists this RcStyle participates in.
* gtkrc.c: When a RcStyle is free, remove all
lists referencing it from the
realized_style_ht hash, and free those lists.
* gtk/gtkrc.c (gtk_rc_clear_styles): Don't call
gtk_rc_init(), since that adds the default styles
to the list of parsed RC files again.
* gtk/gtkrc.c: Use gtk_rc_style_find() consistently.
Thu Aug 26 14:14:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): reactivated the sanity
checks that ensure that a widget's allocation is at least 1 in width
and height. (GNOME note: this doesn't affect old panel code anymore,
because GtkSocket will request width and height of at least 1 since
Fri Jul 23).
* gtk/gtkwindow.c (gtk_window_realize): if the widget hasn't been
allocated yet (happens if the user realizes the window prematurely),
size request and allocate it.
(gtk_window_size_allocate): guard against guint underflows.
Wed Aug 25 19:01:36 1999 Lars Hamann <lars@gtk.org>
* gtk/Makefile.am (gtk_built_sources): reordered stamp-gtk.defs
in gtk_built_sources, so gtk.defs gets built prior to all other
sources.
Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am:
invoke indent on gtkmarshal.*.
rewrote source generation rules, use COPYING as oldest source tag for
a piggyback rule to generate all sources from (don't touch it ;).
major cleanups, strip spaces on build rules for GNU Make.
* gtk/genmarshal.pl: don't operate on hardcoded filenames but take
source and target files from commandline arguments. don't invoke indent.
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Wed Aug 18 09:20:10 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c:
we use window->need_resize from configure_event now, to indicate that
the gtkwindow should keep its allocation (e.g. because the user resized
the window through window manager handles). resize_count is now reliably
used to figure whether we got the allocation we requested from the
window manager.
configure events get queued as resizes now, the real stuff (size
computation and allocation) now only goes on in gtk_window_move_resize().
GtkWindow's requisition now contains its *real* requisition (like all
other widgets), *not* taking usize into account.
geometry_info->last_{width|height} is now updated from set_hints() only
so it always contains the last hints we set for the window manager.
made some event handlers return TRUE instead of FALSE.
the overall code should be much more straight forward now, and the
significant code portions are accompanied by comments now.
(gtk_window_set_hints):
removed requisition argument and made it
fetch the requisition through gtk_widget_get_child_requisition.
we also don't move the gdkwindow here anymore, gtk_window_move_resize()
does that now.
(gtk_window_show):
ensure that the widget is realized before calling
gtk_container_check_resize() (and thus gtk_window_move_resize()), also
ensure that we got properly size requested and allocated before
realization.
(gtk_window_configure_event):
ignore plain window moves, or reallocate the widget tree through the
resize queue otherwise.
(gtk_window_move_resize):
mostly rewrote this function to figure window manager hints more
reliably, coalesce window moves and resizes to reduce configure events
and do actuall size allocations.
Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): discard expose events for widgets
that have a resize pending, because a redraw is already queued for them.
* gtk/gtkcontainer.c: removed ugly connect_to ::size_allocate signal
hack to clear resize_widgets.
* gtk/gtkwidget.c (gtk_widget_size_allocate): call clear_resize_widgets
for resize containers prior to size allocation. (this is also a bit
ugly, but avoids side effects for stopped emissions and is thus more
reliable).
(gtk_widget_unparent): removed disconnect call for clear_resize_widgets.
* gtk/gtktooltips.c (gtk_tooltips_paint_window): renamed this
function from gtk_tooltips_expose, as we connect to ::expose_event
*and* ::draw now.
1999-08-18 Federico Mena Quintero <federico@redhat.com>
* gtk/gtkselection.c (gtk_target_list_ref): Added missing sanity
checks.
(gtk_target_list_unref): Likewise.
* gtk/gtkthemes.c (gtk_theme_engine_unref): Likewise.
Tue Aug 17 15:47:07 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_draw_value_bar):
guard against division by zero. (Fixes bug #1339)
Tue Aug 17 10:56:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_move_{forward,backward}_word):
Prevent the trivial leak of information of allowing
word motion when the entry is not visible.
Tue Aug 17 10:28:52 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_fileop_error): Propagate
modality to error dialog as well as confirmation dialogs.
(Bug #1803, reported by Rosanna Wing Sze Yuen)
Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktreeitem.c (gtk_tree_item_draw_lines): Honor
tree->view_lines.
(gtk-guy-990611-3.patch: Guy Harris <guy@netapp.com>)
* gtk/Makefile.am (install-data-local): Solaris apparently
has various troubles with ln -f; use rm first instead.
(gtk-guy-990611-2.patch: Guy Harris <guy@netapp.com>)
1999-07-30 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (stamp-m): Don't `mv' from builddir to srcdir,
use `cp' followed by `rm' (the `rm' was already there).
July 30, 1999 Elliot Lee <sopwith@redhat.com>
* configure.in: Fix autoconf warnings about cross compilation by
trying to provide sane defaults for AC_TRY_RUN.
* gtk/Makefile.am: If we refer to gtkmarshal.[ch] in $(srcdir),
put them into $(srcdir) when generated. Also add a dependency of
gtksignal.h on gtkmarshal.h for -j builds.
* gtk/gtk(dnd,style,gamma).c: Minor warning fixes.
Wed Jul 28 09:29:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration_do): Added missing
GDK_THREADS_{LEAVE,ENTER} pair.
(From Paul Fisher <pnfisher@redhat.com>)
Fri Jul 23 01:00:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtksocket.c (gtk_socket_size_request): asure that the requested
width and height are always >0 (owen).
Fri Jul 23 00:00:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): backed out my recent
change that assured that a widget's allocated with and height are
always >1, since this breaks *buggy* panel code. unfortunately this
back-breaks the gimp's color selector.
* gtk/gtkdrawingarea.c (gtk_drawing_area_size_allocate): asure that our
allocation is always >0 in width and height, before sending the
configure event; this is a *gross* hack to get the gimp back to work.
* marked both cases with TODO-1.3
Wed Jul 21 15:47:39 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Don't display wrap indicators when
text is not editable and word wrap is on.
Wed Jul 21 08:21:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): special case
option menus here as they are not derived from menu shell, assure that
the option menu has a menu we can add items to.
Tue Jul 20 23:29:48 1999 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_page_allocate): convert allocation->
width/height to (gint) before calculations and check against < 0 to
avoid guint wraparounds.
Sun Jul 18 00:35:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): ensure that the allocated
width and height is never zero. sanity check both dimensions against
32767 and issue a warning if the allocation is greater than that.
Wed Jul 7 15:03:30 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_events_pending): Unlock around call
to g_main_pending() as well.
Wed Jul 7 14:59:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration): Unlock around
call to g_main_iteration() - since that will regrab
GTK+ lock to process events.
Thu Jul 1 15:01:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c
- Regularize with the rest of GTK+ by making widget->requisition
not reflect the set_usize()
- Always recompute geometry hints, then check if they
changed before sending them to the X server. The
previous checks for changes would fail in a number
of circumstances.
Thu Jul 1 11:55:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Include <stdlib.h> for strcmp().
Wed Jun 30 19:26:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c:
- Code cleanups
- Instantaneously update on modifier key presses
- Allow cancellation of the drag with Escape.
Tue Jun 29 17:04:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_handle_box): Set the policy
to auto_shrink - otherwise the appearance is rather
strange when flipping between horizontal and vertical.
Mon Jun 28 09:29:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: add ::default_width and ::default_height arguments.
(gtk_window_set_default_size): don't change a value if it's < 0.
queue a resize.
Sun Jun 27 11:00:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_insert): don't segfault on NULL inserts.
Mon Jun 28 12:08:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (cmpl_completion_fullname): Don't
add an extra "/" when concating "/" + filename.
(From Matt Grossman <mattg@oz.net>)
Mon Jun 28 10:57:12 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (draw_cell_pixmap): Reset clip mask
for fg_gc if we set it for drawing pixmap.
Tue Jun 15 12:45:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes from Peter Wainwright <prw@wainpr.demon.co.uk>
* gtk/gtkrc.c (gtk_rc_parse_engine): If rc_style->engine is
already set, call old engine's destroy function and
unref the old engine.
Thu Jun 10 17:59:38 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.c (gtk_drawing_area_size): queue a resize.
Wed Jun 9 15:13:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h: mark certain functions as internal.
Wed Jun 9 13:48:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpreview.c (gtk_preview_set_expand): queue a resize if the
expand behaviour changed.
* gtk/gtklabel.c (gtk_label_set_pattern):
(gtk_label_set_justify):
(gtk_label_set_line_wrap):
don't bother invoking queue_clear, the reallocation does
that for us, always free_words so the upcoming resize will
relayout the label's contents.
Wed Jun 9 12:50:48 1999 Tim Janik <timj@gtk.org>
* applied argument implementation patches from Elena Devdariani
<elena@cogent.ca>.
* gtk/gtktoolbar.c: ::orientation, ::toolbar_style, ::space_size,
::space_style, ::relief
* gtk/gtkruler.c: ::lower, ::upper, ::position, ::max_size
* gtk/gtkpreview.c: ::expand
* gtk/gtkpaned.c: ::handle_size, ::gutter_size
* gtk/gtknotebook.c: ::homogeneous
* gtk/gtklabel.c: ::wrap
* gtk/gtklist.c: ::selection_mode
* gtk/gtkhandlebox.c: ::handle_position, ::snap_edge
* gtk/gtkcurve.c: ::curve_type, ::min_x, ::max_x, ::min_y, ::max_y
* gtk/gtkcolorsel.c: ::update_policy, ::use_opacity
* gtk/gtkclist.c: ::sort_type
* gtk/gtkcheckmenuitem.c: ::active, ::show_toggle
* gtk/gtkaspectframe.c: ::xalign, ::yalign, ::ratio, ::obey_child
Tue Jun 1 23:38:38 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Removed ill-thought-out part of last
comment.
Tue Jun 1 23:30:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_attach): Get the reference
counting right when we have to attach a new style
for a different visual. (Chi-Deok Hwang <cdhwang@sr.hei.co.kr>)
* gtk/gtkstyle.c: Documented the refcounting
peculularities of gtk_style_attach.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkwindow.c (gtk_window_new): added return if fail for invalid
window types.
* examples/packer/pack.c (main): use GTK_WINDOW_TOPLEVEL instead
of GTK_TOPLEVEL for creating the window.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkmain.c (gtk_init_check): don't segfault when --gtk-module is
the last argument (reported by Per Winkvist).
Tue May 25 13:13:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes for invisible XOR lines (Frank Loemker
<floemker@TechFak.Uni-Bielefeld.DE>)
* gtk/gtkclist.c (gtk_clist_realize): Always use
a non-zero pixel for GDK_XOR.
* gtk/gtkvpaned.c gtk/gtkhpaned.c:
Use GDK_INVERT instead of GDK_XOR.
Wed May 12 21:56:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (adjust_adjustments): signal emit value_changed
signals if h/voffsets differ from adjustment values.
Reportet by Jerome Bolliet <bolliet@in2p3.fr>
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
the user data on the window before destroying it.
* gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
unrealize handler to take care of destroying
notebook->panel properly.
(Bug #1198 - Morten Welinder <terra@diku.dk>)
* gtk/gtktext.c (expand_scratch_buffer): Fix reversal
of g_new and g_realloc to stop memory leak. (Actually,
we could just use g_realloc(), but I'm not 100% sure
that is portable).
(Bug #1196 - Morten Welinder <terra@diku.dk>)
Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.h: Removed stray GtkPlugButton declaration.
* gdk/gdkfont.c (gdk_text_measure): Fix the return value
for fontsets.
* gtk/gtkbutton.c (gtkbutton_expose): Fix warning
with bin/button confusion.
Thu May 6 04:53:26 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: in the ItemFactory test, link radio items together,
and show how preselection of radio items is done.
Sun May 2 13:31:14 1999 Tim Janik <timj@gtk.org>
* gtk/gtktreeitem.c (gtk_tree_item_set_subtree):
* gtk/gtktree.c (gtk_tree_add) (gtk_tree_insert):
* gtk/gtktoolbar.c (gtk_toolbar_insert_element):
* gtk/gtkpaned.c (gtk_paned_pack2) (gtk_paned_pack1):
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_add):
* gtk/gtktable.c (gtk_table_attach):
* gtk/gtklist.c (gtk_list_insert_items):
* gtk/gtkmenushell.c (gtk_menu_shell_insert):
* gtk/gtknotebook.c (gtk_notebook_insert_page_menu):
* gtk/gtkpacker.c (gtk_packer_add_defaults) (gtk_packer_add):
* gtk/gtkbin.c (gtk_bin_add):
* gtk/gtkbox.c (gtk_box_pack_start) (gtk_box_pack_end):
* gtk/gtkfixed.c (gtk_fixed_put):
* gtk/gtklayout.c (gtk_layout_put):
general fixups to container_add logic. always realize child if
child->parent is realized, only map the child and queue a resize
if child and child->parent are both visible.
Fri Apr 30 09:02:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_unrealize): use gtk_container_forall
instead of gtk_container_foreach to walk and unrealize children, so
composite children get also unrealized.
(gtk_widget_real_show): don't call gtk_widget_map() if we don't need to.
(gtk_widget_map): assert that the widget is visible (basic constrain).
(gtk_widget_real_map): assert that the widget is realized (basic
constrain).
Fri Apr 29 00:53:20 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbindings.c (gtk_pattern_spec_init): plugged a memory leak.
Tue May 4 09:32:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc.iso-8859-2: Add a gtkrc
file for iso-8859-2 locales.
* configure.in (ALL_LINGUAS): ALL_LINGUAS update.
Tue Apr 27 16:38:32 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Fix typo of static_sources for static_SOURCES.
(Pointed out by andy@rz.uni-karlsruhe.de and others).
Remove some suspicious and useless lines.
Tue May 4 08:44:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c (gtk_clist_draw, draw_rows): Use
width,height = 0, 0 to mean - here to edge of window,
instead of -1, -1, since the former is all we support.
Tue May 4 08:34:43 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main): Correctly free list nodes
when removing from quit_functions list.
Tue Apr 27 14:17:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpacker.c (gtk_packer_size_request): remove unused variable.
Tue Apr 27 18:23:35 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable):
When redrawing characters on non-visible entry, use appropriate
'*' character. (Bug #1130 - Jean-Marc Jacquet <jm@littleigloo.org>)
Tue Apr 27 01:31:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (drag_dest_cell): compute destination cell
from drag coordinates.
(gtk_clist_drag_data_received) (gtk_clist_drag_motion):
use drag_dest_cell.
* gtk/gtktree (drag_dest_cell)
(gtk_ctree_drag_data_received) (gtk_ctree_drag_motion): likewise.
(Bug #1129)
Wed Apr 21 21:26:11 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_init): properly initialize
translate_* fields.
(gtk_item_factory_finalize): invoke translate_notify independant from
translate_data.
(gtk_item_factory_set_translate_func): likewise.
(gtk_item_factory_destroy): only remove ifactory pointer from those
widgets that belong to us (stupid me).
Mon Apr 19 12:05:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Fixed leak of
rc_style list when lookup succeeeds.
Thu Apr 15 01:11:24 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (resync_selection):
* gtk/gtkclist.c (resync_selection): fixed undo_selection bug.
* gtk/gtkclist.c (gtk_clist_button_release): fixed resync_selection
bug.
Fri Apr 9 19:22:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c gtk/gtkdnd.c gtk/gtkmenuitem.c:
Add some missing GDK_THREADS_ENTER()/LEAVE around
timeouts. (Patches from Sebastian Wilhelmi <wilhelmi@ira.uka.de>)
Thu Apr 8 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkentry.c (gtk_entry_key_press): use gtk_widget_activate()
rather than emit_by_name.
* gtk/gtkeditable.c (gtk_editable_insert_text): keep a reference
on the widget across multiple signal emissions.
(gtk_editable_delete_text): same here.
(gtk_editable_class_init): set widget_class->activate_signal after
editable_signals[ACTIVATE] has been created.
Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
position here prematurely -- we might not have the
right ->min_position and ->max_position yet.
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
Add error traps so if the other end of the connection
dies, we survive.
* gtk/gtkselection.c (gtk_selection_notify): Clean
up properly when selection property retrieval fails.
* gtk/gtkselection.c (gtk_selection_request): Correctly
reject SelectionRequest notifies where the handler
returns no data.
Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_dest_leave): Only unhighlight
when we've previously highlighted.
* gtk/gtkdnd.c (gtk_drag_dest_handle_event): Don't
emit two "drag_leave" signals for Motif drops.
* gtk/gtkdnd.c (gtk_drag_source_handle_event): Send
back the correct status messages when dropping from
Motif onto a proxy window that is rejecting the
drop.
Sat Mar 27 23:32:13 1999 Tim Janik <timj@gtk.org>
* gtk/gtkarg.[hc]: added functions from GLE, gtk_arg_reset() to free
the value and reset type to GTK_TYPE_INVALID, and gtk_arg_values_equal()
to compare two argument values. added gtk_arg_to_valueloc() to set a
variable from an arg through its location (pointer).
* gtk/gtkobject.[hc]: implemented gtk_object_get() in terms of
gtk_object_arg_get() and gtk_arg_to_valueloc(), floats are collected
as gfloat*, uchars are collected as guchar*, ints are collected as
gint*, etc...
Mon Mar 29 17:45:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccelgroup.c gtk/gtkgtkbindings.c:
Include <string.h> instead of <strings.h>.
* gtk/gtkstyle.c: Fix double include of gtkthemes.h
(actually, a lot more duplicate includes occur if
you trace through the sequence of #include's)
gtk-jbb-990320-0: John Bley, jbb6@acpub.duke.edu
Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com>
Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp>
gtk-a-higuti-990322-[0-3]
* configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS
that was causing -DX_LOCALE not to work.
* gtk/gtkrc.c (gtk_rc_init):
X_LOCALE will never have LC_MESSAGES defined
Thu Mar 25 12:38:31 1999 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_append_default_module_path): get $HOME from
g_get_home_dir() (gtk-pmc-990123-0.patch.gz).
* gtk/gtkwindow.c (gtk_window_key_press_event): feature keypad up/down/
left/right as well (gtk-michael-980726-0.patch.gz).
* gtk/gtklabel.[hc]: bunch of miscellaneous cleanups, such as s/0/NULL/
for pointer values, use gchar instead of char. fixed uline allocation
leaks, changed the allocation pattern so we use G_ALLOC_AND_FREE mem
chunks instead of G_ALLOC_ONLY.
(gtk_label_size_request): always alter requisition as passed and leave
widget->requisition alone.
(gtk_label_set_text): allow NULL strings.
(gtk_label_new): likewise.
Wed Mar 24 09:24:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.[hc]: type/macro fixups.
Mon Mar 22 05:51:34 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbin.c (gtk_bin_draw): only redraw children that are visible
*and* mapped (i.e. drawable).
(gtk_bin_expose): only send exposes to drawable children.
* gtk/gtkbox.c (gtk_box_draw): only redraw children that are drawable.
(gtk_box_expose): only send exposes to drawable children.
* gtk/gtkhscale.c (gtk_hscale_draw):
* gtk/gtkvscale.c (gtk_vscale_draw):
hm, this is an ugly one. we first compute the size of our trough area
here (window relative) and then check intersection with the draw_area
which is parent relative because we're a NO_WINDOW widget, so we need
to offset the trough area by allocation.x and allocation.y before the
check. (this must not be done for the background area though, since
that's already computed parent relative).
Mon Mar 22 00:41:39 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_unrealize): unmap clist if neccessary,
unrealize title buttons.
Fri Mar 19 00:00:22 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_column_title_passive)
(gtk_clist_column_title_active):
only connect/disconnect to GtkWidgetClass::event to block mouse events.
* gtk/gtkclist.c (vertical_timeout) (horizontal_timeout):
zero initialize event, removed superfluous gdk_window_get_pointer call
* gtk/gtklist.c (gtk_list_vertical_timeout)
(gtk_list_horizontal_timeout): removed superfluous
gdk_window_get_pointer call
Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org>
* plugging problems reported by "Bruce Mitchener, Jr."
<bruce@puremagic.com> due to a purify session.
* gtk/gtkstyle.c:
(gtk_style_ref):
(gtk_style_unref): assert ref_count to be > 0.
* gtk/gtkclist.c (gtk_clist_set_cell_style): { 0 } initilaize
the requisition.
(gtk_clist_set_shift): likewise.
* gtk/gtklayout.c: introduce gtk_layout_finalize() to unref the
adjustments.
* gtk/gtklist.c (gtk_list_horizontal_timeout): zero initialize the
event before sending it and set send_event to TRUE (which needs to
be done for *all* synthesized events).
(gtk_list_vertical_timeout): likewise.
* gtk/gtktipsquery.c (gtk_tips_query_destroy): plug small memory
leaks.
* gtk/gtkdrawingarea.c (gtk_drawing_area_send_configure): set send_event
to TRUE when synthesizing events.
[ *** end of merges from 1.2 *** ]
1999-11-22 21:52:50 +00:00
|
|
|
case ARG_SORT_TYPE:
|
|
|
|
gtk_clist_set_sort_type (clist, GTK_VALUE_ENUM (*arg));
|
1998-11-05 15:44:22 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_clist_get_arg (GtkObject *object,
|
|
|
|
GtkArg *arg,
|
|
|
|
guint arg_id)
|
|
|
|
{
|
|
|
|
GtkCList *clist;
|
|
|
|
|
|
|
|
clist = GTK_CLIST (object);
|
|
|
|
|
|
|
|
switch (arg_id)
|
|
|
|
{
|
1999-02-18 00:35:11 +00:00
|
|
|
guint i;
|
|
|
|
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
case ARG_N_COLUMNS:
|
|
|
|
GTK_VALUE_UINT (*arg) = clist->columns;
|
|
|
|
break;
|
|
|
|
case ARG_SHADOW_TYPE:
|
|
|
|
GTK_VALUE_ENUM (*arg) = clist->shadow_type;
|
1998-11-05 15:44:22 +00:00
|
|
|
break;
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
case ARG_SELECTION_MODE:
|
|
|
|
GTK_VALUE_ENUM (*arg) = clist->selection_mode;
|
|
|
|
break;
|
|
|
|
case ARG_ROW_HEIGHT:
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
GTK_VALUE_UINT (*arg) = GTK_CLIST_ROW_HEIGHT_SET(clist) ? clist->row_height : 0;
|
|
|
|
break;
|
|
|
|
case ARG_REORDERABLE:
|
|
|
|
GTK_VALUE_BOOL (*arg) = GTK_CLIST_REORDERABLE (clist);
|
|
|
|
break;
|
1999-02-18 00:35:11 +00:00
|
|
|
case ARG_TITLES_ACTIVE:
|
|
|
|
GTK_VALUE_BOOL (*arg) = TRUE;
|
|
|
|
for (i = 0; i < clist->columns; i++)
|
|
|
|
if (clist->column[i].button &&
|
|
|
|
!GTK_WIDGET_SENSITIVE (clist->column[i].button))
|
|
|
|
{
|
|
|
|
GTK_VALUE_BOOL (*arg) = FALSE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
case ARG_USE_DRAG_ICONS:
|
|
|
|
GTK_VALUE_BOOL (*arg) = GTK_CLIST_USE_DRAG_ICONS (clist);
|
1998-11-05 15:44:22 +00:00
|
|
|
break;
|
Adapt cast macros to standard.
Fri Nov 19 10:34:41 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkgamma.h: Adapt cast macros to standard.
[ Merges from 1.2 ]
Tue Nov 16 10:15:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_path):
If translation does not include a '/', use entire
translation instead of crashing.
Sun Oct 31 22:21:11 1999 Tim Janik <timj@gtk.org>
* docs/gtk_tut.sgml:
s/gtk_accel_group_attach/gtk_window_add_accel_group/.
Sat Oct 30 09:09:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_target_list_remove): Use
g_list_remove_link, not g_list_remove.
[ From Geert Bevin <gbevin@thunderstorms.org> ]
Sun Oct 24 07:41:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkclist.c (real_undo_selection): commented out g_print()
statement upon unselection (how the heck did that slip in?).
Sat Oct 23 03:03:08 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_freeze):
(gtk_text_thaw): undraw/draw cursor here to avoid unnecessary scrolling
in frozen state (and aparently crashes). patch provided by Anders
Melchiorsen <and@kampsax.dtu.dk>.
Sat Oct 23 02:53:20 1999 Tim Janik <timj@gtk.org>
* fix insensitive default/focus widget activation,
reported by Matt Goodall <mgg@isotek.co.uk>.
* gtk/gtkwindow.c (gtk_window_key_press_event):
(gtk_window_activate_default):
(gtk_window_activate_focus):
return handled=FALSE for actiavtion of insensitive default
widgets. return handled=TRUE for activation of insensitive
focus widgets. don't activate in either case.
Tue Oct 19 09:55:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk-config.in (lib_gtk): Switch order of @x_cflags@
and $glib_cflags to match library order and in the
theory that an old version of GLib is more likely to
be in the include directory for X then vice-versa.
(Bug #2776)
Tue Oct 19 09:46:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always use LC_CTYPE
to determine the locale for fontsets, not LC_MESSAGES;
the user may want English messages with a handling
for non-English languages. (LC_CTYPE=ru_RU LC_MESSAGES=fr_FR
will still be broken) (Bug #2891)
Tue Oct 19 20:36:42 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Fixed the wrong number of "*"'s.
Tue Oct 19 12:15:13 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Changed the Korean default fontset.
Fri Oct 8 02:32:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): Fix bug
where when scrolling to the left or top double exposes
were done, causing major slowdowns.
Thu Oct 7 18:31:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always normalize codeset
names to lowercase and alphanumeric, before looking
them up.
* gtk/Makefile.am: Install codeset variant gtkrc files
with normalized names.
Thu Oct 7 22:52:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_popup_with_data): even
popup menus when the menu is already visible, but its parent
is still hidden, (happens after tornoff window got hidden).
Thu Oct 7 11:09:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (install-data-local): Fix
a typo where gtkrc.vi_VN.tcvn5712 wasn't getting
deleted, causing error messages on install.
Thu Oct 7 11:03:06 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtk[hv]paned.c (gtk_{h,v}paned_draw): Redraw
the handle as well, since we now sometimes ignore
exposes on the handle while resizing.
Wed Oct 6 18:02:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_append_default_pixmap_path): Fix stupid
extra g_free introduced in one of the last one or two
commits.
Wed Oct 6 16:38:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc*: Make naming of gtkrc files
consistent, put each style that a gtkrc.* file creates
in a unique namespace, remove old files before installing.
Wed Oct 6 14:31:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Avoid leaking memory when
gtk_rc_init is called multiple times. (Yes, people who
do that have bugs in their code.)
Tue Oct 5 11:36:57 PDT 1999 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: listing gtkrc in gtkconf_DATA seems to barf.
Remove it since it's generated by the Makefile anyway
Tue Oct 5 02:43:41 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputcommon.h (gdk_input_device_new): Free
device->info.axes for core pointer.
Thu Sep 30 13:55:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (destroy_idle_test): Rename idle to
idle_id, to deal with obsolete, broken C libraries.
Mon Sep 27 02:50:15 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkvscale.c (gtk_vscale_draw): Don't add in
allocation->x/y twice!
* gtk/gtkhscale.c: Make usage of gtk_hscale_pos_trough()
consistent with gtk_vscale_pos_trough().
Sun Sep 26 19:44:34 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_queue_resize): We may
be queueing a resize on a toplevel container between
the time we show it and when we map it. So, we need
to test GTK_WIDGET_VISIBLE() for toplevels, and only
use GTK_WIDGET_DRAWABLE() for child windows.
Thu Sep 23 16:41:03 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDADDS): Add GDK_WLIBS to LDADDS
(fixes bug #2144)
Fri Sep 24 00:51:45 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c (gtk_container_queue_resize): check for
container DRAWABLE (instead of VISIBLE), so we don't queue
resizes on non-toplevel containers.
Sun Sep 19 18:13:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.[ch]: Make the data argument
const guchar *.
Sat Sep 18 21:27:40 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: Try to behave sensibly if
the focus widget is the window itself. (Should
we allow this at all?)
Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_set_sensitive):
* gtk/gtknotebook.c (gtk_notebook_set_scrollable):
* gtk/gtknotebook.c (gtk_notebook_set_show_border):
* gtk/gtkclist.c (gtk_notebook_set_show_border): make gboolean args
in prototypes and implementations consistent (Tomas Ogren).
* gtk/gtklayout.c (gtk_layout_remove): unset GTK_IS_OFFSCREEN flag
before the widget is unparented (reported by damon).
* gtk/gtkdnd.c: make the cursor and icon data _unsigned_ char,
since we provide unsigned data anyways.
Thu Sep 16 21:32:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_set_tip): Delay
the call to gtk_tooltips_layout_text() until later.
* gtk/gtktooltips.c (gtk_tooltips_draw_tips):
Call gtk_widget_ensure_style() before using the style.
Wed Sep 15 02:52:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_event): Added workaround
for old widgets that don't propagate draws to all
children. (Namely gnome-dock for gnome-libs <= 1.0.16)
Tue Sep 14 19:22:19 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_queue_resize): don't queue the parent
for a redraw but just the widget that requested the resize.
Tue Sep 14 18:29:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c: added new widget level method
gtk_container_set_reallocate_redraws() and a GtkContainer flag
reallocate_redraws : 1 to reflect the setting, exported this through
the argument system as a boolean ::reallocate_redraws.
* gtk/gtkwidget.c (gtk_widget_size_allocate): when queueing redraws
on the widget because the allocation changes, do so as well for
widget->parent if the parent has reallocate_redraws set to TRUE.
with that containers requesting reallocation redraws get automatically
redrawn if their children changed allocation (this unfortunately
affects also other children that didn't change allocation, but we
cannot work around that before 1.3).
Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_idle_draw): only emit ::draw if width
_and_ height are >0 (not _or_).
* gtk/gtktable.c (gtk_table_remove): use gtk_widget_queue_resize()
instead of gtk_container_queue_resize(), which is a core gtk internal
function (must have been on crack when i queued that).
* gtk/gtkprivate.h: added new private flag GTK_FULLDRAW_PENDING, so
we can check more reliably if we want to discard expose events.
* gtk/gtkwidget.c: added setting/unsetting of the GTK_FULLDRAW_PENDING
flag.
* gtk/gtkwidget.c (gtk_widget_event): don't discard synthesized exposes,
we simply trust these events. for deciding whether to discard exposes,
check GTK_FULLDRAW_PENDING instead of RESIZE_PENDING.
Mon Sep 13 15:01:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore
queues of areas that are completely off screen.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fix broken
logic for handleboxes.
* gtk/gtkwidget.c (gtk_widget_queue_draw_data): Add santity
check on width/height.
Mon Sep 13 02:22:47 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: backed out Raja's recent VPATH build "improvements",
we are fine with using $@ the way we do (if we actually encounter
brokeness with $@ in VPATH builds because of additional path prefixes,
we need to use $(@F) actually).
Mon Sep 13 01:34:53 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c: renamed two variables, hopefully didn't introduce
short lived bugs, that would allow language bindings to do surgeries
to our guts.
Fri Sep 10 15:22:50 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_size_allocate): Fix typo
where comparison was being done against an uninitialized
value causing intermittant results depending on
compiler flags. Also make it clearer that we aren't
ever initializing the child as 0x0 (though this will
be caught in gtk_widget_size_allocate())
Fri Sep 10 10:06:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_transient_for): Move
gtk_window_unset_transient_for() call after we do checks
involving the old transient parent.
[ From Lance Capser <lmc@cyberhighway.net> ]
1999-09-07 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gtk.defs): Go back to using `touch' to create
an empty file.
Mon Sep 6 00:11:56 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (gtk_ctree_is_ancestor): return FALSE if node has
no children. (Reported by: Chris Rogers <gandalf@pobox.com>)
1999-09-03 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gen_sources): Improve VPATH builds.
`$@' is valid only in the build dir, not after we've done
`cd $srcdir'. Also use `test -f' instead of less portable
`test -e'.
Fri Sep 3 15:59:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (correct_cache_insert): Rewrite
for simplicity, and hopefully correctness.
(Fixes bug #1322, which was a segfault when
on some insertions with the properties around
the insertion set up just wrong.)
* gtk/gtktext.c (gtk_text_adjustment): When we receive
a "changed" signal, clamp the new value to the adjustment
bounds to avoid segfaulting if someone tries to change
the adjustment to a bogus value. (Bug #1795)
Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c: Ignore unexpected destroy notifies
for children, for toplevel windows handle them
like delete_event.
* gtk/gtkplug.c: Add an unrealize handler so that
we unref plug->socket_window when we are done
with it.
Fri Sep 3 14:52:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_area): Fix stupid signedness
problem that was causing background to sometimes
be misaligned.
Fri Sep 3 12:26:33 1999 Owen Taylor <otaylor@redhat.com>
[ Fixes pointed out by Ettore Perazzoli <ettore@comm2000.it> ]
* gtk/gtkmenu.c (gtk_menu_position): Make
sure we never position menus with negative x, y,
since gtk_widget_set_uposition() can't handle that.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu):
Modify the positioning code a bit so that we always
put the top-left corner onscreen. (This is for
UI reasons, gtk_menu_position() now takes care of
gtk_widet_set_uposition() brokeness.)
Fri Sep 3 03:06:30 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: fixed up things for -jx, x > 1.
Sun Sep 5 08:48:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_style): Ref the
RC style that is passed in. The lack of the ref
before was a bug. If people worked around this
bug, this will introduce a slight memory leak
in their code. The code should typically look like:
rc_style = gtk_rc_style_new ();
[...]
gtk_widget_modify_style (widget, rc_style);
gtk_rc_style_unref (rc_style);
* gtk/gtkwidget.c (gtk_widget_modify_style): Reset
the style if it was already set.
* gtk/gtkwidget.c (gtk_widget_set_name): Only set the
style if it was set before.
Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (main): Add a check to see if we
are being run from the correct directory and
to quit nicely if we are not.
* gtk/gtkrc.c (gtk_rc_slist_remove_all): Make function
static.
Thu Sep 2 23:00:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkenums.h (GtkWindowPosition): added GTK_WIN_POS_CENTER_ALWAYS.
* gtk/gtkwindow.c:
queue resizes unconditionally (gtk_widget_queue_resize will figure
what to do if the window is not realized).
(gtk_window_move_resize): only recenter the window
for GTK_WIN_POS_CENTER_ALWAYS.
(gtk_window_compute_reposition): handle GTK_WIN_POS_CENTER_ALWAYS in
the same way as GTK_WIN_POS_CENTER.
Thu Sep 2 22:39:27 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_reposition): check for the last position
with (!(info->last_flags & GDK_HINT_POS)) instead of
(!info->last_flags & GDK_HINT_POS).
* gtk/gtkwindow.c (gtk_window_move_resize): constrain new_width and
new_height unconditionally, because we use these values even if
!default_size_changed && !hints_changed.
comented the (default_size_changed || hints_changed) case with
respect to resize rejects from the window manager.
* gtk/gtkwindow.c (gtk_window_move_resize): save info->last values
in the zvt condition hack, since this includes the window hints, set
the hints after the handling_resize case.
* gtk/gtkwindow.c (gtk_window_show): constrain the default size that a
window is initially shown with to the geometry.
Thu Sep 2 07:38:56 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize):
s/size_changed/default_size_changed/g so i know what's
really going on (frying brain on smaller flame now).
Thu Sep 2 05:47:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): queue a new resize if
we have size_changed upon handling_resize. this is a gross
workaround for the broken zvt widget and should be removed in
1.3 again (search for FIXME).
Owen provided an accurate comment for this:
/* We could be here for two reasons
* 1) We coincidentally got a resize while handling
* another resize.
* 2) Our computation of size_changed was completely
* screwed up, probably because one of our children
* is broken. It's probably a zvt widget.
*
* For 1), we could just go ahead and ask for the
* new size right now, but doing that for 2)
* might well be fighting the user (and can even
* trigger a loop). Since we really don't want to
* do that, we requeue a resize in hopes that
* by the time it gets handled, the child has seen
* the light and is willing to go along with the
* new size. (this happens for the zvt widget, since
* the size_allocate() above will have stored the
* requisition corresponding to the new size in the
* zvt widget)
*
* This doesn't buy us anything for 1), but it shouldn't
* hurt us too badly, since it is what would have
* happened if we had gotten the configure event before
* the new size had been set.
*/
Wed Sep 1 20:46:11 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: deal properly with the fact that RC
style lists may include rc styles more than once.
* gtk/gtkrc.c (gtk_rc_append_pixmap_path): Removed
unused static function.
* gtk/gtkrc.c (gtk_rc_find_pixmap_in_path): Keep a
stack of directories of RC files currently being
parsed and implicitely add them to pixmap path.
This fixes a bug where the directory would get
appended then overwritten by pixmap_path declarations.
(bug #1462, from Peter Wainright <prw@wainpr.demon.co.uk>)
* gtk/gtkthemes.c (gtk_theme_engine_unref): Call
theme's exit function. (Patch from Peter Wainwright,
bug #1454)
* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_destroy):
Add a destroy() handler to take care of removing
group for menu item. (Fixes bug #1197)
* gtk/gtkwidget.c (gtk_widget_size_request): Fixed thinko
in warning message.
Wed Sep 1 21:27:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): don't require a server
roundtrip to figure window's width and height, since we know that
anyways from widget->allocation.
Wed Sep 1 12:37:44 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Compute
the hints after we request the new size.
Wed Sep 1 10:38:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_compute_hints): Removed
GTK_WIDGET_REALIZED() assertion - we can compute the
hints before we are realized.
* gtk/gtkwindow.c (gtk_window_move_resize): Reorder
hint changing so that we have a value of hints_changed
when we decide whether to constrain the window size.
* gtk/gtkwindow.c (gtk_window_move_resize): Spelling fix.
* gtk/gtkwindow.c (gtk_window_constrain_size): cleanups,
change back to G_MAXINT.
Wed Sep 1 06:54:59 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_get_geometry_info): zero initialize
new GtkWindowGeometryInfo, so fields like GdkGeometry geometry
contain uncluttered values.
(gtk_window_compute_hints): simply assert that window is realized
and that geometry_info is valid, since we rely on this anyways.
(gtk_window_constrain_size): major cleanups to the code.
if (flags & GDK_HINT_BASE_SIZE) use geometry's base width and height
for the base size, instead of the minimums. use 32767 as max width
and height (like in gtkwindow.c) instead of G_MAXINT.
Wed Sep 1 04:41:25 1999 Tim Janik <timj@gtk.org>
* cleaned up the GtkContainer.need_resize flag handling mess, we
only need to force resize requests when we were prematurely
realized, or our widget tree was modified when we were temporarily
hidden. handling these cases directly upon showing the window (i.e.
while the GdkWindow is still unmapped) avoids the need to wait for
a configure event response and therefore makes the GUI more snappier
and avoids blank windows during the roundtrip.
* gtk/gtkwidget.c:
(gtk_widget_hide):
(gtk_widget_show): don't queue resizes on toplevels, they know how
to deal with matters.
* gtk/gtkcontainer.c (gtk_container_queue_resize): set the ->need_resize
flag directly for not visible resize containers and spare us unecessary
signal emissions.
* gtk/gtkwindow.c:
(gtk_window_realize): if we need to enforce premature size allocation,
queue a container resize so we are correctly resized later on.
(gtk_window_init):
(gtk_window_size_request):
don't freak around with the ->need_resize flag,
gtk_container_queue_resize() will care about that.
(gtk_window_show):
handle initial resizing issues here, we can handle matters better in
this place, especially since we know that our GdkWindow is still
unmapped.
(gtk_window_move_resize):
don't care about ->need_resize at all.
handle size changes properly that occoured while we waited for a
configure event.
Tue Aug 31 15:58:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_uposition):
* gtk/gtkwindow.[hc] (gtk_window_reposition):
Move the hint setting code from gtk_widget_set_uposition
to here; set the hints so that we respect any previously
set geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Don't
change the window hints here or move the window here,
let that happen in gtk_window_move_resize().
Tue Aug 31 06:58:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): when discarding exposes due
to already queued resizes (and therefore redraws) on a widget, check
its anchestry as well.
* gtk/gtkcontainer.c:
(gtk_container_queue_resize): clear resize widgets for resize
containers before aborting prematurely. this is especially important
for toplevels which may need imemdiate processing or their resize
handler to be queued.
(gtk_container_dequeue_resize_handler): added new internal function for
gtkwindow.c.
* gtk/gtkwindow.c (gtk_window_move_resize): if we are resizing due to a
configure event, take possible changes in window position into account
as well.
if we request a new window size, queue up a resize handler that will
last until the configure event response arrives.
combined the ->need_resize case (initial show) with the general size
(hints) changed case and added even more comments.
if !auto_shrink, only revert to the old allocation if the new size
is smaller than the current allocation.
Tue Aug 31 11:55:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_arg, gtk_window_set_policy,
gtk_window_set_geometry_hints
gtk_window_set_default_size):
When hints are set, queue a resize so that the hints will
be eventually reset on the toplevel.
* gtk/gtkwindow.c (gtk_window_show): Use
gtk_window_compute_default_size(). Clear the need_resize flag
on the initail map so that we don't unnecessarily trigger the
resize code.
* gtk/gtkwindow.c (gtk_window_move_resize): Split apart
into separate functions. Compare the hints we are setting
with what we set last time so that we can accurately
tell when we need to reset the hints.
* gtk/gtkwindow.c (gtk_window_compute_default_size): New
function to figure out the size from requisition
and default_size.
* gtk/gtkwindow.c (gtk_window_constrain_size): Function
from fvwm to constrain a size to the geometry hints.
* gtk/gtkwindow.c (gtk_window_compare_hints): New function
to compare two sets of geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_hints): Renamed
from gtk_window_set_hints(), just compute the hints,
don't set them.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Move
code from gtk_window_move_resize() to separate function,
rationalize a bit.
Tue Aug 31 13:05:03 1999 Owen Taylor <otaylor@redhat.com>
* gtkrc.h: Move the ref_count member out of the GtkRcStyle
structure into a new private structure.
* gtkrc.c: Split GtkRcStyle into public/private.
In the private part, add a list of pointers to the
RcStyle lists this RcStyle participates in.
* gtkrc.c: When a RcStyle is free, remove all
lists referencing it from the
realized_style_ht hash, and free those lists.
* gtk/gtkrc.c (gtk_rc_clear_styles): Don't call
gtk_rc_init(), since that adds the default styles
to the list of parsed RC files again.
* gtk/gtkrc.c: Use gtk_rc_style_find() consistently.
Thu Aug 26 14:14:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): reactivated the sanity
checks that ensure that a widget's allocation is at least 1 in width
and height. (GNOME note: this doesn't affect old panel code anymore,
because GtkSocket will request width and height of at least 1 since
Fri Jul 23).
* gtk/gtkwindow.c (gtk_window_realize): if the widget hasn't been
allocated yet (happens if the user realizes the window prematurely),
size request and allocate it.
(gtk_window_size_allocate): guard against guint underflows.
Wed Aug 25 19:01:36 1999 Lars Hamann <lars@gtk.org>
* gtk/Makefile.am (gtk_built_sources): reordered stamp-gtk.defs
in gtk_built_sources, so gtk.defs gets built prior to all other
sources.
Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am:
invoke indent on gtkmarshal.*.
rewrote source generation rules, use COPYING as oldest source tag for
a piggyback rule to generate all sources from (don't touch it ;).
major cleanups, strip spaces on build rules for GNU Make.
* gtk/genmarshal.pl: don't operate on hardcoded filenames but take
source and target files from commandline arguments. don't invoke indent.
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Wed Aug 18 09:20:10 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c:
we use window->need_resize from configure_event now, to indicate that
the gtkwindow should keep its allocation (e.g. because the user resized
the window through window manager handles). resize_count is now reliably
used to figure whether we got the allocation we requested from the
window manager.
configure events get queued as resizes now, the real stuff (size
computation and allocation) now only goes on in gtk_window_move_resize().
GtkWindow's requisition now contains its *real* requisition (like all
other widgets), *not* taking usize into account.
geometry_info->last_{width|height} is now updated from set_hints() only
so it always contains the last hints we set for the window manager.
made some event handlers return TRUE instead of FALSE.
the overall code should be much more straight forward now, and the
significant code portions are accompanied by comments now.
(gtk_window_set_hints):
removed requisition argument and made it
fetch the requisition through gtk_widget_get_child_requisition.
we also don't move the gdkwindow here anymore, gtk_window_move_resize()
does that now.
(gtk_window_show):
ensure that the widget is realized before calling
gtk_container_check_resize() (and thus gtk_window_move_resize()), also
ensure that we got properly size requested and allocated before
realization.
(gtk_window_configure_event):
ignore plain window moves, or reallocate the widget tree through the
resize queue otherwise.
(gtk_window_move_resize):
mostly rewrote this function to figure window manager hints more
reliably, coalesce window moves and resizes to reduce configure events
and do actuall size allocations.
Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): discard expose events for widgets
that have a resize pending, because a redraw is already queued for them.
* gtk/gtkcontainer.c: removed ugly connect_to ::size_allocate signal
hack to clear resize_widgets.
* gtk/gtkwidget.c (gtk_widget_size_allocate): call clear_resize_widgets
for resize containers prior to size allocation. (this is also a bit
ugly, but avoids side effects for stopped emissions and is thus more
reliable).
(gtk_widget_unparent): removed disconnect call for clear_resize_widgets.
* gtk/gtktooltips.c (gtk_tooltips_paint_window): renamed this
function from gtk_tooltips_expose, as we connect to ::expose_event
*and* ::draw now.
1999-08-18 Federico Mena Quintero <federico@redhat.com>
* gtk/gtkselection.c (gtk_target_list_ref): Added missing sanity
checks.
(gtk_target_list_unref): Likewise.
* gtk/gtkthemes.c (gtk_theme_engine_unref): Likewise.
Tue Aug 17 15:47:07 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_draw_value_bar):
guard against division by zero. (Fixes bug #1339)
Tue Aug 17 10:56:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_move_{forward,backward}_word):
Prevent the trivial leak of information of allowing
word motion when the entry is not visible.
Tue Aug 17 10:28:52 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_fileop_error): Propagate
modality to error dialog as well as confirmation dialogs.
(Bug #1803, reported by Rosanna Wing Sze Yuen)
Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktreeitem.c (gtk_tree_item_draw_lines): Honor
tree->view_lines.
(gtk-guy-990611-3.patch: Guy Harris <guy@netapp.com>)
* gtk/Makefile.am (install-data-local): Solaris apparently
has various troubles with ln -f; use rm first instead.
(gtk-guy-990611-2.patch: Guy Harris <guy@netapp.com>)
1999-07-30 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (stamp-m): Don't `mv' from builddir to srcdir,
use `cp' followed by `rm' (the `rm' was already there).
July 30, 1999 Elliot Lee <sopwith@redhat.com>
* configure.in: Fix autoconf warnings about cross compilation by
trying to provide sane defaults for AC_TRY_RUN.
* gtk/Makefile.am: If we refer to gtkmarshal.[ch] in $(srcdir),
put them into $(srcdir) when generated. Also add a dependency of
gtksignal.h on gtkmarshal.h for -j builds.
* gtk/gtk(dnd,style,gamma).c: Minor warning fixes.
Wed Jul 28 09:29:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration_do): Added missing
GDK_THREADS_{LEAVE,ENTER} pair.
(From Paul Fisher <pnfisher@redhat.com>)
Fri Jul 23 01:00:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtksocket.c (gtk_socket_size_request): asure that the requested
width and height are always >0 (owen).
Fri Jul 23 00:00:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): backed out my recent
change that assured that a widget's allocated with and height are
always >1, since this breaks *buggy* panel code. unfortunately this
back-breaks the gimp's color selector.
* gtk/gtkdrawingarea.c (gtk_drawing_area_size_allocate): asure that our
allocation is always >0 in width and height, before sending the
configure event; this is a *gross* hack to get the gimp back to work.
* marked both cases with TODO-1.3
Wed Jul 21 15:47:39 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Don't display wrap indicators when
text is not editable and word wrap is on.
Wed Jul 21 08:21:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): special case
option menus here as they are not derived from menu shell, assure that
the option menu has a menu we can add items to.
Tue Jul 20 23:29:48 1999 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_page_allocate): convert allocation->
width/height to (gint) before calculations and check against < 0 to
avoid guint wraparounds.
Sun Jul 18 00:35:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): ensure that the allocated
width and height is never zero. sanity check both dimensions against
32767 and issue a warning if the allocation is greater than that.
Wed Jul 7 15:03:30 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_events_pending): Unlock around call
to g_main_pending() as well.
Wed Jul 7 14:59:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration): Unlock around
call to g_main_iteration() - since that will regrab
GTK+ lock to process events.
Thu Jul 1 15:01:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c
- Regularize with the rest of GTK+ by making widget->requisition
not reflect the set_usize()
- Always recompute geometry hints, then check if they
changed before sending them to the X server. The
previous checks for changes would fail in a number
of circumstances.
Thu Jul 1 11:55:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Include <stdlib.h> for strcmp().
Wed Jun 30 19:26:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c:
- Code cleanups
- Instantaneously update on modifier key presses
- Allow cancellation of the drag with Escape.
Tue Jun 29 17:04:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_handle_box): Set the policy
to auto_shrink - otherwise the appearance is rather
strange when flipping between horizontal and vertical.
Mon Jun 28 09:29:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: add ::default_width and ::default_height arguments.
(gtk_window_set_default_size): don't change a value if it's < 0.
queue a resize.
Sun Jun 27 11:00:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_insert): don't segfault on NULL inserts.
Mon Jun 28 12:08:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (cmpl_completion_fullname): Don't
add an extra "/" when concating "/" + filename.
(From Matt Grossman <mattg@oz.net>)
Mon Jun 28 10:57:12 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (draw_cell_pixmap): Reset clip mask
for fg_gc if we set it for drawing pixmap.
Tue Jun 15 12:45:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes from Peter Wainwright <prw@wainpr.demon.co.uk>
* gtk/gtkrc.c (gtk_rc_parse_engine): If rc_style->engine is
already set, call old engine's destroy function and
unref the old engine.
Thu Jun 10 17:59:38 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.c (gtk_drawing_area_size): queue a resize.
Wed Jun 9 15:13:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h: mark certain functions as internal.
Wed Jun 9 13:48:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpreview.c (gtk_preview_set_expand): queue a resize if the
expand behaviour changed.
* gtk/gtklabel.c (gtk_label_set_pattern):
(gtk_label_set_justify):
(gtk_label_set_line_wrap):
don't bother invoking queue_clear, the reallocation does
that for us, always free_words so the upcoming resize will
relayout the label's contents.
Wed Jun 9 12:50:48 1999 Tim Janik <timj@gtk.org>
* applied argument implementation patches from Elena Devdariani
<elena@cogent.ca>.
* gtk/gtktoolbar.c: ::orientation, ::toolbar_style, ::space_size,
::space_style, ::relief
* gtk/gtkruler.c: ::lower, ::upper, ::position, ::max_size
* gtk/gtkpreview.c: ::expand
* gtk/gtkpaned.c: ::handle_size, ::gutter_size
* gtk/gtknotebook.c: ::homogeneous
* gtk/gtklabel.c: ::wrap
* gtk/gtklist.c: ::selection_mode
* gtk/gtkhandlebox.c: ::handle_position, ::snap_edge
* gtk/gtkcurve.c: ::curve_type, ::min_x, ::max_x, ::min_y, ::max_y
* gtk/gtkcolorsel.c: ::update_policy, ::use_opacity
* gtk/gtkclist.c: ::sort_type
* gtk/gtkcheckmenuitem.c: ::active, ::show_toggle
* gtk/gtkaspectframe.c: ::xalign, ::yalign, ::ratio, ::obey_child
Tue Jun 1 23:38:38 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Removed ill-thought-out part of last
comment.
Tue Jun 1 23:30:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_attach): Get the reference
counting right when we have to attach a new style
for a different visual. (Chi-Deok Hwang <cdhwang@sr.hei.co.kr>)
* gtk/gtkstyle.c: Documented the refcounting
peculularities of gtk_style_attach.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkwindow.c (gtk_window_new): added return if fail for invalid
window types.
* examples/packer/pack.c (main): use GTK_WINDOW_TOPLEVEL instead
of GTK_TOPLEVEL for creating the window.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkmain.c (gtk_init_check): don't segfault when --gtk-module is
the last argument (reported by Per Winkvist).
Tue May 25 13:13:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes for invisible XOR lines (Frank Loemker
<floemker@TechFak.Uni-Bielefeld.DE>)
* gtk/gtkclist.c (gtk_clist_realize): Always use
a non-zero pixel for GDK_XOR.
* gtk/gtkvpaned.c gtk/gtkhpaned.c:
Use GDK_INVERT instead of GDK_XOR.
Wed May 12 21:56:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (adjust_adjustments): signal emit value_changed
signals if h/voffsets differ from adjustment values.
Reportet by Jerome Bolliet <bolliet@in2p3.fr>
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
the user data on the window before destroying it.
* gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
unrealize handler to take care of destroying
notebook->panel properly.
(Bug #1198 - Morten Welinder <terra@diku.dk>)
* gtk/gtktext.c (expand_scratch_buffer): Fix reversal
of g_new and g_realloc to stop memory leak. (Actually,
we could just use g_realloc(), but I'm not 100% sure
that is portable).
(Bug #1196 - Morten Welinder <terra@diku.dk>)
Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.h: Removed stray GtkPlugButton declaration.
* gdk/gdkfont.c (gdk_text_measure): Fix the return value
for fontsets.
* gtk/gtkbutton.c (gtkbutton_expose): Fix warning
with bin/button confusion.
Thu May 6 04:53:26 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: in the ItemFactory test, link radio items together,
and show how preselection of radio items is done.
Sun May 2 13:31:14 1999 Tim Janik <timj@gtk.org>
* gtk/gtktreeitem.c (gtk_tree_item_set_subtree):
* gtk/gtktree.c (gtk_tree_add) (gtk_tree_insert):
* gtk/gtktoolbar.c (gtk_toolbar_insert_element):
* gtk/gtkpaned.c (gtk_paned_pack2) (gtk_paned_pack1):
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_add):
* gtk/gtktable.c (gtk_table_attach):
* gtk/gtklist.c (gtk_list_insert_items):
* gtk/gtkmenushell.c (gtk_menu_shell_insert):
* gtk/gtknotebook.c (gtk_notebook_insert_page_menu):
* gtk/gtkpacker.c (gtk_packer_add_defaults) (gtk_packer_add):
* gtk/gtkbin.c (gtk_bin_add):
* gtk/gtkbox.c (gtk_box_pack_start) (gtk_box_pack_end):
* gtk/gtkfixed.c (gtk_fixed_put):
* gtk/gtklayout.c (gtk_layout_put):
general fixups to container_add logic. always realize child if
child->parent is realized, only map the child and queue a resize
if child and child->parent are both visible.
Fri Apr 30 09:02:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_unrealize): use gtk_container_forall
instead of gtk_container_foreach to walk and unrealize children, so
composite children get also unrealized.
(gtk_widget_real_show): don't call gtk_widget_map() if we don't need to.
(gtk_widget_map): assert that the widget is visible (basic constrain).
(gtk_widget_real_map): assert that the widget is realized (basic
constrain).
Fri Apr 29 00:53:20 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbindings.c (gtk_pattern_spec_init): plugged a memory leak.
Tue May 4 09:32:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc.iso-8859-2: Add a gtkrc
file for iso-8859-2 locales.
* configure.in (ALL_LINGUAS): ALL_LINGUAS update.
Tue Apr 27 16:38:32 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Fix typo of static_sources for static_SOURCES.
(Pointed out by andy@rz.uni-karlsruhe.de and others).
Remove some suspicious and useless lines.
Tue May 4 08:44:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c (gtk_clist_draw, draw_rows): Use
width,height = 0, 0 to mean - here to edge of window,
instead of -1, -1, since the former is all we support.
Tue May 4 08:34:43 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main): Correctly free list nodes
when removing from quit_functions list.
Tue Apr 27 14:17:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpacker.c (gtk_packer_size_request): remove unused variable.
Tue Apr 27 18:23:35 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable):
When redrawing characters on non-visible entry, use appropriate
'*' character. (Bug #1130 - Jean-Marc Jacquet <jm@littleigloo.org>)
Tue Apr 27 01:31:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (drag_dest_cell): compute destination cell
from drag coordinates.
(gtk_clist_drag_data_received) (gtk_clist_drag_motion):
use drag_dest_cell.
* gtk/gtktree (drag_dest_cell)
(gtk_ctree_drag_data_received) (gtk_ctree_drag_motion): likewise.
(Bug #1129)
Wed Apr 21 21:26:11 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_init): properly initialize
translate_* fields.
(gtk_item_factory_finalize): invoke translate_notify independant from
translate_data.
(gtk_item_factory_set_translate_func): likewise.
(gtk_item_factory_destroy): only remove ifactory pointer from those
widgets that belong to us (stupid me).
Mon Apr 19 12:05:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Fixed leak of
rc_style list when lookup succeeeds.
Thu Apr 15 01:11:24 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (resync_selection):
* gtk/gtkclist.c (resync_selection): fixed undo_selection bug.
* gtk/gtkclist.c (gtk_clist_button_release): fixed resync_selection
bug.
Fri Apr 9 19:22:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c gtk/gtkdnd.c gtk/gtkmenuitem.c:
Add some missing GDK_THREADS_ENTER()/LEAVE around
timeouts. (Patches from Sebastian Wilhelmi <wilhelmi@ira.uka.de>)
Thu Apr 8 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkentry.c (gtk_entry_key_press): use gtk_widget_activate()
rather than emit_by_name.
* gtk/gtkeditable.c (gtk_editable_insert_text): keep a reference
on the widget across multiple signal emissions.
(gtk_editable_delete_text): same here.
(gtk_editable_class_init): set widget_class->activate_signal after
editable_signals[ACTIVATE] has been created.
Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
position here prematurely -- we might not have the
right ->min_position and ->max_position yet.
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
Add error traps so if the other end of the connection
dies, we survive.
* gtk/gtkselection.c (gtk_selection_notify): Clean
up properly when selection property retrieval fails.
* gtk/gtkselection.c (gtk_selection_request): Correctly
reject SelectionRequest notifies where the handler
returns no data.
Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_dest_leave): Only unhighlight
when we've previously highlighted.
* gtk/gtkdnd.c (gtk_drag_dest_handle_event): Don't
emit two "drag_leave" signals for Motif drops.
* gtk/gtkdnd.c (gtk_drag_source_handle_event): Send
back the correct status messages when dropping from
Motif onto a proxy window that is rejecting the
drop.
Sat Mar 27 23:32:13 1999 Tim Janik <timj@gtk.org>
* gtk/gtkarg.[hc]: added functions from GLE, gtk_arg_reset() to free
the value and reset type to GTK_TYPE_INVALID, and gtk_arg_values_equal()
to compare two argument values. added gtk_arg_to_valueloc() to set a
variable from an arg through its location (pointer).
* gtk/gtkobject.[hc]: implemented gtk_object_get() in terms of
gtk_object_arg_get() and gtk_arg_to_valueloc(), floats are collected
as gfloat*, uchars are collected as guchar*, ints are collected as
gint*, etc...
Mon Mar 29 17:45:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccelgroup.c gtk/gtkgtkbindings.c:
Include <string.h> instead of <strings.h>.
* gtk/gtkstyle.c: Fix double include of gtkthemes.h
(actually, a lot more duplicate includes occur if
you trace through the sequence of #include's)
gtk-jbb-990320-0: John Bley, jbb6@acpub.duke.edu
Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com>
Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp>
gtk-a-higuti-990322-[0-3]
* configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS
that was causing -DX_LOCALE not to work.
* gtk/gtkrc.c (gtk_rc_init):
X_LOCALE will never have LC_MESSAGES defined
Thu Mar 25 12:38:31 1999 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_append_default_module_path): get $HOME from
g_get_home_dir() (gtk-pmc-990123-0.patch.gz).
* gtk/gtkwindow.c (gtk_window_key_press_event): feature keypad up/down/
left/right as well (gtk-michael-980726-0.patch.gz).
* gtk/gtklabel.[hc]: bunch of miscellaneous cleanups, such as s/0/NULL/
for pointer values, use gchar instead of char. fixed uline allocation
leaks, changed the allocation pattern so we use G_ALLOC_AND_FREE mem
chunks instead of G_ALLOC_ONLY.
(gtk_label_size_request): always alter requisition as passed and leave
widget->requisition alone.
(gtk_label_set_text): allow NULL strings.
(gtk_label_new): likewise.
Wed Mar 24 09:24:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.[hc]: type/macro fixups.
Mon Mar 22 05:51:34 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbin.c (gtk_bin_draw): only redraw children that are visible
*and* mapped (i.e. drawable).
(gtk_bin_expose): only send exposes to drawable children.
* gtk/gtkbox.c (gtk_box_draw): only redraw children that are drawable.
(gtk_box_expose): only send exposes to drawable children.
* gtk/gtkhscale.c (gtk_hscale_draw):
* gtk/gtkvscale.c (gtk_vscale_draw):
hm, this is an ugly one. we first compute the size of our trough area
here (window relative) and then check intersection with the draw_area
which is parent relative because we're a NO_WINDOW widget, so we need
to offset the trough area by allocation.x and allocation.y before the
check. (this must not be done for the background area though, since
that's already computed parent relative).
Mon Mar 22 00:41:39 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_unrealize): unmap clist if neccessary,
unrealize title buttons.
Fri Mar 19 00:00:22 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_column_title_passive)
(gtk_clist_column_title_active):
only connect/disconnect to GtkWidgetClass::event to block mouse events.
* gtk/gtkclist.c (vertical_timeout) (horizontal_timeout):
zero initialize event, removed superfluous gdk_window_get_pointer call
* gtk/gtklist.c (gtk_list_vertical_timeout)
(gtk_list_horizontal_timeout): removed superfluous
gdk_window_get_pointer call
Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org>
* plugging problems reported by "Bruce Mitchener, Jr."
<bruce@puremagic.com> due to a purify session.
* gtk/gtkstyle.c:
(gtk_style_ref):
(gtk_style_unref): assert ref_count to be > 0.
* gtk/gtkclist.c (gtk_clist_set_cell_style): { 0 } initilaize
the requisition.
(gtk_clist_set_shift): likewise.
* gtk/gtklayout.c: introduce gtk_layout_finalize() to unref the
adjustments.
* gtk/gtklist.c (gtk_list_horizontal_timeout): zero initialize the
event before sending it and set send_event to TRUE (which needs to
be done for *all* synthesized events).
(gtk_list_vertical_timeout): likewise.
* gtk/gtktipsquery.c (gtk_tips_query_destroy): plug small memory
leaks.
* gtk/gtkdrawingarea.c (gtk_drawing_area_send_configure): set send_event
to TRUE when synthesizing events.
[ *** end of merges from 1.2 *** ]
1999-11-22 21:52:50 +00:00
|
|
|
case ARG_SORT_TYPE:
|
|
|
|
GTK_VALUE_ENUM (*arg) = clist->sort_type;
|
|
|
|
break;
|
1998-11-05 15:44:22 +00:00
|
|
|
default:
|
|
|
|
arg->type = GTK_TYPE_INVALID;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1998-01-03 03:31:03 +00:00
|
|
|
static void
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_clist_init (GtkCList *clist)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
|
|
|
clist->flags = 0;
|
|
|
|
|
|
|
|
GTK_WIDGET_UNSET_FLAGS (clist, GTK_NO_WINDOW);
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
GTK_WIDGET_SET_FLAGS (clist, GTK_CAN_FOCUS);
|
|
|
|
GTK_CLIST_SET_FLAG (clist, CLIST_CHILD_HAS_FOCUS);
|
|
|
|
GTK_CLIST_SET_FLAG (clist, CLIST_DRAW_DRAG_LINE);
|
|
|
|
GTK_CLIST_SET_FLAG (clist, CLIST_USE_DRAG_ICONS);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-02-28 22:36:06 +00:00
|
|
|
clist->row_mem_chunk = NULL;
|
|
|
|
clist->cell_mem_chunk = NULL;
|
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
clist->freeze_count = 0;
|
|
|
|
|
1998-01-03 03:31:03 +00:00
|
|
|
clist->rows = 0;
|
|
|
|
clist->row_center_offset = 0;
|
|
|
|
clist->row_height = 0;
|
|
|
|
clist->row_list = NULL;
|
|
|
|
clist->row_list_end = NULL;
|
|
|
|
|
|
|
|
clist->columns = 0;
|
|
|
|
|
1998-01-19 09:59:20 +00:00
|
|
|
clist->title_window = NULL;
|
1998-01-03 03:31:03 +00:00
|
|
|
clist->column_title_area.x = 0;
|
|
|
|
clist->column_title_area.y = 0;
|
1998-04-03 23:17:16 +00:00
|
|
|
clist->column_title_area.width = 1;
|
|
|
|
clist->column_title_area.height = 1;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
|
|
|
clist->clist_window = NULL;
|
1998-04-03 23:17:16 +00:00
|
|
|
clist->clist_window_width = 1;
|
|
|
|
clist->clist_window_height = 1;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
|
|
|
clist->hoffset = 0;
|
|
|
|
clist->voffset = 0;
|
|
|
|
|
|
|
|
clist->shadow_type = GTK_SHADOW_IN;
|
1998-11-05 15:44:22 +00:00
|
|
|
clist->vadjustment = NULL;
|
|
|
|
clist->hadjustment = NULL;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
clist->button_actions[0] = GTK_BUTTON_SELECTS | GTK_BUTTON_DRAGS;
|
|
|
|
clist->button_actions[1] = GTK_BUTTON_IGNORED;
|
|
|
|
clist->button_actions[2] = GTK_BUTTON_IGNORED;
|
|
|
|
clist->button_actions[3] = GTK_BUTTON_IGNORED;
|
|
|
|
clist->button_actions[4] = GTK_BUTTON_IGNORED;
|
|
|
|
|
1998-01-03 03:31:03 +00:00
|
|
|
clist->cursor_drag = NULL;
|
|
|
|
clist->xor_gc = NULL;
|
|
|
|
clist->fg_gc = NULL;
|
|
|
|
clist->bg_gc = NULL;
|
|
|
|
clist->x_drag = 0;
|
|
|
|
|
|
|
|
clist->selection_mode = GTK_SELECTION_SINGLE;
|
1998-01-06 06:48:48 +00:00
|
|
|
clist->selection = NULL;
|
1998-07-15 23:40:00 +00:00
|
|
|
clist->selection_end = NULL;
|
|
|
|
clist->undo_selection = NULL;
|
|
|
|
clist->undo_unselection = NULL;
|
|
|
|
|
|
|
|
clist->focus_row = -1;
|
|
|
|
clist->undo_anchor = -1;
|
|
|
|
|
|
|
|
clist->anchor = -1;
|
|
|
|
clist->anchor_state = GTK_STATE_SELECTED;
|
|
|
|
clist->drag_pos = -1;
|
|
|
|
clist->htimer = 0;
|
|
|
|
clist->vtimer = 0;
|
1998-08-05 20:02:32 +00:00
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
clist->click_cell.row = -1;
|
|
|
|
clist->click_cell.column = -1;
|
|
|
|
|
1998-08-05 20:02:32 +00:00
|
|
|
clist->compare = default_compare;
|
|
|
|
clist->sort_type = GTK_SORT_ASCENDING;
|
|
|
|
clist->sort_column = 0;
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
|
1998-02-20 05:29:03 +00:00
|
|
|
/* Constructors */
|
|
|
|
void
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_clist_construct (GtkCList *clist,
|
|
|
|
gint columns,
|
1998-11-26 03:43:24 +00:00
|
|
|
gchar *titles[])
|
1998-02-20 05:29:03 +00:00
|
|
|
{
|
1998-02-28 22:36:06 +00:00
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
g_return_if_fail (columns > 0);
|
|
|
|
g_return_if_fail (GTK_OBJECT_CONSTRUCTED (clist) == FALSE);
|
1998-02-28 22:36:06 +00:00
|
|
|
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
/* mark the object as constructed */
|
|
|
|
gtk_object_constructed (GTK_OBJECT (clist));
|
1998-02-20 05:29:03 +00:00
|
|
|
|
1998-05-01 13:16:49 +00:00
|
|
|
/* initalize memory chunks, if this has not been done by any
|
|
|
|
* possibly derived widget
|
|
|
|
*/
|
|
|
|
if (!clist->row_mem_chunk)
|
|
|
|
clist->row_mem_chunk = g_mem_chunk_new ("clist row mem chunk",
|
|
|
|
sizeof (GtkCListRow),
|
1998-10-19 22:46:38 +00:00
|
|
|
sizeof (GtkCListRow) *
|
|
|
|
CLIST_OPTIMUM_SIZE,
|
1998-05-01 13:16:49 +00:00
|
|
|
G_ALLOC_AND_FREE);
|
|
|
|
|
|
|
|
if (!clist->cell_mem_chunk)
|
|
|
|
clist->cell_mem_chunk = g_mem_chunk_new ("clist cell mem chunk",
|
|
|
|
sizeof (GtkCell) * columns,
|
1998-10-19 22:46:38 +00:00
|
|
|
sizeof (GtkCell) * columns *
|
|
|
|
CLIST_OPTIMUM_SIZE,
|
1998-05-01 13:16:49 +00:00
|
|
|
G_ALLOC_AND_FREE);
|
1998-02-20 05:29:03 +00:00
|
|
|
|
|
|
|
/* set number of columns, allocate memory */
|
|
|
|
clist->columns = columns;
|
|
|
|
clist->column = columns_new (clist);
|
|
|
|
|
|
|
|
/* there needs to be at least one column button
|
|
|
|
* because there is alot of code that will break if it
|
|
|
|
* isn't there*/
|
|
|
|
column_button_create (clist, 0);
|
|
|
|
|
|
|
|
if (titles)
|
|
|
|
{
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
guint i;
|
|
|
|
|
1998-05-01 13:16:49 +00:00
|
|
|
GTK_CLIST_SET_FLAG (clist, CLIST_SHOW_TITLES);
|
1998-02-20 05:29:03 +00:00
|
|
|
for (i = 0; i < columns; i++)
|
|
|
|
gtk_clist_set_column_title (clist, i, titles[i]);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
1998-05-01 13:16:49 +00:00
|
|
|
GTK_CLIST_UNSET_FLAG (clist, CLIST_SHOW_TITLES);
|
1998-02-20 05:29:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* GTKCLIST PUBLIC INTERFACE
|
1998-01-24 19:14:42 +00:00
|
|
|
* gtk_clist_new
|
1998-10-19 22:46:38 +00:00
|
|
|
* gtk_clist_new_with_titles
|
1998-11-05 15:44:22 +00:00
|
|
|
* gtk_clist_set_hadjustment
|
|
|
|
* gtk_clist_set_vadjustment
|
|
|
|
* gtk_clist_get_hadjustment
|
|
|
|
* gtk_clist_get_vadjustment
|
1998-10-19 22:46:38 +00:00
|
|
|
* gtk_clist_set_shadow_type
|
|
|
|
* gtk_clist_set_selection_mode
|
|
|
|
* gtk_clist_freeze
|
|
|
|
* gtk_clist_thaw
|
1998-01-24 19:14:42 +00:00
|
|
|
*/
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
GtkWidget*
|
1998-02-20 05:29:03 +00:00
|
|
|
gtk_clist_new (gint columns)
|
1998-01-19 09:59:20 +00:00
|
|
|
{
|
1998-11-05 15:44:22 +00:00
|
|
|
return gtk_clist_new_with_titles (columns, NULL);
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
GtkWidget*
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_clist_new_with_titles (gint columns,
|
1998-11-26 03:43:24 +00:00
|
|
|
gchar *titles[])
|
1998-10-19 22:46:38 +00:00
|
|
|
{
|
|
|
|
GtkWidget *widget;
|
|
|
|
|
|
|
|
widget = gtk_type_new (GTK_TYPE_CLIST);
|
|
|
|
gtk_clist_construct (GTK_CLIST (widget), columns, titles);
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
return widget;
|
|
|
|
}
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-11-05 15:44:22 +00:00
|
|
|
void
|
|
|
|
gtk_clist_set_hadjustment (GtkCList *clist,
|
|
|
|
GtkAdjustment *adjustment)
|
|
|
|
{
|
1998-11-07 14:29:22 +00:00
|
|
|
GtkAdjustment *old_adjustment;
|
|
|
|
|
1998-11-05 15:44:22 +00:00
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
|
|
|
if (adjustment)
|
|
|
|
g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
|
|
|
|
|
1998-11-07 14:29:22 +00:00
|
|
|
if (clist->hadjustment == adjustment)
|
|
|
|
return;
|
|
|
|
|
|
|
|
old_adjustment = clist->hadjustment;
|
|
|
|
|
|
|
|
if (clist->hadjustment)
|
1998-11-05 15:44:22 +00:00
|
|
|
{
|
|
|
|
gtk_signal_disconnect_by_data (GTK_OBJECT (clist->hadjustment), clist);
|
|
|
|
gtk_object_unref (GTK_OBJECT (clist->hadjustment));
|
|
|
|
}
|
|
|
|
|
1998-11-07 14:29:22 +00:00
|
|
|
clist->hadjustment = adjustment;
|
1998-11-05 15:44:22 +00:00
|
|
|
|
1998-11-07 14:29:22 +00:00
|
|
|
if (clist->hadjustment)
|
1998-11-05 15:44:22 +00:00
|
|
|
{
|
|
|
|
gtk_object_ref (GTK_OBJECT (clist->hadjustment));
|
|
|
|
gtk_object_sink (GTK_OBJECT (clist->hadjustment));
|
|
|
|
|
|
|
|
gtk_signal_connect (GTK_OBJECT (clist->hadjustment), "changed",
|
|
|
|
(GtkSignalFunc) hadjustment_changed,
|
|
|
|
(gpointer) clist);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (clist->hadjustment), "value_changed",
|
|
|
|
(GtkSignalFunc) hadjustment_value_changed,
|
|
|
|
(gpointer) clist);
|
|
|
|
}
|
1998-11-07 14:29:22 +00:00
|
|
|
|
|
|
|
if (!clist->hadjustment || !old_adjustment)
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (clist));
|
1998-11-05 15:44:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GtkAdjustment *
|
|
|
|
gtk_clist_get_hadjustment (GtkCList *clist)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (clist != NULL, NULL);
|
|
|
|
g_return_val_if_fail (GTK_IS_CLIST (clist), NULL);
|
|
|
|
|
|
|
|
return clist->hadjustment;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_clist_set_vadjustment (GtkCList *clist,
|
|
|
|
GtkAdjustment *adjustment)
|
|
|
|
{
|
1998-11-07 14:29:22 +00:00
|
|
|
GtkAdjustment *old_adjustment;
|
|
|
|
|
1998-11-05 15:44:22 +00:00
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
|
|
|
if (adjustment)
|
|
|
|
g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
|
1998-11-07 14:29:22 +00:00
|
|
|
|
|
|
|
if (clist->vadjustment == adjustment)
|
|
|
|
return;
|
1998-11-05 15:44:22 +00:00
|
|
|
|
1998-11-07 14:29:22 +00:00
|
|
|
old_adjustment = clist->vadjustment;
|
|
|
|
|
|
|
|
if (clist->vadjustment)
|
1998-11-05 15:44:22 +00:00
|
|
|
{
|
|
|
|
gtk_signal_disconnect_by_data (GTK_OBJECT (clist->vadjustment), clist);
|
|
|
|
gtk_object_unref (GTK_OBJECT (clist->vadjustment));
|
|
|
|
}
|
|
|
|
|
1998-11-07 14:29:22 +00:00
|
|
|
clist->vadjustment = adjustment;
|
1998-11-05 15:44:22 +00:00
|
|
|
|
1998-11-07 14:29:22 +00:00
|
|
|
if (clist->vadjustment)
|
1998-11-05 15:44:22 +00:00
|
|
|
{
|
|
|
|
gtk_object_ref (GTK_OBJECT (clist->vadjustment));
|
|
|
|
gtk_object_sink (GTK_OBJECT (clist->vadjustment));
|
|
|
|
|
|
|
|
gtk_signal_connect (GTK_OBJECT (clist->vadjustment), "changed",
|
|
|
|
(GtkSignalFunc) vadjustment_changed,
|
|
|
|
(gpointer) clist);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (clist->vadjustment), "value_changed",
|
|
|
|
(GtkSignalFunc) vadjustment_value_changed,
|
|
|
|
(gpointer) clist);
|
|
|
|
}
|
1998-11-07 14:29:22 +00:00
|
|
|
|
|
|
|
if (!clist->vadjustment || !old_adjustment)
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (clist));
|
1998-11-05 15:44:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GtkAdjustment *
|
|
|
|
gtk_clist_get_vadjustment (GtkCList *clist)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (clist != NULL, NULL);
|
|
|
|
g_return_val_if_fail (GTK_IS_CLIST (clist), NULL);
|
|
|
|
|
|
|
|
return clist->vadjustment;
|
|
|
|
}
|
|
|
|
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
static void
|
1998-12-02 03:40:03 +00:00
|
|
|
gtk_clist_set_scroll_adjustments (GtkCList *clist,
|
|
|
|
GtkAdjustment *hadjustment,
|
|
|
|
GtkAdjustment *vadjustment)
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
{
|
|
|
|
if (clist->hadjustment != hadjustment)
|
|
|
|
gtk_clist_set_hadjustment (clist, hadjustment);
|
|
|
|
if (clist->vadjustment != vadjustment)
|
|
|
|
gtk_clist_set_vadjustment (clist, vadjustment);
|
|
|
|
}
|
|
|
|
|
1998-01-03 03:31:03 +00:00
|
|
|
void
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_clist_set_shadow_type (GtkCList *clist,
|
|
|
|
GtkShadowType type)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (clist != NULL);
|
1998-07-15 23:40:00 +00:00
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist->shadow_type = type;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
|
|
|
if (GTK_WIDGET_VISIBLE (clist))
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (clist));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_clist_set_selection_mode (GtkCList *clist,
|
|
|
|
GtkSelectionMode mode)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (clist != NULL);
|
1998-07-15 23:40:00 +00:00
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
|
|
|
|
|
|
|
if (mode == clist->selection_mode)
|
|
|
|
return;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
|
|
|
clist->selection_mode = mode;
|
1998-07-15 23:40:00 +00:00
|
|
|
clist->anchor = -1;
|
|
|
|
clist->anchor_state = GTK_STATE_SELECTED;
|
|
|
|
clist->drag_pos = -1;
|
|
|
|
clist->undo_anchor = clist->focus_row;
|
|
|
|
|
|
|
|
g_list_free (clist->undo_selection);
|
|
|
|
g_list_free (clist->undo_unselection);
|
|
|
|
clist->undo_selection = NULL;
|
|
|
|
clist->undo_unselection = NULL;
|
|
|
|
|
|
|
|
switch (mode)
|
|
|
|
{
|
|
|
|
case GTK_SELECTION_MULTIPLE:
|
|
|
|
case GTK_SELECTION_EXTENDED:
|
|
|
|
return;
|
|
|
|
case GTK_SELECTION_BROWSE:
|
|
|
|
case GTK_SELECTION_SINGLE:
|
|
|
|
gtk_clist_unselect_all (clist);
|
|
|
|
break;
|
|
|
|
}
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
void
|
|
|
|
gtk_clist_freeze (GtkCList *clist)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (clist != NULL);
|
1998-07-15 23:40:00 +00:00
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
clist->freeze_count++;
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_clist_thaw (GtkCList *clist)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (clist != NULL);
|
1998-07-15 23:40:00 +00:00
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
if (clist->freeze_count)
|
|
|
|
{
|
|
|
|
clist->freeze_count--;
|
|
|
|
CLIST_REFRESH (clist);
|
|
|
|
}
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* PUBLIC COLUMN FUNCTIONS
|
|
|
|
* gtk_clist_column_titles_show
|
|
|
|
* gtk_clist_column_titles_hide
|
|
|
|
* gtk_clist_column_title_active
|
|
|
|
* gtk_clist_column_title_passive
|
|
|
|
* gtk_clist_column_titles_active
|
|
|
|
* gtk_clist_column_titles_passive
|
|
|
|
* gtk_clist_set_column_title
|
1998-11-18 23:55:10 +00:00
|
|
|
* gtk_clist_get_column_title
|
1998-10-19 22:46:38 +00:00
|
|
|
* gtk_clist_set_column_widget
|
|
|
|
* gtk_clist_set_column_justification
|
|
|
|
* gtk_clist_set_column_visibility
|
|
|
|
* gtk_clist_set_column_resizeable
|
|
|
|
* gtk_clist_set_column_auto_resize
|
|
|
|
* gtk_clist_optimal_column_width
|
|
|
|
* gtk_clist_set_column_width
|
|
|
|
* gtk_clist_set_column_min_width
|
|
|
|
* gtk_clist_set_column_max_width
|
|
|
|
*/
|
1998-01-19 09:59:20 +00:00
|
|
|
void
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_clist_column_titles_show (GtkCList *clist)
|
1998-01-19 09:59:20 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (clist != NULL);
|
1998-07-15 23:40:00 +00:00
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-01-19 09:59:20 +00:00
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (!GTK_CLIST_SHOW_TITLES(clist))
|
1998-01-19 09:59:20 +00:00
|
|
|
{
|
1998-05-01 13:16:49 +00:00
|
|
|
GTK_CLIST_SET_FLAG (clist, CLIST_SHOW_TITLES);
|
1998-03-17 23:21:17 +00:00
|
|
|
if (clist->title_window)
|
1998-12-04 00:04:31 +00:00
|
|
|
gdk_window_show (clist->title_window);
|
1998-01-19 09:59:20 +00:00
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (clist));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_clist_column_titles_hide (GtkCList *clist)
|
1998-01-19 09:59:20 +00:00
|
|
|
{
|
1998-01-21 08:56:52 +00:00
|
|
|
g_return_if_fail (clist != NULL);
|
1998-07-15 23:40:00 +00:00
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-01-21 08:56:52 +00:00
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (GTK_CLIST_SHOW_TITLES(clist))
|
1998-01-19 09:59:20 +00:00
|
|
|
{
|
1998-05-01 13:16:49 +00:00
|
|
|
GTK_CLIST_UNSET_FLAG (clist, CLIST_SHOW_TITLES);
|
1998-03-17 23:21:17 +00:00
|
|
|
if (clist->title_window)
|
1998-12-04 00:04:31 +00:00
|
|
|
gdk_window_hide (clist->title_window);
|
1998-01-19 09:59:20 +00:00
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (clist));
|
|
|
|
}
|
|
|
|
}
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-04 10:52:52 +00:00
|
|
|
void
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_clist_column_title_active (GtkCList *clist,
|
|
|
|
gint column)
|
1998-01-21 08:56:52 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (clist != NULL);
|
1998-07-15 23:40:00 +00:00
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-01-21 08:56:52 +00:00
|
|
|
|
|
|
|
if (column < 0 || column >= clist->columns)
|
|
|
|
return;
|
Tue Mar 16 17:43:33 1999 Tim Janik <timj@gtk.org>
Wed Mar 17 01:46:28 1999 Tim Janik <timj@gtk.org>
* merges from gtk-1-2:
Tue Mar 16 17:43:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_string): ensure the
item factory class has been created.
(gtk_item_factory_parse_rc): likewise.
* gtk/gtkmenu.c:
keep proper references for old_active_menu_item.
(gtk_menu_reparent): unset the usize of the new parent,
so the menu can sanely be size requested and we don't get nasty screen
artefacts upon next reparentation.
(gtk_menu_motion_notify): set send_event to TRUE if we synthesize an
enter notify. only synthesize enter notifies if the pointer really is
inside the event window.
(gtk_menu_popdown): use gtk_menu_shell_deselect().
(gtk_menu_popup): move the background setting stuff into
gtk_menu_tearoff_bg_copy() so it can be called from other places as well.
* gtk/gtkmenushell.c (gtk_menu_shell_button_press): use
gtk_menu_shell_select_item() to select the new item.
(gtk_menu_shell_deselect): export this function, so gtkmenu.c can
do the right thing for deselection as well.
Sat Mar 15 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.[hc]:
(gtk_widget_accelerators_locked): return whether a widget's accelerators
are locked.
* gtk/gtkmenu.c (gtk_menu_key_press): don't remove or install new or
existing accelerators if the widget's accelerators are locked.
Sat Mar 14 19:44:05 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.[hc]: allow managing of foreign menu items.
* gtk/gtkmenu.c: truely forward key press and key release events to
the menu widget from the toplevel or tearoff window. we can't simply
connect to that, we need to stop further processing of the events as
well.
Sat Mar 13 13:14:17 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.c:
(gtk_menu_key_press): pass event->keyval, event->state to
gtk_accelerator_valid, instead of event->keyval twice.
refuse to install single letter accelerators for menus that use
single letter shortcuts.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): use
gtk_menu_ensure_uline_accel_group().
* gtk/gtkmenu.[hc]: added gtk_menu_ensure_uline_accel_group()
which will always return an uline accel group, made
gtk_menu_get_uline_accel_group() return NULL if the group isn't
yet created.
Mon Mar 15 01:03:27 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h (struct _GtkCListColumn): added button_passive flag.
* gtk/gtkclist.c (gtk_clist_column_title_passive):
Leave button sensitive, trap button_press, button_release,
motion_notify, enter_notify and leave_notify events instead.
(gtk_clist_column_title_active): disconnect event handler.
(gtk_clist_drag_data_get): fixed memory leak. Reported by
Guillaume Laurent <glaurent@worldnet.fr>
Wed Mar 10 23:49:55 1999 Lars Hamann <lars@gtk.org>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): fixed a few
width/height mixups.
* gtk/gtkctree.c (tree_delete): emit an tree_unselect_row signal
if needed.
Wed Mar 10 00:11:32 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c (create_item_factory): unref the item factory after
window's destruction.
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): keep a reference
count on the menu shell around the menu item's activation, since the
signal emission may cause menu shell destruction.
* gtk/gtkitemfactory.c:
the previous code leaked one accel group per menu. we use
gtk_menu_get_uline_accel_group() now to fix that, and with that
also create the underline accelerator group of the menus only if
required (i.e. an underline accelerator has been specified).
(gtk_item_factory_construct):
(gtk_item_factory_create_item): removed code that would create an
extra accel group for the menu (and leak references).
(gtk_item_factory_create_item): adapted the underline accelerator
installation code to properly feature gtk_menu_get_uline_accel_group().
* gtk/gtkmenu.[hc]: added gtk_menu_get_accel_group() to retrive
menu->accel_group, this may return NULL if the accelerator group
hasn't been set yet.
added gtk_menu_get_uline_accel_group() to retrive the underline
accelerator group of the menu, this will be created on demand
and proper care is taken about its reference count.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c:
dumped the approach of keeping a widgets by action list on the
factory since the factory<->widget destroy negotiation didn't work
and would be hard to get going at all. instead we keep a list of
GtkItemFactoryItem items on the factory (GtkItemFactoryItems are
persistant throughout a program's life time).
also, i removed the static const gchar *key_* variables, and made
them inline strings (they weren't actually used anyways).
(gtk_item_factory_add_item): update ifactory->items.
(gtk_item_factory_destroy): destroy ifactory->items (and remove
the item factory pointer from the remaining ifactory widgets).
(gtk_item_factory_get_widget_by_action): walk the GtkItemFactoryItem
list to find the widget.
(gtk_item_factory_get_item): new function that works around
gtk_item_factory_get_widget() limitations, this function will only
return menu items, even for <Branch> entries.
Tue Mar 9 01:01:28 1999 Tim Janik <timj@gtk.org>
* gdk/gdkfont.c (gdk_font_load): first lookup the xfont ID in our
font hash table, if we have a GdkFontPrivate entry for this font
already, simply increment its reference count, provided by Olaf Dietsche
<olaf.dietsche+list.gtk@netcologne.de>.
* gtk/gtkstyle.c (gtk_style_copy): plug a GdkFont reference leak, fix
provided by Olaf Dietsche <olaf.dietsche+list.gtk@netcologne.de>.
Sun Mar 7 06:13:29 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c:
(gtk_container_add_with_args):
(gtk_container_addv):
(gtk_container_add): before adding a child to a conatiner, make sure
it is (default) constructed, this is neccessary because under certain
circumstances the child will get relized and mapped immediatedly, in
which case it has to be constructed already.
Mon Mar 1 17:58:21 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_connect_by_type): count object_signal
values > 1 as TRUE also.
1999-03-17 01:39:42 +00:00
|
|
|
if (!clist->column[column].button || !clist->column[column].button_passive)
|
1998-12-04 00:04:31 +00:00
|
|
|
return;
|
1998-01-21 08:56:52 +00:00
|
|
|
|
Tue Mar 16 17:43:33 1999 Tim Janik <timj@gtk.org>
Wed Mar 17 01:46:28 1999 Tim Janik <timj@gtk.org>
* merges from gtk-1-2:
Tue Mar 16 17:43:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_string): ensure the
item factory class has been created.
(gtk_item_factory_parse_rc): likewise.
* gtk/gtkmenu.c:
keep proper references for old_active_menu_item.
(gtk_menu_reparent): unset the usize of the new parent,
so the menu can sanely be size requested and we don't get nasty screen
artefacts upon next reparentation.
(gtk_menu_motion_notify): set send_event to TRUE if we synthesize an
enter notify. only synthesize enter notifies if the pointer really is
inside the event window.
(gtk_menu_popdown): use gtk_menu_shell_deselect().
(gtk_menu_popup): move the background setting stuff into
gtk_menu_tearoff_bg_copy() so it can be called from other places as well.
* gtk/gtkmenushell.c (gtk_menu_shell_button_press): use
gtk_menu_shell_select_item() to select the new item.
(gtk_menu_shell_deselect): export this function, so gtkmenu.c can
do the right thing for deselection as well.
Sat Mar 15 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.[hc]:
(gtk_widget_accelerators_locked): return whether a widget's accelerators
are locked.
* gtk/gtkmenu.c (gtk_menu_key_press): don't remove or install new or
existing accelerators if the widget's accelerators are locked.
Sat Mar 14 19:44:05 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.[hc]: allow managing of foreign menu items.
* gtk/gtkmenu.c: truely forward key press and key release events to
the menu widget from the toplevel or tearoff window. we can't simply
connect to that, we need to stop further processing of the events as
well.
Sat Mar 13 13:14:17 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.c:
(gtk_menu_key_press): pass event->keyval, event->state to
gtk_accelerator_valid, instead of event->keyval twice.
refuse to install single letter accelerators for menus that use
single letter shortcuts.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): use
gtk_menu_ensure_uline_accel_group().
* gtk/gtkmenu.[hc]: added gtk_menu_ensure_uline_accel_group()
which will always return an uline accel group, made
gtk_menu_get_uline_accel_group() return NULL if the group isn't
yet created.
Mon Mar 15 01:03:27 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h (struct _GtkCListColumn): added button_passive flag.
* gtk/gtkclist.c (gtk_clist_column_title_passive):
Leave button sensitive, trap button_press, button_release,
motion_notify, enter_notify and leave_notify events instead.
(gtk_clist_column_title_active): disconnect event handler.
(gtk_clist_drag_data_get): fixed memory leak. Reported by
Guillaume Laurent <glaurent@worldnet.fr>
Wed Mar 10 23:49:55 1999 Lars Hamann <lars@gtk.org>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): fixed a few
width/height mixups.
* gtk/gtkctree.c (tree_delete): emit an tree_unselect_row signal
if needed.
Wed Mar 10 00:11:32 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c (create_item_factory): unref the item factory after
window's destruction.
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): keep a reference
count on the menu shell around the menu item's activation, since the
signal emission may cause menu shell destruction.
* gtk/gtkitemfactory.c:
the previous code leaked one accel group per menu. we use
gtk_menu_get_uline_accel_group() now to fix that, and with that
also create the underline accelerator group of the menus only if
required (i.e. an underline accelerator has been specified).
(gtk_item_factory_construct):
(gtk_item_factory_create_item): removed code that would create an
extra accel group for the menu (and leak references).
(gtk_item_factory_create_item): adapted the underline accelerator
installation code to properly feature gtk_menu_get_uline_accel_group().
* gtk/gtkmenu.[hc]: added gtk_menu_get_accel_group() to retrive
menu->accel_group, this may return NULL if the accelerator group
hasn't been set yet.
added gtk_menu_get_uline_accel_group() to retrive the underline
accelerator group of the menu, this will be created on demand
and proper care is taken about its reference count.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c:
dumped the approach of keeping a widgets by action list on the
factory since the factory<->widget destroy negotiation didn't work
and would be hard to get going at all. instead we keep a list of
GtkItemFactoryItem items on the factory (GtkItemFactoryItems are
persistant throughout a program's life time).
also, i removed the static const gchar *key_* variables, and made
them inline strings (they weren't actually used anyways).
(gtk_item_factory_add_item): update ifactory->items.
(gtk_item_factory_destroy): destroy ifactory->items (and remove
the item factory pointer from the remaining ifactory widgets).
(gtk_item_factory_get_widget_by_action): walk the GtkItemFactoryItem
list to find the widget.
(gtk_item_factory_get_item): new function that works around
gtk_item_factory_get_widget() limitations, this function will only
return menu items, even for <Branch> entries.
Tue Mar 9 01:01:28 1999 Tim Janik <timj@gtk.org>
* gdk/gdkfont.c (gdk_font_load): first lookup the xfont ID in our
font hash table, if we have a GdkFontPrivate entry for this font
already, simply increment its reference count, provided by Olaf Dietsche
<olaf.dietsche+list.gtk@netcologne.de>.
* gtk/gtkstyle.c (gtk_style_copy): plug a GdkFont reference leak, fix
provided by Olaf Dietsche <olaf.dietsche+list.gtk@netcologne.de>.
Sun Mar 7 06:13:29 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c:
(gtk_container_add_with_args):
(gtk_container_addv):
(gtk_container_add): before adding a child to a conatiner, make sure
it is (default) constructed, this is neccessary because under certain
circumstances the child will get relized and mapped immediatedly, in
which case it has to be constructed already.
Mon Mar 1 17:58:21 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_connect_by_type): count object_signal
values > 1 as TRUE also.
1999-03-17 01:39:42 +00:00
|
|
|
clist->column[column].button_passive = FALSE;
|
|
|
|
|
1999-04-30 11:48:42 +00:00
|
|
|
gtk_signal_disconnect_by_func (GTK_OBJECT (clist->column[column].button),
|
Tue Mar 16 17:43:33 1999 Tim Janik <timj@gtk.org>
Wed Mar 17 01:46:28 1999 Tim Janik <timj@gtk.org>
* merges from gtk-1-2:
Tue Mar 16 17:43:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_string): ensure the
item factory class has been created.
(gtk_item_factory_parse_rc): likewise.
* gtk/gtkmenu.c:
keep proper references for old_active_menu_item.
(gtk_menu_reparent): unset the usize of the new parent,
so the menu can sanely be size requested and we don't get nasty screen
artefacts upon next reparentation.
(gtk_menu_motion_notify): set send_event to TRUE if we synthesize an
enter notify. only synthesize enter notifies if the pointer really is
inside the event window.
(gtk_menu_popdown): use gtk_menu_shell_deselect().
(gtk_menu_popup): move the background setting stuff into
gtk_menu_tearoff_bg_copy() so it can be called from other places as well.
* gtk/gtkmenushell.c (gtk_menu_shell_button_press): use
gtk_menu_shell_select_item() to select the new item.
(gtk_menu_shell_deselect): export this function, so gtkmenu.c can
do the right thing for deselection as well.
Sat Mar 15 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.[hc]:
(gtk_widget_accelerators_locked): return whether a widget's accelerators
are locked.
* gtk/gtkmenu.c (gtk_menu_key_press): don't remove or install new or
existing accelerators if the widget's accelerators are locked.
Sat Mar 14 19:44:05 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.[hc]: allow managing of foreign menu items.
* gtk/gtkmenu.c: truely forward key press and key release events to
the menu widget from the toplevel or tearoff window. we can't simply
connect to that, we need to stop further processing of the events as
well.
Sat Mar 13 13:14:17 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.c:
(gtk_menu_key_press): pass event->keyval, event->state to
gtk_accelerator_valid, instead of event->keyval twice.
refuse to install single letter accelerators for menus that use
single letter shortcuts.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): use
gtk_menu_ensure_uline_accel_group().
* gtk/gtkmenu.[hc]: added gtk_menu_ensure_uline_accel_group()
which will always return an uline accel group, made
gtk_menu_get_uline_accel_group() return NULL if the group isn't
yet created.
Mon Mar 15 01:03:27 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h (struct _GtkCListColumn): added button_passive flag.
* gtk/gtkclist.c (gtk_clist_column_title_passive):
Leave button sensitive, trap button_press, button_release,
motion_notify, enter_notify and leave_notify events instead.
(gtk_clist_column_title_active): disconnect event handler.
(gtk_clist_drag_data_get): fixed memory leak. Reported by
Guillaume Laurent <glaurent@worldnet.fr>
Wed Mar 10 23:49:55 1999 Lars Hamann <lars@gtk.org>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): fixed a few
width/height mixups.
* gtk/gtkctree.c (tree_delete): emit an tree_unselect_row signal
if needed.
Wed Mar 10 00:11:32 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c (create_item_factory): unref the item factory after
window's destruction.
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): keep a reference
count on the menu shell around the menu item's activation, since the
signal emission may cause menu shell destruction.
* gtk/gtkitemfactory.c:
the previous code leaked one accel group per menu. we use
gtk_menu_get_uline_accel_group() now to fix that, and with that
also create the underline accelerator group of the menus only if
required (i.e. an underline accelerator has been specified).
(gtk_item_factory_construct):
(gtk_item_factory_create_item): removed code that would create an
extra accel group for the menu (and leak references).
(gtk_item_factory_create_item): adapted the underline accelerator
installation code to properly feature gtk_menu_get_uline_accel_group().
* gtk/gtkmenu.[hc]: added gtk_menu_get_accel_group() to retrive
menu->accel_group, this may return NULL if the accelerator group
hasn't been set yet.
added gtk_menu_get_uline_accel_group() to retrive the underline
accelerator group of the menu, this will be created on demand
and proper care is taken about its reference count.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c:
dumped the approach of keeping a widgets by action list on the
factory since the factory<->widget destroy negotiation didn't work
and would be hard to get going at all. instead we keep a list of
GtkItemFactoryItem items on the factory (GtkItemFactoryItems are
persistant throughout a program's life time).
also, i removed the static const gchar *key_* variables, and made
them inline strings (they weren't actually used anyways).
(gtk_item_factory_add_item): update ifactory->items.
(gtk_item_factory_destroy): destroy ifactory->items (and remove
the item factory pointer from the remaining ifactory widgets).
(gtk_item_factory_get_widget_by_action): walk the GtkItemFactoryItem
list to find the widget.
(gtk_item_factory_get_item): new function that works around
gtk_item_factory_get_widget() limitations, this function will only
return menu items, even for <Branch> entries.
Tue Mar 9 01:01:28 1999 Tim Janik <timj@gtk.org>
* gdk/gdkfont.c (gdk_font_load): first lookup the xfont ID in our
font hash table, if we have a GdkFontPrivate entry for this font
already, simply increment its reference count, provided by Olaf Dietsche
<olaf.dietsche+list.gtk@netcologne.de>.
* gtk/gtkstyle.c (gtk_style_copy): plug a GdkFont reference leak, fix
provided by Olaf Dietsche <olaf.dietsche+list.gtk@netcologne.de>.
Sun Mar 7 06:13:29 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c:
(gtk_container_add_with_args):
(gtk_container_addv):
(gtk_container_add): before adding a child to a conatiner, make sure
it is (default) constructed, this is neccessary because under certain
circumstances the child will get relized and mapped immediatedly, in
which case it has to be constructed already.
Mon Mar 1 17:58:21 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_connect_by_type): count object_signal
values > 1 as TRUE also.
1999-03-17 01:39:42 +00:00
|
|
|
(GtkSignalFunc) column_title_passive_func,
|
1999-04-30 11:48:42 +00:00
|
|
|
NULL);
|
Tue Mar 16 17:43:33 1999 Tim Janik <timj@gtk.org>
Wed Mar 17 01:46:28 1999 Tim Janik <timj@gtk.org>
* merges from gtk-1-2:
Tue Mar 16 17:43:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_string): ensure the
item factory class has been created.
(gtk_item_factory_parse_rc): likewise.
* gtk/gtkmenu.c:
keep proper references for old_active_menu_item.
(gtk_menu_reparent): unset the usize of the new parent,
so the menu can sanely be size requested and we don't get nasty screen
artefacts upon next reparentation.
(gtk_menu_motion_notify): set send_event to TRUE if we synthesize an
enter notify. only synthesize enter notifies if the pointer really is
inside the event window.
(gtk_menu_popdown): use gtk_menu_shell_deselect().
(gtk_menu_popup): move the background setting stuff into
gtk_menu_tearoff_bg_copy() so it can be called from other places as well.
* gtk/gtkmenushell.c (gtk_menu_shell_button_press): use
gtk_menu_shell_select_item() to select the new item.
(gtk_menu_shell_deselect): export this function, so gtkmenu.c can
do the right thing for deselection as well.
Sat Mar 15 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.[hc]:
(gtk_widget_accelerators_locked): return whether a widget's accelerators
are locked.
* gtk/gtkmenu.c (gtk_menu_key_press): don't remove or install new or
existing accelerators if the widget's accelerators are locked.
Sat Mar 14 19:44:05 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.[hc]: allow managing of foreign menu items.
* gtk/gtkmenu.c: truely forward key press and key release events to
the menu widget from the toplevel or tearoff window. we can't simply
connect to that, we need to stop further processing of the events as
well.
Sat Mar 13 13:14:17 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.c:
(gtk_menu_key_press): pass event->keyval, event->state to
gtk_accelerator_valid, instead of event->keyval twice.
refuse to install single letter accelerators for menus that use
single letter shortcuts.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): use
gtk_menu_ensure_uline_accel_group().
* gtk/gtkmenu.[hc]: added gtk_menu_ensure_uline_accel_group()
which will always return an uline accel group, made
gtk_menu_get_uline_accel_group() return NULL if the group isn't
yet created.
Mon Mar 15 01:03:27 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h (struct _GtkCListColumn): added button_passive flag.
* gtk/gtkclist.c (gtk_clist_column_title_passive):
Leave button sensitive, trap button_press, button_release,
motion_notify, enter_notify and leave_notify events instead.
(gtk_clist_column_title_active): disconnect event handler.
(gtk_clist_drag_data_get): fixed memory leak. Reported by
Guillaume Laurent <glaurent@worldnet.fr>
Wed Mar 10 23:49:55 1999 Lars Hamann <lars@gtk.org>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): fixed a few
width/height mixups.
* gtk/gtkctree.c (tree_delete): emit an tree_unselect_row signal
if needed.
Wed Mar 10 00:11:32 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c (create_item_factory): unref the item factory after
window's destruction.
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): keep a reference
count on the menu shell around the menu item's activation, since the
signal emission may cause menu shell destruction.
* gtk/gtkitemfactory.c:
the previous code leaked one accel group per menu. we use
gtk_menu_get_uline_accel_group() now to fix that, and with that
also create the underline accelerator group of the menus only if
required (i.e. an underline accelerator has been specified).
(gtk_item_factory_construct):
(gtk_item_factory_create_item): removed code that would create an
extra accel group for the menu (and leak references).
(gtk_item_factory_create_item): adapted the underline accelerator
installation code to properly feature gtk_menu_get_uline_accel_group().
* gtk/gtkmenu.[hc]: added gtk_menu_get_accel_group() to retrive
menu->accel_group, this may return NULL if the accelerator group
hasn't been set yet.
added gtk_menu_get_uline_accel_group() to retrive the underline
accelerator group of the menu, this will be created on demand
and proper care is taken about its reference count.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c:
dumped the approach of keeping a widgets by action list on the
factory since the factory<->widget destroy negotiation didn't work
and would be hard to get going at all. instead we keep a list of
GtkItemFactoryItem items on the factory (GtkItemFactoryItems are
persistant throughout a program's life time).
also, i removed the static const gchar *key_* variables, and made
them inline strings (they weren't actually used anyways).
(gtk_item_factory_add_item): update ifactory->items.
(gtk_item_factory_destroy): destroy ifactory->items (and remove
the item factory pointer from the remaining ifactory widgets).
(gtk_item_factory_get_widget_by_action): walk the GtkItemFactoryItem
list to find the widget.
(gtk_item_factory_get_item): new function that works around
gtk_item_factory_get_widget() limitations, this function will only
return menu items, even for <Branch> entries.
Tue Mar 9 01:01:28 1999 Tim Janik <timj@gtk.org>
* gdk/gdkfont.c (gdk_font_load): first lookup the xfont ID in our
font hash table, if we have a GdkFontPrivate entry for this font
already, simply increment its reference count, provided by Olaf Dietsche
<olaf.dietsche+list.gtk@netcologne.de>.
* gtk/gtkstyle.c (gtk_style_copy): plug a GdkFont reference leak, fix
provided by Olaf Dietsche <olaf.dietsche+list.gtk@netcologne.de>.
Sun Mar 7 06:13:29 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c:
(gtk_container_add_with_args):
(gtk_container_addv):
(gtk_container_add): before adding a child to a conatiner, make sure
it is (default) constructed, this is neccessary because under certain
circumstances the child will get relized and mapped immediatedly, in
which case it has to be constructed already.
Mon Mar 1 17:58:21 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_connect_by_type): count object_signal
values > 1 as TRUE also.
1999-03-17 01:39:42 +00:00
|
|
|
|
|
|
|
GTK_WIDGET_SET_FLAGS (clist->column[column].button, GTK_CAN_FOCUS);
|
|
|
|
if (GTK_WIDGET_VISIBLE (clist))
|
|
|
|
gtk_widget_queue_draw (clist->column[column].button);
|
1998-01-21 08:56:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_clist_column_title_passive (GtkCList *clist,
|
|
|
|
gint column)
|
1998-01-21 08:56:52 +00:00
|
|
|
{
|
Tue Mar 16 17:43:33 1999 Tim Janik <timj@gtk.org>
Wed Mar 17 01:46:28 1999 Tim Janik <timj@gtk.org>
* merges from gtk-1-2:
Tue Mar 16 17:43:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_string): ensure the
item factory class has been created.
(gtk_item_factory_parse_rc): likewise.
* gtk/gtkmenu.c:
keep proper references for old_active_menu_item.
(gtk_menu_reparent): unset the usize of the new parent,
so the menu can sanely be size requested and we don't get nasty screen
artefacts upon next reparentation.
(gtk_menu_motion_notify): set send_event to TRUE if we synthesize an
enter notify. only synthesize enter notifies if the pointer really is
inside the event window.
(gtk_menu_popdown): use gtk_menu_shell_deselect().
(gtk_menu_popup): move the background setting stuff into
gtk_menu_tearoff_bg_copy() so it can be called from other places as well.
* gtk/gtkmenushell.c (gtk_menu_shell_button_press): use
gtk_menu_shell_select_item() to select the new item.
(gtk_menu_shell_deselect): export this function, so gtkmenu.c can
do the right thing for deselection as well.
Sat Mar 15 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.[hc]:
(gtk_widget_accelerators_locked): return whether a widget's accelerators
are locked.
* gtk/gtkmenu.c (gtk_menu_key_press): don't remove or install new or
existing accelerators if the widget's accelerators are locked.
Sat Mar 14 19:44:05 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.[hc]: allow managing of foreign menu items.
* gtk/gtkmenu.c: truely forward key press and key release events to
the menu widget from the toplevel or tearoff window. we can't simply
connect to that, we need to stop further processing of the events as
well.
Sat Mar 13 13:14:17 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.c:
(gtk_menu_key_press): pass event->keyval, event->state to
gtk_accelerator_valid, instead of event->keyval twice.
refuse to install single letter accelerators for menus that use
single letter shortcuts.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): use
gtk_menu_ensure_uline_accel_group().
* gtk/gtkmenu.[hc]: added gtk_menu_ensure_uline_accel_group()
which will always return an uline accel group, made
gtk_menu_get_uline_accel_group() return NULL if the group isn't
yet created.
Mon Mar 15 01:03:27 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h (struct _GtkCListColumn): added button_passive flag.
* gtk/gtkclist.c (gtk_clist_column_title_passive):
Leave button sensitive, trap button_press, button_release,
motion_notify, enter_notify and leave_notify events instead.
(gtk_clist_column_title_active): disconnect event handler.
(gtk_clist_drag_data_get): fixed memory leak. Reported by
Guillaume Laurent <glaurent@worldnet.fr>
Wed Mar 10 23:49:55 1999 Lars Hamann <lars@gtk.org>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): fixed a few
width/height mixups.
* gtk/gtkctree.c (tree_delete): emit an tree_unselect_row signal
if needed.
Wed Mar 10 00:11:32 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c (create_item_factory): unref the item factory after
window's destruction.
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): keep a reference
count on the menu shell around the menu item's activation, since the
signal emission may cause menu shell destruction.
* gtk/gtkitemfactory.c:
the previous code leaked one accel group per menu. we use
gtk_menu_get_uline_accel_group() now to fix that, and with that
also create the underline accelerator group of the menus only if
required (i.e. an underline accelerator has been specified).
(gtk_item_factory_construct):
(gtk_item_factory_create_item): removed code that would create an
extra accel group for the menu (and leak references).
(gtk_item_factory_create_item): adapted the underline accelerator
installation code to properly feature gtk_menu_get_uline_accel_group().
* gtk/gtkmenu.[hc]: added gtk_menu_get_accel_group() to retrive
menu->accel_group, this may return NULL if the accelerator group
hasn't been set yet.
added gtk_menu_get_uline_accel_group() to retrive the underline
accelerator group of the menu, this will be created on demand
and proper care is taken about its reference count.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c:
dumped the approach of keeping a widgets by action list on the
factory since the factory<->widget destroy negotiation didn't work
and would be hard to get going at all. instead we keep a list of
GtkItemFactoryItem items on the factory (GtkItemFactoryItems are
persistant throughout a program's life time).
also, i removed the static const gchar *key_* variables, and made
them inline strings (they weren't actually used anyways).
(gtk_item_factory_add_item): update ifactory->items.
(gtk_item_factory_destroy): destroy ifactory->items (and remove
the item factory pointer from the remaining ifactory widgets).
(gtk_item_factory_get_widget_by_action): walk the GtkItemFactoryItem
list to find the widget.
(gtk_item_factory_get_item): new function that works around
gtk_item_factory_get_widget() limitations, this function will only
return menu items, even for <Branch> entries.
Tue Mar 9 01:01:28 1999 Tim Janik <timj@gtk.org>
* gdk/gdkfont.c (gdk_font_load): first lookup the xfont ID in our
font hash table, if we have a GdkFontPrivate entry for this font
already, simply increment its reference count, provided by Olaf Dietsche
<olaf.dietsche+list.gtk@netcologne.de>.
* gtk/gtkstyle.c (gtk_style_copy): plug a GdkFont reference leak, fix
provided by Olaf Dietsche <olaf.dietsche+list.gtk@netcologne.de>.
Sun Mar 7 06:13:29 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c:
(gtk_container_add_with_args):
(gtk_container_addv):
(gtk_container_add): before adding a child to a conatiner, make sure
it is (default) constructed, this is neccessary because under certain
circumstances the child will get relized and mapped immediatedly, in
which case it has to be constructed already.
Mon Mar 1 17:58:21 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_connect_by_type): count object_signal
values > 1 as TRUE also.
1999-03-17 01:39:42 +00:00
|
|
|
GtkButton *button;
|
|
|
|
|
1998-01-21 08:56:52 +00:00
|
|
|
g_return_if_fail (clist != NULL);
|
1998-07-15 23:40:00 +00:00
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-01-21 08:56:52 +00:00
|
|
|
|
|
|
|
if (column < 0 || column >= clist->columns)
|
|
|
|
return;
|
Tue Mar 16 17:43:33 1999 Tim Janik <timj@gtk.org>
Wed Mar 17 01:46:28 1999 Tim Janik <timj@gtk.org>
* merges from gtk-1-2:
Tue Mar 16 17:43:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_string): ensure the
item factory class has been created.
(gtk_item_factory_parse_rc): likewise.
* gtk/gtkmenu.c:
keep proper references for old_active_menu_item.
(gtk_menu_reparent): unset the usize of the new parent,
so the menu can sanely be size requested and we don't get nasty screen
artefacts upon next reparentation.
(gtk_menu_motion_notify): set send_event to TRUE if we synthesize an
enter notify. only synthesize enter notifies if the pointer really is
inside the event window.
(gtk_menu_popdown): use gtk_menu_shell_deselect().
(gtk_menu_popup): move the background setting stuff into
gtk_menu_tearoff_bg_copy() so it can be called from other places as well.
* gtk/gtkmenushell.c (gtk_menu_shell_button_press): use
gtk_menu_shell_select_item() to select the new item.
(gtk_menu_shell_deselect): export this function, so gtkmenu.c can
do the right thing for deselection as well.
Sat Mar 15 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.[hc]:
(gtk_widget_accelerators_locked): return whether a widget's accelerators
are locked.
* gtk/gtkmenu.c (gtk_menu_key_press): don't remove or install new or
existing accelerators if the widget's accelerators are locked.
Sat Mar 14 19:44:05 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.[hc]: allow managing of foreign menu items.
* gtk/gtkmenu.c: truely forward key press and key release events to
the menu widget from the toplevel or tearoff window. we can't simply
connect to that, we need to stop further processing of the events as
well.
Sat Mar 13 13:14:17 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.c:
(gtk_menu_key_press): pass event->keyval, event->state to
gtk_accelerator_valid, instead of event->keyval twice.
refuse to install single letter accelerators for menus that use
single letter shortcuts.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): use
gtk_menu_ensure_uline_accel_group().
* gtk/gtkmenu.[hc]: added gtk_menu_ensure_uline_accel_group()
which will always return an uline accel group, made
gtk_menu_get_uline_accel_group() return NULL if the group isn't
yet created.
Mon Mar 15 01:03:27 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h (struct _GtkCListColumn): added button_passive flag.
* gtk/gtkclist.c (gtk_clist_column_title_passive):
Leave button sensitive, trap button_press, button_release,
motion_notify, enter_notify and leave_notify events instead.
(gtk_clist_column_title_active): disconnect event handler.
(gtk_clist_drag_data_get): fixed memory leak. Reported by
Guillaume Laurent <glaurent@worldnet.fr>
Wed Mar 10 23:49:55 1999 Lars Hamann <lars@gtk.org>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): fixed a few
width/height mixups.
* gtk/gtkctree.c (tree_delete): emit an tree_unselect_row signal
if needed.
Wed Mar 10 00:11:32 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c (create_item_factory): unref the item factory after
window's destruction.
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): keep a reference
count on the menu shell around the menu item's activation, since the
signal emission may cause menu shell destruction.
* gtk/gtkitemfactory.c:
the previous code leaked one accel group per menu. we use
gtk_menu_get_uline_accel_group() now to fix that, and with that
also create the underline accelerator group of the menus only if
required (i.e. an underline accelerator has been specified).
(gtk_item_factory_construct):
(gtk_item_factory_create_item): removed code that would create an
extra accel group for the menu (and leak references).
(gtk_item_factory_create_item): adapted the underline accelerator
installation code to properly feature gtk_menu_get_uline_accel_group().
* gtk/gtkmenu.[hc]: added gtk_menu_get_accel_group() to retrive
menu->accel_group, this may return NULL if the accelerator group
hasn't been set yet.
added gtk_menu_get_uline_accel_group() to retrive the underline
accelerator group of the menu, this will be created on demand
and proper care is taken about its reference count.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c:
dumped the approach of keeping a widgets by action list on the
factory since the factory<->widget destroy negotiation didn't work
and would be hard to get going at all. instead we keep a list of
GtkItemFactoryItem items on the factory (GtkItemFactoryItems are
persistant throughout a program's life time).
also, i removed the static const gchar *key_* variables, and made
them inline strings (they weren't actually used anyways).
(gtk_item_factory_add_item): update ifactory->items.
(gtk_item_factory_destroy): destroy ifactory->items (and remove
the item factory pointer from the remaining ifactory widgets).
(gtk_item_factory_get_widget_by_action): walk the GtkItemFactoryItem
list to find the widget.
(gtk_item_factory_get_item): new function that works around
gtk_item_factory_get_widget() limitations, this function will only
return menu items, even for <Branch> entries.
Tue Mar 9 01:01:28 1999 Tim Janik <timj@gtk.org>
* gdk/gdkfont.c (gdk_font_load): first lookup the xfont ID in our
font hash table, if we have a GdkFontPrivate entry for this font
already, simply increment its reference count, provided by Olaf Dietsche
<olaf.dietsche+list.gtk@netcologne.de>.
* gtk/gtkstyle.c (gtk_style_copy): plug a GdkFont reference leak, fix
provided by Olaf Dietsche <olaf.dietsche+list.gtk@netcologne.de>.
Sun Mar 7 06:13:29 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c:
(gtk_container_add_with_args):
(gtk_container_addv):
(gtk_container_add): before adding a child to a conatiner, make sure
it is (default) constructed, this is neccessary because under certain
circumstances the child will get relized and mapped immediatedly, in
which case it has to be constructed already.
Mon Mar 1 17:58:21 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_connect_by_type): count object_signal
values > 1 as TRUE also.
1999-03-17 01:39:42 +00:00
|
|
|
if (!clist->column[column].button || clist->column[column].button_passive)
|
1998-12-04 00:04:31 +00:00
|
|
|
return;
|
1998-01-21 08:56:52 +00:00
|
|
|
|
Tue Mar 16 17:43:33 1999 Tim Janik <timj@gtk.org>
Wed Mar 17 01:46:28 1999 Tim Janik <timj@gtk.org>
* merges from gtk-1-2:
Tue Mar 16 17:43:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_string): ensure the
item factory class has been created.
(gtk_item_factory_parse_rc): likewise.
* gtk/gtkmenu.c:
keep proper references for old_active_menu_item.
(gtk_menu_reparent): unset the usize of the new parent,
so the menu can sanely be size requested and we don't get nasty screen
artefacts upon next reparentation.
(gtk_menu_motion_notify): set send_event to TRUE if we synthesize an
enter notify. only synthesize enter notifies if the pointer really is
inside the event window.
(gtk_menu_popdown): use gtk_menu_shell_deselect().
(gtk_menu_popup): move the background setting stuff into
gtk_menu_tearoff_bg_copy() so it can be called from other places as well.
* gtk/gtkmenushell.c (gtk_menu_shell_button_press): use
gtk_menu_shell_select_item() to select the new item.
(gtk_menu_shell_deselect): export this function, so gtkmenu.c can
do the right thing for deselection as well.
Sat Mar 15 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.[hc]:
(gtk_widget_accelerators_locked): return whether a widget's accelerators
are locked.
* gtk/gtkmenu.c (gtk_menu_key_press): don't remove or install new or
existing accelerators if the widget's accelerators are locked.
Sat Mar 14 19:44:05 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.[hc]: allow managing of foreign menu items.
* gtk/gtkmenu.c: truely forward key press and key release events to
the menu widget from the toplevel or tearoff window. we can't simply
connect to that, we need to stop further processing of the events as
well.
Sat Mar 13 13:14:17 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.c:
(gtk_menu_key_press): pass event->keyval, event->state to
gtk_accelerator_valid, instead of event->keyval twice.
refuse to install single letter accelerators for menus that use
single letter shortcuts.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): use
gtk_menu_ensure_uline_accel_group().
* gtk/gtkmenu.[hc]: added gtk_menu_ensure_uline_accel_group()
which will always return an uline accel group, made
gtk_menu_get_uline_accel_group() return NULL if the group isn't
yet created.
Mon Mar 15 01:03:27 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h (struct _GtkCListColumn): added button_passive flag.
* gtk/gtkclist.c (gtk_clist_column_title_passive):
Leave button sensitive, trap button_press, button_release,
motion_notify, enter_notify and leave_notify events instead.
(gtk_clist_column_title_active): disconnect event handler.
(gtk_clist_drag_data_get): fixed memory leak. Reported by
Guillaume Laurent <glaurent@worldnet.fr>
Wed Mar 10 23:49:55 1999 Lars Hamann <lars@gtk.org>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): fixed a few
width/height mixups.
* gtk/gtkctree.c (tree_delete): emit an tree_unselect_row signal
if needed.
Wed Mar 10 00:11:32 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c (create_item_factory): unref the item factory after
window's destruction.
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): keep a reference
count on the menu shell around the menu item's activation, since the
signal emission may cause menu shell destruction.
* gtk/gtkitemfactory.c:
the previous code leaked one accel group per menu. we use
gtk_menu_get_uline_accel_group() now to fix that, and with that
also create the underline accelerator group of the menus only if
required (i.e. an underline accelerator has been specified).
(gtk_item_factory_construct):
(gtk_item_factory_create_item): removed code that would create an
extra accel group for the menu (and leak references).
(gtk_item_factory_create_item): adapted the underline accelerator
installation code to properly feature gtk_menu_get_uline_accel_group().
* gtk/gtkmenu.[hc]: added gtk_menu_get_accel_group() to retrive
menu->accel_group, this may return NULL if the accelerator group
hasn't been set yet.
added gtk_menu_get_uline_accel_group() to retrive the underline
accelerator group of the menu, this will be created on demand
and proper care is taken about its reference count.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c:
dumped the approach of keeping a widgets by action list on the
factory since the factory<->widget destroy negotiation didn't work
and would be hard to get going at all. instead we keep a list of
GtkItemFactoryItem items on the factory (GtkItemFactoryItems are
persistant throughout a program's life time).
also, i removed the static const gchar *key_* variables, and made
them inline strings (they weren't actually used anyways).
(gtk_item_factory_add_item): update ifactory->items.
(gtk_item_factory_destroy): destroy ifactory->items (and remove
the item factory pointer from the remaining ifactory widgets).
(gtk_item_factory_get_widget_by_action): walk the GtkItemFactoryItem
list to find the widget.
(gtk_item_factory_get_item): new function that works around
gtk_item_factory_get_widget() limitations, this function will only
return menu items, even for <Branch> entries.
Tue Mar 9 01:01:28 1999 Tim Janik <timj@gtk.org>
* gdk/gdkfont.c (gdk_font_load): first lookup the xfont ID in our
font hash table, if we have a GdkFontPrivate entry for this font
already, simply increment its reference count, provided by Olaf Dietsche
<olaf.dietsche+list.gtk@netcologne.de>.
* gtk/gtkstyle.c (gtk_style_copy): plug a GdkFont reference leak, fix
provided by Olaf Dietsche <olaf.dietsche+list.gtk@netcologne.de>.
Sun Mar 7 06:13:29 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c:
(gtk_container_add_with_args):
(gtk_container_addv):
(gtk_container_add): before adding a child to a conatiner, make sure
it is (default) constructed, this is neccessary because under certain
circumstances the child will get relized and mapped immediatedly, in
which case it has to be constructed already.
Mon Mar 1 17:58:21 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_connect_by_type): count object_signal
values > 1 as TRUE also.
1999-03-17 01:39:42 +00:00
|
|
|
button = GTK_BUTTON (clist->column[column].button);
|
|
|
|
|
|
|
|
clist->column[column].button_passive = TRUE;
|
|
|
|
|
|
|
|
if (button->button_down)
|
|
|
|
gtk_button_released (button);
|
|
|
|
if (button->in_button)
|
|
|
|
gtk_button_leave (button);
|
|
|
|
|
1999-04-30 11:48:42 +00:00
|
|
|
gtk_signal_connect (GTK_OBJECT (clist->column[column].button), "event",
|
|
|
|
(GtkSignalFunc) column_title_passive_func, NULL);
|
Tue Mar 16 17:43:33 1999 Tim Janik <timj@gtk.org>
Wed Mar 17 01:46:28 1999 Tim Janik <timj@gtk.org>
* merges from gtk-1-2:
Tue Mar 16 17:43:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_string): ensure the
item factory class has been created.
(gtk_item_factory_parse_rc): likewise.
* gtk/gtkmenu.c:
keep proper references for old_active_menu_item.
(gtk_menu_reparent): unset the usize of the new parent,
so the menu can sanely be size requested and we don't get nasty screen
artefacts upon next reparentation.
(gtk_menu_motion_notify): set send_event to TRUE if we synthesize an
enter notify. only synthesize enter notifies if the pointer really is
inside the event window.
(gtk_menu_popdown): use gtk_menu_shell_deselect().
(gtk_menu_popup): move the background setting stuff into
gtk_menu_tearoff_bg_copy() so it can be called from other places as well.
* gtk/gtkmenushell.c (gtk_menu_shell_button_press): use
gtk_menu_shell_select_item() to select the new item.
(gtk_menu_shell_deselect): export this function, so gtkmenu.c can
do the right thing for deselection as well.
Sat Mar 15 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.[hc]:
(gtk_widget_accelerators_locked): return whether a widget's accelerators
are locked.
* gtk/gtkmenu.c (gtk_menu_key_press): don't remove or install new or
existing accelerators if the widget's accelerators are locked.
Sat Mar 14 19:44:05 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.[hc]: allow managing of foreign menu items.
* gtk/gtkmenu.c: truely forward key press and key release events to
the menu widget from the toplevel or tearoff window. we can't simply
connect to that, we need to stop further processing of the events as
well.
Sat Mar 13 13:14:17 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.c:
(gtk_menu_key_press): pass event->keyval, event->state to
gtk_accelerator_valid, instead of event->keyval twice.
refuse to install single letter accelerators for menus that use
single letter shortcuts.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): use
gtk_menu_ensure_uline_accel_group().
* gtk/gtkmenu.[hc]: added gtk_menu_ensure_uline_accel_group()
which will always return an uline accel group, made
gtk_menu_get_uline_accel_group() return NULL if the group isn't
yet created.
Mon Mar 15 01:03:27 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h (struct _GtkCListColumn): added button_passive flag.
* gtk/gtkclist.c (gtk_clist_column_title_passive):
Leave button sensitive, trap button_press, button_release,
motion_notify, enter_notify and leave_notify events instead.
(gtk_clist_column_title_active): disconnect event handler.
(gtk_clist_drag_data_get): fixed memory leak. Reported by
Guillaume Laurent <glaurent@worldnet.fr>
Wed Mar 10 23:49:55 1999 Lars Hamann <lars@gtk.org>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): fixed a few
width/height mixups.
* gtk/gtkctree.c (tree_delete): emit an tree_unselect_row signal
if needed.
Wed Mar 10 00:11:32 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c (create_item_factory): unref the item factory after
window's destruction.
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): keep a reference
count on the menu shell around the menu item's activation, since the
signal emission may cause menu shell destruction.
* gtk/gtkitemfactory.c:
the previous code leaked one accel group per menu. we use
gtk_menu_get_uline_accel_group() now to fix that, and with that
also create the underline accelerator group of the menus only if
required (i.e. an underline accelerator has been specified).
(gtk_item_factory_construct):
(gtk_item_factory_create_item): removed code that would create an
extra accel group for the menu (and leak references).
(gtk_item_factory_create_item): adapted the underline accelerator
installation code to properly feature gtk_menu_get_uline_accel_group().
* gtk/gtkmenu.[hc]: added gtk_menu_get_accel_group() to retrive
menu->accel_group, this may return NULL if the accelerator group
hasn't been set yet.
added gtk_menu_get_uline_accel_group() to retrive the underline
accelerator group of the menu, this will be created on demand
and proper care is taken about its reference count.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c:
dumped the approach of keeping a widgets by action list on the
factory since the factory<->widget destroy negotiation didn't work
and would be hard to get going at all. instead we keep a list of
GtkItemFactoryItem items on the factory (GtkItemFactoryItems are
persistant throughout a program's life time).
also, i removed the static const gchar *key_* variables, and made
them inline strings (they weren't actually used anyways).
(gtk_item_factory_add_item): update ifactory->items.
(gtk_item_factory_destroy): destroy ifactory->items (and remove
the item factory pointer from the remaining ifactory widgets).
(gtk_item_factory_get_widget_by_action): walk the GtkItemFactoryItem
list to find the widget.
(gtk_item_factory_get_item): new function that works around
gtk_item_factory_get_widget() limitations, this function will only
return menu items, even for <Branch> entries.
Tue Mar 9 01:01:28 1999 Tim Janik <timj@gtk.org>
* gdk/gdkfont.c (gdk_font_load): first lookup the xfont ID in our
font hash table, if we have a GdkFontPrivate entry for this font
already, simply increment its reference count, provided by Olaf Dietsche
<olaf.dietsche+list.gtk@netcologne.de>.
* gtk/gtkstyle.c (gtk_style_copy): plug a GdkFont reference leak, fix
provided by Olaf Dietsche <olaf.dietsche+list.gtk@netcologne.de>.
Sun Mar 7 06:13:29 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c:
(gtk_container_add_with_args):
(gtk_container_addv):
(gtk_container_add): before adding a child to a conatiner, make sure
it is (default) constructed, this is neccessary because under certain
circumstances the child will get relized and mapped immediatedly, in
which case it has to be constructed already.
Mon Mar 1 17:58:21 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_connect_by_type): count object_signal
values > 1 as TRUE also.
1999-03-17 01:39:42 +00:00
|
|
|
|
|
|
|
GTK_WIDGET_UNSET_FLAGS (clist->column[column].button, GTK_CAN_FOCUS);
|
|
|
|
if (GTK_WIDGET_VISIBLE (clist))
|
|
|
|
gtk_widget_queue_draw (clist->column[column].button);
|
1998-01-21 08:56:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_clist_column_titles_active (GtkCList *clist)
|
1998-01-21 08:56:52 +00:00
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
g_return_if_fail (clist != NULL);
|
1998-07-15 23:40:00 +00:00
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-01-21 08:56:52 +00:00
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (!GTK_CLIST_SHOW_TITLES(clist))
|
|
|
|
return;
|
|
|
|
|
1998-01-21 08:56:52 +00:00
|
|
|
for (i = 0; i < clist->columns; i++)
|
1998-12-04 00:04:31 +00:00
|
|
|
gtk_clist_column_title_active (clist, i);
|
1998-01-21 08:56:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_clist_column_titles_passive (GtkCList *clist)
|
1998-01-21 08:56:52 +00:00
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
g_return_if_fail (clist != NULL);
|
1998-07-15 23:40:00 +00:00
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-01-21 08:56:52 +00:00
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (!GTK_CLIST_SHOW_TITLES(clist))
|
1998-12-04 00:04:31 +00:00
|
|
|
return;
|
|
|
|
|
1998-01-21 08:56:52 +00:00
|
|
|
for (i = 0; i < clist->columns; i++)
|
1998-12-04 00:04:31 +00:00
|
|
|
gtk_clist_column_title_passive (clist, i);
|
1998-01-21 08:56:52 +00:00
|
|
|
}
|
|
|
|
|
1998-01-03 03:31:03 +00:00
|
|
|
void
|
1998-09-03 07:28:37 +00:00
|
|
|
gtk_clist_set_column_title (GtkCList *clist,
|
|
|
|
gint column,
|
|
|
|
const gchar *title)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-01-19 09:59:20 +00:00
|
|
|
gint new_button = 0;
|
1998-01-03 03:31:03 +00:00
|
|
|
GtkWidget *old_widget;
|
1998-01-03 07:45:05 +00:00
|
|
|
GtkWidget *alignment = NULL;
|
1998-01-03 03:31:03 +00:00
|
|
|
GtkWidget *label;
|
|
|
|
|
|
|
|
g_return_if_fail (clist != NULL);
|
1998-07-15 23:40:00 +00:00
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-01-03 03:31:03 +00:00
|
|
|
|
|
|
|
if (column < 0 || column >= clist->columns)
|
|
|
|
return;
|
|
|
|
|
1998-01-31 03:33:02 +00:00
|
|
|
/* if the column button doesn't currently exist,
|
1998-01-19 09:59:20 +00:00
|
|
|
* it has to be created first */
|
|
|
|
if (!clist->column[column].button)
|
|
|
|
{
|
|
|
|
column_button_create (clist, column);
|
|
|
|
new_button = 1;
|
|
|
|
}
|
|
|
|
|
1998-01-24 19:14:42 +00:00
|
|
|
column_title_new (clist, column, title);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
|
|
|
/* remove and destroy the old widget */
|
1998-07-07 01:25:27 +00:00
|
|
|
old_widget = GTK_BIN (clist->column[column].button)->child;
|
1998-01-03 03:31:03 +00:00
|
|
|
if (old_widget)
|
1998-03-18 21:11:04 +00:00
|
|
|
gtk_container_remove (GTK_CONTAINER (clist->column[column].button), old_widget);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-01-19 09:59:20 +00:00
|
|
|
/* create new alignment based no column justification */
|
1998-01-03 03:31:03 +00:00
|
|
|
switch (clist->column[column].justification)
|
|
|
|
{
|
|
|
|
case GTK_JUSTIFY_LEFT:
|
|
|
|
alignment = gtk_alignment_new (0.0, 0.5, 0.0, 0.0);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GTK_JUSTIFY_RIGHT:
|
|
|
|
alignment = gtk_alignment_new (1.0, 0.5, 0.0, 0.0);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GTK_JUSTIFY_CENTER:
|
|
|
|
alignment = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GTK_JUSTIFY_FILL:
|
|
|
|
alignment = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
gtk_widget_push_composite_child ();
|
1998-01-19 09:59:20 +00:00
|
|
|
label = gtk_label_new (clist->column[column].title);
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
gtk_widget_pop_composite_child ();
|
1998-01-19 09:59:20 +00:00
|
|
|
gtk_container_add (GTK_CONTAINER (alignment), label);
|
|
|
|
gtk_container_add (GTK_CONTAINER (clist->column[column].button), alignment);
|
|
|
|
gtk_widget_show (label);
|
|
|
|
gtk_widget_show (alignment);
|
|
|
|
|
1998-01-31 03:33:02 +00:00
|
|
|
/* if this button didn't previously exist, then the
|
1998-01-19 09:59:20 +00:00
|
|
|
* column button positions have to be re-computed */
|
|
|
|
if (GTK_WIDGET_VISIBLE (clist) && new_button)
|
1998-01-21 08:56:52 +00:00
|
|
|
size_allocate_title_buttons (clist);
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
|
1998-11-18 23:55:10 +00:00
|
|
|
gchar *
|
|
|
|
gtk_clist_get_column_title (GtkCList *clist,
|
|
|
|
gint column)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (clist != NULL, NULL);
|
|
|
|
g_return_val_if_fail (GTK_IS_CLIST (clist), NULL);
|
|
|
|
|
|
|
|
if (column < 0 || column >= clist->columns)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
return clist->column[column].title;
|
|
|
|
}
|
|
|
|
|
1998-01-03 03:31:03 +00:00
|
|
|
void
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_clist_set_column_widget (GtkCList *clist,
|
|
|
|
gint column,
|
|
|
|
GtkWidget *widget)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-01-19 09:59:20 +00:00
|
|
|
gint new_button = 0;
|
1998-01-03 03:31:03 +00:00
|
|
|
GtkWidget *old_widget;
|
|
|
|
|
|
|
|
g_return_if_fail (clist != NULL);
|
1998-07-15 23:40:00 +00:00
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-01-03 03:31:03 +00:00
|
|
|
|
|
|
|
if (column < 0 || column >= clist->columns)
|
|
|
|
return;
|
|
|
|
|
1998-01-31 03:33:02 +00:00
|
|
|
/* if the column button doesn't currently exist,
|
1998-01-19 09:59:20 +00:00
|
|
|
* it has to be created first */
|
|
|
|
if (!clist->column[column].button)
|
|
|
|
{
|
|
|
|
column_button_create (clist, column);
|
|
|
|
new_button = 1;
|
|
|
|
}
|
|
|
|
|
1998-01-24 19:14:42 +00:00
|
|
|
column_title_new (clist, column, NULL);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
|
|
|
/* remove and destroy the old widget */
|
1998-07-07 01:25:27 +00:00
|
|
|
old_widget = GTK_BIN (clist->column[column].button)->child;
|
1998-01-03 03:31:03 +00:00
|
|
|
if (old_widget)
|
1998-11-07 14:29:22 +00:00
|
|
|
gtk_container_remove (GTK_CONTAINER (clist->column[column].button),
|
|
|
|
old_widget);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
|
|
|
/* add and show the widget */
|
|
|
|
if (widget)
|
|
|
|
{
|
|
|
|
gtk_container_add (GTK_CONTAINER (clist->column[column].button), widget);
|
|
|
|
gtk_widget_show (widget);
|
|
|
|
}
|
1998-01-19 09:59:20 +00:00
|
|
|
|
1998-01-31 03:33:02 +00:00
|
|
|
/* if this button didn't previously exist, then the
|
1998-01-19 09:59:20 +00:00
|
|
|
* column button positions have to be re-computed */
|
|
|
|
if (GTK_WIDGET_VISIBLE (clist) && new_button)
|
1998-01-21 08:56:52 +00:00
|
|
|
size_allocate_title_buttons (clist);
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
|
1998-11-18 23:55:10 +00:00
|
|
|
GtkWidget *
|
|
|
|
gtk_clist_get_column_widget (GtkCList *clist,
|
|
|
|
gint column)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (clist != NULL, NULL);
|
|
|
|
g_return_val_if_fail (GTK_IS_CLIST (clist), NULL);
|
|
|
|
|
|
|
|
if (column < 0 || column >= clist->columns)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
if (clist->column[column].button)
|
|
|
|
return GTK_BUTTON (clist->column[column].button)->child;
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
1998-01-03 03:31:03 +00:00
|
|
|
void
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_clist_set_column_justification (GtkCList *clist,
|
|
|
|
gint column,
|
|
|
|
GtkJustification justification)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
|
|
|
GtkWidget *alignment;
|
|
|
|
|
|
|
|
g_return_if_fail (clist != NULL);
|
1998-07-15 23:40:00 +00:00
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-01-03 03:31:03 +00:00
|
|
|
|
|
|
|
if (column < 0 || column >= clist->columns)
|
|
|
|
return;
|
|
|
|
|
|
|
|
clist->column[column].justification = justification;
|
|
|
|
|
|
|
|
/* change the alinment of the button title if it's not a
|
|
|
|
* custom widget */
|
|
|
|
if (clist->column[column].title)
|
|
|
|
{
|
1998-07-07 01:25:27 +00:00
|
|
|
alignment = GTK_BIN (clist->column[column].button)->child;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
|
|
|
switch (clist->column[column].justification)
|
|
|
|
{
|
|
|
|
case GTK_JUSTIFY_LEFT:
|
|
|
|
gtk_alignment_set (GTK_ALIGNMENT (alignment), 0.0, 0.5, 0.0, 0.0);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GTK_JUSTIFY_RIGHT:
|
|
|
|
gtk_alignment_set (GTK_ALIGNMENT (alignment), 1.0, 0.5, 0.0, 0.0);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GTK_JUSTIFY_CENTER:
|
|
|
|
gtk_alignment_set (GTK_ALIGNMENT (alignment), 0.5, 0.5, 0.0, 0.0);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GTK_JUSTIFY_FILL:
|
|
|
|
gtk_alignment_set (GTK_ALIGNMENT (alignment), 0.5, 0.5, 0.0, 0.0);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
if (CLIST_UNFROZEN (clist))
|
1998-01-24 19:14:42 +00:00
|
|
|
draw_rows (clist, NULL);
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
void
|
|
|
|
gtk_clist_set_column_visibility (GtkCList *clist,
|
|
|
|
gint column,
|
|
|
|
gboolean visible)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (clist != NULL);
|
1998-07-15 23:40:00 +00:00
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-01-03 03:31:03 +00:00
|
|
|
|
|
|
|
if (column < 0 || column >= clist->columns)
|
|
|
|
return;
|
1998-10-19 22:46:38 +00:00
|
|
|
if (clist->column[column].visible == visible)
|
|
|
|
return;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* don't hide last visible column */
|
|
|
|
if (!visible)
|
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
gint vis_columns = 0;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
for (i = 0, vis_columns = 0; i < clist->columns && vis_columns < 2; i++)
|
|
|
|
if (clist->column[i].visible)
|
|
|
|
vis_columns++;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (vis_columns < 2)
|
|
|
|
return;
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
|
|
|
|
clist->column[column].visible = visible;
|
1998-12-04 00:04:31 +00:00
|
|
|
|
|
|
|
if (clist->column[column].button)
|
|
|
|
{
|
|
|
|
if (visible)
|
|
|
|
gtk_widget_show (clist->column[column].button);
|
|
|
|
else
|
|
|
|
gtk_widget_hide (clist->column[column].button);
|
|
|
|
}
|
1999-01-17 23:44:18 +00:00
|
|
|
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET(clist));
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
|
1998-10-07 00:03:24 +00:00
|
|
|
void
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_clist_set_column_resizeable (GtkCList *clist,
|
|
|
|
gint column,
|
1999-09-17 18:17:20 +00:00
|
|
|
gboolean resizeable)
|
1998-10-07 00:03:24 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
|
|
|
|
|
|
|
if (column < 0 || column >= clist->columns)
|
|
|
|
return;
|
1998-10-19 22:46:38 +00:00
|
|
|
if (clist->column[column].resizeable == resizeable)
|
|
|
|
return;
|
1998-10-07 00:03:24 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist->column[column].resizeable = resizeable;
|
|
|
|
if (resizeable)
|
|
|
|
clist->column[column].auto_resize = FALSE;
|
|
|
|
|
|
|
|
if (GTK_WIDGET_VISIBLE (clist))
|
|
|
|
size_allocate_title_buttons (clist);
|
1998-10-07 00:03:24 +00:00
|
|
|
}
|
|
|
|
|
1998-01-03 03:31:03 +00:00
|
|
|
void
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_clist_set_column_auto_resize (GtkCList *clist,
|
|
|
|
gint column,
|
|
|
|
gboolean auto_resize)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (clist != NULL);
|
1998-07-15 23:40:00 +00:00
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (column < 0 || column >= clist->columns)
|
|
|
|
return;
|
|
|
|
if (clist->column[column].auto_resize == auto_resize)
|
1998-01-03 03:31:03 +00:00
|
|
|
return;
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist->column[column].auto_resize = auto_resize;
|
|
|
|
if (auto_resize)
|
1998-01-31 03:33:02 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
clist->column[column].resizeable = FALSE;
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (!GTK_CLIST_AUTO_RESIZE_BLOCKED(clist))
|
1998-10-19 22:46:38 +00:00
|
|
|
{
|
|
|
|
gint width;
|
|
|
|
|
|
|
|
width = gtk_clist_optimal_column_width (clist, column);
|
|
|
|
gtk_clist_set_column_width (clist, column, width);
|
|
|
|
}
|
1998-01-31 03:33:02 +00:00
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
|
|
|
|
if (GTK_WIDGET_VISIBLE (clist))
|
|
|
|
size_allocate_title_buttons (clist);
|
|
|
|
}
|
|
|
|
|
1998-12-02 00:52:14 +00:00
|
|
|
gint
|
|
|
|
gtk_clist_columns_autosize (GtkCList *clist)
|
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
gint width;
|
|
|
|
|
|
|
|
g_return_val_if_fail (clist != NULL, 0);
|
|
|
|
g_return_val_if_fail (GTK_IS_CLIST (clist), 0);
|
|
|
|
|
|
|
|
gtk_clist_freeze (clist);
|
|
|
|
width = 0;
|
|
|
|
for (i = 0; i < clist->columns; i++)
|
|
|
|
{
|
|
|
|
gtk_clist_set_column_width (clist, i,
|
|
|
|
gtk_clist_optimal_column_width (clist, i));
|
|
|
|
|
|
|
|
width += clist->column[i].width;
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_clist_thaw (clist);
|
|
|
|
return width;
|
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
gint
|
|
|
|
gtk_clist_optimal_column_width (GtkCList *clist,
|
|
|
|
gint column)
|
|
|
|
{
|
|
|
|
GtkRequisition requisition;
|
|
|
|
GList *list;
|
1998-11-11 20:46:51 +00:00
|
|
|
gint width;
|
1998-10-19 22:46:38 +00:00
|
|
|
|
|
|
|
g_return_val_if_fail (clist != NULL, 0);
|
|
|
|
g_return_val_if_fail (GTK_CLIST (clist), 0);
|
|
|
|
|
|
|
|
if (column < 0 || column > clist->columns)
|
|
|
|
return 0;
|
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (GTK_CLIST_SHOW_TITLES(clist) && clist->column[column].button)
|
1998-12-31 21:01:18 +00:00
|
|
|
width = (clist->column[column].button->requisition.width)
|
|
|
|
#if 0
|
|
|
|
(CELL_SPACING + (2 * COLUMN_INSET)))
|
|
|
|
#endif
|
|
|
|
;
|
1998-11-11 20:46:51 +00:00
|
|
|
else
|
|
|
|
width = 0;
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
for (list = clist->row_list; list; list = list->next)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GTK_CLIST_CLASS_FW (clist)->cell_size_request
|
|
|
|
(clist, GTK_CLIST_ROW (list), column, &requisition);
|
|
|
|
width = MAX (width, requisition.width);
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
|
|
|
|
return width;
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_clist_set_column_width (GtkCList *clist,
|
|
|
|
gint column,
|
|
|
|
gint width)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (clist != NULL);
|
1998-07-15 23:40:00 +00:00
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (column < 0 || column >= clist->columns)
|
1998-01-03 03:31:03 +00:00
|
|
|
return;
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_signal_emit (GTK_OBJECT (clist), clist_signals[RESIZE_COLUMN],
|
|
|
|
column, width);
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
void
|
|
|
|
gtk_clist_set_column_min_width (GtkCList *clist,
|
|
|
|
gint column,
|
|
|
|
gint min_width)
|
1998-02-08 07:55:11 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-02-08 07:55:11 +00:00
|
|
|
|
|
|
|
if (column < 0 || column >= clist->columns)
|
1998-10-19 22:46:38 +00:00
|
|
|
return;
|
|
|
|
if (clist->column[column].min_width == min_width)
|
|
|
|
return;
|
1998-02-08 07:55:11 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (clist->column[column].max_width >= 0 &&
|
|
|
|
clist->column[column].max_width < min_width)
|
|
|
|
clist->column[column].min_width = clist->column[column].max_width;
|
|
|
|
else
|
|
|
|
clist->column[column].min_width = min_width;
|
1998-02-08 07:55:11 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (clist->column[column].area.width < clist->column[column].min_width)
|
|
|
|
gtk_clist_set_column_width (clist, column,clist->column[column].min_width);
|
1998-02-08 07:55:11 +00:00
|
|
|
}
|
|
|
|
|
1998-01-03 03:31:03 +00:00
|
|
|
void
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_clist_set_column_max_width (GtkCList *clist,
|
|
|
|
gint column,
|
|
|
|
gint max_width)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (clist != NULL);
|
1998-07-15 23:40:00 +00:00
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-01-03 03:31:03 +00:00
|
|
|
|
|
|
|
if (column < 0 || column >= clist->columns)
|
|
|
|
return;
|
1998-10-19 22:46:38 +00:00
|
|
|
if (clist->column[column].max_width == max_width)
|
|
|
|
return;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (clist->column[column].min_width >= 0 && max_width >= 0 &&
|
|
|
|
clist->column[column].min_width > max_width)
|
|
|
|
clist->column[column].max_width = clist->column[column].min_width;
|
|
|
|
else
|
|
|
|
clist->column[column].max_width = max_width;
|
|
|
|
|
|
|
|
if (clist->column[column].area.width > clist->column[column].max_width)
|
|
|
|
gtk_clist_set_column_width (clist, column,clist->column[column].max_width);
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* PRIVATE COLUMN FUNCTIONS
|
|
|
|
* column_auto_resize
|
|
|
|
* real_resize_column
|
|
|
|
* abort_column_resize
|
|
|
|
* size_allocate_title_buttons
|
|
|
|
* size_allocate_columns
|
1998-11-07 14:29:22 +00:00
|
|
|
* list_requisition_width
|
1998-10-19 22:46:38 +00:00
|
|
|
* new_column_width
|
|
|
|
* column_button_create
|
|
|
|
* column_button_clicked
|
Tue Mar 16 17:43:33 1999 Tim Janik <timj@gtk.org>
Wed Mar 17 01:46:28 1999 Tim Janik <timj@gtk.org>
* merges from gtk-1-2:
Tue Mar 16 17:43:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_string): ensure the
item factory class has been created.
(gtk_item_factory_parse_rc): likewise.
* gtk/gtkmenu.c:
keep proper references for old_active_menu_item.
(gtk_menu_reparent): unset the usize of the new parent,
so the menu can sanely be size requested and we don't get nasty screen
artefacts upon next reparentation.
(gtk_menu_motion_notify): set send_event to TRUE if we synthesize an
enter notify. only synthesize enter notifies if the pointer really is
inside the event window.
(gtk_menu_popdown): use gtk_menu_shell_deselect().
(gtk_menu_popup): move the background setting stuff into
gtk_menu_tearoff_bg_copy() so it can be called from other places as well.
* gtk/gtkmenushell.c (gtk_menu_shell_button_press): use
gtk_menu_shell_select_item() to select the new item.
(gtk_menu_shell_deselect): export this function, so gtkmenu.c can
do the right thing for deselection as well.
Sat Mar 15 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.[hc]:
(gtk_widget_accelerators_locked): return whether a widget's accelerators
are locked.
* gtk/gtkmenu.c (gtk_menu_key_press): don't remove or install new or
existing accelerators if the widget's accelerators are locked.
Sat Mar 14 19:44:05 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.[hc]: allow managing of foreign menu items.
* gtk/gtkmenu.c: truely forward key press and key release events to
the menu widget from the toplevel or tearoff window. we can't simply
connect to that, we need to stop further processing of the events as
well.
Sat Mar 13 13:14:17 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.c:
(gtk_menu_key_press): pass event->keyval, event->state to
gtk_accelerator_valid, instead of event->keyval twice.
refuse to install single letter accelerators for menus that use
single letter shortcuts.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): use
gtk_menu_ensure_uline_accel_group().
* gtk/gtkmenu.[hc]: added gtk_menu_ensure_uline_accel_group()
which will always return an uline accel group, made
gtk_menu_get_uline_accel_group() return NULL if the group isn't
yet created.
Mon Mar 15 01:03:27 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h (struct _GtkCListColumn): added button_passive flag.
* gtk/gtkclist.c (gtk_clist_column_title_passive):
Leave button sensitive, trap button_press, button_release,
motion_notify, enter_notify and leave_notify events instead.
(gtk_clist_column_title_active): disconnect event handler.
(gtk_clist_drag_data_get): fixed memory leak. Reported by
Guillaume Laurent <glaurent@worldnet.fr>
Wed Mar 10 23:49:55 1999 Lars Hamann <lars@gtk.org>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): fixed a few
width/height mixups.
* gtk/gtkctree.c (tree_delete): emit an tree_unselect_row signal
if needed.
Wed Mar 10 00:11:32 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c (create_item_factory): unref the item factory after
window's destruction.
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): keep a reference
count on the menu shell around the menu item's activation, since the
signal emission may cause menu shell destruction.
* gtk/gtkitemfactory.c:
the previous code leaked one accel group per menu. we use
gtk_menu_get_uline_accel_group() now to fix that, and with that
also create the underline accelerator group of the menus only if
required (i.e. an underline accelerator has been specified).
(gtk_item_factory_construct):
(gtk_item_factory_create_item): removed code that would create an
extra accel group for the menu (and leak references).
(gtk_item_factory_create_item): adapted the underline accelerator
installation code to properly feature gtk_menu_get_uline_accel_group().
* gtk/gtkmenu.[hc]: added gtk_menu_get_accel_group() to retrive
menu->accel_group, this may return NULL if the accelerator group
hasn't been set yet.
added gtk_menu_get_uline_accel_group() to retrive the underline
accelerator group of the menu, this will be created on demand
and proper care is taken about its reference count.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c:
dumped the approach of keeping a widgets by action list on the
factory since the factory<->widget destroy negotiation didn't work
and would be hard to get going at all. instead we keep a list of
GtkItemFactoryItem items on the factory (GtkItemFactoryItems are
persistant throughout a program's life time).
also, i removed the static const gchar *key_* variables, and made
them inline strings (they weren't actually used anyways).
(gtk_item_factory_add_item): update ifactory->items.
(gtk_item_factory_destroy): destroy ifactory->items (and remove
the item factory pointer from the remaining ifactory widgets).
(gtk_item_factory_get_widget_by_action): walk the GtkItemFactoryItem
list to find the widget.
(gtk_item_factory_get_item): new function that works around
gtk_item_factory_get_widget() limitations, this function will only
return menu items, even for <Branch> entries.
Tue Mar 9 01:01:28 1999 Tim Janik <timj@gtk.org>
* gdk/gdkfont.c (gdk_font_load): first lookup the xfont ID in our
font hash table, if we have a GdkFontPrivate entry for this font
already, simply increment its reference count, provided by Olaf Dietsche
<olaf.dietsche+list.gtk@netcologne.de>.
* gtk/gtkstyle.c (gtk_style_copy): plug a GdkFont reference leak, fix
provided by Olaf Dietsche <olaf.dietsche+list.gtk@netcologne.de>.
Sun Mar 7 06:13:29 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c:
(gtk_container_add_with_args):
(gtk_container_addv):
(gtk_container_add): before adding a child to a conatiner, make sure
it is (default) constructed, this is neccessary because under certain
circumstances the child will get relized and mapped immediatedly, in
which case it has to be constructed already.
Mon Mar 1 17:58:21 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_connect_by_type): count object_signal
values > 1 as TRUE also.
1999-03-17 01:39:42 +00:00
|
|
|
* column_title_passive_func
|
1998-10-19 22:46:38 +00:00
|
|
|
*/
|
|
|
|
static void
|
|
|
|
column_auto_resize (GtkCList *clist,
|
|
|
|
GtkCListRow *clist_row,
|
|
|
|
gint column,
|
|
|
|
gint old_width)
|
1998-02-08 07:55:11 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
/* resize column if needed for auto_resize */
|
|
|
|
GtkRequisition requisition;
|
1998-02-08 07:55:11 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (!clist->column[column].auto_resize ||
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
GTK_CLIST_AUTO_RESIZE_BLOCKED(clist))
|
1998-10-19 22:46:38 +00:00
|
|
|
return;
|
1998-02-08 07:55:11 +00:00
|
|
|
|
1998-11-11 20:46:51 +00:00
|
|
|
if (clist_row)
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->cell_size_request (clist, clist_row,
|
|
|
|
column, &requisition);
|
|
|
|
else
|
|
|
|
requisition.width = 0;
|
1998-02-08 07:55:11 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (requisition.width > clist->column[column].width)
|
1998-11-11 20:46:51 +00:00
|
|
|
gtk_clist_set_column_width (clist, column, requisition.width);
|
1998-10-19 22:46:38 +00:00
|
|
|
else if (requisition.width < old_width &&
|
|
|
|
old_width == clist->column[column].width)
|
|
|
|
{
|
|
|
|
GList *list;
|
|
|
|
gint new_width = 0;
|
1998-02-08 07:55:11 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* run a "gtk_clist_optimal_column_width" but break, if
|
|
|
|
* the column doesn't shrink */
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (GTK_CLIST_SHOW_TITLES(clist) && clist->column[column].button)
|
1998-11-11 20:46:51 +00:00
|
|
|
new_width = (clist->column[column].button->requisition.width -
|
|
|
|
(CELL_SPACING + (2 * COLUMN_INSET)));
|
|
|
|
else
|
|
|
|
new_width = 0;
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
for (list = clist->row_list; list; list = list->next)
|
|
|
|
{
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->cell_size_request
|
|
|
|
(clist, GTK_CLIST_ROW (list), column, &requisition);
|
|
|
|
new_width = MAX (new_width, requisition.width);
|
|
|
|
if (new_width == clist->column[column].width)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (new_width < clist->column[column].width)
|
|
|
|
gtk_clist_set_column_width
|
|
|
|
(clist, column, MAX (new_width, clist->column[column].min_width));
|
|
|
|
}
|
1998-02-08 07:55:11 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
static void
|
|
|
|
real_resize_column (GtkCList *clist,
|
|
|
|
gint column,
|
|
|
|
gint width)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (clist != NULL);
|
1998-07-15 23:40:00 +00:00
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-01-03 03:31:03 +00:00
|
|
|
|
|
|
|
if (column < 0 || column >= clist->columns)
|
|
|
|
return;
|
1998-11-07 14:29:22 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (width < MAX (COLUMN_MIN_WIDTH, clist->column[column].min_width))
|
|
|
|
width = MAX (COLUMN_MIN_WIDTH, clist->column[column].min_width);
|
|
|
|
if (clist->column[column].max_width >= 0 &&
|
|
|
|
width > clist->column[column].max_width)
|
|
|
|
width = clist->column[column].max_width;
|
1998-11-11 20:46:51 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist->column[column].width = width;
|
|
|
|
clist->column[column].width_set = TRUE;
|
|
|
|
|
|
|
|
/* FIXME: this is quite expensive to do if the widget hasn't
|
|
|
|
* been size_allocated yet, and pointless. Should
|
|
|
|
* a flag be kept
|
|
|
|
*/
|
1998-11-11 20:46:51 +00:00
|
|
|
size_allocate_columns (clist, TRUE);
|
1998-10-19 22:46:38 +00:00
|
|
|
size_allocate_title_buttons (clist);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
CLIST_REFRESH (clist);
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
static void
|
|
|
|
abort_column_resize (GtkCList *clist)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (clist != NULL);
|
1998-07-15 23:40:00 +00:00
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-01-03 03:31:03 +00:00
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (!GTK_CLIST_IN_DRAG(clist))
|
1998-01-03 03:31:03 +00:00
|
|
|
return;
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
GTK_CLIST_UNSET_FLAG (clist, CLIST_IN_DRAG);
|
|
|
|
gtk_grab_remove (GTK_WIDGET (clist));
|
|
|
|
gdk_pointer_ungrab (GDK_CURRENT_TIME);
|
|
|
|
clist->drag_pos = -1;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (clist->x_drag >= 0 && clist->x_drag <= clist->clist_window_width - 1)
|
|
|
|
draw_xor_line (clist);
|
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (GTK_CLIST_ADD_MODE(clist))
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
gdk_gc_set_line_attributes (clist->xor_gc, 1, GDK_LINE_ON_OFF_DASH, 0,0);
|
|
|
|
gdk_gc_set_dashes (clist->xor_gc, 0, "\4\4", 2);
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
static void
|
|
|
|
size_allocate_title_buttons (GtkCList *clist)
|
1998-02-08 07:55:11 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GtkAllocation button_allocation;
|
|
|
|
gint last_column;
|
|
|
|
gint last_button = 0;
|
|
|
|
gint i;
|
1998-02-08 07:55:11 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (!GTK_WIDGET_REALIZED (clist))
|
|
|
|
return;
|
1998-02-08 07:55:11 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
button_allocation.x = clist->hoffset;
|
|
|
|
button_allocation.y = 0;
|
|
|
|
button_allocation.width = 0;
|
|
|
|
button_allocation.height = clist->column_title_area.height;
|
1998-02-08 07:55:11 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* find last visible column */
|
|
|
|
for (last_column = clist->columns - 1; last_column >= 0; last_column--)
|
|
|
|
if (clist->column[last_column].visible)
|
|
|
|
break;
|
1998-02-08 07:55:11 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
for (i = 0; i < last_column; i++)
|
|
|
|
{
|
|
|
|
if (!clist->column[i].visible)
|
|
|
|
{
|
|
|
|
last_button = i + 1;
|
|
|
|
gdk_window_hide (clist->column[i].window);
|
|
|
|
continue;
|
|
|
|
}
|
1998-02-08 07:55:11 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
button_allocation.width += (clist->column[i].area.width +
|
|
|
|
CELL_SPACING + 2 * COLUMN_INSET);
|
1998-03-02 00:32:52 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (!clist->column[i + 1].button)
|
|
|
|
{
|
|
|
|
gdk_window_hide (clist->column[i].window);
|
|
|
|
continue;
|
|
|
|
}
|
1998-02-08 07:55:11 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_widget_size_allocate (clist->column[last_button].button,
|
|
|
|
&button_allocation);
|
|
|
|
button_allocation.x += button_allocation.width;
|
|
|
|
button_allocation.width = 0;
|
|
|
|
|
|
|
|
if (clist->column[last_button].resizeable)
|
|
|
|
{
|
|
|
|
gdk_window_show (clist->column[last_button].window);
|
|
|
|
gdk_window_move_resize (clist->column[last_button].window,
|
|
|
|
button_allocation.x - (DRAG_WIDTH / 2),
|
|
|
|
0, DRAG_WIDTH,
|
|
|
|
clist->column_title_area.height);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
gdk_window_hide (clist->column[last_button].window);
|
|
|
|
|
|
|
|
last_button = i + 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
button_allocation.width += (clist->column[last_column].area.width +
|
|
|
|
2 * (CELL_SPACING + COLUMN_INSET));
|
|
|
|
gtk_widget_size_allocate (clist->column[last_button].button,
|
|
|
|
&button_allocation);
|
|
|
|
|
|
|
|
if (clist->column[last_button].resizeable)
|
|
|
|
{
|
|
|
|
button_allocation.x += button_allocation.width;
|
|
|
|
|
|
|
|
gdk_window_show (clist->column[last_button].window);
|
|
|
|
gdk_window_move_resize (clist->column[last_button].window,
|
|
|
|
button_allocation.x - (DRAG_WIDTH / 2),
|
|
|
|
0, DRAG_WIDTH, clist->column_title_area.height);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
gdk_window_hide (clist->column[last_button].window);
|
1998-02-08 07:55:11 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
static void
|
1998-11-11 20:46:51 +00:00
|
|
|
size_allocate_columns (GtkCList *clist,
|
|
|
|
gboolean block_resize)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
gint xoffset = CELL_SPACING + COLUMN_INSET;
|
|
|
|
gint last_column;
|
|
|
|
gint i;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* find last visible column and calculate correct column width */
|
|
|
|
for (last_column = clist->columns - 1;
|
|
|
|
last_column >= 0 && !clist->column[last_column].visible; last_column--);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (last_column < 0)
|
1998-01-03 03:31:03 +00:00
|
|
|
return;
|
|
|
|
|
1998-11-07 14:29:22 +00:00
|
|
|
for (i = 0; i <= last_column; i++)
|
1998-10-19 22:46:38 +00:00
|
|
|
{
|
|
|
|
if (!clist->column[i].visible)
|
|
|
|
continue;
|
|
|
|
clist->column[i].area.x = xoffset;
|
1998-11-07 14:29:22 +00:00
|
|
|
if (clist->column[i].width_set)
|
|
|
|
{
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (!block_resize && GTK_CLIST_SHOW_TITLES(clist) &&
|
1998-11-11 20:46:51 +00:00
|
|
|
clist->column[i].auto_resize && clist->column[i].button)
|
|
|
|
{
|
|
|
|
gint width;
|
|
|
|
|
|
|
|
width = (clist->column[i].button->requisition.width -
|
|
|
|
(CELL_SPACING + (2 * COLUMN_INSET)));
|
|
|
|
|
|
|
|
if (width > clist->column[i].width)
|
|
|
|
gtk_clist_set_column_width (clist, i, width);
|
|
|
|
}
|
|
|
|
|
1998-11-07 14:29:22 +00:00
|
|
|
clist->column[i].area.width = clist->column[i].width;
|
|
|
|
xoffset += clist->column[i].width + CELL_SPACING + (2* COLUMN_INSET);
|
|
|
|
}
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
else if (GTK_CLIST_SHOW_TITLES(clist) && clist->column[i].button)
|
1998-11-07 14:29:22 +00:00
|
|
|
{
|
|
|
|
clist->column[i].area.width =
|
|
|
|
clist->column[i].button->requisition.width -
|
|
|
|
(CELL_SPACING + (2 * COLUMN_INSET));
|
|
|
|
xoffset += clist->column[i].button->requisition.width;
|
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
}
|
1998-03-10 02:21:15 +00:00
|
|
|
|
1998-11-07 14:29:22 +00:00
|
|
|
clist->column[last_column].area.width = clist->column[last_column].area.width
|
|
|
|
+ MAX (0, clist->clist_window_width + COLUMN_INSET - xoffset);
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
list_requisition_width (GtkCList *clist)
|
|
|
|
{
|
|
|
|
gint width = CELL_SPACING;
|
|
|
|
gint i;
|
|
|
|
|
1999-02-06 00:21:56 +00:00
|
|
|
for (i = clist->columns - 1; i >= 0; i--)
|
1998-11-07 14:29:22 +00:00
|
|
|
{
|
|
|
|
if (!clist->column[i].visible)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (clist->column[i].width_set)
|
|
|
|
width += clist->column[i].width + CELL_SPACING + (2 * COLUMN_INSET);
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
else if (GTK_CLIST_SHOW_TITLES(clist) && clist->column[i].button)
|
1998-11-07 14:29:22 +00:00
|
|
|
width += clist->column[i].button->requisition.width;
|
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
|
1998-11-07 14:29:22 +00:00
|
|
|
return width;
|
1998-10-19 22:46:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* this function returns the new width of the column being resized given
|
|
|
|
* the column and x position of the cursor; the x cursor position is passed
|
|
|
|
* in as a pointer and automagicly corrected if it's beyond min/max limits */
|
|
|
|
static gint
|
|
|
|
new_column_width (GtkCList *clist,
|
|
|
|
gint column,
|
|
|
|
gint *x)
|
|
|
|
{
|
|
|
|
gint xthickness = GTK_WIDGET (clist)->style->klass->xthickness;
|
|
|
|
gint width;
|
|
|
|
gint cx;
|
|
|
|
gint dx;
|
1999-02-06 00:21:56 +00:00
|
|
|
gint last_column;
|
1998-10-19 22:46:38 +00:00
|
|
|
|
|
|
|
/* first translate the x position from widget->window
|
|
|
|
* to clist->clist_window */
|
|
|
|
cx = *x - xthickness;
|
|
|
|
|
1999-02-06 00:21:56 +00:00
|
|
|
for (last_column = clist->columns - 1;
|
|
|
|
last_column >= 0 && !clist->column[last_column].visible; last_column--);
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* calculate new column width making sure it doesn't end up
|
|
|
|
* less than the minimum width */
|
|
|
|
dx = (COLUMN_LEFT_XPIXEL (clist, column) + COLUMN_INSET +
|
1999-02-06 00:21:56 +00:00
|
|
|
(column < last_column) * CELL_SPACING);
|
1998-10-19 22:46:38 +00:00
|
|
|
width = cx - dx;
|
|
|
|
|
|
|
|
if (width < MAX (COLUMN_MIN_WIDTH, clist->column[column].min_width))
|
1998-03-10 02:21:15 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
width = MAX (COLUMN_MIN_WIDTH, clist->column[column].min_width);
|
|
|
|
cx = dx + width;
|
|
|
|
*x = cx + xthickness;
|
1998-03-10 02:21:15 +00:00
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
else if (clist->column[column].max_width >= COLUMN_MIN_WIDTH &&
|
|
|
|
width > clist->column[column].max_width)
|
|
|
|
{
|
|
|
|
width = clist->column[column].max_width;
|
|
|
|
cx = dx + clist->column[column].max_width;
|
|
|
|
*x = cx + xthickness;
|
|
|
|
}
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (cx < 0 || cx > clist->clist_window_width)
|
|
|
|
*x = -1;
|
|
|
|
|
|
|
|
return width;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
column_button_create (GtkCList *clist,
|
|
|
|
gint column)
|
|
|
|
{
|
|
|
|
GtkWidget *button;
|
|
|
|
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
gtk_widget_push_composite_child ();
|
1998-10-19 22:46:38 +00:00
|
|
|
button = clist->column[column].button = gtk_button_new ();
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
gtk_widget_pop_composite_child ();
|
1998-11-07 14:29:22 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (GTK_WIDGET_REALIZED (clist) && clist->title_window)
|
1998-11-07 14:29:22 +00:00
|
|
|
gtk_widget_set_parent_window (clist->column[column].button,
|
|
|
|
clist->title_window);
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_widget_set_parent (button, GTK_WIDGET (clist));
|
1998-11-07 14:29:22 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
|
|
|
(GtkSignalFunc) column_button_clicked,
|
|
|
|
(gpointer) clist);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
column_button_clicked (GtkWidget *widget,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
GtkCList *clist;
|
|
|
|
|
|
|
|
g_return_if_fail (widget != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (data));
|
|
|
|
|
|
|
|
clist = GTK_CLIST (data);
|
|
|
|
|
|
|
|
/* find the column who's button was pressed */
|
|
|
|
for (i = 0; i < clist->columns; i++)
|
|
|
|
if (clist->column[i].button == widget)
|
|
|
|
break;
|
|
|
|
|
|
|
|
gtk_signal_emit (GTK_OBJECT (clist), clist_signals[CLICK_COLUMN], i);
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
|
Tue Mar 16 17:43:33 1999 Tim Janik <timj@gtk.org>
Wed Mar 17 01:46:28 1999 Tim Janik <timj@gtk.org>
* merges from gtk-1-2:
Tue Mar 16 17:43:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_string): ensure the
item factory class has been created.
(gtk_item_factory_parse_rc): likewise.
* gtk/gtkmenu.c:
keep proper references for old_active_menu_item.
(gtk_menu_reparent): unset the usize of the new parent,
so the menu can sanely be size requested and we don't get nasty screen
artefacts upon next reparentation.
(gtk_menu_motion_notify): set send_event to TRUE if we synthesize an
enter notify. only synthesize enter notifies if the pointer really is
inside the event window.
(gtk_menu_popdown): use gtk_menu_shell_deselect().
(gtk_menu_popup): move the background setting stuff into
gtk_menu_tearoff_bg_copy() so it can be called from other places as well.
* gtk/gtkmenushell.c (gtk_menu_shell_button_press): use
gtk_menu_shell_select_item() to select the new item.
(gtk_menu_shell_deselect): export this function, so gtkmenu.c can
do the right thing for deselection as well.
Sat Mar 15 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.[hc]:
(gtk_widget_accelerators_locked): return whether a widget's accelerators
are locked.
* gtk/gtkmenu.c (gtk_menu_key_press): don't remove or install new or
existing accelerators if the widget's accelerators are locked.
Sat Mar 14 19:44:05 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.[hc]: allow managing of foreign menu items.
* gtk/gtkmenu.c: truely forward key press and key release events to
the menu widget from the toplevel or tearoff window. we can't simply
connect to that, we need to stop further processing of the events as
well.
Sat Mar 13 13:14:17 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.c:
(gtk_menu_key_press): pass event->keyval, event->state to
gtk_accelerator_valid, instead of event->keyval twice.
refuse to install single letter accelerators for menus that use
single letter shortcuts.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): use
gtk_menu_ensure_uline_accel_group().
* gtk/gtkmenu.[hc]: added gtk_menu_ensure_uline_accel_group()
which will always return an uline accel group, made
gtk_menu_get_uline_accel_group() return NULL if the group isn't
yet created.
Mon Mar 15 01:03:27 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h (struct _GtkCListColumn): added button_passive flag.
* gtk/gtkclist.c (gtk_clist_column_title_passive):
Leave button sensitive, trap button_press, button_release,
motion_notify, enter_notify and leave_notify events instead.
(gtk_clist_column_title_active): disconnect event handler.
(gtk_clist_drag_data_get): fixed memory leak. Reported by
Guillaume Laurent <glaurent@worldnet.fr>
Wed Mar 10 23:49:55 1999 Lars Hamann <lars@gtk.org>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): fixed a few
width/height mixups.
* gtk/gtkctree.c (tree_delete): emit an tree_unselect_row signal
if needed.
Wed Mar 10 00:11:32 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c (create_item_factory): unref the item factory after
window's destruction.
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): keep a reference
count on the menu shell around the menu item's activation, since the
signal emission may cause menu shell destruction.
* gtk/gtkitemfactory.c:
the previous code leaked one accel group per menu. we use
gtk_menu_get_uline_accel_group() now to fix that, and with that
also create the underline accelerator group of the menus only if
required (i.e. an underline accelerator has been specified).
(gtk_item_factory_construct):
(gtk_item_factory_create_item): removed code that would create an
extra accel group for the menu (and leak references).
(gtk_item_factory_create_item): adapted the underline accelerator
installation code to properly feature gtk_menu_get_uline_accel_group().
* gtk/gtkmenu.[hc]: added gtk_menu_get_accel_group() to retrive
menu->accel_group, this may return NULL if the accelerator group
hasn't been set yet.
added gtk_menu_get_uline_accel_group() to retrive the underline
accelerator group of the menu, this will be created on demand
and proper care is taken about its reference count.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c:
dumped the approach of keeping a widgets by action list on the
factory since the factory<->widget destroy negotiation didn't work
and would be hard to get going at all. instead we keep a list of
GtkItemFactoryItem items on the factory (GtkItemFactoryItems are
persistant throughout a program's life time).
also, i removed the static const gchar *key_* variables, and made
them inline strings (they weren't actually used anyways).
(gtk_item_factory_add_item): update ifactory->items.
(gtk_item_factory_destroy): destroy ifactory->items (and remove
the item factory pointer from the remaining ifactory widgets).
(gtk_item_factory_get_widget_by_action): walk the GtkItemFactoryItem
list to find the widget.
(gtk_item_factory_get_item): new function that works around
gtk_item_factory_get_widget() limitations, this function will only
return menu items, even for <Branch> entries.
Tue Mar 9 01:01:28 1999 Tim Janik <timj@gtk.org>
* gdk/gdkfont.c (gdk_font_load): first lookup the xfont ID in our
font hash table, if we have a GdkFontPrivate entry for this font
already, simply increment its reference count, provided by Olaf Dietsche
<olaf.dietsche+list.gtk@netcologne.de>.
* gtk/gtkstyle.c (gtk_style_copy): plug a GdkFont reference leak, fix
provided by Olaf Dietsche <olaf.dietsche+list.gtk@netcologne.de>.
Sun Mar 7 06:13:29 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c:
(gtk_container_add_with_args):
(gtk_container_addv):
(gtk_container_add): before adding a child to a conatiner, make sure
it is (default) constructed, this is neccessary because under certain
circumstances the child will get relized and mapped immediatedly, in
which case it has to be constructed already.
Mon Mar 1 17:58:21 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_connect_by_type): count object_signal
values > 1 as TRUE also.
1999-03-17 01:39:42 +00:00
|
|
|
static gint
|
|
|
|
column_title_passive_func (GtkWidget *widget,
|
|
|
|
GdkEvent *event,
|
|
|
|
gpointer data)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1999-04-30 11:48:42 +00:00
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
|
|
|
|
|
|
|
switch (event->type)
|
|
|
|
{
|
|
|
|
case GDK_MOTION_NOTIFY:
|
|
|
|
case GDK_BUTTON_PRESS:
|
|
|
|
case GDK_2BUTTON_PRESS:
|
|
|
|
case GDK_3BUTTON_PRESS:
|
|
|
|
case GDK_BUTTON_RELEASE:
|
|
|
|
case GDK_ENTER_NOTIFY:
|
|
|
|
case GDK_LEAVE_NOTIFY:
|
|
|
|
return TRUE;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
Tue Mar 16 17:43:33 1999 Tim Janik <timj@gtk.org>
Wed Mar 17 01:46:28 1999 Tim Janik <timj@gtk.org>
* merges from gtk-1-2:
Tue Mar 16 17:43:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_string): ensure the
item factory class has been created.
(gtk_item_factory_parse_rc): likewise.
* gtk/gtkmenu.c:
keep proper references for old_active_menu_item.
(gtk_menu_reparent): unset the usize of the new parent,
so the menu can sanely be size requested and we don't get nasty screen
artefacts upon next reparentation.
(gtk_menu_motion_notify): set send_event to TRUE if we synthesize an
enter notify. only synthesize enter notifies if the pointer really is
inside the event window.
(gtk_menu_popdown): use gtk_menu_shell_deselect().
(gtk_menu_popup): move the background setting stuff into
gtk_menu_tearoff_bg_copy() so it can be called from other places as well.
* gtk/gtkmenushell.c (gtk_menu_shell_button_press): use
gtk_menu_shell_select_item() to select the new item.
(gtk_menu_shell_deselect): export this function, so gtkmenu.c can
do the right thing for deselection as well.
Sat Mar 15 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.[hc]:
(gtk_widget_accelerators_locked): return whether a widget's accelerators
are locked.
* gtk/gtkmenu.c (gtk_menu_key_press): don't remove or install new or
existing accelerators if the widget's accelerators are locked.
Sat Mar 14 19:44:05 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.[hc]: allow managing of foreign menu items.
* gtk/gtkmenu.c: truely forward key press and key release events to
the menu widget from the toplevel or tearoff window. we can't simply
connect to that, we need to stop further processing of the events as
well.
Sat Mar 13 13:14:17 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.c:
(gtk_menu_key_press): pass event->keyval, event->state to
gtk_accelerator_valid, instead of event->keyval twice.
refuse to install single letter accelerators for menus that use
single letter shortcuts.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): use
gtk_menu_ensure_uline_accel_group().
* gtk/gtkmenu.[hc]: added gtk_menu_ensure_uline_accel_group()
which will always return an uline accel group, made
gtk_menu_get_uline_accel_group() return NULL if the group isn't
yet created.
Mon Mar 15 01:03:27 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h (struct _GtkCListColumn): added button_passive flag.
* gtk/gtkclist.c (gtk_clist_column_title_passive):
Leave button sensitive, trap button_press, button_release,
motion_notify, enter_notify and leave_notify events instead.
(gtk_clist_column_title_active): disconnect event handler.
(gtk_clist_drag_data_get): fixed memory leak. Reported by
Guillaume Laurent <glaurent@worldnet.fr>
Wed Mar 10 23:49:55 1999 Lars Hamann <lars@gtk.org>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): fixed a few
width/height mixups.
* gtk/gtkctree.c (tree_delete): emit an tree_unselect_row signal
if needed.
Wed Mar 10 00:11:32 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c (create_item_factory): unref the item factory after
window's destruction.
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): keep a reference
count on the menu shell around the menu item's activation, since the
signal emission may cause menu shell destruction.
* gtk/gtkitemfactory.c:
the previous code leaked one accel group per menu. we use
gtk_menu_get_uline_accel_group() now to fix that, and with that
also create the underline accelerator group of the menus only if
required (i.e. an underline accelerator has been specified).
(gtk_item_factory_construct):
(gtk_item_factory_create_item): removed code that would create an
extra accel group for the menu (and leak references).
(gtk_item_factory_create_item): adapted the underline accelerator
installation code to properly feature gtk_menu_get_uline_accel_group().
* gtk/gtkmenu.[hc]: added gtk_menu_get_accel_group() to retrive
menu->accel_group, this may return NULL if the accelerator group
hasn't been set yet.
added gtk_menu_get_uline_accel_group() to retrive the underline
accelerator group of the menu, this will be created on demand
and proper care is taken about its reference count.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c:
dumped the approach of keeping a widgets by action list on the
factory since the factory<->widget destroy negotiation didn't work
and would be hard to get going at all. instead we keep a list of
GtkItemFactoryItem items on the factory (GtkItemFactoryItems are
persistant throughout a program's life time).
also, i removed the static const gchar *key_* variables, and made
them inline strings (they weren't actually used anyways).
(gtk_item_factory_add_item): update ifactory->items.
(gtk_item_factory_destroy): destroy ifactory->items (and remove
the item factory pointer from the remaining ifactory widgets).
(gtk_item_factory_get_widget_by_action): walk the GtkItemFactoryItem
list to find the widget.
(gtk_item_factory_get_item): new function that works around
gtk_item_factory_get_widget() limitations, this function will only
return menu items, even for <Branch> entries.
Tue Mar 9 01:01:28 1999 Tim Janik <timj@gtk.org>
* gdk/gdkfont.c (gdk_font_load): first lookup the xfont ID in our
font hash table, if we have a GdkFontPrivate entry for this font
already, simply increment its reference count, provided by Olaf Dietsche
<olaf.dietsche+list.gtk@netcologne.de>.
* gtk/gtkstyle.c (gtk_style_copy): plug a GdkFont reference leak, fix
provided by Olaf Dietsche <olaf.dietsche+list.gtk@netcologne.de>.
Sun Mar 7 06:13:29 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c:
(gtk_container_add_with_args):
(gtk_container_addv):
(gtk_container_add): before adding a child to a conatiner, make sure
it is (default) constructed, this is neccessary because under certain
circumstances the child will get relized and mapped immediatedly, in
which case it has to be constructed already.
Mon Mar 1 17:58:21 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_connect_by_type): count object_signal
values > 1 as TRUE also.
1999-03-17 01:39:42 +00:00
|
|
|
return FALSE;
|
1998-10-19 22:46:38 +00:00
|
|
|
}
|
1998-01-03 03:31:03 +00:00
|
|
|
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* PUBLIC CELL FUNCTIONS
|
|
|
|
* gtk_clist_get_cell_type
|
|
|
|
* gtk_clist_set_text
|
|
|
|
* gtk_clist_get_text
|
|
|
|
* gtk_clist_set_pixmap
|
|
|
|
* gtk_clist_get_pixmap
|
|
|
|
* gtk_clist_set_pixtext
|
|
|
|
* gtk_clist_get_pixtext
|
|
|
|
* gtk_clist_set_shift
|
|
|
|
*/
|
|
|
|
GtkCellType
|
|
|
|
gtk_clist_get_cell_type (GtkCList *clist,
|
|
|
|
gint row,
|
|
|
|
gint column)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
|
|
|
GtkCListRow *clist_row;
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_val_if_fail (clist != NULL, -1);
|
|
|
|
g_return_val_if_fail (GTK_IS_CLIST (clist), -1);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
|
|
|
if (row < 0 || row >= clist->rows)
|
1998-10-19 22:46:38 +00:00
|
|
|
return -1;
|
1998-01-03 03:31:03 +00:00
|
|
|
if (column < 0 || column >= clist->columns)
|
1998-10-19 22:46:38 +00:00
|
|
|
return -1;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
|
|
|
clist_row = (g_list_nth (clist->row_list, row))->data;
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
return clist_row->cell[column].type;
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
|
1998-09-11 13:52:42 +00:00
|
|
|
void
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_clist_set_text (GtkCList *clist,
|
|
|
|
gint row,
|
|
|
|
gint column,
|
|
|
|
const gchar *text)
|
1998-09-11 13:52:42 +00:00
|
|
|
{
|
|
|
|
GtkCListRow *clist_row;
|
|
|
|
|
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
|
|
|
|
|
|
|
if (row < 0 || row >= clist->rows)
|
|
|
|
return;
|
1998-10-19 22:46:38 +00:00
|
|
|
if (column < 0 || column >= clist->columns)
|
|
|
|
return;
|
1998-09-11 13:52:42 +00:00
|
|
|
|
|
|
|
clist_row = (g_list_nth (clist->row_list, row))->data;
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* if text is null, then the cell is empty */
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->set_cell_contents
|
|
|
|
(clist, clist_row, column, GTK_CELL_TEXT, text, 0, NULL, NULL);
|
1998-09-11 13:52:42 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* redraw the list if it's not frozen */
|
1998-11-28 01:56:09 +00:00
|
|
|
if (CLIST_UNFROZEN (clist))
|
1998-09-11 13:52:42 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
if (gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE)
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->draw_row (clist, NULL, row, clist_row);
|
|
|
|
}
|
1998-09-11 13:52:42 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
gint
|
|
|
|
gtk_clist_get_text (GtkCList *clist,
|
|
|
|
gint row,
|
|
|
|
gint column,
|
|
|
|
gchar **text)
|
1998-09-11 13:52:42 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GtkCListRow *clist_row;
|
|
|
|
|
|
|
|
g_return_val_if_fail (clist != NULL, 0);
|
|
|
|
g_return_val_if_fail (GTK_IS_CLIST (clist), 0);
|
1998-09-11 13:52:42 +00:00
|
|
|
|
|
|
|
if (row < 0 || row >= clist->rows)
|
1998-10-19 22:46:38 +00:00
|
|
|
return 0;
|
|
|
|
if (column < 0 || column >= clist->columns)
|
|
|
|
return 0;
|
1998-09-11 13:52:42 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist_row = (g_list_nth (clist->row_list, row))->data;
|
1998-09-11 13:52:42 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (clist_row->cell[column].type != GTK_CELL_TEXT)
|
|
|
|
return 0;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (text)
|
|
|
|
*text = GTK_CELL_TEXT (clist_row->cell[column])->text;
|
|
|
|
|
|
|
|
return 1;
|
1998-10-01 13:24:42 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
void
|
|
|
|
gtk_clist_set_pixmap (GtkCList *clist,
|
|
|
|
gint row,
|
|
|
|
gint column,
|
|
|
|
GdkPixmap *pixmap,
|
|
|
|
GdkBitmap *mask)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GtkCListRow *clist_row;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (row < 0 || row >= clist->rows)
|
|
|
|
return;
|
|
|
|
if (column < 0 || column >= clist->columns)
|
|
|
|
return;
|
1998-10-01 13:24:42 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist_row = (g_list_nth (clist->row_list, row))->data;
|
|
|
|
|
|
|
|
gdk_pixmap_ref (pixmap);
|
|
|
|
|
|
|
|
if (mask) gdk_pixmap_ref (mask);
|
|
|
|
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->set_cell_contents
|
|
|
|
(clist, clist_row, column, GTK_CELL_PIXMAP, NULL, 0, pixmap, mask);
|
1998-10-01 13:24:42 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* redraw the list if it's not frozen */
|
1998-11-28 01:56:09 +00:00
|
|
|
if (CLIST_UNFROZEN (clist))
|
1998-10-19 22:46:38 +00:00
|
|
|
{
|
|
|
|
if (gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE)
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->draw_row (clist, NULL, row, clist_row);
|
|
|
|
}
|
1998-08-17 23:48:04 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
gint
|
|
|
|
gtk_clist_get_pixmap (GtkCList *clist,
|
|
|
|
gint row,
|
|
|
|
gint column,
|
|
|
|
GdkPixmap **pixmap,
|
|
|
|
GdkBitmap **mask)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
|
|
|
GtkCListRow *clist_row;
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_val_if_fail (clist != NULL, 0);
|
|
|
|
g_return_val_if_fail (GTK_IS_CLIST (clist), 0);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (row < 0 || row >= clist->rows)
|
|
|
|
return 0;
|
|
|
|
if (column < 0 || column >= clist->columns)
|
|
|
|
return 0;
|
1998-08-05 20:02:32 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist_row = (g_list_nth (clist->row_list, row))->data;
|
1998-08-05 20:02:32 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (clist_row->cell[column].type != GTK_CELL_PIXMAP)
|
|
|
|
return 0;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (pixmap)
|
|
|
|
{
|
|
|
|
*pixmap = GTK_CELL_PIXMAP (clist_row->cell[column])->pixmap;
|
|
|
|
/* mask can be NULL */
|
|
|
|
*mask = GTK_CELL_PIXMAP (clist_row->cell[column])->mask;
|
|
|
|
}
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
return 1;
|
|
|
|
}
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
void
|
|
|
|
gtk_clist_set_pixtext (GtkCList *clist,
|
|
|
|
gint row,
|
|
|
|
gint column,
|
|
|
|
const gchar *text,
|
|
|
|
guint8 spacing,
|
|
|
|
GdkPixmap *pixmap,
|
|
|
|
GdkBitmap *mask)
|
|
|
|
{
|
|
|
|
GtkCListRow *clist_row;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
|
|
|
|
|
|
|
if (row < 0 || row >= clist->rows)
|
|
|
|
return;
|
|
|
|
if (column < 0 || column >= clist->columns)
|
|
|
|
return;
|
|
|
|
|
|
|
|
clist_row = (g_list_nth (clist->row_list, row))->data;
|
|
|
|
|
|
|
|
gdk_pixmap_ref (pixmap);
|
|
|
|
if (mask) gdk_pixmap_ref (mask);
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->set_cell_contents
|
|
|
|
(clist, clist_row, column, GTK_CELL_PIXTEXT, text, spacing, pixmap, mask);
|
|
|
|
|
|
|
|
/* redraw the list if it's not frozen */
|
1998-11-28 01:56:09 +00:00
|
|
|
if (CLIST_UNFROZEN (clist))
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-03-14 00:07:36 +00:00
|
|
|
if (gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE)
|
1998-10-19 22:46:38 +00:00
|
|
|
GTK_CLIST_CLASS_FW (clist)->draw_row (clist, NULL, row, clist_row);
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
gint
|
|
|
|
gtk_clist_get_pixtext (GtkCList *clist,
|
|
|
|
gint row,
|
|
|
|
gint column,
|
|
|
|
gchar **text,
|
|
|
|
guint8 *spacing,
|
|
|
|
GdkPixmap **pixmap,
|
|
|
|
GdkBitmap **mask)
|
1998-08-17 23:48:04 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GtkCListRow *clist_row;
|
|
|
|
|
|
|
|
g_return_val_if_fail (clist != NULL, 0);
|
|
|
|
g_return_val_if_fail (GTK_IS_CLIST (clist), 0);
|
|
|
|
|
|
|
|
if (row < 0 || row >= clist->rows)
|
|
|
|
return 0;
|
|
|
|
if (column < 0 || column >= clist->columns)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
clist_row = (g_list_nth (clist->row_list, row))->data;
|
|
|
|
|
|
|
|
if (clist_row->cell[column].type != GTK_CELL_PIXTEXT)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
if (text)
|
|
|
|
*text = GTK_CELL_PIXTEXT (clist_row->cell[column])->text;
|
|
|
|
if (spacing)
|
|
|
|
*spacing = GTK_CELL_PIXTEXT (clist_row->cell[column])->spacing;
|
|
|
|
if (pixmap)
|
|
|
|
*pixmap = GTK_CELL_PIXTEXT (clist_row->cell[column])->pixmap;
|
|
|
|
|
|
|
|
/* mask can be NULL */
|
|
|
|
*mask = GTK_CELL_PIXTEXT (clist_row->cell[column])->mask;
|
|
|
|
|
|
|
|
return 1;
|
1998-08-17 23:48:04 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
void
|
|
|
|
gtk_clist_set_shift (GtkCList *clist,
|
|
|
|
gint row,
|
|
|
|
gint column,
|
|
|
|
gint vertical,
|
|
|
|
gint horizontal)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1999-04-30 11:48:42 +00:00
|
|
|
GtkRequisition requisition = { 0 };
|
1998-01-03 03:31:03 +00:00
|
|
|
GtkCListRow *clist_row;
|
|
|
|
|
|
|
|
g_return_if_fail (clist != NULL);
|
1998-07-15 23:40:00 +00:00
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (row < 0 || row >= clist->rows)
|
|
|
|
return;
|
|
|
|
if (column < 0 || column >= clist->columns)
|
1998-01-03 03:31:03 +00:00
|
|
|
return;
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist_row = (g_list_nth (clist->row_list, row))->data;
|
1998-01-06 06:48:48 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (clist->column[column].auto_resize &&
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
!GTK_CLIST_AUTO_RESIZE_BLOCKED(clist))
|
1998-10-19 22:46:38 +00:00
|
|
|
GTK_CLIST_CLASS_FW (clist)->cell_size_request (clist, clist_row,
|
|
|
|
column, &requisition);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist_row->cell[column].vertical = vertical;
|
|
|
|
clist_row->cell[column].horizontal = horizontal;
|
1998-03-08 20:44:01 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
column_auto_resize (clist, clist_row, column, requisition.width);
|
1998-03-08 20:44:01 +00:00
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
if (CLIST_UNFROZEN (clist) && gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE)
|
1998-10-19 22:46:38 +00:00
|
|
|
GTK_CLIST_CLASS_FW (clist)->draw_row (clist, NULL, row, clist_row);
|
|
|
|
}
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* PRIVATE CELL FUNCTIONS
|
|
|
|
* set_cell_contents
|
|
|
|
* cell_size_request
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
set_cell_contents (GtkCList *clist,
|
|
|
|
GtkCListRow *clist_row,
|
|
|
|
gint column,
|
|
|
|
GtkCellType type,
|
|
|
|
const gchar *text,
|
|
|
|
guint8 spacing,
|
|
|
|
GdkPixmap *pixmap,
|
|
|
|
GdkBitmap *mask)
|
|
|
|
{
|
|
|
|
GtkRequisition requisition;
|
1998-03-08 20:44:01 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
|
|
|
g_return_if_fail (clist_row != NULL);
|
1998-03-08 20:44:01 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (clist->column[column].auto_resize &&
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
!GTK_CLIST_AUTO_RESIZE_BLOCKED(clist))
|
1998-10-19 22:46:38 +00:00
|
|
|
GTK_CLIST_CLASS_FW (clist)->cell_size_request (clist, clist_row,
|
|
|
|
column, &requisition);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
switch (clist_row->cell[column].type)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
case GTK_CELL_EMPTY:
|
|
|
|
break;
|
|
|
|
case GTK_CELL_TEXT:
|
|
|
|
g_free (GTK_CELL_TEXT (clist_row->cell[column])->text);
|
|
|
|
break;
|
|
|
|
case GTK_CELL_PIXMAP:
|
|
|
|
gdk_pixmap_unref (GTK_CELL_PIXMAP (clist_row->cell[column])->pixmap);
|
|
|
|
if (GTK_CELL_PIXMAP (clist_row->cell[column])->mask)
|
|
|
|
gdk_bitmap_unref (GTK_CELL_PIXMAP (clist_row->cell[column])->mask);
|
|
|
|
break;
|
|
|
|
case GTK_CELL_PIXTEXT:
|
|
|
|
g_free (GTK_CELL_PIXTEXT (clist_row->cell[column])->text);
|
|
|
|
gdk_pixmap_unref (GTK_CELL_PIXTEXT (clist_row->cell[column])->pixmap);
|
|
|
|
if (GTK_CELL_PIXTEXT (clist_row->cell[column])->mask)
|
|
|
|
gdk_bitmap_unref (GTK_CELL_PIXTEXT (clist_row->cell[column])->mask);
|
|
|
|
break;
|
|
|
|
case GTK_CELL_WIDGET:
|
|
|
|
/* unimplimented */
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
1998-01-06 06:48:48 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist_row->cell[column].type = GTK_CELL_EMPTY;
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
switch (type)
|
1998-01-06 06:48:48 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
case GTK_CELL_TEXT:
|
|
|
|
if (text)
|
|
|
|
{
|
|
|
|
clist_row->cell[column].type = GTK_CELL_TEXT;
|
|
|
|
GTK_CELL_TEXT (clist_row->cell[column])->text = g_strdup (text);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case GTK_CELL_PIXMAP:
|
|
|
|
if (pixmap)
|
|
|
|
{
|
|
|
|
clist_row->cell[column].type = GTK_CELL_PIXMAP;
|
|
|
|
GTK_CELL_PIXMAP (clist_row->cell[column])->pixmap = pixmap;
|
|
|
|
/* We set the mask even if it is NULL */
|
|
|
|
GTK_CELL_PIXMAP (clist_row->cell[column])->mask = mask;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case GTK_CELL_PIXTEXT:
|
|
|
|
if (text && pixmap)
|
|
|
|
{
|
|
|
|
clist_row->cell[column].type = GTK_CELL_PIXTEXT;
|
|
|
|
GTK_CELL_PIXTEXT (clist_row->cell[column])->text = g_strdup (text);
|
|
|
|
GTK_CELL_PIXTEXT (clist_row->cell[column])->spacing = spacing;
|
|
|
|
GTK_CELL_PIXTEXT (clist_row->cell[column])->pixmap = pixmap;
|
|
|
|
GTK_CELL_PIXTEXT (clist_row->cell[column])->mask = mask;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
1998-01-06 06:48:48 +00:00
|
|
|
|
1998-11-26 18:47:58 +00:00
|
|
|
if (clist->column[column].auto_resize &&
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
!GTK_CLIST_AUTO_RESIZE_BLOCKED(clist))
|
1998-11-26 18:47:58 +00:00
|
|
|
column_auto_resize (clist, clist_row, column, requisition.width);
|
1998-10-19 22:46:38 +00:00
|
|
|
}
|
1998-01-06 06:48:48 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
static void
|
|
|
|
cell_size_request (GtkCList *clist,
|
|
|
|
GtkCListRow *clist_row,
|
|
|
|
gint column,
|
|
|
|
GtkRequisition *requisition)
|
|
|
|
{
|
|
|
|
GtkStyle *style;
|
|
|
|
gint width;
|
|
|
|
gint height;
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
|
|
|
g_return_if_fail (requisition != NULL);
|
1998-03-08 20:44:01 +00:00
|
|
|
|
1998-12-16 00:52:46 +00:00
|
|
|
get_cell_style (clist, clist_row, GTK_STATE_NORMAL, column, &style,
|
1998-10-19 22:46:38 +00:00
|
|
|
NULL, NULL);
|
|
|
|
|
|
|
|
switch (clist_row->cell[column].type)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
case GTK_CELL_TEXT:
|
|
|
|
requisition->width =
|
|
|
|
gdk_string_width (style->font,
|
|
|
|
GTK_CELL_TEXT (clist_row->cell[column])->text);
|
|
|
|
requisition->height = style->font->ascent + style->font->descent;
|
|
|
|
break;
|
|
|
|
case GTK_CELL_PIXTEXT:
|
|
|
|
gdk_window_get_size (GTK_CELL_PIXTEXT (clist_row->cell[column])->pixmap,
|
|
|
|
&width, &height);
|
|
|
|
requisition->width = width +
|
|
|
|
GTK_CELL_PIXTEXT (clist_row->cell[column])->spacing +
|
|
|
|
gdk_string_width (style->font,
|
|
|
|
GTK_CELL_TEXT (clist_row->cell[column])->text);
|
|
|
|
|
|
|
|
requisition->height = MAX (style->font->ascent + style->font->descent,
|
|
|
|
height);
|
|
|
|
break;
|
|
|
|
case GTK_CELL_PIXMAP:
|
|
|
|
gdk_window_get_size (GTK_CELL_PIXMAP (clist_row->cell[column])->pixmap,
|
|
|
|
&width, &height);
|
|
|
|
requisition->width = width;
|
|
|
|
requisition->height = height;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
requisition->width = 0;
|
|
|
|
requisition->height = 0;
|
|
|
|
break;
|
1998-03-08 20:44:01 +00:00
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
|
|
|
|
requisition->width += clist_row->cell[column].horizontal;
|
|
|
|
requisition->height += clist_row->cell[column].vertical;
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* PUBLIC INSERT/REMOVE ROW FUNCTIONS
|
|
|
|
* gtk_clist_prepend
|
|
|
|
* gtk_clist_append
|
|
|
|
* gtk_clist_insert
|
|
|
|
* gtk_clist_remove
|
|
|
|
* gtk_clist_clear
|
|
|
|
*/
|
|
|
|
gint
|
1998-11-23 13:53:25 +00:00
|
|
|
gtk_clist_prepend (GtkCList *clist,
|
1998-11-26 03:43:24 +00:00
|
|
|
gchar *text[])
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_val_if_fail (clist != NULL, -1);
|
|
|
|
g_return_val_if_fail (GTK_IS_CLIST (clist), -1);
|
|
|
|
g_return_val_if_fail (text != NULL, -1);
|
|
|
|
|
|
|
|
return GTK_CLIST_CLASS_FW (clist)->insert_row (clist, 0, text);
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
gint
|
1998-11-23 13:53:25 +00:00
|
|
|
gtk_clist_append (GtkCList *clist,
|
1998-11-26 03:43:24 +00:00
|
|
|
gchar *text[])
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_val_if_fail (clist != NULL, -1);
|
|
|
|
g_return_val_if_fail (GTK_IS_CLIST (clist), -1);
|
|
|
|
g_return_val_if_fail (text != NULL, -1);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
return GTK_CLIST_CLASS_FW (clist)->insert_row (clist, clist->rows, text);
|
|
|
|
}
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
gint
|
1998-11-23 13:53:25 +00:00
|
|
|
gtk_clist_insert (GtkCList *clist,
|
|
|
|
gint row,
|
1998-11-26 03:43:24 +00:00
|
|
|
gchar *text[])
|
1998-10-19 22:46:38 +00:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (clist != NULL, -1);
|
|
|
|
g_return_val_if_fail (GTK_IS_CLIST (clist), -1);
|
|
|
|
g_return_val_if_fail (text != NULL, -1);
|
1998-01-06 06:48:48 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (row < 0 || row > clist->rows)
|
|
|
|
row = clist->rows;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
return GTK_CLIST_CLASS_FW (clist)->insert_row (clist, row, text);
|
|
|
|
}
|
1998-10-01 13:24:42 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
void
|
|
|
|
gtk_clist_remove (GtkCList *clist,
|
|
|
|
gint row)
|
|
|
|
{
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->remove_row (clist, row);
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
void
|
|
|
|
gtk_clist_clear (GtkCList *clist)
|
1998-06-02 02:51:46 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (clist != NULL);
|
1998-07-15 23:40:00 +00:00
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-10-19 22:46:38 +00:00
|
|
|
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->clear (clist);
|
|
|
|
}
|
1998-06-02 02:51:46 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* PRIVATE INSERT/REMOVE ROW FUNCTIONS
|
|
|
|
* real_insert_row
|
|
|
|
* real_remove_row
|
|
|
|
* real_clear
|
1998-12-02 00:52:14 +00:00
|
|
|
* real_row_move
|
1998-10-19 22:46:38 +00:00
|
|
|
*/
|
|
|
|
static gint
|
|
|
|
real_insert_row (GtkCList *clist,
|
|
|
|
gint row,
|
|
|
|
gchar *text[])
|
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
GtkCListRow *clist_row;
|
1998-08-05 20:02:32 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_val_if_fail (clist != NULL, -1);
|
|
|
|
g_return_val_if_fail (GTK_IS_CLIST (clist), -1);
|
|
|
|
g_return_val_if_fail (text != NULL, -1);
|
1998-06-02 02:51:46 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* return if out of bounds */
|
|
|
|
if (row < 0 || row > clist->rows)
|
|
|
|
return -1;
|
1998-06-02 02:51:46 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* create the row */
|
|
|
|
clist_row = row_new (clist);
|
1998-06-02 02:51:46 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* set the text in the row's columns */
|
|
|
|
for (i = 0; i < clist->columns; i++)
|
|
|
|
if (text[i])
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->set_cell_contents
|
|
|
|
(clist, clist_row, i, GTK_CELL_TEXT, text[i], 0, NULL ,NULL);
|
1998-06-02 02:51:46 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (!clist->rows)
|
1998-06-02 02:51:46 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
clist->row_list = g_list_append (clist->row_list, clist_row);
|
|
|
|
clist->row_list_end = clist->row_list;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (GTK_CLIST_AUTO_SORT(clist)) /* override insertion pos */
|
1998-10-19 22:46:38 +00:00
|
|
|
{
|
|
|
|
GList *work;
|
|
|
|
|
|
|
|
row = 0;
|
|
|
|
work = clist->row_list;
|
|
|
|
|
|
|
|
if (clist->sort_type == GTK_SORT_ASCENDING)
|
|
|
|
{
|
|
|
|
while (row < clist->rows &&
|
|
|
|
clist->compare (clist, clist_row,
|
|
|
|
GTK_CLIST_ROW (work)) > 0)
|
|
|
|
{
|
|
|
|
row++;
|
|
|
|
work = work->next;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
while (row < clist->rows &&
|
|
|
|
clist->compare (clist, clist_row,
|
|
|
|
GTK_CLIST_ROW (work)) < 0)
|
|
|
|
{
|
|
|
|
row++;
|
|
|
|
work = work->next;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
1998-08-17 14:48:51 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* reset the row end pointer if we're inserting at the end of the list */
|
|
|
|
if (row == clist->rows)
|
|
|
|
clist->row_list_end = (g_list_append (clist->row_list_end,
|
|
|
|
clist_row))->next;
|
|
|
|
else
|
|
|
|
clist->row_list = g_list_insert (clist->row_list, clist_row, row);
|
1999-02-02 01:57:11 +00:00
|
|
|
|
1998-06-02 02:51:46 +00:00
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
clist->rows++;
|
|
|
|
|
|
|
|
if (row < ROW_FROM_YPIXEL (clist, 0))
|
|
|
|
clist->voffset -= (clist->row_height + CELL_SPACING);
|
|
|
|
|
|
|
|
/* syncronize the selection list */
|
|
|
|
sync_selection (clist, row, SYNC_INSERT);
|
|
|
|
|
1999-02-02 01:57:11 +00:00
|
|
|
if (clist->rows == 1)
|
|
|
|
{
|
|
|
|
clist->focus_row = 0;
|
|
|
|
if (clist->selection_mode == GTK_SELECTION_BROWSE)
|
|
|
|
gtk_clist_select_row (clist, 0, -1);
|
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* redraw the list if it isn't frozen */
|
1998-11-28 01:56:09 +00:00
|
|
|
if (CLIST_UNFROZEN (clist))
|
1998-06-02 02:51:46 +00:00
|
|
|
{
|
1998-11-07 14:29:22 +00:00
|
|
|
adjust_adjustments (clist, FALSE);
|
1998-06-02 02:51:46 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE)
|
|
|
|
draw_rows (clist, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
return row;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
real_remove_row (GtkCList *clist,
|
|
|
|
gint row)
|
|
|
|
{
|
|
|
|
gint was_visible, was_selected;
|
|
|
|
GList *list;
|
|
|
|
GtkCListRow *clist_row;
|
|
|
|
|
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
|
|
|
|
|
|
|
/* return if out of bounds */
|
|
|
|
if (row < 0 || row > (clist->rows - 1))
|
|
|
|
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 = g_list_nth (clist->row_list, row);
|
1999-01-21 03:46:32 +00:00
|
|
|
g_assert (list != NULL);
|
1998-10-19 22:46:38 +00:00
|
|
|
clist_row = list->data;
|
|
|
|
|
|
|
|
/* if we're removing a selected row, we have to make sure
|
|
|
|
* it's properly unselected, and then sync up the clist->selected
|
|
|
|
* list to reflect the deincrimented indexies of rows after the
|
|
|
|
* removal */
|
|
|
|
if (clist_row->state == GTK_STATE_SELECTED)
|
1998-11-04 01:28:07 +00:00
|
|
|
gtk_signal_emit (GTK_OBJECT (clist), clist_signals[UNSELECT_ROW],
|
|
|
|
row, -1, NULL);
|
1998-10-19 22:46:38 +00:00
|
|
|
|
Adapt cast macros to standard.
Fri Nov 19 10:34:41 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkgamma.h: Adapt cast macros to standard.
[ Merges from 1.2 ]
Tue Nov 16 10:15:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_path):
If translation does not include a '/', use entire
translation instead of crashing.
Sun Oct 31 22:21:11 1999 Tim Janik <timj@gtk.org>
* docs/gtk_tut.sgml:
s/gtk_accel_group_attach/gtk_window_add_accel_group/.
Sat Oct 30 09:09:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_target_list_remove): Use
g_list_remove_link, not g_list_remove.
[ From Geert Bevin <gbevin@thunderstorms.org> ]
Sun Oct 24 07:41:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkclist.c (real_undo_selection): commented out g_print()
statement upon unselection (how the heck did that slip in?).
Sat Oct 23 03:03:08 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_freeze):
(gtk_text_thaw): undraw/draw cursor here to avoid unnecessary scrolling
in frozen state (and aparently crashes). patch provided by Anders
Melchiorsen <and@kampsax.dtu.dk>.
Sat Oct 23 02:53:20 1999 Tim Janik <timj@gtk.org>
* fix insensitive default/focus widget activation,
reported by Matt Goodall <mgg@isotek.co.uk>.
* gtk/gtkwindow.c (gtk_window_key_press_event):
(gtk_window_activate_default):
(gtk_window_activate_focus):
return handled=FALSE for actiavtion of insensitive default
widgets. return handled=TRUE for activation of insensitive
focus widgets. don't activate in either case.
Tue Oct 19 09:55:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk-config.in (lib_gtk): Switch order of @x_cflags@
and $glib_cflags to match library order and in the
theory that an old version of GLib is more likely to
be in the include directory for X then vice-versa.
(Bug #2776)
Tue Oct 19 09:46:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always use LC_CTYPE
to determine the locale for fontsets, not LC_MESSAGES;
the user may want English messages with a handling
for non-English languages. (LC_CTYPE=ru_RU LC_MESSAGES=fr_FR
will still be broken) (Bug #2891)
Tue Oct 19 20:36:42 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Fixed the wrong number of "*"'s.
Tue Oct 19 12:15:13 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Changed the Korean default fontset.
Fri Oct 8 02:32:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): Fix bug
where when scrolling to the left or top double exposes
were done, causing major slowdowns.
Thu Oct 7 18:31:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always normalize codeset
names to lowercase and alphanumeric, before looking
them up.
* gtk/Makefile.am: Install codeset variant gtkrc files
with normalized names.
Thu Oct 7 22:52:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_popup_with_data): even
popup menus when the menu is already visible, but its parent
is still hidden, (happens after tornoff window got hidden).
Thu Oct 7 11:09:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (install-data-local): Fix
a typo where gtkrc.vi_VN.tcvn5712 wasn't getting
deleted, causing error messages on install.
Thu Oct 7 11:03:06 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtk[hv]paned.c (gtk_{h,v}paned_draw): Redraw
the handle as well, since we now sometimes ignore
exposes on the handle while resizing.
Wed Oct 6 18:02:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_append_default_pixmap_path): Fix stupid
extra g_free introduced in one of the last one or two
commits.
Wed Oct 6 16:38:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc*: Make naming of gtkrc files
consistent, put each style that a gtkrc.* file creates
in a unique namespace, remove old files before installing.
Wed Oct 6 14:31:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Avoid leaking memory when
gtk_rc_init is called multiple times. (Yes, people who
do that have bugs in their code.)
Tue Oct 5 11:36:57 PDT 1999 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: listing gtkrc in gtkconf_DATA seems to barf.
Remove it since it's generated by the Makefile anyway
Tue Oct 5 02:43:41 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputcommon.h (gdk_input_device_new): Free
device->info.axes for core pointer.
Thu Sep 30 13:55:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (destroy_idle_test): Rename idle to
idle_id, to deal with obsolete, broken C libraries.
Mon Sep 27 02:50:15 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkvscale.c (gtk_vscale_draw): Don't add in
allocation->x/y twice!
* gtk/gtkhscale.c: Make usage of gtk_hscale_pos_trough()
consistent with gtk_vscale_pos_trough().
Sun Sep 26 19:44:34 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_queue_resize): We may
be queueing a resize on a toplevel container between
the time we show it and when we map it. So, we need
to test GTK_WIDGET_VISIBLE() for toplevels, and only
use GTK_WIDGET_DRAWABLE() for child windows.
Thu Sep 23 16:41:03 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDADDS): Add GDK_WLIBS to LDADDS
(fixes bug #2144)
Fri Sep 24 00:51:45 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c (gtk_container_queue_resize): check for
container DRAWABLE (instead of VISIBLE), so we don't queue
resizes on non-toplevel containers.
Sun Sep 19 18:13:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.[ch]: Make the data argument
const guchar *.
Sat Sep 18 21:27:40 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: Try to behave sensibly if
the focus widget is the window itself. (Should
we allow this at all?)
Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_set_sensitive):
* gtk/gtknotebook.c (gtk_notebook_set_scrollable):
* gtk/gtknotebook.c (gtk_notebook_set_show_border):
* gtk/gtkclist.c (gtk_notebook_set_show_border): make gboolean args
in prototypes and implementations consistent (Tomas Ogren).
* gtk/gtklayout.c (gtk_layout_remove): unset GTK_IS_OFFSCREEN flag
before the widget is unparented (reported by damon).
* gtk/gtkdnd.c: make the cursor and icon data _unsigned_ char,
since we provide unsigned data anyways.
Thu Sep 16 21:32:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_set_tip): Delay
the call to gtk_tooltips_layout_text() until later.
* gtk/gtktooltips.c (gtk_tooltips_draw_tips):
Call gtk_widget_ensure_style() before using the style.
Wed Sep 15 02:52:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_event): Added workaround
for old widgets that don't propagate draws to all
children. (Namely gnome-dock for gnome-libs <= 1.0.16)
Tue Sep 14 19:22:19 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_queue_resize): don't queue the parent
for a redraw but just the widget that requested the resize.
Tue Sep 14 18:29:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c: added new widget level method
gtk_container_set_reallocate_redraws() and a GtkContainer flag
reallocate_redraws : 1 to reflect the setting, exported this through
the argument system as a boolean ::reallocate_redraws.
* gtk/gtkwidget.c (gtk_widget_size_allocate): when queueing redraws
on the widget because the allocation changes, do so as well for
widget->parent if the parent has reallocate_redraws set to TRUE.
with that containers requesting reallocation redraws get automatically
redrawn if their children changed allocation (this unfortunately
affects also other children that didn't change allocation, but we
cannot work around that before 1.3).
Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_idle_draw): only emit ::draw if width
_and_ height are >0 (not _or_).
* gtk/gtktable.c (gtk_table_remove): use gtk_widget_queue_resize()
instead of gtk_container_queue_resize(), which is a core gtk internal
function (must have been on crack when i queued that).
* gtk/gtkprivate.h: added new private flag GTK_FULLDRAW_PENDING, so
we can check more reliably if we want to discard expose events.
* gtk/gtkwidget.c: added setting/unsetting of the GTK_FULLDRAW_PENDING
flag.
* gtk/gtkwidget.c (gtk_widget_event): don't discard synthesized exposes,
we simply trust these events. for deciding whether to discard exposes,
check GTK_FULLDRAW_PENDING instead of RESIZE_PENDING.
Mon Sep 13 15:01:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore
queues of areas that are completely off screen.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fix broken
logic for handleboxes.
* gtk/gtkwidget.c (gtk_widget_queue_draw_data): Add santity
check on width/height.
Mon Sep 13 02:22:47 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: backed out Raja's recent VPATH build "improvements",
we are fine with using $@ the way we do (if we actually encounter
brokeness with $@ in VPATH builds because of additional path prefixes,
we need to use $(@F) actually).
Mon Sep 13 01:34:53 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c: renamed two variables, hopefully didn't introduce
short lived bugs, that would allow language bindings to do surgeries
to our guts.
Fri Sep 10 15:22:50 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_size_allocate): Fix typo
where comparison was being done against an uninitialized
value causing intermittant results depending on
compiler flags. Also make it clearer that we aren't
ever initializing the child as 0x0 (though this will
be caught in gtk_widget_size_allocate())
Fri Sep 10 10:06:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_transient_for): Move
gtk_window_unset_transient_for() call after we do checks
involving the old transient parent.
[ From Lance Capser <lmc@cyberhighway.net> ]
1999-09-07 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gtk.defs): Go back to using `touch' to create
an empty file.
Mon Sep 6 00:11:56 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (gtk_ctree_is_ancestor): return FALSE if node has
no children. (Reported by: Chris Rogers <gandalf@pobox.com>)
1999-09-03 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gen_sources): Improve VPATH builds.
`$@' is valid only in the build dir, not after we've done
`cd $srcdir'. Also use `test -f' instead of less portable
`test -e'.
Fri Sep 3 15:59:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (correct_cache_insert): Rewrite
for simplicity, and hopefully correctness.
(Fixes bug #1322, which was a segfault when
on some insertions with the properties around
the insertion set up just wrong.)
* gtk/gtktext.c (gtk_text_adjustment): When we receive
a "changed" signal, clamp the new value to the adjustment
bounds to avoid segfaulting if someone tries to change
the adjustment to a bogus value. (Bug #1795)
Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c: Ignore unexpected destroy notifies
for children, for toplevel windows handle them
like delete_event.
* gtk/gtkplug.c: Add an unrealize handler so that
we unref plug->socket_window when we are done
with it.
Fri Sep 3 14:52:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_area): Fix stupid signedness
problem that was causing background to sometimes
be misaligned.
Fri Sep 3 12:26:33 1999 Owen Taylor <otaylor@redhat.com>
[ Fixes pointed out by Ettore Perazzoli <ettore@comm2000.it> ]
* gtk/gtkmenu.c (gtk_menu_position): Make
sure we never position menus with negative x, y,
since gtk_widget_set_uposition() can't handle that.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu):
Modify the positioning code a bit so that we always
put the top-left corner onscreen. (This is for
UI reasons, gtk_menu_position() now takes care of
gtk_widet_set_uposition() brokeness.)
Fri Sep 3 03:06:30 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: fixed up things for -jx, x > 1.
Sun Sep 5 08:48:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_style): Ref the
RC style that is passed in. The lack of the ref
before was a bug. If people worked around this
bug, this will introduce a slight memory leak
in their code. The code should typically look like:
rc_style = gtk_rc_style_new ();
[...]
gtk_widget_modify_style (widget, rc_style);
gtk_rc_style_unref (rc_style);
* gtk/gtkwidget.c (gtk_widget_modify_style): Reset
the style if it was already set.
* gtk/gtkwidget.c (gtk_widget_set_name): Only set the
style if it was set before.
Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (main): Add a check to see if we
are being run from the correct directory and
to quit nicely if we are not.
* gtk/gtkrc.c (gtk_rc_slist_remove_all): Make function
static.
Thu Sep 2 23:00:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkenums.h (GtkWindowPosition): added GTK_WIN_POS_CENTER_ALWAYS.
* gtk/gtkwindow.c:
queue resizes unconditionally (gtk_widget_queue_resize will figure
what to do if the window is not realized).
(gtk_window_move_resize): only recenter the window
for GTK_WIN_POS_CENTER_ALWAYS.
(gtk_window_compute_reposition): handle GTK_WIN_POS_CENTER_ALWAYS in
the same way as GTK_WIN_POS_CENTER.
Thu Sep 2 22:39:27 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_reposition): check for the last position
with (!(info->last_flags & GDK_HINT_POS)) instead of
(!info->last_flags & GDK_HINT_POS).
* gtk/gtkwindow.c (gtk_window_move_resize): constrain new_width and
new_height unconditionally, because we use these values even if
!default_size_changed && !hints_changed.
comented the (default_size_changed || hints_changed) case with
respect to resize rejects from the window manager.
* gtk/gtkwindow.c (gtk_window_move_resize): save info->last values
in the zvt condition hack, since this includes the window hints, set
the hints after the handling_resize case.
* gtk/gtkwindow.c (gtk_window_show): constrain the default size that a
window is initially shown with to the geometry.
Thu Sep 2 07:38:56 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize):
s/size_changed/default_size_changed/g so i know what's
really going on (frying brain on smaller flame now).
Thu Sep 2 05:47:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): queue a new resize if
we have size_changed upon handling_resize. this is a gross
workaround for the broken zvt widget and should be removed in
1.3 again (search for FIXME).
Owen provided an accurate comment for this:
/* We could be here for two reasons
* 1) We coincidentally got a resize while handling
* another resize.
* 2) Our computation of size_changed was completely
* screwed up, probably because one of our children
* is broken. It's probably a zvt widget.
*
* For 1), we could just go ahead and ask for the
* new size right now, but doing that for 2)
* might well be fighting the user (and can even
* trigger a loop). Since we really don't want to
* do that, we requeue a resize in hopes that
* by the time it gets handled, the child has seen
* the light and is willing to go along with the
* new size. (this happens for the zvt widget, since
* the size_allocate() above will have stored the
* requisition corresponding to the new size in the
* zvt widget)
*
* This doesn't buy us anything for 1), but it shouldn't
* hurt us too badly, since it is what would have
* happened if we had gotten the configure event before
* the new size had been set.
*/
Wed Sep 1 20:46:11 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: deal properly with the fact that RC
style lists may include rc styles more than once.
* gtk/gtkrc.c (gtk_rc_append_pixmap_path): Removed
unused static function.
* gtk/gtkrc.c (gtk_rc_find_pixmap_in_path): Keep a
stack of directories of RC files currently being
parsed and implicitely add them to pixmap path.
This fixes a bug where the directory would get
appended then overwritten by pixmap_path declarations.
(bug #1462, from Peter Wainright <prw@wainpr.demon.co.uk>)
* gtk/gtkthemes.c (gtk_theme_engine_unref): Call
theme's exit function. (Patch from Peter Wainwright,
bug #1454)
* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_destroy):
Add a destroy() handler to take care of removing
group for menu item. (Fixes bug #1197)
* gtk/gtkwidget.c (gtk_widget_size_request): Fixed thinko
in warning message.
Wed Sep 1 21:27:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): don't require a server
roundtrip to figure window's width and height, since we know that
anyways from widget->allocation.
Wed Sep 1 12:37:44 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Compute
the hints after we request the new size.
Wed Sep 1 10:38:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_compute_hints): Removed
GTK_WIDGET_REALIZED() assertion - we can compute the
hints before we are realized.
* gtk/gtkwindow.c (gtk_window_move_resize): Reorder
hint changing so that we have a value of hints_changed
when we decide whether to constrain the window size.
* gtk/gtkwindow.c (gtk_window_move_resize): Spelling fix.
* gtk/gtkwindow.c (gtk_window_constrain_size): cleanups,
change back to G_MAXINT.
Wed Sep 1 06:54:59 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_get_geometry_info): zero initialize
new GtkWindowGeometryInfo, so fields like GdkGeometry geometry
contain uncluttered values.
(gtk_window_compute_hints): simply assert that window is realized
and that geometry_info is valid, since we rely on this anyways.
(gtk_window_constrain_size): major cleanups to the code.
if (flags & GDK_HINT_BASE_SIZE) use geometry's base width and height
for the base size, instead of the minimums. use 32767 as max width
and height (like in gtkwindow.c) instead of G_MAXINT.
Wed Sep 1 04:41:25 1999 Tim Janik <timj@gtk.org>
* cleaned up the GtkContainer.need_resize flag handling mess, we
only need to force resize requests when we were prematurely
realized, or our widget tree was modified when we were temporarily
hidden. handling these cases directly upon showing the window (i.e.
while the GdkWindow is still unmapped) avoids the need to wait for
a configure event response and therefore makes the GUI more snappier
and avoids blank windows during the roundtrip.
* gtk/gtkwidget.c:
(gtk_widget_hide):
(gtk_widget_show): don't queue resizes on toplevels, they know how
to deal with matters.
* gtk/gtkcontainer.c (gtk_container_queue_resize): set the ->need_resize
flag directly for not visible resize containers and spare us unecessary
signal emissions.
* gtk/gtkwindow.c:
(gtk_window_realize): if we need to enforce premature size allocation,
queue a container resize so we are correctly resized later on.
(gtk_window_init):
(gtk_window_size_request):
don't freak around with the ->need_resize flag,
gtk_container_queue_resize() will care about that.
(gtk_window_show):
handle initial resizing issues here, we can handle matters better in
this place, especially since we know that our GdkWindow is still
unmapped.
(gtk_window_move_resize):
don't care about ->need_resize at all.
handle size changes properly that occoured while we waited for a
configure event.
Tue Aug 31 15:58:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_uposition):
* gtk/gtkwindow.[hc] (gtk_window_reposition):
Move the hint setting code from gtk_widget_set_uposition
to here; set the hints so that we respect any previously
set geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Don't
change the window hints here or move the window here,
let that happen in gtk_window_move_resize().
Tue Aug 31 06:58:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): when discarding exposes due
to already queued resizes (and therefore redraws) on a widget, check
its anchestry as well.
* gtk/gtkcontainer.c:
(gtk_container_queue_resize): clear resize widgets for resize
containers before aborting prematurely. this is especially important
for toplevels which may need imemdiate processing or their resize
handler to be queued.
(gtk_container_dequeue_resize_handler): added new internal function for
gtkwindow.c.
* gtk/gtkwindow.c (gtk_window_move_resize): if we are resizing due to a
configure event, take possible changes in window position into account
as well.
if we request a new window size, queue up a resize handler that will
last until the configure event response arrives.
combined the ->need_resize case (initial show) with the general size
(hints) changed case and added even more comments.
if !auto_shrink, only revert to the old allocation if the new size
is smaller than the current allocation.
Tue Aug 31 11:55:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_arg, gtk_window_set_policy,
gtk_window_set_geometry_hints
gtk_window_set_default_size):
When hints are set, queue a resize so that the hints will
be eventually reset on the toplevel.
* gtk/gtkwindow.c (gtk_window_show): Use
gtk_window_compute_default_size(). Clear the need_resize flag
on the initail map so that we don't unnecessarily trigger the
resize code.
* gtk/gtkwindow.c (gtk_window_move_resize): Split apart
into separate functions. Compare the hints we are setting
with what we set last time so that we can accurately
tell when we need to reset the hints.
* gtk/gtkwindow.c (gtk_window_compute_default_size): New
function to figure out the size from requisition
and default_size.
* gtk/gtkwindow.c (gtk_window_constrain_size): Function
from fvwm to constrain a size to the geometry hints.
* gtk/gtkwindow.c (gtk_window_compare_hints): New function
to compare two sets of geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_hints): Renamed
from gtk_window_set_hints(), just compute the hints,
don't set them.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Move
code from gtk_window_move_resize() to separate function,
rationalize a bit.
Tue Aug 31 13:05:03 1999 Owen Taylor <otaylor@redhat.com>
* gtkrc.h: Move the ref_count member out of the GtkRcStyle
structure into a new private structure.
* gtkrc.c: Split GtkRcStyle into public/private.
In the private part, add a list of pointers to the
RcStyle lists this RcStyle participates in.
* gtkrc.c: When a RcStyle is free, remove all
lists referencing it from the
realized_style_ht hash, and free those lists.
* gtk/gtkrc.c (gtk_rc_clear_styles): Don't call
gtk_rc_init(), since that adds the default styles
to the list of parsed RC files again.
* gtk/gtkrc.c: Use gtk_rc_style_find() consistently.
Thu Aug 26 14:14:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): reactivated the sanity
checks that ensure that a widget's allocation is at least 1 in width
and height. (GNOME note: this doesn't affect old panel code anymore,
because GtkSocket will request width and height of at least 1 since
Fri Jul 23).
* gtk/gtkwindow.c (gtk_window_realize): if the widget hasn't been
allocated yet (happens if the user realizes the window prematurely),
size request and allocate it.
(gtk_window_size_allocate): guard against guint underflows.
Wed Aug 25 19:01:36 1999 Lars Hamann <lars@gtk.org>
* gtk/Makefile.am (gtk_built_sources): reordered stamp-gtk.defs
in gtk_built_sources, so gtk.defs gets built prior to all other
sources.
Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am:
invoke indent on gtkmarshal.*.
rewrote source generation rules, use COPYING as oldest source tag for
a piggyback rule to generate all sources from (don't touch it ;).
major cleanups, strip spaces on build rules for GNU Make.
* gtk/genmarshal.pl: don't operate on hardcoded filenames but take
source and target files from commandline arguments. don't invoke indent.
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Wed Aug 18 09:20:10 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c:
we use window->need_resize from configure_event now, to indicate that
the gtkwindow should keep its allocation (e.g. because the user resized
the window through window manager handles). resize_count is now reliably
used to figure whether we got the allocation we requested from the
window manager.
configure events get queued as resizes now, the real stuff (size
computation and allocation) now only goes on in gtk_window_move_resize().
GtkWindow's requisition now contains its *real* requisition (like all
other widgets), *not* taking usize into account.
geometry_info->last_{width|height} is now updated from set_hints() only
so it always contains the last hints we set for the window manager.
made some event handlers return TRUE instead of FALSE.
the overall code should be much more straight forward now, and the
significant code portions are accompanied by comments now.
(gtk_window_set_hints):
removed requisition argument and made it
fetch the requisition through gtk_widget_get_child_requisition.
we also don't move the gdkwindow here anymore, gtk_window_move_resize()
does that now.
(gtk_window_show):
ensure that the widget is realized before calling
gtk_container_check_resize() (and thus gtk_window_move_resize()), also
ensure that we got properly size requested and allocated before
realization.
(gtk_window_configure_event):
ignore plain window moves, or reallocate the widget tree through the
resize queue otherwise.
(gtk_window_move_resize):
mostly rewrote this function to figure window manager hints more
reliably, coalesce window moves and resizes to reduce configure events
and do actuall size allocations.
Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): discard expose events for widgets
that have a resize pending, because a redraw is already queued for them.
* gtk/gtkcontainer.c: removed ugly connect_to ::size_allocate signal
hack to clear resize_widgets.
* gtk/gtkwidget.c (gtk_widget_size_allocate): call clear_resize_widgets
for resize containers prior to size allocation. (this is also a bit
ugly, but avoids side effects for stopped emissions and is thus more
reliable).
(gtk_widget_unparent): removed disconnect call for clear_resize_widgets.
* gtk/gtktooltips.c (gtk_tooltips_paint_window): renamed this
function from gtk_tooltips_expose, as we connect to ::expose_event
*and* ::draw now.
1999-08-18 Federico Mena Quintero <federico@redhat.com>
* gtk/gtkselection.c (gtk_target_list_ref): Added missing sanity
checks.
(gtk_target_list_unref): Likewise.
* gtk/gtkthemes.c (gtk_theme_engine_unref): Likewise.
Tue Aug 17 15:47:07 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_draw_value_bar):
guard against division by zero. (Fixes bug #1339)
Tue Aug 17 10:56:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_move_{forward,backward}_word):
Prevent the trivial leak of information of allowing
word motion when the entry is not visible.
Tue Aug 17 10:28:52 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_fileop_error): Propagate
modality to error dialog as well as confirmation dialogs.
(Bug #1803, reported by Rosanna Wing Sze Yuen)
Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktreeitem.c (gtk_tree_item_draw_lines): Honor
tree->view_lines.
(gtk-guy-990611-3.patch: Guy Harris <guy@netapp.com>)
* gtk/Makefile.am (install-data-local): Solaris apparently
has various troubles with ln -f; use rm first instead.
(gtk-guy-990611-2.patch: Guy Harris <guy@netapp.com>)
1999-07-30 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (stamp-m): Don't `mv' from builddir to srcdir,
use `cp' followed by `rm' (the `rm' was already there).
July 30, 1999 Elliot Lee <sopwith@redhat.com>
* configure.in: Fix autoconf warnings about cross compilation by
trying to provide sane defaults for AC_TRY_RUN.
* gtk/Makefile.am: If we refer to gtkmarshal.[ch] in $(srcdir),
put them into $(srcdir) when generated. Also add a dependency of
gtksignal.h on gtkmarshal.h for -j builds.
* gtk/gtk(dnd,style,gamma).c: Minor warning fixes.
Wed Jul 28 09:29:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration_do): Added missing
GDK_THREADS_{LEAVE,ENTER} pair.
(From Paul Fisher <pnfisher@redhat.com>)
Fri Jul 23 01:00:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtksocket.c (gtk_socket_size_request): asure that the requested
width and height are always >0 (owen).
Fri Jul 23 00:00:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): backed out my recent
change that assured that a widget's allocated with and height are
always >1, since this breaks *buggy* panel code. unfortunately this
back-breaks the gimp's color selector.
* gtk/gtkdrawingarea.c (gtk_drawing_area_size_allocate): asure that our
allocation is always >0 in width and height, before sending the
configure event; this is a *gross* hack to get the gimp back to work.
* marked both cases with TODO-1.3
Wed Jul 21 15:47:39 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Don't display wrap indicators when
text is not editable and word wrap is on.
Wed Jul 21 08:21:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): special case
option menus here as they are not derived from menu shell, assure that
the option menu has a menu we can add items to.
Tue Jul 20 23:29:48 1999 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_page_allocate): convert allocation->
width/height to (gint) before calculations and check against < 0 to
avoid guint wraparounds.
Sun Jul 18 00:35:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): ensure that the allocated
width and height is never zero. sanity check both dimensions against
32767 and issue a warning if the allocation is greater than that.
Wed Jul 7 15:03:30 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_events_pending): Unlock around call
to g_main_pending() as well.
Wed Jul 7 14:59:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration): Unlock around
call to g_main_iteration() - since that will regrab
GTK+ lock to process events.
Thu Jul 1 15:01:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c
- Regularize with the rest of GTK+ by making widget->requisition
not reflect the set_usize()
- Always recompute geometry hints, then check if they
changed before sending them to the X server. The
previous checks for changes would fail in a number
of circumstances.
Thu Jul 1 11:55:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Include <stdlib.h> for strcmp().
Wed Jun 30 19:26:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c:
- Code cleanups
- Instantaneously update on modifier key presses
- Allow cancellation of the drag with Escape.
Tue Jun 29 17:04:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_handle_box): Set the policy
to auto_shrink - otherwise the appearance is rather
strange when flipping between horizontal and vertical.
Mon Jun 28 09:29:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: add ::default_width and ::default_height arguments.
(gtk_window_set_default_size): don't change a value if it's < 0.
queue a resize.
Sun Jun 27 11:00:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_insert): don't segfault on NULL inserts.
Mon Jun 28 12:08:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (cmpl_completion_fullname): Don't
add an extra "/" when concating "/" + filename.
(From Matt Grossman <mattg@oz.net>)
Mon Jun 28 10:57:12 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (draw_cell_pixmap): Reset clip mask
for fg_gc if we set it for drawing pixmap.
Tue Jun 15 12:45:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes from Peter Wainwright <prw@wainpr.demon.co.uk>
* gtk/gtkrc.c (gtk_rc_parse_engine): If rc_style->engine is
already set, call old engine's destroy function and
unref the old engine.
Thu Jun 10 17:59:38 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.c (gtk_drawing_area_size): queue a resize.
Wed Jun 9 15:13:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h: mark certain functions as internal.
Wed Jun 9 13:48:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpreview.c (gtk_preview_set_expand): queue a resize if the
expand behaviour changed.
* gtk/gtklabel.c (gtk_label_set_pattern):
(gtk_label_set_justify):
(gtk_label_set_line_wrap):
don't bother invoking queue_clear, the reallocation does
that for us, always free_words so the upcoming resize will
relayout the label's contents.
Wed Jun 9 12:50:48 1999 Tim Janik <timj@gtk.org>
* applied argument implementation patches from Elena Devdariani
<elena@cogent.ca>.
* gtk/gtktoolbar.c: ::orientation, ::toolbar_style, ::space_size,
::space_style, ::relief
* gtk/gtkruler.c: ::lower, ::upper, ::position, ::max_size
* gtk/gtkpreview.c: ::expand
* gtk/gtkpaned.c: ::handle_size, ::gutter_size
* gtk/gtknotebook.c: ::homogeneous
* gtk/gtklabel.c: ::wrap
* gtk/gtklist.c: ::selection_mode
* gtk/gtkhandlebox.c: ::handle_position, ::snap_edge
* gtk/gtkcurve.c: ::curve_type, ::min_x, ::max_x, ::min_y, ::max_y
* gtk/gtkcolorsel.c: ::update_policy, ::use_opacity
* gtk/gtkclist.c: ::sort_type
* gtk/gtkcheckmenuitem.c: ::active, ::show_toggle
* gtk/gtkaspectframe.c: ::xalign, ::yalign, ::ratio, ::obey_child
Tue Jun 1 23:38:38 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Removed ill-thought-out part of last
comment.
Tue Jun 1 23:30:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_attach): Get the reference
counting right when we have to attach a new style
for a different visual. (Chi-Deok Hwang <cdhwang@sr.hei.co.kr>)
* gtk/gtkstyle.c: Documented the refcounting
peculularities of gtk_style_attach.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkwindow.c (gtk_window_new): added return if fail for invalid
window types.
* examples/packer/pack.c (main): use GTK_WINDOW_TOPLEVEL instead
of GTK_TOPLEVEL for creating the window.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkmain.c (gtk_init_check): don't segfault when --gtk-module is
the last argument (reported by Per Winkvist).
Tue May 25 13:13:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes for invisible XOR lines (Frank Loemker
<floemker@TechFak.Uni-Bielefeld.DE>)
* gtk/gtkclist.c (gtk_clist_realize): Always use
a non-zero pixel for GDK_XOR.
* gtk/gtkvpaned.c gtk/gtkhpaned.c:
Use GDK_INVERT instead of GDK_XOR.
Wed May 12 21:56:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (adjust_adjustments): signal emit value_changed
signals if h/voffsets differ from adjustment values.
Reportet by Jerome Bolliet <bolliet@in2p3.fr>
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
the user data on the window before destroying it.
* gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
unrealize handler to take care of destroying
notebook->panel properly.
(Bug #1198 - Morten Welinder <terra@diku.dk>)
* gtk/gtktext.c (expand_scratch_buffer): Fix reversal
of g_new and g_realloc to stop memory leak. (Actually,
we could just use g_realloc(), but I'm not 100% sure
that is portable).
(Bug #1196 - Morten Welinder <terra@diku.dk>)
Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.h: Removed stray GtkPlugButton declaration.
* gdk/gdkfont.c (gdk_text_measure): Fix the return value
for fontsets.
* gtk/gtkbutton.c (gtkbutton_expose): Fix warning
with bin/button confusion.
Thu May 6 04:53:26 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: in the ItemFactory test, link radio items together,
and show how preselection of radio items is done.
Sun May 2 13:31:14 1999 Tim Janik <timj@gtk.org>
* gtk/gtktreeitem.c (gtk_tree_item_set_subtree):
* gtk/gtktree.c (gtk_tree_add) (gtk_tree_insert):
* gtk/gtktoolbar.c (gtk_toolbar_insert_element):
* gtk/gtkpaned.c (gtk_paned_pack2) (gtk_paned_pack1):
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_add):
* gtk/gtktable.c (gtk_table_attach):
* gtk/gtklist.c (gtk_list_insert_items):
* gtk/gtkmenushell.c (gtk_menu_shell_insert):
* gtk/gtknotebook.c (gtk_notebook_insert_page_menu):
* gtk/gtkpacker.c (gtk_packer_add_defaults) (gtk_packer_add):
* gtk/gtkbin.c (gtk_bin_add):
* gtk/gtkbox.c (gtk_box_pack_start) (gtk_box_pack_end):
* gtk/gtkfixed.c (gtk_fixed_put):
* gtk/gtklayout.c (gtk_layout_put):
general fixups to container_add logic. always realize child if
child->parent is realized, only map the child and queue a resize
if child and child->parent are both visible.
Fri Apr 30 09:02:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_unrealize): use gtk_container_forall
instead of gtk_container_foreach to walk and unrealize children, so
composite children get also unrealized.
(gtk_widget_real_show): don't call gtk_widget_map() if we don't need to.
(gtk_widget_map): assert that the widget is visible (basic constrain).
(gtk_widget_real_map): assert that the widget is realized (basic
constrain).
Fri Apr 29 00:53:20 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbindings.c (gtk_pattern_spec_init): plugged a memory leak.
Tue May 4 09:32:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc.iso-8859-2: Add a gtkrc
file for iso-8859-2 locales.
* configure.in (ALL_LINGUAS): ALL_LINGUAS update.
Tue Apr 27 16:38:32 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Fix typo of static_sources for static_SOURCES.
(Pointed out by andy@rz.uni-karlsruhe.de and others).
Remove some suspicious and useless lines.
Tue May 4 08:44:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c (gtk_clist_draw, draw_rows): Use
width,height = 0, 0 to mean - here to edge of window,
instead of -1, -1, since the former is all we support.
Tue May 4 08:34:43 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main): Correctly free list nodes
when removing from quit_functions list.
Tue Apr 27 14:17:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpacker.c (gtk_packer_size_request): remove unused variable.
Tue Apr 27 18:23:35 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable):
When redrawing characters on non-visible entry, use appropriate
'*' character. (Bug #1130 - Jean-Marc Jacquet <jm@littleigloo.org>)
Tue Apr 27 01:31:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (drag_dest_cell): compute destination cell
from drag coordinates.
(gtk_clist_drag_data_received) (gtk_clist_drag_motion):
use drag_dest_cell.
* gtk/gtktree (drag_dest_cell)
(gtk_ctree_drag_data_received) (gtk_ctree_drag_motion): likewise.
(Bug #1129)
Wed Apr 21 21:26:11 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_init): properly initialize
translate_* fields.
(gtk_item_factory_finalize): invoke translate_notify independant from
translate_data.
(gtk_item_factory_set_translate_func): likewise.
(gtk_item_factory_destroy): only remove ifactory pointer from those
widgets that belong to us (stupid me).
Mon Apr 19 12:05:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Fixed leak of
rc_style list when lookup succeeeds.
Thu Apr 15 01:11:24 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (resync_selection):
* gtk/gtkclist.c (resync_selection): fixed undo_selection bug.
* gtk/gtkclist.c (gtk_clist_button_release): fixed resync_selection
bug.
Fri Apr 9 19:22:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c gtk/gtkdnd.c gtk/gtkmenuitem.c:
Add some missing GDK_THREADS_ENTER()/LEAVE around
timeouts. (Patches from Sebastian Wilhelmi <wilhelmi@ira.uka.de>)
Thu Apr 8 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkentry.c (gtk_entry_key_press): use gtk_widget_activate()
rather than emit_by_name.
* gtk/gtkeditable.c (gtk_editable_insert_text): keep a reference
on the widget across multiple signal emissions.
(gtk_editable_delete_text): same here.
(gtk_editable_class_init): set widget_class->activate_signal after
editable_signals[ACTIVATE] has been created.
Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
position here prematurely -- we might not have the
right ->min_position and ->max_position yet.
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
Add error traps so if the other end of the connection
dies, we survive.
* gtk/gtkselection.c (gtk_selection_notify): Clean
up properly when selection property retrieval fails.
* gtk/gtkselection.c (gtk_selection_request): Correctly
reject SelectionRequest notifies where the handler
returns no data.
Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_dest_leave): Only unhighlight
when we've previously highlighted.
* gtk/gtkdnd.c (gtk_drag_dest_handle_event): Don't
emit two "drag_leave" signals for Motif drops.
* gtk/gtkdnd.c (gtk_drag_source_handle_event): Send
back the correct status messages when dropping from
Motif onto a proxy window that is rejecting the
drop.
Sat Mar 27 23:32:13 1999 Tim Janik <timj@gtk.org>
* gtk/gtkarg.[hc]: added functions from GLE, gtk_arg_reset() to free
the value and reset type to GTK_TYPE_INVALID, and gtk_arg_values_equal()
to compare two argument values. added gtk_arg_to_valueloc() to set a
variable from an arg through its location (pointer).
* gtk/gtkobject.[hc]: implemented gtk_object_get() in terms of
gtk_object_arg_get() and gtk_arg_to_valueloc(), floats are collected
as gfloat*, uchars are collected as guchar*, ints are collected as
gint*, etc...
Mon Mar 29 17:45:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccelgroup.c gtk/gtkgtkbindings.c:
Include <string.h> instead of <strings.h>.
* gtk/gtkstyle.c: Fix double include of gtkthemes.h
(actually, a lot more duplicate includes occur if
you trace through the sequence of #include's)
gtk-jbb-990320-0: John Bley, jbb6@acpub.duke.edu
Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com>
Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp>
gtk-a-higuti-990322-[0-3]
* configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS
that was causing -DX_LOCALE not to work.
* gtk/gtkrc.c (gtk_rc_init):
X_LOCALE will never have LC_MESSAGES defined
Thu Mar 25 12:38:31 1999 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_append_default_module_path): get $HOME from
g_get_home_dir() (gtk-pmc-990123-0.patch.gz).
* gtk/gtkwindow.c (gtk_window_key_press_event): feature keypad up/down/
left/right as well (gtk-michael-980726-0.patch.gz).
* gtk/gtklabel.[hc]: bunch of miscellaneous cleanups, such as s/0/NULL/
for pointer values, use gchar instead of char. fixed uline allocation
leaks, changed the allocation pattern so we use G_ALLOC_AND_FREE mem
chunks instead of G_ALLOC_ONLY.
(gtk_label_size_request): always alter requisition as passed and leave
widget->requisition alone.
(gtk_label_set_text): allow NULL strings.
(gtk_label_new): likewise.
Wed Mar 24 09:24:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.[hc]: type/macro fixups.
Mon Mar 22 05:51:34 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbin.c (gtk_bin_draw): only redraw children that are visible
*and* mapped (i.e. drawable).
(gtk_bin_expose): only send exposes to drawable children.
* gtk/gtkbox.c (gtk_box_draw): only redraw children that are drawable.
(gtk_box_expose): only send exposes to drawable children.
* gtk/gtkhscale.c (gtk_hscale_draw):
* gtk/gtkvscale.c (gtk_vscale_draw):
hm, this is an ugly one. we first compute the size of our trough area
here (window relative) and then check intersection with the draw_area
which is parent relative because we're a NO_WINDOW widget, so we need
to offset the trough area by allocation.x and allocation.y before the
check. (this must not be done for the background area though, since
that's already computed parent relative).
Mon Mar 22 00:41:39 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_unrealize): unmap clist if neccessary,
unrealize title buttons.
Fri Mar 19 00:00:22 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_column_title_passive)
(gtk_clist_column_title_active):
only connect/disconnect to GtkWidgetClass::event to block mouse events.
* gtk/gtkclist.c (vertical_timeout) (horizontal_timeout):
zero initialize event, removed superfluous gdk_window_get_pointer call
* gtk/gtklist.c (gtk_list_vertical_timeout)
(gtk_list_horizontal_timeout): removed superfluous
gdk_window_get_pointer call
Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org>
* plugging problems reported by "Bruce Mitchener, Jr."
<bruce@puremagic.com> due to a purify session.
* gtk/gtkstyle.c:
(gtk_style_ref):
(gtk_style_unref): assert ref_count to be > 0.
* gtk/gtkclist.c (gtk_clist_set_cell_style): { 0 } initilaize
the requisition.
(gtk_clist_set_shift): likewise.
* gtk/gtklayout.c: introduce gtk_layout_finalize() to unref the
adjustments.
* gtk/gtklist.c (gtk_list_horizontal_timeout): zero initialize the
event before sending it and set send_event to TRUE (which needs to
be done for *all* synthesized events).
(gtk_list_vertical_timeout): likewise.
* gtk/gtktipsquery.c (gtk_tips_query_destroy): plug small memory
leaks.
* gtk/gtkdrawingarea.c (gtk_drawing_area_send_configure): set send_event
to TRUE when synthesizing events.
[ *** end of merges from 1.2 *** ]
1999-11-22 21:52:50 +00:00
|
|
|
/* reset the row end pointer if we're removing at the end of the list */
|
1998-11-04 01:28:07 +00:00
|
|
|
clist->rows--;
|
1999-01-21 03:46:32 +00:00
|
|
|
if (clist->row_list == list)
|
|
|
|
clist->row_list = g_list_next (list);
|
|
|
|
if (clist->row_list_end == list)
|
|
|
|
clist->row_list_end = g_list_previous (list);
|
|
|
|
g_list_remove (list, clist_row);
|
1998-11-04 01:28:07 +00:00
|
|
|
|
|
|
|
/*if (clist->focus_row >=0 &&
|
|
|
|
(row <= clist->focus_row || clist->focus_row >= clist->rows))
|
|
|
|
clist->focus_row--;*/
|
1998-10-19 22:46:38 +00:00
|
|
|
|
|
|
|
if (row < ROW_FROM_YPIXEL (clist, 0))
|
|
|
|
clist->voffset += clist->row_height + CELL_SPACING;
|
|
|
|
|
|
|
|
sync_selection (clist, row, SYNC_REMOVE);
|
|
|
|
|
1999-02-10 23:15:26 +00:00
|
|
|
if (clist->selection_mode == GTK_SELECTION_BROWSE && !clist->selection &&
|
|
|
|
clist->focus_row >= 0)
|
1998-11-04 01:28:07 +00:00
|
|
|
gtk_signal_emit (GTK_OBJECT (clist), clist_signals[SELECT_ROW],
|
|
|
|
clist->focus_row, -1, NULL);
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* toast the row */
|
|
|
|
row_delete (clist, clist_row);
|
|
|
|
|
|
|
|
/* redraw the row if it isn't frozen */
|
1998-11-28 01:56:09 +00:00
|
|
|
if (CLIST_UNFROZEN (clist))
|
1998-10-19 22:46:38 +00:00
|
|
|
{
|
1998-11-07 14:29:22 +00:00
|
|
|
adjust_adjustments (clist, FALSE);
|
1998-10-19 22:46:38 +00:00
|
|
|
|
|
|
|
if (was_visible)
|
|
|
|
draw_rows (clist, NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
real_clear (GtkCList *clist)
|
|
|
|
{
|
|
|
|
GList *list;
|
|
|
|
GList *free_list;
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
|
|
|
|
|
|
|
/* free up the selection list */
|
|
|
|
g_list_free (clist->selection);
|
|
|
|
g_list_free (clist->undo_selection);
|
|
|
|
g_list_free (clist->undo_unselection);
|
|
|
|
|
|
|
|
clist->selection = NULL;
|
|
|
|
clist->selection_end = NULL;
|
|
|
|
clist->undo_selection = NULL;
|
|
|
|
clist->undo_unselection = NULL;
|
|
|
|
clist->voffset = 0;
|
|
|
|
clist->focus_row = -1;
|
|
|
|
clist->anchor = -1;
|
|
|
|
clist->undo_anchor = -1;
|
|
|
|
clist->anchor_state = GTK_STATE_SELECTED;
|
|
|
|
clist->drag_pos = -1;
|
|
|
|
|
|
|
|
/* remove all the rows */
|
|
|
|
GTK_CLIST_SET_FLAG (clist, CLIST_AUTO_RESIZE_BLOCKED);
|
|
|
|
free_list = clist->row_list;
|
|
|
|
clist->row_list = NULL;
|
|
|
|
clist->row_list_end = NULL;
|
|
|
|
clist->rows = 0;
|
|
|
|
for (list = free_list; list; list = list->next)
|
|
|
|
row_delete (clist, GTK_CLIST_ROW (list));
|
|
|
|
g_list_free (free_list);
|
|
|
|
GTK_CLIST_UNSET_FLAG (clist, CLIST_AUTO_RESIZE_BLOCKED);
|
|
|
|
for (i = 0; i < clist->columns; i++)
|
1998-11-11 20:46:51 +00:00
|
|
|
if (clist->column[i].auto_resize)
|
|
|
|
{
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (GTK_CLIST_SHOW_TITLES(clist) && clist->column[i].button)
|
1998-11-11 20:46:51 +00:00
|
|
|
gtk_clist_set_column_width
|
|
|
|
(clist, i, (clist->column[i].button->requisition.width -
|
|
|
|
(CELL_SPACING + (2 * COLUMN_INSET))));
|
|
|
|
else
|
|
|
|
gtk_clist_set_column_width (clist, i, 0);
|
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
/* zero-out the scrollbars */
|
1998-11-05 15:44:22 +00:00
|
|
|
if (clist->vadjustment)
|
1998-10-19 22:46:38 +00:00
|
|
|
{
|
1998-11-05 15:44:22 +00:00
|
|
|
gtk_adjustment_set_value (clist->vadjustment, 0.0);
|
1998-11-28 01:56:09 +00:00
|
|
|
CLIST_REFRESH (clist);
|
1998-06-02 02:51:46 +00:00
|
|
|
}
|
1998-11-07 14:29:22 +00:00
|
|
|
else
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (clist));
|
1998-06-02 02:51:46 +00:00
|
|
|
}
|
|
|
|
|
1998-12-02 00:52:14 +00:00
|
|
|
static void
|
|
|
|
real_row_move (GtkCList *clist,
|
|
|
|
gint source_row,
|
|
|
|
gint dest_row)
|
|
|
|
{
|
|
|
|
GtkCListRow *clist_row;
|
|
|
|
GList *list;
|
|
|
|
gint first, last;
|
|
|
|
gint d;
|
|
|
|
|
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (GTK_CLIST_AUTO_SORT(clist))
|
1998-12-02 00:52:14 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
if (source_row < 0 || source_row >= clist->rows ||
|
|
|
|
dest_row < 0 || dest_row >= clist->rows ||
|
|
|
|
source_row == dest_row)
|
|
|
|
return;
|
|
|
|
|
|
|
|
gtk_clist_freeze (clist);
|
|
|
|
|
|
|
|
/* unlink source row */
|
|
|
|
clist_row = g_list_nth_data (clist->row_list, source_row);
|
|
|
|
if (source_row == clist->rows - 1)
|
|
|
|
clist->row_list_end = clist->row_list_end->prev;
|
|
|
|
clist->row_list = g_list_remove (clist->row_list, clist_row);
|
|
|
|
clist->rows--;
|
|
|
|
|
|
|
|
/* relink source row */
|
|
|
|
clist->row_list = g_list_insert (clist->row_list, clist_row, dest_row);
|
|
|
|
if (dest_row == clist->rows)
|
|
|
|
clist->row_list_end = clist->row_list_end->next;
|
|
|
|
clist->rows++;
|
|
|
|
|
|
|
|
/* sync selection */
|
|
|
|
if (source_row > dest_row)
|
|
|
|
{
|
|
|
|
first = dest_row;
|
|
|
|
last = source_row;
|
|
|
|
d = 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
first = source_row;
|
|
|
|
last = dest_row;
|
|
|
|
d = -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (list = clist->selection; list; list = list->next)
|
|
|
|
{
|
|
|
|
if (list->data == GINT_TO_POINTER (source_row))
|
|
|
|
list->data = GINT_TO_POINTER (dest_row);
|
|
|
|
else if (first <= GPOINTER_TO_INT (list->data) &&
|
|
|
|
last >= GPOINTER_TO_INT (list->data))
|
1998-12-11 05:52:42 +00:00
|
|
|
list->data = GINT_TO_POINTER (GPOINTER_TO_INT (list->data) + d);
|
1998-12-02 00:52:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (clist->focus_row == source_row)
|
|
|
|
clist->focus_row = dest_row;
|
|
|
|
else if (clist->focus_row > first)
|
|
|
|
clist->focus_row += d;
|
|
|
|
|
|
|
|
gtk_clist_thaw (clist);
|
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* PUBLIC ROW FUNCTIONS
|
Tue Mar 16 17:43:33 1999 Tim Janik <timj@gtk.org>
Wed Mar 17 01:46:28 1999 Tim Janik <timj@gtk.org>
* merges from gtk-1-2:
Tue Mar 16 17:43:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_string): ensure the
item factory class has been created.
(gtk_item_factory_parse_rc): likewise.
* gtk/gtkmenu.c:
keep proper references for old_active_menu_item.
(gtk_menu_reparent): unset the usize of the new parent,
so the menu can sanely be size requested and we don't get nasty screen
artefacts upon next reparentation.
(gtk_menu_motion_notify): set send_event to TRUE if we synthesize an
enter notify. only synthesize enter notifies if the pointer really is
inside the event window.
(gtk_menu_popdown): use gtk_menu_shell_deselect().
(gtk_menu_popup): move the background setting stuff into
gtk_menu_tearoff_bg_copy() so it can be called from other places as well.
* gtk/gtkmenushell.c (gtk_menu_shell_button_press): use
gtk_menu_shell_select_item() to select the new item.
(gtk_menu_shell_deselect): export this function, so gtkmenu.c can
do the right thing for deselection as well.
Sat Mar 15 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.[hc]:
(gtk_widget_accelerators_locked): return whether a widget's accelerators
are locked.
* gtk/gtkmenu.c (gtk_menu_key_press): don't remove or install new or
existing accelerators if the widget's accelerators are locked.
Sat Mar 14 19:44:05 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.[hc]: allow managing of foreign menu items.
* gtk/gtkmenu.c: truely forward key press and key release events to
the menu widget from the toplevel or tearoff window. we can't simply
connect to that, we need to stop further processing of the events as
well.
Sat Mar 13 13:14:17 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.c:
(gtk_menu_key_press): pass event->keyval, event->state to
gtk_accelerator_valid, instead of event->keyval twice.
refuse to install single letter accelerators for menus that use
single letter shortcuts.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): use
gtk_menu_ensure_uline_accel_group().
* gtk/gtkmenu.[hc]: added gtk_menu_ensure_uline_accel_group()
which will always return an uline accel group, made
gtk_menu_get_uline_accel_group() return NULL if the group isn't
yet created.
Mon Mar 15 01:03:27 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h (struct _GtkCListColumn): added button_passive flag.
* gtk/gtkclist.c (gtk_clist_column_title_passive):
Leave button sensitive, trap button_press, button_release,
motion_notify, enter_notify and leave_notify events instead.
(gtk_clist_column_title_active): disconnect event handler.
(gtk_clist_drag_data_get): fixed memory leak. Reported by
Guillaume Laurent <glaurent@worldnet.fr>
Wed Mar 10 23:49:55 1999 Lars Hamann <lars@gtk.org>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): fixed a few
width/height mixups.
* gtk/gtkctree.c (tree_delete): emit an tree_unselect_row signal
if needed.
Wed Mar 10 00:11:32 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c (create_item_factory): unref the item factory after
window's destruction.
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): keep a reference
count on the menu shell around the menu item's activation, since the
signal emission may cause menu shell destruction.
* gtk/gtkitemfactory.c:
the previous code leaked one accel group per menu. we use
gtk_menu_get_uline_accel_group() now to fix that, and with that
also create the underline accelerator group of the menus only if
required (i.e. an underline accelerator has been specified).
(gtk_item_factory_construct):
(gtk_item_factory_create_item): removed code that would create an
extra accel group for the menu (and leak references).
(gtk_item_factory_create_item): adapted the underline accelerator
installation code to properly feature gtk_menu_get_uline_accel_group().
* gtk/gtkmenu.[hc]: added gtk_menu_get_accel_group() to retrive
menu->accel_group, this may return NULL if the accelerator group
hasn't been set yet.
added gtk_menu_get_uline_accel_group() to retrive the underline
accelerator group of the menu, this will be created on demand
and proper care is taken about its reference count.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c:
dumped the approach of keeping a widgets by action list on the
factory since the factory<->widget destroy negotiation didn't work
and would be hard to get going at all. instead we keep a list of
GtkItemFactoryItem items on the factory (GtkItemFactoryItems are
persistant throughout a program's life time).
also, i removed the static const gchar *key_* variables, and made
them inline strings (they weren't actually used anyways).
(gtk_item_factory_add_item): update ifactory->items.
(gtk_item_factory_destroy): destroy ifactory->items (and remove
the item factory pointer from the remaining ifactory widgets).
(gtk_item_factory_get_widget_by_action): walk the GtkItemFactoryItem
list to find the widget.
(gtk_item_factory_get_item): new function that works around
gtk_item_factory_get_widget() limitations, this function will only
return menu items, even for <Branch> entries.
Tue Mar 9 01:01:28 1999 Tim Janik <timj@gtk.org>
* gdk/gdkfont.c (gdk_font_load): first lookup the xfont ID in our
font hash table, if we have a GdkFontPrivate entry for this font
already, simply increment its reference count, provided by Olaf Dietsche
<olaf.dietsche+list.gtk@netcologne.de>.
* gtk/gtkstyle.c (gtk_style_copy): plug a GdkFont reference leak, fix
provided by Olaf Dietsche <olaf.dietsche+list.gtk@netcologne.de>.
Sun Mar 7 06:13:29 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c:
(gtk_container_add_with_args):
(gtk_container_addv):
(gtk_container_add): before adding a child to a conatiner, make sure
it is (default) constructed, this is neccessary because under certain
circumstances the child will get relized and mapped immediatedly, in
which case it has to be constructed already.
Mon Mar 1 17:58:21 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_connect_by_type): count object_signal
values > 1 as TRUE also.
1999-03-17 01:39:42 +00:00
|
|
|
* gtk_clist_moveto
|
|
|
|
* gtk_clist_set_row_height
|
1998-10-19 22:46:38 +00:00
|
|
|
* gtk_clist_set_row_data
|
|
|
|
* gtk_clist_set_row_data_full
|
|
|
|
* gtk_clist_get_row_data
|
|
|
|
* gtk_clist_find_row_from_data
|
|
|
|
* gtk_clist_swap_rows
|
1998-12-02 00:52:14 +00:00
|
|
|
* gtk_clist_row_move
|
1998-10-19 22:46:38 +00:00
|
|
|
* gtk_clist_row_is_visible
|
|
|
|
* gtk_clist_set_foreground
|
|
|
|
* gtk_clist_set_background
|
|
|
|
*/
|
Tue Mar 16 17:43:33 1999 Tim Janik <timj@gtk.org>
Wed Mar 17 01:46:28 1999 Tim Janik <timj@gtk.org>
* merges from gtk-1-2:
Tue Mar 16 17:43:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_string): ensure the
item factory class has been created.
(gtk_item_factory_parse_rc): likewise.
* gtk/gtkmenu.c:
keep proper references for old_active_menu_item.
(gtk_menu_reparent): unset the usize of the new parent,
so the menu can sanely be size requested and we don't get nasty screen
artefacts upon next reparentation.
(gtk_menu_motion_notify): set send_event to TRUE if we synthesize an
enter notify. only synthesize enter notifies if the pointer really is
inside the event window.
(gtk_menu_popdown): use gtk_menu_shell_deselect().
(gtk_menu_popup): move the background setting stuff into
gtk_menu_tearoff_bg_copy() so it can be called from other places as well.
* gtk/gtkmenushell.c (gtk_menu_shell_button_press): use
gtk_menu_shell_select_item() to select the new item.
(gtk_menu_shell_deselect): export this function, so gtkmenu.c can
do the right thing for deselection as well.
Sat Mar 15 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.[hc]:
(gtk_widget_accelerators_locked): return whether a widget's accelerators
are locked.
* gtk/gtkmenu.c (gtk_menu_key_press): don't remove or install new or
existing accelerators if the widget's accelerators are locked.
Sat Mar 14 19:44:05 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.[hc]: allow managing of foreign menu items.
* gtk/gtkmenu.c: truely forward key press and key release events to
the menu widget from the toplevel or tearoff window. we can't simply
connect to that, we need to stop further processing of the events as
well.
Sat Mar 13 13:14:17 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.c:
(gtk_menu_key_press): pass event->keyval, event->state to
gtk_accelerator_valid, instead of event->keyval twice.
refuse to install single letter accelerators for menus that use
single letter shortcuts.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): use
gtk_menu_ensure_uline_accel_group().
* gtk/gtkmenu.[hc]: added gtk_menu_ensure_uline_accel_group()
which will always return an uline accel group, made
gtk_menu_get_uline_accel_group() return NULL if the group isn't
yet created.
Mon Mar 15 01:03:27 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h (struct _GtkCListColumn): added button_passive flag.
* gtk/gtkclist.c (gtk_clist_column_title_passive):
Leave button sensitive, trap button_press, button_release,
motion_notify, enter_notify and leave_notify events instead.
(gtk_clist_column_title_active): disconnect event handler.
(gtk_clist_drag_data_get): fixed memory leak. Reported by
Guillaume Laurent <glaurent@worldnet.fr>
Wed Mar 10 23:49:55 1999 Lars Hamann <lars@gtk.org>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): fixed a few
width/height mixups.
* gtk/gtkctree.c (tree_delete): emit an tree_unselect_row signal
if needed.
Wed Mar 10 00:11:32 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c (create_item_factory): unref the item factory after
window's destruction.
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): keep a reference
count on the menu shell around the menu item's activation, since the
signal emission may cause menu shell destruction.
* gtk/gtkitemfactory.c:
the previous code leaked one accel group per menu. we use
gtk_menu_get_uline_accel_group() now to fix that, and with that
also create the underline accelerator group of the menus only if
required (i.e. an underline accelerator has been specified).
(gtk_item_factory_construct):
(gtk_item_factory_create_item): removed code that would create an
extra accel group for the menu (and leak references).
(gtk_item_factory_create_item): adapted the underline accelerator
installation code to properly feature gtk_menu_get_uline_accel_group().
* gtk/gtkmenu.[hc]: added gtk_menu_get_accel_group() to retrive
menu->accel_group, this may return NULL if the accelerator group
hasn't been set yet.
added gtk_menu_get_uline_accel_group() to retrive the underline
accelerator group of the menu, this will be created on demand
and proper care is taken about its reference count.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c:
dumped the approach of keeping a widgets by action list on the
factory since the factory<->widget destroy negotiation didn't work
and would be hard to get going at all. instead we keep a list of
GtkItemFactoryItem items on the factory (GtkItemFactoryItems are
persistant throughout a program's life time).
also, i removed the static const gchar *key_* variables, and made
them inline strings (they weren't actually used anyways).
(gtk_item_factory_add_item): update ifactory->items.
(gtk_item_factory_destroy): destroy ifactory->items (and remove
the item factory pointer from the remaining ifactory widgets).
(gtk_item_factory_get_widget_by_action): walk the GtkItemFactoryItem
list to find the widget.
(gtk_item_factory_get_item): new function that works around
gtk_item_factory_get_widget() limitations, this function will only
return menu items, even for <Branch> entries.
Tue Mar 9 01:01:28 1999 Tim Janik <timj@gtk.org>
* gdk/gdkfont.c (gdk_font_load): first lookup the xfont ID in our
font hash table, if we have a GdkFontPrivate entry for this font
already, simply increment its reference count, provided by Olaf Dietsche
<olaf.dietsche+list.gtk@netcologne.de>.
* gtk/gtkstyle.c (gtk_style_copy): plug a GdkFont reference leak, fix
provided by Olaf Dietsche <olaf.dietsche+list.gtk@netcologne.de>.
Sun Mar 7 06:13:29 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c:
(gtk_container_add_with_args):
(gtk_container_addv):
(gtk_container_add): before adding a child to a conatiner, make sure
it is (default) constructed, this is neccessary because under certain
circumstances the child will get relized and mapped immediatedly, in
which case it has to be constructed already.
Mon Mar 1 17:58:21 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_connect_by_type): count object_signal
values > 1 as TRUE also.
1999-03-17 01:39:42 +00:00
|
|
|
void
|
|
|
|
gtk_clist_moveto (GtkCList *clist,
|
|
|
|
gint row,
|
|
|
|
gint column,
|
|
|
|
gfloat row_align,
|
|
|
|
gfloat col_align)
|
|
|
|
{
|
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
|
|
|
|
|
|
|
if (row < -1 || row >= clist->rows)
|
|
|
|
return;
|
|
|
|
if (column < -1 || column >= clist->columns)
|
|
|
|
return;
|
|
|
|
|
|
|
|
row_align = CLAMP (row_align, 0, 1);
|
|
|
|
col_align = CLAMP (col_align, 0, 1);
|
|
|
|
|
|
|
|
/* adjust horizontal scrollbar */
|
|
|
|
if (clist->hadjustment && column >= 0)
|
|
|
|
{
|
|
|
|
gint x;
|
|
|
|
|
|
|
|
x = (COLUMN_LEFT (clist, column) - CELL_SPACING - COLUMN_INSET -
|
|
|
|
(col_align * (clist->clist_window_width - 2 * COLUMN_INSET -
|
|
|
|
CELL_SPACING - clist->column[column].area.width)));
|
|
|
|
if (x < 0)
|
|
|
|
gtk_adjustment_set_value (clist->hadjustment, 0.0);
|
|
|
|
else if (x > LIST_WIDTH (clist) - clist->clist_window_width)
|
|
|
|
gtk_adjustment_set_value
|
|
|
|
(clist->hadjustment, LIST_WIDTH (clist) - clist->clist_window_width);
|
|
|
|
else
|
|
|
|
gtk_adjustment_set_value (clist->hadjustment, x);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* adjust vertical scrollbar */
|
|
|
|
if (clist->vadjustment && row >= 0)
|
|
|
|
move_vertical (clist, row, row_align);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_clist_set_row_height (GtkCList *clist,
|
|
|
|
guint height)
|
|
|
|
{
|
|
|
|
GtkWidget *widget;
|
|
|
|
|
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
|
|
|
|
|
|
|
widget = GTK_WIDGET (clist);
|
|
|
|
|
|
|
|
if (height > 0)
|
|
|
|
{
|
|
|
|
clist->row_height = height;
|
|
|
|
GTK_CLIST_SET_FLAG (clist, CLIST_ROW_HEIGHT_SET);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
GTK_CLIST_UNSET_FLAG (clist, CLIST_ROW_HEIGHT_SET);
|
|
|
|
clist->row_height = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (GTK_WIDGET_REALIZED (clist))
|
|
|
|
{
|
|
|
|
if (!GTK_CLIST_ROW_HEIGHT_SET(clist))
|
|
|
|
{
|
|
|
|
clist->row_height = (widget->style->font->ascent +
|
|
|
|
widget->style->font->descent + 1);
|
|
|
|
clist->row_center_offset = widget->style->font->ascent + 1.5;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
clist->row_center_offset = 1.5 + (clist->row_height +
|
|
|
|
widget->style->font->ascent -
|
|
|
|
widget->style->font->descent - 1) / 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
CLIST_REFRESH (clist);
|
|
|
|
}
|
|
|
|
|
1998-01-03 03:31:03 +00:00
|
|
|
void
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_clist_set_row_data (GtkCList *clist,
|
|
|
|
gint row,
|
|
|
|
gpointer data)
|
1998-03-08 03:32:05 +00:00
|
|
|
{
|
|
|
|
gtk_clist_set_row_data_full (clist, row, data, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_clist_set_row_data_full (GtkCList *clist,
|
|
|
|
gint row,
|
|
|
|
gpointer data,
|
|
|
|
GtkDestroyNotify destroy)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
|
|
|
GtkCListRow *clist_row;
|
|
|
|
|
|
|
|
g_return_if_fail (clist != NULL);
|
1998-07-15 23:40:00 +00:00
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-01-03 03:31:03 +00:00
|
|
|
|
|
|
|
if (row < 0 || row > (clist->rows - 1))
|
|
|
|
return;
|
|
|
|
|
|
|
|
clist_row = (g_list_nth (clist->row_list, row))->data;
|
|
|
|
clist_row->data = data;
|
1998-03-08 03:32:05 +00:00
|
|
|
clist_row->destroy = destroy;
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
gpointer
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_clist_get_row_data (GtkCList *clist,
|
|
|
|
gint row)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
|
|
|
GtkCListRow *clist_row;
|
|
|
|
|
|
|
|
g_return_val_if_fail (clist != NULL, NULL);
|
1998-07-15 23:40:00 +00:00
|
|
|
g_return_val_if_fail (GTK_IS_CLIST (clist), NULL);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
|
|
|
if (row < 0 || row > (clist->rows - 1))
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
clist_row = (g_list_nth (clist->row_list, row))->data;
|
|
|
|
return clist_row->data;
|
|
|
|
}
|
|
|
|
|
1998-02-08 07:55:11 +00:00
|
|
|
gint
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_clist_find_row_from_data (GtkCList *clist,
|
|
|
|
gpointer data)
|
1998-02-08 07:55:11 +00:00
|
|
|
{
|
|
|
|
GList *list;
|
|
|
|
gint n;
|
|
|
|
|
|
|
|
g_return_val_if_fail (clist != NULL, -1);
|
|
|
|
g_return_val_if_fail (GTK_IS_CLIST (clist), -1);
|
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
for (n = 0, list = clist->row_list; list; n++, list = list->next)
|
|
|
|
if (GTK_CLIST_ROW (list)->data == data)
|
|
|
|
return n;
|
1998-02-08 07:55:11 +00:00
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
void
|
|
|
|
gtk_clist_swap_rows (GtkCList *clist,
|
|
|
|
gint row1,
|
|
|
|
gint row2)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
gint first, last;
|
1998-12-02 00:52:14 +00:00
|
|
|
|
1998-01-03 03:31:03 +00:00
|
|
|
g_return_if_fail (clist != NULL);
|
1998-07-15 23:40:00 +00:00
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-11-24 04:25:38 +00:00
|
|
|
g_return_if_fail (row1 != row2);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (GTK_CLIST_AUTO_SORT(clist))
|
1998-01-03 03:31:03 +00:00
|
|
|
return;
|
|
|
|
|
1998-12-02 00:52:14 +00:00
|
|
|
gtk_clist_freeze (clist);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
first = MIN (row1, row2);
|
1998-12-02 00:52:14 +00:00
|
|
|
last = MAX (row1, row2);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-12-02 00:52:14 +00:00
|
|
|
gtk_clist_row_move (clist, last, first);
|
|
|
|
gtk_clist_row_move (clist, first + 1, last);
|
1998-10-19 22:46:38 +00:00
|
|
|
|
1998-12-02 00:52:14 +00:00
|
|
|
gtk_clist_thaw (clist);
|
|
|
|
}
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-12-02 00:52:14 +00:00
|
|
|
void
|
|
|
|
gtk_clist_row_move (GtkCList *clist,
|
|
|
|
gint source_row,
|
|
|
|
gint dest_row)
|
|
|
|
{
|
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (GTK_CLIST_AUTO_SORT(clist))
|
1998-12-02 00:52:14 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
if (source_row < 0 || source_row >= clist->rows ||
|
|
|
|
dest_row < 0 || dest_row >= clist->rows ||
|
|
|
|
source_row == dest_row)
|
|
|
|
return;
|
|
|
|
|
|
|
|
gtk_signal_emit (GTK_OBJECT (clist), clist_signals[ROW_MOVE],
|
|
|
|
source_row, dest_row);
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
|
1998-03-14 00:07:36 +00:00
|
|
|
GtkVisibility
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_clist_row_is_visible (GtkCList *clist,
|
|
|
|
gint row)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-03-14 00:07:36 +00:00
|
|
|
gint top;
|
|
|
|
|
1998-01-03 03:31:03 +00:00
|
|
|
g_return_val_if_fail (clist != NULL, 0);
|
1998-07-15 23:40:00 +00:00
|
|
|
g_return_val_if_fail (GTK_IS_CLIST (clist), 0);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
|
|
|
if (row < 0 || row >= clist->rows)
|
1998-03-14 00:07:36 +00:00
|
|
|
return GTK_VISIBILITY_NONE;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
|
|
|
if (clist->row_height == 0)
|
1998-03-14 00:07:36 +00:00
|
|
|
return GTK_VISIBILITY_NONE;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
|
|
|
if (row < ROW_FROM_YPIXEL (clist, 0))
|
1998-03-14 00:07:36 +00:00
|
|
|
return GTK_VISIBILITY_NONE;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
|
|
|
if (row > ROW_FROM_YPIXEL (clist, clist->clist_window_height))
|
1998-03-14 00:07:36 +00:00
|
|
|
return GTK_VISIBILITY_NONE;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-03-14 00:07:36 +00:00
|
|
|
top = ROW_TOP_YPIXEL (clist, row);
|
|
|
|
|
|
|
|
if ((top < 0)
|
|
|
|
|| ((top + clist->row_height) >= clist->clist_window_height))
|
|
|
|
return GTK_VISIBILITY_PARTIAL;
|
|
|
|
|
|
|
|
return GTK_VISIBILITY_FULL;
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_clist_set_foreground (GtkCList *clist,
|
|
|
|
gint row,
|
|
|
|
GdkColor *color)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GtkCListRow *clist_row;
|
|
|
|
|
1998-01-03 03:31:03 +00:00
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (row < 0 || row >= clist->rows)
|
|
|
|
return;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist_row = (g_list_nth (clist->row_list, row))->data;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (color)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
clist_row->foreground = *color;
|
|
|
|
clist_row->fg_set = TRUE;
|
|
|
|
if (GTK_WIDGET_REALIZED (clist))
|
|
|
|
gdk_color_alloc (gtk_widget_get_colormap (GTK_WIDGET (clist)),
|
|
|
|
&clist_row->foreground);
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
else
|
|
|
|
clist_row->fg_set = FALSE;
|
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
if (CLIST_UNFROZEN (clist) && gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE)
|
1998-10-19 22:46:38 +00:00
|
|
|
GTK_CLIST_CLASS_FW (clist)->draw_row (clist, NULL, row, clist_row);
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
void
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_clist_set_background (GtkCList *clist,
|
|
|
|
gint row,
|
|
|
|
GdkColor *color)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GtkCListRow *clist_row;
|
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (row < 0 || row >= clist->rows)
|
|
|
|
return;
|
|
|
|
|
|
|
|
clist_row = (g_list_nth (clist->row_list, row))->data;
|
|
|
|
|
|
|
|
if (color)
|
|
|
|
{
|
|
|
|
clist_row->background = *color;
|
|
|
|
clist_row->bg_set = TRUE;
|
|
|
|
if (GTK_WIDGET_REALIZED (clist))
|
|
|
|
gdk_color_alloc (gtk_widget_get_colormap (GTK_WIDGET (clist)),
|
|
|
|
&clist_row->background);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
clist_row->bg_set = FALSE;
|
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
if (CLIST_UNFROZEN (clist)
|
1998-10-19 22:46:38 +00:00
|
|
|
&& (gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE))
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->draw_row (clist, NULL, row, clist_row);
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* PUBLIC ROW/CELL STYLE FUNCTIONS
|
|
|
|
* gtk_clist_set_cell_style
|
|
|
|
* gtk_clist_get_cell_style
|
|
|
|
* gtk_clist_set_row_style
|
|
|
|
* gtk_clist_get_row_style
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gtk_clist_set_cell_style (GtkCList *clist,
|
|
|
|
gint row,
|
|
|
|
gint column,
|
|
|
|
GtkStyle *style)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1999-04-30 11:48:42 +00:00
|
|
|
GtkRequisition requisition = { 0 };
|
1998-10-19 22:46:38 +00:00
|
|
|
GtkCListRow *clist_row;
|
1998-07-15 23:40:00 +00:00
|
|
|
|
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (row < 0 || row >= clist->rows)
|
|
|
|
return;
|
|
|
|
if (column < 0 || column >= clist->columns)
|
1998-07-15 23:40:00 +00:00
|
|
|
return;
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist_row = (g_list_nth (clist->row_list, row))->data;
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (clist_row->cell[column].style == style)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (clist->column[column].auto_resize &&
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
!GTK_CLIST_AUTO_RESIZE_BLOCKED(clist))
|
1998-10-19 22:46:38 +00:00
|
|
|
GTK_CLIST_CLASS_FW (clist)->cell_size_request (clist, clist_row,
|
|
|
|
column, &requisition);
|
|
|
|
|
|
|
|
if (clist_row->cell[column].style)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
if (GTK_WIDGET_REALIZED (clist))
|
|
|
|
gtk_style_detach (clist_row->cell[column].style);
|
|
|
|
gtk_style_unref (clist_row->cell[column].style);
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist_row->cell[column].style = style;
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (clist_row->cell[column].style)
|
|
|
|
{
|
|
|
|
gtk_style_ref (clist_row->cell[column].style);
|
|
|
|
|
|
|
|
if (GTK_WIDGET_REALIZED (clist))
|
|
|
|
clist_row->cell[column].style =
|
|
|
|
gtk_style_attach (clist_row->cell[column].style,
|
|
|
|
clist->clist_window);
|
|
|
|
}
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
column_auto_resize (clist, clist_row, column, requisition.width);
|
|
|
|
|
|
|
|
/* redraw the list if it's not frozen */
|
1998-11-28 01:56:09 +00:00
|
|
|
if (CLIST_UNFROZEN (clist))
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
if (gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE)
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->draw_row (clist, NULL, row, clist_row);
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
}
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
GtkStyle *
|
|
|
|
gtk_clist_get_cell_style (GtkCList *clist,
|
|
|
|
gint row,
|
|
|
|
gint column)
|
|
|
|
{
|
|
|
|
GtkCListRow *clist_row;
|
|
|
|
|
|
|
|
g_return_val_if_fail (clist != NULL, NULL);
|
|
|
|
g_return_val_if_fail (GTK_IS_CLIST (clist), NULL);
|
|
|
|
|
|
|
|
if (row < 0 || row >= clist->rows || column < 0 || column >= clist->columns)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
clist_row = (g_list_nth (clist->row_list, row))->data;
|
|
|
|
|
|
|
|
return clist_row->cell[column].style;
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
void
|
|
|
|
gtk_clist_set_row_style (GtkCList *clist,
|
|
|
|
gint row,
|
|
|
|
GtkStyle *style)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GtkRequisition requisition;
|
|
|
|
GtkCListRow *clist_row;
|
|
|
|
gint *old_width;
|
1998-01-03 03:31:03 +00:00
|
|
|
gint i;
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (row < 0 || row >= clist->rows)
|
|
|
|
return;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist_row = (g_list_nth (clist->row_list, row))->data;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (clist_row->style == style)
|
|
|
|
return;
|
1998-01-06 06:48:48 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
old_width = g_new (gint, clist->columns);
|
1998-01-31 03:33:02 +00:00
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (!GTK_CLIST_AUTO_RESIZE_BLOCKED(clist))
|
1998-01-31 03:33:02 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
for (i = 0; i < clist->columns; i++)
|
|
|
|
if (clist->column[i].auto_resize)
|
|
|
|
{
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->cell_size_request (clist, clist_row,
|
|
|
|
i, &requisition);
|
|
|
|
old_width[i] = requisition.width;
|
|
|
|
}
|
1998-01-31 03:33:02 +00:00
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
|
|
|
|
if (clist_row->style)
|
1998-01-31 03:33:02 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
if (GTK_WIDGET_REALIZED (clist))
|
|
|
|
gtk_style_detach (clist_row->style);
|
|
|
|
gtk_style_unref (clist_row->style);
|
1998-01-31 03:33:02 +00:00
|
|
|
}
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist_row->style = style;
|
|
|
|
|
|
|
|
if (clist_row->style)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_style_ref (clist_row->style);
|
|
|
|
|
|
|
|
if (GTK_WIDGET_REALIZED (clist))
|
|
|
|
clist_row->style = gtk_style_attach (clist_row->style,
|
|
|
|
clist->clist_window);
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (GTK_CLIST_AUTO_RESIZE_BLOCKED(clist))
|
1998-11-11 20:46:51 +00:00
|
|
|
for (i = 0; i < clist->columns; i++)
|
|
|
|
column_auto_resize (clist, clist_row, i, old_width[i]);
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
g_free (old_width);
|
1998-01-31 03:33:02 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* redraw the list if it's not frozen */
|
1998-11-28 01:56:09 +00:00
|
|
|
if (CLIST_UNFROZEN (clist))
|
1998-10-19 22:46:38 +00:00
|
|
|
{
|
|
|
|
if (gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE)
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->draw_row (clist, NULL, row, clist_row);
|
|
|
|
}
|
1998-01-31 03:33:02 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
GtkStyle *
|
|
|
|
gtk_clist_get_row_style (GtkCList *clist,
|
|
|
|
gint row)
|
1998-01-31 03:33:02 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GtkCListRow *clist_row;
|
1998-01-31 03:33:02 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_val_if_fail (clist != NULL, NULL);
|
|
|
|
g_return_val_if_fail (GTK_IS_CLIST (clist), NULL);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (row < 0 || row >= clist->rows)
|
|
|
|
return NULL;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist_row = (g_list_nth (clist->row_list, row))->data;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
return clist_row->style;
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* PUBLIC SELECTION FUNCTIONS
|
|
|
|
* gtk_clist_set_selectable
|
|
|
|
* gtk_clist_get_selectable
|
|
|
|
* gtk_clist_select_row
|
|
|
|
* gtk_clist_unselect_row
|
|
|
|
* gtk_clist_select_all
|
|
|
|
* gtk_clist_unselect_all
|
|
|
|
* gtk_clist_undo_selection
|
1998-01-24 19:14:42 +00:00
|
|
|
*/
|
1998-10-19 22:46:38 +00:00
|
|
|
void
|
|
|
|
gtk_clist_set_selectable (GtkCList *clist,
|
|
|
|
gint row,
|
|
|
|
gboolean selectable)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-10-16 15:00:05 +00:00
|
|
|
GtkCListRow *clist_row;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (row < 0 || row >= clist->rows)
|
|
|
|
return;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist_row = (g_list_nth (clist->row_list, row))->data;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (selectable == clist_row->selectable)
|
|
|
|
return;
|
1998-04-05 23:30:26 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist_row->selectable = selectable;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (!selectable && clist_row->state == GTK_STATE_SELECTED)
|
|
|
|
{
|
|
|
|
if (clist->anchor >= 0 &&
|
|
|
|
clist->selection_mode == GTK_SELECTION_EXTENDED)
|
|
|
|
{
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
clist->drag_button = 0;
|
|
|
|
remove_grab (clist);
|
1998-10-19 22:46:38 +00:00
|
|
|
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
|
|
|
|
}
|
|
|
|
gtk_signal_emit (GTK_OBJECT (clist), clist_signals[UNSELECT_ROW],
|
|
|
|
row, -1, NULL);
|
|
|
|
}
|
|
|
|
}
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
gboolean
|
|
|
|
gtk_clist_get_selectable (GtkCList *clist,
|
|
|
|
gint row)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (clist != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_CLIST (clist), FALSE);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (row < 0 || row >= clist->rows)
|
|
|
|
return FALSE;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
return GTK_CLIST_ROW (g_list_nth (clist->row_list, row))->selectable;
|
|
|
|
}
|
1998-04-03 23:17:16 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
void
|
|
|
|
gtk_clist_select_row (GtkCList *clist,
|
|
|
|
gint row,
|
|
|
|
gint column)
|
|
|
|
{
|
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (row < 0 || row >= clist->rows)
|
|
|
|
return;
|
|
|
|
if (column < -1 || column >= clist->columns)
|
|
|
|
return;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_signal_emit (GTK_OBJECT (clist), clist_signals[SELECT_ROW],
|
|
|
|
row, column, NULL);
|
|
|
|
}
|
1998-01-18 15:09:10 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
void
|
|
|
|
gtk_clist_unselect_row (GtkCList *clist,
|
|
|
|
gint row,
|
|
|
|
gint column)
|
|
|
|
{
|
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (row < 0 || row >= clist->rows)
|
|
|
|
return;
|
|
|
|
if (column < -1 || column >= clist->columns)
|
|
|
|
return;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_signal_emit (GTK_OBJECT (clist), clist_signals[UNSELECT_ROW],
|
|
|
|
row, column, NULL);
|
|
|
|
}
|
1998-10-16 15:00:05 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
void
|
|
|
|
gtk_clist_select_all (GtkCList *clist)
|
|
|
|
{
|
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-10-07 22:13:19 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
GTK_CLIST_CLASS_FW (clist)->select_all (clist);
|
|
|
|
}
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
void
|
|
|
|
gtk_clist_unselect_all (GtkCList *clist)
|
|
|
|
{
|
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-04-03 23:17:16 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
GTK_CLIST_CLASS_FW (clist)->unselect_all (clist);
|
|
|
|
}
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
void
|
|
|
|
gtk_clist_undo_selection (GtkCList *clist)
|
|
|
|
{
|
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-10-16 15:00:05 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (clist->selection_mode == GTK_SELECTION_EXTENDED &&
|
|
|
|
(clist->undo_selection || clist->undo_unselection))
|
|
|
|
gtk_signal_emit (GTK_OBJECT (clist), clist_signals[UNDO_SELECTION]);
|
|
|
|
}
|
1998-10-16 15:00:05 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* PRIVATE SELECTION FUNCTIONS
|
|
|
|
* selection_find
|
|
|
|
* toggle_row
|
|
|
|
* fake_toggle_row
|
|
|
|
* toggle_focus_row
|
|
|
|
* toggle_add_mode
|
|
|
|
* real_select_row
|
|
|
|
* real_unselect_row
|
|
|
|
* real_select_all
|
|
|
|
* real_unselect_all
|
|
|
|
* fake_unselect_all
|
|
|
|
* real_undo_selection
|
|
|
|
* set_anchor
|
|
|
|
* resync_selection
|
|
|
|
* update_extended_selection
|
|
|
|
* start_selection
|
|
|
|
* end_selection
|
|
|
|
* extend_selection
|
|
|
|
* sync_selection
|
|
|
|
*/
|
|
|
|
static GList *
|
|
|
|
selection_find (GtkCList *clist,
|
|
|
|
gint row_number,
|
|
|
|
GList *row_list_element)
|
|
|
|
{
|
|
|
|
return g_list_find (clist->selection, GINT_TO_POINTER (row_number));
|
|
|
|
}
|
1998-10-16 15:00:05 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
static void
|
|
|
|
toggle_row (GtkCList *clist,
|
|
|
|
gint row,
|
|
|
|
gint column,
|
|
|
|
GdkEvent *event)
|
|
|
|
{
|
|
|
|
GtkCListRow *clist_row;
|
1998-10-16 15:00:05 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
switch (clist->selection_mode)
|
|
|
|
{
|
|
|
|
case GTK_SELECTION_EXTENDED:
|
|
|
|
case GTK_SELECTION_MULTIPLE:
|
|
|
|
case GTK_SELECTION_SINGLE:
|
|
|
|
clist_row = g_list_nth (clist->row_list, row)->data;
|
1998-12-04 01:11:46 +00:00
|
|
|
|
|
|
|
if (!clist_row)
|
|
|
|
return;
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (clist_row->state == GTK_STATE_SELECTED)
|
|
|
|
{
|
|
|
|
gtk_signal_emit (GTK_OBJECT (clist), clist_signals[UNSELECT_ROW],
|
|
|
|
row, column, event);
|
|
|
|
return;
|
1998-10-16 15:00:05 +00:00
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
case GTK_SELECTION_BROWSE:
|
|
|
|
gtk_signal_emit (GTK_OBJECT (clist), clist_signals[SELECT_ROW],
|
|
|
|
row, column, event);
|
|
|
|
break;
|
1998-10-16 15:00:05 +00:00
|
|
|
}
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1998-10-19 22:46:38 +00:00
|
|
|
fake_toggle_row (GtkCList *clist,
|
|
|
|
gint row)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GList *work;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-12-04 01:11:46 +00:00
|
|
|
work = g_list_nth (clist->row_list, row);
|
|
|
|
|
|
|
|
if (!work || !GTK_CLIST_ROW (work)->selectable)
|
1998-10-19 22:46:38 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
if (GTK_CLIST_ROW (work)->state == GTK_STATE_NORMAL)
|
|
|
|
clist->anchor_state = GTK_CLIST_ROW (work)->state = GTK_STATE_SELECTED;
|
|
|
|
else
|
|
|
|
clist->anchor_state = GTK_CLIST_ROW (work)->state = GTK_STATE_NORMAL;
|
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
if (CLIST_UNFROZEN (clist) &&
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE)
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->draw_row (clist, NULL, row,
|
|
|
|
GTK_CLIST_ROW (work));
|
|
|
|
}
|
1998-02-12 03:02:14 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
static void
|
|
|
|
toggle_focus_row (GtkCList *clist)
|
|
|
|
{
|
|
|
|
g_return_if_fail (clist != 0);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if ((gdk_pointer_is_grabbed () && GTK_WIDGET_HAS_GRAB (clist)) ||
|
|
|
|
clist->focus_row < 0 || clist->focus_row >= clist->rows)
|
|
|
|
return;
|
1998-10-16 15:00:05 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
switch (clist->selection_mode)
|
1998-10-16 15:00:05 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
case GTK_SELECTION_SINGLE:
|
|
|
|
case GTK_SELECTION_MULTIPLE:
|
|
|
|
toggle_row (clist, clist->focus_row, 0, NULL);
|
|
|
|
break;
|
|
|
|
case GTK_SELECTION_EXTENDED:
|
|
|
|
g_list_free (clist->undo_selection);
|
|
|
|
g_list_free (clist->undo_unselection);
|
|
|
|
clist->undo_selection = NULL;
|
|
|
|
clist->undo_unselection = NULL;
|
1998-10-16 15:00:05 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist->anchor = clist->focus_row;
|
|
|
|
clist->drag_pos = clist->focus_row;
|
|
|
|
clist->undo_anchor = clist->focus_row;
|
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (GTK_CLIST_ADD_MODE(clist))
|
1998-10-19 22:46:38 +00:00
|
|
|
fake_toggle_row (clist, clist->focus_row);
|
|
|
|
else
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->fake_unselect_all (clist,clist->focus_row);
|
1998-10-16 15:00:05 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
1998-10-16 15:00:05 +00:00
|
|
|
}
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1998-10-19 22:46:38 +00:00
|
|
|
toggle_add_mode (GtkCList *clist)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_if_fail (clist != 0);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
|
|
|
|
|
|
|
if ((gdk_pointer_is_grabbed () && GTK_WIDGET_HAS_GRAB (clist)) ||
|
|
|
|
clist->selection_mode != GTK_SELECTION_EXTENDED)
|
|
|
|
return;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_clist_draw_focus (GTK_WIDGET (clist));
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (!GTK_CLIST_ADD_MODE(clist))
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GTK_CLIST_SET_FLAG (clist, CLIST_ADD_MODE);
|
|
|
|
gdk_gc_set_line_attributes (clist->xor_gc, 1,
|
|
|
|
GDK_LINE_ON_OFF_DASH, 0, 0);
|
|
|
|
gdk_gc_set_dashes (clist->xor_gc, 0, "\4\4", 2);
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
GTK_CLIST_UNSET_FLAG (clist, CLIST_ADD_MODE);
|
|
|
|
gdk_gc_set_line_attributes (clist->xor_gc, 1, GDK_LINE_SOLID, 0, 0);
|
|
|
|
clist->anchor_state = GTK_STATE_SELECTED;
|
|
|
|
}
|
|
|
|
gtk_clist_draw_focus (GTK_WIDGET (clist));
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1998-10-19 22:46:38 +00:00
|
|
|
real_select_row (GtkCList *clist,
|
|
|
|
gint row,
|
|
|
|
gint column,
|
|
|
|
GdkEvent *event)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GtkCListRow *clist_row;
|
|
|
|
GList *list;
|
|
|
|
gint sel_row;
|
|
|
|
gboolean row_selected;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (row < 0 || row > (clist->rows - 1))
|
|
|
|
return;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
switch (clist->selection_mode)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
case GTK_SELECTION_SINGLE:
|
|
|
|
case GTK_SELECTION_BROWSE:
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
row_selected = FALSE;
|
|
|
|
list = clist->selection;
|
1998-01-19 09:59:20 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
while (list)
|
|
|
|
{
|
|
|
|
sel_row = GPOINTER_TO_INT (list->data);
|
|
|
|
list = list->next;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (row == sel_row)
|
|
|
|
row_selected = TRUE;
|
|
|
|
else
|
|
|
|
gtk_signal_emit (GTK_OBJECT (clist), clist_signals[UNSELECT_ROW],
|
|
|
|
sel_row, column, event);
|
|
|
|
}
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (row_selected)
|
|
|
|
return;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist_row = (g_list_nth (clist->row_list, row))->data;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (clist_row->state != GTK_STATE_NORMAL || !clist_row->selectable)
|
|
|
|
return;
|
|
|
|
|
|
|
|
clist_row->state = GTK_STATE_SELECTED;
|
|
|
|
if (!clist->selection)
|
|
|
|
{
|
|
|
|
clist->selection = g_list_append (clist->selection,
|
|
|
|
GINT_TO_POINTER (row));
|
|
|
|
clist->selection_end = clist->selection;
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
else
|
|
|
|
clist->selection_end =
|
|
|
|
g_list_append (clist->selection_end, GINT_TO_POINTER (row))->next;
|
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
if (CLIST_UNFROZEN (clist)
|
1998-10-19 22:46:38 +00:00
|
|
|
&& (gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE))
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->draw_row (clist, NULL, row, clist_row);
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1998-10-19 22:46:38 +00:00
|
|
|
real_unselect_row (GtkCList *clist,
|
|
|
|
gint row,
|
|
|
|
gint column,
|
|
|
|
GdkEvent *event)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GtkCListRow *clist_row;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (row < 0 || row > (clist->rows - 1))
|
|
|
|
return;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist_row = (g_list_nth (clist->row_list, row))->data;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (clist_row->state == GTK_STATE_SELECTED)
|
|
|
|
{
|
|
|
|
clist_row->state = GTK_STATE_NORMAL;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (clist->selection_end &&
|
|
|
|
clist->selection_end->data == GINT_TO_POINTER (row))
|
|
|
|
clist->selection_end = clist->selection_end->prev;
|
1998-08-03 05:58:49 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist->selection = g_list_remove (clist->selection,
|
|
|
|
GINT_TO_POINTER (row));
|
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
if (CLIST_UNFROZEN (clist)
|
1998-10-19 22:46:38 +00:00
|
|
|
&& (gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE))
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->draw_row (clist, NULL, row, clist_row);
|
1998-01-24 19:14:42 +00:00
|
|
|
}
|
|
|
|
}
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
static void
|
|
|
|
real_select_all (GtkCList *clist)
|
1998-01-24 19:14:42 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GList *list;
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (gdk_pointer_is_grabbed () && GTK_WIDGET_HAS_GRAB (clist))
|
|
|
|
return;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
switch (clist->selection_mode)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
case GTK_SELECTION_SINGLE:
|
|
|
|
case GTK_SELECTION_BROWSE:
|
|
|
|
return;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
case GTK_SELECTION_EXTENDED:
|
|
|
|
g_list_free (clist->undo_selection);
|
|
|
|
g_list_free (clist->undo_unselection);
|
|
|
|
clist->undo_selection = NULL;
|
|
|
|
clist->undo_unselection = NULL;
|
|
|
|
|
|
|
|
if (clist->rows &&
|
|
|
|
((GtkCListRow *) (clist->row_list->data))->state !=
|
|
|
|
GTK_STATE_SELECTED)
|
|
|
|
fake_toggle_row (clist, 0);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist->anchor_state = GTK_STATE_SELECTED;
|
|
|
|
clist->anchor = 0;
|
|
|
|
clist->drag_pos = 0;
|
|
|
|
clist->undo_anchor = clist->focus_row;
|
|
|
|
update_extended_selection (clist, clist->rows);
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
|
|
|
|
return;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
case GTK_SELECTION_MULTIPLE:
|
|
|
|
for (i = 0, list = clist->row_list; list; i++, list = list->next)
|
|
|
|
{
|
|
|
|
if (((GtkCListRow *)(list->data))->state == GTK_STATE_NORMAL)
|
|
|
|
gtk_signal_emit (GTK_OBJECT (clist), clist_signals[SELECT_ROW],
|
|
|
|
i, -1, NULL);
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
1998-01-24 19:14:42 +00:00
|
|
|
}
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
static void
|
|
|
|
real_unselect_all (GtkCList *clist)
|
1998-01-24 19:14:42 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GList *list;
|
1998-01-24 19:14:42 +00:00
|
|
|
gint i;
|
1998-10-19 22:46:38 +00:00
|
|
|
|
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (gdk_pointer_is_grabbed () && GTK_WIDGET_HAS_GRAB (clist))
|
|
|
|
return;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
switch (clist->selection_mode)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
case GTK_SELECTION_BROWSE:
|
|
|
|
if (clist->focus_row >= 0)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_signal_emit (GTK_OBJECT (clist),
|
|
|
|
clist_signals[SELECT_ROW],
|
|
|
|
clist->focus_row, -1, NULL);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case GTK_SELECTION_EXTENDED:
|
|
|
|
g_list_free (clist->undo_selection);
|
|
|
|
g_list_free (clist->undo_unselection);
|
|
|
|
clist->undo_selection = NULL;
|
|
|
|
clist->undo_unselection = NULL;
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist->anchor = -1;
|
|
|
|
clist->drag_pos = -1;
|
|
|
|
clist->undo_anchor = clist->focus_row;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
list = clist->selection;
|
|
|
|
while (list)
|
|
|
|
{
|
|
|
|
i = GPOINTER_TO_INT (list->data);
|
|
|
|
list = list->next;
|
|
|
|
gtk_signal_emit (GTK_OBJECT (clist),
|
|
|
|
clist_signals[UNSELECT_ROW], i, -1, NULL);
|
|
|
|
}
|
|
|
|
}
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
static void
|
|
|
|
fake_unselect_all (GtkCList *clist,
|
|
|
|
gint row)
|
|
|
|
{
|
|
|
|
GList *list;
|
|
|
|
GList *work;
|
|
|
|
gint i;
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (row >= 0 && (work = g_list_nth (clist->row_list, row)))
|
|
|
|
{
|
|
|
|
if (GTK_CLIST_ROW (work)->state == GTK_STATE_NORMAL &&
|
|
|
|
GTK_CLIST_ROW (work)->selectable)
|
|
|
|
{
|
|
|
|
GTK_CLIST_ROW (work)->state = GTK_STATE_SELECTED;
|
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
if (CLIST_UNFROZEN (clist) &&
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE)
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->draw_row (clist, NULL, row,
|
|
|
|
GTK_CLIST_ROW (work));
|
|
|
|
}
|
|
|
|
}
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist->undo_selection = clist->selection;
|
|
|
|
clist->selection = NULL;
|
|
|
|
clist->selection_end = NULL;
|
|
|
|
|
|
|
|
for (list = clist->undo_selection; list; list = list->next)
|
|
|
|
{
|
|
|
|
if ((i = GPOINTER_TO_INT (list->data)) == row ||
|
|
|
|
!(work = g_list_nth (clist->row_list, i)))
|
|
|
|
continue;
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
GTK_CLIST_ROW (work)->state = GTK_STATE_NORMAL;
|
1998-11-28 01:56:09 +00:00
|
|
|
if (CLIST_UNFROZEN (clist) &&
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_clist_row_is_visible (clist, i) != GTK_VISIBILITY_NONE)
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->draw_row (clist, NULL, i,
|
|
|
|
GTK_CLIST_ROW (work));
|
|
|
|
}
|
|
|
|
}
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
static void
|
|
|
|
real_undo_selection (GtkCList *clist)
|
|
|
|
{
|
|
|
|
GList *work;
|
1998-07-16 13:05:02 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-07-16 13:05:02 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if ((gdk_pointer_is_grabbed () && GTK_WIDGET_HAS_GRAB (clist)) ||
|
|
|
|
clist->selection_mode != GTK_SELECTION_EXTENDED)
|
|
|
|
return;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (clist->anchor >= 0)
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
|
1998-07-16 13:05:02 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (!(clist->undo_selection || clist->undo_unselection))
|
|
|
|
{
|
|
|
|
gtk_clist_unselect_all (clist);
|
|
|
|
return;
|
1998-01-24 19:14:42 +00:00
|
|
|
}
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
for (work = clist->undo_selection; work; work = work->next)
|
|
|
|
gtk_signal_emit (GTK_OBJECT (clist), clist_signals[SELECT_ROW],
|
|
|
|
GPOINTER_TO_INT (work->data), -1, NULL);
|
1998-08-10 17:56:43 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
for (work = clist->undo_unselection; work; work = work->next)
|
1999-04-30 11:48:42 +00:00
|
|
|
{
|
Adapt cast macros to standard.
Fri Nov 19 10:34:41 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkgamma.h: Adapt cast macros to standard.
[ Merges from 1.2 ]
Tue Nov 16 10:15:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_path):
If translation does not include a '/', use entire
translation instead of crashing.
Sun Oct 31 22:21:11 1999 Tim Janik <timj@gtk.org>
* docs/gtk_tut.sgml:
s/gtk_accel_group_attach/gtk_window_add_accel_group/.
Sat Oct 30 09:09:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_target_list_remove): Use
g_list_remove_link, not g_list_remove.
[ From Geert Bevin <gbevin@thunderstorms.org> ]
Sun Oct 24 07:41:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkclist.c (real_undo_selection): commented out g_print()
statement upon unselection (how the heck did that slip in?).
Sat Oct 23 03:03:08 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_freeze):
(gtk_text_thaw): undraw/draw cursor here to avoid unnecessary scrolling
in frozen state (and aparently crashes). patch provided by Anders
Melchiorsen <and@kampsax.dtu.dk>.
Sat Oct 23 02:53:20 1999 Tim Janik <timj@gtk.org>
* fix insensitive default/focus widget activation,
reported by Matt Goodall <mgg@isotek.co.uk>.
* gtk/gtkwindow.c (gtk_window_key_press_event):
(gtk_window_activate_default):
(gtk_window_activate_focus):
return handled=FALSE for actiavtion of insensitive default
widgets. return handled=TRUE for activation of insensitive
focus widgets. don't activate in either case.
Tue Oct 19 09:55:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk-config.in (lib_gtk): Switch order of @x_cflags@
and $glib_cflags to match library order and in the
theory that an old version of GLib is more likely to
be in the include directory for X then vice-versa.
(Bug #2776)
Tue Oct 19 09:46:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always use LC_CTYPE
to determine the locale for fontsets, not LC_MESSAGES;
the user may want English messages with a handling
for non-English languages. (LC_CTYPE=ru_RU LC_MESSAGES=fr_FR
will still be broken) (Bug #2891)
Tue Oct 19 20:36:42 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Fixed the wrong number of "*"'s.
Tue Oct 19 12:15:13 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Changed the Korean default fontset.
Fri Oct 8 02:32:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): Fix bug
where when scrolling to the left or top double exposes
were done, causing major slowdowns.
Thu Oct 7 18:31:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always normalize codeset
names to lowercase and alphanumeric, before looking
them up.
* gtk/Makefile.am: Install codeset variant gtkrc files
with normalized names.
Thu Oct 7 22:52:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_popup_with_data): even
popup menus when the menu is already visible, but its parent
is still hidden, (happens after tornoff window got hidden).
Thu Oct 7 11:09:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (install-data-local): Fix
a typo where gtkrc.vi_VN.tcvn5712 wasn't getting
deleted, causing error messages on install.
Thu Oct 7 11:03:06 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtk[hv]paned.c (gtk_{h,v}paned_draw): Redraw
the handle as well, since we now sometimes ignore
exposes on the handle while resizing.
Wed Oct 6 18:02:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_append_default_pixmap_path): Fix stupid
extra g_free introduced in one of the last one or two
commits.
Wed Oct 6 16:38:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc*: Make naming of gtkrc files
consistent, put each style that a gtkrc.* file creates
in a unique namespace, remove old files before installing.
Wed Oct 6 14:31:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Avoid leaking memory when
gtk_rc_init is called multiple times. (Yes, people who
do that have bugs in their code.)
Tue Oct 5 11:36:57 PDT 1999 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: listing gtkrc in gtkconf_DATA seems to barf.
Remove it since it's generated by the Makefile anyway
Tue Oct 5 02:43:41 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputcommon.h (gdk_input_device_new): Free
device->info.axes for core pointer.
Thu Sep 30 13:55:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (destroy_idle_test): Rename idle to
idle_id, to deal with obsolete, broken C libraries.
Mon Sep 27 02:50:15 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkvscale.c (gtk_vscale_draw): Don't add in
allocation->x/y twice!
* gtk/gtkhscale.c: Make usage of gtk_hscale_pos_trough()
consistent with gtk_vscale_pos_trough().
Sun Sep 26 19:44:34 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_queue_resize): We may
be queueing a resize on a toplevel container between
the time we show it and when we map it. So, we need
to test GTK_WIDGET_VISIBLE() for toplevels, and only
use GTK_WIDGET_DRAWABLE() for child windows.
Thu Sep 23 16:41:03 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDADDS): Add GDK_WLIBS to LDADDS
(fixes bug #2144)
Fri Sep 24 00:51:45 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c (gtk_container_queue_resize): check for
container DRAWABLE (instead of VISIBLE), so we don't queue
resizes on non-toplevel containers.
Sun Sep 19 18:13:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.[ch]: Make the data argument
const guchar *.
Sat Sep 18 21:27:40 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: Try to behave sensibly if
the focus widget is the window itself. (Should
we allow this at all?)
Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_set_sensitive):
* gtk/gtknotebook.c (gtk_notebook_set_scrollable):
* gtk/gtknotebook.c (gtk_notebook_set_show_border):
* gtk/gtkclist.c (gtk_notebook_set_show_border): make gboolean args
in prototypes and implementations consistent (Tomas Ogren).
* gtk/gtklayout.c (gtk_layout_remove): unset GTK_IS_OFFSCREEN flag
before the widget is unparented (reported by damon).
* gtk/gtkdnd.c: make the cursor and icon data _unsigned_ char,
since we provide unsigned data anyways.
Thu Sep 16 21:32:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_set_tip): Delay
the call to gtk_tooltips_layout_text() until later.
* gtk/gtktooltips.c (gtk_tooltips_draw_tips):
Call gtk_widget_ensure_style() before using the style.
Wed Sep 15 02:52:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_event): Added workaround
for old widgets that don't propagate draws to all
children. (Namely gnome-dock for gnome-libs <= 1.0.16)
Tue Sep 14 19:22:19 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_queue_resize): don't queue the parent
for a redraw but just the widget that requested the resize.
Tue Sep 14 18:29:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c: added new widget level method
gtk_container_set_reallocate_redraws() and a GtkContainer flag
reallocate_redraws : 1 to reflect the setting, exported this through
the argument system as a boolean ::reallocate_redraws.
* gtk/gtkwidget.c (gtk_widget_size_allocate): when queueing redraws
on the widget because the allocation changes, do so as well for
widget->parent if the parent has reallocate_redraws set to TRUE.
with that containers requesting reallocation redraws get automatically
redrawn if their children changed allocation (this unfortunately
affects also other children that didn't change allocation, but we
cannot work around that before 1.3).
Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_idle_draw): only emit ::draw if width
_and_ height are >0 (not _or_).
* gtk/gtktable.c (gtk_table_remove): use gtk_widget_queue_resize()
instead of gtk_container_queue_resize(), which is a core gtk internal
function (must have been on crack when i queued that).
* gtk/gtkprivate.h: added new private flag GTK_FULLDRAW_PENDING, so
we can check more reliably if we want to discard expose events.
* gtk/gtkwidget.c: added setting/unsetting of the GTK_FULLDRAW_PENDING
flag.
* gtk/gtkwidget.c (gtk_widget_event): don't discard synthesized exposes,
we simply trust these events. for deciding whether to discard exposes,
check GTK_FULLDRAW_PENDING instead of RESIZE_PENDING.
Mon Sep 13 15:01:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore
queues of areas that are completely off screen.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fix broken
logic for handleboxes.
* gtk/gtkwidget.c (gtk_widget_queue_draw_data): Add santity
check on width/height.
Mon Sep 13 02:22:47 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: backed out Raja's recent VPATH build "improvements",
we are fine with using $@ the way we do (if we actually encounter
brokeness with $@ in VPATH builds because of additional path prefixes,
we need to use $(@F) actually).
Mon Sep 13 01:34:53 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c: renamed two variables, hopefully didn't introduce
short lived bugs, that would allow language bindings to do surgeries
to our guts.
Fri Sep 10 15:22:50 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_size_allocate): Fix typo
where comparison was being done against an uninitialized
value causing intermittant results depending on
compiler flags. Also make it clearer that we aren't
ever initializing the child as 0x0 (though this will
be caught in gtk_widget_size_allocate())
Fri Sep 10 10:06:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_transient_for): Move
gtk_window_unset_transient_for() call after we do checks
involving the old transient parent.
[ From Lance Capser <lmc@cyberhighway.net> ]
1999-09-07 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gtk.defs): Go back to using `touch' to create
an empty file.
Mon Sep 6 00:11:56 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (gtk_ctree_is_ancestor): return FALSE if node has
no children. (Reported by: Chris Rogers <gandalf@pobox.com>)
1999-09-03 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gen_sources): Improve VPATH builds.
`$@' is valid only in the build dir, not after we've done
`cd $srcdir'. Also use `test -f' instead of less portable
`test -e'.
Fri Sep 3 15:59:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (correct_cache_insert): Rewrite
for simplicity, and hopefully correctness.
(Fixes bug #1322, which was a segfault when
on some insertions with the properties around
the insertion set up just wrong.)
* gtk/gtktext.c (gtk_text_adjustment): When we receive
a "changed" signal, clamp the new value to the adjustment
bounds to avoid segfaulting if someone tries to change
the adjustment to a bogus value. (Bug #1795)
Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c: Ignore unexpected destroy notifies
for children, for toplevel windows handle them
like delete_event.
* gtk/gtkplug.c: Add an unrealize handler so that
we unref plug->socket_window when we are done
with it.
Fri Sep 3 14:52:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_area): Fix stupid signedness
problem that was causing background to sometimes
be misaligned.
Fri Sep 3 12:26:33 1999 Owen Taylor <otaylor@redhat.com>
[ Fixes pointed out by Ettore Perazzoli <ettore@comm2000.it> ]
* gtk/gtkmenu.c (gtk_menu_position): Make
sure we never position menus with negative x, y,
since gtk_widget_set_uposition() can't handle that.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu):
Modify the positioning code a bit so that we always
put the top-left corner onscreen. (This is for
UI reasons, gtk_menu_position() now takes care of
gtk_widet_set_uposition() brokeness.)
Fri Sep 3 03:06:30 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: fixed up things for -jx, x > 1.
Sun Sep 5 08:48:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_style): Ref the
RC style that is passed in. The lack of the ref
before was a bug. If people worked around this
bug, this will introduce a slight memory leak
in their code. The code should typically look like:
rc_style = gtk_rc_style_new ();
[...]
gtk_widget_modify_style (widget, rc_style);
gtk_rc_style_unref (rc_style);
* gtk/gtkwidget.c (gtk_widget_modify_style): Reset
the style if it was already set.
* gtk/gtkwidget.c (gtk_widget_set_name): Only set the
style if it was set before.
Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (main): Add a check to see if we
are being run from the correct directory and
to quit nicely if we are not.
* gtk/gtkrc.c (gtk_rc_slist_remove_all): Make function
static.
Thu Sep 2 23:00:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkenums.h (GtkWindowPosition): added GTK_WIN_POS_CENTER_ALWAYS.
* gtk/gtkwindow.c:
queue resizes unconditionally (gtk_widget_queue_resize will figure
what to do if the window is not realized).
(gtk_window_move_resize): only recenter the window
for GTK_WIN_POS_CENTER_ALWAYS.
(gtk_window_compute_reposition): handle GTK_WIN_POS_CENTER_ALWAYS in
the same way as GTK_WIN_POS_CENTER.
Thu Sep 2 22:39:27 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_reposition): check for the last position
with (!(info->last_flags & GDK_HINT_POS)) instead of
(!info->last_flags & GDK_HINT_POS).
* gtk/gtkwindow.c (gtk_window_move_resize): constrain new_width and
new_height unconditionally, because we use these values even if
!default_size_changed && !hints_changed.
comented the (default_size_changed || hints_changed) case with
respect to resize rejects from the window manager.
* gtk/gtkwindow.c (gtk_window_move_resize): save info->last values
in the zvt condition hack, since this includes the window hints, set
the hints after the handling_resize case.
* gtk/gtkwindow.c (gtk_window_show): constrain the default size that a
window is initially shown with to the geometry.
Thu Sep 2 07:38:56 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize):
s/size_changed/default_size_changed/g so i know what's
really going on (frying brain on smaller flame now).
Thu Sep 2 05:47:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): queue a new resize if
we have size_changed upon handling_resize. this is a gross
workaround for the broken zvt widget and should be removed in
1.3 again (search for FIXME).
Owen provided an accurate comment for this:
/* We could be here for two reasons
* 1) We coincidentally got a resize while handling
* another resize.
* 2) Our computation of size_changed was completely
* screwed up, probably because one of our children
* is broken. It's probably a zvt widget.
*
* For 1), we could just go ahead and ask for the
* new size right now, but doing that for 2)
* might well be fighting the user (and can even
* trigger a loop). Since we really don't want to
* do that, we requeue a resize in hopes that
* by the time it gets handled, the child has seen
* the light and is willing to go along with the
* new size. (this happens for the zvt widget, since
* the size_allocate() above will have stored the
* requisition corresponding to the new size in the
* zvt widget)
*
* This doesn't buy us anything for 1), but it shouldn't
* hurt us too badly, since it is what would have
* happened if we had gotten the configure event before
* the new size had been set.
*/
Wed Sep 1 20:46:11 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: deal properly with the fact that RC
style lists may include rc styles more than once.
* gtk/gtkrc.c (gtk_rc_append_pixmap_path): Removed
unused static function.
* gtk/gtkrc.c (gtk_rc_find_pixmap_in_path): Keep a
stack of directories of RC files currently being
parsed and implicitely add them to pixmap path.
This fixes a bug where the directory would get
appended then overwritten by pixmap_path declarations.
(bug #1462, from Peter Wainright <prw@wainpr.demon.co.uk>)
* gtk/gtkthemes.c (gtk_theme_engine_unref): Call
theme's exit function. (Patch from Peter Wainwright,
bug #1454)
* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_destroy):
Add a destroy() handler to take care of removing
group for menu item. (Fixes bug #1197)
* gtk/gtkwidget.c (gtk_widget_size_request): Fixed thinko
in warning message.
Wed Sep 1 21:27:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): don't require a server
roundtrip to figure window's width and height, since we know that
anyways from widget->allocation.
Wed Sep 1 12:37:44 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Compute
the hints after we request the new size.
Wed Sep 1 10:38:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_compute_hints): Removed
GTK_WIDGET_REALIZED() assertion - we can compute the
hints before we are realized.
* gtk/gtkwindow.c (gtk_window_move_resize): Reorder
hint changing so that we have a value of hints_changed
when we decide whether to constrain the window size.
* gtk/gtkwindow.c (gtk_window_move_resize): Spelling fix.
* gtk/gtkwindow.c (gtk_window_constrain_size): cleanups,
change back to G_MAXINT.
Wed Sep 1 06:54:59 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_get_geometry_info): zero initialize
new GtkWindowGeometryInfo, so fields like GdkGeometry geometry
contain uncluttered values.
(gtk_window_compute_hints): simply assert that window is realized
and that geometry_info is valid, since we rely on this anyways.
(gtk_window_constrain_size): major cleanups to the code.
if (flags & GDK_HINT_BASE_SIZE) use geometry's base width and height
for the base size, instead of the minimums. use 32767 as max width
and height (like in gtkwindow.c) instead of G_MAXINT.
Wed Sep 1 04:41:25 1999 Tim Janik <timj@gtk.org>
* cleaned up the GtkContainer.need_resize flag handling mess, we
only need to force resize requests when we were prematurely
realized, or our widget tree was modified when we were temporarily
hidden. handling these cases directly upon showing the window (i.e.
while the GdkWindow is still unmapped) avoids the need to wait for
a configure event response and therefore makes the GUI more snappier
and avoids blank windows during the roundtrip.
* gtk/gtkwidget.c:
(gtk_widget_hide):
(gtk_widget_show): don't queue resizes on toplevels, they know how
to deal with matters.
* gtk/gtkcontainer.c (gtk_container_queue_resize): set the ->need_resize
flag directly for not visible resize containers and spare us unecessary
signal emissions.
* gtk/gtkwindow.c:
(gtk_window_realize): if we need to enforce premature size allocation,
queue a container resize so we are correctly resized later on.
(gtk_window_init):
(gtk_window_size_request):
don't freak around with the ->need_resize flag,
gtk_container_queue_resize() will care about that.
(gtk_window_show):
handle initial resizing issues here, we can handle matters better in
this place, especially since we know that our GdkWindow is still
unmapped.
(gtk_window_move_resize):
don't care about ->need_resize at all.
handle size changes properly that occoured while we waited for a
configure event.
Tue Aug 31 15:58:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_uposition):
* gtk/gtkwindow.[hc] (gtk_window_reposition):
Move the hint setting code from gtk_widget_set_uposition
to here; set the hints so that we respect any previously
set geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Don't
change the window hints here or move the window here,
let that happen in gtk_window_move_resize().
Tue Aug 31 06:58:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): when discarding exposes due
to already queued resizes (and therefore redraws) on a widget, check
its anchestry as well.
* gtk/gtkcontainer.c:
(gtk_container_queue_resize): clear resize widgets for resize
containers before aborting prematurely. this is especially important
for toplevels which may need imemdiate processing or their resize
handler to be queued.
(gtk_container_dequeue_resize_handler): added new internal function for
gtkwindow.c.
* gtk/gtkwindow.c (gtk_window_move_resize): if we are resizing due to a
configure event, take possible changes in window position into account
as well.
if we request a new window size, queue up a resize handler that will
last until the configure event response arrives.
combined the ->need_resize case (initial show) with the general size
(hints) changed case and added even more comments.
if !auto_shrink, only revert to the old allocation if the new size
is smaller than the current allocation.
Tue Aug 31 11:55:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_arg, gtk_window_set_policy,
gtk_window_set_geometry_hints
gtk_window_set_default_size):
When hints are set, queue a resize so that the hints will
be eventually reset on the toplevel.
* gtk/gtkwindow.c (gtk_window_show): Use
gtk_window_compute_default_size(). Clear the need_resize flag
on the initail map so that we don't unnecessarily trigger the
resize code.
* gtk/gtkwindow.c (gtk_window_move_resize): Split apart
into separate functions. Compare the hints we are setting
with what we set last time so that we can accurately
tell when we need to reset the hints.
* gtk/gtkwindow.c (gtk_window_compute_default_size): New
function to figure out the size from requisition
and default_size.
* gtk/gtkwindow.c (gtk_window_constrain_size): Function
from fvwm to constrain a size to the geometry hints.
* gtk/gtkwindow.c (gtk_window_compare_hints): New function
to compare two sets of geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_hints): Renamed
from gtk_window_set_hints(), just compute the hints,
don't set them.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Move
code from gtk_window_move_resize() to separate function,
rationalize a bit.
Tue Aug 31 13:05:03 1999 Owen Taylor <otaylor@redhat.com>
* gtkrc.h: Move the ref_count member out of the GtkRcStyle
structure into a new private structure.
* gtkrc.c: Split GtkRcStyle into public/private.
In the private part, add a list of pointers to the
RcStyle lists this RcStyle participates in.
* gtkrc.c: When a RcStyle is free, remove all
lists referencing it from the
realized_style_ht hash, and free those lists.
* gtk/gtkrc.c (gtk_rc_clear_styles): Don't call
gtk_rc_init(), since that adds the default styles
to the list of parsed RC files again.
* gtk/gtkrc.c: Use gtk_rc_style_find() consistently.
Thu Aug 26 14:14:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): reactivated the sanity
checks that ensure that a widget's allocation is at least 1 in width
and height. (GNOME note: this doesn't affect old panel code anymore,
because GtkSocket will request width and height of at least 1 since
Fri Jul 23).
* gtk/gtkwindow.c (gtk_window_realize): if the widget hasn't been
allocated yet (happens if the user realizes the window prematurely),
size request and allocate it.
(gtk_window_size_allocate): guard against guint underflows.
Wed Aug 25 19:01:36 1999 Lars Hamann <lars@gtk.org>
* gtk/Makefile.am (gtk_built_sources): reordered stamp-gtk.defs
in gtk_built_sources, so gtk.defs gets built prior to all other
sources.
Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am:
invoke indent on gtkmarshal.*.
rewrote source generation rules, use COPYING as oldest source tag for
a piggyback rule to generate all sources from (don't touch it ;).
major cleanups, strip spaces on build rules for GNU Make.
* gtk/genmarshal.pl: don't operate on hardcoded filenames but take
source and target files from commandline arguments. don't invoke indent.
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Wed Aug 18 09:20:10 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c:
we use window->need_resize from configure_event now, to indicate that
the gtkwindow should keep its allocation (e.g. because the user resized
the window through window manager handles). resize_count is now reliably
used to figure whether we got the allocation we requested from the
window manager.
configure events get queued as resizes now, the real stuff (size
computation and allocation) now only goes on in gtk_window_move_resize().
GtkWindow's requisition now contains its *real* requisition (like all
other widgets), *not* taking usize into account.
geometry_info->last_{width|height} is now updated from set_hints() only
so it always contains the last hints we set for the window manager.
made some event handlers return TRUE instead of FALSE.
the overall code should be much more straight forward now, and the
significant code portions are accompanied by comments now.
(gtk_window_set_hints):
removed requisition argument and made it
fetch the requisition through gtk_widget_get_child_requisition.
we also don't move the gdkwindow here anymore, gtk_window_move_resize()
does that now.
(gtk_window_show):
ensure that the widget is realized before calling
gtk_container_check_resize() (and thus gtk_window_move_resize()), also
ensure that we got properly size requested and allocated before
realization.
(gtk_window_configure_event):
ignore plain window moves, or reallocate the widget tree through the
resize queue otherwise.
(gtk_window_move_resize):
mostly rewrote this function to figure window manager hints more
reliably, coalesce window moves and resizes to reduce configure events
and do actuall size allocations.
Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): discard expose events for widgets
that have a resize pending, because a redraw is already queued for them.
* gtk/gtkcontainer.c: removed ugly connect_to ::size_allocate signal
hack to clear resize_widgets.
* gtk/gtkwidget.c (gtk_widget_size_allocate): call clear_resize_widgets
for resize containers prior to size allocation. (this is also a bit
ugly, but avoids side effects for stopped emissions and is thus more
reliable).
(gtk_widget_unparent): removed disconnect call for clear_resize_widgets.
* gtk/gtktooltips.c (gtk_tooltips_paint_window): renamed this
function from gtk_tooltips_expose, as we connect to ::expose_event
*and* ::draw now.
1999-08-18 Federico Mena Quintero <federico@redhat.com>
* gtk/gtkselection.c (gtk_target_list_ref): Added missing sanity
checks.
(gtk_target_list_unref): Likewise.
* gtk/gtkthemes.c (gtk_theme_engine_unref): Likewise.
Tue Aug 17 15:47:07 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_draw_value_bar):
guard against division by zero. (Fixes bug #1339)
Tue Aug 17 10:56:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_move_{forward,backward}_word):
Prevent the trivial leak of information of allowing
word motion when the entry is not visible.
Tue Aug 17 10:28:52 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_fileop_error): Propagate
modality to error dialog as well as confirmation dialogs.
(Bug #1803, reported by Rosanna Wing Sze Yuen)
Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktreeitem.c (gtk_tree_item_draw_lines): Honor
tree->view_lines.
(gtk-guy-990611-3.patch: Guy Harris <guy@netapp.com>)
* gtk/Makefile.am (install-data-local): Solaris apparently
has various troubles with ln -f; use rm first instead.
(gtk-guy-990611-2.patch: Guy Harris <guy@netapp.com>)
1999-07-30 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (stamp-m): Don't `mv' from builddir to srcdir,
use `cp' followed by `rm' (the `rm' was already there).
July 30, 1999 Elliot Lee <sopwith@redhat.com>
* configure.in: Fix autoconf warnings about cross compilation by
trying to provide sane defaults for AC_TRY_RUN.
* gtk/Makefile.am: If we refer to gtkmarshal.[ch] in $(srcdir),
put them into $(srcdir) when generated. Also add a dependency of
gtksignal.h on gtkmarshal.h for -j builds.
* gtk/gtk(dnd,style,gamma).c: Minor warning fixes.
Wed Jul 28 09:29:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration_do): Added missing
GDK_THREADS_{LEAVE,ENTER} pair.
(From Paul Fisher <pnfisher@redhat.com>)
Fri Jul 23 01:00:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtksocket.c (gtk_socket_size_request): asure that the requested
width and height are always >0 (owen).
Fri Jul 23 00:00:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): backed out my recent
change that assured that a widget's allocated with and height are
always >1, since this breaks *buggy* panel code. unfortunately this
back-breaks the gimp's color selector.
* gtk/gtkdrawingarea.c (gtk_drawing_area_size_allocate): asure that our
allocation is always >0 in width and height, before sending the
configure event; this is a *gross* hack to get the gimp back to work.
* marked both cases with TODO-1.3
Wed Jul 21 15:47:39 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Don't display wrap indicators when
text is not editable and word wrap is on.
Wed Jul 21 08:21:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): special case
option menus here as they are not derived from menu shell, assure that
the option menu has a menu we can add items to.
Tue Jul 20 23:29:48 1999 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_page_allocate): convert allocation->
width/height to (gint) before calculations and check against < 0 to
avoid guint wraparounds.
Sun Jul 18 00:35:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): ensure that the allocated
width and height is never zero. sanity check both dimensions against
32767 and issue a warning if the allocation is greater than that.
Wed Jul 7 15:03:30 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_events_pending): Unlock around call
to g_main_pending() as well.
Wed Jul 7 14:59:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration): Unlock around
call to g_main_iteration() - since that will regrab
GTK+ lock to process events.
Thu Jul 1 15:01:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c
- Regularize with the rest of GTK+ by making widget->requisition
not reflect the set_usize()
- Always recompute geometry hints, then check if they
changed before sending them to the X server. The
previous checks for changes would fail in a number
of circumstances.
Thu Jul 1 11:55:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Include <stdlib.h> for strcmp().
Wed Jun 30 19:26:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c:
- Code cleanups
- Instantaneously update on modifier key presses
- Allow cancellation of the drag with Escape.
Tue Jun 29 17:04:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_handle_box): Set the policy
to auto_shrink - otherwise the appearance is rather
strange when flipping between horizontal and vertical.
Mon Jun 28 09:29:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: add ::default_width and ::default_height arguments.
(gtk_window_set_default_size): don't change a value if it's < 0.
queue a resize.
Sun Jun 27 11:00:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_insert): don't segfault on NULL inserts.
Mon Jun 28 12:08:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (cmpl_completion_fullname): Don't
add an extra "/" when concating "/" + filename.
(From Matt Grossman <mattg@oz.net>)
Mon Jun 28 10:57:12 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (draw_cell_pixmap): Reset clip mask
for fg_gc if we set it for drawing pixmap.
Tue Jun 15 12:45:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes from Peter Wainwright <prw@wainpr.demon.co.uk>
* gtk/gtkrc.c (gtk_rc_parse_engine): If rc_style->engine is
already set, call old engine's destroy function and
unref the old engine.
Thu Jun 10 17:59:38 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.c (gtk_drawing_area_size): queue a resize.
Wed Jun 9 15:13:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h: mark certain functions as internal.
Wed Jun 9 13:48:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpreview.c (gtk_preview_set_expand): queue a resize if the
expand behaviour changed.
* gtk/gtklabel.c (gtk_label_set_pattern):
(gtk_label_set_justify):
(gtk_label_set_line_wrap):
don't bother invoking queue_clear, the reallocation does
that for us, always free_words so the upcoming resize will
relayout the label's contents.
Wed Jun 9 12:50:48 1999 Tim Janik <timj@gtk.org>
* applied argument implementation patches from Elena Devdariani
<elena@cogent.ca>.
* gtk/gtktoolbar.c: ::orientation, ::toolbar_style, ::space_size,
::space_style, ::relief
* gtk/gtkruler.c: ::lower, ::upper, ::position, ::max_size
* gtk/gtkpreview.c: ::expand
* gtk/gtkpaned.c: ::handle_size, ::gutter_size
* gtk/gtknotebook.c: ::homogeneous
* gtk/gtklabel.c: ::wrap
* gtk/gtklist.c: ::selection_mode
* gtk/gtkhandlebox.c: ::handle_position, ::snap_edge
* gtk/gtkcurve.c: ::curve_type, ::min_x, ::max_x, ::min_y, ::max_y
* gtk/gtkcolorsel.c: ::update_policy, ::use_opacity
* gtk/gtkclist.c: ::sort_type
* gtk/gtkcheckmenuitem.c: ::active, ::show_toggle
* gtk/gtkaspectframe.c: ::xalign, ::yalign, ::ratio, ::obey_child
Tue Jun 1 23:38:38 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Removed ill-thought-out part of last
comment.
Tue Jun 1 23:30:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_attach): Get the reference
counting right when we have to attach a new style
for a different visual. (Chi-Deok Hwang <cdhwang@sr.hei.co.kr>)
* gtk/gtkstyle.c: Documented the refcounting
peculularities of gtk_style_attach.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkwindow.c (gtk_window_new): added return if fail for invalid
window types.
* examples/packer/pack.c (main): use GTK_WINDOW_TOPLEVEL instead
of GTK_TOPLEVEL for creating the window.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkmain.c (gtk_init_check): don't segfault when --gtk-module is
the last argument (reported by Per Winkvist).
Tue May 25 13:13:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes for invisible XOR lines (Frank Loemker
<floemker@TechFak.Uni-Bielefeld.DE>)
* gtk/gtkclist.c (gtk_clist_realize): Always use
a non-zero pixel for GDK_XOR.
* gtk/gtkvpaned.c gtk/gtkhpaned.c:
Use GDK_INVERT instead of GDK_XOR.
Wed May 12 21:56:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (adjust_adjustments): signal emit value_changed
signals if h/voffsets differ from adjustment values.
Reportet by Jerome Bolliet <bolliet@in2p3.fr>
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
the user data on the window before destroying it.
* gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
unrealize handler to take care of destroying
notebook->panel properly.
(Bug #1198 - Morten Welinder <terra@diku.dk>)
* gtk/gtktext.c (expand_scratch_buffer): Fix reversal
of g_new and g_realloc to stop memory leak. (Actually,
we could just use g_realloc(), but I'm not 100% sure
that is portable).
(Bug #1196 - Morten Welinder <terra@diku.dk>)
Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.h: Removed stray GtkPlugButton declaration.
* gdk/gdkfont.c (gdk_text_measure): Fix the return value
for fontsets.
* gtk/gtkbutton.c (gtkbutton_expose): Fix warning
with bin/button confusion.
Thu May 6 04:53:26 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: in the ItemFactory test, link radio items together,
and show how preselection of radio items is done.
Sun May 2 13:31:14 1999 Tim Janik <timj@gtk.org>
* gtk/gtktreeitem.c (gtk_tree_item_set_subtree):
* gtk/gtktree.c (gtk_tree_add) (gtk_tree_insert):
* gtk/gtktoolbar.c (gtk_toolbar_insert_element):
* gtk/gtkpaned.c (gtk_paned_pack2) (gtk_paned_pack1):
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_add):
* gtk/gtktable.c (gtk_table_attach):
* gtk/gtklist.c (gtk_list_insert_items):
* gtk/gtkmenushell.c (gtk_menu_shell_insert):
* gtk/gtknotebook.c (gtk_notebook_insert_page_menu):
* gtk/gtkpacker.c (gtk_packer_add_defaults) (gtk_packer_add):
* gtk/gtkbin.c (gtk_bin_add):
* gtk/gtkbox.c (gtk_box_pack_start) (gtk_box_pack_end):
* gtk/gtkfixed.c (gtk_fixed_put):
* gtk/gtklayout.c (gtk_layout_put):
general fixups to container_add logic. always realize child if
child->parent is realized, only map the child and queue a resize
if child and child->parent are both visible.
Fri Apr 30 09:02:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_unrealize): use gtk_container_forall
instead of gtk_container_foreach to walk and unrealize children, so
composite children get also unrealized.
(gtk_widget_real_show): don't call gtk_widget_map() if we don't need to.
(gtk_widget_map): assert that the widget is visible (basic constrain).
(gtk_widget_real_map): assert that the widget is realized (basic
constrain).
Fri Apr 29 00:53:20 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbindings.c (gtk_pattern_spec_init): plugged a memory leak.
Tue May 4 09:32:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc.iso-8859-2: Add a gtkrc
file for iso-8859-2 locales.
* configure.in (ALL_LINGUAS): ALL_LINGUAS update.
Tue Apr 27 16:38:32 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Fix typo of static_sources for static_SOURCES.
(Pointed out by andy@rz.uni-karlsruhe.de and others).
Remove some suspicious and useless lines.
Tue May 4 08:44:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c (gtk_clist_draw, draw_rows): Use
width,height = 0, 0 to mean - here to edge of window,
instead of -1, -1, since the former is all we support.
Tue May 4 08:34:43 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main): Correctly free list nodes
when removing from quit_functions list.
Tue Apr 27 14:17:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpacker.c (gtk_packer_size_request): remove unused variable.
Tue Apr 27 18:23:35 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable):
When redrawing characters on non-visible entry, use appropriate
'*' character. (Bug #1130 - Jean-Marc Jacquet <jm@littleigloo.org>)
Tue Apr 27 01:31:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (drag_dest_cell): compute destination cell
from drag coordinates.
(gtk_clist_drag_data_received) (gtk_clist_drag_motion):
use drag_dest_cell.
* gtk/gtktree (drag_dest_cell)
(gtk_ctree_drag_data_received) (gtk_ctree_drag_motion): likewise.
(Bug #1129)
Wed Apr 21 21:26:11 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_init): properly initialize
translate_* fields.
(gtk_item_factory_finalize): invoke translate_notify independant from
translate_data.
(gtk_item_factory_set_translate_func): likewise.
(gtk_item_factory_destroy): only remove ifactory pointer from those
widgets that belong to us (stupid me).
Mon Apr 19 12:05:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Fixed leak of
rc_style list when lookup succeeeds.
Thu Apr 15 01:11:24 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (resync_selection):
* gtk/gtkclist.c (resync_selection): fixed undo_selection bug.
* gtk/gtkclist.c (gtk_clist_button_release): fixed resync_selection
bug.
Fri Apr 9 19:22:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c gtk/gtkdnd.c gtk/gtkmenuitem.c:
Add some missing GDK_THREADS_ENTER()/LEAVE around
timeouts. (Patches from Sebastian Wilhelmi <wilhelmi@ira.uka.de>)
Thu Apr 8 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkentry.c (gtk_entry_key_press): use gtk_widget_activate()
rather than emit_by_name.
* gtk/gtkeditable.c (gtk_editable_insert_text): keep a reference
on the widget across multiple signal emissions.
(gtk_editable_delete_text): same here.
(gtk_editable_class_init): set widget_class->activate_signal after
editable_signals[ACTIVATE] has been created.
Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
position here prematurely -- we might not have the
right ->min_position and ->max_position yet.
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
Add error traps so if the other end of the connection
dies, we survive.
* gtk/gtkselection.c (gtk_selection_notify): Clean
up properly when selection property retrieval fails.
* gtk/gtkselection.c (gtk_selection_request): Correctly
reject SelectionRequest notifies where the handler
returns no data.
Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_dest_leave): Only unhighlight
when we've previously highlighted.
* gtk/gtkdnd.c (gtk_drag_dest_handle_event): Don't
emit two "drag_leave" signals for Motif drops.
* gtk/gtkdnd.c (gtk_drag_source_handle_event): Send
back the correct status messages when dropping from
Motif onto a proxy window that is rejecting the
drop.
Sat Mar 27 23:32:13 1999 Tim Janik <timj@gtk.org>
* gtk/gtkarg.[hc]: added functions from GLE, gtk_arg_reset() to free
the value and reset type to GTK_TYPE_INVALID, and gtk_arg_values_equal()
to compare two argument values. added gtk_arg_to_valueloc() to set a
variable from an arg through its location (pointer).
* gtk/gtkobject.[hc]: implemented gtk_object_get() in terms of
gtk_object_arg_get() and gtk_arg_to_valueloc(), floats are collected
as gfloat*, uchars are collected as guchar*, ints are collected as
gint*, etc...
Mon Mar 29 17:45:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccelgroup.c gtk/gtkgtkbindings.c:
Include <string.h> instead of <strings.h>.
* gtk/gtkstyle.c: Fix double include of gtkthemes.h
(actually, a lot more duplicate includes occur if
you trace through the sequence of #include's)
gtk-jbb-990320-0: John Bley, jbb6@acpub.duke.edu
Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com>
Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp>
gtk-a-higuti-990322-[0-3]
* configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS
that was causing -DX_LOCALE not to work.
* gtk/gtkrc.c (gtk_rc_init):
X_LOCALE will never have LC_MESSAGES defined
Thu Mar 25 12:38:31 1999 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_append_default_module_path): get $HOME from
g_get_home_dir() (gtk-pmc-990123-0.patch.gz).
* gtk/gtkwindow.c (gtk_window_key_press_event): feature keypad up/down/
left/right as well (gtk-michael-980726-0.patch.gz).
* gtk/gtklabel.[hc]: bunch of miscellaneous cleanups, such as s/0/NULL/
for pointer values, use gchar instead of char. fixed uline allocation
leaks, changed the allocation pattern so we use G_ALLOC_AND_FREE mem
chunks instead of G_ALLOC_ONLY.
(gtk_label_size_request): always alter requisition as passed and leave
widget->requisition alone.
(gtk_label_set_text): allow NULL strings.
(gtk_label_new): likewise.
Wed Mar 24 09:24:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.[hc]: type/macro fixups.
Mon Mar 22 05:51:34 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbin.c (gtk_bin_draw): only redraw children that are visible
*and* mapped (i.e. drawable).
(gtk_bin_expose): only send exposes to drawable children.
* gtk/gtkbox.c (gtk_box_draw): only redraw children that are drawable.
(gtk_box_expose): only send exposes to drawable children.
* gtk/gtkhscale.c (gtk_hscale_draw):
* gtk/gtkvscale.c (gtk_vscale_draw):
hm, this is an ugly one. we first compute the size of our trough area
here (window relative) and then check intersection with the draw_area
which is parent relative because we're a NO_WINDOW widget, so we need
to offset the trough area by allocation.x and allocation.y before the
check. (this must not be done for the background area though, since
that's already computed parent relative).
Mon Mar 22 00:41:39 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_unrealize): unmap clist if neccessary,
unrealize title buttons.
Fri Mar 19 00:00:22 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_column_title_passive)
(gtk_clist_column_title_active):
only connect/disconnect to GtkWidgetClass::event to block mouse events.
* gtk/gtkclist.c (vertical_timeout) (horizontal_timeout):
zero initialize event, removed superfluous gdk_window_get_pointer call
* gtk/gtklist.c (gtk_list_vertical_timeout)
(gtk_list_horizontal_timeout): removed superfluous
gdk_window_get_pointer call
Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org>
* plugging problems reported by "Bruce Mitchener, Jr."
<bruce@puremagic.com> due to a purify session.
* gtk/gtkstyle.c:
(gtk_style_ref):
(gtk_style_unref): assert ref_count to be > 0.
* gtk/gtkclist.c (gtk_clist_set_cell_style): { 0 } initilaize
the requisition.
(gtk_clist_set_shift): likewise.
* gtk/gtklayout.c: introduce gtk_layout_finalize() to unref the
adjustments.
* gtk/gtklist.c (gtk_list_horizontal_timeout): zero initialize the
event before sending it and set send_event to TRUE (which needs to
be done for *all* synthesized events).
(gtk_list_vertical_timeout): likewise.
* gtk/gtktipsquery.c (gtk_tips_query_destroy): plug small memory
leaks.
* gtk/gtkdrawingarea.c (gtk_drawing_area_send_configure): set send_event
to TRUE when synthesizing events.
[ *** end of merges from 1.2 *** ]
1999-11-22 21:52:50 +00:00
|
|
|
/* g_print ("unselect %d\n",GPOINTER_TO_INT (work->data)); */
|
1999-04-30 11:48:42 +00:00
|
|
|
gtk_signal_emit (GTK_OBJECT (clist), clist_signals[UNSELECT_ROW],
|
|
|
|
GPOINTER_TO_INT (work->data), -1, NULL);
|
|
|
|
}
|
1998-01-03 03:31:03 +00:00
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (GTK_WIDGET_HAS_FOCUS(clist) && clist->focus_row != clist->undo_anchor)
|
1998-10-19 22:46:38 +00:00
|
|
|
{
|
|
|
|
gtk_clist_draw_focus (GTK_WIDGET (clist));
|
|
|
|
clist->focus_row = clist->undo_anchor;
|
|
|
|
gtk_clist_draw_focus (GTK_WIDGET (clist));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
clist->focus_row = clist->undo_anchor;
|
|
|
|
|
|
|
|
clist->undo_anchor = -1;
|
|
|
|
|
|
|
|
g_list_free (clist->undo_selection);
|
|
|
|
g_list_free (clist->undo_unselection);
|
|
|
|
clist->undo_selection = NULL;
|
|
|
|
clist->undo_unselection = NULL;
|
1998-08-10 17:56:43 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (ROW_TOP_YPIXEL (clist, clist->focus_row) + clist->row_height >
|
|
|
|
clist->clist_window_height)
|
|
|
|
gtk_clist_moveto (clist, clist->focus_row, -1, 1, 0);
|
|
|
|
else if (ROW_TOP_YPIXEL (clist, clist->focus_row) < 0)
|
|
|
|
gtk_clist_moveto (clist, clist->focus_row, -1, 0, 0);
|
1998-01-24 19:14:42 +00:00
|
|
|
}
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
static void
|
|
|
|
set_anchor (GtkCList *clist,
|
|
|
|
gboolean add_mode,
|
|
|
|
gint anchor,
|
|
|
|
gint undo_anchor)
|
1998-01-24 19:14:42 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
|
|
|
|
|
|
|
if (clist->selection_mode != GTK_SELECTION_EXTENDED || clist->anchor >= 0)
|
|
|
|
return;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
g_list_free (clist->undo_selection);
|
|
|
|
g_list_free (clist->undo_unselection);
|
|
|
|
clist->undo_selection = NULL;
|
|
|
|
clist->undo_unselection = NULL;
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (add_mode)
|
|
|
|
fake_toggle_row (clist, anchor);
|
|
|
|
else
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GTK_CLIST_CLASS_FW (clist)->fake_unselect_all (clist, anchor);
|
|
|
|
clist->anchor_state = GTK_STATE_SELECTED;
|
|
|
|
}
|
1998-10-07 00:03:24 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist->anchor = anchor;
|
|
|
|
clist->drag_pos = anchor;
|
|
|
|
clist->undo_anchor = undo_anchor;
|
|
|
|
}
|
1998-01-26 00:07:40 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
static void
|
|
|
|
resync_selection (GtkCList *clist,
|
|
|
|
GdkEvent *event)
|
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
gint e;
|
|
|
|
gint row;
|
|
|
|
GList *list;
|
|
|
|
GtkCListRow *clist_row;
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (clist->anchor < 0)
|
|
|
|
return;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
gtk_clist_freeze (clist);
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
i = MIN (clist->anchor, clist->drag_pos);
|
|
|
|
e = MAX (clist->anchor, clist->drag_pos);
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (clist->undo_selection)
|
|
|
|
{
|
|
|
|
list = clist->selection;
|
|
|
|
clist->selection = clist->undo_selection;
|
|
|
|
clist->selection_end = g_list_last (clist->selection);
|
|
|
|
clist->undo_selection = list;
|
|
|
|
list = clist->selection;
|
|
|
|
while (list)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
row = GPOINTER_TO_INT (list->data);
|
|
|
|
list = list->next;
|
|
|
|
if (row < i || row > e)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
clist_row = g_list_nth (clist->row_list, row)->data;
|
|
|
|
if (clist_row->selectable)
|
|
|
|
{
|
|
|
|
clist_row->state = GTK_STATE_SELECTED;
|
|
|
|
gtk_signal_emit (GTK_OBJECT (clist),
|
|
|
|
clist_signals[UNSELECT_ROW],
|
|
|
|
row, -1, event);
|
|
|
|
clist->undo_selection = g_list_prepend
|
|
|
|
(clist->undo_selection, GINT_TO_POINTER (row));
|
|
|
|
}
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
}
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1999-02-02 01:57:11 +00:00
|
|
|
if (clist->anchor < clist->drag_pos)
|
|
|
|
{
|
|
|
|
for (list = g_list_nth (clist->row_list, i); i <= e;
|
|
|
|
i++, list = list->next)
|
|
|
|
if (GTK_CLIST_ROW (list)->selectable)
|
1998-10-19 22:46:38 +00:00
|
|
|
{
|
1999-02-02 01:57:11 +00:00
|
|
|
if (g_list_find (clist->selection, GINT_TO_POINTER(i)))
|
|
|
|
{
|
|
|
|
if (GTK_CLIST_ROW (list)->state == GTK_STATE_NORMAL)
|
|
|
|
{
|
|
|
|
GTK_CLIST_ROW (list)->state = GTK_STATE_SELECTED;
|
|
|
|
gtk_signal_emit (GTK_OBJECT (clist),
|
|
|
|
clist_signals[UNSELECT_ROW],
|
|
|
|
i, -1, event);
|
|
|
|
clist->undo_selection =
|
|
|
|
g_list_prepend (clist->undo_selection,
|
|
|
|
GINT_TO_POINTER (i));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (GTK_CLIST_ROW (list)->state == GTK_STATE_SELECTED)
|
1998-10-19 22:46:38 +00:00
|
|
|
{
|
1999-02-02 01:57:11 +00:00
|
|
|
GTK_CLIST_ROW (list)->state = GTK_STATE_NORMAL;
|
|
|
|
clist->undo_unselection =
|
|
|
|
g_list_prepend (clist->undo_unselection,
|
|
|
|
GINT_TO_POINTER (i));
|
1998-10-19 22:46:38 +00:00
|
|
|
}
|
|
|
|
}
|
1999-02-02 01:57:11 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
for (list = g_list_nth (clist->row_list, e); i <= e;
|
|
|
|
e--, list = list->prev)
|
|
|
|
if (GTK_CLIST_ROW (list)->selectable)
|
1998-10-19 22:46:38 +00:00
|
|
|
{
|
1999-02-02 01:57:11 +00:00
|
|
|
if (g_list_find (clist->selection, GINT_TO_POINTER(e)))
|
|
|
|
{
|
|
|
|
if (GTK_CLIST_ROW (list)->state == GTK_STATE_NORMAL)
|
|
|
|
{
|
|
|
|
GTK_CLIST_ROW (list)->state = GTK_STATE_SELECTED;
|
|
|
|
gtk_signal_emit (GTK_OBJECT (clist),
|
|
|
|
clist_signals[UNSELECT_ROW],
|
|
|
|
e, -1, event);
|
|
|
|
clist->undo_selection =
|
|
|
|
g_list_prepend (clist->undo_selection,
|
|
|
|
GINT_TO_POINTER (e));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (GTK_CLIST_ROW (list)->state == GTK_STATE_SELECTED)
|
|
|
|
{
|
|
|
|
GTK_CLIST_ROW (list)->state = GTK_STATE_NORMAL;
|
|
|
|
clist->undo_unselection =
|
|
|
|
g_list_prepend (clist->undo_unselection,
|
|
|
|
GINT_TO_POINTER (e));
|
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
}
|
1999-02-02 01:57:11 +00:00
|
|
|
}
|
1999-04-30 11:48:42 +00:00
|
|
|
|
|
|
|
clist->undo_unselection = g_list_reverse (clist->undo_unselection);
|
|
|
|
for (list = clist->undo_unselection; list; list = list->next)
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_signal_emit (GTK_OBJECT (clist), clist_signals[SELECT_ROW],
|
|
|
|
GPOINTER_TO_INT (list->data), -1, event);
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist->anchor = -1;
|
|
|
|
clist->drag_pos = -1;
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
gtk_clist_thaw (clist);
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
static void
|
|
|
|
update_extended_selection (GtkCList *clist,
|
|
|
|
gint row)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
gint i;
|
|
|
|
GList *list;
|
|
|
|
GdkRectangle area;
|
|
|
|
gint s1 = -1;
|
|
|
|
gint s2 = -1;
|
|
|
|
gint e1 = -1;
|
|
|
|
gint e2 = -1;
|
|
|
|
gint y1 = clist->clist_window_height;
|
|
|
|
gint y2 = clist->clist_window_height;
|
|
|
|
gint h1 = 0;
|
|
|
|
gint h2 = 0;
|
|
|
|
gint top;
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (clist->selection_mode != GTK_SELECTION_EXTENDED || clist->anchor == -1)
|
|
|
|
return;
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (row < 0)
|
|
|
|
row = 0;
|
|
|
|
if (row >= clist->rows)
|
|
|
|
row = clist->rows - 1;
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* extending downwards */
|
|
|
|
if (row > clist->drag_pos && clist->anchor <= clist->drag_pos)
|
|
|
|
{
|
|
|
|
s2 = clist->drag_pos + 1;
|
|
|
|
e2 = row;
|
|
|
|
}
|
|
|
|
/* extending upwards */
|
|
|
|
else if (row < clist->drag_pos && clist->anchor >= clist->drag_pos)
|
|
|
|
{
|
|
|
|
s2 = row;
|
|
|
|
e2 = clist->drag_pos - 1;
|
|
|
|
}
|
|
|
|
else if (row < clist->drag_pos && clist->anchor < clist->drag_pos)
|
|
|
|
{
|
|
|
|
e1 = clist->drag_pos;
|
|
|
|
/* row and drag_pos on different sides of anchor :
|
|
|
|
take back the selection between anchor and drag_pos,
|
|
|
|
select between anchor and row */
|
|
|
|
if (row < clist->anchor)
|
|
|
|
{
|
|
|
|
s1 = clist->anchor + 1;
|
|
|
|
s2 = row;
|
|
|
|
e2 = clist->anchor - 1;
|
|
|
|
}
|
|
|
|
/* take back the selection between anchor and drag_pos */
|
|
|
|
else
|
|
|
|
s1 = row + 1;
|
|
|
|
}
|
|
|
|
else if (row > clist->drag_pos && clist->anchor > clist->drag_pos)
|
|
|
|
{
|
|
|
|
s1 = clist->drag_pos;
|
|
|
|
/* row and drag_pos on different sides of anchor :
|
|
|
|
take back the selection between anchor and drag_pos,
|
|
|
|
select between anchor and row */
|
|
|
|
if (row > clist->anchor)
|
|
|
|
{
|
|
|
|
e1 = clist->anchor - 1;
|
|
|
|
s2 = clist->anchor + 1;
|
|
|
|
e2 = row;
|
|
|
|
}
|
|
|
|
/* take back the selection between anchor and drag_pos */
|
|
|
|
else
|
|
|
|
e1 = row - 1;
|
|
|
|
}
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist->drag_pos = row;
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
area.x = 0;
|
|
|
|
area.width = clist->clist_window_width;
|
|
|
|
|
|
|
|
/* restore the elements between s1 and e1 */
|
|
|
|
if (s1 >= 0)
|
|
|
|
{
|
|
|
|
for (i = s1, list = g_list_nth (clist->row_list, i); i <= e1;
|
|
|
|
i++, list = list->next)
|
|
|
|
if (GTK_CLIST_ROW (list)->selectable)
|
|
|
|
{
|
|
|
|
if (GTK_CLIST_CLASS_FW (clist)->selection_find (clist, i, list))
|
|
|
|
GTK_CLIST_ROW (list)->state = GTK_STATE_SELECTED;
|
|
|
|
else
|
|
|
|
GTK_CLIST_ROW (list)->state = GTK_STATE_NORMAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
top = ROW_TOP_YPIXEL (clist, clist->focus_row);
|
|
|
|
|
|
|
|
if (top + clist->row_height <= 0)
|
|
|
|
{
|
|
|
|
area.y = 0;
|
|
|
|
area.height = ROW_TOP_YPIXEL (clist, e1) + clist->row_height;
|
|
|
|
draw_rows (clist, &area);
|
|
|
|
gtk_clist_moveto (clist, clist->focus_row, -1, 0, 0);
|
|
|
|
}
|
|
|
|
else if (top >= clist->clist_window_height)
|
|
|
|
{
|
|
|
|
area.y = ROW_TOP_YPIXEL (clist, s1) - 1;
|
|
|
|
area.height = clist->clist_window_height - area.y;
|
|
|
|
draw_rows (clist, &area);
|
|
|
|
gtk_clist_moveto (clist, clist->focus_row, -1, 1, 0);
|
|
|
|
}
|
|
|
|
else if (top < 0)
|
|
|
|
gtk_clist_moveto (clist, clist->focus_row, -1, 0, 0);
|
|
|
|
else if (top + clist->row_height > clist->clist_window_height)
|
|
|
|
gtk_clist_moveto (clist, clist->focus_row, -1, 1, 0);
|
|
|
|
|
|
|
|
y1 = ROW_TOP_YPIXEL (clist, s1) - 1;
|
|
|
|
h1 = (e1 - s1 + 1) * (clist->row_height + CELL_SPACING);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* extend the selection between s2 and e2 */
|
|
|
|
if (s2 >= 0)
|
|
|
|
{
|
|
|
|
for (i = s2, list = g_list_nth (clist->row_list, i); i <= e2;
|
|
|
|
i++, list = list->next)
|
|
|
|
if (GTK_CLIST_ROW (list)->selectable &&
|
|
|
|
GTK_CLIST_ROW (list)->state != clist->anchor_state)
|
|
|
|
GTK_CLIST_ROW (list)->state = clist->anchor_state;
|
|
|
|
|
|
|
|
top = ROW_TOP_YPIXEL (clist, clist->focus_row);
|
|
|
|
|
|
|
|
if (top + clist->row_height <= 0)
|
|
|
|
{
|
|
|
|
area.y = 0;
|
|
|
|
area.height = ROW_TOP_YPIXEL (clist, e2) + clist->row_height;
|
|
|
|
draw_rows (clist, &area);
|
|
|
|
gtk_clist_moveto (clist, clist->focus_row, -1, 0, 0);
|
|
|
|
}
|
|
|
|
else if (top >= clist->clist_window_height)
|
|
|
|
{
|
|
|
|
area.y = ROW_TOP_YPIXEL (clist, s2) - 1;
|
|
|
|
area.height = clist->clist_window_height - area.y;
|
|
|
|
draw_rows (clist, &area);
|
|
|
|
gtk_clist_moveto (clist, clist->focus_row, -1, 1, 0);
|
|
|
|
}
|
|
|
|
else if (top < 0)
|
|
|
|
gtk_clist_moveto (clist, clist->focus_row, -1, 0, 0);
|
|
|
|
else if (top + clist->row_height > clist->clist_window_height)
|
|
|
|
gtk_clist_moveto (clist, clist->focus_row, -1, 1, 0);
|
|
|
|
|
|
|
|
y2 = ROW_TOP_YPIXEL (clist, s2) - 1;
|
|
|
|
h2 = (e2 - s2 + 1) * (clist->row_height + CELL_SPACING);
|
|
|
|
}
|
|
|
|
|
|
|
|
area.y = MAX (0, MIN (y1, y2));
|
|
|
|
if (area.y > clist->clist_window_height)
|
|
|
|
area.y = 0;
|
|
|
|
area.height = MIN (clist->clist_window_height, h1 + h2);
|
|
|
|
if (s1 >= 0 && s2 >= 0)
|
|
|
|
area.height += (clist->row_height + CELL_SPACING);
|
|
|
|
draw_rows (clist, &area);
|
1998-01-24 19:14:42 +00:00
|
|
|
}
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
static void
|
1998-10-19 22:46:38 +00:00
|
|
|
start_selection (GtkCList *clist)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (gdk_pointer_is_grabbed () && GTK_WIDGET_HAS_GRAB (clist))
|
|
|
|
return;
|
1998-07-15 23:40:00 +00:00
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
set_anchor (clist, GTK_CLIST_ADD_MODE(clist), clist->focus_row,
|
1998-10-19 22:46:38 +00:00
|
|
|
clist->focus_row);
|
|
|
|
}
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
static void
|
|
|
|
end_selection (GtkCList *clist)
|
|
|
|
{
|
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if ((gdk_pointer_is_grabbed () && GTK_WIDGET_HAS_FOCUS(clist)) ||
|
1998-10-19 22:46:38 +00:00
|
|
|
clist->anchor == -1)
|
|
|
|
return;
|
|
|
|
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1998-10-19 22:46:38 +00:00
|
|
|
extend_selection (GtkCList *clist,
|
|
|
|
GtkScrollType scroll_type,
|
|
|
|
gfloat position,
|
|
|
|
gboolean auto_start_selection)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if ((gdk_pointer_is_grabbed () && GTK_WIDGET_HAS_GRAB (clist)) ||
|
|
|
|
clist->selection_mode != GTK_SELECTION_EXTENDED)
|
|
|
|
return;
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (auto_start_selection)
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
set_anchor (clist, GTK_CLIST_ADD_MODE(clist), clist->focus_row,
|
1998-10-19 22:46:38 +00:00
|
|
|
clist->focus_row);
|
|
|
|
else if (clist->anchor == -1)
|
|
|
|
return;
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
move_focus_row (clist, scroll_type, position);
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (ROW_TOP_YPIXEL (clist, clist->focus_row) + clist->row_height >
|
|
|
|
clist->clist_window_height)
|
|
|
|
gtk_clist_moveto (clist, clist->focus_row, -1, 1, 0);
|
|
|
|
else if (ROW_TOP_YPIXEL (clist, clist->focus_row) < 0)
|
|
|
|
gtk_clist_moveto (clist, clist->focus_row, -1, 0, 0);
|
|
|
|
|
|
|
|
update_extended_selection (clist, clist->focus_row);
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
static void
|
|
|
|
sync_selection (GtkCList *clist,
|
|
|
|
gint row,
|
|
|
|
gint mode)
|
1998-01-24 19:14:42 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GList *list;
|
|
|
|
gint d;
|
1998-07-29 21:46:39 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (mode == SYNC_INSERT)
|
|
|
|
d = 1;
|
|
|
|
else
|
|
|
|
d = -1;
|
Few fixes for column resize. Store resize column in clist->drag_pos.
Fri Jul 31 20:45:07 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_button_press) (gtk_clist_motion)
(gtk_clist_button_release) (new_column_width): Few fixes for
column resize. Store resize column in clist->drag_pos.
Thu Jul 31 15:18:36 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.h
* gtk/gtkctree.c
* gtk/testgtk.c : New typedef GtkCTreeNode, changed all GList *node
to GtkCTreeNode *node.
* gtk/gtklist.h : added extended selection mode and auto scrolling.
(struct _GtkList): removed unneeded variables timer, button,
selection_start_pos, selection_end_pos, scroll_direction, have_grab.
Added new variables undo_selection, undo_unselection, last_focus_child,
undo_focus_child, htimer, vtimer, anchor, drag_pos, anchor_state,
drag_selection, add_mode.
New functions :
(gtk_list_extend_selection), (gtk_list_start_selection),
(gtk_list_end_selection), (gtk_list_select_all),
(gtk_list_unselect_all), (gtk_list_scroll_horizontal),
(gtk_list_scroll_vertical), (gtk_list_toggle_add_mode),
(gtk_list_toggle_focus_row), (gtk_list_toggle_row),
(gtk_list_undo_selection), (gtk_list_end_drag_selection)
* gtk/gtklist.c :
(gtk_list_enter_notify): removed, because auto scrolling now works
with gtk_list_motion_notify
New functions, needed for auto scrolling :
(gtk_list_motion_notify) (gtk_list_move_focus_child)
New functions for extended selection support :
(gtk_list_set_anchor), (gtk_list_fake_unselect_all),
(gtk_list_fake_toggle_row), (gtk_list_update_extended_selection),
(gtk_list_focus_lost)
(gtk_list_set_focus_child): modified gtk_container_set_focus_child
function to support auto scrolling, and avoid out-of-sync errors in
case auf GTK_SELECTION_BROWSE
(gtk_list_focus): modified gtk_container_focus function to avoid out
off sync errors in case auf GTK_SELECTION_EXTENDED
* gtk/gtklistitem.h
* gtk/gtklistitem.c :
New signal functions for key binding support :
(toggle_focus_row), (select_all), (list_item), (unselect_all)
(list_item), (undo_selection), (start_selection), (end_selection)
(extend_selection), (scroll_horizontal), (scroll_vertical),
(toggle_add_mode)
(gtk_list_item_realize): added GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK
(gtk_list_item_draw_focus): modify gc if parent has add_mode set.
* gtk/gtkcombo.c :
(gtk_combo_popup_button_press): grab pointer for combo->list
(gtk_combo_button_release): ungrab only if combo->popwin HAS_GRAB
(gtk_combo_list_key_press): take care of which child HAS_GRAB
(gtk_comb_init): don't connect combo->button with button_release_event
1998-07-31 20:48:06 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (clist->focus_row >= row)
|
|
|
|
{
|
1998-11-04 01:28:07 +00:00
|
|
|
if (d > 0 || clist->focus_row > row)
|
|
|
|
clist->focus_row += d;
|
1998-10-19 22:46:38 +00:00
|
|
|
if (clist->focus_row == -1 && clist->rows >= 1)
|
|
|
|
clist->focus_row = 0;
|
1998-11-04 01:28:07 +00:00
|
|
|
else if (clist->focus_row >= clist->rows)
|
|
|
|
clist->focus_row = clist->rows - 1;
|
1998-10-19 22:46:38 +00:00
|
|
|
}
|
1998-01-26 00:07:40 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (clist->selection_mode == GTK_SELECTION_BROWSE && clist->anchor != -1)
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
|
1998-10-07 00:03:24 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
g_list_free (clist->undo_selection);
|
|
|
|
g_list_free (clist->undo_unselection);
|
|
|
|
clist->undo_selection = NULL;
|
|
|
|
clist->undo_unselection = NULL;
|
1998-01-26 00:07:40 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist->anchor = -1;
|
|
|
|
clist->drag_pos = -1;
|
|
|
|
clist->undo_anchor = clist->focus_row;
|
1998-07-29 21:46:39 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
list = clist->selection;
|
1998-11-04 01:28:07 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
while (list)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
if (GPOINTER_TO_INT (list->data) >= row)
|
|
|
|
list->data = ((gchar*) list->data) + d;
|
|
|
|
list = list->next;
|
1998-07-29 21:46:39 +00:00
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
}
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* GTKOBJECT
|
|
|
|
* gtk_clist_destroy
|
|
|
|
* gtk_clist_finalize
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
gtk_clist_destroy (GtkObject *object)
|
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
GtkCList *clist;
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_if_fail (object != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (object));
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist = GTK_CLIST (object);
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* freeze the list */
|
1998-11-28 01:56:09 +00:00
|
|
|
clist->freeze_count++;
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* get rid of all the rows */
|
|
|
|
gtk_clist_clear (clist);
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* Since we don't have a _remove method, unparent the children
|
|
|
|
* instead of destroying them so the focus will be unset properly.
|
|
|
|
* (For other containers, the _remove method takes care of the
|
|
|
|
* unparent) The destroy will happen when the refcount drops
|
|
|
|
* to zero.
|
|
|
|
*/
|
1998-07-29 21:46:39 +00:00
|
|
|
|
1998-11-05 15:44:22 +00:00
|
|
|
/* unref adjustments */
|
|
|
|
if (clist->hadjustment)
|
1998-07-29 21:46:39 +00:00
|
|
|
{
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
gtk_signal_disconnect_by_data (GTK_OBJECT (clist->hadjustment), clist);
|
1998-11-05 15:44:22 +00:00
|
|
|
gtk_object_unref (GTK_OBJECT (clist->hadjustment));
|
|
|
|
clist->hadjustment = NULL;
|
1998-10-19 22:46:38 +00:00
|
|
|
}
|
1998-11-05 15:44:22 +00:00
|
|
|
if (clist->vadjustment)
|
1998-10-19 22:46:38 +00:00
|
|
|
{
|
added args ::show_text, ::text_xalign, ::text_yalign, ::activity_mode.
Sun Nov 22 16:21:28 1998 Tim Janik <timj@gtk.org>
* gtk/gtkprogress.c: added args ::show_text, ::text_xalign,
::text_yalign, ::activity_mode.
* gtk/gtkprogressbar.c: added construct arg ::adjustment. added args
::bar_style, ::orientation, ::discrete_blocks, ::activity_step,
::activity_blocks.
(gtk_progress_bar_new):
(gtk_progress_bar_new_with_adjustment): use gtk_widget_new().
(gtk_progress_bar_construct): deprecated.
* gtk/gtkvscrollbar.c:
(gtk_vscrollbar_draw_step_back):
(gtk_vscrollbar_draw_step_forw): use "vscrollbar" as detail for
gtk_paint_arrow, to be consistent with hscrollbar.
* gtk/gtktext.c
added construct args ::hadjustment, ::vadjustment.
added args ::line_wrap, ::word_wrap.
(gtk_text_class_init): added scroll_adjustments signal.
(gtk_text_new): use gtk_widget_new.
(gtk_text_disconnect): remove adjustement with gtk_text_set_adjustments,
so we don't screw the reference counts and don't leave signals connected.
(gtk_text_destroy): disconnect adjustments signals.
(gtk_text_finalize): unref adjustments.
* gtk/gtkctree.c: added construct args ::n_columns and ::tree_column.
added args ::indent, ::spacing, ::show_stub, ::reorderable,
::use_drag_icons, ::line_style and ::expander_style.
(gtk_ctree_set_show_stub): renamed from gtk_ctree_show_stub, which is
deprecated now.
* gtk/gtkclist.h: remove GTK_CLIST_CONSTRUCT flag.
* gtk/gtkclist.c:
removed ::vadjustment and ::hadjustment args, introduced
::scroll_adjustments signal.
added ::shadow_type, ::selection_mode and ::row_height args.
added n_columns construct arg.
(gtk_clist_construct): call gtk_object_constructed().
(gtk_clist_set_row_height): if height is passed as 0,
revert to automatic height calculation.
(gtk_clist_destroy): before unrefing the adjustments, disconnect our
signal handlers.
Fri Nov 21 22:34:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_new): call gtk_object_default_construct
like gtk_object_new.
(gtk_widget_destroy): assert that we only destroy constructed widgets.
* gtk/gtkobject.h (enum GtkArgFlags): new flag GTK_ARG_CONSTRUCT_ONLY
to identify args that may only be used for construction.
GTK_ARG_CONSTRUCT maybe used as normal arguments besides construction
time.
* gtk/gtkobject.c (gtk_object_new): invoke gtk_object_default_construct
at the end if the object is not fully constructed.
(gtk_object_newv): likewise.
(gtk_object_destroy): assert that we only destroy constructed objects.
(gtk_object_init): setup GTK_CONSTRUCTED from the
objects real klass.
(gtk_object_default_construct): new function to complete default
construction of an object by applying missing construtor args with
default values of 0, 0.0 or NULL.
(gtk_object_constructed): new function to mark an object as being
constructed (used from within constructors).
* gtk/gtkarg.c (gtk_arg_type_new_static): return the args info pointer
so it is immediatedly available for the caller.
* gtk/gtktypeutils.c (gtk_type_new): pass an object's real class to
the object initilizer (GtkObjectInitFunc takes a second arg now, the
real klass), and asure that object initializers may temporarily alter
the class pointer.
Fri Nov 20 08:00:30 1998 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: change all occourances of gtk_container_add (
scrolled_window, widget) to gtk_scrolled_window_add_with_viewport (...)
for widget!=(clist, ctree, text, viewport).
* gtk/gtkcombo.c:
(gtk_combo_init): use gtk_scrolled_window_add_with_viewport()
to add children to the scrolled window.
* gtk/gtkscrolledwindow.h:
* gtk/gtkscrolledwindow.c:
changed scrolled_window->viewport to scrolled_window->child, and use
gtk_widget_scroll_adjustements() to set the scroll adjustments for the
widget, we do not create an additional viewport anymore.
added ::hadjustment and ::vadjustment constructor args.
(gtk_scrolled_window_new): use gtk_widget_new() to create the widget.
(gtk_scrolled_window_set_hadjustment):
(gtk_scrolled_window_set_vadjustment): new functions that superceed
gtk_scrolled_window_construct.
(gtk_scrolled_window_construct): deprecated this function.
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
support a constructor arg "::adjustment", and use gtk_widget_new() for
the widget creation.
* gtk/gtkrange.c: added ::update_policy arg.
(gtk_range_set_adjustment): if adjustment is passed in as NULL, create
a default adjustment so this function can be used for derived widgets
that depend on the adjustment's existance.
(gtk_range_destroy): disconnect the adjustment signal, so we don't
get called after we got destroyed, we don't destroy the adjustment
in here, because it might have been provided from another widget.
* gtk/gtkviewport.c: introduced ::scroll_adjustments signal.
(gtk_viewport_destroy): same as gtk_range_destroy.
* gtk/gtkprogress.c (gtk_progress_destroy): same as gtk_range_destroy.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: changed gtk_widget_activate() to return a
gboolean, indicating whether this widget supports activation.
added gtk_widget_scroll_adjustements() to set the scrolling
adjustments of a widget.
Wed Nov 19 01:22:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c:
(gtk_option_menu_remove_contents):
(gtk_option_menu_update_contents): removed
gtk_container_[un]block_resize() pairs.
* gtk/gtknotebook.h:
* gtk/gtknotebook.c: removed the tab_border field, since it shouldn't
be used outside of gtknotebook.c anyways. made ARG_TAB_BORDER a
wrtie-only argument.
* *.c: made deprecated functions issue a message:
gtk_clist_set_border, gtk_container_block_resize,
gtk_container_unblock_resize, gtk_container_need_resize,
gtk_object_class_add_user_signal, gtk_spin_button_construct,
gtk_scrolled_window_construct.
removed non-functional functions:
gtk_container_disable_resize, gtk_container_enable_resize,
gtk_clist_set_policy.
Wed Nov 18 22:54:36 1998 Tim Janik <timj@gtk.org>
* gtk/gtkbox.c (gtk_box_init):
* gtk/gtkdrawingarea.c (gtk_drawing_area_init):
* gtk/gtkeventbox.c (gtk_event_box_init):
* gtk/gtkfixed.c (gtk_fixed_init):
* gtk/gtkframe.c (gtk_frame_init):
* gtk/gtkhandlebox.c (gtk_handle_box_init):
* gtk/gtkpacker.c (gtk_packer_init):
* gtk/gtkmisc.c (gtk_misc_init):
* gtk/gtkpreview.c (gtk_preview_init):
* gtk/gtkprogress.c (gtk_progress_init):
* gtk/gtkprogressbar.c (gtk_progress_bar_init):
* gtk/gtkseparator.c (gtk_separator_init):
* gtk/gtktable.c (gtk_table_init):
* gtk/gtkviewport.c (gtk_viewport_init):
* gtk/gtkalignment.c (gtk_alignment_init):
removed setting of the GTK_BASIC flag.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
removed GTK_BASIC, GTK_WIDGET_BASIC and gtk_widget_basic.
* miscellaneous GtkType and macro fixups.
1998-11-23 01:54:45 +00:00
|
|
|
gtk_signal_disconnect_by_data (GTK_OBJECT (clist->vadjustment), clist);
|
1998-11-05 15:44:22 +00:00
|
|
|
gtk_object_unref (GTK_OBJECT (clist->vadjustment));
|
|
|
|
clist->vadjustment = NULL;
|
1998-10-19 22:46:38 +00:00
|
|
|
}
|
1998-07-29 21:46:39 +00:00
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
remove_grab (clist);
|
1998-07-30 10:52:35 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* destroy the column buttons */
|
|
|
|
for (i = 0; i < clist->columns; i++)
|
|
|
|
if (clist->column[i].button)
|
|
|
|
{
|
|
|
|
gtk_widget_unparent (clist->column[i].button);
|
|
|
|
clist->column[i].button = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (GTK_OBJECT_CLASS (parent_class)->destroy)
|
|
|
|
(*GTK_OBJECT_CLASS (parent_class)->destroy) (object);
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_clist_finalize (GtkObject *object)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-01-24 19:14:42 +00:00
|
|
|
GtkCList *clist;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_if_fail (object != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (object));
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist = GTK_CLIST (object);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
columns_delete (clist);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
g_mem_chunk_destroy (clist->cell_mem_chunk);
|
|
|
|
g_mem_chunk_destroy (clist->row_mem_chunk);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (GTK_OBJECT_CLASS (parent_class)->finalize)
|
|
|
|
(*GTK_OBJECT_CLASS (parent_class)->finalize) (object);
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* GTKWIDGET
|
|
|
|
* gtk_clist_realize
|
|
|
|
* gtk_clist_unrealize
|
|
|
|
* gtk_clist_map
|
|
|
|
* gtk_clist_unmap
|
|
|
|
* gtk_clist_draw
|
|
|
|
* gtk_clist_expose
|
|
|
|
* gtk_clist_style_set
|
|
|
|
* gtk_clist_key_press
|
|
|
|
* gtk_clist_button_press
|
|
|
|
* gtk_clist_button_release
|
|
|
|
* gtk_clist_motion
|
|
|
|
* gtk_clist_size_request
|
|
|
|
* gtk_clist_size_allocate
|
|
|
|
*/
|
1998-01-24 19:14:42 +00:00
|
|
|
static void
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_clist_realize (GtkWidget *widget)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-01-24 19:14:42 +00:00
|
|
|
GtkCList *clist;
|
1998-10-19 22:46:38 +00:00
|
|
|
GdkWindowAttr attributes;
|
|
|
|
GdkGCValues values;
|
|
|
|
GtkCListRow *clist_row;
|
|
|
|
GList *list;
|
|
|
|
gint attributes_mask;
|
1998-10-07 00:03:24 +00:00
|
|
|
gint border_width;
|
1998-10-19 22:46:38 +00:00
|
|
|
gint i;
|
|
|
|
gint j;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-01-24 19:14:42 +00:00
|
|
|
g_return_if_fail (widget != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (widget));
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-01-24 19:14:42 +00:00
|
|
|
clist = GTK_CLIST (widget);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
border_width = GTK_CONTAINER (widget)->border_width;
|
1998-04-03 23:17:16 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
attributes.window_type = GDK_WINDOW_CHILD;
|
|
|
|
attributes.x = widget->allocation.x + border_width;
|
|
|
|
attributes.y = widget->allocation.y + border_width;
|
|
|
|
attributes.width = widget->allocation.width - border_width * 2;
|
|
|
|
attributes.height = widget->allocation.height - border_width * 2;
|
|
|
|
attributes.wclass = GDK_INPUT_OUTPUT;
|
|
|
|
attributes.visual = gtk_widget_get_visual (widget);
|
|
|
|
attributes.colormap = gtk_widget_get_colormap (widget);
|
|
|
|
attributes.event_mask = gtk_widget_get_events (widget);
|
|
|
|
attributes.event_mask |= (GDK_EXPOSURE_MASK |
|
|
|
|
GDK_BUTTON_PRESS_MASK |
|
|
|
|
GDK_BUTTON_RELEASE_MASK |
|
|
|
|
GDK_KEY_PRESS_MASK |
|
|
|
|
GDK_KEY_RELEASE_MASK);
|
|
|
|
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
|
|
|
|
|
|
|
|
/* main window */
|
|
|
|
widget->window = gdk_window_new (gtk_widget_get_parent_window (widget),
|
|
|
|
&attributes, attributes_mask);
|
|
|
|
gdk_window_set_user_data (widget->window, clist);
|
|
|
|
|
|
|
|
widget->style = gtk_style_attach (widget->style, widget->window);
|
|
|
|
|
|
|
|
gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
|
|
|
|
|
|
|
|
/* column-title window */
|
|
|
|
|
|
|
|
attributes.x = clist->column_title_area.x;
|
|
|
|
attributes.y = clist->column_title_area.y;
|
|
|
|
attributes.width = clist->column_title_area.width;
|
|
|
|
attributes.height = clist->column_title_area.height;
|
1998-04-03 23:17:16 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist->title_window = gdk_window_new (widget->window, &attributes,
|
|
|
|
attributes_mask);
|
|
|
|
gdk_window_set_user_data (clist->title_window, clist);
|
|
|
|
|
|
|
|
gtk_style_set_background (widget->style, clist->title_window,
|
1998-11-07 15:45:27 +00:00
|
|
|
GTK_STATE_NORMAL);
|
1998-10-19 22:46:38 +00:00
|
|
|
gdk_window_show (clist->title_window);
|
|
|
|
|
|
|
|
/* set things up so column buttons are drawn in title window */
|
|
|
|
for (i = 0; i < clist->columns; i++)
|
|
|
|
if (clist->column[i].button)
|
|
|
|
gtk_widget_set_parent_window (clist->column[i].button,
|
|
|
|
clist->title_window);
|
|
|
|
|
|
|
|
/* clist-window */
|
|
|
|
attributes.x = (clist->internal_allocation.x +
|
|
|
|
widget->style->klass->xthickness);
|
|
|
|
attributes.y = (clist->internal_allocation.y +
|
|
|
|
widget->style->klass->ythickness +
|
|
|
|
clist->column_title_area.height);
|
|
|
|
attributes.width = clist->clist_window_width;
|
|
|
|
attributes.height = clist->clist_window_height;
|
1998-04-03 23:17:16 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist->clist_window = gdk_window_new (widget->window, &attributes,
|
|
|
|
attributes_mask);
|
|
|
|
gdk_window_set_user_data (clist->clist_window, clist);
|
|
|
|
|
|
|
|
gdk_window_set_background (clist->clist_window,
|
1998-12-16 00:52:46 +00:00
|
|
|
&widget->style->base[GTK_STATE_NORMAL]);
|
1998-10-19 22:46:38 +00:00
|
|
|
gdk_window_show (clist->clist_window);
|
|
|
|
gdk_window_get_size (clist->clist_window, &clist->clist_window_width,
|
|
|
|
&clist->clist_window_height);
|
|
|
|
|
|
|
|
/* create resize windows */
|
|
|
|
attributes.wclass = GDK_INPUT_ONLY;
|
|
|
|
attributes.event_mask = (GDK_BUTTON_PRESS_MASK |
|
|
|
|
GDK_BUTTON_RELEASE_MASK |
|
|
|
|
GDK_POINTER_MOTION_MASK |
|
|
|
|
GDK_POINTER_MOTION_HINT_MASK |
|
|
|
|
GDK_KEY_PRESS_MASK);
|
|
|
|
attributes_mask = GDK_WA_CURSOR;
|
|
|
|
attributes.cursor = gdk_cursor_new (GDK_SB_H_DOUBLE_ARROW);
|
|
|
|
clist->cursor_drag = attributes.cursor;
|
|
|
|
|
|
|
|
attributes.x = LIST_WIDTH (clist) + 1;
|
|
|
|
attributes.y = 0;
|
|
|
|
attributes.width = 0;
|
|
|
|
attributes.height = 0;
|
|
|
|
|
|
|
|
for (i = 0; i < clist->columns; i++)
|
1998-04-03 23:17:16 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
clist->column[i].window = gdk_window_new (clist->title_window,
|
|
|
|
&attributes, attributes_mask);
|
|
|
|
gdk_window_set_user_data (clist->column[i].window, clist);
|
1998-04-03 23:17:16 +00:00
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
|
|
|
|
/* This is slightly less efficient than creating them with the
|
|
|
|
* right size to begin with, but easier
|
|
|
|
*/
|
1998-08-10 17:56:43 +00:00
|
|
|
size_allocate_title_buttons (clist);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* GCs */
|
|
|
|
clist->fg_gc = gdk_gc_new (widget->window);
|
|
|
|
clist->bg_gc = gdk_gc_new (widget->window);
|
1998-04-03 23:17:16 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* We'll use this gc to do scrolling as well */
|
|
|
|
gdk_gc_set_exposures (clist->fg_gc, TRUE);
|
|
|
|
|
Adapt cast macros to standard.
Fri Nov 19 10:34:41 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkgamma.h: Adapt cast macros to standard.
[ Merges from 1.2 ]
Tue Nov 16 10:15:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_path):
If translation does not include a '/', use entire
translation instead of crashing.
Sun Oct 31 22:21:11 1999 Tim Janik <timj@gtk.org>
* docs/gtk_tut.sgml:
s/gtk_accel_group_attach/gtk_window_add_accel_group/.
Sat Oct 30 09:09:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_target_list_remove): Use
g_list_remove_link, not g_list_remove.
[ From Geert Bevin <gbevin@thunderstorms.org> ]
Sun Oct 24 07:41:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkclist.c (real_undo_selection): commented out g_print()
statement upon unselection (how the heck did that slip in?).
Sat Oct 23 03:03:08 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_freeze):
(gtk_text_thaw): undraw/draw cursor here to avoid unnecessary scrolling
in frozen state (and aparently crashes). patch provided by Anders
Melchiorsen <and@kampsax.dtu.dk>.
Sat Oct 23 02:53:20 1999 Tim Janik <timj@gtk.org>
* fix insensitive default/focus widget activation,
reported by Matt Goodall <mgg@isotek.co.uk>.
* gtk/gtkwindow.c (gtk_window_key_press_event):
(gtk_window_activate_default):
(gtk_window_activate_focus):
return handled=FALSE for actiavtion of insensitive default
widgets. return handled=TRUE for activation of insensitive
focus widgets. don't activate in either case.
Tue Oct 19 09:55:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk-config.in (lib_gtk): Switch order of @x_cflags@
and $glib_cflags to match library order and in the
theory that an old version of GLib is more likely to
be in the include directory for X then vice-versa.
(Bug #2776)
Tue Oct 19 09:46:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always use LC_CTYPE
to determine the locale for fontsets, not LC_MESSAGES;
the user may want English messages with a handling
for non-English languages. (LC_CTYPE=ru_RU LC_MESSAGES=fr_FR
will still be broken) (Bug #2891)
Tue Oct 19 20:36:42 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Fixed the wrong number of "*"'s.
Tue Oct 19 12:15:13 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Changed the Korean default fontset.
Fri Oct 8 02:32:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): Fix bug
where when scrolling to the left or top double exposes
were done, causing major slowdowns.
Thu Oct 7 18:31:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always normalize codeset
names to lowercase and alphanumeric, before looking
them up.
* gtk/Makefile.am: Install codeset variant gtkrc files
with normalized names.
Thu Oct 7 22:52:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_popup_with_data): even
popup menus when the menu is already visible, but its parent
is still hidden, (happens after tornoff window got hidden).
Thu Oct 7 11:09:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (install-data-local): Fix
a typo where gtkrc.vi_VN.tcvn5712 wasn't getting
deleted, causing error messages on install.
Thu Oct 7 11:03:06 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtk[hv]paned.c (gtk_{h,v}paned_draw): Redraw
the handle as well, since we now sometimes ignore
exposes on the handle while resizing.
Wed Oct 6 18:02:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_append_default_pixmap_path): Fix stupid
extra g_free introduced in one of the last one or two
commits.
Wed Oct 6 16:38:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc*: Make naming of gtkrc files
consistent, put each style that a gtkrc.* file creates
in a unique namespace, remove old files before installing.
Wed Oct 6 14:31:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Avoid leaking memory when
gtk_rc_init is called multiple times. (Yes, people who
do that have bugs in their code.)
Tue Oct 5 11:36:57 PDT 1999 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: listing gtkrc in gtkconf_DATA seems to barf.
Remove it since it's generated by the Makefile anyway
Tue Oct 5 02:43:41 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputcommon.h (gdk_input_device_new): Free
device->info.axes for core pointer.
Thu Sep 30 13:55:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (destroy_idle_test): Rename idle to
idle_id, to deal with obsolete, broken C libraries.
Mon Sep 27 02:50:15 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkvscale.c (gtk_vscale_draw): Don't add in
allocation->x/y twice!
* gtk/gtkhscale.c: Make usage of gtk_hscale_pos_trough()
consistent with gtk_vscale_pos_trough().
Sun Sep 26 19:44:34 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_queue_resize): We may
be queueing a resize on a toplevel container between
the time we show it and when we map it. So, we need
to test GTK_WIDGET_VISIBLE() for toplevels, and only
use GTK_WIDGET_DRAWABLE() for child windows.
Thu Sep 23 16:41:03 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDADDS): Add GDK_WLIBS to LDADDS
(fixes bug #2144)
Fri Sep 24 00:51:45 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c (gtk_container_queue_resize): check for
container DRAWABLE (instead of VISIBLE), so we don't queue
resizes on non-toplevel containers.
Sun Sep 19 18:13:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.[ch]: Make the data argument
const guchar *.
Sat Sep 18 21:27:40 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: Try to behave sensibly if
the focus widget is the window itself. (Should
we allow this at all?)
Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_set_sensitive):
* gtk/gtknotebook.c (gtk_notebook_set_scrollable):
* gtk/gtknotebook.c (gtk_notebook_set_show_border):
* gtk/gtkclist.c (gtk_notebook_set_show_border): make gboolean args
in prototypes and implementations consistent (Tomas Ogren).
* gtk/gtklayout.c (gtk_layout_remove): unset GTK_IS_OFFSCREEN flag
before the widget is unparented (reported by damon).
* gtk/gtkdnd.c: make the cursor and icon data _unsigned_ char,
since we provide unsigned data anyways.
Thu Sep 16 21:32:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_set_tip): Delay
the call to gtk_tooltips_layout_text() until later.
* gtk/gtktooltips.c (gtk_tooltips_draw_tips):
Call gtk_widget_ensure_style() before using the style.
Wed Sep 15 02:52:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_event): Added workaround
for old widgets that don't propagate draws to all
children. (Namely gnome-dock for gnome-libs <= 1.0.16)
Tue Sep 14 19:22:19 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_queue_resize): don't queue the parent
for a redraw but just the widget that requested the resize.
Tue Sep 14 18:29:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c: added new widget level method
gtk_container_set_reallocate_redraws() and a GtkContainer flag
reallocate_redraws : 1 to reflect the setting, exported this through
the argument system as a boolean ::reallocate_redraws.
* gtk/gtkwidget.c (gtk_widget_size_allocate): when queueing redraws
on the widget because the allocation changes, do so as well for
widget->parent if the parent has reallocate_redraws set to TRUE.
with that containers requesting reallocation redraws get automatically
redrawn if their children changed allocation (this unfortunately
affects also other children that didn't change allocation, but we
cannot work around that before 1.3).
Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_idle_draw): only emit ::draw if width
_and_ height are >0 (not _or_).
* gtk/gtktable.c (gtk_table_remove): use gtk_widget_queue_resize()
instead of gtk_container_queue_resize(), which is a core gtk internal
function (must have been on crack when i queued that).
* gtk/gtkprivate.h: added new private flag GTK_FULLDRAW_PENDING, so
we can check more reliably if we want to discard expose events.
* gtk/gtkwidget.c: added setting/unsetting of the GTK_FULLDRAW_PENDING
flag.
* gtk/gtkwidget.c (gtk_widget_event): don't discard synthesized exposes,
we simply trust these events. for deciding whether to discard exposes,
check GTK_FULLDRAW_PENDING instead of RESIZE_PENDING.
Mon Sep 13 15:01:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore
queues of areas that are completely off screen.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fix broken
logic for handleboxes.
* gtk/gtkwidget.c (gtk_widget_queue_draw_data): Add santity
check on width/height.
Mon Sep 13 02:22:47 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: backed out Raja's recent VPATH build "improvements",
we are fine with using $@ the way we do (if we actually encounter
brokeness with $@ in VPATH builds because of additional path prefixes,
we need to use $(@F) actually).
Mon Sep 13 01:34:53 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c: renamed two variables, hopefully didn't introduce
short lived bugs, that would allow language bindings to do surgeries
to our guts.
Fri Sep 10 15:22:50 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_size_allocate): Fix typo
where comparison was being done against an uninitialized
value causing intermittant results depending on
compiler flags. Also make it clearer that we aren't
ever initializing the child as 0x0 (though this will
be caught in gtk_widget_size_allocate())
Fri Sep 10 10:06:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_transient_for): Move
gtk_window_unset_transient_for() call after we do checks
involving the old transient parent.
[ From Lance Capser <lmc@cyberhighway.net> ]
1999-09-07 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gtk.defs): Go back to using `touch' to create
an empty file.
Mon Sep 6 00:11:56 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (gtk_ctree_is_ancestor): return FALSE if node has
no children. (Reported by: Chris Rogers <gandalf@pobox.com>)
1999-09-03 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gen_sources): Improve VPATH builds.
`$@' is valid only in the build dir, not after we've done
`cd $srcdir'. Also use `test -f' instead of less portable
`test -e'.
Fri Sep 3 15:59:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (correct_cache_insert): Rewrite
for simplicity, and hopefully correctness.
(Fixes bug #1322, which was a segfault when
on some insertions with the properties around
the insertion set up just wrong.)
* gtk/gtktext.c (gtk_text_adjustment): When we receive
a "changed" signal, clamp the new value to the adjustment
bounds to avoid segfaulting if someone tries to change
the adjustment to a bogus value. (Bug #1795)
Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c: Ignore unexpected destroy notifies
for children, for toplevel windows handle them
like delete_event.
* gtk/gtkplug.c: Add an unrealize handler so that
we unref plug->socket_window when we are done
with it.
Fri Sep 3 14:52:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_area): Fix stupid signedness
problem that was causing background to sometimes
be misaligned.
Fri Sep 3 12:26:33 1999 Owen Taylor <otaylor@redhat.com>
[ Fixes pointed out by Ettore Perazzoli <ettore@comm2000.it> ]
* gtk/gtkmenu.c (gtk_menu_position): Make
sure we never position menus with negative x, y,
since gtk_widget_set_uposition() can't handle that.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu):
Modify the positioning code a bit so that we always
put the top-left corner onscreen. (This is for
UI reasons, gtk_menu_position() now takes care of
gtk_widet_set_uposition() brokeness.)
Fri Sep 3 03:06:30 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: fixed up things for -jx, x > 1.
Sun Sep 5 08:48:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_style): Ref the
RC style that is passed in. The lack of the ref
before was a bug. If people worked around this
bug, this will introduce a slight memory leak
in their code. The code should typically look like:
rc_style = gtk_rc_style_new ();
[...]
gtk_widget_modify_style (widget, rc_style);
gtk_rc_style_unref (rc_style);
* gtk/gtkwidget.c (gtk_widget_modify_style): Reset
the style if it was already set.
* gtk/gtkwidget.c (gtk_widget_set_name): Only set the
style if it was set before.
Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (main): Add a check to see if we
are being run from the correct directory and
to quit nicely if we are not.
* gtk/gtkrc.c (gtk_rc_slist_remove_all): Make function
static.
Thu Sep 2 23:00:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkenums.h (GtkWindowPosition): added GTK_WIN_POS_CENTER_ALWAYS.
* gtk/gtkwindow.c:
queue resizes unconditionally (gtk_widget_queue_resize will figure
what to do if the window is not realized).
(gtk_window_move_resize): only recenter the window
for GTK_WIN_POS_CENTER_ALWAYS.
(gtk_window_compute_reposition): handle GTK_WIN_POS_CENTER_ALWAYS in
the same way as GTK_WIN_POS_CENTER.
Thu Sep 2 22:39:27 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_reposition): check for the last position
with (!(info->last_flags & GDK_HINT_POS)) instead of
(!info->last_flags & GDK_HINT_POS).
* gtk/gtkwindow.c (gtk_window_move_resize): constrain new_width and
new_height unconditionally, because we use these values even if
!default_size_changed && !hints_changed.
comented the (default_size_changed || hints_changed) case with
respect to resize rejects from the window manager.
* gtk/gtkwindow.c (gtk_window_move_resize): save info->last values
in the zvt condition hack, since this includes the window hints, set
the hints after the handling_resize case.
* gtk/gtkwindow.c (gtk_window_show): constrain the default size that a
window is initially shown with to the geometry.
Thu Sep 2 07:38:56 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize):
s/size_changed/default_size_changed/g so i know what's
really going on (frying brain on smaller flame now).
Thu Sep 2 05:47:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): queue a new resize if
we have size_changed upon handling_resize. this is a gross
workaround for the broken zvt widget and should be removed in
1.3 again (search for FIXME).
Owen provided an accurate comment for this:
/* We could be here for two reasons
* 1) We coincidentally got a resize while handling
* another resize.
* 2) Our computation of size_changed was completely
* screwed up, probably because one of our children
* is broken. It's probably a zvt widget.
*
* For 1), we could just go ahead and ask for the
* new size right now, but doing that for 2)
* might well be fighting the user (and can even
* trigger a loop). Since we really don't want to
* do that, we requeue a resize in hopes that
* by the time it gets handled, the child has seen
* the light and is willing to go along with the
* new size. (this happens for the zvt widget, since
* the size_allocate() above will have stored the
* requisition corresponding to the new size in the
* zvt widget)
*
* This doesn't buy us anything for 1), but it shouldn't
* hurt us too badly, since it is what would have
* happened if we had gotten the configure event before
* the new size had been set.
*/
Wed Sep 1 20:46:11 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: deal properly with the fact that RC
style lists may include rc styles more than once.
* gtk/gtkrc.c (gtk_rc_append_pixmap_path): Removed
unused static function.
* gtk/gtkrc.c (gtk_rc_find_pixmap_in_path): Keep a
stack of directories of RC files currently being
parsed and implicitely add them to pixmap path.
This fixes a bug where the directory would get
appended then overwritten by pixmap_path declarations.
(bug #1462, from Peter Wainright <prw@wainpr.demon.co.uk>)
* gtk/gtkthemes.c (gtk_theme_engine_unref): Call
theme's exit function. (Patch from Peter Wainwright,
bug #1454)
* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_destroy):
Add a destroy() handler to take care of removing
group for menu item. (Fixes bug #1197)
* gtk/gtkwidget.c (gtk_widget_size_request): Fixed thinko
in warning message.
Wed Sep 1 21:27:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): don't require a server
roundtrip to figure window's width and height, since we know that
anyways from widget->allocation.
Wed Sep 1 12:37:44 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Compute
the hints after we request the new size.
Wed Sep 1 10:38:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_compute_hints): Removed
GTK_WIDGET_REALIZED() assertion - we can compute the
hints before we are realized.
* gtk/gtkwindow.c (gtk_window_move_resize): Reorder
hint changing so that we have a value of hints_changed
when we decide whether to constrain the window size.
* gtk/gtkwindow.c (gtk_window_move_resize): Spelling fix.
* gtk/gtkwindow.c (gtk_window_constrain_size): cleanups,
change back to G_MAXINT.
Wed Sep 1 06:54:59 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_get_geometry_info): zero initialize
new GtkWindowGeometryInfo, so fields like GdkGeometry geometry
contain uncluttered values.
(gtk_window_compute_hints): simply assert that window is realized
and that geometry_info is valid, since we rely on this anyways.
(gtk_window_constrain_size): major cleanups to the code.
if (flags & GDK_HINT_BASE_SIZE) use geometry's base width and height
for the base size, instead of the minimums. use 32767 as max width
and height (like in gtkwindow.c) instead of G_MAXINT.
Wed Sep 1 04:41:25 1999 Tim Janik <timj@gtk.org>
* cleaned up the GtkContainer.need_resize flag handling mess, we
only need to force resize requests when we were prematurely
realized, or our widget tree was modified when we were temporarily
hidden. handling these cases directly upon showing the window (i.e.
while the GdkWindow is still unmapped) avoids the need to wait for
a configure event response and therefore makes the GUI more snappier
and avoids blank windows during the roundtrip.
* gtk/gtkwidget.c:
(gtk_widget_hide):
(gtk_widget_show): don't queue resizes on toplevels, they know how
to deal with matters.
* gtk/gtkcontainer.c (gtk_container_queue_resize): set the ->need_resize
flag directly for not visible resize containers and spare us unecessary
signal emissions.
* gtk/gtkwindow.c:
(gtk_window_realize): if we need to enforce premature size allocation,
queue a container resize so we are correctly resized later on.
(gtk_window_init):
(gtk_window_size_request):
don't freak around with the ->need_resize flag,
gtk_container_queue_resize() will care about that.
(gtk_window_show):
handle initial resizing issues here, we can handle matters better in
this place, especially since we know that our GdkWindow is still
unmapped.
(gtk_window_move_resize):
don't care about ->need_resize at all.
handle size changes properly that occoured while we waited for a
configure event.
Tue Aug 31 15:58:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_uposition):
* gtk/gtkwindow.[hc] (gtk_window_reposition):
Move the hint setting code from gtk_widget_set_uposition
to here; set the hints so that we respect any previously
set geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Don't
change the window hints here or move the window here,
let that happen in gtk_window_move_resize().
Tue Aug 31 06:58:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): when discarding exposes due
to already queued resizes (and therefore redraws) on a widget, check
its anchestry as well.
* gtk/gtkcontainer.c:
(gtk_container_queue_resize): clear resize widgets for resize
containers before aborting prematurely. this is especially important
for toplevels which may need imemdiate processing or their resize
handler to be queued.
(gtk_container_dequeue_resize_handler): added new internal function for
gtkwindow.c.
* gtk/gtkwindow.c (gtk_window_move_resize): if we are resizing due to a
configure event, take possible changes in window position into account
as well.
if we request a new window size, queue up a resize handler that will
last until the configure event response arrives.
combined the ->need_resize case (initial show) with the general size
(hints) changed case and added even more comments.
if !auto_shrink, only revert to the old allocation if the new size
is smaller than the current allocation.
Tue Aug 31 11:55:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_arg, gtk_window_set_policy,
gtk_window_set_geometry_hints
gtk_window_set_default_size):
When hints are set, queue a resize so that the hints will
be eventually reset on the toplevel.
* gtk/gtkwindow.c (gtk_window_show): Use
gtk_window_compute_default_size(). Clear the need_resize flag
on the initail map so that we don't unnecessarily trigger the
resize code.
* gtk/gtkwindow.c (gtk_window_move_resize): Split apart
into separate functions. Compare the hints we are setting
with what we set last time so that we can accurately
tell when we need to reset the hints.
* gtk/gtkwindow.c (gtk_window_compute_default_size): New
function to figure out the size from requisition
and default_size.
* gtk/gtkwindow.c (gtk_window_constrain_size): Function
from fvwm to constrain a size to the geometry hints.
* gtk/gtkwindow.c (gtk_window_compare_hints): New function
to compare two sets of geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_hints): Renamed
from gtk_window_set_hints(), just compute the hints,
don't set them.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Move
code from gtk_window_move_resize() to separate function,
rationalize a bit.
Tue Aug 31 13:05:03 1999 Owen Taylor <otaylor@redhat.com>
* gtkrc.h: Move the ref_count member out of the GtkRcStyle
structure into a new private structure.
* gtkrc.c: Split GtkRcStyle into public/private.
In the private part, add a list of pointers to the
RcStyle lists this RcStyle participates in.
* gtkrc.c: When a RcStyle is free, remove all
lists referencing it from the
realized_style_ht hash, and free those lists.
* gtk/gtkrc.c (gtk_rc_clear_styles): Don't call
gtk_rc_init(), since that adds the default styles
to the list of parsed RC files again.
* gtk/gtkrc.c: Use gtk_rc_style_find() consistently.
Thu Aug 26 14:14:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): reactivated the sanity
checks that ensure that a widget's allocation is at least 1 in width
and height. (GNOME note: this doesn't affect old panel code anymore,
because GtkSocket will request width and height of at least 1 since
Fri Jul 23).
* gtk/gtkwindow.c (gtk_window_realize): if the widget hasn't been
allocated yet (happens if the user realizes the window prematurely),
size request and allocate it.
(gtk_window_size_allocate): guard against guint underflows.
Wed Aug 25 19:01:36 1999 Lars Hamann <lars@gtk.org>
* gtk/Makefile.am (gtk_built_sources): reordered stamp-gtk.defs
in gtk_built_sources, so gtk.defs gets built prior to all other
sources.
Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am:
invoke indent on gtkmarshal.*.
rewrote source generation rules, use COPYING as oldest source tag for
a piggyback rule to generate all sources from (don't touch it ;).
major cleanups, strip spaces on build rules for GNU Make.
* gtk/genmarshal.pl: don't operate on hardcoded filenames but take
source and target files from commandline arguments. don't invoke indent.
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Wed Aug 18 09:20:10 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c:
we use window->need_resize from configure_event now, to indicate that
the gtkwindow should keep its allocation (e.g. because the user resized
the window through window manager handles). resize_count is now reliably
used to figure whether we got the allocation we requested from the
window manager.
configure events get queued as resizes now, the real stuff (size
computation and allocation) now only goes on in gtk_window_move_resize().
GtkWindow's requisition now contains its *real* requisition (like all
other widgets), *not* taking usize into account.
geometry_info->last_{width|height} is now updated from set_hints() only
so it always contains the last hints we set for the window manager.
made some event handlers return TRUE instead of FALSE.
the overall code should be much more straight forward now, and the
significant code portions are accompanied by comments now.
(gtk_window_set_hints):
removed requisition argument and made it
fetch the requisition through gtk_widget_get_child_requisition.
we also don't move the gdkwindow here anymore, gtk_window_move_resize()
does that now.
(gtk_window_show):
ensure that the widget is realized before calling
gtk_container_check_resize() (and thus gtk_window_move_resize()), also
ensure that we got properly size requested and allocated before
realization.
(gtk_window_configure_event):
ignore plain window moves, or reallocate the widget tree through the
resize queue otherwise.
(gtk_window_move_resize):
mostly rewrote this function to figure window manager hints more
reliably, coalesce window moves and resizes to reduce configure events
and do actuall size allocations.
Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): discard expose events for widgets
that have a resize pending, because a redraw is already queued for them.
* gtk/gtkcontainer.c: removed ugly connect_to ::size_allocate signal
hack to clear resize_widgets.
* gtk/gtkwidget.c (gtk_widget_size_allocate): call clear_resize_widgets
for resize containers prior to size allocation. (this is also a bit
ugly, but avoids side effects for stopped emissions and is thus more
reliable).
(gtk_widget_unparent): removed disconnect call for clear_resize_widgets.
* gtk/gtktooltips.c (gtk_tooltips_paint_window): renamed this
function from gtk_tooltips_expose, as we connect to ::expose_event
*and* ::draw now.
1999-08-18 Federico Mena Quintero <federico@redhat.com>
* gtk/gtkselection.c (gtk_target_list_ref): Added missing sanity
checks.
(gtk_target_list_unref): Likewise.
* gtk/gtkthemes.c (gtk_theme_engine_unref): Likewise.
Tue Aug 17 15:47:07 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_draw_value_bar):
guard against division by zero. (Fixes bug #1339)
Tue Aug 17 10:56:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_move_{forward,backward}_word):
Prevent the trivial leak of information of allowing
word motion when the entry is not visible.
Tue Aug 17 10:28:52 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_fileop_error): Propagate
modality to error dialog as well as confirmation dialogs.
(Bug #1803, reported by Rosanna Wing Sze Yuen)
Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktreeitem.c (gtk_tree_item_draw_lines): Honor
tree->view_lines.
(gtk-guy-990611-3.patch: Guy Harris <guy@netapp.com>)
* gtk/Makefile.am (install-data-local): Solaris apparently
has various troubles with ln -f; use rm first instead.
(gtk-guy-990611-2.patch: Guy Harris <guy@netapp.com>)
1999-07-30 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (stamp-m): Don't `mv' from builddir to srcdir,
use `cp' followed by `rm' (the `rm' was already there).
July 30, 1999 Elliot Lee <sopwith@redhat.com>
* configure.in: Fix autoconf warnings about cross compilation by
trying to provide sane defaults for AC_TRY_RUN.
* gtk/Makefile.am: If we refer to gtkmarshal.[ch] in $(srcdir),
put them into $(srcdir) when generated. Also add a dependency of
gtksignal.h on gtkmarshal.h for -j builds.
* gtk/gtk(dnd,style,gamma).c: Minor warning fixes.
Wed Jul 28 09:29:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration_do): Added missing
GDK_THREADS_{LEAVE,ENTER} pair.
(From Paul Fisher <pnfisher@redhat.com>)
Fri Jul 23 01:00:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtksocket.c (gtk_socket_size_request): asure that the requested
width and height are always >0 (owen).
Fri Jul 23 00:00:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): backed out my recent
change that assured that a widget's allocated with and height are
always >1, since this breaks *buggy* panel code. unfortunately this
back-breaks the gimp's color selector.
* gtk/gtkdrawingarea.c (gtk_drawing_area_size_allocate): asure that our
allocation is always >0 in width and height, before sending the
configure event; this is a *gross* hack to get the gimp back to work.
* marked both cases with TODO-1.3
Wed Jul 21 15:47:39 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Don't display wrap indicators when
text is not editable and word wrap is on.
Wed Jul 21 08:21:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): special case
option menus here as they are not derived from menu shell, assure that
the option menu has a menu we can add items to.
Tue Jul 20 23:29:48 1999 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_page_allocate): convert allocation->
width/height to (gint) before calculations and check against < 0 to
avoid guint wraparounds.
Sun Jul 18 00:35:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): ensure that the allocated
width and height is never zero. sanity check both dimensions against
32767 and issue a warning if the allocation is greater than that.
Wed Jul 7 15:03:30 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_events_pending): Unlock around call
to g_main_pending() as well.
Wed Jul 7 14:59:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration): Unlock around
call to g_main_iteration() - since that will regrab
GTK+ lock to process events.
Thu Jul 1 15:01:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c
- Regularize with the rest of GTK+ by making widget->requisition
not reflect the set_usize()
- Always recompute geometry hints, then check if they
changed before sending them to the X server. The
previous checks for changes would fail in a number
of circumstances.
Thu Jul 1 11:55:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Include <stdlib.h> for strcmp().
Wed Jun 30 19:26:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c:
- Code cleanups
- Instantaneously update on modifier key presses
- Allow cancellation of the drag with Escape.
Tue Jun 29 17:04:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_handle_box): Set the policy
to auto_shrink - otherwise the appearance is rather
strange when flipping between horizontal and vertical.
Mon Jun 28 09:29:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: add ::default_width and ::default_height arguments.
(gtk_window_set_default_size): don't change a value if it's < 0.
queue a resize.
Sun Jun 27 11:00:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_insert): don't segfault on NULL inserts.
Mon Jun 28 12:08:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (cmpl_completion_fullname): Don't
add an extra "/" when concating "/" + filename.
(From Matt Grossman <mattg@oz.net>)
Mon Jun 28 10:57:12 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (draw_cell_pixmap): Reset clip mask
for fg_gc if we set it for drawing pixmap.
Tue Jun 15 12:45:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes from Peter Wainwright <prw@wainpr.demon.co.uk>
* gtk/gtkrc.c (gtk_rc_parse_engine): If rc_style->engine is
already set, call old engine's destroy function and
unref the old engine.
Thu Jun 10 17:59:38 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.c (gtk_drawing_area_size): queue a resize.
Wed Jun 9 15:13:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h: mark certain functions as internal.
Wed Jun 9 13:48:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpreview.c (gtk_preview_set_expand): queue a resize if the
expand behaviour changed.
* gtk/gtklabel.c (gtk_label_set_pattern):
(gtk_label_set_justify):
(gtk_label_set_line_wrap):
don't bother invoking queue_clear, the reallocation does
that for us, always free_words so the upcoming resize will
relayout the label's contents.
Wed Jun 9 12:50:48 1999 Tim Janik <timj@gtk.org>
* applied argument implementation patches from Elena Devdariani
<elena@cogent.ca>.
* gtk/gtktoolbar.c: ::orientation, ::toolbar_style, ::space_size,
::space_style, ::relief
* gtk/gtkruler.c: ::lower, ::upper, ::position, ::max_size
* gtk/gtkpreview.c: ::expand
* gtk/gtkpaned.c: ::handle_size, ::gutter_size
* gtk/gtknotebook.c: ::homogeneous
* gtk/gtklabel.c: ::wrap
* gtk/gtklist.c: ::selection_mode
* gtk/gtkhandlebox.c: ::handle_position, ::snap_edge
* gtk/gtkcurve.c: ::curve_type, ::min_x, ::max_x, ::min_y, ::max_y
* gtk/gtkcolorsel.c: ::update_policy, ::use_opacity
* gtk/gtkclist.c: ::sort_type
* gtk/gtkcheckmenuitem.c: ::active, ::show_toggle
* gtk/gtkaspectframe.c: ::xalign, ::yalign, ::ratio, ::obey_child
Tue Jun 1 23:38:38 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Removed ill-thought-out part of last
comment.
Tue Jun 1 23:30:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_attach): Get the reference
counting right when we have to attach a new style
for a different visual. (Chi-Deok Hwang <cdhwang@sr.hei.co.kr>)
* gtk/gtkstyle.c: Documented the refcounting
peculularities of gtk_style_attach.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkwindow.c (gtk_window_new): added return if fail for invalid
window types.
* examples/packer/pack.c (main): use GTK_WINDOW_TOPLEVEL instead
of GTK_TOPLEVEL for creating the window.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkmain.c (gtk_init_check): don't segfault when --gtk-module is
the last argument (reported by Per Winkvist).
Tue May 25 13:13:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes for invisible XOR lines (Frank Loemker
<floemker@TechFak.Uni-Bielefeld.DE>)
* gtk/gtkclist.c (gtk_clist_realize): Always use
a non-zero pixel for GDK_XOR.
* gtk/gtkvpaned.c gtk/gtkhpaned.c:
Use GDK_INVERT instead of GDK_XOR.
Wed May 12 21:56:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (adjust_adjustments): signal emit value_changed
signals if h/voffsets differ from adjustment values.
Reportet by Jerome Bolliet <bolliet@in2p3.fr>
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
the user data on the window before destroying it.
* gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
unrealize handler to take care of destroying
notebook->panel properly.
(Bug #1198 - Morten Welinder <terra@diku.dk>)
* gtk/gtktext.c (expand_scratch_buffer): Fix reversal
of g_new and g_realloc to stop memory leak. (Actually,
we could just use g_realloc(), but I'm not 100% sure
that is portable).
(Bug #1196 - Morten Welinder <terra@diku.dk>)
Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.h: Removed stray GtkPlugButton declaration.
* gdk/gdkfont.c (gdk_text_measure): Fix the return value
for fontsets.
* gtk/gtkbutton.c (gtkbutton_expose): Fix warning
with bin/button confusion.
Thu May 6 04:53:26 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: in the ItemFactory test, link radio items together,
and show how preselection of radio items is done.
Sun May 2 13:31:14 1999 Tim Janik <timj@gtk.org>
* gtk/gtktreeitem.c (gtk_tree_item_set_subtree):
* gtk/gtktree.c (gtk_tree_add) (gtk_tree_insert):
* gtk/gtktoolbar.c (gtk_toolbar_insert_element):
* gtk/gtkpaned.c (gtk_paned_pack2) (gtk_paned_pack1):
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_add):
* gtk/gtktable.c (gtk_table_attach):
* gtk/gtklist.c (gtk_list_insert_items):
* gtk/gtkmenushell.c (gtk_menu_shell_insert):
* gtk/gtknotebook.c (gtk_notebook_insert_page_menu):
* gtk/gtkpacker.c (gtk_packer_add_defaults) (gtk_packer_add):
* gtk/gtkbin.c (gtk_bin_add):
* gtk/gtkbox.c (gtk_box_pack_start) (gtk_box_pack_end):
* gtk/gtkfixed.c (gtk_fixed_put):
* gtk/gtklayout.c (gtk_layout_put):
general fixups to container_add logic. always realize child if
child->parent is realized, only map the child and queue a resize
if child and child->parent are both visible.
Fri Apr 30 09:02:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_unrealize): use gtk_container_forall
instead of gtk_container_foreach to walk and unrealize children, so
composite children get also unrealized.
(gtk_widget_real_show): don't call gtk_widget_map() if we don't need to.
(gtk_widget_map): assert that the widget is visible (basic constrain).
(gtk_widget_real_map): assert that the widget is realized (basic
constrain).
Fri Apr 29 00:53:20 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbindings.c (gtk_pattern_spec_init): plugged a memory leak.
Tue May 4 09:32:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc.iso-8859-2: Add a gtkrc
file for iso-8859-2 locales.
* configure.in (ALL_LINGUAS): ALL_LINGUAS update.
Tue Apr 27 16:38:32 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Fix typo of static_sources for static_SOURCES.
(Pointed out by andy@rz.uni-karlsruhe.de and others).
Remove some suspicious and useless lines.
Tue May 4 08:44:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c (gtk_clist_draw, draw_rows): Use
width,height = 0, 0 to mean - here to edge of window,
instead of -1, -1, since the former is all we support.
Tue May 4 08:34:43 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main): Correctly free list nodes
when removing from quit_functions list.
Tue Apr 27 14:17:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpacker.c (gtk_packer_size_request): remove unused variable.
Tue Apr 27 18:23:35 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable):
When redrawing characters on non-visible entry, use appropriate
'*' character. (Bug #1130 - Jean-Marc Jacquet <jm@littleigloo.org>)
Tue Apr 27 01:31:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (drag_dest_cell): compute destination cell
from drag coordinates.
(gtk_clist_drag_data_received) (gtk_clist_drag_motion):
use drag_dest_cell.
* gtk/gtktree (drag_dest_cell)
(gtk_ctree_drag_data_received) (gtk_ctree_drag_motion): likewise.
(Bug #1129)
Wed Apr 21 21:26:11 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_init): properly initialize
translate_* fields.
(gtk_item_factory_finalize): invoke translate_notify independant from
translate_data.
(gtk_item_factory_set_translate_func): likewise.
(gtk_item_factory_destroy): only remove ifactory pointer from those
widgets that belong to us (stupid me).
Mon Apr 19 12:05:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Fixed leak of
rc_style list when lookup succeeeds.
Thu Apr 15 01:11:24 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (resync_selection):
* gtk/gtkclist.c (resync_selection): fixed undo_selection bug.
* gtk/gtkclist.c (gtk_clist_button_release): fixed resync_selection
bug.
Fri Apr 9 19:22:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c gtk/gtkdnd.c gtk/gtkmenuitem.c:
Add some missing GDK_THREADS_ENTER()/LEAVE around
timeouts. (Patches from Sebastian Wilhelmi <wilhelmi@ira.uka.de>)
Thu Apr 8 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkentry.c (gtk_entry_key_press): use gtk_widget_activate()
rather than emit_by_name.
* gtk/gtkeditable.c (gtk_editable_insert_text): keep a reference
on the widget across multiple signal emissions.
(gtk_editable_delete_text): same here.
(gtk_editable_class_init): set widget_class->activate_signal after
editable_signals[ACTIVATE] has been created.
Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
position here prematurely -- we might not have the
right ->min_position and ->max_position yet.
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
Add error traps so if the other end of the connection
dies, we survive.
* gtk/gtkselection.c (gtk_selection_notify): Clean
up properly when selection property retrieval fails.
* gtk/gtkselection.c (gtk_selection_request): Correctly
reject SelectionRequest notifies where the handler
returns no data.
Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_dest_leave): Only unhighlight
when we've previously highlighted.
* gtk/gtkdnd.c (gtk_drag_dest_handle_event): Don't
emit two "drag_leave" signals for Motif drops.
* gtk/gtkdnd.c (gtk_drag_source_handle_event): Send
back the correct status messages when dropping from
Motif onto a proxy window that is rejecting the
drop.
Sat Mar 27 23:32:13 1999 Tim Janik <timj@gtk.org>
* gtk/gtkarg.[hc]: added functions from GLE, gtk_arg_reset() to free
the value and reset type to GTK_TYPE_INVALID, and gtk_arg_values_equal()
to compare two argument values. added gtk_arg_to_valueloc() to set a
variable from an arg through its location (pointer).
* gtk/gtkobject.[hc]: implemented gtk_object_get() in terms of
gtk_object_arg_get() and gtk_arg_to_valueloc(), floats are collected
as gfloat*, uchars are collected as guchar*, ints are collected as
gint*, etc...
Mon Mar 29 17:45:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccelgroup.c gtk/gtkgtkbindings.c:
Include <string.h> instead of <strings.h>.
* gtk/gtkstyle.c: Fix double include of gtkthemes.h
(actually, a lot more duplicate includes occur if
you trace through the sequence of #include's)
gtk-jbb-990320-0: John Bley, jbb6@acpub.duke.edu
Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com>
Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp>
gtk-a-higuti-990322-[0-3]
* configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS
that was causing -DX_LOCALE not to work.
* gtk/gtkrc.c (gtk_rc_init):
X_LOCALE will never have LC_MESSAGES defined
Thu Mar 25 12:38:31 1999 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_append_default_module_path): get $HOME from
g_get_home_dir() (gtk-pmc-990123-0.patch.gz).
* gtk/gtkwindow.c (gtk_window_key_press_event): feature keypad up/down/
left/right as well (gtk-michael-980726-0.patch.gz).
* gtk/gtklabel.[hc]: bunch of miscellaneous cleanups, such as s/0/NULL/
for pointer values, use gchar instead of char. fixed uline allocation
leaks, changed the allocation pattern so we use G_ALLOC_AND_FREE mem
chunks instead of G_ALLOC_ONLY.
(gtk_label_size_request): always alter requisition as passed and leave
widget->requisition alone.
(gtk_label_set_text): allow NULL strings.
(gtk_label_new): likewise.
Wed Mar 24 09:24:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.[hc]: type/macro fixups.
Mon Mar 22 05:51:34 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbin.c (gtk_bin_draw): only redraw children that are visible
*and* mapped (i.e. drawable).
(gtk_bin_expose): only send exposes to drawable children.
* gtk/gtkbox.c (gtk_box_draw): only redraw children that are drawable.
(gtk_box_expose): only send exposes to drawable children.
* gtk/gtkhscale.c (gtk_hscale_draw):
* gtk/gtkvscale.c (gtk_vscale_draw):
hm, this is an ugly one. we first compute the size of our trough area
here (window relative) and then check intersection with the draw_area
which is parent relative because we're a NO_WINDOW widget, so we need
to offset the trough area by allocation.x and allocation.y before the
check. (this must not be done for the background area though, since
that's already computed parent relative).
Mon Mar 22 00:41:39 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_unrealize): unmap clist if neccessary,
unrealize title buttons.
Fri Mar 19 00:00:22 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_column_title_passive)
(gtk_clist_column_title_active):
only connect/disconnect to GtkWidgetClass::event to block mouse events.
* gtk/gtkclist.c (vertical_timeout) (horizontal_timeout):
zero initialize event, removed superfluous gdk_window_get_pointer call
* gtk/gtklist.c (gtk_list_vertical_timeout)
(gtk_list_horizontal_timeout): removed superfluous
gdk_window_get_pointer call
Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org>
* plugging problems reported by "Bruce Mitchener, Jr."
<bruce@puremagic.com> due to a purify session.
* gtk/gtkstyle.c:
(gtk_style_ref):
(gtk_style_unref): assert ref_count to be > 0.
* gtk/gtkclist.c (gtk_clist_set_cell_style): { 0 } initilaize
the requisition.
(gtk_clist_set_shift): likewise.
* gtk/gtklayout.c: introduce gtk_layout_finalize() to unref the
adjustments.
* gtk/gtklist.c (gtk_list_horizontal_timeout): zero initialize the
event before sending it and set send_event to TRUE (which needs to
be done for *all* synthesized events).
(gtk_list_vertical_timeout): likewise.
* gtk/gtktipsquery.c (gtk_tips_query_destroy): plug small memory
leaks.
* gtk/gtkdrawingarea.c (gtk_drawing_area_send_configure): set send_event
to TRUE when synthesizing events.
[ *** end of merges from 1.2 *** ]
1999-11-22 21:52:50 +00:00
|
|
|
values.foreground = (widget->style->white.pixel==0 ?
|
|
|
|
widget->style->black:widget->style->white);
|
1998-10-19 22:46:38 +00:00
|
|
|
values.function = GDK_XOR;
|
|
|
|
values.subwindow_mode = GDK_INCLUDE_INFERIORS;
|
|
|
|
clist->xor_gc = gdk_gc_new_with_values (widget->window,
|
|
|
|
&values,
|
|
|
|
GDK_GC_FOREGROUND |
|
|
|
|
GDK_GC_FUNCTION |
|
|
|
|
GDK_GC_SUBWINDOW);
|
|
|
|
|
|
|
|
/* attach optional row/cell styles, allocate foreground/background colors */
|
|
|
|
list = clist->row_list;
|
|
|
|
for (i = 0; i < clist->rows; i++)
|
1998-04-03 23:17:16 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
clist_row = list->data;
|
|
|
|
list = list->next;
|
|
|
|
|
|
|
|
if (clist_row->style)
|
|
|
|
clist_row->style = gtk_style_attach (clist_row->style,
|
|
|
|
clist->clist_window);
|
|
|
|
|
|
|
|
if (clist_row->fg_set || clist_row->bg_set)
|
|
|
|
{
|
|
|
|
GdkColormap *colormap;
|
|
|
|
|
|
|
|
colormap = gtk_widget_get_colormap (widget);
|
|
|
|
if (clist_row->fg_set)
|
|
|
|
gdk_color_alloc (colormap, &clist_row->foreground);
|
|
|
|
if (clist_row->bg_set)
|
|
|
|
gdk_color_alloc (colormap, &clist_row->background);
|
|
|
|
}
|
1998-04-03 23:17:16 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
for (j = 0; j < clist->columns; j++)
|
|
|
|
if (clist_row->cell[j].style)
|
|
|
|
clist_row->cell[j].style =
|
|
|
|
gtk_style_attach (clist_row->cell[j].style, clist->clist_window);
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_clist_unrealize (GtkWidget *widget)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
gint i;
|
1998-01-24 19:14:42 +00:00
|
|
|
GtkCList *clist;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_if_fail (widget != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (widget));
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist = GTK_CLIST (widget);
|
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
/* freeze the list */
|
|
|
|
clist->freeze_count++;
|
1998-10-19 22:46:38 +00:00
|
|
|
|
1999-04-30 11:48:42 +00:00
|
|
|
if (GTK_WIDGET_MAPPED (widget))
|
|
|
|
gtk_clist_unmap (widget);
|
1998-10-19 22:46:38 +00:00
|
|
|
|
1999-04-30 11:48:42 +00:00
|
|
|
GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED);
|
|
|
|
|
|
|
|
/* detach optional row/cell styles */
|
1998-10-19 22:46:38 +00:00
|
|
|
if (GTK_WIDGET_REALIZED (widget))
|
GTK_MENU_DIR_CHILD: check for the existance of
Thu Sep 3 04:22:20 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current):
GTK_MENU_DIR_CHILD: check for the existance of
menu_shell->active_menu_item before accessing its child.
GTK_MENU_DIR_PREV:
GTK_MENU_DIR_NEXT: if we haven't had an active item and still
don't, make a default selection.
Wed Sep 2 00:28:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_propagate_state): iterate
the children with _forall for sensitivity changes and with
_foreach on pure state changes. this fixes a lot of the
old inclusions of internal widgets into _foreach calls.
* gtk/gtktree.c: removed gtk_tree_foreach, let gtk_tree_forall
do the work. don't walk the subtrees of first level children.
* gtk/gtktreeitem.c: provide a _forall implementation,
which walks the subtrees as well for include_internals.
* gtk/gtkmenuitem.c: provide a _forall implementation, which walks
the submenus as well for include_internals.
* gtk/gtkscrolledwindow.c: removed gtk_scrolled_window_foreach and
implemented gtk_scrolled_window_forall, which will iterate over
the viewport and the scrollbars for gtk_container_forall or
iterate over the viewports children for gtk_container_foreach.
* gtk/gtktoolbar.c:
* gtk/gtktable.c:
* gtk/gtkpaned.c:
* gtk/gtkpacker.c:
* gtk/gtkmenushell.c:
* gtk/gtklist.c:
* gtk/gtkfixed.c:
* gtk/gtkclist.c:
* gtk/gtkbox.c:
* gtk/gtkbin.c:
* gtk/gtknotebook.c:
removed the old gtk_*_foreach functions and provided gtk_*_forall.
* gtk/gtknotebook.c:
(gtk_notebook_real_switch_page): expose tabs.
(gtk_notebook_page_num): new function to return the page number
of a distinct child.
(gtk_notebook_focus): minor fixups. foxus handling is still screwed
under some circumstances.
* gtk/gtktreeitem.c:
(gtk_real_tree_item_select):
(gtk_real_tree_item_deselect): major fixes.
some general fixups wrt queue_redraw, and tree items not being
NO_WINDOW widgets.
* gtk/gtklistitem.c:
(gtk_real_list_item_select):
(gtk_real_list_item_deselect):
(gtk_real_list_item_toggle):
removed unneccessary queue_redraw calls.
Wed Aug 30 09:42:07 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c: allow optionmenus to have the focus and
automatically popup the menu on space bar.
Wed Aug 26 06:40:34 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: implemented gtk_container_forall() (as a class
method), which acts similar to gtk_container_foreach(), but iterates
over internal children. the GtkContainer::foreach signal vanished in
favour of a new class method ->forall() that optionally includes
internal widgets.
* gtk/gtkclist.c (gtk_clist_init): provide no _foreach implementation
but a _forall implementation, since all child widgets we have are
internal ones.
(column_button_create): set the parent window prior
to gtk_widget_set_parent().
* gtk/gtkwidget.c:
exchanged all calls to gtk_container_foreach() with
gtk_container_forall().
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: added the GTK_COMPOSITE_CHILD, exported through
the GtkWidget::composite_child argument. to have a widget created
with the flag initially, two new functions got added to wrap a widgets
creation:
gtk_widget_push_composite_flag() and gtk_widget_pop_composite_flag().
Wed Aug 25 23:37:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktooltips.h:
* gtk/gtktooltips.c: exported gtk_tooltips_create_window() as
gtk_tooltips_force_window(), so tooltips->tip_window can be accessed
prior to the first tip being set.
don't put an extra reference on the window, since it is a toplevel,
it wont get destroyed from anywhere else.
* overall macro and GtkType fixups.
1998-09-03 02:38:53 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GtkCListRow *clist_row;
|
|
|
|
GList *list;
|
|
|
|
gint j;
|
1998-10-16 15:00:05 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
list = clist->row_list;
|
|
|
|
for (i = 0; i < clist->rows; i++)
|
1998-10-16 15:00:05 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
clist_row = list->data;
|
|
|
|
list = list->next;
|
|
|
|
|
|
|
|
if (clist_row->style)
|
|
|
|
gtk_style_detach (clist_row->style);
|
|
|
|
for (j = 0; j < clist->columns; j++)
|
|
|
|
if (clist_row->cell[j].style)
|
|
|
|
gtk_style_detach (clist_row->cell[j].style);
|
1998-10-16 15:00:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
gdk_cursor_destroy (clist->cursor_drag);
|
|
|
|
gdk_gc_destroy (clist->xor_gc);
|
|
|
|
gdk_gc_destroy (clist->fg_gc);
|
|
|
|
gdk_gc_destroy (clist->bg_gc);
|
1998-10-16 15:00:05 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
for (i = 0; i < clist->columns; i++)
|
1999-04-30 11:48:42 +00:00
|
|
|
{
|
|
|
|
if (clist->column[i].button)
|
|
|
|
gtk_widget_unrealize (clist->column[i].button);
|
|
|
|
if (clist->column[i].window)
|
|
|
|
{
|
|
|
|
gdk_window_set_user_data (clist->column[i].window, NULL);
|
|
|
|
gdk_window_destroy (clist->column[i].window);
|
|
|
|
clist->column[i].window = NULL;
|
|
|
|
}
|
|
|
|
}
|
1998-10-16 15:00:05 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
gdk_window_set_user_data (clist->clist_window, NULL);
|
|
|
|
gdk_window_destroy (clist->clist_window);
|
|
|
|
clist->clist_window = NULL;
|
1998-10-16 15:00:05 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
gdk_window_set_user_data (clist->title_window, NULL);
|
|
|
|
gdk_window_destroy (clist->title_window);
|
|
|
|
clist->title_window = NULL;
|
1998-10-16 15:00:05 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist->cursor_drag = NULL;
|
|
|
|
clist->xor_gc = NULL;
|
|
|
|
clist->fg_gc = NULL;
|
|
|
|
clist->bg_gc = NULL;
|
1998-10-16 15:00:05 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (GTK_WIDGET_CLASS (parent_class)->unrealize)
|
|
|
|
(* GTK_WIDGET_CLASS (parent_class)->unrealize) (widget);
|
1998-10-16 15:00:05 +00:00
|
|
|
}
|
|
|
|
|
1998-01-03 03:31:03 +00:00
|
|
|
static void
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_clist_map (GtkWidget *widget)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-10-16 15:00:05 +00:00
|
|
|
gint i;
|
1998-10-19 22:46:38 +00:00
|
|
|
GtkCList *clist;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_if_fail (widget != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (widget));
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist = GTK_CLIST (widget);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (!GTK_WIDGET_MAPPED (widget))
|
|
|
|
{
|
|
|
|
GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* map column buttons */
|
|
|
|
for (i = 0; i < clist->columns; i++)
|
1999-04-30 11:48:42 +00:00
|
|
|
{
|
|
|
|
if (clist->column[i].button &&
|
|
|
|
GTK_WIDGET_VISIBLE (clist->column[i].button) &&
|
|
|
|
!GTK_WIDGET_MAPPED (clist->column[i].button))
|
|
|
|
gtk_widget_map (clist->column[i].button);
|
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
|
|
|
|
for (i = 0; i < clist->columns; i++)
|
|
|
|
if (clist->column[i].window && clist->column[i].button)
|
1999-01-17 23:44:18 +00:00
|
|
|
{
|
|
|
|
gdk_window_raise (clist->column[i].window);
|
|
|
|
gdk_window_show (clist->column[i].window);
|
|
|
|
}
|
|
|
|
|
1999-01-15 16:00:39 +00:00
|
|
|
gdk_window_show (clist->title_window);
|
|
|
|
gdk_window_show (clist->clist_window);
|
|
|
|
gdk_window_show (widget->window);
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* unfreeze the list */
|
1998-11-28 01:56:09 +00:00
|
|
|
clist->freeze_count = 0;
|
1998-01-24 19:14:42 +00:00
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
}
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
static void
|
|
|
|
gtk_clist_unmap (GtkWidget *widget)
|
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
GtkCList *clist;
|
1998-01-19 09:59:20 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_if_fail (widget != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (widget));
|
1998-01-19 09:59:20 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist = GTK_CLIST (widget);
|
1998-01-19 09:59:20 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (GTK_WIDGET_MAPPED (widget))
|
1998-01-24 19:14:42 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED);
|
1998-01-19 09:59:20 +00:00
|
|
|
|
1999-01-18 23:02:08 +00:00
|
|
|
if (gdk_pointer_is_grabbed () && GTK_WIDGET_HAS_GRAB (clist))
|
|
|
|
{
|
|
|
|
remove_grab (clist);
|
|
|
|
|
|
|
|
if (clist->anchor != -1 &&
|
|
|
|
clist->selection_mode == GTK_SELECTION_EXTENDED)
|
|
|
|
GTK_CLIST_CLASS_FW (widget)->resync_selection (clist, NULL);
|
|
|
|
|
|
|
|
clist->click_cell.row = -1;
|
|
|
|
clist->click_cell.column = -1;
|
|
|
|
clist->drag_button = 0;
|
1999-01-23 01:04:33 +00:00
|
|
|
|
|
|
|
if (GTK_CLIST_IN_DRAG(clist))
|
|
|
|
{
|
|
|
|
gpointer drag_data;
|
|
|
|
|
|
|
|
GTK_CLIST_UNSET_FLAG (clist, CLIST_IN_DRAG);
|
|
|
|
drag_data = gtk_object_get_data (GTK_OBJECT (clist),
|
|
|
|
"gtk-site-data");
|
|
|
|
if (drag_data)
|
|
|
|
gtk_signal_handler_unblock_by_data (GTK_OBJECT (clist),
|
|
|
|
drag_data);
|
|
|
|
}
|
1999-01-18 23:02:08 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
for (i = 0; i < clist->columns; i++)
|
|
|
|
if (clist->column[i].window)
|
|
|
|
gdk_window_hide (clist->column[i].window);
|
1998-02-05 08:40:06 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
gdk_window_hide (clist->clist_window);
|
|
|
|
gdk_window_hide (clist->title_window);
|
|
|
|
gdk_window_hide (widget->window);
|
1998-10-16 15:00:05 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* unmap column buttons */
|
|
|
|
for (i = 0; i < clist->columns; i++)
|
|
|
|
if (clist->column[i].button &&
|
|
|
|
GTK_WIDGET_MAPPED (clist->column[i].button))
|
|
|
|
gtk_widget_unmap (clist->column[i].button);
|
1998-10-16 15:00:05 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* freeze the list */
|
1998-11-28 01:56:09 +00:00
|
|
|
clist->freeze_count++;
|
1998-10-19 22:46:38 +00:00
|
|
|
}
|
|
|
|
}
|
1998-01-19 09:59:20 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
static void
|
|
|
|
gtk_clist_draw (GtkWidget *widget,
|
|
|
|
GdkRectangle *area)
|
|
|
|
{
|
|
|
|
GtkCList *clist;
|
|
|
|
gint border_width;
|
|
|
|
GdkRectangle child_area;
|
|
|
|
int i;
|
1998-10-16 15:00:05 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_if_fail (widget != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (widget));
|
|
|
|
g_return_if_fail (area != NULL);
|
1998-10-16 15:00:05 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (GTK_WIDGET_DRAWABLE (widget))
|
|
|
|
{
|
|
|
|
clist = GTK_CLIST (widget);
|
|
|
|
border_width = GTK_CONTAINER (widget)->border_width;
|
1998-01-19 09:59:20 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
gdk_window_clear_area (widget->window,
|
|
|
|
area->x - border_width,
|
|
|
|
area->y - border_width,
|
|
|
|
area->width, area->height);
|
|
|
|
|
|
|
|
/* draw list shadow/border */
|
|
|
|
gtk_draw_shadow (widget->style, widget->window,
|
|
|
|
GTK_STATE_NORMAL, clist->shadow_type,
|
|
|
|
0, 0,
|
|
|
|
clist->clist_window_width +
|
|
|
|
(2 * widget->style->klass->xthickness),
|
|
|
|
clist->clist_window_height +
|
|
|
|
(2 * widget->style->klass->ythickness) +
|
|
|
|
clist->column_title_area.height);
|
|
|
|
|
Adapt cast macros to standard.
Fri Nov 19 10:34:41 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkgamma.h: Adapt cast macros to standard.
[ Merges from 1.2 ]
Tue Nov 16 10:15:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_path):
If translation does not include a '/', use entire
translation instead of crashing.
Sun Oct 31 22:21:11 1999 Tim Janik <timj@gtk.org>
* docs/gtk_tut.sgml:
s/gtk_accel_group_attach/gtk_window_add_accel_group/.
Sat Oct 30 09:09:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_target_list_remove): Use
g_list_remove_link, not g_list_remove.
[ From Geert Bevin <gbevin@thunderstorms.org> ]
Sun Oct 24 07:41:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkclist.c (real_undo_selection): commented out g_print()
statement upon unselection (how the heck did that slip in?).
Sat Oct 23 03:03:08 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_freeze):
(gtk_text_thaw): undraw/draw cursor here to avoid unnecessary scrolling
in frozen state (and aparently crashes). patch provided by Anders
Melchiorsen <and@kampsax.dtu.dk>.
Sat Oct 23 02:53:20 1999 Tim Janik <timj@gtk.org>
* fix insensitive default/focus widget activation,
reported by Matt Goodall <mgg@isotek.co.uk>.
* gtk/gtkwindow.c (gtk_window_key_press_event):
(gtk_window_activate_default):
(gtk_window_activate_focus):
return handled=FALSE for actiavtion of insensitive default
widgets. return handled=TRUE for activation of insensitive
focus widgets. don't activate in either case.
Tue Oct 19 09:55:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk-config.in (lib_gtk): Switch order of @x_cflags@
and $glib_cflags to match library order and in the
theory that an old version of GLib is more likely to
be in the include directory for X then vice-versa.
(Bug #2776)
Tue Oct 19 09:46:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always use LC_CTYPE
to determine the locale for fontsets, not LC_MESSAGES;
the user may want English messages with a handling
for non-English languages. (LC_CTYPE=ru_RU LC_MESSAGES=fr_FR
will still be broken) (Bug #2891)
Tue Oct 19 20:36:42 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Fixed the wrong number of "*"'s.
Tue Oct 19 12:15:13 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Changed the Korean default fontset.
Fri Oct 8 02:32:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): Fix bug
where when scrolling to the left or top double exposes
were done, causing major slowdowns.
Thu Oct 7 18:31:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always normalize codeset
names to lowercase and alphanumeric, before looking
them up.
* gtk/Makefile.am: Install codeset variant gtkrc files
with normalized names.
Thu Oct 7 22:52:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_popup_with_data): even
popup menus when the menu is already visible, but its parent
is still hidden, (happens after tornoff window got hidden).
Thu Oct 7 11:09:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (install-data-local): Fix
a typo where gtkrc.vi_VN.tcvn5712 wasn't getting
deleted, causing error messages on install.
Thu Oct 7 11:03:06 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtk[hv]paned.c (gtk_{h,v}paned_draw): Redraw
the handle as well, since we now sometimes ignore
exposes on the handle while resizing.
Wed Oct 6 18:02:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_append_default_pixmap_path): Fix stupid
extra g_free introduced in one of the last one or two
commits.
Wed Oct 6 16:38:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc*: Make naming of gtkrc files
consistent, put each style that a gtkrc.* file creates
in a unique namespace, remove old files before installing.
Wed Oct 6 14:31:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Avoid leaking memory when
gtk_rc_init is called multiple times. (Yes, people who
do that have bugs in their code.)
Tue Oct 5 11:36:57 PDT 1999 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: listing gtkrc in gtkconf_DATA seems to barf.
Remove it since it's generated by the Makefile anyway
Tue Oct 5 02:43:41 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputcommon.h (gdk_input_device_new): Free
device->info.axes for core pointer.
Thu Sep 30 13:55:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (destroy_idle_test): Rename idle to
idle_id, to deal with obsolete, broken C libraries.
Mon Sep 27 02:50:15 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkvscale.c (gtk_vscale_draw): Don't add in
allocation->x/y twice!
* gtk/gtkhscale.c: Make usage of gtk_hscale_pos_trough()
consistent with gtk_vscale_pos_trough().
Sun Sep 26 19:44:34 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_queue_resize): We may
be queueing a resize on a toplevel container between
the time we show it and when we map it. So, we need
to test GTK_WIDGET_VISIBLE() for toplevels, and only
use GTK_WIDGET_DRAWABLE() for child windows.
Thu Sep 23 16:41:03 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDADDS): Add GDK_WLIBS to LDADDS
(fixes bug #2144)
Fri Sep 24 00:51:45 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c (gtk_container_queue_resize): check for
container DRAWABLE (instead of VISIBLE), so we don't queue
resizes on non-toplevel containers.
Sun Sep 19 18:13:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.[ch]: Make the data argument
const guchar *.
Sat Sep 18 21:27:40 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: Try to behave sensibly if
the focus widget is the window itself. (Should
we allow this at all?)
Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_set_sensitive):
* gtk/gtknotebook.c (gtk_notebook_set_scrollable):
* gtk/gtknotebook.c (gtk_notebook_set_show_border):
* gtk/gtkclist.c (gtk_notebook_set_show_border): make gboolean args
in prototypes and implementations consistent (Tomas Ogren).
* gtk/gtklayout.c (gtk_layout_remove): unset GTK_IS_OFFSCREEN flag
before the widget is unparented (reported by damon).
* gtk/gtkdnd.c: make the cursor and icon data _unsigned_ char,
since we provide unsigned data anyways.
Thu Sep 16 21:32:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_set_tip): Delay
the call to gtk_tooltips_layout_text() until later.
* gtk/gtktooltips.c (gtk_tooltips_draw_tips):
Call gtk_widget_ensure_style() before using the style.
Wed Sep 15 02:52:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_event): Added workaround
for old widgets that don't propagate draws to all
children. (Namely gnome-dock for gnome-libs <= 1.0.16)
Tue Sep 14 19:22:19 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_queue_resize): don't queue the parent
for a redraw but just the widget that requested the resize.
Tue Sep 14 18:29:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c: added new widget level method
gtk_container_set_reallocate_redraws() and a GtkContainer flag
reallocate_redraws : 1 to reflect the setting, exported this through
the argument system as a boolean ::reallocate_redraws.
* gtk/gtkwidget.c (gtk_widget_size_allocate): when queueing redraws
on the widget because the allocation changes, do so as well for
widget->parent if the parent has reallocate_redraws set to TRUE.
with that containers requesting reallocation redraws get automatically
redrawn if their children changed allocation (this unfortunately
affects also other children that didn't change allocation, but we
cannot work around that before 1.3).
Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_idle_draw): only emit ::draw if width
_and_ height are >0 (not _or_).
* gtk/gtktable.c (gtk_table_remove): use gtk_widget_queue_resize()
instead of gtk_container_queue_resize(), which is a core gtk internal
function (must have been on crack when i queued that).
* gtk/gtkprivate.h: added new private flag GTK_FULLDRAW_PENDING, so
we can check more reliably if we want to discard expose events.
* gtk/gtkwidget.c: added setting/unsetting of the GTK_FULLDRAW_PENDING
flag.
* gtk/gtkwidget.c (gtk_widget_event): don't discard synthesized exposes,
we simply trust these events. for deciding whether to discard exposes,
check GTK_FULLDRAW_PENDING instead of RESIZE_PENDING.
Mon Sep 13 15:01:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore
queues of areas that are completely off screen.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fix broken
logic for handleboxes.
* gtk/gtkwidget.c (gtk_widget_queue_draw_data): Add santity
check on width/height.
Mon Sep 13 02:22:47 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: backed out Raja's recent VPATH build "improvements",
we are fine with using $@ the way we do (if we actually encounter
brokeness with $@ in VPATH builds because of additional path prefixes,
we need to use $(@F) actually).
Mon Sep 13 01:34:53 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c: renamed two variables, hopefully didn't introduce
short lived bugs, that would allow language bindings to do surgeries
to our guts.
Fri Sep 10 15:22:50 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_size_allocate): Fix typo
where comparison was being done against an uninitialized
value causing intermittant results depending on
compiler flags. Also make it clearer that we aren't
ever initializing the child as 0x0 (though this will
be caught in gtk_widget_size_allocate())
Fri Sep 10 10:06:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_transient_for): Move
gtk_window_unset_transient_for() call after we do checks
involving the old transient parent.
[ From Lance Capser <lmc@cyberhighway.net> ]
1999-09-07 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gtk.defs): Go back to using `touch' to create
an empty file.
Mon Sep 6 00:11:56 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (gtk_ctree_is_ancestor): return FALSE if node has
no children. (Reported by: Chris Rogers <gandalf@pobox.com>)
1999-09-03 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gen_sources): Improve VPATH builds.
`$@' is valid only in the build dir, not after we've done
`cd $srcdir'. Also use `test -f' instead of less portable
`test -e'.
Fri Sep 3 15:59:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (correct_cache_insert): Rewrite
for simplicity, and hopefully correctness.
(Fixes bug #1322, which was a segfault when
on some insertions with the properties around
the insertion set up just wrong.)
* gtk/gtktext.c (gtk_text_adjustment): When we receive
a "changed" signal, clamp the new value to the adjustment
bounds to avoid segfaulting if someone tries to change
the adjustment to a bogus value. (Bug #1795)
Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c: Ignore unexpected destroy notifies
for children, for toplevel windows handle them
like delete_event.
* gtk/gtkplug.c: Add an unrealize handler so that
we unref plug->socket_window when we are done
with it.
Fri Sep 3 14:52:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_area): Fix stupid signedness
problem that was causing background to sometimes
be misaligned.
Fri Sep 3 12:26:33 1999 Owen Taylor <otaylor@redhat.com>
[ Fixes pointed out by Ettore Perazzoli <ettore@comm2000.it> ]
* gtk/gtkmenu.c (gtk_menu_position): Make
sure we never position menus with negative x, y,
since gtk_widget_set_uposition() can't handle that.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu):
Modify the positioning code a bit so that we always
put the top-left corner onscreen. (This is for
UI reasons, gtk_menu_position() now takes care of
gtk_widet_set_uposition() brokeness.)
Fri Sep 3 03:06:30 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: fixed up things for -jx, x > 1.
Sun Sep 5 08:48:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_style): Ref the
RC style that is passed in. The lack of the ref
before was a bug. If people worked around this
bug, this will introduce a slight memory leak
in their code. The code should typically look like:
rc_style = gtk_rc_style_new ();
[...]
gtk_widget_modify_style (widget, rc_style);
gtk_rc_style_unref (rc_style);
* gtk/gtkwidget.c (gtk_widget_modify_style): Reset
the style if it was already set.
* gtk/gtkwidget.c (gtk_widget_set_name): Only set the
style if it was set before.
Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (main): Add a check to see if we
are being run from the correct directory and
to quit nicely if we are not.
* gtk/gtkrc.c (gtk_rc_slist_remove_all): Make function
static.
Thu Sep 2 23:00:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkenums.h (GtkWindowPosition): added GTK_WIN_POS_CENTER_ALWAYS.
* gtk/gtkwindow.c:
queue resizes unconditionally (gtk_widget_queue_resize will figure
what to do if the window is not realized).
(gtk_window_move_resize): only recenter the window
for GTK_WIN_POS_CENTER_ALWAYS.
(gtk_window_compute_reposition): handle GTK_WIN_POS_CENTER_ALWAYS in
the same way as GTK_WIN_POS_CENTER.
Thu Sep 2 22:39:27 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_reposition): check for the last position
with (!(info->last_flags & GDK_HINT_POS)) instead of
(!info->last_flags & GDK_HINT_POS).
* gtk/gtkwindow.c (gtk_window_move_resize): constrain new_width and
new_height unconditionally, because we use these values even if
!default_size_changed && !hints_changed.
comented the (default_size_changed || hints_changed) case with
respect to resize rejects from the window manager.
* gtk/gtkwindow.c (gtk_window_move_resize): save info->last values
in the zvt condition hack, since this includes the window hints, set
the hints after the handling_resize case.
* gtk/gtkwindow.c (gtk_window_show): constrain the default size that a
window is initially shown with to the geometry.
Thu Sep 2 07:38:56 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize):
s/size_changed/default_size_changed/g so i know what's
really going on (frying brain on smaller flame now).
Thu Sep 2 05:47:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): queue a new resize if
we have size_changed upon handling_resize. this is a gross
workaround for the broken zvt widget and should be removed in
1.3 again (search for FIXME).
Owen provided an accurate comment for this:
/* We could be here for two reasons
* 1) We coincidentally got a resize while handling
* another resize.
* 2) Our computation of size_changed was completely
* screwed up, probably because one of our children
* is broken. It's probably a zvt widget.
*
* For 1), we could just go ahead and ask for the
* new size right now, but doing that for 2)
* might well be fighting the user (and can even
* trigger a loop). Since we really don't want to
* do that, we requeue a resize in hopes that
* by the time it gets handled, the child has seen
* the light and is willing to go along with the
* new size. (this happens for the zvt widget, since
* the size_allocate() above will have stored the
* requisition corresponding to the new size in the
* zvt widget)
*
* This doesn't buy us anything for 1), but it shouldn't
* hurt us too badly, since it is what would have
* happened if we had gotten the configure event before
* the new size had been set.
*/
Wed Sep 1 20:46:11 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: deal properly with the fact that RC
style lists may include rc styles more than once.
* gtk/gtkrc.c (gtk_rc_append_pixmap_path): Removed
unused static function.
* gtk/gtkrc.c (gtk_rc_find_pixmap_in_path): Keep a
stack of directories of RC files currently being
parsed and implicitely add them to pixmap path.
This fixes a bug where the directory would get
appended then overwritten by pixmap_path declarations.
(bug #1462, from Peter Wainright <prw@wainpr.demon.co.uk>)
* gtk/gtkthemes.c (gtk_theme_engine_unref): Call
theme's exit function. (Patch from Peter Wainwright,
bug #1454)
* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_destroy):
Add a destroy() handler to take care of removing
group for menu item. (Fixes bug #1197)
* gtk/gtkwidget.c (gtk_widget_size_request): Fixed thinko
in warning message.
Wed Sep 1 21:27:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): don't require a server
roundtrip to figure window's width and height, since we know that
anyways from widget->allocation.
Wed Sep 1 12:37:44 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Compute
the hints after we request the new size.
Wed Sep 1 10:38:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_compute_hints): Removed
GTK_WIDGET_REALIZED() assertion - we can compute the
hints before we are realized.
* gtk/gtkwindow.c (gtk_window_move_resize): Reorder
hint changing so that we have a value of hints_changed
when we decide whether to constrain the window size.
* gtk/gtkwindow.c (gtk_window_move_resize): Spelling fix.
* gtk/gtkwindow.c (gtk_window_constrain_size): cleanups,
change back to G_MAXINT.
Wed Sep 1 06:54:59 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_get_geometry_info): zero initialize
new GtkWindowGeometryInfo, so fields like GdkGeometry geometry
contain uncluttered values.
(gtk_window_compute_hints): simply assert that window is realized
and that geometry_info is valid, since we rely on this anyways.
(gtk_window_constrain_size): major cleanups to the code.
if (flags & GDK_HINT_BASE_SIZE) use geometry's base width and height
for the base size, instead of the minimums. use 32767 as max width
and height (like in gtkwindow.c) instead of G_MAXINT.
Wed Sep 1 04:41:25 1999 Tim Janik <timj@gtk.org>
* cleaned up the GtkContainer.need_resize flag handling mess, we
only need to force resize requests when we were prematurely
realized, or our widget tree was modified when we were temporarily
hidden. handling these cases directly upon showing the window (i.e.
while the GdkWindow is still unmapped) avoids the need to wait for
a configure event response and therefore makes the GUI more snappier
and avoids blank windows during the roundtrip.
* gtk/gtkwidget.c:
(gtk_widget_hide):
(gtk_widget_show): don't queue resizes on toplevels, they know how
to deal with matters.
* gtk/gtkcontainer.c (gtk_container_queue_resize): set the ->need_resize
flag directly for not visible resize containers and spare us unecessary
signal emissions.
* gtk/gtkwindow.c:
(gtk_window_realize): if we need to enforce premature size allocation,
queue a container resize so we are correctly resized later on.
(gtk_window_init):
(gtk_window_size_request):
don't freak around with the ->need_resize flag,
gtk_container_queue_resize() will care about that.
(gtk_window_show):
handle initial resizing issues here, we can handle matters better in
this place, especially since we know that our GdkWindow is still
unmapped.
(gtk_window_move_resize):
don't care about ->need_resize at all.
handle size changes properly that occoured while we waited for a
configure event.
Tue Aug 31 15:58:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_uposition):
* gtk/gtkwindow.[hc] (gtk_window_reposition):
Move the hint setting code from gtk_widget_set_uposition
to here; set the hints so that we respect any previously
set geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Don't
change the window hints here or move the window here,
let that happen in gtk_window_move_resize().
Tue Aug 31 06:58:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): when discarding exposes due
to already queued resizes (and therefore redraws) on a widget, check
its anchestry as well.
* gtk/gtkcontainer.c:
(gtk_container_queue_resize): clear resize widgets for resize
containers before aborting prematurely. this is especially important
for toplevels which may need imemdiate processing or their resize
handler to be queued.
(gtk_container_dequeue_resize_handler): added new internal function for
gtkwindow.c.
* gtk/gtkwindow.c (gtk_window_move_resize): if we are resizing due to a
configure event, take possible changes in window position into account
as well.
if we request a new window size, queue up a resize handler that will
last until the configure event response arrives.
combined the ->need_resize case (initial show) with the general size
(hints) changed case and added even more comments.
if !auto_shrink, only revert to the old allocation if the new size
is smaller than the current allocation.
Tue Aug 31 11:55:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_arg, gtk_window_set_policy,
gtk_window_set_geometry_hints
gtk_window_set_default_size):
When hints are set, queue a resize so that the hints will
be eventually reset on the toplevel.
* gtk/gtkwindow.c (gtk_window_show): Use
gtk_window_compute_default_size(). Clear the need_resize flag
on the initail map so that we don't unnecessarily trigger the
resize code.
* gtk/gtkwindow.c (gtk_window_move_resize): Split apart
into separate functions. Compare the hints we are setting
with what we set last time so that we can accurately
tell when we need to reset the hints.
* gtk/gtkwindow.c (gtk_window_compute_default_size): New
function to figure out the size from requisition
and default_size.
* gtk/gtkwindow.c (gtk_window_constrain_size): Function
from fvwm to constrain a size to the geometry hints.
* gtk/gtkwindow.c (gtk_window_compare_hints): New function
to compare two sets of geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_hints): Renamed
from gtk_window_set_hints(), just compute the hints,
don't set them.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Move
code from gtk_window_move_resize() to separate function,
rationalize a bit.
Tue Aug 31 13:05:03 1999 Owen Taylor <otaylor@redhat.com>
* gtkrc.h: Move the ref_count member out of the GtkRcStyle
structure into a new private structure.
* gtkrc.c: Split GtkRcStyle into public/private.
In the private part, add a list of pointers to the
RcStyle lists this RcStyle participates in.
* gtkrc.c: When a RcStyle is free, remove all
lists referencing it from the
realized_style_ht hash, and free those lists.
* gtk/gtkrc.c (gtk_rc_clear_styles): Don't call
gtk_rc_init(), since that adds the default styles
to the list of parsed RC files again.
* gtk/gtkrc.c: Use gtk_rc_style_find() consistently.
Thu Aug 26 14:14:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): reactivated the sanity
checks that ensure that a widget's allocation is at least 1 in width
and height. (GNOME note: this doesn't affect old panel code anymore,
because GtkSocket will request width and height of at least 1 since
Fri Jul 23).
* gtk/gtkwindow.c (gtk_window_realize): if the widget hasn't been
allocated yet (happens if the user realizes the window prematurely),
size request and allocate it.
(gtk_window_size_allocate): guard against guint underflows.
Wed Aug 25 19:01:36 1999 Lars Hamann <lars@gtk.org>
* gtk/Makefile.am (gtk_built_sources): reordered stamp-gtk.defs
in gtk_built_sources, so gtk.defs gets built prior to all other
sources.
Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am:
invoke indent on gtkmarshal.*.
rewrote source generation rules, use COPYING as oldest source tag for
a piggyback rule to generate all sources from (don't touch it ;).
major cleanups, strip spaces on build rules for GNU Make.
* gtk/genmarshal.pl: don't operate on hardcoded filenames but take
source and target files from commandline arguments. don't invoke indent.
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Wed Aug 18 09:20:10 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c:
we use window->need_resize from configure_event now, to indicate that
the gtkwindow should keep its allocation (e.g. because the user resized
the window through window manager handles). resize_count is now reliably
used to figure whether we got the allocation we requested from the
window manager.
configure events get queued as resizes now, the real stuff (size
computation and allocation) now only goes on in gtk_window_move_resize().
GtkWindow's requisition now contains its *real* requisition (like all
other widgets), *not* taking usize into account.
geometry_info->last_{width|height} is now updated from set_hints() only
so it always contains the last hints we set for the window manager.
made some event handlers return TRUE instead of FALSE.
the overall code should be much more straight forward now, and the
significant code portions are accompanied by comments now.
(gtk_window_set_hints):
removed requisition argument and made it
fetch the requisition through gtk_widget_get_child_requisition.
we also don't move the gdkwindow here anymore, gtk_window_move_resize()
does that now.
(gtk_window_show):
ensure that the widget is realized before calling
gtk_container_check_resize() (and thus gtk_window_move_resize()), also
ensure that we got properly size requested and allocated before
realization.
(gtk_window_configure_event):
ignore plain window moves, or reallocate the widget tree through the
resize queue otherwise.
(gtk_window_move_resize):
mostly rewrote this function to figure window manager hints more
reliably, coalesce window moves and resizes to reduce configure events
and do actuall size allocations.
Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): discard expose events for widgets
that have a resize pending, because a redraw is already queued for them.
* gtk/gtkcontainer.c: removed ugly connect_to ::size_allocate signal
hack to clear resize_widgets.
* gtk/gtkwidget.c (gtk_widget_size_allocate): call clear_resize_widgets
for resize containers prior to size allocation. (this is also a bit
ugly, but avoids side effects for stopped emissions and is thus more
reliable).
(gtk_widget_unparent): removed disconnect call for clear_resize_widgets.
* gtk/gtktooltips.c (gtk_tooltips_paint_window): renamed this
function from gtk_tooltips_expose, as we connect to ::expose_event
*and* ::draw now.
1999-08-18 Federico Mena Quintero <federico@redhat.com>
* gtk/gtkselection.c (gtk_target_list_ref): Added missing sanity
checks.
(gtk_target_list_unref): Likewise.
* gtk/gtkthemes.c (gtk_theme_engine_unref): Likewise.
Tue Aug 17 15:47:07 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_draw_value_bar):
guard against division by zero. (Fixes bug #1339)
Tue Aug 17 10:56:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_move_{forward,backward}_word):
Prevent the trivial leak of information of allowing
word motion when the entry is not visible.
Tue Aug 17 10:28:52 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_fileop_error): Propagate
modality to error dialog as well as confirmation dialogs.
(Bug #1803, reported by Rosanna Wing Sze Yuen)
Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktreeitem.c (gtk_tree_item_draw_lines): Honor
tree->view_lines.
(gtk-guy-990611-3.patch: Guy Harris <guy@netapp.com>)
* gtk/Makefile.am (install-data-local): Solaris apparently
has various troubles with ln -f; use rm first instead.
(gtk-guy-990611-2.patch: Guy Harris <guy@netapp.com>)
1999-07-30 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (stamp-m): Don't `mv' from builddir to srcdir,
use `cp' followed by `rm' (the `rm' was already there).
July 30, 1999 Elliot Lee <sopwith@redhat.com>
* configure.in: Fix autoconf warnings about cross compilation by
trying to provide sane defaults for AC_TRY_RUN.
* gtk/Makefile.am: If we refer to gtkmarshal.[ch] in $(srcdir),
put them into $(srcdir) when generated. Also add a dependency of
gtksignal.h on gtkmarshal.h for -j builds.
* gtk/gtk(dnd,style,gamma).c: Minor warning fixes.
Wed Jul 28 09:29:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration_do): Added missing
GDK_THREADS_{LEAVE,ENTER} pair.
(From Paul Fisher <pnfisher@redhat.com>)
Fri Jul 23 01:00:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtksocket.c (gtk_socket_size_request): asure that the requested
width and height are always >0 (owen).
Fri Jul 23 00:00:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): backed out my recent
change that assured that a widget's allocated with and height are
always >1, since this breaks *buggy* panel code. unfortunately this
back-breaks the gimp's color selector.
* gtk/gtkdrawingarea.c (gtk_drawing_area_size_allocate): asure that our
allocation is always >0 in width and height, before sending the
configure event; this is a *gross* hack to get the gimp back to work.
* marked both cases with TODO-1.3
Wed Jul 21 15:47:39 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Don't display wrap indicators when
text is not editable and word wrap is on.
Wed Jul 21 08:21:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): special case
option menus here as they are not derived from menu shell, assure that
the option menu has a menu we can add items to.
Tue Jul 20 23:29:48 1999 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_page_allocate): convert allocation->
width/height to (gint) before calculations and check against < 0 to
avoid guint wraparounds.
Sun Jul 18 00:35:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): ensure that the allocated
width and height is never zero. sanity check both dimensions against
32767 and issue a warning if the allocation is greater than that.
Wed Jul 7 15:03:30 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_events_pending): Unlock around call
to g_main_pending() as well.
Wed Jul 7 14:59:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration): Unlock around
call to g_main_iteration() - since that will regrab
GTK+ lock to process events.
Thu Jul 1 15:01:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c
- Regularize with the rest of GTK+ by making widget->requisition
not reflect the set_usize()
- Always recompute geometry hints, then check if they
changed before sending them to the X server. The
previous checks for changes would fail in a number
of circumstances.
Thu Jul 1 11:55:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Include <stdlib.h> for strcmp().
Wed Jun 30 19:26:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c:
- Code cleanups
- Instantaneously update on modifier key presses
- Allow cancellation of the drag with Escape.
Tue Jun 29 17:04:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_handle_box): Set the policy
to auto_shrink - otherwise the appearance is rather
strange when flipping between horizontal and vertical.
Mon Jun 28 09:29:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: add ::default_width and ::default_height arguments.
(gtk_window_set_default_size): don't change a value if it's < 0.
queue a resize.
Sun Jun 27 11:00:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_insert): don't segfault on NULL inserts.
Mon Jun 28 12:08:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (cmpl_completion_fullname): Don't
add an extra "/" when concating "/" + filename.
(From Matt Grossman <mattg@oz.net>)
Mon Jun 28 10:57:12 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (draw_cell_pixmap): Reset clip mask
for fg_gc if we set it for drawing pixmap.
Tue Jun 15 12:45:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes from Peter Wainwright <prw@wainpr.demon.co.uk>
* gtk/gtkrc.c (gtk_rc_parse_engine): If rc_style->engine is
already set, call old engine's destroy function and
unref the old engine.
Thu Jun 10 17:59:38 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.c (gtk_drawing_area_size): queue a resize.
Wed Jun 9 15:13:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h: mark certain functions as internal.
Wed Jun 9 13:48:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpreview.c (gtk_preview_set_expand): queue a resize if the
expand behaviour changed.
* gtk/gtklabel.c (gtk_label_set_pattern):
(gtk_label_set_justify):
(gtk_label_set_line_wrap):
don't bother invoking queue_clear, the reallocation does
that for us, always free_words so the upcoming resize will
relayout the label's contents.
Wed Jun 9 12:50:48 1999 Tim Janik <timj@gtk.org>
* applied argument implementation patches from Elena Devdariani
<elena@cogent.ca>.
* gtk/gtktoolbar.c: ::orientation, ::toolbar_style, ::space_size,
::space_style, ::relief
* gtk/gtkruler.c: ::lower, ::upper, ::position, ::max_size
* gtk/gtkpreview.c: ::expand
* gtk/gtkpaned.c: ::handle_size, ::gutter_size
* gtk/gtknotebook.c: ::homogeneous
* gtk/gtklabel.c: ::wrap
* gtk/gtklist.c: ::selection_mode
* gtk/gtkhandlebox.c: ::handle_position, ::snap_edge
* gtk/gtkcurve.c: ::curve_type, ::min_x, ::max_x, ::min_y, ::max_y
* gtk/gtkcolorsel.c: ::update_policy, ::use_opacity
* gtk/gtkclist.c: ::sort_type
* gtk/gtkcheckmenuitem.c: ::active, ::show_toggle
* gtk/gtkaspectframe.c: ::xalign, ::yalign, ::ratio, ::obey_child
Tue Jun 1 23:38:38 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Removed ill-thought-out part of last
comment.
Tue Jun 1 23:30:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_attach): Get the reference
counting right when we have to attach a new style
for a different visual. (Chi-Deok Hwang <cdhwang@sr.hei.co.kr>)
* gtk/gtkstyle.c: Documented the refcounting
peculularities of gtk_style_attach.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkwindow.c (gtk_window_new): added return if fail for invalid
window types.
* examples/packer/pack.c (main): use GTK_WINDOW_TOPLEVEL instead
of GTK_TOPLEVEL for creating the window.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkmain.c (gtk_init_check): don't segfault when --gtk-module is
the last argument (reported by Per Winkvist).
Tue May 25 13:13:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes for invisible XOR lines (Frank Loemker
<floemker@TechFak.Uni-Bielefeld.DE>)
* gtk/gtkclist.c (gtk_clist_realize): Always use
a non-zero pixel for GDK_XOR.
* gtk/gtkvpaned.c gtk/gtkhpaned.c:
Use GDK_INVERT instead of GDK_XOR.
Wed May 12 21:56:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (adjust_adjustments): signal emit value_changed
signals if h/voffsets differ from adjustment values.
Reportet by Jerome Bolliet <bolliet@in2p3.fr>
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
the user data on the window before destroying it.
* gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
unrealize handler to take care of destroying
notebook->panel properly.
(Bug #1198 - Morten Welinder <terra@diku.dk>)
* gtk/gtktext.c (expand_scratch_buffer): Fix reversal
of g_new and g_realloc to stop memory leak. (Actually,
we could just use g_realloc(), but I'm not 100% sure
that is portable).
(Bug #1196 - Morten Welinder <terra@diku.dk>)
Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.h: Removed stray GtkPlugButton declaration.
* gdk/gdkfont.c (gdk_text_measure): Fix the return value
for fontsets.
* gtk/gtkbutton.c (gtkbutton_expose): Fix warning
with bin/button confusion.
Thu May 6 04:53:26 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: in the ItemFactory test, link radio items together,
and show how preselection of radio items is done.
Sun May 2 13:31:14 1999 Tim Janik <timj@gtk.org>
* gtk/gtktreeitem.c (gtk_tree_item_set_subtree):
* gtk/gtktree.c (gtk_tree_add) (gtk_tree_insert):
* gtk/gtktoolbar.c (gtk_toolbar_insert_element):
* gtk/gtkpaned.c (gtk_paned_pack2) (gtk_paned_pack1):
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_add):
* gtk/gtktable.c (gtk_table_attach):
* gtk/gtklist.c (gtk_list_insert_items):
* gtk/gtkmenushell.c (gtk_menu_shell_insert):
* gtk/gtknotebook.c (gtk_notebook_insert_page_menu):
* gtk/gtkpacker.c (gtk_packer_add_defaults) (gtk_packer_add):
* gtk/gtkbin.c (gtk_bin_add):
* gtk/gtkbox.c (gtk_box_pack_start) (gtk_box_pack_end):
* gtk/gtkfixed.c (gtk_fixed_put):
* gtk/gtklayout.c (gtk_layout_put):
general fixups to container_add logic. always realize child if
child->parent is realized, only map the child and queue a resize
if child and child->parent are both visible.
Fri Apr 30 09:02:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_unrealize): use gtk_container_forall
instead of gtk_container_foreach to walk and unrealize children, so
composite children get also unrealized.
(gtk_widget_real_show): don't call gtk_widget_map() if we don't need to.
(gtk_widget_map): assert that the widget is visible (basic constrain).
(gtk_widget_real_map): assert that the widget is realized (basic
constrain).
Fri Apr 29 00:53:20 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbindings.c (gtk_pattern_spec_init): plugged a memory leak.
Tue May 4 09:32:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc.iso-8859-2: Add a gtkrc
file for iso-8859-2 locales.
* configure.in (ALL_LINGUAS): ALL_LINGUAS update.
Tue Apr 27 16:38:32 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Fix typo of static_sources for static_SOURCES.
(Pointed out by andy@rz.uni-karlsruhe.de and others).
Remove some suspicious and useless lines.
Tue May 4 08:44:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c (gtk_clist_draw, draw_rows): Use
width,height = 0, 0 to mean - here to edge of window,
instead of -1, -1, since the former is all we support.
Tue May 4 08:34:43 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main): Correctly free list nodes
when removing from quit_functions list.
Tue Apr 27 14:17:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpacker.c (gtk_packer_size_request): remove unused variable.
Tue Apr 27 18:23:35 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable):
When redrawing characters on non-visible entry, use appropriate
'*' character. (Bug #1130 - Jean-Marc Jacquet <jm@littleigloo.org>)
Tue Apr 27 01:31:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (drag_dest_cell): compute destination cell
from drag coordinates.
(gtk_clist_drag_data_received) (gtk_clist_drag_motion):
use drag_dest_cell.
* gtk/gtktree (drag_dest_cell)
(gtk_ctree_drag_data_received) (gtk_ctree_drag_motion): likewise.
(Bug #1129)
Wed Apr 21 21:26:11 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_init): properly initialize
translate_* fields.
(gtk_item_factory_finalize): invoke translate_notify independant from
translate_data.
(gtk_item_factory_set_translate_func): likewise.
(gtk_item_factory_destroy): only remove ifactory pointer from those
widgets that belong to us (stupid me).
Mon Apr 19 12:05:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Fixed leak of
rc_style list when lookup succeeeds.
Thu Apr 15 01:11:24 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (resync_selection):
* gtk/gtkclist.c (resync_selection): fixed undo_selection bug.
* gtk/gtkclist.c (gtk_clist_button_release): fixed resync_selection
bug.
Fri Apr 9 19:22:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c gtk/gtkdnd.c gtk/gtkmenuitem.c:
Add some missing GDK_THREADS_ENTER()/LEAVE around
timeouts. (Patches from Sebastian Wilhelmi <wilhelmi@ira.uka.de>)
Thu Apr 8 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkentry.c (gtk_entry_key_press): use gtk_widget_activate()
rather than emit_by_name.
* gtk/gtkeditable.c (gtk_editable_insert_text): keep a reference
on the widget across multiple signal emissions.
(gtk_editable_delete_text): same here.
(gtk_editable_class_init): set widget_class->activate_signal after
editable_signals[ACTIVATE] has been created.
Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
position here prematurely -- we might not have the
right ->min_position and ->max_position yet.
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
Add error traps so if the other end of the connection
dies, we survive.
* gtk/gtkselection.c (gtk_selection_notify): Clean
up properly when selection property retrieval fails.
* gtk/gtkselection.c (gtk_selection_request): Correctly
reject SelectionRequest notifies where the handler
returns no data.
Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_dest_leave): Only unhighlight
when we've previously highlighted.
* gtk/gtkdnd.c (gtk_drag_dest_handle_event): Don't
emit two "drag_leave" signals for Motif drops.
* gtk/gtkdnd.c (gtk_drag_source_handle_event): Send
back the correct status messages when dropping from
Motif onto a proxy window that is rejecting the
drop.
Sat Mar 27 23:32:13 1999 Tim Janik <timj@gtk.org>
* gtk/gtkarg.[hc]: added functions from GLE, gtk_arg_reset() to free
the value and reset type to GTK_TYPE_INVALID, and gtk_arg_values_equal()
to compare two argument values. added gtk_arg_to_valueloc() to set a
variable from an arg through its location (pointer).
* gtk/gtkobject.[hc]: implemented gtk_object_get() in terms of
gtk_object_arg_get() and gtk_arg_to_valueloc(), floats are collected
as gfloat*, uchars are collected as guchar*, ints are collected as
gint*, etc...
Mon Mar 29 17:45:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccelgroup.c gtk/gtkgtkbindings.c:
Include <string.h> instead of <strings.h>.
* gtk/gtkstyle.c: Fix double include of gtkthemes.h
(actually, a lot more duplicate includes occur if
you trace through the sequence of #include's)
gtk-jbb-990320-0: John Bley, jbb6@acpub.duke.edu
Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com>
Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp>
gtk-a-higuti-990322-[0-3]
* configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS
that was causing -DX_LOCALE not to work.
* gtk/gtkrc.c (gtk_rc_init):
X_LOCALE will never have LC_MESSAGES defined
Thu Mar 25 12:38:31 1999 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_append_default_module_path): get $HOME from
g_get_home_dir() (gtk-pmc-990123-0.patch.gz).
* gtk/gtkwindow.c (gtk_window_key_press_event): feature keypad up/down/
left/right as well (gtk-michael-980726-0.patch.gz).
* gtk/gtklabel.[hc]: bunch of miscellaneous cleanups, such as s/0/NULL/
for pointer values, use gchar instead of char. fixed uline allocation
leaks, changed the allocation pattern so we use G_ALLOC_AND_FREE mem
chunks instead of G_ALLOC_ONLY.
(gtk_label_size_request): always alter requisition as passed and leave
widget->requisition alone.
(gtk_label_set_text): allow NULL strings.
(gtk_label_new): likewise.
Wed Mar 24 09:24:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.[hc]: type/macro fixups.
Mon Mar 22 05:51:34 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbin.c (gtk_bin_draw): only redraw children that are visible
*and* mapped (i.e. drawable).
(gtk_bin_expose): only send exposes to drawable children.
* gtk/gtkbox.c (gtk_box_draw): only redraw children that are drawable.
(gtk_box_expose): only send exposes to drawable children.
* gtk/gtkhscale.c (gtk_hscale_draw):
* gtk/gtkvscale.c (gtk_vscale_draw):
hm, this is an ugly one. we first compute the size of our trough area
here (window relative) and then check intersection with the draw_area
which is parent relative because we're a NO_WINDOW widget, so we need
to offset the trough area by allocation.x and allocation.y before the
check. (this must not be done for the background area though, since
that's already computed parent relative).
Mon Mar 22 00:41:39 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_unrealize): unmap clist if neccessary,
unrealize title buttons.
Fri Mar 19 00:00:22 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_column_title_passive)
(gtk_clist_column_title_active):
only connect/disconnect to GtkWidgetClass::event to block mouse events.
* gtk/gtkclist.c (vertical_timeout) (horizontal_timeout):
zero initialize event, removed superfluous gdk_window_get_pointer call
* gtk/gtklist.c (gtk_list_vertical_timeout)
(gtk_list_horizontal_timeout): removed superfluous
gdk_window_get_pointer call
Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org>
* plugging problems reported by "Bruce Mitchener, Jr."
<bruce@puremagic.com> due to a purify session.
* gtk/gtkstyle.c:
(gtk_style_ref):
(gtk_style_unref): assert ref_count to be > 0.
* gtk/gtkclist.c (gtk_clist_set_cell_style): { 0 } initilaize
the requisition.
(gtk_clist_set_shift): likewise.
* gtk/gtklayout.c: introduce gtk_layout_finalize() to unref the
adjustments.
* gtk/gtklist.c (gtk_list_horizontal_timeout): zero initialize the
event before sending it and set send_event to TRUE (which needs to
be done for *all* synthesized events).
(gtk_list_vertical_timeout): likewise.
* gtk/gtktipsquery.c (gtk_tips_query_destroy): plug small memory
leaks.
* gtk/gtkdrawingarea.c (gtk_drawing_area_send_configure): set send_event
to TRUE when synthesizing events.
[ *** end of merges from 1.2 *** ]
1999-11-22 21:52:50 +00:00
|
|
|
gdk_window_clear_area (clist->clist_window, 0, 0, 0, 0);
|
1998-10-19 22:46:38 +00:00
|
|
|
draw_rows (clist, NULL);
|
|
|
|
|
|
|
|
for (i = 0; i < clist->columns; i++)
|
1998-01-24 19:14:42 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
if (!clist->column[i].visible)
|
|
|
|
continue;
|
1998-11-08 05:58:41 +00:00
|
|
|
if (clist->column[i].button &&
|
|
|
|
gtk_widget_intersect(clist->column[i].button, area, &child_area))
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_widget_draw (clist->column[i].button, &child_area);
|
1998-01-19 09:59:20 +00:00
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
}
|
|
|
|
}
|
1998-01-19 09:59:20 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
static gint
|
|
|
|
gtk_clist_expose (GtkWidget *widget,
|
|
|
|
GdkEventExpose *event)
|
|
|
|
{
|
|
|
|
GtkCList *clist;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_val_if_fail (widget != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_CLIST (widget), FALSE);
|
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
1998-06-02 02:51:46 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (GTK_WIDGET_DRAWABLE (widget))
|
|
|
|
{
|
|
|
|
clist = GTK_CLIST (widget);
|
|
|
|
|
|
|
|
/* draw border */
|
|
|
|
if (event->window == widget->window)
|
|
|
|
gtk_draw_shadow (widget->style, widget->window,
|
|
|
|
GTK_STATE_NORMAL, clist->shadow_type,
|
|
|
|
0, 0,
|
|
|
|
clist->clist_window_width +
|
|
|
|
(2 * widget->style->klass->xthickness),
|
|
|
|
clist->clist_window_height +
|
|
|
|
(2 * widget->style->klass->ythickness) +
|
|
|
|
clist->column_title_area.height);
|
|
|
|
|
|
|
|
/* exposure events on the list */
|
|
|
|
if (event->window == clist->clist_window)
|
|
|
|
draw_rows (clist, &event->area);
|
1998-01-24 19:14:42 +00:00
|
|
|
}
|
1998-10-16 15:00:05 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_clist_style_set (GtkWidget *widget,
|
|
|
|
GtkStyle *previous_style)
|
|
|
|
{
|
|
|
|
GtkCList *clist;
|
|
|
|
|
|
|
|
g_return_if_fail (widget != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (widget));
|
|
|
|
|
|
|
|
if (GTK_WIDGET_CLASS (parent_class)->style_set)
|
|
|
|
(*GTK_WIDGET_CLASS (parent_class)->style_set) (widget, previous_style);
|
|
|
|
|
|
|
|
clist = GTK_CLIST (widget);
|
|
|
|
|
1998-12-11 10:52:30 +00:00
|
|
|
if (GTK_WIDGET_REALIZED (widget))
|
|
|
|
{
|
|
|
|
gtk_style_set_background (widget->style, widget->window, widget->state);
|
|
|
|
gtk_style_set_background (widget->style, clist->title_window, GTK_STATE_SELECTED);
|
1998-12-16 00:52:46 +00:00
|
|
|
gdk_window_set_background (clist->clist_window, &widget->style->base[GTK_STATE_NORMAL]);
|
1998-12-11 10:52:30 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* Fill in data after widget has correct style */
|
|
|
|
|
|
|
|
/* text properties */
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (!GTK_CLIST_ROW_HEIGHT_SET(clist))
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
clist->row_height = (widget->style->font->ascent +
|
|
|
|
widget->style->font->descent + 1);
|
|
|
|
clist->row_center_offset = widget->style->font->ascent + 1.5;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
clist->row_center_offset = 1.5 + (clist->row_height +
|
|
|
|
widget->style->font->ascent -
|
|
|
|
widget->style->font->descent - 1) / 2;
|
|
|
|
|
|
|
|
/* Column widths */
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (!GTK_CLIST_AUTO_RESIZE_BLOCKED(clist))
|
1998-10-19 22:46:38 +00:00
|
|
|
{
|
|
|
|
gint width;
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
for (i = 0; i < clist->columns; i++)
|
|
|
|
if (clist->column[i].auto_resize)
|
|
|
|
{
|
|
|
|
width = gtk_clist_optimal_column_width (clist, i);
|
|
|
|
if (width != clist->column[i].width)
|
|
|
|
gtk_clist_set_column_width (clist, i, width);
|
|
|
|
}
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
1998-01-24 19:14:42 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
static gint
|
|
|
|
gtk_clist_key_press (GtkWidget *widget,
|
|
|
|
GdkEventKey *event)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (widget != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_CLIST (widget), FALSE);
|
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
|
|
|
|
|
|
|
if (GTK_WIDGET_CLASS (parent_class)->key_press_event &&
|
|
|
|
GTK_WIDGET_CLASS (parent_class)->key_press_event (widget, event))
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
switch (event->keyval)
|
|
|
|
{
|
|
|
|
case GDK_Tab:
|
|
|
|
case GDK_ISO_Left_Tab:
|
|
|
|
if (event->state & GDK_SHIFT_MASK)
|
|
|
|
return gtk_container_focus (GTK_CONTAINER (widget),
|
|
|
|
GTK_DIR_TAB_BACKWARD);
|
|
|
|
else
|
|
|
|
return gtk_container_focus (GTK_CONTAINER (widget),
|
|
|
|
GTK_DIR_TAB_FORWARD);
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_clist_button_press (GtkWidget *widget,
|
|
|
|
GdkEventButton *event)
|
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
GtkCList *clist;
|
|
|
|
gint x;
|
|
|
|
gint y;
|
|
|
|
gint row;
|
|
|
|
gint column;
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
gint button_actions;
|
1998-10-19 22:46:38 +00:00
|
|
|
|
|
|
|
g_return_val_if_fail (widget != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_CLIST (widget), FALSE);
|
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
|
|
|
|
|
|
|
clist = GTK_CLIST (widget);
|
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
button_actions = clist->button_actions[event->button - 1];
|
|
|
|
|
|
|
|
if (button_actions == GTK_BUTTON_IGNORED)
|
1998-10-19 22:46:38 +00:00
|
|
|
return FALSE;
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* selections on the list */
|
|
|
|
if (event->window == clist->clist_window)
|
|
|
|
{
|
|
|
|
x = event->x;
|
|
|
|
y = event->y;
|
|
|
|
|
|
|
|
if (get_selection_info (clist, x, y, &row, &column))
|
|
|
|
{
|
|
|
|
gint old_row = clist->focus_row;
|
|
|
|
|
|
|
|
if (clist->focus_row == -1)
|
|
|
|
old_row = row;
|
|
|
|
|
|
|
|
if (event->type == GDK_BUTTON_PRESS)
|
|
|
|
{
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
GdkEventMask mask = ((1 << (4 + event->button)) |
|
|
|
|
GDK_POINTER_MOTION_HINT_MASK |
|
|
|
|
GDK_BUTTON_RELEASE_MASK);
|
|
|
|
|
1999-01-18 23:02:08 +00:00
|
|
|
if (gdk_pointer_grab (clist->clist_window, FALSE, mask,
|
|
|
|
NULL, NULL, event->time))
|
|
|
|
return FALSE;
|
|
|
|
gtk_grab_add (widget);
|
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
clist->click_cell.row = row;
|
|
|
|
clist->click_cell.column = column;
|
|
|
|
clist->drag_button = event->button;
|
1998-10-19 22:46:38 +00:00
|
|
|
}
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
else
|
1998-10-19 22:46:38 +00:00
|
|
|
{
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
clist->click_cell.row = -1;
|
|
|
|
clist->click_cell.column = -1;
|
|
|
|
|
|
|
|
clist->drag_button = 0;
|
|
|
|
remove_grab (clist);
|
1998-10-19 22:46:38 +00:00
|
|
|
}
|
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (button_actions & GTK_BUTTON_SELECTS)
|
1998-10-19 22:46:38 +00:00
|
|
|
{
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (GTK_CLIST_ADD_MODE(clist))
|
1998-10-19 22:46:38 +00:00
|
|
|
{
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
GTK_CLIST_UNSET_FLAG (clist, CLIST_ADD_MODE);
|
|
|
|
if (GTK_WIDGET_HAS_FOCUS(widget))
|
|
|
|
{
|
|
|
|
gtk_clist_draw_focus (widget);
|
|
|
|
gdk_gc_set_line_attributes (clist->xor_gc, 1,
|
|
|
|
GDK_LINE_SOLID, 0, 0);
|
|
|
|
clist->focus_row = row;
|
|
|
|
gtk_clist_draw_focus (widget);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gdk_gc_set_line_attributes (clist->xor_gc, 1,
|
|
|
|
GDK_LINE_SOLID, 0, 0);
|
|
|
|
clist->focus_row = row;
|
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
}
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
else if (row != clist->focus_row)
|
1998-10-19 22:46:38 +00:00
|
|
|
{
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (GTK_WIDGET_HAS_FOCUS(widget))
|
|
|
|
{
|
|
|
|
gtk_clist_draw_focus (widget);
|
|
|
|
clist->focus_row = row;
|
|
|
|
gtk_clist_draw_focus (widget);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
clist->focus_row = row;
|
1998-10-19 22:46:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (!GTK_WIDGET_HAS_FOCUS(widget))
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_widget_grab_focus (widget);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (button_actions & GTK_BUTTON_SELECTS)
|
1998-10-19 22:46:38 +00:00
|
|
|
{
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
switch (clist->selection_mode)
|
1998-10-19 22:46:38 +00:00
|
|
|
{
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
case GTK_SELECTION_SINGLE:
|
|
|
|
case GTK_SELECTION_MULTIPLE:
|
|
|
|
if (event->type != GDK_BUTTON_PRESS)
|
|
|
|
gtk_signal_emit (GTK_OBJECT (clist),
|
|
|
|
clist_signals[SELECT_ROW],
|
|
|
|
row, column, event);
|
|
|
|
else
|
|
|
|
clist->anchor = row;
|
|
|
|
break;
|
|
|
|
case GTK_SELECTION_BROWSE:
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_signal_emit (GTK_OBJECT (clist),
|
|
|
|
clist_signals[SELECT_ROW],
|
|
|
|
row, column, event);
|
|
|
|
break;
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
case GTK_SELECTION_EXTENDED:
|
|
|
|
if (event->type != GDK_BUTTON_PRESS)
|
1998-10-19 22:46:38 +00:00
|
|
|
{
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (clist->anchor != -1)
|
1998-10-19 22:46:38 +00:00
|
|
|
{
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
update_extended_selection (clist, clist->focus_row);
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->resync_selection
|
|
|
|
(clist, (GdkEvent *) event);
|
1998-10-19 22:46:38 +00:00
|
|
|
}
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
gtk_signal_emit (GTK_OBJECT (clist),
|
|
|
|
clist_signals[SELECT_ROW],
|
|
|
|
row, column, event);
|
|
|
|
break;
|
1998-10-19 22:46:38 +00:00
|
|
|
}
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
|
|
|
|
if (event->state & GDK_CONTROL_MASK)
|
1998-10-19 22:46:38 +00:00
|
|
|
{
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (event->state & GDK_SHIFT_MASK)
|
|
|
|
{
|
|
|
|
if (clist->anchor < 0)
|
|
|
|
{
|
|
|
|
g_list_free (clist->undo_selection);
|
|
|
|
g_list_free (clist->undo_unselection);
|
|
|
|
clist->undo_selection = NULL;
|
|
|
|
clist->undo_unselection = NULL;
|
|
|
|
clist->anchor = old_row;
|
|
|
|
clist->drag_pos = old_row;
|
|
|
|
clist->undo_anchor = old_row;
|
|
|
|
}
|
|
|
|
update_extended_selection (clist, clist->focus_row);
|
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
else
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
{
|
|
|
|
if (clist->anchor == -1)
|
|
|
|
set_anchor (clist, TRUE, row, old_row);
|
|
|
|
else
|
|
|
|
update_extended_selection (clist,
|
|
|
|
clist->focus_row);
|
|
|
|
}
|
|
|
|
break;
|
1998-10-19 22:46:38 +00:00
|
|
|
}
|
1998-01-03 03:31:03 +00:00
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (event->state & GDK_SHIFT_MASK)
|
|
|
|
{
|
|
|
|
set_anchor (clist, FALSE, old_row, old_row);
|
|
|
|
update_extended_selection (clist, clist->focus_row);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (clist->anchor == -1)
|
|
|
|
set_anchor (clist, FALSE, row, old_row);
|
|
|
|
else
|
|
|
|
update_extended_selection (clist, clist->focus_row);
|
|
|
|
break;
|
|
|
|
default:
|
1998-10-19 22:46:38 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return FALSE;
|
1998-01-24 19:14:42 +00:00
|
|
|
}
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* press on resize windows */
|
|
|
|
for (i = 0; i < clist->columns; i++)
|
|
|
|
if (clist->column[i].resizeable && clist->column[i].window &&
|
|
|
|
event->window == clist->column[i].window)
|
|
|
|
{
|
1999-01-17 23:44:18 +00:00
|
|
|
gpointer drag_data;
|
|
|
|
|
1999-01-18 23:02:08 +00:00
|
|
|
if (gdk_pointer_grab (clist->column[i].window, FALSE,
|
|
|
|
GDK_POINTER_MOTION_HINT_MASK |
|
|
|
|
GDK_BUTTON1_MOTION_MASK |
|
|
|
|
GDK_BUTTON_RELEASE_MASK,
|
|
|
|
NULL, NULL, event->time))
|
|
|
|
return FALSE;
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_grab_add (widget);
|
|
|
|
GTK_CLIST_SET_FLAG (clist, CLIST_IN_DRAG);
|
1998-02-05 08:40:06 +00:00
|
|
|
|
1999-01-17 23:44:18 +00:00
|
|
|
/* block attached dnd signal handler */
|
|
|
|
drag_data = gtk_object_get_data (GTK_OBJECT (clist), "gtk-site-data");
|
|
|
|
if (drag_data)
|
|
|
|
gtk_signal_handler_block_by_data (GTK_OBJECT (clist), drag_data);
|
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (!GTK_WIDGET_HAS_FOCUS(widget))
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_widget_grab_focus (widget);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist->drag_pos = i;
|
|
|
|
clist->x_drag = (COLUMN_LEFT_XPIXEL(clist, i) + COLUMN_INSET +
|
|
|
|
clist->column[i].area.width + CELL_SPACING);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (GTK_CLIST_ADD_MODE(clist))
|
1998-10-19 22:46:38 +00:00
|
|
|
gdk_gc_set_line_attributes (clist->xor_gc, 1, GDK_LINE_SOLID, 0, 0);
|
|
|
|
draw_xor_line (clist);
|
|
|
|
}
|
|
|
|
return FALSE;
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
static gint
|
|
|
|
gtk_clist_button_release (GtkWidget *widget,
|
|
|
|
GdkEventButton *event)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GtkCList *clist;
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
gint button_actions;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_val_if_fail (widget != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_CLIST (widget), FALSE);
|
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
1998-01-19 09:59:20 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist = GTK_CLIST (widget);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
button_actions = clist->button_actions[event->button - 1];
|
|
|
|
if (button_actions == GTK_BUTTON_IGNORED)
|
1998-10-19 22:46:38 +00:00
|
|
|
return FALSE;
|
1998-10-04 10:52:52 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* release on resize windows */
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (GTK_CLIST_IN_DRAG(clist))
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1999-01-17 23:44:18 +00:00
|
|
|
gpointer drag_data;
|
1998-10-19 22:46:38 +00:00
|
|
|
gint width;
|
|
|
|
gint x;
|
|
|
|
gint i;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
i = clist->drag_pos;
|
|
|
|
clist->drag_pos = -1;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1999-01-17 23:44:18 +00:00
|
|
|
/* unblock attached dnd signal handler */
|
|
|
|
drag_data = gtk_object_get_data (GTK_OBJECT (clist), "gtk-site-data");
|
|
|
|
if (drag_data)
|
|
|
|
gtk_signal_handler_unblock_by_data (GTK_OBJECT (clist), drag_data);
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
GTK_CLIST_UNSET_FLAG (clist, CLIST_IN_DRAG);
|
|
|
|
gtk_widget_get_pointer (widget, &x, NULL);
|
|
|
|
gtk_grab_remove (widget);
|
|
|
|
gdk_pointer_ungrab (event->time);
|
|
|
|
|
|
|
|
if (clist->x_drag >= 0)
|
|
|
|
draw_xor_line (clist);
|
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (GTK_CLIST_ADD_MODE(clist))
|
1998-01-19 09:59:20 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
gdk_gc_set_line_attributes (clist->xor_gc, 1,
|
|
|
|
GDK_LINE_ON_OFF_DASH, 0, 0);
|
|
|
|
gdk_gc_set_dashes (clist->xor_gc, 0, "\4\4", 2);
|
1998-10-07 00:03:24 +00:00
|
|
|
}
|
1998-01-19 09:59:20 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
width = new_column_width (clist, i, &x);
|
|
|
|
gtk_clist_set_column_width (clist, i, width);
|
|
|
|
return FALSE;
|
|
|
|
}
|
1998-10-07 00:03:24 +00:00
|
|
|
|
1998-12-19 01:18:08 +00:00
|
|
|
if (clist->drag_button == event->button)
|
1998-10-19 22:46:38 +00:00
|
|
|
{
|
|
|
|
gint row;
|
|
|
|
gint column;
|
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
clist->drag_button = 0;
|
|
|
|
clist->click_cell.row = -1;
|
|
|
|
clist->click_cell.column = -1;
|
1998-10-07 00:03:24 +00:00
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
remove_grab (clist);
|
|
|
|
|
|
|
|
if (button_actions & GTK_BUTTON_SELECTS)
|
|
|
|
{
|
|
|
|
switch (clist->selection_mode)
|
1998-10-19 22:46:38 +00:00
|
|
|
{
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
case GTK_SELECTION_EXTENDED:
|
|
|
|
if (!(event->state & GDK_SHIFT_MASK) ||
|
1999-04-30 11:48:42 +00:00
|
|
|
!GTK_WIDGET_CAN_FOCUS (widget) ||
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
event->x < 0 || event->x >= clist->clist_window_width ||
|
|
|
|
event->y < 0 || event->y >= clist->clist_window_height)
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->resync_selection
|
|
|
|
(clist, (GdkEvent *) event);
|
|
|
|
break;
|
|
|
|
case GTK_SELECTION_SINGLE:
|
|
|
|
case GTK_SELECTION_MULTIPLE:
|
|
|
|
if (get_selection_info (clist, event->x, event->y,
|
|
|
|
&row, &column))
|
|
|
|
{
|
|
|
|
if (row >= 0 && row < clist->rows && clist->anchor == row)
|
|
|
|
toggle_row (clist, row, column, (GdkEvent *) event);
|
|
|
|
}
|
|
|
|
clist->anchor = -1;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
1998-10-19 22:46:38 +00:00
|
|
|
}
|
|
|
|
}
|
1998-10-07 00:03:24 +00:00
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
return FALSE;
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
static gint
|
|
|
|
gtk_clist_motion (GtkWidget *widget,
|
|
|
|
GdkEventMotion *event)
|
1998-03-05 09:34:36 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GtkCList *clist;
|
|
|
|
gint x;
|
|
|
|
gint y;
|
|
|
|
gint row;
|
|
|
|
gint new_width;
|
1998-12-21 21:09:37 +00:00
|
|
|
gint button_actions = 0;
|
1998-03-05 09:34:36 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_val_if_fail (widget != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_CLIST (widget), FALSE);
|
1998-03-05 09:34:36 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist = GTK_CLIST (widget);
|
1998-12-21 21:09:37 +00:00
|
|
|
if (!(gdk_pointer_is_grabbed () && GTK_WIDGET_HAS_GRAB (clist)))
|
1998-10-19 22:46:38 +00:00
|
|
|
return FALSE;
|
1998-03-05 09:34:36 +00:00
|
|
|
|
1998-12-21 21:09:37 +00:00
|
|
|
if (clist->drag_button > 0)
|
|
|
|
button_actions = clist->button_actions[clist->drag_button - 1];
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
|
|
|
|
if (GTK_CLIST_IN_DRAG(clist))
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
if (event->is_hint || event->window != widget->window)
|
|
|
|
gtk_widget_get_pointer (widget, &x, NULL);
|
|
|
|
else
|
|
|
|
x = event->x;
|
|
|
|
|
|
|
|
new_width = new_column_width (clist, clist->drag_pos, &x);
|
|
|
|
if (x != clist->x_drag)
|
|
|
|
{
|
|
|
|
/* x_drag < 0 indicates that the xor line is already invisible */
|
|
|
|
if (clist->x_drag >= 0)
|
|
|
|
draw_xor_line (clist);
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist->x_drag = x;
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (clist->x_drag >= 0)
|
|
|
|
draw_xor_line (clist);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (new_width <= MAX (COLUMN_MIN_WIDTH + 1,
|
|
|
|
clist->column[clist->drag_pos].min_width + 1))
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
if (COLUMN_LEFT_XPIXEL (clist, clist->drag_pos) < 0 && x < 0)
|
|
|
|
gtk_clist_moveto (clist, -1, clist->drag_pos, 0, 0);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
if (clist->column[clist->drag_pos].max_width >= COLUMN_MIN_WIDTH &&
|
|
|
|
new_width >= clist->column[clist->drag_pos].max_width)
|
|
|
|
{
|
|
|
|
if (COLUMN_LEFT_XPIXEL (clist, clist->drag_pos) + new_width >
|
|
|
|
clist->clist_window_width && x < 0)
|
|
|
|
move_horizontal (clist,
|
|
|
|
COLUMN_LEFT_XPIXEL (clist, clist->drag_pos) +
|
|
|
|
new_width - clist->clist_window_width +
|
|
|
|
COLUMN_INSET + CELL_SPACING);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (event->is_hint || event->window != clist->clist_window)
|
|
|
|
gdk_window_get_pointer (clist->clist_window, &x, &y, NULL);
|
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (GTK_CLIST_REORDERABLE(clist) && button_actions & GTK_BUTTON_DRAGS)
|
|
|
|
{
|
|
|
|
/* delayed drag start */
|
1998-12-19 01:18:08 +00:00
|
|
|
if (event->window == clist->clist_window &&
|
|
|
|
clist->click_cell.row >= 0 && clist->click_cell.column >= 0 &&
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
(y < 0 || y >= clist->clist_window_height ||
|
|
|
|
x < 0 || x >= clist->clist_window_width ||
|
|
|
|
y < ROW_TOP_YPIXEL (clist, clist->click_cell.row) ||
|
|
|
|
y >= (ROW_TOP_YPIXEL (clist, clist->click_cell.row) +
|
|
|
|
clist->row_height) ||
|
|
|
|
x < COLUMN_LEFT_XPIXEL (clist, clist->click_cell.column) ||
|
|
|
|
x >= (COLUMN_LEFT_XPIXEL(clist, clist->click_cell.column) +
|
|
|
|
clist->column[clist->click_cell.column].area.width)))
|
|
|
|
{
|
|
|
|
GtkTargetList *target_list;
|
|
|
|
|
|
|
|
target_list = gtk_target_list_new (&clist_target_table, 1);
|
1999-01-08 00:21:36 +00:00
|
|
|
gtk_drag_begin (widget, target_list, GDK_ACTION_MOVE,
|
|
|
|
clist->drag_button, (GdkEvent *)event);
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* horizontal autoscrolling */
|
1998-11-07 14:29:22 +00:00
|
|
|
if (clist->hadjustment && LIST_WIDTH (clist) > clist->clist_window_width &&
|
1998-10-19 22:46:38 +00:00
|
|
|
(x < 0 || x >= clist->clist_window_width))
|
|
|
|
{
|
|
|
|
if (clist->htimer)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
clist->htimer = gtk_timeout_add
|
|
|
|
(SCROLL_TIME, (GtkFunction) horizontal_timeout, clist);
|
|
|
|
|
1998-11-05 15:44:22 +00:00
|
|
|
if (!((x < 0 && clist->hadjustment->value == 0) ||
|
1998-10-19 22:46:38 +00:00
|
|
|
(x >= clist->clist_window_width &&
|
1998-11-05 15:44:22 +00:00
|
|
|
clist->hadjustment->value ==
|
1998-10-19 22:46:38 +00:00
|
|
|
LIST_WIDTH (clist) - clist->clist_window_width)))
|
|
|
|
{
|
|
|
|
if (x < 0)
|
|
|
|
move_horizontal (clist, -1 + (x/2));
|
1998-07-15 23:40:00 +00:00
|
|
|
else
|
1998-10-19 22:46:38 +00:00
|
|
|
move_horizontal (clist, 1 + (x - clist->clist_window_width) / 2);
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (GTK_CLIST_IN_DRAG(clist))
|
1998-10-19 22:46:38 +00:00
|
|
|
return FALSE;
|
1998-03-05 09:34:36 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* vertical autoscrolling */
|
|
|
|
row = ROW_FROM_YPIXEL (clist, y);
|
1998-03-05 09:34:36 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* don't scroll on last pixel row if it's a cell spacing */
|
1998-11-07 14:29:22 +00:00
|
|
|
if (y == clist->clist_window_height - 1 &&
|
1998-10-19 22:46:38 +00:00
|
|
|
y == ROW_TOP_YPIXEL (clist, row-1) + clist->row_height)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (LIST_HEIGHT (clist) > clist->clist_window_height &&
|
|
|
|
(y < 0 || y >= clist->clist_window_height))
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
if (clist->vtimer)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
clist->vtimer = gtk_timeout_add (SCROLL_TIME,
|
|
|
|
(GtkFunction) vertical_timeout, clist);
|
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (clist->drag_button &&
|
|
|
|
((y < 0 && clist->focus_row == 0) ||
|
|
|
|
(y >= clist->clist_window_height &&
|
|
|
|
clist->focus_row == clist->rows - 1)))
|
|
|
|
return FALSE;
|
1998-10-19 22:46:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
row = CLAMP (row, 0, clist->rows - 1);
|
|
|
|
|
1999-01-08 00:21:36 +00:00
|
|
|
if (button_actions & GTK_BUTTON_SELECTS &
|
|
|
|
!gtk_object_get_data (GTK_OBJECT (widget), "gtk-site-data"))
|
1998-10-19 22:46:38 +00:00
|
|
|
{
|
|
|
|
if (row == clist->focus_row)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
gtk_clist_draw_focus (widget);
|
|
|
|
clist->focus_row = row;
|
|
|
|
gtk_clist_draw_focus (widget);
|
|
|
|
|
|
|
|
switch (clist->selection_mode)
|
|
|
|
{
|
|
|
|
case GTK_SELECTION_BROWSE:
|
|
|
|
gtk_signal_emit (GTK_OBJECT (clist), clist_signals[SELECT_ROW],
|
|
|
|
clist->focus_row, -1, event);
|
|
|
|
break;
|
|
|
|
case GTK_SELECTION_EXTENDED:
|
|
|
|
update_extended_selection (clist, clist->focus_row);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
1998-03-05 09:34:36 +00:00
|
|
|
}
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (ROW_TOP_YPIXEL(clist, row) < 0)
|
|
|
|
move_vertical (clist, row, 0);
|
|
|
|
else if (ROW_TOP_YPIXEL(clist, row) + clist->row_height >
|
|
|
|
clist->clist_window_height)
|
|
|
|
move_vertical (clist, row, 1);
|
|
|
|
|
|
|
|
return FALSE;
|
1998-03-05 09:34:36 +00:00
|
|
|
}
|
|
|
|
|
1998-01-24 19:14:42 +00:00
|
|
|
static void
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_clist_size_request (GtkWidget *widget,
|
|
|
|
GtkRequisition *requisition)
|
1998-01-24 19:14:42 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GtkCList *clist;
|
1998-11-07 14:29:22 +00:00
|
|
|
gint i;
|
1998-01-24 19:14:42 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_if_fail (widget != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (widget));
|
|
|
|
g_return_if_fail (requisition != NULL);
|
1998-01-24 19:14:42 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist = GTK_CLIST (widget);
|
1998-01-24 19:14:42 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
requisition->width = 0;
|
|
|
|
requisition->height = 0;
|
1998-01-24 19:14:42 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* compute the size of the column title (title) area */
|
|
|
|
clist->column_title_area.height = 0;
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (GTK_CLIST_SHOW_TITLES(clist))
|
1998-10-19 22:46:38 +00:00
|
|
|
for (i = 0; i < clist->columns; i++)
|
|
|
|
if (clist->column[i].button)
|
|
|
|
{
|
1999-02-10 02:35:09 +00:00
|
|
|
GtkRequisition child_requisition;
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_widget_size_request (clist->column[i].button,
|
1999-02-10 02:35:09 +00:00
|
|
|
&child_requisition);
|
1998-10-19 22:46:38 +00:00
|
|
|
clist->column_title_area.height =
|
|
|
|
MAX (clist->column_title_area.height,
|
1999-02-10 02:35:09 +00:00
|
|
|
child_requisition.height);
|
1998-10-19 22:46:38 +00:00
|
|
|
}
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
requisition->width += (widget->style->klass->xthickness +
|
|
|
|
GTK_CONTAINER (widget)->border_width) * 2;
|
1998-11-05 15:44:22 +00:00
|
|
|
requisition->height += (clist->column_title_area.height +
|
|
|
|
(widget->style->klass->ythickness +
|
|
|
|
GTK_CONTAINER (widget)->border_width) * 2);
|
1998-11-07 14:29:22 +00:00
|
|
|
|
1998-12-02 03:40:03 +00:00
|
|
|
/* if (!clist->hadjustment) */
|
|
|
|
requisition->width += list_requisition_width (clist);
|
|
|
|
/* if (!clist->vadjustment) */
|
|
|
|
requisition->height += LIST_HEIGHT (clist);
|
1998-03-10 05:25:15 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
static void
|
|
|
|
gtk_clist_size_allocate (GtkWidget *widget,
|
|
|
|
GtkAllocation *allocation)
|
1998-01-19 09:59:20 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GtkCList *clist;
|
|
|
|
GtkAllocation clist_allocation;
|
|
|
|
gint border_width;
|
1998-01-19 09:59:20 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_if_fail (widget != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (widget));
|
|
|
|
g_return_if_fail (allocation != NULL);
|
1998-01-19 09:59:20 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist = GTK_CLIST (widget);
|
|
|
|
widget->allocation = *allocation;
|
|
|
|
border_width = GTK_CONTAINER (widget)->border_width;
|
1998-01-19 09:59:20 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (GTK_WIDGET_REALIZED (widget))
|
|
|
|
{
|
|
|
|
gdk_window_move_resize (widget->window,
|
|
|
|
allocation->x + border_width,
|
|
|
|
allocation->y + border_width,
|
|
|
|
allocation->width - border_width * 2,
|
|
|
|
allocation->height - border_width * 2);
|
|
|
|
}
|
1998-01-19 09:59:20 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* use internal allocation structure for all the math
|
|
|
|
* because it's easier than always subtracting the container
|
|
|
|
* border width */
|
|
|
|
clist->internal_allocation.x = 0;
|
|
|
|
clist->internal_allocation.y = 0;
|
1999-01-14 06:04:55 +00:00
|
|
|
clist->internal_allocation.width = MAX (1, (gint)allocation->width -
|
1998-10-19 22:46:38 +00:00
|
|
|
border_width * 2);
|
1999-01-14 06:04:55 +00:00
|
|
|
clist->internal_allocation.height = MAX (1, (gint)allocation->height -
|
1998-10-19 22:46:38 +00:00
|
|
|
border_width * 2);
|
|
|
|
|
|
|
|
/* allocate clist window assuming no scrollbars */
|
|
|
|
clist_allocation.x = (clist->internal_allocation.x +
|
|
|
|
widget->style->klass->xthickness);
|
|
|
|
clist_allocation.y = (clist->internal_allocation.y +
|
|
|
|
widget->style->klass->ythickness +
|
|
|
|
clist->column_title_area.height);
|
1999-01-14 06:04:55 +00:00
|
|
|
clist_allocation.width = MAX (1, (gint)clist->internal_allocation.width -
|
|
|
|
(2 * (gint)widget->style->klass->xthickness));
|
|
|
|
clist_allocation.height = MAX (1, (gint)clist->internal_allocation.height -
|
|
|
|
(2 * (gint)widget->style->klass->ythickness) -
|
|
|
|
(gint)clist->column_title_area.height);
|
1998-10-19 22:46:38 +00:00
|
|
|
|
|
|
|
clist->clist_window_width = clist_allocation.width;
|
|
|
|
clist->clist_window_height = clist_allocation.height;
|
|
|
|
|
|
|
|
if (GTK_WIDGET_REALIZED (widget))
|
|
|
|
{
|
|
|
|
gdk_window_move_resize (clist->clist_window,
|
|
|
|
clist_allocation.x,
|
|
|
|
clist_allocation.y,
|
|
|
|
clist_allocation.width,
|
|
|
|
clist_allocation.height);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* position the window which holds the column title buttons */
|
|
|
|
clist->column_title_area.x = widget->style->klass->xthickness;
|
|
|
|
clist->column_title_area.y = widget->style->klass->ythickness;
|
|
|
|
clist->column_title_area.width = clist_allocation.width;
|
|
|
|
|
|
|
|
if (GTK_WIDGET_REALIZED (widget))
|
|
|
|
{
|
|
|
|
gdk_window_move_resize (clist->title_window,
|
|
|
|
clist->column_title_area.x,
|
|
|
|
clist->column_title_area.y,
|
|
|
|
clist->column_title_area.width,
|
|
|
|
clist->column_title_area.height);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* column button allocation */
|
1998-11-11 20:46:51 +00:00
|
|
|
size_allocate_columns (clist, FALSE);
|
1998-10-19 22:46:38 +00:00
|
|
|
size_allocate_title_buttons (clist);
|
1998-01-19 09:59:20 +00:00
|
|
|
|
1998-11-07 14:29:22 +00:00
|
|
|
adjust_adjustments (clist, TRUE);
|
1998-01-19 09:59:20 +00:00
|
|
|
}
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* GTKCONTAINER
|
|
|
|
* gtk_clist_forall
|
|
|
|
*/
|
1998-01-03 03:31:03 +00:00
|
|
|
static void
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_clist_forall (GtkContainer *container,
|
|
|
|
gboolean include_internals,
|
|
|
|
GtkCallback callback,
|
|
|
|
gpointer callback_data)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
|
|
|
GtkCList *clist;
|
1998-11-05 15:44:22 +00:00
|
|
|
guint i;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_if_fail (container != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (container));
|
|
|
|
g_return_if_fail (callback != NULL);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-11-05 15:44:22 +00:00
|
|
|
if (!include_internals)
|
|
|
|
return;
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist = GTK_CLIST (container);
|
|
|
|
|
1998-11-05 15:44:22 +00:00
|
|
|
/* callback for the column buttons */
|
|
|
|
for (i = 0; i < clist->columns; i++)
|
|
|
|
if (clist->column[i].button)
|
|
|
|
(*callback) (clist->column[i].button, callback_data);
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* PRIVATE DRAWING FUNCTIONS
|
|
|
|
* get_cell_style
|
|
|
|
* draw_cell_pixmap
|
|
|
|
* draw_row
|
|
|
|
* draw_rows
|
|
|
|
* draw_xor_line
|
1998-11-28 01:56:09 +00:00
|
|
|
* clist_refresh
|
1998-01-24 19:14:42 +00:00
|
|
|
*/
|
1998-01-03 03:31:03 +00:00
|
|
|
static void
|
1998-10-19 22:46:38 +00:00
|
|
|
get_cell_style (GtkCList *clist,
|
|
|
|
GtkCListRow *clist_row,
|
|
|
|
gint state,
|
|
|
|
gint column,
|
|
|
|
GtkStyle **style,
|
|
|
|
GdkGC **fg_gc,
|
|
|
|
GdkGC **bg_gc)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-12-03 21:41:14 +00:00
|
|
|
gint fg_state;
|
|
|
|
|
1998-12-16 00:52:46 +00:00
|
|
|
if ((state == GTK_STATE_NORMAL) &&
|
1998-12-03 21:41:14 +00:00
|
|
|
(GTK_WIDGET (clist)->state == GTK_STATE_INSENSITIVE))
|
|
|
|
fg_state = GTK_STATE_INSENSITIVE;
|
|
|
|
else
|
|
|
|
fg_state = state;
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (clist_row->cell[column].style)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
if (style)
|
|
|
|
*style = clist_row->cell[column].style;
|
|
|
|
if (fg_gc)
|
1998-12-03 21:41:14 +00:00
|
|
|
*fg_gc = clist_row->cell[column].style->fg_gc[fg_state];
|
1998-12-16 00:52:46 +00:00
|
|
|
if (bg_gc) {
|
|
|
|
if (state == GTK_STATE_SELECTED)
|
|
|
|
*bg_gc = clist_row->cell[column].style->bg_gc[state];
|
|
|
|
else
|
|
|
|
*bg_gc = clist_row->cell[column].style->base_gc[state];
|
|
|
|
}
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
else if (clist_row->style)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
if (style)
|
|
|
|
*style = clist_row->style;
|
|
|
|
if (fg_gc)
|
1998-12-03 21:41:14 +00:00
|
|
|
*fg_gc = clist_row->style->fg_gc[fg_state];
|
1998-12-16 00:52:46 +00:00
|
|
|
if (bg_gc) {
|
|
|
|
if (state == GTK_STATE_SELECTED)
|
|
|
|
*bg_gc = clist_row->style->bg_gc[state];
|
|
|
|
else
|
|
|
|
*bg_gc = clist_row->style->base_gc[state];
|
|
|
|
}
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
else
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
if (style)
|
|
|
|
*style = GTK_WIDGET (clist)->style;
|
|
|
|
if (fg_gc)
|
1998-12-03 21:41:14 +00:00
|
|
|
*fg_gc = GTK_WIDGET (clist)->style->fg_gc[fg_state];
|
1998-12-16 00:52:46 +00:00
|
|
|
if (bg_gc) {
|
|
|
|
if (state == GTK_STATE_SELECTED)
|
|
|
|
*bg_gc = GTK_WIDGET (clist)->style->bg_gc[state];
|
|
|
|
else
|
|
|
|
*bg_gc = GTK_WIDGET (clist)->style->base_gc[state];
|
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
|
|
|
|
if (state != GTK_STATE_SELECTED)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
if (fg_gc && clist_row->fg_set)
|
|
|
|
*fg_gc = clist->fg_gc;
|
|
|
|
if (bg_gc && clist_row->bg_set)
|
|
|
|
*bg_gc = clist->bg_gc;
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
draw_cell_pixmap (GdkWindow *window,
|
|
|
|
GdkRectangle *clip_rectangle,
|
|
|
|
GdkGC *fg_gc,
|
|
|
|
GdkPixmap *pixmap,
|
|
|
|
GdkBitmap *mask,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
|
|
|
{
|
|
|
|
gint xsrc = 0;
|
|
|
|
gint ysrc = 0;
|
|
|
|
|
|
|
|
if (mask)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
gdk_gc_set_clip_mask (fg_gc, mask);
|
|
|
|
gdk_gc_set_clip_origin (fg_gc, x, y);
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (x < clip_rectangle->x)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
xsrc = clip_rectangle->x - x;
|
|
|
|
width -= xsrc;
|
|
|
|
x = clip_rectangle->x;
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
if (x + width > clip_rectangle->x + clip_rectangle->width)
|
|
|
|
width = clip_rectangle->x + clip_rectangle->width - x;
|
|
|
|
|
|
|
|
if (y < clip_rectangle->y)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
ysrc = clip_rectangle->y - y;
|
|
|
|
height -= ysrc;
|
|
|
|
y = clip_rectangle->y;
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
if (y + height > clip_rectangle->y + clip_rectangle->height)
|
|
|
|
height = clip_rectangle->y + clip_rectangle->height - y;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
gdk_draw_pixmap (window, fg_gc, pixmap, xsrc, ysrc, x, y, width, height);
|
|
|
|
gdk_gc_set_clip_origin (fg_gc, 0, 0);
|
1999-02-25 00:04:18 +00:00
|
|
|
if (mask)
|
|
|
|
gdk_gc_set_clip_mask (fg_gc, NULL);
|
1998-10-19 22:46:38 +00:00
|
|
|
|
|
|
|
return x + MAX (width, 0);
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1998-10-19 22:46:38 +00:00
|
|
|
draw_row (GtkCList *clist,
|
|
|
|
GdkRectangle *area,
|
|
|
|
gint row,
|
|
|
|
GtkCListRow *clist_row)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GtkWidget *widget;
|
|
|
|
GdkRectangle *rect;
|
|
|
|
GdkRectangle row_rectangle;
|
|
|
|
GdkRectangle cell_rectangle;
|
|
|
|
GdkRectangle clip_rectangle;
|
|
|
|
GdkRectangle intersect_rectangle;
|
1999-02-06 00:21:56 +00:00
|
|
|
gint last_column;
|
1998-10-19 22:46:38 +00:00
|
|
|
gint state;
|
|
|
|
gint i;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_if_fail (clist != NULL);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* bail now if we arn't drawable yet */
|
|
|
|
if (!GTK_WIDGET_DRAWABLE (clist) || row < 0 || row >= clist->rows)
|
|
|
|
return;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
widget = GTK_WIDGET (clist);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* if the function is passed the pointer to the row instead of null,
|
|
|
|
* it avoids this expensive lookup */
|
|
|
|
if (!clist_row)
|
|
|
|
clist_row = (g_list_nth (clist->row_list, row))->data;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* rectangle of the entire row */
|
|
|
|
row_rectangle.x = 0;
|
|
|
|
row_rectangle.y = ROW_TOP_YPIXEL (clist, row);
|
|
|
|
row_rectangle.width = clist->clist_window_width;
|
|
|
|
row_rectangle.height = clist->row_height;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* rectangle of the cell spacing above the row */
|
|
|
|
cell_rectangle.x = 0;
|
|
|
|
cell_rectangle.y = row_rectangle.y - CELL_SPACING;
|
|
|
|
cell_rectangle.width = row_rectangle.width;
|
|
|
|
cell_rectangle.height = CELL_SPACING;
|
1998-01-31 03:33:02 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* rectangle used to clip drawing operations, it's y and height
|
|
|
|
* positions only need to be set once, so we set them once here.
|
|
|
|
* the x and width are set withing the drawing loop below once per
|
|
|
|
* column */
|
|
|
|
clip_rectangle.y = row_rectangle.y;
|
|
|
|
clip_rectangle.height = row_rectangle.height;
|
1998-02-13 18:41:18 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (clist_row->state == GTK_STATE_NORMAL)
|
1998-01-31 03:33:02 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
if (clist_row->fg_set)
|
|
|
|
gdk_gc_set_foreground (clist->fg_gc, &clist_row->foreground);
|
|
|
|
if (clist_row->bg_set)
|
|
|
|
gdk_gc_set_foreground (clist->bg_gc, &clist_row->background);
|
|
|
|
}
|
1998-12-16 00:52:46 +00:00
|
|
|
|
|
|
|
state = clist_row->state;
|
1998-10-19 22:46:38 +00:00
|
|
|
|
|
|
|
/* draw the cell borders and background */
|
|
|
|
if (area)
|
|
|
|
{
|
|
|
|
rect = &intersect_rectangle;
|
|
|
|
if (gdk_rectangle_intersect (area, &cell_rectangle,
|
|
|
|
&intersect_rectangle))
|
|
|
|
gdk_draw_rectangle (clist->clist_window,
|
1998-12-16 00:52:46 +00:00
|
|
|
widget->style->base_gc[GTK_STATE_ACTIVE],
|
1998-10-19 22:46:38 +00:00
|
|
|
TRUE,
|
|
|
|
intersect_rectangle.x,
|
|
|
|
intersect_rectangle.y,
|
|
|
|
intersect_rectangle.width,
|
|
|
|
intersect_rectangle.height);
|
|
|
|
|
|
|
|
/* the last row has to clear it's bottom cell spacing too */
|
|
|
|
if (clist_row == clist->row_list_end->data)
|
1998-01-31 03:33:02 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
cell_rectangle.y += clist->row_height + CELL_SPACING;
|
|
|
|
|
|
|
|
if (gdk_rectangle_intersect (area, &cell_rectangle,
|
|
|
|
&intersect_rectangle))
|
|
|
|
gdk_draw_rectangle (clist->clist_window,
|
1998-12-16 00:52:46 +00:00
|
|
|
widget->style->base_gc[GTK_STATE_ACTIVE],
|
1998-10-19 22:46:38 +00:00
|
|
|
TRUE,
|
|
|
|
intersect_rectangle.x,
|
|
|
|
intersect_rectangle.y,
|
|
|
|
intersect_rectangle.width,
|
|
|
|
intersect_rectangle.height);
|
1998-01-31 03:33:02 +00:00
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
|
|
|
|
if (!gdk_rectangle_intersect (area, &row_rectangle,&intersect_rectangle))
|
|
|
|
return;
|
|
|
|
|
1998-01-31 03:33:02 +00:00
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
rect = &clip_rectangle;
|
|
|
|
gdk_draw_rectangle (clist->clist_window,
|
1998-12-16 00:52:46 +00:00
|
|
|
widget->style->base_gc[GTK_STATE_ACTIVE],
|
1998-10-19 22:46:38 +00:00
|
|
|
TRUE,
|
|
|
|
cell_rectangle.x,
|
|
|
|
cell_rectangle.y,
|
|
|
|
cell_rectangle.width,
|
|
|
|
cell_rectangle.height);
|
1998-01-31 03:33:02 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* the last row has to clear it's bottom cell spacing too */
|
|
|
|
if (clist_row == clist->row_list_end->data)
|
|
|
|
{
|
|
|
|
cell_rectangle.y += clist->row_height + CELL_SPACING;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
gdk_draw_rectangle (clist->clist_window,
|
1998-12-16 00:52:46 +00:00
|
|
|
widget->style->base_gc[GTK_STATE_ACTIVE],
|
1998-10-19 22:46:38 +00:00
|
|
|
TRUE,
|
|
|
|
cell_rectangle.x,
|
|
|
|
cell_rectangle.y,
|
|
|
|
cell_rectangle.width,
|
|
|
|
cell_rectangle.height);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-02-06 00:21:56 +00:00
|
|
|
for (last_column = clist->columns - 1;
|
|
|
|
last_column >= 0 && !clist->column[last_column].visible; last_column--)
|
|
|
|
;
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* iterate and draw all the columns (row cells) and draw their contents */
|
|
|
|
for (i = 0; i < clist->columns; i++)
|
|
|
|
{
|
|
|
|
GtkStyle *style;
|
|
|
|
GdkGC *fg_gc;
|
|
|
|
GdkGC *bg_gc;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
gint width;
|
|
|
|
gint height;
|
|
|
|
gint pixmap_width;
|
|
|
|
gint offset = 0;
|
|
|
|
gint row_center_offset;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (!clist->column[i].visible)
|
|
|
|
continue;
|
1998-02-13 18:41:18 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
get_cell_style (clist, clist_row, state, i, &style, &fg_gc, &bg_gc);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clip_rectangle.x = clist->column[i].area.x + clist->hoffset;
|
|
|
|
clip_rectangle.width = clist->column[i].area.width;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* calculate clipping region clipping region */
|
|
|
|
clip_rectangle.x -= COLUMN_INSET + CELL_SPACING;
|
|
|
|
clip_rectangle.width += (2 * COLUMN_INSET + CELL_SPACING +
|
1999-02-06 00:21:56 +00:00
|
|
|
(i == last_column) * CELL_SPACING);
|
1998-10-19 22:46:38 +00:00
|
|
|
|
|
|
|
if (area && !gdk_rectangle_intersect (area, &clip_rectangle,
|
|
|
|
&intersect_rectangle))
|
|
|
|
continue;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
gdk_draw_rectangle (clist->clist_window, bg_gc, TRUE,
|
|
|
|
rect->x, rect->y, rect->width, rect->height);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clip_rectangle.x += COLUMN_INSET + CELL_SPACING;
|
|
|
|
clip_rectangle.width -= (2 * COLUMN_INSET + CELL_SPACING +
|
1999-02-06 00:21:56 +00:00
|
|
|
(i == last_column) * CELL_SPACING);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* calculate real width for column justification */
|
|
|
|
pixmap_width = 0;
|
|
|
|
offset = 0;
|
|
|
|
switch (clist_row->cell[i].type)
|
|
|
|
{
|
|
|
|
case GTK_CELL_TEXT:
|
|
|
|
width = gdk_string_width (style->font,
|
|
|
|
GTK_CELL_TEXT (clist_row->cell[i])->text);
|
|
|
|
break;
|
|
|
|
case GTK_CELL_PIXMAP:
|
|
|
|
gdk_window_get_size (GTK_CELL_PIXMAP (clist_row->cell[i])->pixmap,
|
|
|
|
&pixmap_width, &height);
|
|
|
|
width = pixmap_width;
|
|
|
|
break;
|
|
|
|
case GTK_CELL_PIXTEXT:
|
|
|
|
gdk_window_get_size (GTK_CELL_PIXTEXT (clist_row->cell[i])->pixmap,
|
|
|
|
&pixmap_width, &height);
|
|
|
|
width = (pixmap_width +
|
|
|
|
GTK_CELL_PIXTEXT (clist_row->cell[i])->spacing +
|
|
|
|
gdk_string_width (style->font,
|
|
|
|
GTK_CELL_PIXTEXT
|
|
|
|
(clist_row->cell[i])->text));
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
continue;
|
|
|
|
break;
|
|
|
|
}
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
switch (clist->column[i].justification)
|
|
|
|
{
|
|
|
|
case GTK_JUSTIFY_LEFT:
|
|
|
|
offset = clip_rectangle.x + clist_row->cell[i].horizontal;
|
|
|
|
break;
|
|
|
|
case GTK_JUSTIFY_RIGHT:
|
|
|
|
offset = (clip_rectangle.x + clist_row->cell[i].horizontal +
|
|
|
|
clip_rectangle.width - width);
|
|
|
|
break;
|
|
|
|
case GTK_JUSTIFY_CENTER:
|
|
|
|
case GTK_JUSTIFY_FILL:
|
|
|
|
offset = (clip_rectangle.x + clist_row->cell[i].horizontal +
|
|
|
|
(clip_rectangle.width / 2) - (width / 2));
|
|
|
|
break;
|
|
|
|
};
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* Draw Text and/or Pixmap */
|
|
|
|
switch (clist_row->cell[i].type)
|
|
|
|
{
|
|
|
|
case GTK_CELL_PIXMAP:
|
|
|
|
draw_cell_pixmap (clist->clist_window, &clip_rectangle, fg_gc,
|
|
|
|
GTK_CELL_PIXMAP (clist_row->cell[i])->pixmap,
|
|
|
|
GTK_CELL_PIXMAP (clist_row->cell[i])->mask,
|
|
|
|
offset,
|
|
|
|
clip_rectangle.y + clist_row->cell[i].vertical +
|
|
|
|
(clip_rectangle.height - height) / 2,
|
|
|
|
pixmap_width, height);
|
|
|
|
break;
|
|
|
|
case GTK_CELL_PIXTEXT:
|
|
|
|
offset =
|
|
|
|
draw_cell_pixmap (clist->clist_window, &clip_rectangle, fg_gc,
|
|
|
|
GTK_CELL_PIXTEXT (clist_row->cell[i])->pixmap,
|
|
|
|
GTK_CELL_PIXTEXT (clist_row->cell[i])->mask,
|
|
|
|
offset,
|
|
|
|
clip_rectangle.y + clist_row->cell[i].vertical+
|
|
|
|
(clip_rectangle.height - height) / 2,
|
|
|
|
pixmap_width, height);
|
|
|
|
offset += GTK_CELL_PIXTEXT (clist_row->cell[i])->spacing;
|
|
|
|
case GTK_CELL_TEXT:
|
|
|
|
if (style != GTK_WIDGET (clist)->style)
|
|
|
|
row_center_offset = (((clist->row_height - style->font->ascent -
|
|
|
|
style->font->descent - 1) / 2) + 1.5 +
|
|
|
|
style->font->ascent);
|
|
|
|
else
|
|
|
|
row_center_offset = clist->row_center_offset;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
gdk_gc_set_clip_rectangle (fg_gc, &clip_rectangle);
|
|
|
|
gdk_draw_string (clist->clist_window, style->font, fg_gc,
|
|
|
|
offset,
|
|
|
|
row_rectangle.y + row_center_offset +
|
|
|
|
clist_row->cell[i].vertical,
|
|
|
|
(clist_row->cell[i].type == GTK_CELL_PIXTEXT) ?
|
|
|
|
GTK_CELL_PIXTEXT (clist_row->cell[i])->text :
|
|
|
|
GTK_CELL_TEXT (clist_row->cell[i])->text);
|
|
|
|
gdk_gc_set_clip_rectangle (fg_gc, NULL);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* draw focus rectangle */
|
1999-02-08 21:03:54 +00:00
|
|
|
if (clist->focus_row == row &&
|
|
|
|
GTK_WIDGET_CAN_FOCUS (widget) && GTK_WIDGET_HAS_FOCUS(widget))
|
1998-10-19 22:46:38 +00:00
|
|
|
{
|
|
|
|
if (!area)
|
|
|
|
gdk_draw_rectangle (clist->clist_window, clist->xor_gc, FALSE,
|
|
|
|
row_rectangle.x, row_rectangle.y,
|
|
|
|
row_rectangle.width - 1, row_rectangle.height - 1);
|
|
|
|
else if (gdk_rectangle_intersect (area, &row_rectangle,
|
|
|
|
&intersect_rectangle))
|
|
|
|
{
|
|
|
|
gdk_gc_set_clip_rectangle (clist->xor_gc, &intersect_rectangle);
|
|
|
|
gdk_draw_rectangle (clist->clist_window, clist->xor_gc, FALSE,
|
|
|
|
row_rectangle.x, row_rectangle.y,
|
|
|
|
row_rectangle.width - 1,
|
|
|
|
row_rectangle.height - 1);
|
|
|
|
gdk_gc_set_clip_rectangle (clist->xor_gc, NULL);
|
|
|
|
}
|
|
|
|
}
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1998-10-19 22:46:38 +00:00
|
|
|
draw_rows (GtkCList *clist,
|
|
|
|
GdkRectangle *area)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GList *list;
|
|
|
|
GtkCListRow *clist_row;
|
1998-07-15 23:40:00 +00:00
|
|
|
gint i;
|
1998-10-19 22:46:38 +00:00
|
|
|
gint first_row;
|
|
|
|
gint last_row;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (clist->row_height == 0 ||
|
|
|
|
!GTK_WIDGET_DRAWABLE (clist))
|
1998-02-13 18:41:18 +00:00
|
|
|
return;
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (area)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
first_row = ROW_FROM_YPIXEL (clist, area->y);
|
|
|
|
last_row = ROW_FROM_YPIXEL (clist, area->y + area->height);
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
first_row = ROW_FROM_YPIXEL (clist, 0);
|
|
|
|
last_row = ROW_FROM_YPIXEL (clist, clist->clist_window_height);
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* this is a small special case which exposes the bottom cell line
|
1998-12-16 00:52:46 +00:00
|
|
|
* on the last row -- it might go away if I change the wall the cell
|
1998-10-19 22:46:38 +00:00
|
|
|
* spacings are drawn
|
|
|
|
*/
|
|
|
|
if (clist->rows == first_row)
|
|
|
|
first_row--;
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
list = g_list_nth (clist->row_list, first_row);
|
|
|
|
i = first_row;
|
|
|
|
while (list)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
clist_row = list->data;
|
|
|
|
list = list->next;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (i > last_row)
|
|
|
|
return;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
GTK_CLIST_CLASS_FW (clist)->draw_row (clist, area, i, clist_row);
|
|
|
|
i++;
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (!area)
|
Adapt cast macros to standard.
Fri Nov 19 10:34:41 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkgamma.h: Adapt cast macros to standard.
[ Merges from 1.2 ]
Tue Nov 16 10:15:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_path):
If translation does not include a '/', use entire
translation instead of crashing.
Sun Oct 31 22:21:11 1999 Tim Janik <timj@gtk.org>
* docs/gtk_tut.sgml:
s/gtk_accel_group_attach/gtk_window_add_accel_group/.
Sat Oct 30 09:09:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_target_list_remove): Use
g_list_remove_link, not g_list_remove.
[ From Geert Bevin <gbevin@thunderstorms.org> ]
Sun Oct 24 07:41:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkclist.c (real_undo_selection): commented out g_print()
statement upon unselection (how the heck did that slip in?).
Sat Oct 23 03:03:08 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_freeze):
(gtk_text_thaw): undraw/draw cursor here to avoid unnecessary scrolling
in frozen state (and aparently crashes). patch provided by Anders
Melchiorsen <and@kampsax.dtu.dk>.
Sat Oct 23 02:53:20 1999 Tim Janik <timj@gtk.org>
* fix insensitive default/focus widget activation,
reported by Matt Goodall <mgg@isotek.co.uk>.
* gtk/gtkwindow.c (gtk_window_key_press_event):
(gtk_window_activate_default):
(gtk_window_activate_focus):
return handled=FALSE for actiavtion of insensitive default
widgets. return handled=TRUE for activation of insensitive
focus widgets. don't activate in either case.
Tue Oct 19 09:55:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk-config.in (lib_gtk): Switch order of @x_cflags@
and $glib_cflags to match library order and in the
theory that an old version of GLib is more likely to
be in the include directory for X then vice-versa.
(Bug #2776)
Tue Oct 19 09:46:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always use LC_CTYPE
to determine the locale for fontsets, not LC_MESSAGES;
the user may want English messages with a handling
for non-English languages. (LC_CTYPE=ru_RU LC_MESSAGES=fr_FR
will still be broken) (Bug #2891)
Tue Oct 19 20:36:42 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Fixed the wrong number of "*"'s.
Tue Oct 19 12:15:13 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Changed the Korean default fontset.
Fri Oct 8 02:32:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): Fix bug
where when scrolling to the left or top double exposes
were done, causing major slowdowns.
Thu Oct 7 18:31:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always normalize codeset
names to lowercase and alphanumeric, before looking
them up.
* gtk/Makefile.am: Install codeset variant gtkrc files
with normalized names.
Thu Oct 7 22:52:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_popup_with_data): even
popup menus when the menu is already visible, but its parent
is still hidden, (happens after tornoff window got hidden).
Thu Oct 7 11:09:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (install-data-local): Fix
a typo where gtkrc.vi_VN.tcvn5712 wasn't getting
deleted, causing error messages on install.
Thu Oct 7 11:03:06 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtk[hv]paned.c (gtk_{h,v}paned_draw): Redraw
the handle as well, since we now sometimes ignore
exposes on the handle while resizing.
Wed Oct 6 18:02:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_append_default_pixmap_path): Fix stupid
extra g_free introduced in one of the last one or two
commits.
Wed Oct 6 16:38:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc*: Make naming of gtkrc files
consistent, put each style that a gtkrc.* file creates
in a unique namespace, remove old files before installing.
Wed Oct 6 14:31:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Avoid leaking memory when
gtk_rc_init is called multiple times. (Yes, people who
do that have bugs in their code.)
Tue Oct 5 11:36:57 PDT 1999 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: listing gtkrc in gtkconf_DATA seems to barf.
Remove it since it's generated by the Makefile anyway
Tue Oct 5 02:43:41 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputcommon.h (gdk_input_device_new): Free
device->info.axes for core pointer.
Thu Sep 30 13:55:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (destroy_idle_test): Rename idle to
idle_id, to deal with obsolete, broken C libraries.
Mon Sep 27 02:50:15 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkvscale.c (gtk_vscale_draw): Don't add in
allocation->x/y twice!
* gtk/gtkhscale.c: Make usage of gtk_hscale_pos_trough()
consistent with gtk_vscale_pos_trough().
Sun Sep 26 19:44:34 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_queue_resize): We may
be queueing a resize on a toplevel container between
the time we show it and when we map it. So, we need
to test GTK_WIDGET_VISIBLE() for toplevels, and only
use GTK_WIDGET_DRAWABLE() for child windows.
Thu Sep 23 16:41:03 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDADDS): Add GDK_WLIBS to LDADDS
(fixes bug #2144)
Fri Sep 24 00:51:45 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c (gtk_container_queue_resize): check for
container DRAWABLE (instead of VISIBLE), so we don't queue
resizes on non-toplevel containers.
Sun Sep 19 18:13:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.[ch]: Make the data argument
const guchar *.
Sat Sep 18 21:27:40 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: Try to behave sensibly if
the focus widget is the window itself. (Should
we allow this at all?)
Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_set_sensitive):
* gtk/gtknotebook.c (gtk_notebook_set_scrollable):
* gtk/gtknotebook.c (gtk_notebook_set_show_border):
* gtk/gtkclist.c (gtk_notebook_set_show_border): make gboolean args
in prototypes and implementations consistent (Tomas Ogren).
* gtk/gtklayout.c (gtk_layout_remove): unset GTK_IS_OFFSCREEN flag
before the widget is unparented (reported by damon).
* gtk/gtkdnd.c: make the cursor and icon data _unsigned_ char,
since we provide unsigned data anyways.
Thu Sep 16 21:32:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_set_tip): Delay
the call to gtk_tooltips_layout_text() until later.
* gtk/gtktooltips.c (gtk_tooltips_draw_tips):
Call gtk_widget_ensure_style() before using the style.
Wed Sep 15 02:52:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_event): Added workaround
for old widgets that don't propagate draws to all
children. (Namely gnome-dock for gnome-libs <= 1.0.16)
Tue Sep 14 19:22:19 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_queue_resize): don't queue the parent
for a redraw but just the widget that requested the resize.
Tue Sep 14 18:29:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c: added new widget level method
gtk_container_set_reallocate_redraws() and a GtkContainer flag
reallocate_redraws : 1 to reflect the setting, exported this through
the argument system as a boolean ::reallocate_redraws.
* gtk/gtkwidget.c (gtk_widget_size_allocate): when queueing redraws
on the widget because the allocation changes, do so as well for
widget->parent if the parent has reallocate_redraws set to TRUE.
with that containers requesting reallocation redraws get automatically
redrawn if their children changed allocation (this unfortunately
affects also other children that didn't change allocation, but we
cannot work around that before 1.3).
Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_idle_draw): only emit ::draw if width
_and_ height are >0 (not _or_).
* gtk/gtktable.c (gtk_table_remove): use gtk_widget_queue_resize()
instead of gtk_container_queue_resize(), which is a core gtk internal
function (must have been on crack when i queued that).
* gtk/gtkprivate.h: added new private flag GTK_FULLDRAW_PENDING, so
we can check more reliably if we want to discard expose events.
* gtk/gtkwidget.c: added setting/unsetting of the GTK_FULLDRAW_PENDING
flag.
* gtk/gtkwidget.c (gtk_widget_event): don't discard synthesized exposes,
we simply trust these events. for deciding whether to discard exposes,
check GTK_FULLDRAW_PENDING instead of RESIZE_PENDING.
Mon Sep 13 15:01:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore
queues of areas that are completely off screen.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fix broken
logic for handleboxes.
* gtk/gtkwidget.c (gtk_widget_queue_draw_data): Add santity
check on width/height.
Mon Sep 13 02:22:47 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: backed out Raja's recent VPATH build "improvements",
we are fine with using $@ the way we do (if we actually encounter
brokeness with $@ in VPATH builds because of additional path prefixes,
we need to use $(@F) actually).
Mon Sep 13 01:34:53 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c: renamed two variables, hopefully didn't introduce
short lived bugs, that would allow language bindings to do surgeries
to our guts.
Fri Sep 10 15:22:50 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_size_allocate): Fix typo
where comparison was being done against an uninitialized
value causing intermittant results depending on
compiler flags. Also make it clearer that we aren't
ever initializing the child as 0x0 (though this will
be caught in gtk_widget_size_allocate())
Fri Sep 10 10:06:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_transient_for): Move
gtk_window_unset_transient_for() call after we do checks
involving the old transient parent.
[ From Lance Capser <lmc@cyberhighway.net> ]
1999-09-07 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gtk.defs): Go back to using `touch' to create
an empty file.
Mon Sep 6 00:11:56 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (gtk_ctree_is_ancestor): return FALSE if node has
no children. (Reported by: Chris Rogers <gandalf@pobox.com>)
1999-09-03 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gen_sources): Improve VPATH builds.
`$@' is valid only in the build dir, not after we've done
`cd $srcdir'. Also use `test -f' instead of less portable
`test -e'.
Fri Sep 3 15:59:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (correct_cache_insert): Rewrite
for simplicity, and hopefully correctness.
(Fixes bug #1322, which was a segfault when
on some insertions with the properties around
the insertion set up just wrong.)
* gtk/gtktext.c (gtk_text_adjustment): When we receive
a "changed" signal, clamp the new value to the adjustment
bounds to avoid segfaulting if someone tries to change
the adjustment to a bogus value. (Bug #1795)
Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c: Ignore unexpected destroy notifies
for children, for toplevel windows handle them
like delete_event.
* gtk/gtkplug.c: Add an unrealize handler so that
we unref plug->socket_window when we are done
with it.
Fri Sep 3 14:52:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_area): Fix stupid signedness
problem that was causing background to sometimes
be misaligned.
Fri Sep 3 12:26:33 1999 Owen Taylor <otaylor@redhat.com>
[ Fixes pointed out by Ettore Perazzoli <ettore@comm2000.it> ]
* gtk/gtkmenu.c (gtk_menu_position): Make
sure we never position menus with negative x, y,
since gtk_widget_set_uposition() can't handle that.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu):
Modify the positioning code a bit so that we always
put the top-left corner onscreen. (This is for
UI reasons, gtk_menu_position() now takes care of
gtk_widet_set_uposition() brokeness.)
Fri Sep 3 03:06:30 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: fixed up things for -jx, x > 1.
Sun Sep 5 08:48:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_style): Ref the
RC style that is passed in. The lack of the ref
before was a bug. If people worked around this
bug, this will introduce a slight memory leak
in their code. The code should typically look like:
rc_style = gtk_rc_style_new ();
[...]
gtk_widget_modify_style (widget, rc_style);
gtk_rc_style_unref (rc_style);
* gtk/gtkwidget.c (gtk_widget_modify_style): Reset
the style if it was already set.
* gtk/gtkwidget.c (gtk_widget_set_name): Only set the
style if it was set before.
Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (main): Add a check to see if we
are being run from the correct directory and
to quit nicely if we are not.
* gtk/gtkrc.c (gtk_rc_slist_remove_all): Make function
static.
Thu Sep 2 23:00:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkenums.h (GtkWindowPosition): added GTK_WIN_POS_CENTER_ALWAYS.
* gtk/gtkwindow.c:
queue resizes unconditionally (gtk_widget_queue_resize will figure
what to do if the window is not realized).
(gtk_window_move_resize): only recenter the window
for GTK_WIN_POS_CENTER_ALWAYS.
(gtk_window_compute_reposition): handle GTK_WIN_POS_CENTER_ALWAYS in
the same way as GTK_WIN_POS_CENTER.
Thu Sep 2 22:39:27 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_reposition): check for the last position
with (!(info->last_flags & GDK_HINT_POS)) instead of
(!info->last_flags & GDK_HINT_POS).
* gtk/gtkwindow.c (gtk_window_move_resize): constrain new_width and
new_height unconditionally, because we use these values even if
!default_size_changed && !hints_changed.
comented the (default_size_changed || hints_changed) case with
respect to resize rejects from the window manager.
* gtk/gtkwindow.c (gtk_window_move_resize): save info->last values
in the zvt condition hack, since this includes the window hints, set
the hints after the handling_resize case.
* gtk/gtkwindow.c (gtk_window_show): constrain the default size that a
window is initially shown with to the geometry.
Thu Sep 2 07:38:56 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize):
s/size_changed/default_size_changed/g so i know what's
really going on (frying brain on smaller flame now).
Thu Sep 2 05:47:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): queue a new resize if
we have size_changed upon handling_resize. this is a gross
workaround for the broken zvt widget and should be removed in
1.3 again (search for FIXME).
Owen provided an accurate comment for this:
/* We could be here for two reasons
* 1) We coincidentally got a resize while handling
* another resize.
* 2) Our computation of size_changed was completely
* screwed up, probably because one of our children
* is broken. It's probably a zvt widget.
*
* For 1), we could just go ahead and ask for the
* new size right now, but doing that for 2)
* might well be fighting the user (and can even
* trigger a loop). Since we really don't want to
* do that, we requeue a resize in hopes that
* by the time it gets handled, the child has seen
* the light and is willing to go along with the
* new size. (this happens for the zvt widget, since
* the size_allocate() above will have stored the
* requisition corresponding to the new size in the
* zvt widget)
*
* This doesn't buy us anything for 1), but it shouldn't
* hurt us too badly, since it is what would have
* happened if we had gotten the configure event before
* the new size had been set.
*/
Wed Sep 1 20:46:11 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: deal properly with the fact that RC
style lists may include rc styles more than once.
* gtk/gtkrc.c (gtk_rc_append_pixmap_path): Removed
unused static function.
* gtk/gtkrc.c (gtk_rc_find_pixmap_in_path): Keep a
stack of directories of RC files currently being
parsed and implicitely add them to pixmap path.
This fixes a bug where the directory would get
appended then overwritten by pixmap_path declarations.
(bug #1462, from Peter Wainright <prw@wainpr.demon.co.uk>)
* gtk/gtkthemes.c (gtk_theme_engine_unref): Call
theme's exit function. (Patch from Peter Wainwright,
bug #1454)
* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_destroy):
Add a destroy() handler to take care of removing
group for menu item. (Fixes bug #1197)
* gtk/gtkwidget.c (gtk_widget_size_request): Fixed thinko
in warning message.
Wed Sep 1 21:27:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): don't require a server
roundtrip to figure window's width and height, since we know that
anyways from widget->allocation.
Wed Sep 1 12:37:44 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Compute
the hints after we request the new size.
Wed Sep 1 10:38:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_compute_hints): Removed
GTK_WIDGET_REALIZED() assertion - we can compute the
hints before we are realized.
* gtk/gtkwindow.c (gtk_window_move_resize): Reorder
hint changing so that we have a value of hints_changed
when we decide whether to constrain the window size.
* gtk/gtkwindow.c (gtk_window_move_resize): Spelling fix.
* gtk/gtkwindow.c (gtk_window_constrain_size): cleanups,
change back to G_MAXINT.
Wed Sep 1 06:54:59 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_get_geometry_info): zero initialize
new GtkWindowGeometryInfo, so fields like GdkGeometry geometry
contain uncluttered values.
(gtk_window_compute_hints): simply assert that window is realized
and that geometry_info is valid, since we rely on this anyways.
(gtk_window_constrain_size): major cleanups to the code.
if (flags & GDK_HINT_BASE_SIZE) use geometry's base width and height
for the base size, instead of the minimums. use 32767 as max width
and height (like in gtkwindow.c) instead of G_MAXINT.
Wed Sep 1 04:41:25 1999 Tim Janik <timj@gtk.org>
* cleaned up the GtkContainer.need_resize flag handling mess, we
only need to force resize requests when we were prematurely
realized, or our widget tree was modified when we were temporarily
hidden. handling these cases directly upon showing the window (i.e.
while the GdkWindow is still unmapped) avoids the need to wait for
a configure event response and therefore makes the GUI more snappier
and avoids blank windows during the roundtrip.
* gtk/gtkwidget.c:
(gtk_widget_hide):
(gtk_widget_show): don't queue resizes on toplevels, they know how
to deal with matters.
* gtk/gtkcontainer.c (gtk_container_queue_resize): set the ->need_resize
flag directly for not visible resize containers and spare us unecessary
signal emissions.
* gtk/gtkwindow.c:
(gtk_window_realize): if we need to enforce premature size allocation,
queue a container resize so we are correctly resized later on.
(gtk_window_init):
(gtk_window_size_request):
don't freak around with the ->need_resize flag,
gtk_container_queue_resize() will care about that.
(gtk_window_show):
handle initial resizing issues here, we can handle matters better in
this place, especially since we know that our GdkWindow is still
unmapped.
(gtk_window_move_resize):
don't care about ->need_resize at all.
handle size changes properly that occoured while we waited for a
configure event.
Tue Aug 31 15:58:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_uposition):
* gtk/gtkwindow.[hc] (gtk_window_reposition):
Move the hint setting code from gtk_widget_set_uposition
to here; set the hints so that we respect any previously
set geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Don't
change the window hints here or move the window here,
let that happen in gtk_window_move_resize().
Tue Aug 31 06:58:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): when discarding exposes due
to already queued resizes (and therefore redraws) on a widget, check
its anchestry as well.
* gtk/gtkcontainer.c:
(gtk_container_queue_resize): clear resize widgets for resize
containers before aborting prematurely. this is especially important
for toplevels which may need imemdiate processing or their resize
handler to be queued.
(gtk_container_dequeue_resize_handler): added new internal function for
gtkwindow.c.
* gtk/gtkwindow.c (gtk_window_move_resize): if we are resizing due to a
configure event, take possible changes in window position into account
as well.
if we request a new window size, queue up a resize handler that will
last until the configure event response arrives.
combined the ->need_resize case (initial show) with the general size
(hints) changed case and added even more comments.
if !auto_shrink, only revert to the old allocation if the new size
is smaller than the current allocation.
Tue Aug 31 11:55:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_arg, gtk_window_set_policy,
gtk_window_set_geometry_hints
gtk_window_set_default_size):
When hints are set, queue a resize so that the hints will
be eventually reset on the toplevel.
* gtk/gtkwindow.c (gtk_window_show): Use
gtk_window_compute_default_size(). Clear the need_resize flag
on the initail map so that we don't unnecessarily trigger the
resize code.
* gtk/gtkwindow.c (gtk_window_move_resize): Split apart
into separate functions. Compare the hints we are setting
with what we set last time so that we can accurately
tell when we need to reset the hints.
* gtk/gtkwindow.c (gtk_window_compute_default_size): New
function to figure out the size from requisition
and default_size.
* gtk/gtkwindow.c (gtk_window_constrain_size): Function
from fvwm to constrain a size to the geometry hints.
* gtk/gtkwindow.c (gtk_window_compare_hints): New function
to compare two sets of geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_hints): Renamed
from gtk_window_set_hints(), just compute the hints,
don't set them.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Move
code from gtk_window_move_resize() to separate function,
rationalize a bit.
Tue Aug 31 13:05:03 1999 Owen Taylor <otaylor@redhat.com>
* gtkrc.h: Move the ref_count member out of the GtkRcStyle
structure into a new private structure.
* gtkrc.c: Split GtkRcStyle into public/private.
In the private part, add a list of pointers to the
RcStyle lists this RcStyle participates in.
* gtkrc.c: When a RcStyle is free, remove all
lists referencing it from the
realized_style_ht hash, and free those lists.
* gtk/gtkrc.c (gtk_rc_clear_styles): Don't call
gtk_rc_init(), since that adds the default styles
to the list of parsed RC files again.
* gtk/gtkrc.c: Use gtk_rc_style_find() consistently.
Thu Aug 26 14:14:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): reactivated the sanity
checks that ensure that a widget's allocation is at least 1 in width
and height. (GNOME note: this doesn't affect old panel code anymore,
because GtkSocket will request width and height of at least 1 since
Fri Jul 23).
* gtk/gtkwindow.c (gtk_window_realize): if the widget hasn't been
allocated yet (happens if the user realizes the window prematurely),
size request and allocate it.
(gtk_window_size_allocate): guard against guint underflows.
Wed Aug 25 19:01:36 1999 Lars Hamann <lars@gtk.org>
* gtk/Makefile.am (gtk_built_sources): reordered stamp-gtk.defs
in gtk_built_sources, so gtk.defs gets built prior to all other
sources.
Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am:
invoke indent on gtkmarshal.*.
rewrote source generation rules, use COPYING as oldest source tag for
a piggyback rule to generate all sources from (don't touch it ;).
major cleanups, strip spaces on build rules for GNU Make.
* gtk/genmarshal.pl: don't operate on hardcoded filenames but take
source and target files from commandline arguments. don't invoke indent.
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Wed Aug 18 09:20:10 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c:
we use window->need_resize from configure_event now, to indicate that
the gtkwindow should keep its allocation (e.g. because the user resized
the window through window manager handles). resize_count is now reliably
used to figure whether we got the allocation we requested from the
window manager.
configure events get queued as resizes now, the real stuff (size
computation and allocation) now only goes on in gtk_window_move_resize().
GtkWindow's requisition now contains its *real* requisition (like all
other widgets), *not* taking usize into account.
geometry_info->last_{width|height} is now updated from set_hints() only
so it always contains the last hints we set for the window manager.
made some event handlers return TRUE instead of FALSE.
the overall code should be much more straight forward now, and the
significant code portions are accompanied by comments now.
(gtk_window_set_hints):
removed requisition argument and made it
fetch the requisition through gtk_widget_get_child_requisition.
we also don't move the gdkwindow here anymore, gtk_window_move_resize()
does that now.
(gtk_window_show):
ensure that the widget is realized before calling
gtk_container_check_resize() (and thus gtk_window_move_resize()), also
ensure that we got properly size requested and allocated before
realization.
(gtk_window_configure_event):
ignore plain window moves, or reallocate the widget tree through the
resize queue otherwise.
(gtk_window_move_resize):
mostly rewrote this function to figure window manager hints more
reliably, coalesce window moves and resizes to reduce configure events
and do actuall size allocations.
Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): discard expose events for widgets
that have a resize pending, because a redraw is already queued for them.
* gtk/gtkcontainer.c: removed ugly connect_to ::size_allocate signal
hack to clear resize_widgets.
* gtk/gtkwidget.c (gtk_widget_size_allocate): call clear_resize_widgets
for resize containers prior to size allocation. (this is also a bit
ugly, but avoids side effects for stopped emissions and is thus more
reliable).
(gtk_widget_unparent): removed disconnect call for clear_resize_widgets.
* gtk/gtktooltips.c (gtk_tooltips_paint_window): renamed this
function from gtk_tooltips_expose, as we connect to ::expose_event
*and* ::draw now.
1999-08-18 Federico Mena Quintero <federico@redhat.com>
* gtk/gtkselection.c (gtk_target_list_ref): Added missing sanity
checks.
(gtk_target_list_unref): Likewise.
* gtk/gtkthemes.c (gtk_theme_engine_unref): Likewise.
Tue Aug 17 15:47:07 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_draw_value_bar):
guard against division by zero. (Fixes bug #1339)
Tue Aug 17 10:56:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_move_{forward,backward}_word):
Prevent the trivial leak of information of allowing
word motion when the entry is not visible.
Tue Aug 17 10:28:52 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_fileop_error): Propagate
modality to error dialog as well as confirmation dialogs.
(Bug #1803, reported by Rosanna Wing Sze Yuen)
Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktreeitem.c (gtk_tree_item_draw_lines): Honor
tree->view_lines.
(gtk-guy-990611-3.patch: Guy Harris <guy@netapp.com>)
* gtk/Makefile.am (install-data-local): Solaris apparently
has various troubles with ln -f; use rm first instead.
(gtk-guy-990611-2.patch: Guy Harris <guy@netapp.com>)
1999-07-30 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (stamp-m): Don't `mv' from builddir to srcdir,
use `cp' followed by `rm' (the `rm' was already there).
July 30, 1999 Elliot Lee <sopwith@redhat.com>
* configure.in: Fix autoconf warnings about cross compilation by
trying to provide sane defaults for AC_TRY_RUN.
* gtk/Makefile.am: If we refer to gtkmarshal.[ch] in $(srcdir),
put them into $(srcdir) when generated. Also add a dependency of
gtksignal.h on gtkmarshal.h for -j builds.
* gtk/gtk(dnd,style,gamma).c: Minor warning fixes.
Wed Jul 28 09:29:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration_do): Added missing
GDK_THREADS_{LEAVE,ENTER} pair.
(From Paul Fisher <pnfisher@redhat.com>)
Fri Jul 23 01:00:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtksocket.c (gtk_socket_size_request): asure that the requested
width and height are always >0 (owen).
Fri Jul 23 00:00:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): backed out my recent
change that assured that a widget's allocated with and height are
always >1, since this breaks *buggy* panel code. unfortunately this
back-breaks the gimp's color selector.
* gtk/gtkdrawingarea.c (gtk_drawing_area_size_allocate): asure that our
allocation is always >0 in width and height, before sending the
configure event; this is a *gross* hack to get the gimp back to work.
* marked both cases with TODO-1.3
Wed Jul 21 15:47:39 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Don't display wrap indicators when
text is not editable and word wrap is on.
Wed Jul 21 08:21:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): special case
option menus here as they are not derived from menu shell, assure that
the option menu has a menu we can add items to.
Tue Jul 20 23:29:48 1999 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_page_allocate): convert allocation->
width/height to (gint) before calculations and check against < 0 to
avoid guint wraparounds.
Sun Jul 18 00:35:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): ensure that the allocated
width and height is never zero. sanity check both dimensions against
32767 and issue a warning if the allocation is greater than that.
Wed Jul 7 15:03:30 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_events_pending): Unlock around call
to g_main_pending() as well.
Wed Jul 7 14:59:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration): Unlock around
call to g_main_iteration() - since that will regrab
GTK+ lock to process events.
Thu Jul 1 15:01:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c
- Regularize with the rest of GTK+ by making widget->requisition
not reflect the set_usize()
- Always recompute geometry hints, then check if they
changed before sending them to the X server. The
previous checks for changes would fail in a number
of circumstances.
Thu Jul 1 11:55:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Include <stdlib.h> for strcmp().
Wed Jun 30 19:26:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c:
- Code cleanups
- Instantaneously update on modifier key presses
- Allow cancellation of the drag with Escape.
Tue Jun 29 17:04:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_handle_box): Set the policy
to auto_shrink - otherwise the appearance is rather
strange when flipping between horizontal and vertical.
Mon Jun 28 09:29:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: add ::default_width and ::default_height arguments.
(gtk_window_set_default_size): don't change a value if it's < 0.
queue a resize.
Sun Jun 27 11:00:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_insert): don't segfault on NULL inserts.
Mon Jun 28 12:08:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (cmpl_completion_fullname): Don't
add an extra "/" when concating "/" + filename.
(From Matt Grossman <mattg@oz.net>)
Mon Jun 28 10:57:12 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (draw_cell_pixmap): Reset clip mask
for fg_gc if we set it for drawing pixmap.
Tue Jun 15 12:45:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes from Peter Wainwright <prw@wainpr.demon.co.uk>
* gtk/gtkrc.c (gtk_rc_parse_engine): If rc_style->engine is
already set, call old engine's destroy function and
unref the old engine.
Thu Jun 10 17:59:38 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.c (gtk_drawing_area_size): queue a resize.
Wed Jun 9 15:13:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h: mark certain functions as internal.
Wed Jun 9 13:48:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpreview.c (gtk_preview_set_expand): queue a resize if the
expand behaviour changed.
* gtk/gtklabel.c (gtk_label_set_pattern):
(gtk_label_set_justify):
(gtk_label_set_line_wrap):
don't bother invoking queue_clear, the reallocation does
that for us, always free_words so the upcoming resize will
relayout the label's contents.
Wed Jun 9 12:50:48 1999 Tim Janik <timj@gtk.org>
* applied argument implementation patches from Elena Devdariani
<elena@cogent.ca>.
* gtk/gtktoolbar.c: ::orientation, ::toolbar_style, ::space_size,
::space_style, ::relief
* gtk/gtkruler.c: ::lower, ::upper, ::position, ::max_size
* gtk/gtkpreview.c: ::expand
* gtk/gtkpaned.c: ::handle_size, ::gutter_size
* gtk/gtknotebook.c: ::homogeneous
* gtk/gtklabel.c: ::wrap
* gtk/gtklist.c: ::selection_mode
* gtk/gtkhandlebox.c: ::handle_position, ::snap_edge
* gtk/gtkcurve.c: ::curve_type, ::min_x, ::max_x, ::min_y, ::max_y
* gtk/gtkcolorsel.c: ::update_policy, ::use_opacity
* gtk/gtkclist.c: ::sort_type
* gtk/gtkcheckmenuitem.c: ::active, ::show_toggle
* gtk/gtkaspectframe.c: ::xalign, ::yalign, ::ratio, ::obey_child
Tue Jun 1 23:38:38 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Removed ill-thought-out part of last
comment.
Tue Jun 1 23:30:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_attach): Get the reference
counting right when we have to attach a new style
for a different visual. (Chi-Deok Hwang <cdhwang@sr.hei.co.kr>)
* gtk/gtkstyle.c: Documented the refcounting
peculularities of gtk_style_attach.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkwindow.c (gtk_window_new): added return if fail for invalid
window types.
* examples/packer/pack.c (main): use GTK_WINDOW_TOPLEVEL instead
of GTK_TOPLEVEL for creating the window.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkmain.c (gtk_init_check): don't segfault when --gtk-module is
the last argument (reported by Per Winkvist).
Tue May 25 13:13:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes for invisible XOR lines (Frank Loemker
<floemker@TechFak.Uni-Bielefeld.DE>)
* gtk/gtkclist.c (gtk_clist_realize): Always use
a non-zero pixel for GDK_XOR.
* gtk/gtkvpaned.c gtk/gtkhpaned.c:
Use GDK_INVERT instead of GDK_XOR.
Wed May 12 21:56:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (adjust_adjustments): signal emit value_changed
signals if h/voffsets differ from adjustment values.
Reportet by Jerome Bolliet <bolliet@in2p3.fr>
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
the user data on the window before destroying it.
* gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
unrealize handler to take care of destroying
notebook->panel properly.
(Bug #1198 - Morten Welinder <terra@diku.dk>)
* gtk/gtktext.c (expand_scratch_buffer): Fix reversal
of g_new and g_realloc to stop memory leak. (Actually,
we could just use g_realloc(), but I'm not 100% sure
that is portable).
(Bug #1196 - Morten Welinder <terra@diku.dk>)
Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.h: Removed stray GtkPlugButton declaration.
* gdk/gdkfont.c (gdk_text_measure): Fix the return value
for fontsets.
* gtk/gtkbutton.c (gtkbutton_expose): Fix warning
with bin/button confusion.
Thu May 6 04:53:26 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: in the ItemFactory test, link radio items together,
and show how preselection of radio items is done.
Sun May 2 13:31:14 1999 Tim Janik <timj@gtk.org>
* gtk/gtktreeitem.c (gtk_tree_item_set_subtree):
* gtk/gtktree.c (gtk_tree_add) (gtk_tree_insert):
* gtk/gtktoolbar.c (gtk_toolbar_insert_element):
* gtk/gtkpaned.c (gtk_paned_pack2) (gtk_paned_pack1):
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_add):
* gtk/gtktable.c (gtk_table_attach):
* gtk/gtklist.c (gtk_list_insert_items):
* gtk/gtkmenushell.c (gtk_menu_shell_insert):
* gtk/gtknotebook.c (gtk_notebook_insert_page_menu):
* gtk/gtkpacker.c (gtk_packer_add_defaults) (gtk_packer_add):
* gtk/gtkbin.c (gtk_bin_add):
* gtk/gtkbox.c (gtk_box_pack_start) (gtk_box_pack_end):
* gtk/gtkfixed.c (gtk_fixed_put):
* gtk/gtklayout.c (gtk_layout_put):
general fixups to container_add logic. always realize child if
child->parent is realized, only map the child and queue a resize
if child and child->parent are both visible.
Fri Apr 30 09:02:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_unrealize): use gtk_container_forall
instead of gtk_container_foreach to walk and unrealize children, so
composite children get also unrealized.
(gtk_widget_real_show): don't call gtk_widget_map() if we don't need to.
(gtk_widget_map): assert that the widget is visible (basic constrain).
(gtk_widget_real_map): assert that the widget is realized (basic
constrain).
Fri Apr 29 00:53:20 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbindings.c (gtk_pattern_spec_init): plugged a memory leak.
Tue May 4 09:32:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc.iso-8859-2: Add a gtkrc
file for iso-8859-2 locales.
* configure.in (ALL_LINGUAS): ALL_LINGUAS update.
Tue Apr 27 16:38:32 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Fix typo of static_sources for static_SOURCES.
(Pointed out by andy@rz.uni-karlsruhe.de and others).
Remove some suspicious and useless lines.
Tue May 4 08:44:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c (gtk_clist_draw, draw_rows): Use
width,height = 0, 0 to mean - here to edge of window,
instead of -1, -1, since the former is all we support.
Tue May 4 08:34:43 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main): Correctly free list nodes
when removing from quit_functions list.
Tue Apr 27 14:17:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpacker.c (gtk_packer_size_request): remove unused variable.
Tue Apr 27 18:23:35 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable):
When redrawing characters on non-visible entry, use appropriate
'*' character. (Bug #1130 - Jean-Marc Jacquet <jm@littleigloo.org>)
Tue Apr 27 01:31:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (drag_dest_cell): compute destination cell
from drag coordinates.
(gtk_clist_drag_data_received) (gtk_clist_drag_motion):
use drag_dest_cell.
* gtk/gtktree (drag_dest_cell)
(gtk_ctree_drag_data_received) (gtk_ctree_drag_motion): likewise.
(Bug #1129)
Wed Apr 21 21:26:11 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_init): properly initialize
translate_* fields.
(gtk_item_factory_finalize): invoke translate_notify independant from
translate_data.
(gtk_item_factory_set_translate_func): likewise.
(gtk_item_factory_destroy): only remove ifactory pointer from those
widgets that belong to us (stupid me).
Mon Apr 19 12:05:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Fixed leak of
rc_style list when lookup succeeeds.
Thu Apr 15 01:11:24 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (resync_selection):
* gtk/gtkclist.c (resync_selection): fixed undo_selection bug.
* gtk/gtkclist.c (gtk_clist_button_release): fixed resync_selection
bug.
Fri Apr 9 19:22:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c gtk/gtkdnd.c gtk/gtkmenuitem.c:
Add some missing GDK_THREADS_ENTER()/LEAVE around
timeouts. (Patches from Sebastian Wilhelmi <wilhelmi@ira.uka.de>)
Thu Apr 8 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkentry.c (gtk_entry_key_press): use gtk_widget_activate()
rather than emit_by_name.
* gtk/gtkeditable.c (gtk_editable_insert_text): keep a reference
on the widget across multiple signal emissions.
(gtk_editable_delete_text): same here.
(gtk_editable_class_init): set widget_class->activate_signal after
editable_signals[ACTIVATE] has been created.
Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
position here prematurely -- we might not have the
right ->min_position and ->max_position yet.
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
Add error traps so if the other end of the connection
dies, we survive.
* gtk/gtkselection.c (gtk_selection_notify): Clean
up properly when selection property retrieval fails.
* gtk/gtkselection.c (gtk_selection_request): Correctly
reject SelectionRequest notifies where the handler
returns no data.
Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_dest_leave): Only unhighlight
when we've previously highlighted.
* gtk/gtkdnd.c (gtk_drag_dest_handle_event): Don't
emit two "drag_leave" signals for Motif drops.
* gtk/gtkdnd.c (gtk_drag_source_handle_event): Send
back the correct status messages when dropping from
Motif onto a proxy window that is rejecting the
drop.
Sat Mar 27 23:32:13 1999 Tim Janik <timj@gtk.org>
* gtk/gtkarg.[hc]: added functions from GLE, gtk_arg_reset() to free
the value and reset type to GTK_TYPE_INVALID, and gtk_arg_values_equal()
to compare two argument values. added gtk_arg_to_valueloc() to set a
variable from an arg through its location (pointer).
* gtk/gtkobject.[hc]: implemented gtk_object_get() in terms of
gtk_object_arg_get() and gtk_arg_to_valueloc(), floats are collected
as gfloat*, uchars are collected as guchar*, ints are collected as
gint*, etc...
Mon Mar 29 17:45:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccelgroup.c gtk/gtkgtkbindings.c:
Include <string.h> instead of <strings.h>.
* gtk/gtkstyle.c: Fix double include of gtkthemes.h
(actually, a lot more duplicate includes occur if
you trace through the sequence of #include's)
gtk-jbb-990320-0: John Bley, jbb6@acpub.duke.edu
Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com>
Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp>
gtk-a-higuti-990322-[0-3]
* configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS
that was causing -DX_LOCALE not to work.
* gtk/gtkrc.c (gtk_rc_init):
X_LOCALE will never have LC_MESSAGES defined
Thu Mar 25 12:38:31 1999 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_append_default_module_path): get $HOME from
g_get_home_dir() (gtk-pmc-990123-0.patch.gz).
* gtk/gtkwindow.c (gtk_window_key_press_event): feature keypad up/down/
left/right as well (gtk-michael-980726-0.patch.gz).
* gtk/gtklabel.[hc]: bunch of miscellaneous cleanups, such as s/0/NULL/
for pointer values, use gchar instead of char. fixed uline allocation
leaks, changed the allocation pattern so we use G_ALLOC_AND_FREE mem
chunks instead of G_ALLOC_ONLY.
(gtk_label_size_request): always alter requisition as passed and leave
widget->requisition alone.
(gtk_label_set_text): allow NULL strings.
(gtk_label_new): likewise.
Wed Mar 24 09:24:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.[hc]: type/macro fixups.
Mon Mar 22 05:51:34 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbin.c (gtk_bin_draw): only redraw children that are visible
*and* mapped (i.e. drawable).
(gtk_bin_expose): only send exposes to drawable children.
* gtk/gtkbox.c (gtk_box_draw): only redraw children that are drawable.
(gtk_box_expose): only send exposes to drawable children.
* gtk/gtkhscale.c (gtk_hscale_draw):
* gtk/gtkvscale.c (gtk_vscale_draw):
hm, this is an ugly one. we first compute the size of our trough area
here (window relative) and then check intersection with the draw_area
which is parent relative because we're a NO_WINDOW widget, so we need
to offset the trough area by allocation.x and allocation.y before the
check. (this must not be done for the background area though, since
that's already computed parent relative).
Mon Mar 22 00:41:39 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_unrealize): unmap clist if neccessary,
unrealize title buttons.
Fri Mar 19 00:00:22 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_column_title_passive)
(gtk_clist_column_title_active):
only connect/disconnect to GtkWidgetClass::event to block mouse events.
* gtk/gtkclist.c (vertical_timeout) (horizontal_timeout):
zero initialize event, removed superfluous gdk_window_get_pointer call
* gtk/gtklist.c (gtk_list_vertical_timeout)
(gtk_list_horizontal_timeout): removed superfluous
gdk_window_get_pointer call
Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org>
* plugging problems reported by "Bruce Mitchener, Jr."
<bruce@puremagic.com> due to a purify session.
* gtk/gtkstyle.c:
(gtk_style_ref):
(gtk_style_unref): assert ref_count to be > 0.
* gtk/gtkclist.c (gtk_clist_set_cell_style): { 0 } initilaize
the requisition.
(gtk_clist_set_shift): likewise.
* gtk/gtklayout.c: introduce gtk_layout_finalize() to unref the
adjustments.
* gtk/gtklist.c (gtk_list_horizontal_timeout): zero initialize the
event before sending it and set send_event to TRUE (which needs to
be done for *all* synthesized events).
(gtk_list_vertical_timeout): likewise.
* gtk/gtktipsquery.c (gtk_tips_query_destroy): plug small memory
leaks.
* gtk/gtkdrawingarea.c (gtk_drawing_area_send_configure): set send_event
to TRUE when synthesizing events.
[ *** end of merges from 1.2 *** ]
1999-11-22 21:52:50 +00:00
|
|
|
gdk_window_clear_area (clist->clist_window, 0,
|
|
|
|
ROW_TOP_YPIXEL (clist, i), 0, 0);
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
static void
|
|
|
|
draw_xor_line (GtkCList *clist)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GtkWidget *widget;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_if_fail (clist != NULL);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
widget = GTK_WIDGET (clist);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
gdk_draw_line (widget->window, clist->xor_gc,
|
|
|
|
clist->x_drag,
|
|
|
|
widget->style->klass->ythickness,
|
|
|
|
clist->x_drag,
|
|
|
|
clist->column_title_area.height +
|
|
|
|
clist->clist_window_height + 1);
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
static void
|
|
|
|
clist_refresh (GtkCList *clist)
|
|
|
|
{
|
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
|
|
|
|
|
|
|
if (CLIST_UNFROZEN (clist))
|
|
|
|
{
|
|
|
|
adjust_adjustments (clist, FALSE);
|
|
|
|
draw_rows (clist, NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* get cell from coordinates
|
|
|
|
* get_selection_info
|
|
|
|
* gtk_clist_get_selection_info
|
|
|
|
*/
|
|
|
|
static gint
|
|
|
|
get_selection_info (GtkCList *clist,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint *row,
|
|
|
|
gint *column)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
gint trow, tcol;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_val_if_fail (clist != NULL, 0);
|
|
|
|
g_return_val_if_fail (GTK_IS_CLIST (clist), 0);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* bounds checking, return false if the user clicked
|
|
|
|
* on a blank area */
|
|
|
|
trow = ROW_FROM_YPIXEL (clist, y);
|
|
|
|
if (trow >= clist->rows)
|
|
|
|
return 0;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (row)
|
|
|
|
*row = trow;
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
tcol = COLUMN_FROM_XPIXEL (clist, x);
|
|
|
|
if (tcol >= clist->columns)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
if (column)
|
|
|
|
*column = tcol;
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
|
|
|
gtk_clist_get_selection_info (GtkCList *clist,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint *row,
|
|
|
|
gint *column)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (clist != NULL, 0);
|
|
|
|
g_return_val_if_fail (GTK_IS_CLIST (clist), 0);
|
|
|
|
return get_selection_info (clist, x, y, row, column);
|
1998-01-03 03:31:03 +00:00
|
|
|
}
|
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
/* PRIVATE ADJUSTMENT FUNCTIONS
|
1998-11-05 15:44:22 +00:00
|
|
|
* adjust_adjustments
|
1998-10-19 22:46:38 +00:00
|
|
|
* vadjustment_changed
|
|
|
|
* hadjustment_changed
|
|
|
|
* vadjustment_value_changed
|
|
|
|
* hadjustment_value_changed
|
|
|
|
* check_exposures
|
|
|
|
*/
|
1998-01-03 03:31:03 +00:00
|
|
|
static void
|
1998-11-07 14:29:22 +00:00
|
|
|
adjust_adjustments (GtkCList *clist,
|
|
|
|
gboolean block_resize)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-11-07 14:29:22 +00:00
|
|
|
if (clist->vadjustment)
|
|
|
|
{
|
|
|
|
clist->vadjustment->page_size = clist->clist_window_height;
|
|
|
|
clist->vadjustment->page_increment = clist->clist_window_height / 2;
|
|
|
|
clist->vadjustment->step_increment = clist->row_height;
|
|
|
|
clist->vadjustment->lower = 0;
|
|
|
|
clist->vadjustment->upper = LIST_HEIGHT (clist);
|
1998-08-17 23:48:04 +00:00
|
|
|
|
Adapt cast macros to standard.
Fri Nov 19 10:34:41 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkgamma.h: Adapt cast macros to standard.
[ Merges from 1.2 ]
Tue Nov 16 10:15:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_path):
If translation does not include a '/', use entire
translation instead of crashing.
Sun Oct 31 22:21:11 1999 Tim Janik <timj@gtk.org>
* docs/gtk_tut.sgml:
s/gtk_accel_group_attach/gtk_window_add_accel_group/.
Sat Oct 30 09:09:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_target_list_remove): Use
g_list_remove_link, not g_list_remove.
[ From Geert Bevin <gbevin@thunderstorms.org> ]
Sun Oct 24 07:41:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkclist.c (real_undo_selection): commented out g_print()
statement upon unselection (how the heck did that slip in?).
Sat Oct 23 03:03:08 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_freeze):
(gtk_text_thaw): undraw/draw cursor here to avoid unnecessary scrolling
in frozen state (and aparently crashes). patch provided by Anders
Melchiorsen <and@kampsax.dtu.dk>.
Sat Oct 23 02:53:20 1999 Tim Janik <timj@gtk.org>
* fix insensitive default/focus widget activation,
reported by Matt Goodall <mgg@isotek.co.uk>.
* gtk/gtkwindow.c (gtk_window_key_press_event):
(gtk_window_activate_default):
(gtk_window_activate_focus):
return handled=FALSE for actiavtion of insensitive default
widgets. return handled=TRUE for activation of insensitive
focus widgets. don't activate in either case.
Tue Oct 19 09:55:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk-config.in (lib_gtk): Switch order of @x_cflags@
and $glib_cflags to match library order and in the
theory that an old version of GLib is more likely to
be in the include directory for X then vice-versa.
(Bug #2776)
Tue Oct 19 09:46:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always use LC_CTYPE
to determine the locale for fontsets, not LC_MESSAGES;
the user may want English messages with a handling
for non-English languages. (LC_CTYPE=ru_RU LC_MESSAGES=fr_FR
will still be broken) (Bug #2891)
Tue Oct 19 20:36:42 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Fixed the wrong number of "*"'s.
Tue Oct 19 12:15:13 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Changed the Korean default fontset.
Fri Oct 8 02:32:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): Fix bug
where when scrolling to the left or top double exposes
were done, causing major slowdowns.
Thu Oct 7 18:31:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always normalize codeset
names to lowercase and alphanumeric, before looking
them up.
* gtk/Makefile.am: Install codeset variant gtkrc files
with normalized names.
Thu Oct 7 22:52:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_popup_with_data): even
popup menus when the menu is already visible, but its parent
is still hidden, (happens after tornoff window got hidden).
Thu Oct 7 11:09:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (install-data-local): Fix
a typo where gtkrc.vi_VN.tcvn5712 wasn't getting
deleted, causing error messages on install.
Thu Oct 7 11:03:06 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtk[hv]paned.c (gtk_{h,v}paned_draw): Redraw
the handle as well, since we now sometimes ignore
exposes on the handle while resizing.
Wed Oct 6 18:02:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_append_default_pixmap_path): Fix stupid
extra g_free introduced in one of the last one or two
commits.
Wed Oct 6 16:38:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc*: Make naming of gtkrc files
consistent, put each style that a gtkrc.* file creates
in a unique namespace, remove old files before installing.
Wed Oct 6 14:31:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Avoid leaking memory when
gtk_rc_init is called multiple times. (Yes, people who
do that have bugs in their code.)
Tue Oct 5 11:36:57 PDT 1999 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: listing gtkrc in gtkconf_DATA seems to barf.
Remove it since it's generated by the Makefile anyway
Tue Oct 5 02:43:41 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputcommon.h (gdk_input_device_new): Free
device->info.axes for core pointer.
Thu Sep 30 13:55:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (destroy_idle_test): Rename idle to
idle_id, to deal with obsolete, broken C libraries.
Mon Sep 27 02:50:15 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkvscale.c (gtk_vscale_draw): Don't add in
allocation->x/y twice!
* gtk/gtkhscale.c: Make usage of gtk_hscale_pos_trough()
consistent with gtk_vscale_pos_trough().
Sun Sep 26 19:44:34 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_queue_resize): We may
be queueing a resize on a toplevel container between
the time we show it and when we map it. So, we need
to test GTK_WIDGET_VISIBLE() for toplevels, and only
use GTK_WIDGET_DRAWABLE() for child windows.
Thu Sep 23 16:41:03 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDADDS): Add GDK_WLIBS to LDADDS
(fixes bug #2144)
Fri Sep 24 00:51:45 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c (gtk_container_queue_resize): check for
container DRAWABLE (instead of VISIBLE), so we don't queue
resizes on non-toplevel containers.
Sun Sep 19 18:13:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.[ch]: Make the data argument
const guchar *.
Sat Sep 18 21:27:40 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: Try to behave sensibly if
the focus widget is the window itself. (Should
we allow this at all?)
Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_set_sensitive):
* gtk/gtknotebook.c (gtk_notebook_set_scrollable):
* gtk/gtknotebook.c (gtk_notebook_set_show_border):
* gtk/gtkclist.c (gtk_notebook_set_show_border): make gboolean args
in prototypes and implementations consistent (Tomas Ogren).
* gtk/gtklayout.c (gtk_layout_remove): unset GTK_IS_OFFSCREEN flag
before the widget is unparented (reported by damon).
* gtk/gtkdnd.c: make the cursor and icon data _unsigned_ char,
since we provide unsigned data anyways.
Thu Sep 16 21:32:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_set_tip): Delay
the call to gtk_tooltips_layout_text() until later.
* gtk/gtktooltips.c (gtk_tooltips_draw_tips):
Call gtk_widget_ensure_style() before using the style.
Wed Sep 15 02:52:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_event): Added workaround
for old widgets that don't propagate draws to all
children. (Namely gnome-dock for gnome-libs <= 1.0.16)
Tue Sep 14 19:22:19 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_queue_resize): don't queue the parent
for a redraw but just the widget that requested the resize.
Tue Sep 14 18:29:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c: added new widget level method
gtk_container_set_reallocate_redraws() and a GtkContainer flag
reallocate_redraws : 1 to reflect the setting, exported this through
the argument system as a boolean ::reallocate_redraws.
* gtk/gtkwidget.c (gtk_widget_size_allocate): when queueing redraws
on the widget because the allocation changes, do so as well for
widget->parent if the parent has reallocate_redraws set to TRUE.
with that containers requesting reallocation redraws get automatically
redrawn if their children changed allocation (this unfortunately
affects also other children that didn't change allocation, but we
cannot work around that before 1.3).
Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_idle_draw): only emit ::draw if width
_and_ height are >0 (not _or_).
* gtk/gtktable.c (gtk_table_remove): use gtk_widget_queue_resize()
instead of gtk_container_queue_resize(), which is a core gtk internal
function (must have been on crack when i queued that).
* gtk/gtkprivate.h: added new private flag GTK_FULLDRAW_PENDING, so
we can check more reliably if we want to discard expose events.
* gtk/gtkwidget.c: added setting/unsetting of the GTK_FULLDRAW_PENDING
flag.
* gtk/gtkwidget.c (gtk_widget_event): don't discard synthesized exposes,
we simply trust these events. for deciding whether to discard exposes,
check GTK_FULLDRAW_PENDING instead of RESIZE_PENDING.
Mon Sep 13 15:01:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore
queues of areas that are completely off screen.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fix broken
logic for handleboxes.
* gtk/gtkwidget.c (gtk_widget_queue_draw_data): Add santity
check on width/height.
Mon Sep 13 02:22:47 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: backed out Raja's recent VPATH build "improvements",
we are fine with using $@ the way we do (if we actually encounter
brokeness with $@ in VPATH builds because of additional path prefixes,
we need to use $(@F) actually).
Mon Sep 13 01:34:53 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c: renamed two variables, hopefully didn't introduce
short lived bugs, that would allow language bindings to do surgeries
to our guts.
Fri Sep 10 15:22:50 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_size_allocate): Fix typo
where comparison was being done against an uninitialized
value causing intermittant results depending on
compiler flags. Also make it clearer that we aren't
ever initializing the child as 0x0 (though this will
be caught in gtk_widget_size_allocate())
Fri Sep 10 10:06:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_transient_for): Move
gtk_window_unset_transient_for() call after we do checks
involving the old transient parent.
[ From Lance Capser <lmc@cyberhighway.net> ]
1999-09-07 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gtk.defs): Go back to using `touch' to create
an empty file.
Mon Sep 6 00:11:56 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (gtk_ctree_is_ancestor): return FALSE if node has
no children. (Reported by: Chris Rogers <gandalf@pobox.com>)
1999-09-03 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gen_sources): Improve VPATH builds.
`$@' is valid only in the build dir, not after we've done
`cd $srcdir'. Also use `test -f' instead of less portable
`test -e'.
Fri Sep 3 15:59:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (correct_cache_insert): Rewrite
for simplicity, and hopefully correctness.
(Fixes bug #1322, which was a segfault when
on some insertions with the properties around
the insertion set up just wrong.)
* gtk/gtktext.c (gtk_text_adjustment): When we receive
a "changed" signal, clamp the new value to the adjustment
bounds to avoid segfaulting if someone tries to change
the adjustment to a bogus value. (Bug #1795)
Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c: Ignore unexpected destroy notifies
for children, for toplevel windows handle them
like delete_event.
* gtk/gtkplug.c: Add an unrealize handler so that
we unref plug->socket_window when we are done
with it.
Fri Sep 3 14:52:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_area): Fix stupid signedness
problem that was causing background to sometimes
be misaligned.
Fri Sep 3 12:26:33 1999 Owen Taylor <otaylor@redhat.com>
[ Fixes pointed out by Ettore Perazzoli <ettore@comm2000.it> ]
* gtk/gtkmenu.c (gtk_menu_position): Make
sure we never position menus with negative x, y,
since gtk_widget_set_uposition() can't handle that.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu):
Modify the positioning code a bit so that we always
put the top-left corner onscreen. (This is for
UI reasons, gtk_menu_position() now takes care of
gtk_widet_set_uposition() brokeness.)
Fri Sep 3 03:06:30 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: fixed up things for -jx, x > 1.
Sun Sep 5 08:48:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_style): Ref the
RC style that is passed in. The lack of the ref
before was a bug. If people worked around this
bug, this will introduce a slight memory leak
in their code. The code should typically look like:
rc_style = gtk_rc_style_new ();
[...]
gtk_widget_modify_style (widget, rc_style);
gtk_rc_style_unref (rc_style);
* gtk/gtkwidget.c (gtk_widget_modify_style): Reset
the style if it was already set.
* gtk/gtkwidget.c (gtk_widget_set_name): Only set the
style if it was set before.
Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (main): Add a check to see if we
are being run from the correct directory and
to quit nicely if we are not.
* gtk/gtkrc.c (gtk_rc_slist_remove_all): Make function
static.
Thu Sep 2 23:00:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkenums.h (GtkWindowPosition): added GTK_WIN_POS_CENTER_ALWAYS.
* gtk/gtkwindow.c:
queue resizes unconditionally (gtk_widget_queue_resize will figure
what to do if the window is not realized).
(gtk_window_move_resize): only recenter the window
for GTK_WIN_POS_CENTER_ALWAYS.
(gtk_window_compute_reposition): handle GTK_WIN_POS_CENTER_ALWAYS in
the same way as GTK_WIN_POS_CENTER.
Thu Sep 2 22:39:27 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_reposition): check for the last position
with (!(info->last_flags & GDK_HINT_POS)) instead of
(!info->last_flags & GDK_HINT_POS).
* gtk/gtkwindow.c (gtk_window_move_resize): constrain new_width and
new_height unconditionally, because we use these values even if
!default_size_changed && !hints_changed.
comented the (default_size_changed || hints_changed) case with
respect to resize rejects from the window manager.
* gtk/gtkwindow.c (gtk_window_move_resize): save info->last values
in the zvt condition hack, since this includes the window hints, set
the hints after the handling_resize case.
* gtk/gtkwindow.c (gtk_window_show): constrain the default size that a
window is initially shown with to the geometry.
Thu Sep 2 07:38:56 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize):
s/size_changed/default_size_changed/g so i know what's
really going on (frying brain on smaller flame now).
Thu Sep 2 05:47:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): queue a new resize if
we have size_changed upon handling_resize. this is a gross
workaround for the broken zvt widget and should be removed in
1.3 again (search for FIXME).
Owen provided an accurate comment for this:
/* We could be here for two reasons
* 1) We coincidentally got a resize while handling
* another resize.
* 2) Our computation of size_changed was completely
* screwed up, probably because one of our children
* is broken. It's probably a zvt widget.
*
* For 1), we could just go ahead and ask for the
* new size right now, but doing that for 2)
* might well be fighting the user (and can even
* trigger a loop). Since we really don't want to
* do that, we requeue a resize in hopes that
* by the time it gets handled, the child has seen
* the light and is willing to go along with the
* new size. (this happens for the zvt widget, since
* the size_allocate() above will have stored the
* requisition corresponding to the new size in the
* zvt widget)
*
* This doesn't buy us anything for 1), but it shouldn't
* hurt us too badly, since it is what would have
* happened if we had gotten the configure event before
* the new size had been set.
*/
Wed Sep 1 20:46:11 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: deal properly with the fact that RC
style lists may include rc styles more than once.
* gtk/gtkrc.c (gtk_rc_append_pixmap_path): Removed
unused static function.
* gtk/gtkrc.c (gtk_rc_find_pixmap_in_path): Keep a
stack of directories of RC files currently being
parsed and implicitely add them to pixmap path.
This fixes a bug where the directory would get
appended then overwritten by pixmap_path declarations.
(bug #1462, from Peter Wainright <prw@wainpr.demon.co.uk>)
* gtk/gtkthemes.c (gtk_theme_engine_unref): Call
theme's exit function. (Patch from Peter Wainwright,
bug #1454)
* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_destroy):
Add a destroy() handler to take care of removing
group for menu item. (Fixes bug #1197)
* gtk/gtkwidget.c (gtk_widget_size_request): Fixed thinko
in warning message.
Wed Sep 1 21:27:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): don't require a server
roundtrip to figure window's width and height, since we know that
anyways from widget->allocation.
Wed Sep 1 12:37:44 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Compute
the hints after we request the new size.
Wed Sep 1 10:38:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_compute_hints): Removed
GTK_WIDGET_REALIZED() assertion - we can compute the
hints before we are realized.
* gtk/gtkwindow.c (gtk_window_move_resize): Reorder
hint changing so that we have a value of hints_changed
when we decide whether to constrain the window size.
* gtk/gtkwindow.c (gtk_window_move_resize): Spelling fix.
* gtk/gtkwindow.c (gtk_window_constrain_size): cleanups,
change back to G_MAXINT.
Wed Sep 1 06:54:59 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_get_geometry_info): zero initialize
new GtkWindowGeometryInfo, so fields like GdkGeometry geometry
contain uncluttered values.
(gtk_window_compute_hints): simply assert that window is realized
and that geometry_info is valid, since we rely on this anyways.
(gtk_window_constrain_size): major cleanups to the code.
if (flags & GDK_HINT_BASE_SIZE) use geometry's base width and height
for the base size, instead of the minimums. use 32767 as max width
and height (like in gtkwindow.c) instead of G_MAXINT.
Wed Sep 1 04:41:25 1999 Tim Janik <timj@gtk.org>
* cleaned up the GtkContainer.need_resize flag handling mess, we
only need to force resize requests when we were prematurely
realized, or our widget tree was modified when we were temporarily
hidden. handling these cases directly upon showing the window (i.e.
while the GdkWindow is still unmapped) avoids the need to wait for
a configure event response and therefore makes the GUI more snappier
and avoids blank windows during the roundtrip.
* gtk/gtkwidget.c:
(gtk_widget_hide):
(gtk_widget_show): don't queue resizes on toplevels, they know how
to deal with matters.
* gtk/gtkcontainer.c (gtk_container_queue_resize): set the ->need_resize
flag directly for not visible resize containers and spare us unecessary
signal emissions.
* gtk/gtkwindow.c:
(gtk_window_realize): if we need to enforce premature size allocation,
queue a container resize so we are correctly resized later on.
(gtk_window_init):
(gtk_window_size_request):
don't freak around with the ->need_resize flag,
gtk_container_queue_resize() will care about that.
(gtk_window_show):
handle initial resizing issues here, we can handle matters better in
this place, especially since we know that our GdkWindow is still
unmapped.
(gtk_window_move_resize):
don't care about ->need_resize at all.
handle size changes properly that occoured while we waited for a
configure event.
Tue Aug 31 15:58:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_uposition):
* gtk/gtkwindow.[hc] (gtk_window_reposition):
Move the hint setting code from gtk_widget_set_uposition
to here; set the hints so that we respect any previously
set geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Don't
change the window hints here or move the window here,
let that happen in gtk_window_move_resize().
Tue Aug 31 06:58:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): when discarding exposes due
to already queued resizes (and therefore redraws) on a widget, check
its anchestry as well.
* gtk/gtkcontainer.c:
(gtk_container_queue_resize): clear resize widgets for resize
containers before aborting prematurely. this is especially important
for toplevels which may need imemdiate processing or their resize
handler to be queued.
(gtk_container_dequeue_resize_handler): added new internal function for
gtkwindow.c.
* gtk/gtkwindow.c (gtk_window_move_resize): if we are resizing due to a
configure event, take possible changes in window position into account
as well.
if we request a new window size, queue up a resize handler that will
last until the configure event response arrives.
combined the ->need_resize case (initial show) with the general size
(hints) changed case and added even more comments.
if !auto_shrink, only revert to the old allocation if the new size
is smaller than the current allocation.
Tue Aug 31 11:55:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_arg, gtk_window_set_policy,
gtk_window_set_geometry_hints
gtk_window_set_default_size):
When hints are set, queue a resize so that the hints will
be eventually reset on the toplevel.
* gtk/gtkwindow.c (gtk_window_show): Use
gtk_window_compute_default_size(). Clear the need_resize flag
on the initail map so that we don't unnecessarily trigger the
resize code.
* gtk/gtkwindow.c (gtk_window_move_resize): Split apart
into separate functions. Compare the hints we are setting
with what we set last time so that we can accurately
tell when we need to reset the hints.
* gtk/gtkwindow.c (gtk_window_compute_default_size): New
function to figure out the size from requisition
and default_size.
* gtk/gtkwindow.c (gtk_window_constrain_size): Function
from fvwm to constrain a size to the geometry hints.
* gtk/gtkwindow.c (gtk_window_compare_hints): New function
to compare two sets of geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_hints): Renamed
from gtk_window_set_hints(), just compute the hints,
don't set them.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Move
code from gtk_window_move_resize() to separate function,
rationalize a bit.
Tue Aug 31 13:05:03 1999 Owen Taylor <otaylor@redhat.com>
* gtkrc.h: Move the ref_count member out of the GtkRcStyle
structure into a new private structure.
* gtkrc.c: Split GtkRcStyle into public/private.
In the private part, add a list of pointers to the
RcStyle lists this RcStyle participates in.
* gtkrc.c: When a RcStyle is free, remove all
lists referencing it from the
realized_style_ht hash, and free those lists.
* gtk/gtkrc.c (gtk_rc_clear_styles): Don't call
gtk_rc_init(), since that adds the default styles
to the list of parsed RC files again.
* gtk/gtkrc.c: Use gtk_rc_style_find() consistently.
Thu Aug 26 14:14:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): reactivated the sanity
checks that ensure that a widget's allocation is at least 1 in width
and height. (GNOME note: this doesn't affect old panel code anymore,
because GtkSocket will request width and height of at least 1 since
Fri Jul 23).
* gtk/gtkwindow.c (gtk_window_realize): if the widget hasn't been
allocated yet (happens if the user realizes the window prematurely),
size request and allocate it.
(gtk_window_size_allocate): guard against guint underflows.
Wed Aug 25 19:01:36 1999 Lars Hamann <lars@gtk.org>
* gtk/Makefile.am (gtk_built_sources): reordered stamp-gtk.defs
in gtk_built_sources, so gtk.defs gets built prior to all other
sources.
Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am:
invoke indent on gtkmarshal.*.
rewrote source generation rules, use COPYING as oldest source tag for
a piggyback rule to generate all sources from (don't touch it ;).
major cleanups, strip spaces on build rules for GNU Make.
* gtk/genmarshal.pl: don't operate on hardcoded filenames but take
source and target files from commandline arguments. don't invoke indent.
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Wed Aug 18 09:20:10 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c:
we use window->need_resize from configure_event now, to indicate that
the gtkwindow should keep its allocation (e.g. because the user resized
the window through window manager handles). resize_count is now reliably
used to figure whether we got the allocation we requested from the
window manager.
configure events get queued as resizes now, the real stuff (size
computation and allocation) now only goes on in gtk_window_move_resize().
GtkWindow's requisition now contains its *real* requisition (like all
other widgets), *not* taking usize into account.
geometry_info->last_{width|height} is now updated from set_hints() only
so it always contains the last hints we set for the window manager.
made some event handlers return TRUE instead of FALSE.
the overall code should be much more straight forward now, and the
significant code portions are accompanied by comments now.
(gtk_window_set_hints):
removed requisition argument and made it
fetch the requisition through gtk_widget_get_child_requisition.
we also don't move the gdkwindow here anymore, gtk_window_move_resize()
does that now.
(gtk_window_show):
ensure that the widget is realized before calling
gtk_container_check_resize() (and thus gtk_window_move_resize()), also
ensure that we got properly size requested and allocated before
realization.
(gtk_window_configure_event):
ignore plain window moves, or reallocate the widget tree through the
resize queue otherwise.
(gtk_window_move_resize):
mostly rewrote this function to figure window manager hints more
reliably, coalesce window moves and resizes to reduce configure events
and do actuall size allocations.
Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): discard expose events for widgets
that have a resize pending, because a redraw is already queued for them.
* gtk/gtkcontainer.c: removed ugly connect_to ::size_allocate signal
hack to clear resize_widgets.
* gtk/gtkwidget.c (gtk_widget_size_allocate): call clear_resize_widgets
for resize containers prior to size allocation. (this is also a bit
ugly, but avoids side effects for stopped emissions and is thus more
reliable).
(gtk_widget_unparent): removed disconnect call for clear_resize_widgets.
* gtk/gtktooltips.c (gtk_tooltips_paint_window): renamed this
function from gtk_tooltips_expose, as we connect to ::expose_event
*and* ::draw now.
1999-08-18 Federico Mena Quintero <federico@redhat.com>
* gtk/gtkselection.c (gtk_target_list_ref): Added missing sanity
checks.
(gtk_target_list_unref): Likewise.
* gtk/gtkthemes.c (gtk_theme_engine_unref): Likewise.
Tue Aug 17 15:47:07 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_draw_value_bar):
guard against division by zero. (Fixes bug #1339)
Tue Aug 17 10:56:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_move_{forward,backward}_word):
Prevent the trivial leak of information of allowing
word motion when the entry is not visible.
Tue Aug 17 10:28:52 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_fileop_error): Propagate
modality to error dialog as well as confirmation dialogs.
(Bug #1803, reported by Rosanna Wing Sze Yuen)
Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktreeitem.c (gtk_tree_item_draw_lines): Honor
tree->view_lines.
(gtk-guy-990611-3.patch: Guy Harris <guy@netapp.com>)
* gtk/Makefile.am (install-data-local): Solaris apparently
has various troubles with ln -f; use rm first instead.
(gtk-guy-990611-2.patch: Guy Harris <guy@netapp.com>)
1999-07-30 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (stamp-m): Don't `mv' from builddir to srcdir,
use `cp' followed by `rm' (the `rm' was already there).
July 30, 1999 Elliot Lee <sopwith@redhat.com>
* configure.in: Fix autoconf warnings about cross compilation by
trying to provide sane defaults for AC_TRY_RUN.
* gtk/Makefile.am: If we refer to gtkmarshal.[ch] in $(srcdir),
put them into $(srcdir) when generated. Also add a dependency of
gtksignal.h on gtkmarshal.h for -j builds.
* gtk/gtk(dnd,style,gamma).c: Minor warning fixes.
Wed Jul 28 09:29:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration_do): Added missing
GDK_THREADS_{LEAVE,ENTER} pair.
(From Paul Fisher <pnfisher@redhat.com>)
Fri Jul 23 01:00:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtksocket.c (gtk_socket_size_request): asure that the requested
width and height are always >0 (owen).
Fri Jul 23 00:00:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): backed out my recent
change that assured that a widget's allocated with and height are
always >1, since this breaks *buggy* panel code. unfortunately this
back-breaks the gimp's color selector.
* gtk/gtkdrawingarea.c (gtk_drawing_area_size_allocate): asure that our
allocation is always >0 in width and height, before sending the
configure event; this is a *gross* hack to get the gimp back to work.
* marked both cases with TODO-1.3
Wed Jul 21 15:47:39 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Don't display wrap indicators when
text is not editable and word wrap is on.
Wed Jul 21 08:21:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): special case
option menus here as they are not derived from menu shell, assure that
the option menu has a menu we can add items to.
Tue Jul 20 23:29:48 1999 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_page_allocate): convert allocation->
width/height to (gint) before calculations and check against < 0 to
avoid guint wraparounds.
Sun Jul 18 00:35:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): ensure that the allocated
width and height is never zero. sanity check both dimensions against
32767 and issue a warning if the allocation is greater than that.
Wed Jul 7 15:03:30 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_events_pending): Unlock around call
to g_main_pending() as well.
Wed Jul 7 14:59:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration): Unlock around
call to g_main_iteration() - since that will regrab
GTK+ lock to process events.
Thu Jul 1 15:01:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c
- Regularize with the rest of GTK+ by making widget->requisition
not reflect the set_usize()
- Always recompute geometry hints, then check if they
changed before sending them to the X server. The
previous checks for changes would fail in a number
of circumstances.
Thu Jul 1 11:55:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Include <stdlib.h> for strcmp().
Wed Jun 30 19:26:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c:
- Code cleanups
- Instantaneously update on modifier key presses
- Allow cancellation of the drag with Escape.
Tue Jun 29 17:04:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_handle_box): Set the policy
to auto_shrink - otherwise the appearance is rather
strange when flipping between horizontal and vertical.
Mon Jun 28 09:29:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: add ::default_width and ::default_height arguments.
(gtk_window_set_default_size): don't change a value if it's < 0.
queue a resize.
Sun Jun 27 11:00:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_insert): don't segfault on NULL inserts.
Mon Jun 28 12:08:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (cmpl_completion_fullname): Don't
add an extra "/" when concating "/" + filename.
(From Matt Grossman <mattg@oz.net>)
Mon Jun 28 10:57:12 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (draw_cell_pixmap): Reset clip mask
for fg_gc if we set it for drawing pixmap.
Tue Jun 15 12:45:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes from Peter Wainwright <prw@wainpr.demon.co.uk>
* gtk/gtkrc.c (gtk_rc_parse_engine): If rc_style->engine is
already set, call old engine's destroy function and
unref the old engine.
Thu Jun 10 17:59:38 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.c (gtk_drawing_area_size): queue a resize.
Wed Jun 9 15:13:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h: mark certain functions as internal.
Wed Jun 9 13:48:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpreview.c (gtk_preview_set_expand): queue a resize if the
expand behaviour changed.
* gtk/gtklabel.c (gtk_label_set_pattern):
(gtk_label_set_justify):
(gtk_label_set_line_wrap):
don't bother invoking queue_clear, the reallocation does
that for us, always free_words so the upcoming resize will
relayout the label's contents.
Wed Jun 9 12:50:48 1999 Tim Janik <timj@gtk.org>
* applied argument implementation patches from Elena Devdariani
<elena@cogent.ca>.
* gtk/gtktoolbar.c: ::orientation, ::toolbar_style, ::space_size,
::space_style, ::relief
* gtk/gtkruler.c: ::lower, ::upper, ::position, ::max_size
* gtk/gtkpreview.c: ::expand
* gtk/gtkpaned.c: ::handle_size, ::gutter_size
* gtk/gtknotebook.c: ::homogeneous
* gtk/gtklabel.c: ::wrap
* gtk/gtklist.c: ::selection_mode
* gtk/gtkhandlebox.c: ::handle_position, ::snap_edge
* gtk/gtkcurve.c: ::curve_type, ::min_x, ::max_x, ::min_y, ::max_y
* gtk/gtkcolorsel.c: ::update_policy, ::use_opacity
* gtk/gtkclist.c: ::sort_type
* gtk/gtkcheckmenuitem.c: ::active, ::show_toggle
* gtk/gtkaspectframe.c: ::xalign, ::yalign, ::ratio, ::obey_child
Tue Jun 1 23:38:38 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Removed ill-thought-out part of last
comment.
Tue Jun 1 23:30:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_attach): Get the reference
counting right when we have to attach a new style
for a different visual. (Chi-Deok Hwang <cdhwang@sr.hei.co.kr>)
* gtk/gtkstyle.c: Documented the refcounting
peculularities of gtk_style_attach.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkwindow.c (gtk_window_new): added return if fail for invalid
window types.
* examples/packer/pack.c (main): use GTK_WINDOW_TOPLEVEL instead
of GTK_TOPLEVEL for creating the window.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkmain.c (gtk_init_check): don't segfault when --gtk-module is
the last argument (reported by Per Winkvist).
Tue May 25 13:13:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes for invisible XOR lines (Frank Loemker
<floemker@TechFak.Uni-Bielefeld.DE>)
* gtk/gtkclist.c (gtk_clist_realize): Always use
a non-zero pixel for GDK_XOR.
* gtk/gtkvpaned.c gtk/gtkhpaned.c:
Use GDK_INVERT instead of GDK_XOR.
Wed May 12 21:56:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (adjust_adjustments): signal emit value_changed
signals if h/voffsets differ from adjustment values.
Reportet by Jerome Bolliet <bolliet@in2p3.fr>
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
the user data on the window before destroying it.
* gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
unrealize handler to take care of destroying
notebook->panel properly.
(Bug #1198 - Morten Welinder <terra@diku.dk>)
* gtk/gtktext.c (expand_scratch_buffer): Fix reversal
of g_new and g_realloc to stop memory leak. (Actually,
we could just use g_realloc(), but I'm not 100% sure
that is portable).
(Bug #1196 - Morten Welinder <terra@diku.dk>)
Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.h: Removed stray GtkPlugButton declaration.
* gdk/gdkfont.c (gdk_text_measure): Fix the return value
for fontsets.
* gtk/gtkbutton.c (gtkbutton_expose): Fix warning
with bin/button confusion.
Thu May 6 04:53:26 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: in the ItemFactory test, link radio items together,
and show how preselection of radio items is done.
Sun May 2 13:31:14 1999 Tim Janik <timj@gtk.org>
* gtk/gtktreeitem.c (gtk_tree_item_set_subtree):
* gtk/gtktree.c (gtk_tree_add) (gtk_tree_insert):
* gtk/gtktoolbar.c (gtk_toolbar_insert_element):
* gtk/gtkpaned.c (gtk_paned_pack2) (gtk_paned_pack1):
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_add):
* gtk/gtktable.c (gtk_table_attach):
* gtk/gtklist.c (gtk_list_insert_items):
* gtk/gtkmenushell.c (gtk_menu_shell_insert):
* gtk/gtknotebook.c (gtk_notebook_insert_page_menu):
* gtk/gtkpacker.c (gtk_packer_add_defaults) (gtk_packer_add):
* gtk/gtkbin.c (gtk_bin_add):
* gtk/gtkbox.c (gtk_box_pack_start) (gtk_box_pack_end):
* gtk/gtkfixed.c (gtk_fixed_put):
* gtk/gtklayout.c (gtk_layout_put):
general fixups to container_add logic. always realize child if
child->parent is realized, only map the child and queue a resize
if child and child->parent are both visible.
Fri Apr 30 09:02:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_unrealize): use gtk_container_forall
instead of gtk_container_foreach to walk and unrealize children, so
composite children get also unrealized.
(gtk_widget_real_show): don't call gtk_widget_map() if we don't need to.
(gtk_widget_map): assert that the widget is visible (basic constrain).
(gtk_widget_real_map): assert that the widget is realized (basic
constrain).
Fri Apr 29 00:53:20 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbindings.c (gtk_pattern_spec_init): plugged a memory leak.
Tue May 4 09:32:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc.iso-8859-2: Add a gtkrc
file for iso-8859-2 locales.
* configure.in (ALL_LINGUAS): ALL_LINGUAS update.
Tue Apr 27 16:38:32 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Fix typo of static_sources for static_SOURCES.
(Pointed out by andy@rz.uni-karlsruhe.de and others).
Remove some suspicious and useless lines.
Tue May 4 08:44:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c (gtk_clist_draw, draw_rows): Use
width,height = 0, 0 to mean - here to edge of window,
instead of -1, -1, since the former is all we support.
Tue May 4 08:34:43 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main): Correctly free list nodes
when removing from quit_functions list.
Tue Apr 27 14:17:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpacker.c (gtk_packer_size_request): remove unused variable.
Tue Apr 27 18:23:35 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable):
When redrawing characters on non-visible entry, use appropriate
'*' character. (Bug #1130 - Jean-Marc Jacquet <jm@littleigloo.org>)
Tue Apr 27 01:31:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (drag_dest_cell): compute destination cell
from drag coordinates.
(gtk_clist_drag_data_received) (gtk_clist_drag_motion):
use drag_dest_cell.
* gtk/gtktree (drag_dest_cell)
(gtk_ctree_drag_data_received) (gtk_ctree_drag_motion): likewise.
(Bug #1129)
Wed Apr 21 21:26:11 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_init): properly initialize
translate_* fields.
(gtk_item_factory_finalize): invoke translate_notify independant from
translate_data.
(gtk_item_factory_set_translate_func): likewise.
(gtk_item_factory_destroy): only remove ifactory pointer from those
widgets that belong to us (stupid me).
Mon Apr 19 12:05:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Fixed leak of
rc_style list when lookup succeeeds.
Thu Apr 15 01:11:24 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (resync_selection):
* gtk/gtkclist.c (resync_selection): fixed undo_selection bug.
* gtk/gtkclist.c (gtk_clist_button_release): fixed resync_selection
bug.
Fri Apr 9 19:22:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c gtk/gtkdnd.c gtk/gtkmenuitem.c:
Add some missing GDK_THREADS_ENTER()/LEAVE around
timeouts. (Patches from Sebastian Wilhelmi <wilhelmi@ira.uka.de>)
Thu Apr 8 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkentry.c (gtk_entry_key_press): use gtk_widget_activate()
rather than emit_by_name.
* gtk/gtkeditable.c (gtk_editable_insert_text): keep a reference
on the widget across multiple signal emissions.
(gtk_editable_delete_text): same here.
(gtk_editable_class_init): set widget_class->activate_signal after
editable_signals[ACTIVATE] has been created.
Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
position here prematurely -- we might not have the
right ->min_position and ->max_position yet.
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
Add error traps so if the other end of the connection
dies, we survive.
* gtk/gtkselection.c (gtk_selection_notify): Clean
up properly when selection property retrieval fails.
* gtk/gtkselection.c (gtk_selection_request): Correctly
reject SelectionRequest notifies where the handler
returns no data.
Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_dest_leave): Only unhighlight
when we've previously highlighted.
* gtk/gtkdnd.c (gtk_drag_dest_handle_event): Don't
emit two "drag_leave" signals for Motif drops.
* gtk/gtkdnd.c (gtk_drag_source_handle_event): Send
back the correct status messages when dropping from
Motif onto a proxy window that is rejecting the
drop.
Sat Mar 27 23:32:13 1999 Tim Janik <timj@gtk.org>
* gtk/gtkarg.[hc]: added functions from GLE, gtk_arg_reset() to free
the value and reset type to GTK_TYPE_INVALID, and gtk_arg_values_equal()
to compare two argument values. added gtk_arg_to_valueloc() to set a
variable from an arg through its location (pointer).
* gtk/gtkobject.[hc]: implemented gtk_object_get() in terms of
gtk_object_arg_get() and gtk_arg_to_valueloc(), floats are collected
as gfloat*, uchars are collected as guchar*, ints are collected as
gint*, etc...
Mon Mar 29 17:45:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccelgroup.c gtk/gtkgtkbindings.c:
Include <string.h> instead of <strings.h>.
* gtk/gtkstyle.c: Fix double include of gtkthemes.h
(actually, a lot more duplicate includes occur if
you trace through the sequence of #include's)
gtk-jbb-990320-0: John Bley, jbb6@acpub.duke.edu
Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com>
Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp>
gtk-a-higuti-990322-[0-3]
* configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS
that was causing -DX_LOCALE not to work.
* gtk/gtkrc.c (gtk_rc_init):
X_LOCALE will never have LC_MESSAGES defined
Thu Mar 25 12:38:31 1999 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_append_default_module_path): get $HOME from
g_get_home_dir() (gtk-pmc-990123-0.patch.gz).
* gtk/gtkwindow.c (gtk_window_key_press_event): feature keypad up/down/
left/right as well (gtk-michael-980726-0.patch.gz).
* gtk/gtklabel.[hc]: bunch of miscellaneous cleanups, such as s/0/NULL/
for pointer values, use gchar instead of char. fixed uline allocation
leaks, changed the allocation pattern so we use G_ALLOC_AND_FREE mem
chunks instead of G_ALLOC_ONLY.
(gtk_label_size_request): always alter requisition as passed and leave
widget->requisition alone.
(gtk_label_set_text): allow NULL strings.
(gtk_label_new): likewise.
Wed Mar 24 09:24:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.[hc]: type/macro fixups.
Mon Mar 22 05:51:34 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbin.c (gtk_bin_draw): only redraw children that are visible
*and* mapped (i.e. drawable).
(gtk_bin_expose): only send exposes to drawable children.
* gtk/gtkbox.c (gtk_box_draw): only redraw children that are drawable.
(gtk_box_expose): only send exposes to drawable children.
* gtk/gtkhscale.c (gtk_hscale_draw):
* gtk/gtkvscale.c (gtk_vscale_draw):
hm, this is an ugly one. we first compute the size of our trough area
here (window relative) and then check intersection with the draw_area
which is parent relative because we're a NO_WINDOW widget, so we need
to offset the trough area by allocation.x and allocation.y before the
check. (this must not be done for the background area though, since
that's already computed parent relative).
Mon Mar 22 00:41:39 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_unrealize): unmap clist if neccessary,
unrealize title buttons.
Fri Mar 19 00:00:22 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_column_title_passive)
(gtk_clist_column_title_active):
only connect/disconnect to GtkWidgetClass::event to block mouse events.
* gtk/gtkclist.c (vertical_timeout) (horizontal_timeout):
zero initialize event, removed superfluous gdk_window_get_pointer call
* gtk/gtklist.c (gtk_list_vertical_timeout)
(gtk_list_horizontal_timeout): removed superfluous
gdk_window_get_pointer call
Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org>
* plugging problems reported by "Bruce Mitchener, Jr."
<bruce@puremagic.com> due to a purify session.
* gtk/gtkstyle.c:
(gtk_style_ref):
(gtk_style_unref): assert ref_count to be > 0.
* gtk/gtkclist.c (gtk_clist_set_cell_style): { 0 } initilaize
the requisition.
(gtk_clist_set_shift): likewise.
* gtk/gtklayout.c: introduce gtk_layout_finalize() to unref the
adjustments.
* gtk/gtklist.c (gtk_list_horizontal_timeout): zero initialize the
event before sending it and set send_event to TRUE (which needs to
be done for *all* synthesized events).
(gtk_list_vertical_timeout): likewise.
* gtk/gtktipsquery.c (gtk_tips_query_destroy): plug small memory
leaks.
* gtk/gtkdrawingarea.c (gtk_drawing_area_send_configure): set send_event
to TRUE when synthesizing events.
[ *** end of merges from 1.2 *** ]
1999-11-22 21:52:50 +00:00
|
|
|
if (clist->clist_window_height - clist->voffset > LIST_HEIGHT (clist) ||
|
|
|
|
(clist->voffset + (gint)clist->vadjustment->value) != 0)
|
1998-11-07 14:29:22 +00:00
|
|
|
{
|
|
|
|
clist->vadjustment->value = MAX (0, (LIST_HEIGHT (clist) -
|
|
|
|
clist->clist_window_height));
|
|
|
|
gtk_signal_emit_by_name (GTK_OBJECT (clist->vadjustment),
|
|
|
|
"value_changed");
|
|
|
|
}
|
|
|
|
gtk_signal_emit_by_name (GTK_OBJECT (clist->vadjustment), "changed");
|
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
|
1998-11-07 14:29:22 +00:00
|
|
|
if (clist->hadjustment)
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-11-07 14:29:22 +00:00
|
|
|
clist->hadjustment->page_size = clist->clist_window_width;
|
|
|
|
clist->hadjustment->page_increment = clist->clist_window_width / 2;
|
|
|
|
clist->hadjustment->step_increment = 10;
|
|
|
|
clist->hadjustment->lower = 0;
|
|
|
|
clist->hadjustment->upper = LIST_WIDTH (clist);
|
1998-01-03 03:31:03 +00:00
|
|
|
|
Adapt cast macros to standard.
Fri Nov 19 10:34:41 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkgamma.h: Adapt cast macros to standard.
[ Merges from 1.2 ]
Tue Nov 16 10:15:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_path):
If translation does not include a '/', use entire
translation instead of crashing.
Sun Oct 31 22:21:11 1999 Tim Janik <timj@gtk.org>
* docs/gtk_tut.sgml:
s/gtk_accel_group_attach/gtk_window_add_accel_group/.
Sat Oct 30 09:09:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_target_list_remove): Use
g_list_remove_link, not g_list_remove.
[ From Geert Bevin <gbevin@thunderstorms.org> ]
Sun Oct 24 07:41:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkclist.c (real_undo_selection): commented out g_print()
statement upon unselection (how the heck did that slip in?).
Sat Oct 23 03:03:08 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_freeze):
(gtk_text_thaw): undraw/draw cursor here to avoid unnecessary scrolling
in frozen state (and aparently crashes). patch provided by Anders
Melchiorsen <and@kampsax.dtu.dk>.
Sat Oct 23 02:53:20 1999 Tim Janik <timj@gtk.org>
* fix insensitive default/focus widget activation,
reported by Matt Goodall <mgg@isotek.co.uk>.
* gtk/gtkwindow.c (gtk_window_key_press_event):
(gtk_window_activate_default):
(gtk_window_activate_focus):
return handled=FALSE for actiavtion of insensitive default
widgets. return handled=TRUE for activation of insensitive
focus widgets. don't activate in either case.
Tue Oct 19 09:55:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk-config.in (lib_gtk): Switch order of @x_cflags@
and $glib_cflags to match library order and in the
theory that an old version of GLib is more likely to
be in the include directory for X then vice-versa.
(Bug #2776)
Tue Oct 19 09:46:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always use LC_CTYPE
to determine the locale for fontsets, not LC_MESSAGES;
the user may want English messages with a handling
for non-English languages. (LC_CTYPE=ru_RU LC_MESSAGES=fr_FR
will still be broken) (Bug #2891)
Tue Oct 19 20:36:42 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Fixed the wrong number of "*"'s.
Tue Oct 19 12:15:13 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Changed the Korean default fontset.
Fri Oct 8 02:32:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): Fix bug
where when scrolling to the left or top double exposes
were done, causing major slowdowns.
Thu Oct 7 18:31:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always normalize codeset
names to lowercase and alphanumeric, before looking
them up.
* gtk/Makefile.am: Install codeset variant gtkrc files
with normalized names.
Thu Oct 7 22:52:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_popup_with_data): even
popup menus when the menu is already visible, but its parent
is still hidden, (happens after tornoff window got hidden).
Thu Oct 7 11:09:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (install-data-local): Fix
a typo where gtkrc.vi_VN.tcvn5712 wasn't getting
deleted, causing error messages on install.
Thu Oct 7 11:03:06 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtk[hv]paned.c (gtk_{h,v}paned_draw): Redraw
the handle as well, since we now sometimes ignore
exposes on the handle while resizing.
Wed Oct 6 18:02:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_append_default_pixmap_path): Fix stupid
extra g_free introduced in one of the last one or two
commits.
Wed Oct 6 16:38:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc*: Make naming of gtkrc files
consistent, put each style that a gtkrc.* file creates
in a unique namespace, remove old files before installing.
Wed Oct 6 14:31:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Avoid leaking memory when
gtk_rc_init is called multiple times. (Yes, people who
do that have bugs in their code.)
Tue Oct 5 11:36:57 PDT 1999 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: listing gtkrc in gtkconf_DATA seems to barf.
Remove it since it's generated by the Makefile anyway
Tue Oct 5 02:43:41 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputcommon.h (gdk_input_device_new): Free
device->info.axes for core pointer.
Thu Sep 30 13:55:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (destroy_idle_test): Rename idle to
idle_id, to deal with obsolete, broken C libraries.
Mon Sep 27 02:50:15 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkvscale.c (gtk_vscale_draw): Don't add in
allocation->x/y twice!
* gtk/gtkhscale.c: Make usage of gtk_hscale_pos_trough()
consistent with gtk_vscale_pos_trough().
Sun Sep 26 19:44:34 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_queue_resize): We may
be queueing a resize on a toplevel container between
the time we show it and when we map it. So, we need
to test GTK_WIDGET_VISIBLE() for toplevels, and only
use GTK_WIDGET_DRAWABLE() for child windows.
Thu Sep 23 16:41:03 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDADDS): Add GDK_WLIBS to LDADDS
(fixes bug #2144)
Fri Sep 24 00:51:45 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c (gtk_container_queue_resize): check for
container DRAWABLE (instead of VISIBLE), so we don't queue
resizes on non-toplevel containers.
Sun Sep 19 18:13:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.[ch]: Make the data argument
const guchar *.
Sat Sep 18 21:27:40 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: Try to behave sensibly if
the focus widget is the window itself. (Should
we allow this at all?)
Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_set_sensitive):
* gtk/gtknotebook.c (gtk_notebook_set_scrollable):
* gtk/gtknotebook.c (gtk_notebook_set_show_border):
* gtk/gtkclist.c (gtk_notebook_set_show_border): make gboolean args
in prototypes and implementations consistent (Tomas Ogren).
* gtk/gtklayout.c (gtk_layout_remove): unset GTK_IS_OFFSCREEN flag
before the widget is unparented (reported by damon).
* gtk/gtkdnd.c: make the cursor and icon data _unsigned_ char,
since we provide unsigned data anyways.
Thu Sep 16 21:32:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_set_tip): Delay
the call to gtk_tooltips_layout_text() until later.
* gtk/gtktooltips.c (gtk_tooltips_draw_tips):
Call gtk_widget_ensure_style() before using the style.
Wed Sep 15 02:52:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_event): Added workaround
for old widgets that don't propagate draws to all
children. (Namely gnome-dock for gnome-libs <= 1.0.16)
Tue Sep 14 19:22:19 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_queue_resize): don't queue the parent
for a redraw but just the widget that requested the resize.
Tue Sep 14 18:29:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c: added new widget level method
gtk_container_set_reallocate_redraws() and a GtkContainer flag
reallocate_redraws : 1 to reflect the setting, exported this through
the argument system as a boolean ::reallocate_redraws.
* gtk/gtkwidget.c (gtk_widget_size_allocate): when queueing redraws
on the widget because the allocation changes, do so as well for
widget->parent if the parent has reallocate_redraws set to TRUE.
with that containers requesting reallocation redraws get automatically
redrawn if their children changed allocation (this unfortunately
affects also other children that didn't change allocation, but we
cannot work around that before 1.3).
Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_idle_draw): only emit ::draw if width
_and_ height are >0 (not _or_).
* gtk/gtktable.c (gtk_table_remove): use gtk_widget_queue_resize()
instead of gtk_container_queue_resize(), which is a core gtk internal
function (must have been on crack when i queued that).
* gtk/gtkprivate.h: added new private flag GTK_FULLDRAW_PENDING, so
we can check more reliably if we want to discard expose events.
* gtk/gtkwidget.c: added setting/unsetting of the GTK_FULLDRAW_PENDING
flag.
* gtk/gtkwidget.c (gtk_widget_event): don't discard synthesized exposes,
we simply trust these events. for deciding whether to discard exposes,
check GTK_FULLDRAW_PENDING instead of RESIZE_PENDING.
Mon Sep 13 15:01:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore
queues of areas that are completely off screen.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fix broken
logic for handleboxes.
* gtk/gtkwidget.c (gtk_widget_queue_draw_data): Add santity
check on width/height.
Mon Sep 13 02:22:47 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: backed out Raja's recent VPATH build "improvements",
we are fine with using $@ the way we do (if we actually encounter
brokeness with $@ in VPATH builds because of additional path prefixes,
we need to use $(@F) actually).
Mon Sep 13 01:34:53 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c: renamed two variables, hopefully didn't introduce
short lived bugs, that would allow language bindings to do surgeries
to our guts.
Fri Sep 10 15:22:50 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_size_allocate): Fix typo
where comparison was being done against an uninitialized
value causing intermittant results depending on
compiler flags. Also make it clearer that we aren't
ever initializing the child as 0x0 (though this will
be caught in gtk_widget_size_allocate())
Fri Sep 10 10:06:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_transient_for): Move
gtk_window_unset_transient_for() call after we do checks
involving the old transient parent.
[ From Lance Capser <lmc@cyberhighway.net> ]
1999-09-07 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gtk.defs): Go back to using `touch' to create
an empty file.
Mon Sep 6 00:11:56 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (gtk_ctree_is_ancestor): return FALSE if node has
no children. (Reported by: Chris Rogers <gandalf@pobox.com>)
1999-09-03 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gen_sources): Improve VPATH builds.
`$@' is valid only in the build dir, not after we've done
`cd $srcdir'. Also use `test -f' instead of less portable
`test -e'.
Fri Sep 3 15:59:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (correct_cache_insert): Rewrite
for simplicity, and hopefully correctness.
(Fixes bug #1322, which was a segfault when
on some insertions with the properties around
the insertion set up just wrong.)
* gtk/gtktext.c (gtk_text_adjustment): When we receive
a "changed" signal, clamp the new value to the adjustment
bounds to avoid segfaulting if someone tries to change
the adjustment to a bogus value. (Bug #1795)
Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c: Ignore unexpected destroy notifies
for children, for toplevel windows handle them
like delete_event.
* gtk/gtkplug.c: Add an unrealize handler so that
we unref plug->socket_window when we are done
with it.
Fri Sep 3 14:52:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_area): Fix stupid signedness
problem that was causing background to sometimes
be misaligned.
Fri Sep 3 12:26:33 1999 Owen Taylor <otaylor@redhat.com>
[ Fixes pointed out by Ettore Perazzoli <ettore@comm2000.it> ]
* gtk/gtkmenu.c (gtk_menu_position): Make
sure we never position menus with negative x, y,
since gtk_widget_set_uposition() can't handle that.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu):
Modify the positioning code a bit so that we always
put the top-left corner onscreen. (This is for
UI reasons, gtk_menu_position() now takes care of
gtk_widet_set_uposition() brokeness.)
Fri Sep 3 03:06:30 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: fixed up things for -jx, x > 1.
Sun Sep 5 08:48:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_style): Ref the
RC style that is passed in. The lack of the ref
before was a bug. If people worked around this
bug, this will introduce a slight memory leak
in their code. The code should typically look like:
rc_style = gtk_rc_style_new ();
[...]
gtk_widget_modify_style (widget, rc_style);
gtk_rc_style_unref (rc_style);
* gtk/gtkwidget.c (gtk_widget_modify_style): Reset
the style if it was already set.
* gtk/gtkwidget.c (gtk_widget_set_name): Only set the
style if it was set before.
Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (main): Add a check to see if we
are being run from the correct directory and
to quit nicely if we are not.
* gtk/gtkrc.c (gtk_rc_slist_remove_all): Make function
static.
Thu Sep 2 23:00:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkenums.h (GtkWindowPosition): added GTK_WIN_POS_CENTER_ALWAYS.
* gtk/gtkwindow.c:
queue resizes unconditionally (gtk_widget_queue_resize will figure
what to do if the window is not realized).
(gtk_window_move_resize): only recenter the window
for GTK_WIN_POS_CENTER_ALWAYS.
(gtk_window_compute_reposition): handle GTK_WIN_POS_CENTER_ALWAYS in
the same way as GTK_WIN_POS_CENTER.
Thu Sep 2 22:39:27 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_reposition): check for the last position
with (!(info->last_flags & GDK_HINT_POS)) instead of
(!info->last_flags & GDK_HINT_POS).
* gtk/gtkwindow.c (gtk_window_move_resize): constrain new_width and
new_height unconditionally, because we use these values even if
!default_size_changed && !hints_changed.
comented the (default_size_changed || hints_changed) case with
respect to resize rejects from the window manager.
* gtk/gtkwindow.c (gtk_window_move_resize): save info->last values
in the zvt condition hack, since this includes the window hints, set
the hints after the handling_resize case.
* gtk/gtkwindow.c (gtk_window_show): constrain the default size that a
window is initially shown with to the geometry.
Thu Sep 2 07:38:56 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize):
s/size_changed/default_size_changed/g so i know what's
really going on (frying brain on smaller flame now).
Thu Sep 2 05:47:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): queue a new resize if
we have size_changed upon handling_resize. this is a gross
workaround for the broken zvt widget and should be removed in
1.3 again (search for FIXME).
Owen provided an accurate comment for this:
/* We could be here for two reasons
* 1) We coincidentally got a resize while handling
* another resize.
* 2) Our computation of size_changed was completely
* screwed up, probably because one of our children
* is broken. It's probably a zvt widget.
*
* For 1), we could just go ahead and ask for the
* new size right now, but doing that for 2)
* might well be fighting the user (and can even
* trigger a loop). Since we really don't want to
* do that, we requeue a resize in hopes that
* by the time it gets handled, the child has seen
* the light and is willing to go along with the
* new size. (this happens for the zvt widget, since
* the size_allocate() above will have stored the
* requisition corresponding to the new size in the
* zvt widget)
*
* This doesn't buy us anything for 1), but it shouldn't
* hurt us too badly, since it is what would have
* happened if we had gotten the configure event before
* the new size had been set.
*/
Wed Sep 1 20:46:11 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: deal properly with the fact that RC
style lists may include rc styles more than once.
* gtk/gtkrc.c (gtk_rc_append_pixmap_path): Removed
unused static function.
* gtk/gtkrc.c (gtk_rc_find_pixmap_in_path): Keep a
stack of directories of RC files currently being
parsed and implicitely add them to pixmap path.
This fixes a bug where the directory would get
appended then overwritten by pixmap_path declarations.
(bug #1462, from Peter Wainright <prw@wainpr.demon.co.uk>)
* gtk/gtkthemes.c (gtk_theme_engine_unref): Call
theme's exit function. (Patch from Peter Wainwright,
bug #1454)
* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_destroy):
Add a destroy() handler to take care of removing
group for menu item. (Fixes bug #1197)
* gtk/gtkwidget.c (gtk_widget_size_request): Fixed thinko
in warning message.
Wed Sep 1 21:27:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): don't require a server
roundtrip to figure window's width and height, since we know that
anyways from widget->allocation.
Wed Sep 1 12:37:44 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Compute
the hints after we request the new size.
Wed Sep 1 10:38:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_compute_hints): Removed
GTK_WIDGET_REALIZED() assertion - we can compute the
hints before we are realized.
* gtk/gtkwindow.c (gtk_window_move_resize): Reorder
hint changing so that we have a value of hints_changed
when we decide whether to constrain the window size.
* gtk/gtkwindow.c (gtk_window_move_resize): Spelling fix.
* gtk/gtkwindow.c (gtk_window_constrain_size): cleanups,
change back to G_MAXINT.
Wed Sep 1 06:54:59 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_get_geometry_info): zero initialize
new GtkWindowGeometryInfo, so fields like GdkGeometry geometry
contain uncluttered values.
(gtk_window_compute_hints): simply assert that window is realized
and that geometry_info is valid, since we rely on this anyways.
(gtk_window_constrain_size): major cleanups to the code.
if (flags & GDK_HINT_BASE_SIZE) use geometry's base width and height
for the base size, instead of the minimums. use 32767 as max width
and height (like in gtkwindow.c) instead of G_MAXINT.
Wed Sep 1 04:41:25 1999 Tim Janik <timj@gtk.org>
* cleaned up the GtkContainer.need_resize flag handling mess, we
only need to force resize requests when we were prematurely
realized, or our widget tree was modified when we were temporarily
hidden. handling these cases directly upon showing the window (i.e.
while the GdkWindow is still unmapped) avoids the need to wait for
a configure event response and therefore makes the GUI more snappier
and avoids blank windows during the roundtrip.
* gtk/gtkwidget.c:
(gtk_widget_hide):
(gtk_widget_show): don't queue resizes on toplevels, they know how
to deal with matters.
* gtk/gtkcontainer.c (gtk_container_queue_resize): set the ->need_resize
flag directly for not visible resize containers and spare us unecessary
signal emissions.
* gtk/gtkwindow.c:
(gtk_window_realize): if we need to enforce premature size allocation,
queue a container resize so we are correctly resized later on.
(gtk_window_init):
(gtk_window_size_request):
don't freak around with the ->need_resize flag,
gtk_container_queue_resize() will care about that.
(gtk_window_show):
handle initial resizing issues here, we can handle matters better in
this place, especially since we know that our GdkWindow is still
unmapped.
(gtk_window_move_resize):
don't care about ->need_resize at all.
handle size changes properly that occoured while we waited for a
configure event.
Tue Aug 31 15:58:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_uposition):
* gtk/gtkwindow.[hc] (gtk_window_reposition):
Move the hint setting code from gtk_widget_set_uposition
to here; set the hints so that we respect any previously
set geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Don't
change the window hints here or move the window here,
let that happen in gtk_window_move_resize().
Tue Aug 31 06:58:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): when discarding exposes due
to already queued resizes (and therefore redraws) on a widget, check
its anchestry as well.
* gtk/gtkcontainer.c:
(gtk_container_queue_resize): clear resize widgets for resize
containers before aborting prematurely. this is especially important
for toplevels which may need imemdiate processing or their resize
handler to be queued.
(gtk_container_dequeue_resize_handler): added new internal function for
gtkwindow.c.
* gtk/gtkwindow.c (gtk_window_move_resize): if we are resizing due to a
configure event, take possible changes in window position into account
as well.
if we request a new window size, queue up a resize handler that will
last until the configure event response arrives.
combined the ->need_resize case (initial show) with the general size
(hints) changed case and added even more comments.
if !auto_shrink, only revert to the old allocation if the new size
is smaller than the current allocation.
Tue Aug 31 11:55:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_arg, gtk_window_set_policy,
gtk_window_set_geometry_hints
gtk_window_set_default_size):
When hints are set, queue a resize so that the hints will
be eventually reset on the toplevel.
* gtk/gtkwindow.c (gtk_window_show): Use
gtk_window_compute_default_size(). Clear the need_resize flag
on the initail map so that we don't unnecessarily trigger the
resize code.
* gtk/gtkwindow.c (gtk_window_move_resize): Split apart
into separate functions. Compare the hints we are setting
with what we set last time so that we can accurately
tell when we need to reset the hints.
* gtk/gtkwindow.c (gtk_window_compute_default_size): New
function to figure out the size from requisition
and default_size.
* gtk/gtkwindow.c (gtk_window_constrain_size): Function
from fvwm to constrain a size to the geometry hints.
* gtk/gtkwindow.c (gtk_window_compare_hints): New function
to compare two sets of geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_hints): Renamed
from gtk_window_set_hints(), just compute the hints,
don't set them.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Move
code from gtk_window_move_resize() to separate function,
rationalize a bit.
Tue Aug 31 13:05:03 1999 Owen Taylor <otaylor@redhat.com>
* gtkrc.h: Move the ref_count member out of the GtkRcStyle
structure into a new private structure.
* gtkrc.c: Split GtkRcStyle into public/private.
In the private part, add a list of pointers to the
RcStyle lists this RcStyle participates in.
* gtkrc.c: When a RcStyle is free, remove all
lists referencing it from the
realized_style_ht hash, and free those lists.
* gtk/gtkrc.c (gtk_rc_clear_styles): Don't call
gtk_rc_init(), since that adds the default styles
to the list of parsed RC files again.
* gtk/gtkrc.c: Use gtk_rc_style_find() consistently.
Thu Aug 26 14:14:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): reactivated the sanity
checks that ensure that a widget's allocation is at least 1 in width
and height. (GNOME note: this doesn't affect old panel code anymore,
because GtkSocket will request width and height of at least 1 since
Fri Jul 23).
* gtk/gtkwindow.c (gtk_window_realize): if the widget hasn't been
allocated yet (happens if the user realizes the window prematurely),
size request and allocate it.
(gtk_window_size_allocate): guard against guint underflows.
Wed Aug 25 19:01:36 1999 Lars Hamann <lars@gtk.org>
* gtk/Makefile.am (gtk_built_sources): reordered stamp-gtk.defs
in gtk_built_sources, so gtk.defs gets built prior to all other
sources.
Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am:
invoke indent on gtkmarshal.*.
rewrote source generation rules, use COPYING as oldest source tag for
a piggyback rule to generate all sources from (don't touch it ;).
major cleanups, strip spaces on build rules for GNU Make.
* gtk/genmarshal.pl: don't operate on hardcoded filenames but take
source and target files from commandline arguments. don't invoke indent.
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Wed Aug 18 09:20:10 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c:
we use window->need_resize from configure_event now, to indicate that
the gtkwindow should keep its allocation (e.g. because the user resized
the window through window manager handles). resize_count is now reliably
used to figure whether we got the allocation we requested from the
window manager.
configure events get queued as resizes now, the real stuff (size
computation and allocation) now only goes on in gtk_window_move_resize().
GtkWindow's requisition now contains its *real* requisition (like all
other widgets), *not* taking usize into account.
geometry_info->last_{width|height} is now updated from set_hints() only
so it always contains the last hints we set for the window manager.
made some event handlers return TRUE instead of FALSE.
the overall code should be much more straight forward now, and the
significant code portions are accompanied by comments now.
(gtk_window_set_hints):
removed requisition argument and made it
fetch the requisition through gtk_widget_get_child_requisition.
we also don't move the gdkwindow here anymore, gtk_window_move_resize()
does that now.
(gtk_window_show):
ensure that the widget is realized before calling
gtk_container_check_resize() (and thus gtk_window_move_resize()), also
ensure that we got properly size requested and allocated before
realization.
(gtk_window_configure_event):
ignore plain window moves, or reallocate the widget tree through the
resize queue otherwise.
(gtk_window_move_resize):
mostly rewrote this function to figure window manager hints more
reliably, coalesce window moves and resizes to reduce configure events
and do actuall size allocations.
Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): discard expose events for widgets
that have a resize pending, because a redraw is already queued for them.
* gtk/gtkcontainer.c: removed ugly connect_to ::size_allocate signal
hack to clear resize_widgets.
* gtk/gtkwidget.c (gtk_widget_size_allocate): call clear_resize_widgets
for resize containers prior to size allocation. (this is also a bit
ugly, but avoids side effects for stopped emissions and is thus more
reliable).
(gtk_widget_unparent): removed disconnect call for clear_resize_widgets.
* gtk/gtktooltips.c (gtk_tooltips_paint_window): renamed this
function from gtk_tooltips_expose, as we connect to ::expose_event
*and* ::draw now.
1999-08-18 Federico Mena Quintero <federico@redhat.com>
* gtk/gtkselection.c (gtk_target_list_ref): Added missing sanity
checks.
(gtk_target_list_unref): Likewise.
* gtk/gtkthemes.c (gtk_theme_engine_unref): Likewise.
Tue Aug 17 15:47:07 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_draw_value_bar):
guard against division by zero. (Fixes bug #1339)
Tue Aug 17 10:56:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_move_{forward,backward}_word):
Prevent the trivial leak of information of allowing
word motion when the entry is not visible.
Tue Aug 17 10:28:52 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_fileop_error): Propagate
modality to error dialog as well as confirmation dialogs.
(Bug #1803, reported by Rosanna Wing Sze Yuen)
Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktreeitem.c (gtk_tree_item_draw_lines): Honor
tree->view_lines.
(gtk-guy-990611-3.patch: Guy Harris <guy@netapp.com>)
* gtk/Makefile.am (install-data-local): Solaris apparently
has various troubles with ln -f; use rm first instead.
(gtk-guy-990611-2.patch: Guy Harris <guy@netapp.com>)
1999-07-30 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (stamp-m): Don't `mv' from builddir to srcdir,
use `cp' followed by `rm' (the `rm' was already there).
July 30, 1999 Elliot Lee <sopwith@redhat.com>
* configure.in: Fix autoconf warnings about cross compilation by
trying to provide sane defaults for AC_TRY_RUN.
* gtk/Makefile.am: If we refer to gtkmarshal.[ch] in $(srcdir),
put them into $(srcdir) when generated. Also add a dependency of
gtksignal.h on gtkmarshal.h for -j builds.
* gtk/gtk(dnd,style,gamma).c: Minor warning fixes.
Wed Jul 28 09:29:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration_do): Added missing
GDK_THREADS_{LEAVE,ENTER} pair.
(From Paul Fisher <pnfisher@redhat.com>)
Fri Jul 23 01:00:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtksocket.c (gtk_socket_size_request): asure that the requested
width and height are always >0 (owen).
Fri Jul 23 00:00:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): backed out my recent
change that assured that a widget's allocated with and height are
always >1, since this breaks *buggy* panel code. unfortunately this
back-breaks the gimp's color selector.
* gtk/gtkdrawingarea.c (gtk_drawing_area_size_allocate): asure that our
allocation is always >0 in width and height, before sending the
configure event; this is a *gross* hack to get the gimp back to work.
* marked both cases with TODO-1.3
Wed Jul 21 15:47:39 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Don't display wrap indicators when
text is not editable and word wrap is on.
Wed Jul 21 08:21:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): special case
option menus here as they are not derived from menu shell, assure that
the option menu has a menu we can add items to.
Tue Jul 20 23:29:48 1999 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_page_allocate): convert allocation->
width/height to (gint) before calculations and check against < 0 to
avoid guint wraparounds.
Sun Jul 18 00:35:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): ensure that the allocated
width and height is never zero. sanity check both dimensions against
32767 and issue a warning if the allocation is greater than that.
Wed Jul 7 15:03:30 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_events_pending): Unlock around call
to g_main_pending() as well.
Wed Jul 7 14:59:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration): Unlock around
call to g_main_iteration() - since that will regrab
GTK+ lock to process events.
Thu Jul 1 15:01:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c
- Regularize with the rest of GTK+ by making widget->requisition
not reflect the set_usize()
- Always recompute geometry hints, then check if they
changed before sending them to the X server. The
previous checks for changes would fail in a number
of circumstances.
Thu Jul 1 11:55:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Include <stdlib.h> for strcmp().
Wed Jun 30 19:26:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c:
- Code cleanups
- Instantaneously update on modifier key presses
- Allow cancellation of the drag with Escape.
Tue Jun 29 17:04:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_handle_box): Set the policy
to auto_shrink - otherwise the appearance is rather
strange when flipping between horizontal and vertical.
Mon Jun 28 09:29:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: add ::default_width and ::default_height arguments.
(gtk_window_set_default_size): don't change a value if it's < 0.
queue a resize.
Sun Jun 27 11:00:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_insert): don't segfault on NULL inserts.
Mon Jun 28 12:08:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (cmpl_completion_fullname): Don't
add an extra "/" when concating "/" + filename.
(From Matt Grossman <mattg@oz.net>)
Mon Jun 28 10:57:12 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (draw_cell_pixmap): Reset clip mask
for fg_gc if we set it for drawing pixmap.
Tue Jun 15 12:45:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes from Peter Wainwright <prw@wainpr.demon.co.uk>
* gtk/gtkrc.c (gtk_rc_parse_engine): If rc_style->engine is
already set, call old engine's destroy function and
unref the old engine.
Thu Jun 10 17:59:38 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.c (gtk_drawing_area_size): queue a resize.
Wed Jun 9 15:13:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h: mark certain functions as internal.
Wed Jun 9 13:48:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpreview.c (gtk_preview_set_expand): queue a resize if the
expand behaviour changed.
* gtk/gtklabel.c (gtk_label_set_pattern):
(gtk_label_set_justify):
(gtk_label_set_line_wrap):
don't bother invoking queue_clear, the reallocation does
that for us, always free_words so the upcoming resize will
relayout the label's contents.
Wed Jun 9 12:50:48 1999 Tim Janik <timj@gtk.org>
* applied argument implementation patches from Elena Devdariani
<elena@cogent.ca>.
* gtk/gtktoolbar.c: ::orientation, ::toolbar_style, ::space_size,
::space_style, ::relief
* gtk/gtkruler.c: ::lower, ::upper, ::position, ::max_size
* gtk/gtkpreview.c: ::expand
* gtk/gtkpaned.c: ::handle_size, ::gutter_size
* gtk/gtknotebook.c: ::homogeneous
* gtk/gtklabel.c: ::wrap
* gtk/gtklist.c: ::selection_mode
* gtk/gtkhandlebox.c: ::handle_position, ::snap_edge
* gtk/gtkcurve.c: ::curve_type, ::min_x, ::max_x, ::min_y, ::max_y
* gtk/gtkcolorsel.c: ::update_policy, ::use_opacity
* gtk/gtkclist.c: ::sort_type
* gtk/gtkcheckmenuitem.c: ::active, ::show_toggle
* gtk/gtkaspectframe.c: ::xalign, ::yalign, ::ratio, ::obey_child
Tue Jun 1 23:38:38 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Removed ill-thought-out part of last
comment.
Tue Jun 1 23:30:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_attach): Get the reference
counting right when we have to attach a new style
for a different visual. (Chi-Deok Hwang <cdhwang@sr.hei.co.kr>)
* gtk/gtkstyle.c: Documented the refcounting
peculularities of gtk_style_attach.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkwindow.c (gtk_window_new): added return if fail for invalid
window types.
* examples/packer/pack.c (main): use GTK_WINDOW_TOPLEVEL instead
of GTK_TOPLEVEL for creating the window.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkmain.c (gtk_init_check): don't segfault when --gtk-module is
the last argument (reported by Per Winkvist).
Tue May 25 13:13:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes for invisible XOR lines (Frank Loemker
<floemker@TechFak.Uni-Bielefeld.DE>)
* gtk/gtkclist.c (gtk_clist_realize): Always use
a non-zero pixel for GDK_XOR.
* gtk/gtkvpaned.c gtk/gtkhpaned.c:
Use GDK_INVERT instead of GDK_XOR.
Wed May 12 21:56:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (adjust_adjustments): signal emit value_changed
signals if h/voffsets differ from adjustment values.
Reportet by Jerome Bolliet <bolliet@in2p3.fr>
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
the user data on the window before destroying it.
* gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
unrealize handler to take care of destroying
notebook->panel properly.
(Bug #1198 - Morten Welinder <terra@diku.dk>)
* gtk/gtktext.c (expand_scratch_buffer): Fix reversal
of g_new and g_realloc to stop memory leak. (Actually,
we could just use g_realloc(), but I'm not 100% sure
that is portable).
(Bug #1196 - Morten Welinder <terra@diku.dk>)
Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.h: Removed stray GtkPlugButton declaration.
* gdk/gdkfont.c (gdk_text_measure): Fix the return value
for fontsets.
* gtk/gtkbutton.c (gtkbutton_expose): Fix warning
with bin/button confusion.
Thu May 6 04:53:26 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: in the ItemFactory test, link radio items together,
and show how preselection of radio items is done.
Sun May 2 13:31:14 1999 Tim Janik <timj@gtk.org>
* gtk/gtktreeitem.c (gtk_tree_item_set_subtree):
* gtk/gtktree.c (gtk_tree_add) (gtk_tree_insert):
* gtk/gtktoolbar.c (gtk_toolbar_insert_element):
* gtk/gtkpaned.c (gtk_paned_pack2) (gtk_paned_pack1):
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_add):
* gtk/gtktable.c (gtk_table_attach):
* gtk/gtklist.c (gtk_list_insert_items):
* gtk/gtkmenushell.c (gtk_menu_shell_insert):
* gtk/gtknotebook.c (gtk_notebook_insert_page_menu):
* gtk/gtkpacker.c (gtk_packer_add_defaults) (gtk_packer_add):
* gtk/gtkbin.c (gtk_bin_add):
* gtk/gtkbox.c (gtk_box_pack_start) (gtk_box_pack_end):
* gtk/gtkfixed.c (gtk_fixed_put):
* gtk/gtklayout.c (gtk_layout_put):
general fixups to container_add logic. always realize child if
child->parent is realized, only map the child and queue a resize
if child and child->parent are both visible.
Fri Apr 30 09:02:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_unrealize): use gtk_container_forall
instead of gtk_container_foreach to walk and unrealize children, so
composite children get also unrealized.
(gtk_widget_real_show): don't call gtk_widget_map() if we don't need to.
(gtk_widget_map): assert that the widget is visible (basic constrain).
(gtk_widget_real_map): assert that the widget is realized (basic
constrain).
Fri Apr 29 00:53:20 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbindings.c (gtk_pattern_spec_init): plugged a memory leak.
Tue May 4 09:32:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc.iso-8859-2: Add a gtkrc
file for iso-8859-2 locales.
* configure.in (ALL_LINGUAS): ALL_LINGUAS update.
Tue Apr 27 16:38:32 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Fix typo of static_sources for static_SOURCES.
(Pointed out by andy@rz.uni-karlsruhe.de and others).
Remove some suspicious and useless lines.
Tue May 4 08:44:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c (gtk_clist_draw, draw_rows): Use
width,height = 0, 0 to mean - here to edge of window,
instead of -1, -1, since the former is all we support.
Tue May 4 08:34:43 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main): Correctly free list nodes
when removing from quit_functions list.
Tue Apr 27 14:17:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpacker.c (gtk_packer_size_request): remove unused variable.
Tue Apr 27 18:23:35 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable):
When redrawing characters on non-visible entry, use appropriate
'*' character. (Bug #1130 - Jean-Marc Jacquet <jm@littleigloo.org>)
Tue Apr 27 01:31:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (drag_dest_cell): compute destination cell
from drag coordinates.
(gtk_clist_drag_data_received) (gtk_clist_drag_motion):
use drag_dest_cell.
* gtk/gtktree (drag_dest_cell)
(gtk_ctree_drag_data_received) (gtk_ctree_drag_motion): likewise.
(Bug #1129)
Wed Apr 21 21:26:11 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_init): properly initialize
translate_* fields.
(gtk_item_factory_finalize): invoke translate_notify independant from
translate_data.
(gtk_item_factory_set_translate_func): likewise.
(gtk_item_factory_destroy): only remove ifactory pointer from those
widgets that belong to us (stupid me).
Mon Apr 19 12:05:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Fixed leak of
rc_style list when lookup succeeeds.
Thu Apr 15 01:11:24 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (resync_selection):
* gtk/gtkclist.c (resync_selection): fixed undo_selection bug.
* gtk/gtkclist.c (gtk_clist_button_release): fixed resync_selection
bug.
Fri Apr 9 19:22:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c gtk/gtkdnd.c gtk/gtkmenuitem.c:
Add some missing GDK_THREADS_ENTER()/LEAVE around
timeouts. (Patches from Sebastian Wilhelmi <wilhelmi@ira.uka.de>)
Thu Apr 8 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkentry.c (gtk_entry_key_press): use gtk_widget_activate()
rather than emit_by_name.
* gtk/gtkeditable.c (gtk_editable_insert_text): keep a reference
on the widget across multiple signal emissions.
(gtk_editable_delete_text): same here.
(gtk_editable_class_init): set widget_class->activate_signal after
editable_signals[ACTIVATE] has been created.
Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
position here prematurely -- we might not have the
right ->min_position and ->max_position yet.
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
Add error traps so if the other end of the connection
dies, we survive.
* gtk/gtkselection.c (gtk_selection_notify): Clean
up properly when selection property retrieval fails.
* gtk/gtkselection.c (gtk_selection_request): Correctly
reject SelectionRequest notifies where the handler
returns no data.
Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_dest_leave): Only unhighlight
when we've previously highlighted.
* gtk/gtkdnd.c (gtk_drag_dest_handle_event): Don't
emit two "drag_leave" signals for Motif drops.
* gtk/gtkdnd.c (gtk_drag_source_handle_event): Send
back the correct status messages when dropping from
Motif onto a proxy window that is rejecting the
drop.
Sat Mar 27 23:32:13 1999 Tim Janik <timj@gtk.org>
* gtk/gtkarg.[hc]: added functions from GLE, gtk_arg_reset() to free
the value and reset type to GTK_TYPE_INVALID, and gtk_arg_values_equal()
to compare two argument values. added gtk_arg_to_valueloc() to set a
variable from an arg through its location (pointer).
* gtk/gtkobject.[hc]: implemented gtk_object_get() in terms of
gtk_object_arg_get() and gtk_arg_to_valueloc(), floats are collected
as gfloat*, uchars are collected as guchar*, ints are collected as
gint*, etc...
Mon Mar 29 17:45:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccelgroup.c gtk/gtkgtkbindings.c:
Include <string.h> instead of <strings.h>.
* gtk/gtkstyle.c: Fix double include of gtkthemes.h
(actually, a lot more duplicate includes occur if
you trace through the sequence of #include's)
gtk-jbb-990320-0: John Bley, jbb6@acpub.duke.edu
Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com>
Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp>
gtk-a-higuti-990322-[0-3]
* configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS
that was causing -DX_LOCALE not to work.
* gtk/gtkrc.c (gtk_rc_init):
X_LOCALE will never have LC_MESSAGES defined
Thu Mar 25 12:38:31 1999 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_append_default_module_path): get $HOME from
g_get_home_dir() (gtk-pmc-990123-0.patch.gz).
* gtk/gtkwindow.c (gtk_window_key_press_event): feature keypad up/down/
left/right as well (gtk-michael-980726-0.patch.gz).
* gtk/gtklabel.[hc]: bunch of miscellaneous cleanups, such as s/0/NULL/
for pointer values, use gchar instead of char. fixed uline allocation
leaks, changed the allocation pattern so we use G_ALLOC_AND_FREE mem
chunks instead of G_ALLOC_ONLY.
(gtk_label_size_request): always alter requisition as passed and leave
widget->requisition alone.
(gtk_label_set_text): allow NULL strings.
(gtk_label_new): likewise.
Wed Mar 24 09:24:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.[hc]: type/macro fixups.
Mon Mar 22 05:51:34 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbin.c (gtk_bin_draw): only redraw children that are visible
*and* mapped (i.e. drawable).
(gtk_bin_expose): only send exposes to drawable children.
* gtk/gtkbox.c (gtk_box_draw): only redraw children that are drawable.
(gtk_box_expose): only send exposes to drawable children.
* gtk/gtkhscale.c (gtk_hscale_draw):
* gtk/gtkvscale.c (gtk_vscale_draw):
hm, this is an ugly one. we first compute the size of our trough area
here (window relative) and then check intersection with the draw_area
which is parent relative because we're a NO_WINDOW widget, so we need
to offset the trough area by allocation.x and allocation.y before the
check. (this must not be done for the background area though, since
that's already computed parent relative).
Mon Mar 22 00:41:39 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_unrealize): unmap clist if neccessary,
unrealize title buttons.
Fri Mar 19 00:00:22 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_column_title_passive)
(gtk_clist_column_title_active):
only connect/disconnect to GtkWidgetClass::event to block mouse events.
* gtk/gtkclist.c (vertical_timeout) (horizontal_timeout):
zero initialize event, removed superfluous gdk_window_get_pointer call
* gtk/gtklist.c (gtk_list_vertical_timeout)
(gtk_list_horizontal_timeout): removed superfluous
gdk_window_get_pointer call
Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org>
* plugging problems reported by "Bruce Mitchener, Jr."
<bruce@puremagic.com> due to a purify session.
* gtk/gtkstyle.c:
(gtk_style_ref):
(gtk_style_unref): assert ref_count to be > 0.
* gtk/gtkclist.c (gtk_clist_set_cell_style): { 0 } initilaize
the requisition.
(gtk_clist_set_shift): likewise.
* gtk/gtklayout.c: introduce gtk_layout_finalize() to unref the
adjustments.
* gtk/gtklist.c (gtk_list_horizontal_timeout): zero initialize the
event before sending it and set send_event to TRUE (which needs to
be done for *all* synthesized events).
(gtk_list_vertical_timeout): likewise.
* gtk/gtktipsquery.c (gtk_tips_query_destroy): plug small memory
leaks.
* gtk/gtkdrawingarea.c (gtk_drawing_area_send_configure): set send_event
to TRUE when synthesizing events.
[ *** end of merges from 1.2 *** ]
1999-11-22 21:52:50 +00:00
|
|
|
if (clist->clist_window_width - clist->hoffset > LIST_WIDTH (clist) ||
|
|
|
|
(clist->hoffset + (gint)clist->hadjustment->value) != 0)
|
1998-11-07 14:29:22 +00:00
|
|
|
{
|
|
|
|
clist->hadjustment->value = MAX (0, (LIST_WIDTH (clist) -
|
|
|
|
clist->clist_window_width));
|
|
|
|
gtk_signal_emit_by_name (GTK_OBJECT (clist->hadjustment),
|
|
|
|
"value_changed");
|
|
|
|
}
|
|
|
|
gtk_signal_emit_by_name (GTK_OBJECT (clist->hadjustment), "changed");
|
|
|
|
}
|
1998-01-03 03:31:03 +00:00
|
|
|
|
1998-11-07 14:29:22 +00:00
|
|
|
if (!block_resize && (!clist->vadjustment || !clist->hadjustment))
|
1998-01-03 03:31:03 +00:00
|
|
|
{
|
1998-11-07 14:29:22 +00:00
|
|
|
GtkWidget *widget;
|
1999-02-10 02:35:09 +00:00
|
|
|
GtkRequisition requisition;
|
1998-10-19 22:46:38 +00:00
|
|
|
|
1998-11-07 14:29:22 +00:00
|
|
|
widget = GTK_WIDGET (clist);
|
1999-02-10 02:35:09 +00:00
|
|
|
gtk_widget_size_request (widget, &requisition);
|
1998-11-07 14:29:22 +00:00
|
|
|
|
|
|
|
if ((!clist->hadjustment &&
|
1999-02-10 02:35:09 +00:00
|
|
|
requisition.width != widget->allocation.width) ||
|
1998-11-07 14:29:22 +00:00
|
|
|
(!clist->vadjustment &&
|
1999-02-10 02:35:09 +00:00
|
|
|
requisition.height != widget->allocation.height))
|
1998-11-07 14:29:22 +00:00
|
|
|
gtk_widget_queue_resize (widget);
|
|
|
|
}
|
1998-01-31 03:33:02 +00:00
|
|
|
}
|
1998-07-15 23:40:00 +00:00
|
|
|
|
|
|
|
static void
|
1998-10-19 22:46:38 +00:00
|
|
|
vadjustment_changed (GtkAdjustment *adjustment,
|
|
|
|
gpointer data)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
|
|
|
GtkCList *clist;
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_if_fail (adjustment != NULL);
|
|
|
|
g_return_if_fail (data != NULL);
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist = GTK_CLIST (data);
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1998-10-19 22:46:38 +00:00
|
|
|
hadjustment_changed (GtkAdjustment *adjustment,
|
|
|
|
gpointer data)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
|
|
|
GtkCList *clist;
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_if_fail (adjustment != NULL);
|
|
|
|
g_return_if_fail (data != NULL);
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist = GTK_CLIST (data);
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
static void
|
|
|
|
vadjustment_value_changed (GtkAdjustment *adjustment,
|
|
|
|
gpointer data)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-07-16 13:05:02 +00:00
|
|
|
GtkCList *clist;
|
1998-10-19 22:46:38 +00:00
|
|
|
GdkRectangle area;
|
|
|
|
gint diff, value;
|
1998-07-16 13:05:02 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_if_fail (adjustment != NULL);
|
|
|
|
g_return_if_fail (data != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (data));
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist = GTK_CLIST (data);
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-11-05 15:44:22 +00:00
|
|
|
if (!GTK_WIDGET_DRAWABLE (clist) || adjustment != clist->vadjustment)
|
1998-07-15 23:40:00 +00:00
|
|
|
return;
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
value = adjustment->value;
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-11-05 15:44:22 +00:00
|
|
|
if (value > -clist->voffset)
|
1998-10-19 22:46:38 +00:00
|
|
|
{
|
1998-11-05 15:44:22 +00:00
|
|
|
/* scroll down */
|
|
|
|
diff = value + clist->voffset;
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-11-05 15:44:22 +00:00
|
|
|
/* we have to re-draw the whole screen here... */
|
|
|
|
if (diff >= clist->clist_window_height)
|
1998-10-19 22:46:38 +00:00
|
|
|
{
|
1998-11-05 15:44:22 +00:00
|
|
|
clist->voffset = -value;
|
|
|
|
draw_rows (clist, NULL);
|
|
|
|
return;
|
|
|
|
}
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-11-05 15:44:22 +00:00
|
|
|
if ((diff != 0) && (diff != clist->clist_window_height))
|
|
|
|
gdk_window_copy_area (clist->clist_window, clist->fg_gc,
|
|
|
|
0, 0, clist->clist_window, 0, diff,
|
|
|
|
clist->clist_window_width,
|
|
|
|
clist->clist_window_height - diff);
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-11-05 15:44:22 +00:00
|
|
|
area.x = 0;
|
|
|
|
area.y = clist->clist_window_height - diff;
|
|
|
|
area.width = clist->clist_window_width;
|
|
|
|
area.height = diff;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* scroll up */
|
|
|
|
diff = -clist->voffset - value;
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-11-05 15:44:22 +00:00
|
|
|
/* we have to re-draw the whole screen here... */
|
|
|
|
if (diff >= clist->clist_window_height)
|
|
|
|
{
|
|
|
|
clist->voffset = -value;
|
|
|
|
draw_rows (clist, NULL);
|
|
|
|
return;
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
|
|
|
|
if ((diff != 0) && (diff != clist->clist_window_height))
|
1998-11-05 15:44:22 +00:00
|
|
|
gdk_window_copy_area (clist->clist_window, clist->fg_gc,
|
|
|
|
0, diff, clist->clist_window, 0, 0,
|
|
|
|
clist->clist_window_width,
|
|
|
|
clist->clist_window_height - diff);
|
|
|
|
|
|
|
|
area.x = 0;
|
|
|
|
area.y = 0;
|
|
|
|
area.width = clist->clist_window_width;
|
|
|
|
area.height = diff;
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
|
1998-11-05 15:44:22 +00:00
|
|
|
clist->voffset = -value;
|
|
|
|
if ((diff != 0) && (diff != clist->clist_window_height))
|
|
|
|
check_exposures (clist);
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
draw_rows (clist, &area);
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1998-10-19 22:46:38 +00:00
|
|
|
hadjustment_value_changed (GtkAdjustment *adjustment,
|
|
|
|
gpointer data)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GtkCList *clist;
|
|
|
|
GdkRectangle area;
|
|
|
|
gint i;
|
|
|
|
gint y = 0;
|
|
|
|
gint diff = 0;
|
|
|
|
gint value;
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_if_fail (adjustment != NULL);
|
|
|
|
g_return_if_fail (data != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (data));
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist = GTK_CLIST (data);
|
|
|
|
|
1998-11-05 15:44:22 +00:00
|
|
|
if (!GTK_WIDGET_DRAWABLE (clist) || adjustment != clist->hadjustment)
|
1998-07-15 23:40:00 +00:00
|
|
|
return;
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
value = adjustment->value;
|
1998-11-05 15:44:22 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* move the column buttons and resize windows */
|
|
|
|
for (i = 0; i < clist->columns; i++)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
if (clist->column[i].button)
|
|
|
|
{
|
|
|
|
clist->column[i].button->allocation.x -= value + clist->hoffset;
|
|
|
|
|
|
|
|
if (clist->column[i].button->window)
|
|
|
|
{
|
|
|
|
gdk_window_move (clist->column[i].button->window,
|
|
|
|
clist->column[i].button->allocation.x,
|
|
|
|
clist->column[i].button->allocation.y);
|
|
|
|
|
|
|
|
if (clist->column[i].window)
|
|
|
|
gdk_window_move (clist->column[i].window,
|
|
|
|
clist->column[i].button->allocation.x +
|
|
|
|
clist->column[i].button->allocation.width -
|
|
|
|
(DRAG_WIDTH / 2), 0);
|
|
|
|
}
|
|
|
|
}
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (value > -clist->hoffset)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
/* scroll right */
|
|
|
|
diff = value + clist->hoffset;
|
|
|
|
|
|
|
|
clist->hoffset = -value;
|
|
|
|
|
|
|
|
/* we have to re-draw the whole screen here... */
|
|
|
|
if (diff >= clist->clist_window_width)
|
|
|
|
{
|
|
|
|
draw_rows (clist, NULL);
|
|
|
|
return;
|
|
|
|
}
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1999-02-08 21:03:54 +00:00
|
|
|
if (GTK_WIDGET_CAN_FOCUS(clist) && GTK_WIDGET_HAS_FOCUS(clist) &&
|
|
|
|
!GTK_CLIST_CHILD_HAS_FOCUS(clist) && GTK_CLIST_ADD_MODE(clist))
|
1998-10-19 22:46:38 +00:00
|
|
|
{
|
|
|
|
y = ROW_TOP_YPIXEL (clist, clist->focus_row);
|
|
|
|
|
|
|
|
gdk_draw_rectangle (clist->clist_window, clist->xor_gc, FALSE, 0, y,
|
|
|
|
clist->clist_window_width - 1,
|
|
|
|
clist->row_height - 1);
|
|
|
|
}
|
|
|
|
gdk_window_copy_area (clist->clist_window,
|
|
|
|
clist->fg_gc,
|
|
|
|
0, 0,
|
|
|
|
clist->clist_window,
|
|
|
|
diff,
|
|
|
|
0,
|
|
|
|
clist->clist_window_width - diff,
|
|
|
|
clist->clist_window_height);
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
area.x = clist->clist_window_width - diff;
|
|
|
|
}
|
|
|
|
else
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
/* scroll left */
|
|
|
|
if (!(diff = -clist->hoffset - value))
|
1998-07-15 23:40:00 +00:00
|
|
|
return;
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist->hoffset = -value;
|
|
|
|
|
|
|
|
/* we have to re-draw the whole screen here... */
|
|
|
|
if (diff >= clist->clist_window_width)
|
|
|
|
{
|
|
|
|
draw_rows (clist, NULL);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
1999-02-08 21:03:54 +00:00
|
|
|
if (GTK_WIDGET_CAN_FOCUS(clist) && GTK_WIDGET_HAS_FOCUS(clist) &&
|
|
|
|
!GTK_CLIST_CHILD_HAS_FOCUS(clist) && GTK_CLIST_ADD_MODE(clist))
|
1998-10-19 22:46:38 +00:00
|
|
|
{
|
|
|
|
y = ROW_TOP_YPIXEL (clist, clist->focus_row);
|
|
|
|
|
|
|
|
gdk_draw_rectangle (clist->clist_window, clist->xor_gc, FALSE, 0, y,
|
|
|
|
clist->clist_window_width - 1,
|
|
|
|
clist->row_height - 1);
|
|
|
|
}
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
gdk_window_copy_area (clist->clist_window,
|
|
|
|
clist->fg_gc,
|
|
|
|
diff, 0,
|
|
|
|
clist->clist_window,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
clist->clist_window_width - diff,
|
|
|
|
clist->clist_window_height);
|
|
|
|
|
|
|
|
area.x = 0;
|
|
|
|
}
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
area.y = 0;
|
|
|
|
area.width = diff;
|
|
|
|
area.height = clist->clist_window_height;
|
|
|
|
|
|
|
|
check_exposures (clist);
|
|
|
|
|
1999-02-08 21:03:54 +00:00
|
|
|
if (GTK_WIDGET_CAN_FOCUS(clist) && GTK_WIDGET_HAS_FOCUS(clist) &&
|
|
|
|
!GTK_CLIST_CHILD_HAS_FOCUS(clist))
|
1998-10-19 22:46:38 +00:00
|
|
|
{
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (GTK_CLIST_ADD_MODE(clist))
|
1998-07-17 16:05:42 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
gint focus_row;
|
|
|
|
|
|
|
|
focus_row = clist->focus_row;
|
|
|
|
clist->focus_row = -1;
|
|
|
|
draw_rows (clist, &area);
|
|
|
|
clist->focus_row = focus_row;
|
|
|
|
|
|
|
|
gdk_draw_rectangle (clist->clist_window, clist->xor_gc,
|
|
|
|
FALSE, 0, y, clist->clist_window_width - 1,
|
|
|
|
clist->row_height - 1);
|
|
|
|
return;
|
1998-07-17 16:05:42 +00:00
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
else
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
gint x0;
|
|
|
|
gint x1;
|
|
|
|
|
|
|
|
if (area.x == 0)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
x0 = clist->clist_window_width - 1;
|
|
|
|
x1 = diff;
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
else
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
x0 = 0;
|
|
|
|
x1 = area.x - 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
y = ROW_TOP_YPIXEL (clist, clist->focus_row);
|
|
|
|
gdk_draw_line (clist->clist_window, clist->xor_gc,
|
|
|
|
x0, y + 1, x0, y + clist->row_height - 2);
|
|
|
|
gdk_draw_line (clist->clist_window, clist->xor_gc,
|
|
|
|
x1, y + 1, x1, y + clist->row_height - 2);
|
|
|
|
|
|
|
|
}
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
draw_rows (clist, &area);
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1998-10-19 22:46:38 +00:00
|
|
|
check_exposures (GtkCList *clist)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GdkEvent *event;
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (!GTK_WIDGET_REALIZED (clist))
|
|
|
|
return;
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* Make sure graphics expose events are processed before scrolling
|
|
|
|
* again */
|
|
|
|
while ((event = gdk_event_get_graphics_expose (clist->clist_window)) != NULL)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_widget_event (GTK_WIDGET (clist), event);
|
|
|
|
if (event->expose.count == 0)
|
|
|
|
{
|
|
|
|
gdk_event_free (event);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
gdk_event_free (event);
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
/* PRIVATE
|
1998-10-19 22:46:38 +00:00
|
|
|
* Memory Allocation/Distruction Routines for GtkCList stuctures
|
|
|
|
*
|
|
|
|
* functions:
|
|
|
|
* columns_new
|
|
|
|
* column_title_new
|
|
|
|
* columns_delete
|
|
|
|
* row_new
|
|
|
|
* row_delete
|
|
|
|
*/
|
|
|
|
static GtkCListColumn *
|
|
|
|
columns_new (GtkCList *clist)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GtkCListColumn *column;
|
1998-07-15 23:40:00 +00:00
|
|
|
gint i;
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
column = g_new (GtkCListColumn, clist->columns);
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
for (i = 0; i < clist->columns; i++)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
column[i].area.x = 0;
|
|
|
|
column[i].area.y = 0;
|
|
|
|
column[i].area.width = 0;
|
|
|
|
column[i].area.height = 0;
|
|
|
|
column[i].title = NULL;
|
|
|
|
column[i].button = NULL;
|
|
|
|
column[i].window = NULL;
|
|
|
|
column[i].width = 0;
|
|
|
|
column[i].min_width = -1;
|
|
|
|
column[i].max_width = -1;
|
|
|
|
column[i].visible = TRUE;
|
|
|
|
column[i].width_set = FALSE;
|
|
|
|
column[i].resizeable = TRUE;
|
|
|
|
column[i].auto_resize = FALSE;
|
Tue Mar 16 17:43:33 1999 Tim Janik <timj@gtk.org>
Wed Mar 17 01:46:28 1999 Tim Janik <timj@gtk.org>
* merges from gtk-1-2:
Tue Mar 16 17:43:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_string): ensure the
item factory class has been created.
(gtk_item_factory_parse_rc): likewise.
* gtk/gtkmenu.c:
keep proper references for old_active_menu_item.
(gtk_menu_reparent): unset the usize of the new parent,
so the menu can sanely be size requested and we don't get nasty screen
artefacts upon next reparentation.
(gtk_menu_motion_notify): set send_event to TRUE if we synthesize an
enter notify. only synthesize enter notifies if the pointer really is
inside the event window.
(gtk_menu_popdown): use gtk_menu_shell_deselect().
(gtk_menu_popup): move the background setting stuff into
gtk_menu_tearoff_bg_copy() so it can be called from other places as well.
* gtk/gtkmenushell.c (gtk_menu_shell_button_press): use
gtk_menu_shell_select_item() to select the new item.
(gtk_menu_shell_deselect): export this function, so gtkmenu.c can
do the right thing for deselection as well.
Sat Mar 15 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.[hc]:
(gtk_widget_accelerators_locked): return whether a widget's accelerators
are locked.
* gtk/gtkmenu.c (gtk_menu_key_press): don't remove or install new or
existing accelerators if the widget's accelerators are locked.
Sat Mar 14 19:44:05 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.[hc]: allow managing of foreign menu items.
* gtk/gtkmenu.c: truely forward key press and key release events to
the menu widget from the toplevel or tearoff window. we can't simply
connect to that, we need to stop further processing of the events as
well.
Sat Mar 13 13:14:17 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.c:
(gtk_menu_key_press): pass event->keyval, event->state to
gtk_accelerator_valid, instead of event->keyval twice.
refuse to install single letter accelerators for menus that use
single letter shortcuts.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): use
gtk_menu_ensure_uline_accel_group().
* gtk/gtkmenu.[hc]: added gtk_menu_ensure_uline_accel_group()
which will always return an uline accel group, made
gtk_menu_get_uline_accel_group() return NULL if the group isn't
yet created.
Mon Mar 15 01:03:27 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h (struct _GtkCListColumn): added button_passive flag.
* gtk/gtkclist.c (gtk_clist_column_title_passive):
Leave button sensitive, trap button_press, button_release,
motion_notify, enter_notify and leave_notify events instead.
(gtk_clist_column_title_active): disconnect event handler.
(gtk_clist_drag_data_get): fixed memory leak. Reported by
Guillaume Laurent <glaurent@worldnet.fr>
Wed Mar 10 23:49:55 1999 Lars Hamann <lars@gtk.org>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): fixed a few
width/height mixups.
* gtk/gtkctree.c (tree_delete): emit an tree_unselect_row signal
if needed.
Wed Mar 10 00:11:32 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c (create_item_factory): unref the item factory after
window's destruction.
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): keep a reference
count on the menu shell around the menu item's activation, since the
signal emission may cause menu shell destruction.
* gtk/gtkitemfactory.c:
the previous code leaked one accel group per menu. we use
gtk_menu_get_uline_accel_group() now to fix that, and with that
also create the underline accelerator group of the menus only if
required (i.e. an underline accelerator has been specified).
(gtk_item_factory_construct):
(gtk_item_factory_create_item): removed code that would create an
extra accel group for the menu (and leak references).
(gtk_item_factory_create_item): adapted the underline accelerator
installation code to properly feature gtk_menu_get_uline_accel_group().
* gtk/gtkmenu.[hc]: added gtk_menu_get_accel_group() to retrive
menu->accel_group, this may return NULL if the accelerator group
hasn't been set yet.
added gtk_menu_get_uline_accel_group() to retrive the underline
accelerator group of the menu, this will be created on demand
and proper care is taken about its reference count.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c:
dumped the approach of keeping a widgets by action list on the
factory since the factory<->widget destroy negotiation didn't work
and would be hard to get going at all. instead we keep a list of
GtkItemFactoryItem items on the factory (GtkItemFactoryItems are
persistant throughout a program's life time).
also, i removed the static const gchar *key_* variables, and made
them inline strings (they weren't actually used anyways).
(gtk_item_factory_add_item): update ifactory->items.
(gtk_item_factory_destroy): destroy ifactory->items (and remove
the item factory pointer from the remaining ifactory widgets).
(gtk_item_factory_get_widget_by_action): walk the GtkItemFactoryItem
list to find the widget.
(gtk_item_factory_get_item): new function that works around
gtk_item_factory_get_widget() limitations, this function will only
return menu items, even for <Branch> entries.
Tue Mar 9 01:01:28 1999 Tim Janik <timj@gtk.org>
* gdk/gdkfont.c (gdk_font_load): first lookup the xfont ID in our
font hash table, if we have a GdkFontPrivate entry for this font
already, simply increment its reference count, provided by Olaf Dietsche
<olaf.dietsche+list.gtk@netcologne.de>.
* gtk/gtkstyle.c (gtk_style_copy): plug a GdkFont reference leak, fix
provided by Olaf Dietsche <olaf.dietsche+list.gtk@netcologne.de>.
Sun Mar 7 06:13:29 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c:
(gtk_container_add_with_args):
(gtk_container_addv):
(gtk_container_add): before adding a child to a conatiner, make sure
it is (default) constructed, this is neccessary because under certain
circumstances the child will get relized and mapped immediatedly, in
which case it has to be constructed already.
Mon Mar 1 17:58:21 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_connect_by_type): count object_signal
values > 1 as TRUE also.
1999-03-17 01:39:42 +00:00
|
|
|
column[i].button_passive = FALSE;
|
1998-10-19 22:46:38 +00:00
|
|
|
column[i].justification = GTK_JUSTIFY_LEFT;
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
return column;
|
|
|
|
}
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
static void
|
|
|
|
column_title_new (GtkCList *clist,
|
|
|
|
gint column,
|
|
|
|
const gchar *title)
|
|
|
|
{
|
|
|
|
if (clist->column[column].title)
|
|
|
|
g_free (clist->column[column].title);
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist->column[column].title = g_strdup (title);
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1998-10-19 22:46:38 +00:00
|
|
|
columns_delete (GtkCList *clist)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
for (i = 0; i < clist->columns; i++)
|
|
|
|
if (clist->column[i].title)
|
|
|
|
g_free (clist->column[i].title);
|
|
|
|
|
|
|
|
g_free (clist->column);
|
|
|
|
}
|
1998-07-16 13:05:02 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
static GtkCListRow *
|
|
|
|
row_new (GtkCList *clist)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
GtkCListRow *clist_row;
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist_row = g_chunk_new (GtkCListRow, clist->row_mem_chunk);
|
|
|
|
clist_row->cell = g_chunk_new (GtkCell, clist->cell_mem_chunk);
|
|
|
|
|
|
|
|
for (i = 0; i < clist->columns; i++)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
clist_row->cell[i].type = GTK_CELL_EMPTY;
|
|
|
|
clist_row->cell[i].vertical = 0;
|
|
|
|
clist_row->cell[i].horizontal = 0;
|
|
|
|
clist_row->cell[i].style = NULL;
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
|
|
|
|
clist_row->fg_set = FALSE;
|
|
|
|
clist_row->bg_set = FALSE;
|
|
|
|
clist_row->style = NULL;
|
|
|
|
clist_row->selectable = TRUE;
|
|
|
|
clist_row->state = GTK_STATE_NORMAL;
|
|
|
|
clist_row->data = NULL;
|
|
|
|
clist_row->destroy = NULL;
|
|
|
|
|
|
|
|
return clist_row;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
row_delete (GtkCList *clist,
|
|
|
|
GtkCListRow *clist_row)
|
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
for (i = 0; i < clist->columns; i++)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GTK_CLIST_CLASS_FW (clist)->set_cell_contents
|
|
|
|
(clist, clist_row, i, GTK_CELL_EMPTY, NULL, 0, NULL, NULL);
|
|
|
|
if (clist_row->cell[i].style)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
if (GTK_WIDGET_REALIZED (clist))
|
|
|
|
gtk_style_detach (clist_row->cell[i].style);
|
|
|
|
gtk_style_unref (clist_row->cell[i].style);
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
|
|
|
|
if (clist_row->style)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
if (GTK_WIDGET_REALIZED (clist))
|
|
|
|
gtk_style_detach (clist_row->style);
|
|
|
|
gtk_style_unref (clist_row->style);
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (clist_row->destroy)
|
|
|
|
clist_row->destroy (clist_row->data);
|
|
|
|
|
|
|
|
g_mem_chunk_free (clist->cell_mem_chunk, clist_row->cell);
|
|
|
|
g_mem_chunk_free (clist->row_mem_chunk, clist_row);
|
|
|
|
}
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* FOCUS FUNCTIONS
|
|
|
|
* gtk_clist_focus
|
|
|
|
* gtk_clist_draw_focus
|
|
|
|
* gtk_clist_focus_in
|
|
|
|
* gtk_clist_focus_out
|
|
|
|
* gtk_clist_set_focus_child
|
|
|
|
* title_focus
|
|
|
|
*/
|
|
|
|
static gint
|
|
|
|
gtk_clist_focus (GtkContainer *container,
|
|
|
|
GtkDirectionType direction)
|
|
|
|
{
|
|
|
|
GtkCList *clist;
|
|
|
|
GtkWidget *focus_child;
|
|
|
|
gint old_row;
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_val_if_fail (container != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_CLIST (container), FALSE);
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1999-01-11 12:22:52 +00:00
|
|
|
if (!GTK_WIDGET_IS_SENSITIVE (container))
|
1998-10-19 22:46:38 +00:00
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
clist = GTK_CLIST (container);
|
|
|
|
focus_child = container->focus_child;
|
|
|
|
old_row = clist->focus_row;
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
switch (direction)
|
|
|
|
{
|
|
|
|
case GTK_DIR_LEFT:
|
|
|
|
case GTK_DIR_RIGHT:
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (GTK_CLIST_CHILD_HAS_FOCUS(clist))
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
if (title_focus (clist, direction))
|
|
|
|
return TRUE;
|
|
|
|
gtk_container_set_focus_child (container, NULL);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
gtk_widget_grab_focus (GTK_WIDGET (container));
|
|
|
|
return TRUE;
|
|
|
|
case GTK_DIR_DOWN:
|
|
|
|
case GTK_DIR_TAB_FORWARD:
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (GTK_CLIST_CHILD_HAS_FOCUS(clist))
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
gboolean tf = FALSE;
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (((focus_child && direction == GTK_DIR_DOWN) ||
|
|
|
|
!(tf = title_focus (clist, GTK_DIR_TAB_FORWARD)))
|
|
|
|
&& clist->rows)
|
|
|
|
{
|
|
|
|
if (clist->focus_row < 0)
|
|
|
|
{
|
|
|
|
clist->focus_row = 0;
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if ((clist->selection_mode == GTK_SELECTION_BROWSE ||
|
|
|
|
clist->selection_mode == GTK_SELECTION_EXTENDED) &&
|
|
|
|
!clist->selection)
|
|
|
|
gtk_signal_emit (GTK_OBJECT (clist),
|
|
|
|
clist_signals[SELECT_ROW],
|
|
|
|
clist->focus_row, -1, NULL);
|
|
|
|
}
|
|
|
|
gtk_widget_grab_focus (GTK_WIDGET (container));
|
|
|
|
return TRUE;
|
|
|
|
}
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (tf)
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
GTK_CLIST_SET_FLAG (clist, CLIST_CHILD_HAS_FOCUS);
|
|
|
|
break;
|
|
|
|
case GTK_DIR_UP:
|
|
|
|
case GTK_DIR_TAB_BACKWARD:
|
1998-11-05 15:44:22 +00:00
|
|
|
if (!focus_child &&
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
GTK_CLIST_CHILD_HAS_FOCUS(clist) && clist->rows)
|
1998-10-19 22:46:38 +00:00
|
|
|
{
|
|
|
|
if (clist->focus_row < 0)
|
|
|
|
{
|
|
|
|
clist->focus_row = 0;
|
|
|
|
if ((clist->selection_mode == GTK_SELECTION_BROWSE ||
|
|
|
|
clist->selection_mode == GTK_SELECTION_EXTENDED) &&
|
|
|
|
!clist->selection)
|
|
|
|
gtk_signal_emit (GTK_OBJECT (clist),
|
|
|
|
clist_signals[SELECT_ROW],
|
|
|
|
clist->focus_row, -1, NULL);
|
|
|
|
}
|
|
|
|
gtk_widget_grab_focus (GTK_WIDGET (container));
|
|
|
|
return TRUE;
|
|
|
|
}
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
GTK_CLIST_SET_FLAG (clist, CLIST_CHILD_HAS_FOCUS);
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (title_focus (clist, direction))
|
|
|
|
return TRUE;
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_container_set_focus_child (container, NULL);
|
|
|
|
return FALSE;
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_clist_draw_focus (GtkWidget *widget)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GtkCList *clist;
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_if_fail (widget != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (widget));
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1999-02-08 21:03:54 +00:00
|
|
|
if (!GTK_WIDGET_DRAWABLE (widget) || !GTK_WIDGET_CAN_FOCUS (widget))
|
1998-07-15 23:40:00 +00:00
|
|
|
return;
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist = GTK_CLIST (widget);
|
|
|
|
if (clist->focus_row >= 0)
|
|
|
|
gdk_draw_rectangle (clist->clist_window, clist->xor_gc, FALSE,
|
|
|
|
0, ROW_TOP_YPIXEL(clist, clist->focus_row),
|
|
|
|
clist->clist_window_width - 1,
|
|
|
|
clist->row_height - 1);
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
static gint
|
|
|
|
gtk_clist_focus_in (GtkWidget *widget,
|
|
|
|
GdkEventFocus *event)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GtkCList *clist;
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_val_if_fail (widget != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_CLIST (widget), FALSE);
|
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS);
|
|
|
|
GTK_CLIST_UNSET_FLAG (widget, CLIST_CHILD_HAS_FOCUS);
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist = GTK_CLIST (widget);
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (clist->selection_mode == GTK_SELECTION_BROWSE &&
|
|
|
|
clist->selection == NULL && clist->focus_row > -1)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GList *list;
|
|
|
|
|
|
|
|
list = g_list_nth (clist->row_list, clist->focus_row);
|
|
|
|
if (list && GTK_CLIST_ROW (list)->selectable)
|
|
|
|
gtk_signal_emit (GTK_OBJECT (clist), clist_signals[SELECT_ROW],
|
|
|
|
clist->focus_row, -1, event);
|
|
|
|
else
|
|
|
|
gtk_widget_draw_focus (widget);
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
else
|
|
|
|
gtk_widget_draw_focus (widget);
|
|
|
|
|
|
|
|
return FALSE;
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_clist_focus_out (GtkWidget *widget,
|
|
|
|
GdkEventFocus *event)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GtkCList *clist;
|
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
g_return_val_if_fail (widget != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_CLIST (widget), FALSE);
|
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS);
|
1998-12-03 06:52:48 +00:00
|
|
|
GTK_CLIST_SET_FLAG (widget, CLIST_CHILD_HAS_FOCUS);
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_widget_draw_focus (widget);
|
|
|
|
|
|
|
|
clist = GTK_CLIST (widget);
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (clist->anchor != -1 && clist->selection_mode == GTK_SELECTION_EXTENDED)
|
|
|
|
GTK_CLIST_CLASS_FW (widget)->resync_selection (clist, (GdkEvent *) event);
|
1998-07-15 23:40:00 +00:00
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
static void
|
|
|
|
gtk_clist_set_focus_child (GtkContainer *container,
|
|
|
|
GtkWidget *child)
|
|
|
|
{
|
|
|
|
g_return_if_fail (container != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (container));
|
|
|
|
|
|
|
|
if (child)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_WIDGET (child));
|
1998-12-03 06:52:48 +00:00
|
|
|
GTK_CLIST_SET_FLAG (container, CLIST_CHILD_HAS_FOCUS);
|
1998-10-19 22:46:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
parent_class->set_focus_child (container, child);
|
|
|
|
}
|
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
static gboolean
|
1998-10-19 22:46:38 +00:00
|
|
|
title_focus (GtkCList *clist,
|
|
|
|
gint dir)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
|
|
|
GtkWidget *focus_child;
|
|
|
|
gboolean return_val = FALSE;
|
1999-02-06 00:21:56 +00:00
|
|
|
gint last_column;
|
1998-07-15 23:40:00 +00:00
|
|
|
gint d = 1;
|
|
|
|
gint i = 0;
|
|
|
|
gint j;
|
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (!GTK_CLIST_SHOW_TITLES(clist))
|
1998-07-15 23:40:00 +00:00
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
focus_child = GTK_CONTAINER (clist)->focus_child;
|
1999-02-06 00:21:56 +00:00
|
|
|
|
|
|
|
for (last_column = clist->columns - 1;
|
|
|
|
last_column >= 0 && !clist->column[last_column].visible; last_column--)
|
|
|
|
;
|
1998-07-15 23:40:00 +00:00
|
|
|
|
|
|
|
switch (dir)
|
|
|
|
{
|
|
|
|
case GTK_DIR_TAB_BACKWARD:
|
|
|
|
case GTK_DIR_UP:
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (!focus_child || !GTK_CLIST_CHILD_HAS_FOCUS(clist))
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
|
|
|
if (dir == GTK_DIR_UP)
|
|
|
|
i = COLUMN_FROM_XPIXEL (clist, 0);
|
|
|
|
else
|
1999-02-06 00:21:56 +00:00
|
|
|
i = last_column;
|
1998-07-15 23:40:00 +00:00
|
|
|
focus_child = clist->column[i].button;
|
|
|
|
dir = GTK_DIR_TAB_FORWARD;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
d = -1;
|
|
|
|
break;
|
|
|
|
case GTK_DIR_LEFT:
|
|
|
|
d = -1;
|
1998-11-05 15:44:22 +00:00
|
|
|
if (!focus_child)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1999-02-06 00:21:56 +00:00
|
|
|
i = last_column;
|
1998-07-15 23:40:00 +00:00
|
|
|
focus_child = clist->column[i].button;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case GTK_DIR_RIGHT:
|
1998-11-05 15:44:22 +00:00
|
|
|
if (!focus_child)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
|
|
|
i = 0;
|
|
|
|
focus_child = clist->column[i].button;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (focus_child)
|
|
|
|
while (i < clist->columns)
|
|
|
|
{
|
|
|
|
if (clist->column[i].button == focus_child)
|
|
|
|
{
|
|
|
|
if (clist->column[i].button &&
|
|
|
|
GTK_WIDGET_VISIBLE (clist->column[i].button) &&
|
|
|
|
GTK_IS_CONTAINER (clist->column[i].button) &&
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
!GTK_WIDGET_HAS_FOCUS(clist->column[i].button))
|
1998-07-15 23:40:00 +00:00
|
|
|
if (gtk_container_focus
|
|
|
|
(GTK_CONTAINER (clist->column[i].button), dir))
|
|
|
|
{
|
|
|
|
return_val = TRUE;
|
|
|
|
i -= d;
|
|
|
|
}
|
|
|
|
if (!return_val && dir == GTK_DIR_UP)
|
|
|
|
return FALSE;
|
|
|
|
i += d;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
|
|
|
|
j = i;
|
|
|
|
|
|
|
|
if (!return_val)
|
|
|
|
while (j >= 0 && j < clist->columns)
|
|
|
|
{
|
|
|
|
if (clist->column[j].button &&
|
|
|
|
GTK_WIDGET_VISIBLE (clist->column[j].button))
|
|
|
|
{
|
|
|
|
if (GTK_IS_CONTAINER (clist->column[j].button) &&
|
|
|
|
gtk_container_focus
|
|
|
|
(GTK_CONTAINER (clist->column[j].button), dir))
|
|
|
|
{
|
|
|
|
return_val = TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
else if (GTK_WIDGET_CAN_FOCUS (clist->column[j].button))
|
|
|
|
{
|
|
|
|
gtk_widget_grab_focus (clist->column[j].button);
|
|
|
|
return_val = TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
j += d;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (return_val)
|
|
|
|
{
|
|
|
|
if (COLUMN_LEFT_XPIXEL (clist, j) < CELL_SPACING + COLUMN_INSET)
|
|
|
|
gtk_clist_moveto (clist, -1, j, 0, 0);
|
|
|
|
else if (COLUMN_LEFT_XPIXEL(clist, j) + clist->column[j].area.width >
|
|
|
|
clist->clist_window_width)
|
|
|
|
{
|
1999-02-06 00:21:56 +00:00
|
|
|
if (j == last_column)
|
1998-07-15 23:40:00 +00:00
|
|
|
gtk_clist_moveto (clist, -1, j, 0, 0);
|
|
|
|
else
|
|
|
|
gtk_clist_moveto (clist, -1, j, 0, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return return_val;
|
|
|
|
}
|
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
/* PRIVATE SCROLLING FUNCTIONS
|
1998-10-19 22:46:38 +00:00
|
|
|
* move_focus_row
|
|
|
|
* scroll_horizontal
|
|
|
|
* scroll_vertical
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
* move_horizontal
|
|
|
|
* move_vertical
|
|
|
|
* horizontal_timeout
|
|
|
|
* vertical_timeout
|
|
|
|
* remove_grab
|
1998-10-19 22:46:38 +00:00
|
|
|
*/
|
|
|
|
static void
|
|
|
|
move_focus_row (GtkCList *clist,
|
|
|
|
GtkScrollType scroll_type,
|
|
|
|
gfloat position)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GtkWidget *widget;
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_if_fail (clist != 0);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
widget = GTK_WIDGET (clist);
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
switch (scroll_type)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
case GTK_SCROLL_STEP_BACKWARD:
|
|
|
|
if (clist->focus_row <= 0)
|
|
|
|
return;
|
|
|
|
gtk_clist_draw_focus (widget);
|
|
|
|
clist->focus_row--;
|
|
|
|
gtk_clist_draw_focus (widget);
|
1998-07-15 23:40:00 +00:00
|
|
|
break;
|
1998-10-19 22:46:38 +00:00
|
|
|
case GTK_SCROLL_STEP_FORWARD:
|
|
|
|
if (clist->focus_row >= clist->rows - 1)
|
|
|
|
return;
|
|
|
|
gtk_clist_draw_focus (widget);
|
|
|
|
clist->focus_row++;
|
|
|
|
gtk_clist_draw_focus (widget);
|
|
|
|
break;
|
|
|
|
case GTK_SCROLL_PAGE_BACKWARD:
|
|
|
|
if (clist->focus_row <= 0)
|
|
|
|
return;
|
|
|
|
gtk_clist_draw_focus (widget);
|
|
|
|
clist->focus_row = MAX (0, clist->focus_row -
|
|
|
|
(2 * clist->clist_window_height -
|
|
|
|
clist->row_height - CELL_SPACING) /
|
|
|
|
(2 * (clist->row_height + CELL_SPACING)));
|
|
|
|
gtk_clist_draw_focus (widget);
|
|
|
|
break;
|
|
|
|
case GTK_SCROLL_PAGE_FORWARD:
|
|
|
|
if (clist->focus_row >= clist->rows - 1)
|
|
|
|
return;
|
|
|
|
gtk_clist_draw_focus (widget);
|
|
|
|
clist->focus_row = MIN (clist->rows - 1, clist->focus_row +
|
|
|
|
(2 * clist->clist_window_height -
|
|
|
|
clist->row_height - CELL_SPACING) /
|
|
|
|
(2 * (clist->row_height + CELL_SPACING)));
|
|
|
|
gtk_clist_draw_focus (widget);
|
|
|
|
break;
|
|
|
|
case GTK_SCROLL_JUMP:
|
|
|
|
if (position >= 0 && position <= 1)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_clist_draw_focus (widget);
|
|
|
|
clist->focus_row = position * (clist->rows - 1);
|
|
|
|
gtk_clist_draw_focus (widget);
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
static void
|
|
|
|
scroll_horizontal (GtkCList *clist,
|
|
|
|
GtkScrollType scroll_type,
|
|
|
|
gfloat position)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
gint column = 0;
|
1999-02-06 00:21:56 +00:00
|
|
|
gint last_column;
|
1998-10-19 22:46:38 +00:00
|
|
|
|
|
|
|
g_return_if_fail (clist != 0);
|
1998-09-26 06:31:30 +00:00
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (gdk_pointer_is_grabbed () && GTK_WIDGET_HAS_GRAB (clist))
|
|
|
|
return;
|
|
|
|
|
1999-02-06 00:21:56 +00:00
|
|
|
for (last_column = clist->columns - 1;
|
|
|
|
last_column >= 0 && !clist->column[last_column].visible; last_column--)
|
|
|
|
;
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
switch (scroll_type)
|
|
|
|
{
|
|
|
|
case GTK_SCROLL_STEP_BACKWARD:
|
|
|
|
column = COLUMN_FROM_XPIXEL (clist, 0);
|
|
|
|
if (COLUMN_LEFT_XPIXEL (clist, column) - CELL_SPACING - COLUMN_INSET >= 0
|
|
|
|
&& column > 0)
|
|
|
|
column--;
|
|
|
|
break;
|
|
|
|
case GTK_SCROLL_STEP_FORWARD:
|
1999-02-06 00:21:56 +00:00
|
|
|
column = COLUMN_FROM_XPIXEL (clist, clist->clist_window_width);
|
1998-10-19 22:46:38 +00:00
|
|
|
if (column < 0)
|
|
|
|
return;
|
1998-11-05 15:44:22 +00:00
|
|
|
if (COLUMN_LEFT_XPIXEL (clist, column) +
|
|
|
|
clist->column[column].area.width +
|
|
|
|
CELL_SPACING + COLUMN_INSET - 1 <= clist->clist_window_width &&
|
1999-02-06 00:21:56 +00:00
|
|
|
column < last_column)
|
1998-10-19 22:46:38 +00:00
|
|
|
column++;
|
|
|
|
break;
|
|
|
|
case GTK_SCROLL_PAGE_BACKWARD:
|
|
|
|
case GTK_SCROLL_PAGE_FORWARD:
|
|
|
|
return;
|
|
|
|
case GTK_SCROLL_JUMP:
|
|
|
|
if (position >= 0 && position <= 1)
|
1999-02-06 00:21:56 +00:00
|
|
|
{
|
|
|
|
gint vis_columns = 0;
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
for (i = 0; i <= last_column; i++)
|
|
|
|
if (clist->column[i].visible)
|
|
|
|
vis_columns++;
|
|
|
|
|
|
|
|
column = position * vis_columns;
|
|
|
|
|
|
|
|
for (i = 0; i <= last_column && column > 0; i++)
|
|
|
|
if (clist->column[i].visible)
|
|
|
|
column--;
|
|
|
|
|
|
|
|
column = i;
|
|
|
|
}
|
1998-10-19 22:46:38 +00:00
|
|
|
else
|
|
|
|
return;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (COLUMN_LEFT_XPIXEL (clist, column) < CELL_SPACING + COLUMN_INSET)
|
|
|
|
gtk_clist_moveto (clist, -1, column, 0, 0);
|
|
|
|
else if (COLUMN_LEFT_XPIXEL (clist, column) + CELL_SPACING + COLUMN_INSET - 1
|
|
|
|
+ clist->column[column].area.width > clist->clist_window_width)
|
|
|
|
{
|
1999-02-06 00:21:56 +00:00
|
|
|
if (column == last_column)
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_clist_moveto (clist, -1, column, 0, 0);
|
|
|
|
else
|
|
|
|
gtk_clist_moveto (clist, -1, column, 0, 1);
|
|
|
|
}
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1998-10-19 22:46:38 +00:00
|
|
|
scroll_vertical (GtkCList *clist,
|
|
|
|
GtkScrollType scroll_type,
|
|
|
|
gfloat position)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
gint old_focus_row;
|
|
|
|
|
1998-07-15 23:40:00 +00:00
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
|
|
|
|
1998-07-26 13:12:07 +00:00
|
|
|
if (gdk_pointer_is_grabbed () && GTK_WIDGET_HAS_GRAB (clist))
|
1998-07-15 23:40:00 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
switch (clist->selection_mode)
|
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
case GTK_SELECTION_EXTENDED:
|
|
|
|
if (clist->anchor >= 0)
|
|
|
|
return;
|
1998-07-15 23:40:00 +00:00
|
|
|
case GTK_SELECTION_BROWSE:
|
1998-10-19 22:46:38 +00:00
|
|
|
|
|
|
|
old_focus_row = clist->focus_row;
|
|
|
|
move_focus_row (clist, scroll_type, position);
|
|
|
|
|
|
|
|
if (old_focus_row != clist->focus_row)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
if (clist->selection_mode == GTK_SELECTION_BROWSE)
|
|
|
|
gtk_signal_emit (GTK_OBJECT (clist), clist_signals[UNSELECT_ROW],
|
|
|
|
old_focus_row, -1, NULL);
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
else if (!GTK_CLIST_ADD_MODE(clist))
|
1998-10-19 22:46:38 +00:00
|
|
|
{
|
|
|
|
gtk_clist_unselect_all (clist);
|
|
|
|
clist->undo_anchor = old_focus_row;
|
|
|
|
}
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
switch (gtk_clist_row_is_visible (clist, clist->focus_row))
|
|
|
|
{
|
|
|
|
case GTK_VISIBILITY_NONE:
|
|
|
|
if (old_focus_row != clist->focus_row &&
|
|
|
|
!(clist->selection_mode == GTK_SELECTION_EXTENDED &&
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
GTK_CLIST_ADD_MODE(clist)))
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_signal_emit (GTK_OBJECT (clist), clist_signals[SELECT_ROW],
|
|
|
|
clist->focus_row, -1, NULL);
|
|
|
|
switch (scroll_type)
|
|
|
|
{
|
|
|
|
case GTK_SCROLL_STEP_BACKWARD:
|
|
|
|
case GTK_SCROLL_PAGE_BACKWARD:
|
|
|
|
gtk_clist_moveto (clist, clist->focus_row, -1, 0, 0);
|
|
|
|
break;
|
|
|
|
case GTK_SCROLL_STEP_FORWARD:
|
|
|
|
case GTK_SCROLL_PAGE_FORWARD:
|
|
|
|
gtk_clist_moveto (clist, clist->focus_row, -1, 1, 0);
|
|
|
|
break;
|
|
|
|
case GTK_SCROLL_JUMP:
|
|
|
|
gtk_clist_moveto (clist, clist->focus_row, -1, 0.5, 0);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case GTK_VISIBILITY_PARTIAL:
|
|
|
|
switch (scroll_type)
|
|
|
|
{
|
|
|
|
case GTK_SCROLL_STEP_BACKWARD:
|
|
|
|
case GTK_SCROLL_PAGE_BACKWARD:
|
|
|
|
gtk_clist_moveto (clist, clist->focus_row, -1, 0, 0);
|
|
|
|
break;
|
|
|
|
case GTK_SCROLL_STEP_FORWARD:
|
|
|
|
case GTK_SCROLL_PAGE_FORWARD:
|
|
|
|
gtk_clist_moveto (clist, clist->focus_row, -1, 1, 0);
|
|
|
|
break;
|
|
|
|
case GTK_SCROLL_JUMP:
|
|
|
|
gtk_clist_moveto (clist, clist->focus_row, -1, 0.5, 0);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
if (old_focus_row != clist->focus_row &&
|
|
|
|
!(clist->selection_mode == GTK_SELECTION_EXTENDED &&
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
GTK_CLIST_ADD_MODE(clist)))
|
1998-10-19 22:46:38 +00:00
|
|
|
gtk_signal_emit (GTK_OBJECT (clist), clist_signals[SELECT_ROW],
|
|
|
|
clist->focus_row, -1, NULL);
|
|
|
|
break;
|
|
|
|
}
|
1998-07-15 23:40:00 +00:00
|
|
|
break;
|
|
|
|
default:
|
1998-10-19 22:46:38 +00:00
|
|
|
move_focus_row (clist, scroll_type, position);
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (ROW_TOP_YPIXEL (clist, clist->focus_row) + clist->row_height >
|
|
|
|
clist->clist_window_height)
|
|
|
|
gtk_clist_moveto (clist, clist->focus_row, -1, 1, 0);
|
|
|
|
else if (ROW_TOP_YPIXEL (clist, clist->focus_row) < 0)
|
|
|
|
gtk_clist_moveto (clist, clist->focus_row, -1, 0, 0);
|
|
|
|
break;
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
static void
|
|
|
|
move_horizontal (GtkCList *clist,
|
|
|
|
gint diff)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
gfloat value;
|
1998-09-26 06:31:30 +00:00
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (!clist->hadjustment)
|
|
|
|
return;
|
|
|
|
|
|
|
|
value = CLAMP (clist->hadjustment->value + diff, 0.0,
|
|
|
|
clist->hadjustment->upper - clist->hadjustment->page_size);
|
|
|
|
gtk_adjustment_set_value(clist->hadjustment, value);
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
static void
|
|
|
|
move_vertical (GtkCList *clist,
|
|
|
|
gint row,
|
|
|
|
gfloat align)
|
|
|
|
{
|
|
|
|
gfloat value;
|
|
|
|
|
|
|
|
if (!clist->vadjustment)
|
|
|
|
return;
|
|
|
|
|
|
|
|
value = (ROW_TOP_YPIXEL (clist, row) - clist->voffset -
|
|
|
|
align * (clist->clist_window_height - clist->row_height) +
|
|
|
|
(2 * align - 1) * CELL_SPACING);
|
|
|
|
|
|
|
|
if (value + clist->vadjustment->page_size > clist->vadjustment->upper)
|
|
|
|
value = clist->vadjustment->upper - clist->vadjustment->page_size;
|
|
|
|
|
|
|
|
gtk_adjustment_set_value(clist->vadjustment, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
horizontal_timeout (GtkCList *clist)
|
|
|
|
{
|
1999-04-30 11:48:42 +00:00
|
|
|
GdkEventMotion event = { 0 };
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
|
1998-12-16 20:09:30 +00:00
|
|
|
GDK_THREADS_ENTER ();
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
|
|
|
|
clist->htimer = 0;
|
|
|
|
|
1999-04-30 11:48:42 +00:00
|
|
|
event.type = GDK_MOTION_NOTIFY;
|
|
|
|
event.send_event = TRUE;
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
|
|
|
|
gtk_clist_motion (GTK_WIDGET (clist), &event);
|
|
|
|
|
1998-12-16 20:09:30 +00:00
|
|
|
GDK_THREADS_LEAVE ();
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
vertical_timeout (GtkCList *clist)
|
|
|
|
{
|
1999-04-30 11:48:42 +00:00
|
|
|
GdkEventMotion event = { 0 };
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
|
1998-12-16 20:09:30 +00:00
|
|
|
GDK_THREADS_ENTER ();
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
|
|
|
|
clist->vtimer = 0;
|
|
|
|
|
1999-04-30 11:48:42 +00:00
|
|
|
event.type = GDK_MOTION_NOTIFY;
|
|
|
|
event.send_event = TRUE;
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
|
|
|
|
gtk_clist_motion (GTK_WIDGET (clist), &event);
|
|
|
|
|
1998-12-16 20:09:30 +00:00
|
|
|
GDK_THREADS_LEAVE ();
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
remove_grab (GtkCList *clist)
|
|
|
|
{
|
1999-01-18 23:02:08 +00:00
|
|
|
if (GTK_WIDGET_HAS_GRAB (clist))
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
{
|
|
|
|
gtk_grab_remove (GTK_WIDGET (clist));
|
1999-01-18 23:02:08 +00:00
|
|
|
if (gdk_pointer_is_grabbed ())
|
|
|
|
gdk_pointer_ungrab (GDK_CURRENT_TIME);
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (clist->htimer)
|
|
|
|
{
|
|
|
|
gtk_timeout_remove (clist->htimer);
|
|
|
|
clist->htimer = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (clist->vtimer)
|
|
|
|
{
|
|
|
|
gtk_timeout_remove (clist->vtimer);
|
|
|
|
clist->vtimer = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* PUBLIC SORTING FUNCTIONS
|
|
|
|
* gtk_clist_sort
|
|
|
|
* gtk_clist_set_compare_func
|
|
|
|
* gtk_clist_set_auto_sort
|
|
|
|
* gtk_clist_set_sort_type
|
|
|
|
* gtk_clist_set_sort_column
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gtk_clist_sort (GtkCList *clist)
|
|
|
|
{
|
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
|
|
|
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->sort_list (clist);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_clist_set_compare_func (GtkCList *clist,
|
|
|
|
GtkCListCompareFunc cmp_func)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist->compare = (cmp_func) ? cmp_func : default_compare;
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
void
|
|
|
|
gtk_clist_set_auto_sort (GtkCList *clist,
|
|
|
|
gboolean auto_sort)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-07-15 23:40:00 +00:00
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (GTK_CLIST_AUTO_SORT(clist) && !auto_sort)
|
1998-10-19 22:46:38 +00:00
|
|
|
GTK_CLIST_UNSET_FLAG (clist, CLIST_AUTO_SORT);
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
else if (!GTK_CLIST_AUTO_SORT(clist) && auto_sort)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GTK_CLIST_SET_FLAG (clist, CLIST_AUTO_SORT);
|
|
|
|
gtk_clist_sort (clist);
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
void
|
|
|
|
gtk_clist_set_sort_type (GtkCList *clist,
|
|
|
|
GtkSortType sort_type)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-07-15 23:40:00 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
clist->sort_type = sort_type;
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
void
|
|
|
|
gtk_clist_set_sort_column (GtkCList *clist,
|
|
|
|
gint column)
|
1998-07-15 23:40:00 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
|
|
|
|
|
|
|
if (column < 0 || column >= clist->columns)
|
|
|
|
return;
|
|
|
|
|
|
|
|
clist->sort_column = column;
|
1998-07-15 23:40:00 +00:00
|
|
|
}
|
1998-08-05 20:02:32 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
/* PRIVATE SORTING FUNCTIONS
|
|
|
|
* default_compare
|
|
|
|
* real_sort_list
|
|
|
|
* gtk_clist_merge
|
|
|
|
* gtk_clist_mergesort
|
|
|
|
*/
|
1998-08-05 20:02:32 +00:00
|
|
|
static gint
|
1998-10-19 22:46:38 +00:00
|
|
|
default_compare (GtkCList *clist,
|
|
|
|
gconstpointer ptr1,
|
|
|
|
gconstpointer ptr2)
|
1998-08-05 20:02:32 +00:00
|
|
|
{
|
1998-08-17 23:48:04 +00:00
|
|
|
char *text1 = NULL;
|
|
|
|
char *text2 = NULL;
|
|
|
|
|
1998-08-05 20:02:32 +00:00
|
|
|
GtkCListRow *row1 = (GtkCListRow *) ptr1;
|
|
|
|
GtkCListRow *row2 = (GtkCListRow *) ptr2;
|
1998-08-17 23:48:04 +00:00
|
|
|
|
|
|
|
switch (row1->cell[clist->sort_column].type)
|
|
|
|
{
|
|
|
|
case GTK_CELL_TEXT:
|
|
|
|
text1 = GTK_CELL_TEXT (row1->cell[clist->sort_column])->text;
|
|
|
|
break;
|
|
|
|
case GTK_CELL_PIXTEXT:
|
|
|
|
text1 = GTK_CELL_PIXTEXT (row1->cell[clist->sort_column])->text;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (row2->cell[clist->sort_column].type)
|
|
|
|
{
|
|
|
|
case GTK_CELL_TEXT:
|
|
|
|
text2 = GTK_CELL_TEXT (row2->cell[clist->sort_column])->text;
|
|
|
|
break;
|
|
|
|
case GTK_CELL_PIXTEXT:
|
|
|
|
text2 = GTK_CELL_PIXTEXT (row2->cell[clist->sort_column])->text;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!text2)
|
|
|
|
return (text1 != NULL);
|
|
|
|
|
|
|
|
if (!text1)
|
|
|
|
return -1;
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
return strcmp (text1, text2);
|
1998-08-05 20:02:32 +00:00
|
|
|
}
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
static void
|
|
|
|
real_sort_list (GtkCList *clist)
|
1998-08-05 20:02:32 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GList *list;
|
|
|
|
GList *work;
|
|
|
|
gint i;
|
|
|
|
|
1998-08-05 20:02:32 +00:00
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
1998-10-19 22:46:38 +00:00
|
|
|
|
|
|
|
if (clist->rows <= 1)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (gdk_pointer_is_grabbed () && GTK_WIDGET_HAS_GRAB (clist))
|
|
|
|
return;
|
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
gtk_clist_freeze (clist);
|
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
if (clist->anchor != -1 && clist->selection_mode == GTK_SELECTION_EXTENDED)
|
1998-08-05 20:02:32 +00:00
|
|
|
{
|
1998-10-19 22:46:38 +00:00
|
|
|
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
|
|
|
|
g_list_free (clist->undo_selection);
|
|
|
|
g_list_free (clist->undo_unselection);
|
|
|
|
clist->undo_selection = NULL;
|
|
|
|
clist->undo_unselection = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
clist->row_list = gtk_clist_mergesort (clist, clist->row_list, clist->rows);
|
1998-08-05 20:02:32 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
work = clist->selection;
|
1998-08-05 20:02:32 +00:00
|
|
|
|
1998-10-19 22:46:38 +00:00
|
|
|
for (i = 0, list = clist->row_list; i < clist->rows; i++, list = list->next)
|
|
|
|
{
|
|
|
|
if (GTK_CLIST_ROW (list)->state == GTK_STATE_SELECTED)
|
|
|
|
{
|
|
|
|
work->data = GINT_TO_POINTER (i);
|
|
|
|
work = work->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (i == clist->rows - 1)
|
|
|
|
clist->row_list_end = list;
|
|
|
|
}
|
1998-08-05 20:02:32 +00:00
|
|
|
|
1998-11-28 01:56:09 +00:00
|
|
|
gtk_clist_thaw (clist);
|
1998-08-05 20:02:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static GList *
|
1998-08-06 20:49:24 +00:00
|
|
|
gtk_clist_merge (GtkCList *clist,
|
|
|
|
GList *a, /* first list to merge */
|
|
|
|
GList *b) /* second list to merge */
|
1998-08-05 20:02:32 +00:00
|
|
|
{
|
1998-08-06 20:49:24 +00:00
|
|
|
GList z = { 0 }; /* auxiliary node */
|
1998-08-05 20:02:32 +00:00
|
|
|
GList *c;
|
|
|
|
gint cmp;
|
|
|
|
|
|
|
|
c = &z;
|
|
|
|
|
|
|
|
while (a || b)
|
|
|
|
{
|
|
|
|
if (a && !b)
|
|
|
|
{
|
|
|
|
c->next = a;
|
|
|
|
a->prev = c;
|
|
|
|
c = a;
|
|
|
|
a = a->next;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
else if (!a && b)
|
|
|
|
{
|
|
|
|
c->next = b;
|
|
|
|
b->prev = c;
|
|
|
|
c = b;
|
|
|
|
b = b->next;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
else /* a && b */
|
|
|
|
{
|
|
|
|
cmp = clist->compare (clist, GTK_CLIST_ROW (a), GTK_CLIST_ROW (b));
|
|
|
|
if ((cmp >= 0 && clist->sort_type == GTK_SORT_DESCENDING) ||
|
|
|
|
(cmp <= 0 && clist->sort_type == GTK_SORT_ASCENDING) ||
|
|
|
|
(a && !b))
|
|
|
|
{
|
|
|
|
c->next = a;
|
|
|
|
a->prev = c;
|
|
|
|
c = a;
|
|
|
|
a = a->next;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
c->next = b;
|
|
|
|
b->prev = c;
|
|
|
|
c = b;
|
|
|
|
b = b->next;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return z.next;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GList *
|
1998-08-06 20:49:24 +00:00
|
|
|
gtk_clist_mergesort (GtkCList *clist,
|
|
|
|
GList *list, /* the list to sort */
|
|
|
|
gint num) /* the list's length */
|
1998-08-05 20:02:32 +00:00
|
|
|
{
|
|
|
|
GList *half;
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
if (num == 1)
|
|
|
|
{
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* move "half" to the middle */
|
|
|
|
half = list;
|
|
|
|
for (i = 0; i < num / 2; i++)
|
|
|
|
half = half->next;
|
|
|
|
|
|
|
|
/* cut the list in two */
|
|
|
|
half->prev->next = NULL;
|
|
|
|
half->prev = NULL;
|
|
|
|
|
|
|
|
/* recursively sort both lists */
|
1998-08-06 20:49:24 +00:00
|
|
|
return gtk_clist_merge (clist,
|
|
|
|
gtk_clist_mergesort (clist, list, num / 2),
|
|
|
|
gtk_clist_mergesort (clist, half, num - num / 2));
|
1998-08-05 20:02:32 +00:00
|
|
|
}
|
|
|
|
}
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
|
|
|
|
/************************/
|
|
|
|
|
|
|
|
static void
|
|
|
|
drag_source_info_destroy (gpointer data)
|
|
|
|
{
|
|
|
|
GtkCListCellInfo *info = data;
|
|
|
|
|
|
|
|
g_free (info);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
drag_dest_info_destroy (gpointer data)
|
|
|
|
{
|
|
|
|
GtkCListDestInfo *info = data;
|
|
|
|
|
|
|
|
g_free (info);
|
|
|
|
}
|
|
|
|
|
1999-04-30 11:48:42 +00:00
|
|
|
static void
|
|
|
|
drag_dest_cell (GtkCList *clist,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
GtkCListDestInfo *dest_info)
|
|
|
|
{
|
|
|
|
GtkWidget *widget;
|
|
|
|
|
|
|
|
widget = GTK_WIDGET (clist);
|
|
|
|
|
|
|
|
dest_info->insert_pos = GTK_CLIST_DRAG_NONE;
|
|
|
|
|
|
|
|
y -= (GTK_CONTAINER (clist)->border_width +
|
|
|
|
widget->style->klass->ythickness +
|
|
|
|
clist->column_title_area.height);
|
|
|
|
|
|
|
|
dest_info->cell.row = ROW_FROM_YPIXEL (clist, y);
|
|
|
|
if (dest_info->cell.row >= clist->rows)
|
|
|
|
{
|
|
|
|
dest_info->cell.row = clist->rows - 1;
|
|
|
|
y = ROW_TOP_YPIXEL (clist, dest_info->cell.row) + clist->row_height;
|
|
|
|
}
|
|
|
|
if (dest_info->cell.row < -1)
|
|
|
|
dest_info->cell.row = -1;
|
|
|
|
|
|
|
|
x -= GTK_CONTAINER (widget)->border_width + widget->style->klass->xthickness;
|
|
|
|
dest_info->cell.column = COLUMN_FROM_XPIXEL (clist, x);
|
|
|
|
|
|
|
|
if (dest_info->cell.row >= 0)
|
|
|
|
{
|
|
|
|
gint y_delta;
|
|
|
|
gint h = 0;
|
|
|
|
|
|
|
|
y_delta = y - ROW_TOP_YPIXEL (clist, dest_info->cell.row);
|
|
|
|
|
|
|
|
if (GTK_CLIST_DRAW_DRAG_RECT(clist))
|
|
|
|
{
|
|
|
|
dest_info->insert_pos = GTK_CLIST_DRAG_INTO;
|
|
|
|
h = clist->row_height / 4;
|
|
|
|
}
|
|
|
|
else if (GTK_CLIST_DRAW_DRAG_LINE(clist))
|
|
|
|
{
|
|
|
|
dest_info->insert_pos = GTK_CLIST_DRAG_BEFORE;
|
|
|
|
h = clist->row_height / 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (GTK_CLIST_DRAW_DRAG_LINE(clist))
|
|
|
|
{
|
|
|
|
if (y_delta < h)
|
|
|
|
dest_info->insert_pos = GTK_CLIST_DRAG_BEFORE;
|
|
|
|
else if (clist->row_height - y_delta < h)
|
|
|
|
dest_info->insert_pos = GTK_CLIST_DRAG_AFTER;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
static void
|
|
|
|
gtk_clist_drag_begin (GtkWidget *widget,
|
|
|
|
GdkDragContext *context)
|
|
|
|
{
|
|
|
|
GtkCList *clist;
|
|
|
|
GtkCListCellInfo *info;
|
|
|
|
|
|
|
|
g_return_if_fail (widget != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (widget));
|
|
|
|
g_return_if_fail (context != NULL);
|
|
|
|
|
|
|
|
clist = GTK_CLIST (widget);
|
|
|
|
|
1999-01-08 00:21:36 +00:00
|
|
|
clist->drag_button = 0;
|
|
|
|
remove_grab (clist);
|
|
|
|
|
|
|
|
switch (clist->selection_mode)
|
|
|
|
{
|
|
|
|
case GTK_SELECTION_EXTENDED:
|
|
|
|
update_extended_selection (clist, clist->focus_row);
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
|
|
|
|
break;
|
|
|
|
case GTK_SELECTION_SINGLE:
|
|
|
|
case GTK_SELECTION_MULTIPLE:
|
|
|
|
clist->anchor = -1;
|
|
|
|
case GTK_SELECTION_BROWSE:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
info = g_dataset_get_data (context, "gtk-clist-drag-source");
|
|
|
|
|
|
|
|
if (!info)
|
|
|
|
{
|
|
|
|
info = g_new (GtkCListCellInfo, 1);
|
|
|
|
|
|
|
|
if (clist->click_cell.row < 0)
|
|
|
|
clist->click_cell.row = 0;
|
|
|
|
else if (clist->click_cell.row >= clist->rows)
|
|
|
|
clist->click_cell.row = clist->rows - 1;
|
|
|
|
info->row = clist->click_cell.row;
|
|
|
|
info->column = clist->click_cell.column;
|
|
|
|
|
|
|
|
g_dataset_set_data_full (context, "gtk-clist-drag-source", info,
|
|
|
|
drag_source_info_destroy);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (GTK_CLIST_USE_DRAG_ICONS (clist))
|
|
|
|
gtk_drag_set_icon_default (context);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_clist_drag_end (GtkWidget *widget,
|
|
|
|
GdkDragContext *context)
|
|
|
|
{
|
|
|
|
GtkCList *clist;
|
|
|
|
|
|
|
|
g_return_if_fail (widget != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (widget));
|
|
|
|
g_return_if_fail (context != NULL);
|
|
|
|
|
|
|
|
clist = GTK_CLIST (widget);
|
|
|
|
|
|
|
|
clist->click_cell.row = -1;
|
|
|
|
clist->click_cell.column = -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_clist_drag_leave (GtkWidget *widget,
|
|
|
|
GdkDragContext *context,
|
|
|
|
guint time)
|
|
|
|
{
|
|
|
|
GtkCList *clist;
|
|
|
|
GtkCListDestInfo *dest_info;
|
|
|
|
|
|
|
|
g_return_if_fail (widget != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (widget));
|
|
|
|
g_return_if_fail (context != NULL);
|
|
|
|
|
|
|
|
clist = GTK_CLIST (widget);
|
|
|
|
|
|
|
|
dest_info = g_dataset_get_data (context, "gtk-clist-drag-dest");
|
|
|
|
|
|
|
|
if (dest_info)
|
|
|
|
{
|
|
|
|
if (dest_info->cell.row >= 0 &&
|
|
|
|
GTK_CLIST_REORDERABLE(clist) &&
|
|
|
|
gtk_drag_get_source_widget (context) == widget)
|
|
|
|
{
|
|
|
|
GList *list;
|
|
|
|
GdkAtom atom = gdk_atom_intern ("gtk-clist-drag-reorder", FALSE);
|
|
|
|
|
|
|
|
list = context->targets;
|
|
|
|
while (list)
|
|
|
|
{
|
|
|
|
if (atom == GPOINTER_TO_INT (list->data))
|
|
|
|
{
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->draw_drag_highlight
|
|
|
|
(clist,
|
|
|
|
g_list_nth (clist->row_list, dest_info->cell.row)->data,
|
|
|
|
dest_info->cell.row, dest_info->insert_pos);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
list = list->next;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
g_dataset_remove_data (context, "gtk-clist-drag-dest");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_clist_drag_motion (GtkWidget *widget,
|
|
|
|
GdkDragContext *context,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
guint time)
|
|
|
|
{
|
|
|
|
GtkCList *clist;
|
1999-04-30 11:48:42 +00:00
|
|
|
GtkCListDestInfo new_info;
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
GtkCListDestInfo *dest_info;
|
|
|
|
|
|
|
|
g_return_val_if_fail (widget != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_CLIST (widget), FALSE);
|
|
|
|
|
|
|
|
clist = GTK_CLIST (widget);
|
|
|
|
|
|
|
|
dest_info = g_dataset_get_data (context, "gtk-clist-drag-dest");
|
|
|
|
|
|
|
|
if (!dest_info)
|
|
|
|
{
|
|
|
|
dest_info = g_new (GtkCListDestInfo, 1);
|
|
|
|
|
|
|
|
dest_info->insert_pos = GTK_CLIST_DRAG_NONE;
|
|
|
|
dest_info->cell.row = -1;
|
|
|
|
dest_info->cell.column = -1;
|
|
|
|
|
|
|
|
g_dataset_set_data_full (context, "gtk-clist-drag-dest", dest_info,
|
|
|
|
drag_dest_info_destroy);
|
|
|
|
}
|
|
|
|
|
1999-04-30 11:48:42 +00:00
|
|
|
drag_dest_cell (clist, x, y, &new_info);
|
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
if (GTK_CLIST_REORDERABLE (clist))
|
|
|
|
{
|
|
|
|
GList *list;
|
|
|
|
GdkAtom atom = gdk_atom_intern ("gtk-clist-drag-reorder", FALSE);
|
|
|
|
|
|
|
|
list = context->targets;
|
|
|
|
while (list)
|
|
|
|
{
|
|
|
|
if (atom == GPOINTER_TO_INT (list->data))
|
|
|
|
break;
|
|
|
|
list = list->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (list)
|
|
|
|
{
|
|
|
|
if (gtk_drag_get_source_widget (context) != widget ||
|
1999-04-30 11:48:42 +00:00
|
|
|
new_info.insert_pos == GTK_CLIST_DRAG_NONE ||
|
|
|
|
new_info.cell.row == clist->click_cell.row ||
|
|
|
|
(new_info.cell.row == clist->click_cell.row - 1 &&
|
|
|
|
new_info.insert_pos == GTK_CLIST_DRAG_AFTER) ||
|
|
|
|
(new_info.cell.row == clist->click_cell.row + 1 &&
|
|
|
|
new_info.insert_pos == GTK_CLIST_DRAG_BEFORE))
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
{
|
|
|
|
if (dest_info->cell.row < 0)
|
|
|
|
{
|
|
|
|
gdk_drag_status (context, GDK_ACTION_DEFAULT, time);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
1999-04-30 11:48:42 +00:00
|
|
|
if (new_info.cell.row != dest_info->cell.row ||
|
|
|
|
(new_info.cell.row == dest_info->cell.row &&
|
|
|
|
dest_info->insert_pos != new_info.insert_pos))
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
{
|
|
|
|
if (dest_info->cell.row >= 0)
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->draw_drag_highlight
|
|
|
|
(clist, g_list_nth (clist->row_list,
|
|
|
|
dest_info->cell.row)->data,
|
|
|
|
dest_info->cell.row, dest_info->insert_pos);
|
|
|
|
|
1999-04-30 11:48:42 +00:00
|
|
|
dest_info->insert_pos = new_info.insert_pos;
|
|
|
|
dest_info->cell.row = new_info.cell.row;
|
|
|
|
dest_info->cell.column = new_info.cell.column;
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->draw_drag_highlight
|
|
|
|
(clist, g_list_nth (clist->row_list,
|
|
|
|
dest_info->cell.row)->data,
|
|
|
|
dest_info->cell.row, dest_info->insert_pos);
|
|
|
|
|
|
|
|
gdk_drag_status (context, context->suggested_action, time);
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-04-30 11:48:42 +00:00
|
|
|
dest_info->insert_pos = new_info.insert_pos;
|
|
|
|
dest_info->cell.row = new_info.cell.row;
|
|
|
|
dest_info->cell.column = new_info.cell.column;
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gtk_clist_drag_drop (GtkWidget *widget,
|
|
|
|
GdkDragContext *context,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
guint time)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (widget != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_CLIST (widget), FALSE);
|
|
|
|
g_return_val_if_fail (context != NULL, FALSE);
|
|
|
|
|
|
|
|
if (GTK_CLIST_REORDERABLE (widget) &&
|
|
|
|
gtk_drag_get_source_widget (context) == widget)
|
|
|
|
{
|
|
|
|
GList *list;
|
|
|
|
GdkAtom atom = gdk_atom_intern ("gtk-clist-drag-reorder", FALSE);
|
|
|
|
|
|
|
|
list = context->targets;
|
|
|
|
while (list)
|
|
|
|
{
|
|
|
|
if (atom == GPOINTER_TO_INT (list->data))
|
|
|
|
return TRUE;
|
|
|
|
list = list->next;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_clist_drag_data_received (GtkWidget *widget,
|
|
|
|
GdkDragContext *context,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
GtkSelectionData *selection_data,
|
|
|
|
guint info,
|
1999-02-25 04:06:15 +00:00
|
|
|
guint time)
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
{
|
|
|
|
GtkCList *clist;
|
|
|
|
|
|
|
|
g_return_if_fail (widget != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (widget));
|
|
|
|
g_return_if_fail (context != NULL);
|
|
|
|
g_return_if_fail (selection_data != NULL);
|
|
|
|
|
|
|
|
clist = GTK_CLIST (widget);
|
|
|
|
|
|
|
|
if (GTK_CLIST_REORDERABLE (clist) &&
|
|
|
|
gtk_drag_get_source_widget (context) == widget &&
|
|
|
|
selection_data->target ==
|
|
|
|
gdk_atom_intern ("gtk-clist-drag-reorder", FALSE) &&
|
|
|
|
selection_data->format == GTK_TYPE_POINTER &&
|
|
|
|
selection_data->length == sizeof (GtkCListCellInfo))
|
|
|
|
{
|
|
|
|
GtkCListCellInfo *source_info;
|
|
|
|
|
|
|
|
source_info = (GtkCListCellInfo *)(selection_data->data);
|
1999-04-30 11:48:42 +00:00
|
|
|
if (source_info)
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
{
|
1999-04-30 11:48:42 +00:00
|
|
|
GtkCListDestInfo dest_info;
|
|
|
|
|
|
|
|
drag_dest_cell (clist, x, y, &dest_info);
|
|
|
|
|
|
|
|
if (dest_info.insert_pos == GTK_CLIST_DRAG_AFTER)
|
|
|
|
dest_info.cell.row++;
|
|
|
|
if (source_info->row < dest_info.cell.row)
|
|
|
|
dest_info.cell.row--;
|
|
|
|
if (dest_info.cell.row != source_info->row)
|
|
|
|
gtk_clist_row_move (clist, source_info->row, dest_info.cell.row);
|
|
|
|
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
g_dataset_remove_data (context, "gtk-clist-drag-dest");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_clist_drag_data_get (GtkWidget *widget,
|
|
|
|
GdkDragContext *context,
|
|
|
|
GtkSelectionData *selection_data,
|
|
|
|
guint info,
|
|
|
|
guint time)
|
|
|
|
{
|
|
|
|
g_return_if_fail (widget != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (widget));
|
|
|
|
g_return_if_fail (context != NULL);
|
|
|
|
g_return_if_fail (selection_data != NULL);
|
|
|
|
|
|
|
|
if (selection_data->target ==
|
|
|
|
gdk_atom_intern ("gtk-clist-drag-reorder", FALSE))
|
|
|
|
{
|
|
|
|
GtkCListCellInfo *info;
|
|
|
|
|
|
|
|
info = g_dataset_get_data (context, "gtk-clist-drag-source");
|
|
|
|
|
|
|
|
if (info)
|
|
|
|
{
|
Tue Mar 16 17:43:33 1999 Tim Janik <timj@gtk.org>
Wed Mar 17 01:46:28 1999 Tim Janik <timj@gtk.org>
* merges from gtk-1-2:
Tue Mar 16 17:43:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_string): ensure the
item factory class has been created.
(gtk_item_factory_parse_rc): likewise.
* gtk/gtkmenu.c:
keep proper references for old_active_menu_item.
(gtk_menu_reparent): unset the usize of the new parent,
so the menu can sanely be size requested and we don't get nasty screen
artefacts upon next reparentation.
(gtk_menu_motion_notify): set send_event to TRUE if we synthesize an
enter notify. only synthesize enter notifies if the pointer really is
inside the event window.
(gtk_menu_popdown): use gtk_menu_shell_deselect().
(gtk_menu_popup): move the background setting stuff into
gtk_menu_tearoff_bg_copy() so it can be called from other places as well.
* gtk/gtkmenushell.c (gtk_menu_shell_button_press): use
gtk_menu_shell_select_item() to select the new item.
(gtk_menu_shell_deselect): export this function, so gtkmenu.c can
do the right thing for deselection as well.
Sat Mar 15 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.[hc]:
(gtk_widget_accelerators_locked): return whether a widget's accelerators
are locked.
* gtk/gtkmenu.c (gtk_menu_key_press): don't remove or install new or
existing accelerators if the widget's accelerators are locked.
Sat Mar 14 19:44:05 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.[hc]: allow managing of foreign menu items.
* gtk/gtkmenu.c: truely forward key press and key release events to
the menu widget from the toplevel or tearoff window. we can't simply
connect to that, we need to stop further processing of the events as
well.
Sat Mar 13 13:14:17 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.c:
(gtk_menu_key_press): pass event->keyval, event->state to
gtk_accelerator_valid, instead of event->keyval twice.
refuse to install single letter accelerators for menus that use
single letter shortcuts.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): use
gtk_menu_ensure_uline_accel_group().
* gtk/gtkmenu.[hc]: added gtk_menu_ensure_uline_accel_group()
which will always return an uline accel group, made
gtk_menu_get_uline_accel_group() return NULL if the group isn't
yet created.
Mon Mar 15 01:03:27 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h (struct _GtkCListColumn): added button_passive flag.
* gtk/gtkclist.c (gtk_clist_column_title_passive):
Leave button sensitive, trap button_press, button_release,
motion_notify, enter_notify and leave_notify events instead.
(gtk_clist_column_title_active): disconnect event handler.
(gtk_clist_drag_data_get): fixed memory leak. Reported by
Guillaume Laurent <glaurent@worldnet.fr>
Wed Mar 10 23:49:55 1999 Lars Hamann <lars@gtk.org>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): fixed a few
width/height mixups.
* gtk/gtkctree.c (tree_delete): emit an tree_unselect_row signal
if needed.
Wed Mar 10 00:11:32 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c (create_item_factory): unref the item factory after
window's destruction.
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): keep a reference
count on the menu shell around the menu item's activation, since the
signal emission may cause menu shell destruction.
* gtk/gtkitemfactory.c:
the previous code leaked one accel group per menu. we use
gtk_menu_get_uline_accel_group() now to fix that, and with that
also create the underline accelerator group of the menus only if
required (i.e. an underline accelerator has been specified).
(gtk_item_factory_construct):
(gtk_item_factory_create_item): removed code that would create an
extra accel group for the menu (and leak references).
(gtk_item_factory_create_item): adapted the underline accelerator
installation code to properly feature gtk_menu_get_uline_accel_group().
* gtk/gtkmenu.[hc]: added gtk_menu_get_accel_group() to retrive
menu->accel_group, this may return NULL if the accelerator group
hasn't been set yet.
added gtk_menu_get_uline_accel_group() to retrive the underline
accelerator group of the menu, this will be created on demand
and proper care is taken about its reference count.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c:
dumped the approach of keeping a widgets by action list on the
factory since the factory<->widget destroy negotiation didn't work
and would be hard to get going at all. instead we keep a list of
GtkItemFactoryItem items on the factory (GtkItemFactoryItems are
persistant throughout a program's life time).
also, i removed the static const gchar *key_* variables, and made
them inline strings (they weren't actually used anyways).
(gtk_item_factory_add_item): update ifactory->items.
(gtk_item_factory_destroy): destroy ifactory->items (and remove
the item factory pointer from the remaining ifactory widgets).
(gtk_item_factory_get_widget_by_action): walk the GtkItemFactoryItem
list to find the widget.
(gtk_item_factory_get_item): new function that works around
gtk_item_factory_get_widget() limitations, this function will only
return menu items, even for <Branch> entries.
Tue Mar 9 01:01:28 1999 Tim Janik <timj@gtk.org>
* gdk/gdkfont.c (gdk_font_load): first lookup the xfont ID in our
font hash table, if we have a GdkFontPrivate entry for this font
already, simply increment its reference count, provided by Olaf Dietsche
<olaf.dietsche+list.gtk@netcologne.de>.
* gtk/gtkstyle.c (gtk_style_copy): plug a GdkFont reference leak, fix
provided by Olaf Dietsche <olaf.dietsche+list.gtk@netcologne.de>.
Sun Mar 7 06:13:29 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c:
(gtk_container_add_with_args):
(gtk_container_addv):
(gtk_container_add): before adding a child to a conatiner, make sure
it is (default) constructed, this is neccessary because under certain
circumstances the child will get relized and mapped immediatedly, in
which case it has to be constructed already.
Mon Mar 1 17:58:21 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_connect_by_type): count object_signal
values > 1 as TRUE also.
1999-03-17 01:39:42 +00:00
|
|
|
GtkCListCellInfo ret_info;
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
|
Tue Mar 16 17:43:33 1999 Tim Janik <timj@gtk.org>
Wed Mar 17 01:46:28 1999 Tim Janik <timj@gtk.org>
* merges from gtk-1-2:
Tue Mar 16 17:43:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_string): ensure the
item factory class has been created.
(gtk_item_factory_parse_rc): likewise.
* gtk/gtkmenu.c:
keep proper references for old_active_menu_item.
(gtk_menu_reparent): unset the usize of the new parent,
so the menu can sanely be size requested and we don't get nasty screen
artefacts upon next reparentation.
(gtk_menu_motion_notify): set send_event to TRUE if we synthesize an
enter notify. only synthesize enter notifies if the pointer really is
inside the event window.
(gtk_menu_popdown): use gtk_menu_shell_deselect().
(gtk_menu_popup): move the background setting stuff into
gtk_menu_tearoff_bg_copy() so it can be called from other places as well.
* gtk/gtkmenushell.c (gtk_menu_shell_button_press): use
gtk_menu_shell_select_item() to select the new item.
(gtk_menu_shell_deselect): export this function, so gtkmenu.c can
do the right thing for deselection as well.
Sat Mar 15 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.[hc]:
(gtk_widget_accelerators_locked): return whether a widget's accelerators
are locked.
* gtk/gtkmenu.c (gtk_menu_key_press): don't remove or install new or
existing accelerators if the widget's accelerators are locked.
Sat Mar 14 19:44:05 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.[hc]: allow managing of foreign menu items.
* gtk/gtkmenu.c: truely forward key press and key release events to
the menu widget from the toplevel or tearoff window. we can't simply
connect to that, we need to stop further processing of the events as
well.
Sat Mar 13 13:14:17 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.c:
(gtk_menu_key_press): pass event->keyval, event->state to
gtk_accelerator_valid, instead of event->keyval twice.
refuse to install single letter accelerators for menus that use
single letter shortcuts.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): use
gtk_menu_ensure_uline_accel_group().
* gtk/gtkmenu.[hc]: added gtk_menu_ensure_uline_accel_group()
which will always return an uline accel group, made
gtk_menu_get_uline_accel_group() return NULL if the group isn't
yet created.
Mon Mar 15 01:03:27 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h (struct _GtkCListColumn): added button_passive flag.
* gtk/gtkclist.c (gtk_clist_column_title_passive):
Leave button sensitive, trap button_press, button_release,
motion_notify, enter_notify and leave_notify events instead.
(gtk_clist_column_title_active): disconnect event handler.
(gtk_clist_drag_data_get): fixed memory leak. Reported by
Guillaume Laurent <glaurent@worldnet.fr>
Wed Mar 10 23:49:55 1999 Lars Hamann <lars@gtk.org>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): fixed a few
width/height mixups.
* gtk/gtkctree.c (tree_delete): emit an tree_unselect_row signal
if needed.
Wed Mar 10 00:11:32 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c (create_item_factory): unref the item factory after
window's destruction.
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): keep a reference
count on the menu shell around the menu item's activation, since the
signal emission may cause menu shell destruction.
* gtk/gtkitemfactory.c:
the previous code leaked one accel group per menu. we use
gtk_menu_get_uline_accel_group() now to fix that, and with that
also create the underline accelerator group of the menus only if
required (i.e. an underline accelerator has been specified).
(gtk_item_factory_construct):
(gtk_item_factory_create_item): removed code that would create an
extra accel group for the menu (and leak references).
(gtk_item_factory_create_item): adapted the underline accelerator
installation code to properly feature gtk_menu_get_uline_accel_group().
* gtk/gtkmenu.[hc]: added gtk_menu_get_accel_group() to retrive
menu->accel_group, this may return NULL if the accelerator group
hasn't been set yet.
added gtk_menu_get_uline_accel_group() to retrive the underline
accelerator group of the menu, this will be created on demand
and proper care is taken about its reference count.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c:
dumped the approach of keeping a widgets by action list on the
factory since the factory<->widget destroy negotiation didn't work
and would be hard to get going at all. instead we keep a list of
GtkItemFactoryItem items on the factory (GtkItemFactoryItems are
persistant throughout a program's life time).
also, i removed the static const gchar *key_* variables, and made
them inline strings (they weren't actually used anyways).
(gtk_item_factory_add_item): update ifactory->items.
(gtk_item_factory_destroy): destroy ifactory->items (and remove
the item factory pointer from the remaining ifactory widgets).
(gtk_item_factory_get_widget_by_action): walk the GtkItemFactoryItem
list to find the widget.
(gtk_item_factory_get_item): new function that works around
gtk_item_factory_get_widget() limitations, this function will only
return menu items, even for <Branch> entries.
Tue Mar 9 01:01:28 1999 Tim Janik <timj@gtk.org>
* gdk/gdkfont.c (gdk_font_load): first lookup the xfont ID in our
font hash table, if we have a GdkFontPrivate entry for this font
already, simply increment its reference count, provided by Olaf Dietsche
<olaf.dietsche+list.gtk@netcologne.de>.
* gtk/gtkstyle.c (gtk_style_copy): plug a GdkFont reference leak, fix
provided by Olaf Dietsche <olaf.dietsche+list.gtk@netcologne.de>.
Sun Mar 7 06:13:29 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c:
(gtk_container_add_with_args):
(gtk_container_addv):
(gtk_container_add): before adding a child to a conatiner, make sure
it is (default) constructed, this is neccessary because under certain
circumstances the child will get relized and mapped immediatedly, in
which case it has to be constructed already.
Mon Mar 1 17:58:21 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_connect_by_type): count object_signal
values > 1 as TRUE also.
1999-03-17 01:39:42 +00:00
|
|
|
ret_info.row = info->row;
|
|
|
|
ret_info.column = info->column;
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
|
Tue Mar 16 17:43:33 1999 Tim Janik <timj@gtk.org>
Wed Mar 17 01:46:28 1999 Tim Janik <timj@gtk.org>
* merges from gtk-1-2:
Tue Mar 16 17:43:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_string): ensure the
item factory class has been created.
(gtk_item_factory_parse_rc): likewise.
* gtk/gtkmenu.c:
keep proper references for old_active_menu_item.
(gtk_menu_reparent): unset the usize of the new parent,
so the menu can sanely be size requested and we don't get nasty screen
artefacts upon next reparentation.
(gtk_menu_motion_notify): set send_event to TRUE if we synthesize an
enter notify. only synthesize enter notifies if the pointer really is
inside the event window.
(gtk_menu_popdown): use gtk_menu_shell_deselect().
(gtk_menu_popup): move the background setting stuff into
gtk_menu_tearoff_bg_copy() so it can be called from other places as well.
* gtk/gtkmenushell.c (gtk_menu_shell_button_press): use
gtk_menu_shell_select_item() to select the new item.
(gtk_menu_shell_deselect): export this function, so gtkmenu.c can
do the right thing for deselection as well.
Sat Mar 15 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.[hc]:
(gtk_widget_accelerators_locked): return whether a widget's accelerators
are locked.
* gtk/gtkmenu.c (gtk_menu_key_press): don't remove or install new or
existing accelerators if the widget's accelerators are locked.
Sat Mar 14 19:44:05 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.[hc]: allow managing of foreign menu items.
* gtk/gtkmenu.c: truely forward key press and key release events to
the menu widget from the toplevel or tearoff window. we can't simply
connect to that, we need to stop further processing of the events as
well.
Sat Mar 13 13:14:17 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.c:
(gtk_menu_key_press): pass event->keyval, event->state to
gtk_accelerator_valid, instead of event->keyval twice.
refuse to install single letter accelerators for menus that use
single letter shortcuts.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): use
gtk_menu_ensure_uline_accel_group().
* gtk/gtkmenu.[hc]: added gtk_menu_ensure_uline_accel_group()
which will always return an uline accel group, made
gtk_menu_get_uline_accel_group() return NULL if the group isn't
yet created.
Mon Mar 15 01:03:27 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h (struct _GtkCListColumn): added button_passive flag.
* gtk/gtkclist.c (gtk_clist_column_title_passive):
Leave button sensitive, trap button_press, button_release,
motion_notify, enter_notify and leave_notify events instead.
(gtk_clist_column_title_active): disconnect event handler.
(gtk_clist_drag_data_get): fixed memory leak. Reported by
Guillaume Laurent <glaurent@worldnet.fr>
Wed Mar 10 23:49:55 1999 Lars Hamann <lars@gtk.org>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): fixed a few
width/height mixups.
* gtk/gtkctree.c (tree_delete): emit an tree_unselect_row signal
if needed.
Wed Mar 10 00:11:32 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c (create_item_factory): unref the item factory after
window's destruction.
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): keep a reference
count on the menu shell around the menu item's activation, since the
signal emission may cause menu shell destruction.
* gtk/gtkitemfactory.c:
the previous code leaked one accel group per menu. we use
gtk_menu_get_uline_accel_group() now to fix that, and with that
also create the underline accelerator group of the menus only if
required (i.e. an underline accelerator has been specified).
(gtk_item_factory_construct):
(gtk_item_factory_create_item): removed code that would create an
extra accel group for the menu (and leak references).
(gtk_item_factory_create_item): adapted the underline accelerator
installation code to properly feature gtk_menu_get_uline_accel_group().
* gtk/gtkmenu.[hc]: added gtk_menu_get_accel_group() to retrive
menu->accel_group, this may return NULL if the accelerator group
hasn't been set yet.
added gtk_menu_get_uline_accel_group() to retrive the underline
accelerator group of the menu, this will be created on demand
and proper care is taken about its reference count.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c:
dumped the approach of keeping a widgets by action list on the
factory since the factory<->widget destroy negotiation didn't work
and would be hard to get going at all. instead we keep a list of
GtkItemFactoryItem items on the factory (GtkItemFactoryItems are
persistant throughout a program's life time).
also, i removed the static const gchar *key_* variables, and made
them inline strings (they weren't actually used anyways).
(gtk_item_factory_add_item): update ifactory->items.
(gtk_item_factory_destroy): destroy ifactory->items (and remove
the item factory pointer from the remaining ifactory widgets).
(gtk_item_factory_get_widget_by_action): walk the GtkItemFactoryItem
list to find the widget.
(gtk_item_factory_get_item): new function that works around
gtk_item_factory_get_widget() limitations, this function will only
return menu items, even for <Branch> entries.
Tue Mar 9 01:01:28 1999 Tim Janik <timj@gtk.org>
* gdk/gdkfont.c (gdk_font_load): first lookup the xfont ID in our
font hash table, if we have a GdkFontPrivate entry for this font
already, simply increment its reference count, provided by Olaf Dietsche
<olaf.dietsche+list.gtk@netcologne.de>.
* gtk/gtkstyle.c (gtk_style_copy): plug a GdkFont reference leak, fix
provided by Olaf Dietsche <olaf.dietsche+list.gtk@netcologne.de>.
Sun Mar 7 06:13:29 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c:
(gtk_container_add_with_args):
(gtk_container_addv):
(gtk_container_add): before adding a child to a conatiner, make sure
it is (default) constructed, this is neccessary because under certain
circumstances the child will get relized and mapped immediatedly, in
which case it has to be constructed already.
Mon Mar 1 17:58:21 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_connect_by_type): count object_signal
values > 1 as TRUE also.
1999-03-17 01:39:42 +00:00
|
|
|
gtk_selection_data_set (selection_data, selection_data->target,
|
|
|
|
GTK_TYPE_POINTER, (guchar *) &ret_info,
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
sizeof (GtkCListCellInfo));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
gtk_selection_data_set (selection_data, selection_data->target,
|
Tue Mar 16 17:43:33 1999 Tim Janik <timj@gtk.org>
Wed Mar 17 01:46:28 1999 Tim Janik <timj@gtk.org>
* merges from gtk-1-2:
Tue Mar 16 17:43:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_string): ensure the
item factory class has been created.
(gtk_item_factory_parse_rc): likewise.
* gtk/gtkmenu.c:
keep proper references for old_active_menu_item.
(gtk_menu_reparent): unset the usize of the new parent,
so the menu can sanely be size requested and we don't get nasty screen
artefacts upon next reparentation.
(gtk_menu_motion_notify): set send_event to TRUE if we synthesize an
enter notify. only synthesize enter notifies if the pointer really is
inside the event window.
(gtk_menu_popdown): use gtk_menu_shell_deselect().
(gtk_menu_popup): move the background setting stuff into
gtk_menu_tearoff_bg_copy() so it can be called from other places as well.
* gtk/gtkmenushell.c (gtk_menu_shell_button_press): use
gtk_menu_shell_select_item() to select the new item.
(gtk_menu_shell_deselect): export this function, so gtkmenu.c can
do the right thing for deselection as well.
Sat Mar 15 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.[hc]:
(gtk_widget_accelerators_locked): return whether a widget's accelerators
are locked.
* gtk/gtkmenu.c (gtk_menu_key_press): don't remove or install new or
existing accelerators if the widget's accelerators are locked.
Sat Mar 14 19:44:05 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.[hc]: allow managing of foreign menu items.
* gtk/gtkmenu.c: truely forward key press and key release events to
the menu widget from the toplevel or tearoff window. we can't simply
connect to that, we need to stop further processing of the events as
well.
Sat Mar 13 13:14:17 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.c:
(gtk_menu_key_press): pass event->keyval, event->state to
gtk_accelerator_valid, instead of event->keyval twice.
refuse to install single letter accelerators for menus that use
single letter shortcuts.
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): use
gtk_menu_ensure_uline_accel_group().
* gtk/gtkmenu.[hc]: added gtk_menu_ensure_uline_accel_group()
which will always return an uline accel group, made
gtk_menu_get_uline_accel_group() return NULL if the group isn't
yet created.
Mon Mar 15 01:03:27 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h (struct _GtkCListColumn): added button_passive flag.
* gtk/gtkclist.c (gtk_clist_column_title_passive):
Leave button sensitive, trap button_press, button_release,
motion_notify, enter_notify and leave_notify events instead.
(gtk_clist_column_title_active): disconnect event handler.
(gtk_clist_drag_data_get): fixed memory leak. Reported by
Guillaume Laurent <glaurent@worldnet.fr>
Wed Mar 10 23:49:55 1999 Lars Hamann <lars@gtk.org>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): fixed a few
width/height mixups.
* gtk/gtkctree.c (tree_delete): emit an tree_unselect_row signal
if needed.
Wed Mar 10 00:11:32 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c (create_item_factory): unref the item factory after
window's destruction.
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): keep a reference
count on the menu shell around the menu item's activation, since the
signal emission may cause menu shell destruction.
* gtk/gtkitemfactory.c:
the previous code leaked one accel group per menu. we use
gtk_menu_get_uline_accel_group() now to fix that, and with that
also create the underline accelerator group of the menus only if
required (i.e. an underline accelerator has been specified).
(gtk_item_factory_construct):
(gtk_item_factory_create_item): removed code that would create an
extra accel group for the menu (and leak references).
(gtk_item_factory_create_item): adapted the underline accelerator
installation code to properly feature gtk_menu_get_uline_accel_group().
* gtk/gtkmenu.[hc]: added gtk_menu_get_accel_group() to retrive
menu->accel_group, this may return NULL if the accelerator group
hasn't been set yet.
added gtk_menu_get_uline_accel_group() to retrive the underline
accelerator group of the menu, this will be created on demand
and proper care is taken about its reference count.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c:
dumped the approach of keeping a widgets by action list on the
factory since the factory<->widget destroy negotiation didn't work
and would be hard to get going at all. instead we keep a list of
GtkItemFactoryItem items on the factory (GtkItemFactoryItems are
persistant throughout a program's life time).
also, i removed the static const gchar *key_* variables, and made
them inline strings (they weren't actually used anyways).
(gtk_item_factory_add_item): update ifactory->items.
(gtk_item_factory_destroy): destroy ifactory->items (and remove
the item factory pointer from the remaining ifactory widgets).
(gtk_item_factory_get_widget_by_action): walk the GtkItemFactoryItem
list to find the widget.
(gtk_item_factory_get_item): new function that works around
gtk_item_factory_get_widget() limitations, this function will only
return menu items, even for <Branch> entries.
Tue Mar 9 01:01:28 1999 Tim Janik <timj@gtk.org>
* gdk/gdkfont.c (gdk_font_load): first lookup the xfont ID in our
font hash table, if we have a GdkFontPrivate entry for this font
already, simply increment its reference count, provided by Olaf Dietsche
<olaf.dietsche+list.gtk@netcologne.de>.
* gtk/gtkstyle.c (gtk_style_copy): plug a GdkFont reference leak, fix
provided by Olaf Dietsche <olaf.dietsche+list.gtk@netcologne.de>.
Sun Mar 7 06:13:29 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c:
(gtk_container_add_with_args):
(gtk_container_addv):
(gtk_container_add): before adding a child to a conatiner, make sure
it is (default) constructed, this is neccessary because under certain
circumstances the child will get relized and mapped immediatedly, in
which case it has to be constructed already.
Mon Mar 1 17:58:21 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_connect_by_type): count object_signal
values > 1 as TRUE also.
1999-03-17 01:39:42 +00:00
|
|
|
GTK_TYPE_POINTER, NULL, 0);
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
draw_drag_highlight (GtkCList *clist,
|
|
|
|
GtkCListRow *dest_row,
|
|
|
|
gint dest_row_number,
|
|
|
|
GtkCListDragPos drag_pos)
|
|
|
|
{
|
|
|
|
gint y;
|
|
|
|
|
|
|
|
y = ROW_TOP_YPIXEL (clist, dest_row_number) - 1;
|
|
|
|
|
|
|
|
switch (drag_pos)
|
|
|
|
{
|
|
|
|
case GTK_CLIST_DRAG_NONE:
|
|
|
|
break;
|
|
|
|
case GTK_CLIST_DRAG_AFTER:
|
|
|
|
y += clist->row_height + 1;
|
|
|
|
case GTK_CLIST_DRAG_BEFORE:
|
|
|
|
gdk_draw_line (clist->clist_window, clist->xor_gc,
|
|
|
|
0, y, clist->clist_window_width, y);
|
|
|
|
break;
|
|
|
|
case GTK_CLIST_DRAG_INTO:
|
|
|
|
gdk_draw_rectangle (clist->clist_window, clist->xor_gc, FALSE, 0, y,
|
|
|
|
clist->clist_window_width - 1, clist->row_height);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_clist_set_reorderable (GtkCList *clist,
|
|
|
|
gboolean reorderable)
|
|
|
|
{
|
|
|
|
GtkWidget *widget;
|
|
|
|
|
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
|
|
|
|
|
|
|
if ((GTK_CLIST_REORDERABLE(clist) != 0) == reorderable)
|
|
|
|
return;
|
|
|
|
|
|
|
|
widget = GTK_WIDGET (clist);
|
|
|
|
|
|
|
|
if (reorderable)
|
|
|
|
{
|
|
|
|
GTK_CLIST_SET_FLAG (clist, CLIST_REORDERABLE);
|
|
|
|
gtk_drag_dest_set (widget,
|
|
|
|
GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_DROP,
|
|
|
|
&clist_target_table, 1, GDK_ACTION_MOVE);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
GTK_CLIST_UNSET_FLAG (clist, CLIST_REORDERABLE);
|
|
|
|
gtk_drag_dest_unset (GTK_WIDGET (clist));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_clist_set_use_drag_icons (GtkCList *clist,
|
|
|
|
gboolean use_icons)
|
|
|
|
{
|
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
|
|
|
|
|
|
|
if (use_icons != 0)
|
|
|
|
GTK_CLIST_SET_FLAG (clist, CLIST_USE_DRAG_ICONS);
|
|
|
|
else
|
|
|
|
GTK_CLIST_UNSET_FLAG (clist, CLIST_USE_DRAG_ICONS);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_clist_set_button_actions (GtkCList *clist,
|
|
|
|
guint button,
|
|
|
|
guint8 button_actions)
|
|
|
|
{
|
|
|
|
g_return_if_fail (clist != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (clist));
|
|
|
|
|
1999-11-10 17:28:59 +00:00
|
|
|
if (button < MAX_BUTTON)
|
removed clist flag : GTK_CLIST_DRAG_SELECTION added flags :
Tue Dec 15 22:30:44 1998 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.h :
removed clist flag : GTK_CLIST_DRAG_SELECTION
added flags : GTK_CLIST_REORDERABLE, GTK_CLIST_USE_DRAG_ICONS,
GTK_CLIST_DRAW_DRAG_LINE, GTK_CLIST_DRAW_DRAG_RECT
(GtkCListDragPos) : new enum for DND
(GtkButtonAction) : new enum of possible mouse button actions
(struct _GtkCList): added button_actions array.
Added drag_button and click_cell struct, to store cell and
mouse button of last button_press_event
(struct _GtkCListClass): new class method draw_drag_highlight.
(gtk_clist_set_reorderable) (gtk_clist_set_use_drag_icons) :
new functions. Moved from gtkctree.h. Now clist is reorderable
as well.
(gtk_clist_set_button_actions) new function to customize mouse
button actions.
* gtk/gtkclist.c:
(gtk_clist_drag_begin)
(gtk_clist_drag_motion)
(gtk_clist_drag_leave)
(gtk_clist_drag_end)
(gtk_clist_drag_drop)
(gtk_clist_drag_data_get)
(gtk_clist_drag_data_received) : new dnd widget methods to
implement clists reorderability via DND
(remove_grab) : new function. remove mouse grab if necessary.
(draw_drag_highlight) : new method. Draw dnd highlight depending
on clist flags GTK_CLIST_DRAW_DRAG_LINE and GTK_CLIST_DRAW_DRAG_RECT
(gtk_clist_class_init): added object args "reorderable" and
"use_drag_icons"
(gtk_clist_button_press) (gtk_clist_button_release) :
use button_actions array to decide which action to perform.
(gtk_clist_motion) : start reorder operation if necessary.
* gtk/gtkctree.h :
(struct _GtkCTree): removed drag_icon, icon_widht, icon_height,
drag_row, drag_source, drag_target, reorderable, use_icons,
in_drag, drag_rect
(gtk_ctree_set_reorderable) : deprecated function.
use gtk_clist_set_reorderable instead.
(gtk_ctree_set_use_drag_icons) : deprecated function.
use gtk_clist_set_use_drag_icons instead.
* gtk/gtkctree.c :
(gtk_ctree_class_init): removed object args "reorderable" and
and "use_drag_icons"
(draw_xor_line) (draw_xor_rect) (create_drag_icon) (check_cursor)
(tree_toggle_selection) (set_mouse_cursor) : removed
(draw_drag_highlight) : new clist method. replacement for
draw_xor_line and draw_xor_rect functions
(check_drag) renamed check_cursor function
(gtk_ctree_drag_begin)
(gtk_ctree_drag_motion)
(gtk_ctree_drag_data_received) : new dnd methods to implement ctrees
reorderability via DND
(gtk_ctree_button_release)
(gtk_ctree_button_motion) : removed.
* gtk/testgtk.c:
(create_clist) : added new reorderable toggle button
1998-12-16 01:28:31 +00:00
|
|
|
{
|
|
|
|
if (gdk_pointer_is_grabbed () || GTK_WIDGET_HAS_GRAB (clist))
|
|
|
|
{
|
|
|
|
remove_grab (clist);
|
|
|
|
clist->drag_button = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (clist->anchor >= 0 &&
|
|
|
|
clist->selection_mode == GTK_SELECTION_EXTENDED)
|
|
|
|
GTK_CLIST_CLASS_FW (clist)->resync_selection (clist, NULL);
|
|
|
|
|
|
|
|
clist->button_actions[button] = button_actions;
|
|
|
|
}
|
|
|
|
}
|