Update icon list to use the tree model instead.

2004-07-02  Anders Carlsson  <andersca@gnome.org>

	* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
	(egg_icon_list_init), (egg_icon_list_destroy),
	(egg_icon_list_finalize), (egg_icon_list_set_property),
	(egg_icon_list_get_property), (egg_icon_list_button_press),
	(egg_icon_list_select_first_matching_item),
	(egg_icon_list_maybe_begin_dragging_items),
	(egg_icon_list_real_toggle_cursor_item),
	(egg_icon_list_calculate_item_size),
	(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
	(egg_icon_list_item_new), (egg_icon_list_item_unref),
	(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
	(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
	(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
	(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
	(egg_icon_list_item_activated), (egg_icon_list_get_items),
	(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
	(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
	(egg_icon_list_build_items), (egg_icon_list_set_model),
	(egg_icon_list_get_model), (egg_icon_list_set_text_column),
	(egg_icon_list_set_pixbuf_column):
	* libegg/iconlist/eggiconlist.h:
	* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
	(foreach_selected_print), (item_removed), (remove_selected),
	(item_cb), (do_popup_menu), (main):
	* libegg/util/eggmarshalers.list:
	Update icon list to use the tree model instead.
This commit is contained in:
Anders Carlsson 2004-07-02 12:04:49 +00:00 committed by Anders Carlsson
parent ee15a7b948
commit 5a79a61179
2 changed files with 729 additions and 829 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/* eggiconlist.h /* eggiconlist.h
* Copyright (C) 2002 Anders Carlsson <andersca@gnu.org> * Copyright (C) 2002, 2004 Anders Carlsson <andersca@gnome.org>
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
@ -20,6 +20,7 @@
#define __EGG_ICON_LIST_H__ #define __EGG_ICON_LIST_H__
#include <gtk/gtkcontainer.h> #include <gtk/gtkcontainer.h>
#include <gtk/gtktreemodel.h>
G_BEGIN_DECLS G_BEGIN_DECLS
@ -30,20 +31,14 @@ G_BEGIN_DECLS
#define EGG_IS_ICON_LIST_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), EGG_TYPE_ICON_LIST)) #define EGG_IS_ICON_LIST_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), EGG_TYPE_ICON_LIST))
#define EGG_ICON_LIST_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), EGG_TYPE_ICON_LIST, EggIconListClass)) #define EGG_ICON_LIST_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), EGG_TYPE_ICON_LIST, EggIconListClass))
#define EGG_TYPE_ICON_LIST_ITEM (egg_icon_list_item_get_type ())
typedef struct _EggIconList EggIconList; typedef struct _EggIconList EggIconList;
typedef struct _EggIconListClass EggIconListClass; typedef struct _EggIconListClass EggIconListClass;
typedef struct _EggIconListPrivate EggIconListPrivate; typedef struct _EggIconListPrivate EggIconListPrivate;
typedef struct _EggIconListItem EggIconListItem; typedef struct _EggIconListItem EggIconListItem;
typedef void (* EggIconListForeachFunc) (EggIconList *icon_list, typedef void (* EggIconListForeachFunc) (EggIconList *icon_list,
EggIconListItem *item, GtkTreePath *path,
gpointer data); gpointer data);
typedef gint (* EggIconListItemCompareFunc) (EggIconList *icon_list,
EggIconListItem *a,
EggIconListItem *b,
gpointer user_data);
struct _EggIconList struct _EggIconList
{ {
@ -61,14 +56,9 @@ struct _EggIconListClass
GtkAdjustment *vadjustment); GtkAdjustment *vadjustment);
void (* item_activated) (EggIconList *icon_list, void (* item_activated) (EggIconList *icon_list,
EggIconListItem *item); GtkTreePath *path);
void (* selection_changed) (EggIconList *icon_list); void (* selection_changed) (EggIconList *icon_list);
void (* item_added) (EggIconList *icon_list,
EggIconListItem *item);
void (* item_removed) (EggIconList *icon_list,
EggIconListItem *item);
void (* item_changed) (EggIconList *icon_list,
EggIconListItem *item);
/* Key binding signals */ /* Key binding signals */
void (* select_all) (EggIconList *icon_list); void (* select_all) (EggIconList *icon_list);
void (* unselect_all) (EggIconList *icon_list); void (* unselect_all) (EggIconList *icon_list);
@ -79,75 +69,40 @@ struct _EggIconListClass
gint count); gint count);
}; };
GType egg_icon_list_get_type (void); GType egg_icon_list_get_type (void);
GType egg_icon_list_item_get_type (void); GtkWidget * egg_icon_list_new (void);
GtkWidget *egg_icon_list_new (void); void egg_icon_list_set_model (EggIconList *icon_list,
GtkTreeModel *model);
GtkTreeModel *egg_icon_list_get_model (EggIconList *icon_list);
void egg_icon_list_set_text_column (EggIconList *icon_list,
gint column);
gint egg_icon_list_get_text_column (EggIconList *icon_list);
void egg_icon_list_set_pixbuf_column (EggIconList *icon_list,
gint column);
gint egg_icon_list_get_pixbuf_column (EggIconList *icon_list);
GtkTreePath * egg_icon_list_get_path_at_pos (EggIconList *icon_list,
gint x,
gint y);
void egg_icon_list_selected_foreach (EggIconList *icon_list,
EggIconListForeachFunc func,
gpointer data);
void egg_icon_list_set_selection_mode (EggIconList *icon_list,
GtkSelectionMode mode);
GtkSelectionMode egg_icon_list_get_selection_mode (EggIconList *icon_list);
void egg_icon_list_select_path (EggIconList *icon_list,
GtkTreePath *path);
void egg_icon_list_unselect_path (EggIconList *icon_list,
GtkTreePath *path);
gboolean egg_icon_list_path_is_selected (EggIconList *icon_list,
GtkTreePath *path);
void egg_icon_list_select_all (EggIconList *icon_list);
void egg_icon_list_unselect_all (EggIconList *icon_list);
void egg_icon_list_item_activated (EggIconList *icon_list,
GtkTreePath *path);
EggIconListItem * egg_icon_list_item_new (GdkPixbuf *icon,
const gchar *label);
void egg_icon_list_item_ref (EggIconListItem *item);
void egg_icon_list_item_unref (EggIconListItem *item);
void egg_icon_list_item_set_data (EggIconListItem *item,
gpointer data);
void egg_icon_list_item_set_data_full (EggIconListItem *item,
gpointer data,
GDestroyNotify destroy_notify);
gpointer egg_icon_list_item_get_data (EggIconListItem *item);
void egg_icon_list_item_set_label (EggIconListItem *item,
const char *label);
G_CONST_RETURN gchar *egg_icon_list_item_get_label (EggIconListItem *item);
void egg_icon_list_item_set_icon (EggIconListItem *item,
GdkPixbuf *icon);
GdkPixbuf * egg_icon_list_item_get_icon (EggIconListItem *item);
void egg_icon_list_append_item (EggIconList *icon_list,
EggIconListItem *item);
void egg_icon_list_prepend_item (EggIconList *icon_list,
EggIconListItem *item);
void egg_icon_list_insert_item_before (EggIconList *icon_list,
EggIconListItem *sibling,
EggIconListItem *item);
void egg_icon_list_insert_item_after (EggIconList *icon_list,
EggIconListItem *sibling,
EggIconListItem *item);
void egg_icon_list_remove_item (EggIconList *icon_list,
EggIconListItem *item);
void egg_icon_list_clear (EggIconList *icon_list);
EggIconListItem * egg_icon_list_get_item_at_pos (EggIconList *icon_list,
gint x,
gint y);
gint egg_icon_list_get_item_count (EggIconList *icon_list);
void egg_icon_list_foreach (EggIconList *icon_list,
EggIconListForeachFunc func,
gpointer data);
GList * egg_icon_list_get_selected (EggIconList *icon_list);
void egg_icon_list_selected_foreach (EggIconList *icon_list,
EggIconListForeachFunc func,
gpointer data);
void egg_icon_list_set_selection_mode (EggIconList *icon_list,
GtkSelectionMode mode);
GtkSelectionMode egg_icon_list_get_selection_mode (EggIconList *icon_list);
void egg_icon_list_select_item (EggIconList *icon_list,
EggIconListItem *item);
void egg_icon_list_unselect_item (EggIconList *icon_list,
EggIconListItem *item);
gboolean egg_icon_list_item_is_selected (EggIconListItem *item);
void egg_icon_list_select_all (EggIconList *icon_list);
void egg_icon_list_unselect_all (EggIconList *icon_list);
void egg_icon_list_set_sorted (EggIconList *icon_list,
gboolean sorted);
gboolean egg_icon_list_get_sorted (EggIconList *icon_list);
void egg_icon_list_set_sort_func (EggIconList *icon_list,
EggIconListItemCompareFunc func,
gpointer data,
GDestroyNotify destroy_notify);
void egg_icon_list_set_sort_order (EggIconList *icon_list,
GtkSortType order);
GtkSortType egg_icon_list_get_sort_order (EggIconList *icon_list);
void egg_icon_list_item_activated (EggIconList *icon_list,
EggIconListItem *item);
/* For accessibility */
GList *egg_icon_list_get_items (EggIconList *icon_list);
G_END_DECLS G_END_DECLS