2008-07-01 22:57:50 +00:00
|
|
|
/* GTK - The GIMP Toolkit
|
1997-11-24 22:37:52 +00:00
|
|
|
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
2000-07-26 11:33:08 +00:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
1997-11-24 22:37:52 +00:00
|
|
|
* 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
|
1998-05-01 04:23:59 +00:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2000-07-26 11:33:08 +00:00
|
|
|
* Lesser General Public License for more details.
|
1997-11-24 22:37:52 +00:00
|
|
|
*
|
2000-07-26 11:33:08 +00:00
|
|
|
* You should have received a copy of the GNU Lesser 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.
|
1997-11-24 22:37:52 +00:00
|
|
|
*/
|
1999-02-24 07:37:18 +00:00
|
|
|
|
|
|
|
/*
|
2000-07-26 11:33:08 +00:00
|
|
|
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
1999-02-24 07:37:18 +00:00
|
|
|
* 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/.
|
|
|
|
*/
|
|
|
|
|
2008-08-04 14:38:35 +00:00
|
|
|
#if !defined (GTK_DISABLE_DEPRECATED) || defined (__GTK_LIST_C__)
|
2001-02-03 01:09:41 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
#ifndef __GTK_LIST_H__
|
|
|
|
#define __GTK_LIST_H__
|
|
|
|
|
2008-05-28 15:07:04 +00:00
|
|
|
#include <gtk/gtk.h>
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2005-03-20 07:01:23 +00:00
|
|
|
G_BEGIN_DECLS
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1998-06-16 05:20:05 +00:00
|
|
|
#define GTK_TYPE_LIST (gtk_list_get_type ())
|
|
|
|
#define GTK_LIST(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_LIST, GtkList))
|
|
|
|
#define GTK_LIST_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_LIST, GtkListClass))
|
|
|
|
#define GTK_IS_LIST(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_LIST))
|
|
|
|
#define GTK_IS_LIST_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_LIST))
|
2000-02-13 08:16:48 +00:00
|
|
|
#define GTK_LIST_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_LIST, GtkListClass))
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
|
1998-05-01 04:23:59 +00:00
|
|
|
typedef struct _GtkList GtkList;
|
1997-11-24 22:37:52 +00:00
|
|
|
typedef struct _GtkListClass GtkListClass;
|
|
|
|
|
|
|
|
struct _GtkList
|
|
|
|
{
|
|
|
|
GtkContainer container;
|
|
|
|
|
|
|
|
GList *children;
|
|
|
|
GList *selection;
|
|
|
|
|
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
|
|
|
GList *undo_selection;
|
|
|
|
GList *undo_unselection;
|
|
|
|
|
|
|
|
GtkWidget *last_focus_child;
|
|
|
|
GtkWidget *undo_focus_child;
|
|
|
|
|
|
|
|
guint htimer;
|
|
|
|
guint vtimer;
|
|
|
|
|
|
|
|
gint anchor;
|
|
|
|
gint drag_pos;
|
|
|
|
GtkStateType anchor_state;
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
guint selection_mode : 2;
|
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
|
|
|
guint drag_selection:1;
|
|
|
|
guint add_mode:1;
|
1997-11-24 22:37:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _GtkListClass
|
|
|
|
{
|
|
|
|
GtkContainerClass parent_class;
|
|
|
|
|
1998-05-01 04:23:59 +00:00
|
|
|
void (* selection_changed) (GtkList *list);
|
|
|
|
void (* select_child) (GtkList *list,
|
1997-11-24 22:37:52 +00:00
|
|
|
GtkWidget *child);
|
1998-05-01 04:23:59 +00:00
|
|
|
void (* unselect_child) (GtkList *list,
|
1997-11-24 22:37:52 +00:00
|
|
|
GtkWidget *child);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2000-08-30 00:33:38 +00:00
|
|
|
GtkType gtk_list_get_type (void) G_GNUC_CONST;
|
1998-05-01 04:23:59 +00:00
|
|
|
GtkWidget* gtk_list_new (void);
|
|
|
|
void gtk_list_insert_items (GtkList *list,
|
|
|
|
GList *items,
|
|
|
|
gint position);
|
|
|
|
void gtk_list_append_items (GtkList *list,
|
|
|
|
GList *items);
|
|
|
|
void gtk_list_prepend_items (GtkList *list,
|
|
|
|
GList *items);
|
|
|
|
void gtk_list_remove_items (GtkList *list,
|
|
|
|
GList *items);
|
|
|
|
void gtk_list_remove_items_no_unref (GtkList *list,
|
|
|
|
GList *items);
|
|
|
|
void gtk_list_clear_items (GtkList *list,
|
|
|
|
gint start,
|
|
|
|
gint end);
|
|
|
|
void gtk_list_select_item (GtkList *list,
|
|
|
|
gint item);
|
|
|
|
void gtk_list_unselect_item (GtkList *list,
|
|
|
|
gint item);
|
|
|
|
void gtk_list_select_child (GtkList *list,
|
|
|
|
GtkWidget *child);
|
|
|
|
void gtk_list_unselect_child (GtkList *list,
|
|
|
|
GtkWidget *child);
|
|
|
|
gint gtk_list_child_position (GtkList *list,
|
|
|
|
GtkWidget *child);
|
|
|
|
void gtk_list_set_selection_mode (GtkList *list,
|
new function to perform the same actions as gtk_list_remove_items, but
Thu Feb 5 02:13:08 1998 Tim Janik <timj@gimp.org>
* gtk/gtklist.h:
* gtk/gtklist.c (gtk_list_remove_items_no_unref): new function
to perform the same actions as gtk_list_remove_items, but
supply the removed widgets with an additional reference count.
* gtk/gtkmain.c (gtk_main_iteration_do): ignore events
with event_widget == NULL, since they are bogus events
from destroyed GdkWindows, exept for the case where
event->type==GDK_PROPERTY_NOTIFY. Always handle expired
timeout functions when returning from this function.
* gtk/gtkwidget.c (gtk_widget_event): ignore GDK_EXPOSE events
if event->window == NULL. Also, if this function couldn't handle
the event for any reason (including failing assumptions), make
the return value to look as if the event had been handled to
avoid further processing (and warnings).
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: remove gtk_widget_sink, because there is
no point in providing such a function.
* gdk/gdk.c (gdk_init): changed options `-name' and `-class'
to `--name' and `--class', because the old names would
confuse getopt(). these arguments have been introduced in the
changes from gtk+970916 to gtk+970925 without a ChangeLog entry,
changing argument names is painful, it would be nice if people
would care about compatibility and consistency in the first place!
1998-02-05 03:53:41 +00:00
|
|
|
GtkSelectionMode mode);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
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
|
|
|
void gtk_list_extend_selection (GtkList *list,
|
|
|
|
GtkScrollType scroll_type,
|
|
|
|
gfloat position,
|
|
|
|
gboolean auto_start_selection);
|
|
|
|
void gtk_list_start_selection (GtkList *list);
|
|
|
|
void gtk_list_end_selection (GtkList *list);
|
|
|
|
void gtk_list_select_all (GtkList *list);
|
|
|
|
void gtk_list_unselect_all (GtkList *list);
|
|
|
|
void gtk_list_scroll_horizontal (GtkList *list,
|
|
|
|
GtkScrollType scroll_type,
|
|
|
|
gfloat position);
|
|
|
|
void gtk_list_scroll_vertical (GtkList *list,
|
|
|
|
GtkScrollType scroll_type,
|
|
|
|
gfloat position);
|
|
|
|
void gtk_list_toggle_add_mode (GtkList *list);
|
|
|
|
void gtk_list_toggle_focus_row (GtkList *list);
|
|
|
|
void gtk_list_toggle_row (GtkList *list,
|
|
|
|
GtkWidget *item);
|
|
|
|
void gtk_list_undo_selection (GtkList *list);
|
|
|
|
void gtk_list_end_drag_selection (GtkList *list);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2005-03-20 07:01:23 +00:00
|
|
|
G_END_DECLS
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
#endif /* __GTK_LIST_H__ */
|
2001-02-03 01:09:41 +00:00
|
|
|
|
|
|
|
#endif /* GTK_DISABLE_DEPRECATED */
|