diff options
author | Christopher James Lahey <clahey@ximian.com> | 2001-03-25 16:17:15 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2001-03-25 16:17:15 +0800 |
commit | 1190e292f4e32be10c45ffd92e36eb62e8592a53 (patch) | |
tree | 51b03058290b93f1a416764c36b6159cc778723f /widgets/misc/e-selection-model.h | |
parent | 2ed07fe856571d969c17c944e1fdb16740252b95 (diff) | |
download | gsoc2013-evolution-1190e292f4e32be10c45ffd92e36eb62e8592a53.tar.gz gsoc2013-evolution-1190e292f4e32be10c45ffd92e36eb62e8592a53.tar.zst gsoc2013-evolution-1190e292f4e32be10c45ffd92e36eb62e8592a53.zip |
Added e-selection-model-array.lo.
2001-03-25 Christopher James Lahey <clahey@ximian.com>
* gal/Makefile.am (libgal_la_LIBADD): Added
e-selection-model-array.lo.
* gal/widgets/Makefile.am: Added e-selection-model-array.c and
e-selection-model-array.h.
* gal/widgets/e-selection-model-array.c,
gal/widgets/e-selection-model-array.h: New class that implements
the details of ESelectionModel. ESelectionModel has been
refactored to just be a this virtual class. ESelectionModelArray
is the original implementation of ESelectionModel. This is what
most people will want to use or derive from.
* gal/widgets/e-selection-model-simple.c,
gal/widgets/e-selection-model-simple.h: Made the parent class of
this be ESelectionModelArray instead of ESelectionModel. Changed
some function names to match this change.
* gal/widgets/e-selection-model.c,
gal/widgets/e-selection-model.h: Refactored most of the
implementation of this class into ESelectionModelArray. Now just
a thin virtual class.
From gal/e-table/ChangeLog:
2001-03-25 Christopher James Lahey <clahey@ximian.com>
* e-table-selection-model.c, e-table-selection-model.h: Made the
parent object of this be ESelectionModelArray instead of
ESelectionModel due to their refactoring. Changed the commented
out code for saving the selection a bit.
svn path=/trunk/; revision=8924
Diffstat (limited to 'widgets/misc/e-selection-model.h')
-rw-r--r-- | widgets/misc/e-selection-model.h | 99 |
1 files changed, 56 insertions, 43 deletions
diff --git a/widgets/misc/e-selection-model.h b/widgets/misc/e-selection-model.h index 5ba0411587..3fb027e1a7 100644 --- a/widgets/misc/e-selection-model.h +++ b/widgets/misc/e-selection-model.h @@ -31,20 +31,6 @@ typedef struct { ESorter *sorter; - gint row_count; - guint32 *selection; - - gint cursor_row; - gint cursor_col; - gint selection_start_row; - - guint model_changed_id; - guint model_row_inserted_id, model_row_deleted_id; - - guint frozen : 1; - guint selection_model_changed : 1; - guint group_info_changed : 1; - GtkSelectionMode mode; ECursorMode cursor_mode; } ESelectionModel; @@ -52,58 +38,85 @@ typedef struct { typedef struct { GtkObjectClass parent_class; - gint (*get_row_count) (ESelectionModel *selection); + /* Virtual methods */ + gboolean (*is_row_selected) (ESelectionModel *esm, int row); + void (*foreach) (ESelectionModel *esm, EForeachFunc callback, gpointer closure); + void (*clear) (ESelectionModel *esm); + gint (*selected_count) (ESelectionModel *esm); + void (*select_all) (ESelectionModel *esm); + void (*invert_selection) (ESelectionModel *esm); + int (*row_count) (ESelectionModel *esm); + + /* Protected virtual methods. */ + void (*change_one_row) (ESelectionModel *esm, int row, gboolean on); + void (*change_cursor) (ESelectionModel *esm, int row, int col); + int (*cursor_row) (ESelectionModel *esm); + int (*cursor_col) (ESelectionModel *esm); + + void (*select_single_row) (ESelectionModel *selection, int row); + void (*toggle_single_row) (ESelectionModel *selection, int row); + void (*move_selection_end) (ESelectionModel *selection, int row); + void (*set_selection_end) (ESelectionModel *selection, int row); /* * Signals */ - void (*cursor_changed) (ESelectionModel *selection, int row, int col); - void (*cursor_activated) (ESelectionModel *selection, int row, int col); - void (*selection_changed) (ESelectionModel *selection); + void (*cursor_changed) (ESelectionModel *esm, int row, int col); + void (*cursor_activated) (ESelectionModel *esm, int row, int col); + void (*selection_changed) (ESelectionModel *esm); } ESelectionModelClass; + GtkType e_selection_model_get_type (void); -gboolean e_selection_model_is_row_selected (ESelectionModel *selection, - gint n); -void e_selection_model_foreach (ESelectionModel *selection, - EForeachFunc callback, - gpointer closure); -void e_selection_model_do_something (ESelectionModel *selection, +void e_selection_model_do_something (ESelectionModel *esm, guint row, guint col, GdkModifierType state); -void e_selection_model_maybe_do_something (ESelectionModel *selection, +void e_selection_model_maybe_do_something (ESelectionModel *esm, guint row, guint col, GdkModifierType state); -gint e_selection_model_key_press (ESelectionModel *selection, +gint e_selection_model_key_press (ESelectionModel *esm, GdkEventKey *key); -void e_selection_model_clear (ESelectionModel *selection); -gint e_selection_model_selected_count (ESelectionModel *selection); -void e_selection_model_select_all (ESelectionModel *selection); -void e_selection_model_invert_selection (ESelectionModel *selection); -/* Private Functions */ -void e_selection_model_insert_rows (ESelectionModel *esm, - int row, - int count); -void e_selection_model_delete_rows (ESelectionModel *esm, - int row, - int count); -void e_selection_model_move_row (ESelectionModel *esm, - int old_row, - int new_row); +/* Virtual functions */ +gboolean e_selection_model_is_row_selected (ESelectionModel *esm, + gint n); +void e_selection_model_foreach (ESelectionModel *esm, + EForeachFunc callback, + gpointer closure); +void e_selection_model_clear (ESelectionModel *esm); +gint e_selection_model_selected_count (ESelectionModel *esm); +void e_selection_model_select_all (ESelectionModel *esm); +void e_selection_model_invert_selection (ESelectionModel *esm); +int e_selection_model_row_count (ESelectionModel *esm); + + +/* Private virtual Functions */ void e_selection_model_change_one_row (ESelectionModel *esm, int row, gboolean on); void e_selection_model_change_cursor (ESelectionModel *esm, + int row, + int col); +int e_selection_model_cursor_row (ESelectionModel *esm); +int e_selection_model_cursor_col (ESelectionModel *esm); +void e_selection_model_select_single_row (ESelectionModel *selection, + int row); +void e_selection_model_toggle_single_row (ESelectionModel *selection, + int row); +void e_selection_model_move_selection_end (ESelectionModel *selection, + int row); +void e_selection_model_set_selection_end (ESelectionModel *selection, int row); -gboolean e_selection_model_confirm_row_count (ESelectionModel *esm); -/* Virtual Function */ -gint e_selection_model_get_row_count (ESelectionModel *esm); +/* Signals */ +void e_selection_model_cursor_changed (ESelectionModel *selection, + int row, + int col); +void e_selection_model_selection_changed (ESelectionModel *selection); #ifdef __cplusplus } |