aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-tree-model.c
Commit message (Collapse)AuthorAgeFilesLines
* Upped the version number to 0.6.99.0. Upped the so number to 6.Christopher James Lahey2001-04-131-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-04-12 Christopher James Lahey <clahey@ximian.com> * configure.in: Upped the version number to 0.6.99.0. Upped the so number to 6. * docs/etablexml.txt: Made some updates here. * tests/test-tree-1.c, tests/test-tree-3.c: Added NULL, NULL to the call to e_tree_memory_callbacks_new. From gal/e-table/ChangeLog: 2001-04-12 Christopher James Lahey <clahey@ximian.com> * e-table-item.c (eti_cursor_change): Only move the screen to show the cursor if there are no changes pending. Updated the commented out code for alternating colors a bit. * e-table-model.c, e-table-model.h: Added e_table_model_has_change_pending. * e-tree-memory-callbacks.c, e-tree-memory-callbacks.h: Added has_get_node_by_id and get_node_by_id. * e-tree-model.c, e-tree-model.h: Added e_tree_model_has_get_node_by_id and e_tree_model_get_node_by_id. Added e_tree_model_has_change_pending. * e-tree-selection-model.c: Handle the selection and cursor properly across the tree changing. * e-tree-sorted.c: Implemented has_get_node_by_id and get_node_by_id, and has_changes_pending. * e-tree-table-adapter.c: Implemented has_changes_pending. Fixed an array underflow. svn path=/trunk/; revision=9289
* Fix headers. Ditto. Ditto. Ditto. Ditto. Ditto. Ditto. Ditto. Ditto.Kjartan Maraas2001-04-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-04-04 Kjartan Maraas <kmaraas@gnome.org> * e-cell-date.c: Fix headers. * e-cell-number.c: Ditto. * e-cell-pixbuf.[ch]: Ditto. * e-cell-size.c: Ditto. * e-cell-text.c: Ditto. * e-cell-tree.c: Ditto. * e-table-click-to-add.[ch]: Ditto. * e-table-column-specification.h: Ditto. * e-table-config-field.c: Ditto. * e-table-config.[ch]: Ditto. * e-table-example-2.c: Ditto. * e-table-field-chooser-dialog.[ch]: Ditto. * e-table-field-chooser-item.c: Ditto. * e-table-field-chooser.h: Ditto. * e-table-group-container.c: Ditto. * e-table-item.c: Ditto * e-table-memory.c: Ditto. * e-table-selection-model.c: Ditto. * e-table-sorter.c: Ditto. * e-table-subset-variable.c: Ditto. * e-table.c: Ditto. * e-tree-memory.c: Ditto. * e-tree-model.c: Ditto. * e-tree-selection-model.[ch]: Ditto. * e-tree-sorted-variable.c: Ditto. * e-tree-sorted.c: Ditto. * e-tree-table-adapter.c: Ditto. * e-tree.[ch]: Same here. svn path=/trunk/; revision=9164
* Add argument to get the table adapter. (et_set_arg): Add arguments forRichard Hult2001-04-041-0/+66
| | | | | | | | | | | | | | | 2001-04-03 Richard Hult <rhult@codefactory.se> * e-tree.c (et_get_arg): Add argument to get the table adapter. (et_set_arg): Add arguments for setting drawing of the grid and focus. * e-tree-model.c, e-tree-model.h (e_tree_model_node_traverse): Fill in missing implementation. (e_tree_model_node_traverse_preorder): Likewise, but preorder traversal. svn path=/trunk/; revision=9156
* Updated these to match the new e_tree_model_node_removed signal.Christopher James Lahey2001-03-271-4/+4
| | | | | | | | | | | | | | | | 2001-03-26 Christopher James Lahey <clahey@ximian.com> * e-tree-memory.c, e-tree-table-adapter.c: Updated these to match the new e_tree_model_node_removed signal. * e-tree-model.c, e-tree-model.h: Added an old_position parameter to the node_removed signal so that it would be completely deterministic. * e-tree-sorted.c: Changed this so that paths keep track of their original position. This makes sorting much faster. svn path=/trunk/; revision=8953
* Deal with proxy_node_changed being called on a different root node thanChristopher James Lahey2001-03-201-1412/+343
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-03-19 Christopher James Lahey <clahey@ximian.com> * e-tree-sorted.c (ets_proxy_node_changed): Deal with proxy_node_changed being called on a different root node than the one we have in our tree. * e-tree-table-adapter.c: Did some general clean up here. * Merged branch: 2001-03-19 Christopher James Lahey <clahey@ximian.com> * e-tree-sorted.c (find_child_path): Added this function to allow us to find paths that have been removed from the source. (ets_proxy_node_removed): Fixed the memmove here a bit. Call find_child_path. * e-tree-table-adapter.c (find_node): Check that the passed in path isn't NULL. 2001-03-19 Christopher James Lahey <clahey@ximian.com> * e-table-item.c (eti_reflow): Get width from header object instead of calculating it ourselves. * e-table-selection-model.c: Turn off selection saving since it's so slow. * e-table.c (e_table_set_state_object): Set the width of the newly created header object. * e-tree.c (e_tree_set_state_object): Set the width of the newly created header object. (tree_canvas_size_allocate): Don't bother setting the dimensions of the white background twice. 2001-03-18 Christopher James Lahey <clahey@ximian.com> * e-table-selection-model.c, e-table-selection-model.h: Made ETableSelectionModel save the cursor properly across changed signals if has_save_id is true. 2001-03-18 Christopher James Lahey <clahey@ximian.com> * e-table-selection-model.c, e-table-selection-model.h: Made ETableSelectionModel save selection properly across changed signals if has_save_id is true. * e-tree-memory.c: A couple of typos. 2001-03-18 Christopher James Lahey <clahey@ximian.com> * e-tree-memory.c, e-tree-sorted.c: Send pre_changes properly. 2001-03-18 Christopher James Lahey <clahey@ximian.com> * e-tree-table-adapter.c: Send pre_changes when performing set_expanded or root_node_set_visible. 2001-03-18 Christopher James Lahey <clahey@ximian.com> * e-tree-sorted.c (ets_is_expandable): When the API requests whether the object is expandable and it isn't, make sure to send a signal when it becomes expandable. * e-tree-table-adapter.c: Made it so that in a number of cases where it doesn't need to create an empty hash table node if the current tree node has no children, it doesn't. 2001-03-18 Christopher James Lahey <clahey@ximian.com> * e-tree-memory-callbacks.c, e-tree-memory-callbacks.h (etmc_has_save_id, etmc_get_save_id): Added has_save_id and get_save_id to the list of methods supported by e_tree_memory_callbacks. * e-tree-table-adapter.c, e-tree-table-adapter.h: Added saving of expanded nodes. 2001-03-18 Christopher James Lahey <clahey@ximian.com> * e-table-model.c, e-table-model.h (e_table_model_get_save_id): Changed row_save_id to get_save_id to be consistent with ETree. * e-tree-model.c, e-tree-model.h: Added "pre_change" signal. Added has_save_id and get_save_id methods. * e-tree-sorted.c: Proxy pre_change signal. Implemented has_save_id and get_save_id. If the base model doesn't provide has_save_id then we g_strdup_printf the pointer of the base model ETreePath as the save_id. * e-tree-table-adapter.c: Proxy pre_change signal. If base model has_save_id, then use the results of get_save_id as the key for the hash table of node attributes. Otherwise use the pointer as before. 2001-03-17 Christopher James Lahey <clahey@ximian.com> * e-tree-sorted.c (ets_sort_idle): Fixed it so that all nodes get sorted properly instead of just the top node. 2001-03-17 Christopher James Lahey <clahey@ximian.com> * e-table-sorting-utils.c (e_table_sorting_utils_tree_sort): Made tree sorting faster by using a cache. * e-tree-sorted.c: Added commented out debugging g_prints. 2001-03-17 Christopher James Lahey <clahey@ximian.com> * e-tree-sorted.c: Switched to using GMemChunks. 2001-03-17 Christopher James Lahey <clahey@ximian.com> * e-tree-sorted.c (resort_node): Made it so that children of a node that's being sorted don't send changed signals. 2001-03-17 Christopher James Lahey <clahey@ximian.com> * e-table-sorting-utils.c, e-table-sorting-utils.h: Switched to using e_sort and e_search instead of qsort and a linear search. Added the tree functions e_table_sorting_utils_tree_sort, e_table_sorting_utils_tree_check_position, and e_table_sorting_utils_tree_insert. * e-tree-sorted.c: Made this actually do sorting. * e-tree-table-adapter.c (etta_proxy_node_changed): The old_size needs to be the number of visible children + 1 to include the top node. * e-tree.c (e_tree_set_state_object): Set the sort_info on the ETreeSorted when you get a new sort_info. 2001-03-16 Christopher James Lahey <clahey@ximian.com> * Makefile.am: Added e-tree-sorted.c and e-tree-sorted.h. * e-table-item.c (eti_realize_cell_views): Only realize the cells if they're not realized already and if the canvas is realized. * e-table-sorted.c (ets_proxy_model_cell_changed): Matched the change to the signature of e_table_sorting_utils_affects_sort. * e-table-sorting-utils.c, e-table-sorting-utils.h (e_table_sorting_utils_affects_sort): Changed the signature of this function to not take the ETableModel source since it doesn't use it and we need to use this function for ETreeSorted which doesn't have an ETableModel. * e-tree-memory.c (etmm_get_expanded_default): Actually implement the get_expanded_default for this tree. * e-tree-model.h: Cleaned up the indentation here. * e-tree-sorted.c, e-tree-sorted.h: New class meant to be used for sorting trees. It doesn't actually sort yet. It simply acts as an ETreeProxy which is the hardest part of making ETreeSorted. * e-tree.c, e-tree.h: Made this use an ETreeSorted. 2001-03-14 Christopher James Lahey <clahey@ximian.com> * e-table-item.c, e-table-item.h, e-table-selection-model.c, e-table-selection-model.h, e-table-sorted.c, e-table-sorted.h, e-table-subset.c, e-table-subset.h, e-table.c, e-table.h: Switch to handling e_table_model_rows_inserted instead of e_table_model_row_inserted and e_table_model_rows_deleted instead of e_table_model_row_deleted. * e-table-model.c, e-table-model.h: Replaced the signals "model_row_inserted" and "model_row_deleted" with "model_rows_inserted" and "model_rows_deleted" so that when multiple rows are inserted or deleted at the same time they can be handled properly. * e-tree-table-adapter.c: Call "model_rows_inserted" and "model_rows_deleted" instead of "model_changed" when inserting or deleting multiple rows. 2001-03-14 Christopher James Lahey <clahey@ximian.com> * e-table-item.c (e_table_item_row_diff): Made this not count the pixel between rows if it isn't there. 2001-03-14 Christopher James Lahey <clahey@ximian.com> * e-table-item.c (eti_header_structure_changed): Properly attach & realize cell views here. 2001-03-13 Christopher James Lahey <clahey@ximian.com> * e-tree-table-adapter.c (etta_proxy_node_removed): Check that parent_node and parent aren't NULL before making function calls on them. 2001-03-13 Christopher James Lahey <clahey@ximian.com> * e-table-item.c (confirm_height_cache): Fixed a height cache miscalculation. * e-tree-table-adapter.c (find_first_child_node): Made the semantics of this mean that find_first_child_node(adapter, -1) means return the first node in the tree. 2001-03-13 Christopher James Lahey <clahey@ximian.com> * e-table-extras.c: Added a "string-integer" comparison function to the default %ETableExtras so you can do comparisons based on integer value even if you using strings for the data (this lets you do editable numbers, for instance.) * e-table-item.c: Rearranged it a bit so that if you have draw_grid off it doesn't add space for the horizontal lines, nor leave them the background color. * e-table-model.c, e-table-model.h: Added the row_save_id and has_save_id methods to %ETableModel. * e-tree.c, e-tree.h: Replaced e_tree_compute_location with e_tree_get_cell_at. 2001-03-08 Christopher James Lahey <clahey@ximian.com> * Makefile.am: Added e-table/e-table-utils.c, e-table/e-tree-memory-callbacks.c, e-table/e-tree-memory.c, e-table/e-tree-scrolled.c, e-table/e-tree-table-adapter.c, and e-table/e-tree.c. Removed e-table/e-tree-simple.c. Added e-table/e-table-utils.h, e-table/e-tree-memory-callbacks.h, e-table/e-tree-memory.h, e-table/e-tree-scrolled.h, e-table/e-tree-table-adapter.h, and e-table/e-tree.h. Removed e-table/e-tree-simple.h. * e-cell-tree.c: Updated this for the new tree. * e-table-item.c: Added some redraw requests where appropriate. * e-table-item.h: Fixed an incorrect class method declaration. * e-table-model.c, e-table-model.h: Removed e_table_model_has_sort_group and e_table_model_row_sort_group. * e-table-scrolled.h: Removed unused headers. * e-table-simple.c, e-table-simple.h: Rearranged this a bit. * e-table-sorter.c, e-table-sorting-utils.c, e-table-sorting-utils.h: Removed sort group stuff. Added the function e_table_sorting_utils_check_position. * e-table-utils.c, e-table-utils.h: Utility functions for ETable and ETree. * e-table.c: Moved some of the functionality from here to e-table-utils.c so that it can be reused by ETree. * e-tree-memory-callbacks.c, e-tree-memory-callbacks.h: Class to implement an ETreeMemory as callbacks instead of overriding the class. * e-tree-memory.c, e-tree-memory.h: ETreeModel that stores a tree of physical nodes. * e-tree-model.c, e-tree-model.h: Removed most of the functionality from here to the classes ETreeMemory and ETreeTableAdapter. This is now just a simple virtualized tree class. * e-tree-scrolled.c, e-tree-scrolled.h: New class. An ETree in an EScrollFrame. * e-tree-simple.c: Small change. This is no longer used. * e-tree-table-adapter.c, e-tree-table-adapter.h: ETableModel that represents an ETreeModel as a table. * e-tree.c, e-tree.h: New super class kind of like ETable but for trees. End of branch svn path=/trunk/; revision=8837
* Doh!Chris Lahey2001-02-231-10/+10
| | | | svn path=/trunk/; revision=8362
* Added a bunch of g_return_if_fails.Christopher James Lahey2001-02-231-7/+78
| | | | | | | | 2001-02-22 Christopher James Lahey <clahey@ximian.com> * e-tree-model.c: Added a bunch of g_return_if_fails. svn path=/trunk/; revision=8360
* add some more (mostly empty) api docs. (e_tree_model_node_changed): passChris Toshok2001-02-201-2/+355
| | | | | | | | | | | | 2001-02-20 Chris Toshok <toshok@ximian.com> * e-tree-model.c: add some more (mostly empty) api docs. (e_tree_model_node_changed): pass the node in the "node_changed" signal. (etree_destroy): e_tree_model_node_remove our root node here to free up the tree's storage. svn path=/trunk/; revision=8302
* Added this function. Made frozen an int so that recursive freezes andChristopher James Lahey2001-02-091-8/+24
| | | | | | | | | | 2001-02-08 Christopher James Lahey <clahey@ximian.com> * e-tree-model.c, e-tree-model.h (e_tree_model_show_node): Added this function. Made frozen an int so that recursive freezes and thaws behaves properly. svn path=/trunk/; revision=8106
* Step 2Miguel de Icaza2001-01-161-1/+1
| | | | svn path=/trunk/; revision=7521
* Rename from Helix Code -> XimianMiguel de Icaza2001-01-161-1/+1
| | | | svn path=/trunk/; revision=7520
* Move the correct offset when memmoving. Patch provided by Richard HultJP Rosevear2000-12-051-1/+1
| | | | | | | | | | 2000-12-05 JP Rosevear <jpr@helixcode.com> * e-tree-model.c (e_tree_model_node_remove): Move the correct offset when memmoving. Patch provided by Richard Hult <rhult@hem.passagen.se>. svn path=/trunk/; revision=6795
* Updated version number.Christopher James Lahey2000-11-141-15/+20
| | | | | | | | | | | | | 2000-11-13 Christopher James Lahey <clahey@helixcode.com> * configure.in: Updated version number. * gal/e-table/e-tree-model.c, gal/e-table/e-tree-model.h: Added freeze and thaw functions. * gal/menus/gal-define-views-dialog.c: Fixed some warnings. svn path=/trunk/; revision=6563
* Since we insert at the parent->child position, we need to account forNot Zed2000-11-031-39/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-11-03 Not Zed <NotZed@HelixCode.com> * e-tree-model.c (e_tree_model_node_insert): Since we insert at the parent->child position, we need to account for expanded nodes above this node to properly calculate the absolute row position of the node. (e_tree_model_node_insert): If we're inserting at the end of this node, then we just use the position directly. (e_tree_model_node_remove): Completely rewritten. Now we delete all nodes at once, which should be >> faster, unfortunately still have to signal each removal, which is >> SLOW :( Its still about 2-3x faster than it was (for 25K nodes). (child_free): Free all data/subnodes of a given path, no unlinking. (e_tree_model_node_remove): If we are removing a lot of nodes [>1000 or >1/4 total nodes], then use model_changed, rather then removing each node. Yay. Now its about 500x faster than it was, for 25K nodes. (etree_pre_change): Signal handler, so we can find out when we are in a pre-change state. (etree_changed): Likewise to find when we have finished. (e_tree_model_construct): Link to the model*changed signals so we know when we are in pre/changed state. (e_tree_model_node_insert): Only perform a row_inserted if not in pre_change state. Another significant speed improvement (200-500%) on big trees. (e_tree_model_node_remove): Do not emit row_deleted (or model_changed), if we are in the pre_change state. (add_visible_descendents_to_array): Likewise for row_inserted. (e_tree_model_node_sort): And here too, for consistency. svn path=/trunk/; revision=6363
* Updated these unused glade files to better match the versions in the code.Christopher James Lahey2000-11-031-1/+1
| | | | | | | | | | | | | | 2000-11-02 Christopher James Lahey <clahey@helixcode.com> * e-table-config.glade, e-table-config.glade.h: Updated these unused glade files to better match the versions in the code. * e-table.c, e-table.h: Added e_table_selected_count and "selection_change" signal. * e-tree-model.c: Fixed an out of order svn path=/trunk/; revision=6354
* If we are inserting into the root level, we dont have to search the wholeNot Zed2000-10-271-1/+6
| | | | | | | | | | 2000-10-27 Not Zed <NotZed@HelixCode.com> * e-tree-model.c (e_tree_model_node_insert): If we are inserting into the root level, we dont have to search the whole array for a parent node we'll never find. svn path=/trunk/; revision=6218
* remove the save_id here, so we don't save state for nodes that no longerChris Toshok2000-10-261-9/+6
| | | | | | | | | | | | | 2000-10-25 Chris Toshok <toshok@helixcode.com> * e-tree-model.c (e_tree_model_node_remove): remove the save_id here, so we don't save state for nodes that no longer exist. (etree_destroy): remove the foreach, since all the save_id's should have been removed by now (don't destroy a tree without destroying the root node.) also, make sure to call g_hash_table_destroy. svn path=/trunk/; revision=6202
* make ETreeModel opaque, and switch from using g_new0 and g_free forChris Toshok2000-10-251-88/+130
| | | | | | | | | | | | | | | 2000-10-24 Chris Toshok <toshok@helixcode.com> * e-tree-model.c: make ETreeModel opaque, and switch from using g_new0 and g_free for ETreePath's to using g_mem_chunk routines. (e_tree_model_node_remove): free the path's save_id. * (e_tree_model_set_expanded_default): add method to add default expanded status for parent nodes. (etree_set_expanded_recurse): make this more efficient. e-tree-model.h: make ETreeModel opaque. add prototype for e_tree_model_set_expanded_default. svn path=/trunk/; revision=6156
* get the next child before traversing/calling func.Chris Toshok2000-10-161-2/+5
| | | | | | | | | 2000-10-15 Chris Toshok <toshok@helixcode.com> * e-tree-model.c (e_tree_model_node_traverse): get the next child before traversing/calling func. svn path=/trunk/; revision=5937
* get rid of ENode type, as everything in it is now in ETreePath, and addChris Toshok2000-10-161-125/+235
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-10-15 Chris Toshok <toshok@helixcode.com> * e-tree-model.c: get rid of ENode type, as everything in it is now in ETreePath, and add parent/sibling/child pointers to ETreePath. everywhere where GNode/ENode were used, we just use ETreePath now. (e_tree_path_depth): new function. (e_tree_path_insert): new function. (e_tree_path_unlink): new function. (e_tree_model_node_traverse): new function. (etree_get_first_child): new virtual function impl. (etree_get_last_child): same. (e_tree_model_class_init): fill in function pointers for get_first_child/get_last_child. (e_tree_model_node_get_first_child): new function. (e_tree_model_node_get_last_child): new function. (e_tree_model_node_depth): g_node_depth -> e_tree_path_depth. (e_tree_model_node_insert): modify to use ETreePath and new e_tree_path functions. Prepends and appends are now both constant time. (child_remove): modify for e_tree_model_node_traverse. (e_tree_model_node_remove): same, and use e_tree_path functions. (e_tree_model_node_insert_before): add a loop here to figure out the position, since it's the only place we care about the child position. (e_tree_model_node_sort): rework to accomodate new e_tree_path functions, and put the e_tree_model_node_set_expanded calls in a separate loop after all the children have been added. * e-tree-model.h: add prototypes and virtual functions for more tree traversal operations (get_first_child, get_last_child), as well as a new function to traverse depth first the descendents of a node (e_tree_model_node_traverse), much like g_node_traverse (G_IN_ORDER). Also, ETreePath is an opaque type now, and is not a GNode. svn path=/trunk/; revision=5932
* Changed these to match the new ETable system.Christopher James Lahey2000-10-111-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-10-11 Christopher James Lahey <clahey@helixcode.com> * tests/test-tree-1.c, tests/test-tree-2.c, tests/test-tree-3.c: Changed these to match the new ETable system. * gal/Makefile.am: Added e-table-column-specification.lo, e-table-extras.lo, e-table-specification.lo, and e-table-state.lo. From gal/e-table/ChangeLog: 2000-10-11 Christopher James Lahey <clahey@helixcode.com> * Makefile.am: Added e-table-column-specification.c, e-table-column-specification.h, e-table-extras.c, e-table-extras.h, e-table-specification.c, e-table-specification.h, e-table-state.c, and e-table-state.h. Removed some duplicated .h files. * e-cell-tree.c: Ref, sink, and unref the subcell instead of destroying it when done. * e-table-column-specification.c, e-table-column-specification.h: New class which describes a column without having a table get instantiated. * e-table-config.c: Changed get_specification to get_state to get this to compile. * e-table-defines.h, e-table-item.h: Moved the definition of ETableCursorMode from e-table-item.h to e-table-defines.h. * e-table-extras.c, e-table-extras.h: New class which acts as a set of 3 hash tables. All from char * and to alternately, ECells, GCompareFuncs, and GdkPxibufs. * e-table-scrolled.c, e-table-scrolled.h: Changed this to match the new ETable function declarations. * e-table-sort-info.c, e-table-sort-info.h: Added functions for saving to and loading from xml. * e-table-specification.c, e-table-specification.h: New class which describes a table without having to instantiate it. * e-table-state.c, e-table-state.h: New class which describes the state of a table without having to instantiate the table. * e-table.c, e-table.h: Changed this to accept both a state and a specification instead of just a specification. You then save only the state. The specification stays exactly the same. Also, you no longer need to pass in an ETableHeader. Most of the information contained in the ETableHeader are in the specification. However you may need to translate some of the strings in the specification to objects. If you need anything other than the builtin choices, you need to create an ETableExtras and pass it in. * e-tree-model.c: Removed an unused variable. svn path=/trunk/; revision=5837
* Changed to take into account the sort group, if the table has one.xNot Zed2000-10-041-1/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-10-04 Not Zed <NotZed@HelixCode.com> * e-table-sorted-variable.c (etsv_add): Changed to take into account the sort group, if the table has one.x (etsv_insert_idle): Clear the insert count if we hit an idle loop. (etsv_sort_idle): Reset the insert count if we perform a sort. (etsv_add): If we are adding a lot (>ETSV_INSERT_MAX) items, without hitting an idle loop, assume we're better off performing a sort instead. Use another idle handler to reset the count. 2000-10-03 Not Zed <NotZed@HelixCode.com> * e-table-sorted-variable.c (etsv_sort_by_group): Sort based on the sort_group stuff. * e-tree-model.c (e_tree_init): Setup the group sort info string. (etree_destroy): And free it. (build_sort_group): Build a string for this node. 2000-09-29 Not Zed <NotZed@HelixCode.com> * e-cell-tree.c (e_cell_tree_get_node): Changed to take the source model, not the tree model. The source model may be a subset, and it needs to remap the rows for us. (ect_draw): (ect_event): (ect_max_width): (ect_print): Changed callers. * e-table-sorted-variable.c (etsv_sort_subset): (etsv_sort_build_subset): (etsv_sort_free_subset): Functions to perfom grouping of sorts for sorts that have row_sort_group returning useful info. (etsv_sort): Use the complex sort routines if we need to. * e-table-model.c (e_table_model_row_sort_group): Return a sort-id for a given row. (e_table_model_has_sort_group): Return if the sort-id provides any useful information. svn path=/trunk/; revision=5705
* change/add prototypes and a typedef for ETreePathCompareFunc.Chris Toshok2000-10-031-44/+90
| | | | | | | | | | | | | | | | | | | | | | 2000-10-02 Chris Toshok <toshok@helixcode.com> * e-tree-model.h: change/add prototypes and a typedef for ETreePathCompareFunc. * e-tree-model.c (e_tree_model_node_set_compare_function): new function, used to set the comparison function for sorted nodes. Eventually sorting entail just calling this function, with the tree maintaining the sort. (e_tree_model_node_sort): use a helper function (e_tree_model_node_compare) to allow the e-tree user's comparison function to take mode reasonable paramaters. also, fix it so the previous expanded state is kept with the node. i can't believe i wrote it the way it originally was. also, don't take the comparison function here. it's set in e_tree_model_node_set_compare_function. svn path=/trunk/; revision=5674
* don't screw things up if we sort a collapsed node.Chris Toshok2000-10-031-2/+5
| | | | | | | | | 2000-10-02 Chris Toshok <toshok@helixcode.com> * e-tree-model.c (e_tree_model_node_sort): don't screw things up if we sort a collapsed node. svn path=/trunk/; revision=5673
* reinstate file.Chris Toshok2000-10-031-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-10-02 Chris Toshok <toshok@helixcode.com> * tree-expanded.xpm: reinstate file. * tree-unexpanded.xpm: same. * e-tree-example-1.c (main): remove calls to e_cursor_*, and don't create pixbufs. let's the tree give us the defaults. * e-tree-model.c (e_tree_model_node_changed): call e_table_model_row_changed on the node's row (if it's visible). (e_tree_model_node_inserted): call e_table_model_row_inserted on the new node's row, if it's visible. (e_tree_model_node_removed): call e_table_model_row_removed on the old node's row, if it was visible. * e-cell-tree.c (e_cell_tree_construct): allow open_pixbuf and closed_pixbuf to be NULL, and default them to the xpm data in rtee-{un}expanded.xpm. (ect_destroy): call gdk_pixbuf_unref on our open/closed pixbufs. * tree-expanded.xpm, tree-unexpanded.xpm: make the + and - a little lighter than straight black. svn path=/trunk/; revision=5660
* add save_state stuff to ETreeModel, and prototypes for the public methods.Chris Toshok2000-09-261-7/+203
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-09-25 Chris Toshok <toshok@helixcode.com> * gal/e-table/e-tree-model.h: add save_state stuff to ETreeModel, and prototypes for the public methods. * gal/e-table/e-tree-model.c: add save_id to the ENode. (expanded_remove_func): new function, iterator to delete the save id's. (etree_destroy): iterate over expanded_state. (etree_set_expanded): if the node has a save id, make sure to update both the collapsed and expanded counts. (e_tree_model_node_insert_id): convenience function that inserts a node and sets its id. (e_tree_model_node_sort): remove extra spew. (save_expanded_state_func): new function, iterator for saving expanded state. (e_tree_model_save_expanded_state): new function. (get_string_value): helper function for loading. (e_tree_model_load_expanded_state): new function. (e_tree_model_node_set_save_id): sets the save id for a node, adding it to the hashtable if it's not already there. if the id was there previously, set the expanded flag of the node accordingly. svn path=/trunk/; revision=5573
* Fix include typo.Ariel Rios2000-09-251-1/+1
| | | | | | | | 2000-09-24 Ariel Rios <ariel@arcavia.com> * e-tree-model.c: Fix include typo. svn path=/trunk/; revision=5566
* fix sorting - need to update the row_array as well as the actual structureChris Toshok2000-09-251-4/+20
| | | | | | | | | | 2000-09-24 Chris Toshok <toshok@helixcode.com> * e-tree-model.c (e_tree_model_node_sort): fix sorting - need to update the row_array as well as the actual structure of the GNodes. svn path=/trunk/; revision=5564
* Moved files, fixed header files and paths - FedericoFederico Mena Quintero2000-09-201-1/+1
| | | | svn path=/trunk/; revision=5513
* Fixed e-table #includes so that it would compile.Chris Lahey2000-09-181-1/+1
| | | | svn path=/trunk/; revision=5482
* add signals/prototypes for e_tree_model_node_collapsed andChris Toshok2000-09-011-8/+56
| | | | | | | | | | | | | | | | | 2000-09-01 Chris Toshok <toshok@helixcode.com> * e-tree-model.h: add signals/prototypes for e_tree_model_node_collapsed and e_tree_model_node_expanded. * e-tree-model.c (etree_set_expanded): emit node_expanded/node_collapsed signals, with node_expanded happening before the expansion so it can much with the children, and collapsed being emitted after. (e_tree_model_row_of_node): remove stupid check, and g_warning. (e_tree_model_node_collapsed): new function. (e_tree_model_node_expanded): new function. svn path=/trunk/; revision=5162
* Remove a ton of (hopefully harmless) warnings from the ETable code.Ettore Perazzoli2000-08-281-0/+3
| | | | svn path=/trunk/; revision=5081
* Moved drawing of the cell backgrounds from ECell into ETableItem.Christopher James Lahey2000-08-221-0/+1
| | | | | | | | | | | 2000-08-22 Christopher James Lahey <clahey@helixcode.com> * e-cell-text.c, e-cell-toggle.c, e-cell-tree.c, e-table-item.c: Moved drawing of the cell backgrounds from ECell into ETableItem. * e-tree-model.c: Include stdlib.c. svn path=/trunk/; revision=4915
* we can remove nodes with children now.Chris Toshok2000-08-221-5/+49
| | | | | | | | | | | | | | | | | | | | | | 2000-08-21 Chris Toshok <toshok@helixcode.com> * e-tree-example-1.c (remove_node): we can remove nodes with children now. * e-tree-model.h: add prototype for e_tree_model_node_sort. * e-tree-model.c (etree_set_expanded): if the node is invisible, just set its expanded flag and return. (e_tree_model_root_node_set_visible): call set_expanded before we remove it from the row array or else the aforementioned change will result in nothing happening. (e_tree_model_node_insert): use a position of -1 as "append". (e_tree_model_node_insert): if the model was marked with root_visible == FALSE, make sure to set it's expanded flag to TRUE when the root node is inserted. (e_tree_model_node_sort): new function. svn path=/trunk/; revision=4912
* Call our parent's destroy method.Miguel de Icaza2000-08-091-0/+5
| | | | | | | | | 2000-07-18 Miguel de Icaza <miguel@helixcode.com> * e-tree-model.c (etree_destroy): Call our parent's destroy method. svn path=/trunk/; revision=4643
* When inserting a root node, only call e_table_model_row_inserted ifDan Winship2000-07-091-4/+4
| | | | | | | | | | * e-tree-model.c (e_tree_model_node_insert): When inserting a root node, only call e_table_model_row_inserted if root_visible. (e_tree_model_node_remove): Call e_table_model_row_deleted before removing the row from the row_array, because the chain of signal handlers will sometimes need that info. svn path=/trunk/; revision=3994
* add a g_return_val_if_fail to etree_node_at_rowDan Winship2000-07-071-2/+2
| | | | svn path=/trunk/; revision=3937
* Make this work recursively.Dan Winship2000-07-071-1/+8
| | | | | | | * e-tree-model.c (e_tree_model_node_remove): Make this work recursively. svn path=/trunk/; revision=3935
* Calculate height including if clip_height is set to -1.Christopher James Lahey2000-06-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-06-26 Christopher James Lahey <clahey@helixcode.com> * widgets/e-text/e-text.c: Calculate height including if clip_height is set to -1. From addressbook/ChangeLog: 2000-06-26 Christopher James Lahey <clahey@helixcode.com> * contact-editor/e-contact-editor-categories.c, addressbook/gui/component/e-cardlist-model.c: Added value_to_string handlers. * demo/addressbook-widget.c, demo/demo.c: Removed usage of "x" and "y" arguments. * addressbook/gui/component/addressbook.c: Activated Click To Add and set the click to add message. * addressbook/gui/component/e-addressbook-model.c: Added value_to_string and append_row handlers. * addressbook/gui/component/e-select-names.c: Added a column. From calendar/ChangeLog: 2000-06-26 Christopher James Lahey <clahey@helixcode.com> * gui/calendar-model.c: Added an #ifdefed value_to_string handler assignment. From camel/ChangeLog: 2000-06-26 Christopher James Lahey <clahey@helixcode.com> * providers/mbox/camel-mbox-summary.c: Added debugging information. From composer/ChangeLog: 2000-06-26 Christopher James Lahey <clahey@helixcode.com> * Makefile.am: Added e-msg-composer-select-file.h for make distcheck. From e-util/ChangeLog: 2000-06-26 Christopher James Lahey <clahey@helixcode.com> * Makefile.am: Added e-canvas-vbox.c and e-canvas-vbox.h. * e-canvas-vbox.c, e-canvas-vbox.h: New canvas object to act like a vbox using the reflow system. From mail/ChangeLog: 2000-06-26 Christopher James Lahey <clahey@helixcode.com> * message-list.c: Added a value_to_string handler. From shell/ChangeLog: 2000-06-26 Christopher James Lahey <clahey@helixcode.com> * glade/Makefile.am: Added EXTRA_DIST for make distcheck. From widgets/e-table/ChangeLog: 2000-06-26 Christopher James Lahey <clahey@helixcode.com> * Makefile.am: Added e-table-click-to-add.c, e-table-click-to-add.h, e-table-one.c, and e-table-one.h. * e-table-click-to-add.c, e-table-click-to-add.h: A new canvas item that represents a single row that sometimes exists. It's for adding new rows to your table. * e-table-example-1.c, e-table-example-2.c, e-table-size-test.c, test-check.c, test-cols.c, test-table.c: Added value_to_string handlers. * e-table-group-container.c: Use value_to_string to make grouping not crash for non string columns. Made some changes to work properly in an ECanvasVbox. * e-table-group-leaf.c, e-table-item.c: Made some changes to work properly in an ECanvasVbox. * e-table-model.c, e-table-model.h: Added append_row and value_to_string methods. * e-table-one.c, e-table-one.h: Given a source ETableModel, this provides a single row model that uses the initialize_value, duplicate_value, free_value, and value_is_empty methods of the original source to implement set_value and value_at (and proxies most of the other methods.) This is used for ETableClickToAdd. * e-table-simple.c, e-table-simple.h: Added append_row and value_to_string handlers. append_row uses a GtkArg instead of a parameter to e_table_simple_new. * e-table-subset.c: Added append_row and value_to_string handlers. * e-table.c, e-table.h: Use a vbox containing an ETableClickToAdd and an ETableItem instead of an ETableItem directly. Only show the ETableClickToAdd if the top level of the xml SPEC has the attribute click-to-add set to some non-zero integer. (click-to-add="1"). Add a "click_to_add_message" argument. * e-tree-model.c: Add a commented out value_to_string handler. From widgets/meeting-time-sel/ChangeLog: 2000-06-26 Christopher James Lahey <clahey@helixcode.com> * Makefile.am: Added the include path to top_srcdir. svn path=/trunk/; revision=3744
* add icon_at virtual function - it was stupid to make the insert call takeChris Toshok2000-06-231-33/+15
| | | | | | | | | | | | | | | | | | | | 2000-06-23 Chris Toshok <toshok@helixcode.com> * e-tree-model.h, e-tree-model.c: add icon_at virtual function - it was stupid to make the insert call take 2 pixbufs. the model should give this information. * e-cell-tree.c: get rid of the opened/closed pixbuf stuff. call e_tree_model_icon_of_node. * e-tree-example-1.c: add my_icon_at. * e-tree-simple.c (simple_icon_at): new function (e_tree_simple_new): add icon_at parameter. * e-tree-simple.h: add SimpleIconAtFn. svn path=/trunk/; revision=3707
* use the expanded/unexpanded pixbufs as node pixbufs for the first level ofChris Toshok2000-06-231-2/+37
| | | | | | | | | | | | | | | | | | | | 2000-06-23 Chris Toshok <toshok@helixcode.com> * e-tree-example-1.c (create_tree): use the expanded/unexpanded pixbufs as node pixbufs for the first level of children, to test the drawing. * e-tree-model.c (e_tree_model_node_get_closed_pixbuf): new function. (e_tree_model_node_get_opened_pixbuf): same. (e_tree_model_node_insert): add opened/closed pixbuf argument. (e_tree_model_node_insert_before): same. * e-tree-model.h: add prototypes for opened/closed pixbuf accessors, and add them to the e_tree_model_node_insert_* calls. * e-cell-tree.c (ect_draw): add opened/closed pixbuf drawing per node. svn path=/trunk/; revision=3706
* call e_table_model_row_inserted instead of e_table_model_changed.Chris Toshok2000-06-201-4/+4
| | | | | | | | | 2000-06-17 Chris Toshok <toshok@helixcode.com> * e-tree-model.c (e_tree_model_node_insert): call e_table_model_row_inserted instead of e_table_model_changed. svn path=/trunk/; revision=3637
* change things so we focus the cell and select the row, and also dispatchChris Toshok2000-06-111-90/+459
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-06-10 Chris Toshok <toshok@helixcode.com> * e-table-item.c (eti_event): change things so we focus the cell and select the row, and also dispatch the event to that row/cell. This fixes the problem with the tree where you had to click twice to activate the tree controls. * Makefile.am (libetable_a_SOURCES): remove e-tree-gnode.* and add e-tree-simple.* (icons): add tree-expanded.xpm and tree-unexpanded.xpm * e-cell-tree.c (ect_enter_edit): defer to subcell's view. (ect_leave_edit): defer to subcell's view. (visible_depth_of_node): visual depth, taking into account that the root node of the model might not be displayed. (offset_of_node): return the offset used to shift the subcell over. (ect_draw): don't draw vertical lines if we're the leftmode node (a visual root node). also, don't shift x2 by the subcell offset, so we get ellipses like we're supposed to. (ect_event): remove GDK_BUTTON_RELEASE from the list of events that we care about. * e-tree-example-1.c: lots of changes, a more dynamic UI so we can test tree model api stuff. * e-tree-gnode.c, e-tree-gnode.c: removed files, since their guts have been rolled into e-tree-model.c * e-tree-model.c, e-tree-model.h: substantially changed. too much to really describe here. this should really be considered the first revision of these files :) * e-tree-simple.c, e-tree-simple.h: analogous to e-table-simple, a subclass that allows the use of function pointers. svn path=/trunk/; revision=3519
* New files. A tree model using a GNode structure to store it's info.Chris Toshok2000-06-091-0/+316
2000-06-08 Chris Toshok <toshok@helixcode.com> * e-tree-gnode.c, e-tree-gnode.h: New files. A tree model using a GNode structure to store it's info. * e-tree-model.c, e-tree-model.h: New files. A proxy model sitting between a table model and the real tree model (of which ETreeGNode is an example). * e-cell-tree.c, e-cell-tree.h: New files. A cell renderer capable of wrapping up a subcell and drawing the tree controls for expanding/collapsing trees. * tree-expanded.xpm, tree-unexpanded.xpm: New files. the standard + and - icons. * e-tree-example-1.c: New file, giving a (pretty poor :) example of using ETreeGNode. * Makefile.am: at the tree stuff to the build, and build tree-example-1. * .cvsignore: ignore tree-example-1. svn path=/trunk/; revision=3483