2001-03-19 Christopher James Lahey <clahey@ximian.com> * configure.in: Upped the version number to 0.5.99.4. * Merged branch: 2001-03-18 Christopher James Lahey <clahey@ximian.com> * gal/widgets/e-selection-model.c, gal/widgets/e-selection-model.h: Added another semi-private function (e_selection_model_change_cursor.) 2001-03-18 Christopher James Lahey <clahey@ximian.com> * gal/widgets/e-selection-model.c, gal/widgets/e-selection-model.h: Added a couple of semi-private functions (e_selection_model_change_one_row and e_selection_model_confirm_row_count.) 2001-03-18 Christopher James Lahey <clahey@ximian.com> * tests/test-tree-1.c, tests/test-tree-3.c: Added arguments for e_tree_memory_callbacks_new of get_save_id and has_save_id to NULL. 2001-03-17 Christopher James Lahey <clahey@ximian.com> * gal/util/e-util.c (e_sort): Switched to just using qsort directly here. 2001-03-17 Christopher James Lahey <clahey@ximian.com> * gal/util/e-util.c, gal/util/e-util.h (e_bsearch, e_sort): Added e_sort and e_bsearch. They both take a closure. e_sort guarantees a stable sort. e_bsearch returns the range of matching elements including the position where an object would be if there are no matching elements. 2001-03-16 Christopher James Lahey <clahey@ximian.com> * gal/Makefile.am (libgal_la_LIBADD): Added e-tree-sorted.lo. 2001-03-14 Christopher James Lahey <clahey@ximian.com> * gal/widgets/e-selection-model-simple.c, gal/widgets/e-selection-model-simple.h: Replaced the methods insert_row and delete_row with insert_rows and delete_rows. * gal/widgets/e-selection-model.c, gal/widgets/e-selection-model.h: Replaced the methods insert_row and delete_row with insert_rows and delete_rows. 2001-03-08 Christopher James Lahey <clahey@ximian.com> * Makefile.am: Added e-table/e-table-utils.lo, e-table/e-tree-memory-callbacks.lo, e-table/e-tree-memory.lo, e-table/e-tree-scrolled.lo, e-table/e-tree-table-adapter.lo, and e-table/e-tree.lo. Removed e-table/e-tree-simple.lo. * gal/util/e-util.c, gal/util/e-util.h: Added a whole bunch of e_marshal functions for ETree. * tests/test-tree-1.c, tests/test-tree-3.c: Reworked these to use the new tree stuff. End of branch svn path=/trunk/; revision=8840
101 lines
2.5 KiB
C
101 lines
2.5 KiB
C
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
|
|
/*
|
|
* e-selection-model-simple.c: a Table Selection Model
|
|
*
|
|
* Author:
|
|
* Christopher James Lahey <clahey@ximian.com>
|
|
*
|
|
* (C) 2000, 2001 Ximian, Inc.
|
|
*/
|
|
#include <config.h>
|
|
#include <gal/util/e-util.h>
|
|
#include "e-selection-model-simple.h"
|
|
|
|
#define ESMS_CLASS(e) ((ESelectionModelSimpleClass *)((GtkObject *)e)->klass)
|
|
|
|
#define PARENT_TYPE e_selection_model_get_type ()
|
|
|
|
static ESelectionModel *parent_class;
|
|
|
|
static gint esms_get_row_count (ESelectionModel *esm);
|
|
|
|
static void
|
|
e_selection_model_simple_init (ESelectionModelSimple *selection)
|
|
{
|
|
selection->row_count = 0;
|
|
}
|
|
|
|
static void
|
|
e_selection_model_simple_class_init (ESelectionModelSimpleClass *klass)
|
|
{
|
|
ESelectionModelClass *esm_class;
|
|
|
|
parent_class = gtk_type_class (PARENT_TYPE);
|
|
|
|
esm_class = E_SELECTION_MODEL_CLASS(klass);
|
|
|
|
esm_class->get_row_count = esms_get_row_count;
|
|
}
|
|
|
|
E_MAKE_TYPE(e_selection_model_simple, "ESelectionModelSimple", ESelectionModelSimple,
|
|
e_selection_model_simple_class_init, e_selection_model_simple_init, PARENT_TYPE);
|
|
|
|
/**
|
|
* e_selection_model_simple_new
|
|
*
|
|
* This routine creates a new #ESelectionModelSimple.
|
|
*
|
|
* Returns: The new #ESelectionModelSimple.
|
|
*/
|
|
ESelectionModelSimple *
|
|
e_selection_model_simple_new (void)
|
|
{
|
|
return gtk_type_new (e_selection_model_simple_get_type ());
|
|
}
|
|
|
|
void
|
|
e_selection_model_simple_set_row_count (ESelectionModelSimple *esms,
|
|
int row_count)
|
|
{
|
|
if (esms->row_count != row_count) {
|
|
ESelectionModel *esm = E_SELECTION_MODEL(esms);
|
|
g_free(esm->selection);
|
|
esm->selection = NULL;
|
|
esm->row_count = -1;
|
|
}
|
|
esms->row_count = row_count;
|
|
}
|
|
|
|
static gint
|
|
esms_get_row_count (ESelectionModel *esm)
|
|
{
|
|
ESelectionModelSimple *esms = E_SELECTION_MODEL_SIMPLE(esm);
|
|
|
|
return esms->row_count;
|
|
}
|
|
|
|
void e_selection_model_simple_insert_rows (ESelectionModelSimple *esms,
|
|
int row,
|
|
int count)
|
|
{
|
|
esms->row_count += count;
|
|
e_selection_model_insert_rows (E_SELECTION_MODEL(esms), row, count);
|
|
}
|
|
|
|
void
|
|
e_selection_model_simple_delete_rows (ESelectionModelSimple *esms,
|
|
int row,
|
|
int count)
|
|
{
|
|
esms->row_count -= count;
|
|
e_selection_model_delete_rows (E_SELECTION_MODEL(esms), row, count);
|
|
}
|
|
|
|
void
|
|
e_selection_model_simple_move_row (ESelectionModelSimple *esms,
|
|
int old_row,
|
|
int new_row)
|
|
{
|
|
e_selection_model_move_row (E_SELECTION_MODEL(esms), old_row, new_row);
|
|
}
|