summaryrefslogtreecommitdiff
path: root/gtk/gtkrbtree.c
Commit message (Collapse)AuthorAgeFilesLines
* include missing #ifdef G_ENA\BLE_DEBUGJonathan Blandford2002-05-161-1/+9
| | | | | | Thu May 16 17:29:08 2002 Jonathan Blandford <jrb@redhat.com> * gtk/gtkrbtree.c (_gtk_rbtree_remove): include missing #ifdef G_ENA\BLE_DEBUG
* Fixes for #78258Owen Taylor2002-05-161-8/+24
| | | | | | | | | | | | | | | | Thu May 16 14:51:14 2002 Owen Taylor <otaylor@redhat.com> Fixes for #78258 * gtk/gtkrbtree.c demos/gtk-demo/editable-cells.c: Fix some 64-bit warning problems. (Patch from Matthias Clasen.) * gtk/gtkrbtree.c (_gtk_rbtree_debug_spew_helper): Surround a bunch of debug code with G_ENABLE_DEBUG. * configure.in demos/gtk-demo/main.c: Replace #ifndef G_OS_WIN32 with proper #ifdef HAVE_FLOCKFILE.
* add _gtk_rbtree_set_fixed_height()Kristian Rietveld2002-03-201-0/+26
| | | | | | | | | | | | | | | | | Wed Mar 20 22:59:23 2002 Kristian Rietveld <kris@gtk.org> * gtk/gtkrbtree.[ch]: add _gtk_rbtree_set_fixed_height() * gtk/gtktreeprivate.h: add fixed_height_check field * gtk/gtktreeview.c (gtk_tree_view_init): initialize scroll_sync_timer and fixed_height_check (do_validate_rows): add fixed_height_check. If all validated rows in the first cycle have the same height, then we set that height for the entire tree. This is some sort of 'fake' optimization, but helps a lot for the common case. We keep validating the entire tree in the background though. (gtk_tree_view_set_model): reset fixed_height_check
* add _gtk_rbtree_mark_invalid (my previous commit already needed this ...)Kristian Rietveld2002-01-271-0/+24
| | | | | | | | | Sun Jan 27 23:23:23 Kristian Rietveld <kris@gtk.org> * gtk/gtkrbtree.[ch]: add _gtk_rbtree_mark_invalid (my previous commit already needed this ...) (/me broke the build for the first time ... :)
* New function to fixup parity. RBTree corruption bug--Jonathan Blandford2001-12-101-56/+53
| | | | | | | Mon Dec 10 16:21:38 2001 Jonathan Blandford <jrb@redhat.com> * gtk/gtkrbtree.c (_fixup_parity): New function to fixup parity. RBTree corruption bug--
* Add debug spew to lots of places, so that people with crashy trees canJonathan Blandford2001-12-081-5/+31
| | | | | | | | Sat Dec 8 10:04:54 2001 Jonathan Blandford <jrb@redhat.com> * gtk/gtkrbtree.c (_gtk_rbtree_debug_spew): Add debug spew to lots of places, so that people with crashy trees can just run their program with GTK_DEBUG=TREE.
* get logic right, #66249Jonathan Blandford2001-12-081-101/+283
| | | | | | | | | | | | | | Fri Dec 7 20:06:14 2001 Jonathan Blandford <jrb@redhat.com> * gtk/gtktreeview.c (validate_visible_area): get logic right, #66249 * gtk/gtkrbtree.c (_gtk_rbtree_remove_node): fix bug where removing a node ended up with a corrupt tree. Really really nasty bug. (_gtk_rbtree_debug_spew): new debug helper function (_fixup_validation): new inline function to clean up code readability a lot.
* Minor fix.Jonathan Blandford2001-12-041-26/+101
| | | | | | | | | | | | | | | | Tue Dec 4 18:38:35 2001 Jonathan Blandford <jrb@redhat.com> * demos/gtk-demo/main.c: (create_tree): Minor fix. * docs/tree-column-sizing.txt: Update * gtk/gtkrbtree.[ch]: Massive work to support validation. * gtk/gtktreemodel.c: Doc fixes. * gtk/gtktreeview.c: Incremental reflow added. * gtk/gtktreeviewcolumn.c: ditto * gtk/gtktreeviewcolumn.h: ditto
* Clean up height code a bit. I don't think it's completely correct yet, butJonathan Blandford2001-11-021-7/+35
| | | | | | | | Fri Nov 2 16:45:17 2001 Jonathan Blandford <jrb@redhat.com> * gtk/gtkrbtree.c (_gtk_rbtree_remove_node): Clean up height code a bit. I don't think it's completely correct yet, but it's getting there.
* Fix reorder_fixup, #59583Jonathan Blandford2001-11-021-2/+9
| | | | | | | | | | Thu Nov 1 19:11:35 2001 Jonathan Blandford <jrb@redhat.com> * gtk/gtkrbtree.c (gtk_rbtree_reorder_fixup): Fix reorder_fixup, #59583 * gtk/gtktreeselection.c (gtk_tree_selection_set_mode): fix warning.
* Add support for invalid nodes. (_gtk_rbnode_rotate_right): Ditto.Jonathan Blandford2001-10-251-1/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | Thu Oct 25 16:27:29 2001 Jonathan Blandford <jrb@redhat.com> * gtk/gtkrbtree.c (_gtk_rbnode_rotate_left): Add support for invalid nodes. (_gtk_rbnode_rotate_right): Ditto. (_gtk_rbtree_node_mark_invalid): New function. (_gtk_rbtree_node_mark_valid): New function. * gtk/gtktreemodelsort.c (gtk_tree_model_sort_class_init): We're a GObject, not a GtkObject. (gtk_tree_model_sort_row_has_child_toggled): Rewrote to be more correct. (gtk_tree_model_sort_row_deleted): ditto. (gtk_tree_model_sort_{un,}ref_node): Fix. * gtk/gtktreeview.c: Protean incremental reflow support (commented out) * gtk/gtktreeview.h (GtkTreeViewSearchEqualFunc): change char *key to const char *key. * gtk/gtktreemodel.c (gtk_tree_row_reference_unref_path_helper): Important 1 line fix to fix a lot of refcounting woes.
* change scroll_to_cell delayed code to happen in size_allocate.Jonathan Blandford2001-10-011-1/+1
| | | | | | | | | | | | | | Mon Oct 1 14:07:02 2001 Jonathan Blandford <jrb@redhat.com> * gtk/gtktreeview.c (gtk_tree_view_size_allocate): change scroll_to_cell delayed code to happen in size_allocate. * gtk/gtkstyle.c (gtk_default_draw_expander): change prelight/normal arrow drawing. * gtk/gtktreedatalist.c: Change compare func to use g_utf8_collate * gtk/gtktreestore.c: refactor.
* add warnings per jrb's request.Kristian Rietveld2001-09-011-2/+5
| | | | | | | Sat Sep 1 21:57:27 2001 Kristian Rietveld <kristian@planet.nl> * gtk/gtkrbtree.c (_gtk_rbtree_reorder): add warnings per jrb's request.
* Rename gtk_tree_sortable_sort_column_id_set_func. It's much shorter now.Jonathan Blandford2001-06-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | Fri Jun 15 18:53:48 2001 Jonathan Blandford <jrb@redhat.com> * gtk/gtktreesortable.c (gtk_tree_sortable_set_sort_func): Rename gtk_tree_sortable_sort_column_id_set_func. It's much shorter now. * gtk/gtktreeview.c (gtk_tree_view_sort_iter_changed): WOOO!!! Now I can really reorder/sort all Store widgets. treesorttest seems to just work now. * gtk/gtklistview.c (gtk_list_store_iter_changed): Whoops. testtreesort worked through a big coincidence all this time. * gtk/gtkrbtree.c (_gtk_rbtree_reorder): Nasty bug fix in nasty code. * tests/testtreecolumns.c: Big 'ol warning at the top letting people know that this code should never ever ever be copied. HA! While everyone else was busy flaming eash other over configuration engines, I secretly got sorting completely working with store widgets and GtkTreeView. GtkTreeModelSort, here I come!!!!!
* Massive reordering/sorting work. Now pretty much works.Jonathan Blandford2001-03-291-11/+26
| | | | | | | | | | | | | | Thu Mar 29 16:29:12 2001 Jonathan Blandford <jrb@webwynk.net> * gtk/gtkliststore.c (gtk_list_store_iter_changed): Massive reordering/sorting work. Now pretty much works. * gtk/gtkrbtree.c (_gtk_rbtree_reorder): Lots of work to make reorder mostly work. Still need to get the parity correct. * gtk/gtktreeviewcolumn.c: Listen for "model" property changed signal, so I can listen for the sort_column_changed signal so I can change my "sort_indicator" property. Cool.
* new function to handle reordering of trees. Seems to mostly work w/ theJonathan Blandford2001-03-281-0/+95
| | | | | | | | | | | Wed Mar 28 17:27:12 2001 Jonathan Blandford <jrb@redhat.com> * gtk/gtkrbtree.c (_gtk_rbtree_reorder): new function to handle reordering of trees. Seems to mostly work w/ the exception of the parity flag. * gtk/gtktreeview.c (gtk_tree_view_reordered): handle "reordered" signal.
* Proxy out to _gtk_tree_row_reference_deleted. (inserted_callback): ProxyJonathan Blandford2001-02-281-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | Tue Feb 27 19:32:53 2001 Jonathan Blandford <jrb@redhat.com> * gtk/gtktreemodel.c (deleted_callback): Proxy out to _gtk_tree_row_reference_deleted. (inserted_callback): Proxy out to _gtk_tree_row_reference_inserted. (_gtk_tree_row_reference_new_from_view): Somewhat yukky hack to get around signal emission ordering problem. * gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all): fix to work with SINGLE (_gtk_tree_selection_internal_select_node): Major sanitization on selections. SINGLE now seems to work. * tests/Makefile.am: add testtreecolumn.c: * tests/testtreecolumn.c: New test. Mostly points out selection bugs currently, but will test columns later. * gtk/gtkrbtree.c (_gtk_rbtree_remove_node): Fix really nasty selection bug. I hate touching this code -- it's scary.
* remove validation idleHavoc Pennington2001-02-081-33/+246
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-02-08 Havoc Pennington <hp@redhat.com> * gtk/gtktextview.c (gtk_text_view_destroy_layout): remove validation idle * demos/gtk-demo/main.c (create_tree): adjust to changes in text cell renderer * demos/pixbuf-demo.c (timeout): remove deprecated gtk_widget_draw * demos/testpixbuf-save.c (main): remove deprecated gtk_drawing_area_size * gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate buttons even if the model isn't setup. gtk_tree_view_check_dirty() at the start of the allocation. (gtk_tree_view_check_dirty): handle column->button == NULL, handle unsetup or NULL model. * gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the even/odd/sorted cells in the tree view. * gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all): bugfixes * gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row backgrounds with draw_flat_box using different detail for even/odd rows. * gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each row, so we can draw the alternating colors thing * gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a property from a synonym property, notify for the synonym. Also, nuke the background_gdk_set and foreground_gdk_set synonyms (gtk_text_tag_get_property): Always return the font, even if all its fields aren't set * gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't store the attr list; it leaves us with no way to change attributes in _render according to the render flags, and no way to implement get_property. Instead store all the specific text attributes. Separate whether an attribute is enabled from its value. Sync all properties with GtkTextTag, make them all consistent, etc. * gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so renderers can highlight the sort row/column * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use accessor functions to get values; this has the side effect of showing up which accessor functions were missing. Added those. * gtk/gtktreeviewcolumn.h: Replace set_justification with set_alignment, to be consistent with GtkLabel, GtkMisc * gtk/gtktreeviewcolumn.c: Added code to display sort indicator arrow. * gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h * gtk/gtktreesortable.h: updates in here
* adapt to handle PangoColorHavoc Pennington2001-01-261-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-01-26 Havoc Pennington <hp@redhat.com> * gtk/gtktextlayout.c (convert_color): adapt to handle PangoColor * gtk/gtktreeview.c (gtk_tree_view_widget_to_tree_coords): fix to not offset by TREE_VIEW_HEADER_HEIGHT (gtk_tree_view_tree_to_widget_coords): fix to not offset by TREE_VIEW_HEADER_HEIGHT * configure.in (included_loaders): for me, --with-included-loaders generates the error "the specified loader yes does not exist", i.e. the arg defaults to "yes", so change test for value "" to test for value "yes", and include all loaders in that case. * gtk/gtkrbtree.c (_gtk_rbtree_get_depth): new function * gtk/gtktreeview.c (gtk_tree_view_get_cell_rect): fix to properly handle TREE_VIEW_VERTICAL_SEPARATOR (gtk_tree_view_bin_expose): fix to consider the row offset as pointing halfway into vertical separator. (gtk_tree_view_draw_node_focus_rect): ditto * gtk/gtkdebug.h, gtk/gtkmain.c (gtk_init_check): Add --gtk-debug=updates, which causes gdk_window_set_debug_updates (TRUE) to be called. * gdk/gdkwindow.c (gdk_window_set_debug_updates): Allow enabling a debug mode where the invalid region is colored in on invalidate, so you can see the flicker and know whether your redraw code is doing a good job. * gtk/gtktreeview.c (gtk_tree_view_queue_draw_node): Work in tree window coordinates (clip rect is in tree window coords) * gtk/Makefile.am: add gtktreednd.[hc] * gtk/gtkliststore.c: implement gtktreednd interfaces. * gtk/gtktreednd.c, gtk/gtktreednd.h: New interface to support drag-and-drop data operations on a model (so we can set up tree drag-and-drop automatically) * gtk/testgtk.c: Add a window to change sensitivity in the GtkLabel test; add a way to change the entry frame in GtkEntry test * gtk/gtkentry.c (gtk_entry_set_has_frame): (gtk_entry_get_has_frame): new functions to remove the frame around an entry (gtk_entry_size_request): shrink requisition if no frame (gtk_entry_draw_focus): don't draw frame if no frame * gtk/gtkstyle.c (gtk_default_draw_check): draw custom look for checks inside a cell renderer (gtk_default_draw_option): ditto for options * gtk/gtktreeviewcolumn.c (update_button_contents): add/remove children from the alignment, not the button (gtk_tree_view_column_init): ref/sink the column, to emulate GObject refcounting. * gtk/gtkcellrenderer.c (gtk_cell_renderer_init): ref/sink * gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_render): Use theme functions to draw the toggles * gdk/gdkpango.c (gdk_pango_get_gc): use GdkRGB to alloc colors * gdk/gdkpango.h, gdk/gdkpango.c: Add GdkPangoAttrStipple and GdkPangoAttrEmbossed to use in rendering insensitive text * gdk/gdkpango.c (gdk_draw_layout_line): render new properties * gtk/gtkstyle.c (gtk_default_draw_layout): handle sensitivity using new GDK features
* sync to tree changesHavoc Pennington2001-01-191-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-01-19 Havoc Pennington <hp@redhat.com> * demos/gtk-demo/main.c (button_press_event_cb): sync to tree changes * gtk/gtkrbtree.c (_gtk_rbtree_node_find_offset): fix this function * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_widget): implement * gtk/gtktreeview.c (gtk_tree_view_move_to): rename scroll_to_cell, matches TextView scroll functions better (gtk_tree_view_tree_to_widget_coords): new function (gtk_tree_view_widget_to_tree_coords): new function (gtk_tree_view_get_visible_rect): new function (gtk_tree_view_get_path_at_pos): accept negative coordinates (gtk_tree_view_draw_node_focus_rect): new function moved from draw_focus, also, use width of bin_window as width of the focus rect (gtk_tree_view_expand_row): fix bug where it didn't recognize already-expanded rows (gtk_tree_view_get_cell_rect): new function (gtk_tree_view_get_path_at_pos): return the click position relative to the passed-in cell (gtk_tree_view_set_expander_column): new function * configure.in: remove gtk-config-2.0 chmod * gtk/gtktextview.c (gtk_text_view_drag_motion): small cleanups, and properly handle drags with targets we don't understand (gtk_text_view_drag_end): don't stop scrolling, the source isn't scrolling anyway (gtk_text_view_drag_drop): stop scrolling here though, and set the mark invisible * gtk/gtkdnd.c (gtk_drag_dest_find_target): export as a public function (gtk_drag_dest_get_target_list): new function (gtk_drag_dest_set_target_list): new function * gtk/gtktreeview.c: Add a bunch of drag-and-drop implementation * gtk/gtktreeprivate.h (struct _GtkTreeViewPrivate): add fields related to drag-and-drop
* handle case where there are no rows in the modelHavoc Pennington2001-01-091-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-01-09 Havoc Pennington <hp@redhat.com> * gtk/gtktreeview.c (gtk_tree_view_check_dirty): handle case where there are no rows in the model * gtk/gtkliststore.c (gtk_list_store_iter_children): if parent is NULL, then return the start of the list * gtk/gtktreeview.c (gtk_tree_view_setup_model): don't build tree if we can't get any rows from an empty model * gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): remove extraneous * after function pointer typedef usage * Makefile.am: don't specify full path to cp and rm * gtk/gtkcellrenderertextpixbuf.c (gtk_cell_renderer_text_pixbuf_get_size): check width/height != NULL before dereferencing, fixes a segfault that happened from time to time * gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_render): use gdk_pixbuf_render_to_drawable_alpha() to get alpha channel, and reindent the function (gtk_cell_renderer_pixbuf_get_size): indentation * gtk/gtkdialog.c (gtk_dialog_run): destroy main loop only after we quit it (gtk_dialog_add_buttons_valist): add g_return_if_fail (gtk_dialog_set_default_response): New function, to set default button (gtk_dialog_set_response_sensitive): New function, to set sensitivity of buttons * gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_property): allow getting a NULL pixbuf (gtk_cell_renderer_pixbuf_set_property): allow setting a NULL pixbuf * gtk/gtktreedatalist.c (_gtk_tree_data_list_node_to_value): handle any G_TYPE_OBJECT subclass, not just the base class, and also boxed types. (_gtk_tree_data_list_value_to_node): ditto * gtk/gtkrbtree.c: Run _gtk_rbtree_test at strategic points if --gtk-debug=tree * gtk/gtkmain.c: add GTK_DEBUG_TREE * gtk/gtkdebug.h: add GTK_DEBUG_TREE
* Got rid of GtkTreeNode, and changed it to GtkTreeIter. Added iteratorsJonathan Blandford2000-10-261-0/+7
| | | | | | | | | | | | | | | | | | | | | | | Wed Oct 25 20:40:25 2000 Jonathan Blandford <jrb@redhat.com> * gtk/gtktreemodel.h: Got rid of GtkTreeNode, and changed it to GtkTreeIter. Added iterators everywhere. * gtk/gtktreeviewcolumn.c: Changed to use the iterators. * gtk/gtktreeviewselection.c: Changed to use the iterators. * gtk/gtktreestore.c: Changed to use the iterators. * gtk/gtkliststore.c: Commented out the code. Will convert to iterators tomorrow. * gtk/gtkmodelsimple.c: Commented out the code. Will convert to iterators tomorrow. * gtk/treestoretest.c: Changed to use iterators. * demos/testgtk/main.c: Moved to use the new iterator system.
* Checked in initial draft of the new tree widget.42000-10-051-0/+994
2000-10-04 <jrb@redhat.com> * gtk/gtk{tree,cell}?*.[ch]: Checked in initial draft of the new tree widget.