From 9a4ef219defa24e0db83dc5f22d01cf29e0a75bd Mon Sep 17 00:00:00 2001 From: Greg Ercolano Date: Thu, 19 Jan 2012 12:44:26 +0000 Subject: Fl_Tree optimizations for selecting large trees (100k items). Added _next_sibling and _prev_sibling to Fl_Tree_Item class to make next_sibling() and prev_sibling() more efficient during item selection. Used new FLTK_ABI_VERSION macro (as designed by Greg and Albrecht on fltk.dev) to protect the ABI breaking features. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9231 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- FL/Fl_Tree_Item_Array.H | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'FL/Fl_Tree_Item_Array.H') diff --git a/FL/Fl_Tree_Item_Array.H b/FL/Fl_Tree_Item_Array.H index 8bdf21afc..18527a8ef 100644 --- a/FL/Fl_Tree_Item_Array.H +++ b/FL/Fl_Tree_Item_Array.H @@ -5,6 +5,7 @@ #ifndef _FL_TREE_ITEM_ARRAY_H #define _FL_TREE_ITEM_ARRAY_H +#include #include "Fl_Export.H" class FL_EXPORT Fl_Tree_Item; // forward decl must *precede* first doxygen comment block @@ -66,11 +67,17 @@ public: return(_total); } /// Swap the two items at index positions \p ax and \p bx. +#if FLTK_ABI_VERSION >= 10302 + // NEW -- code moved to .cxx + void swap(int ax, int bx); +#else /*FLTK_ABI_VERSION*/ + // OLD void swap(int ax, int bx) { Fl_Tree_Item *asave = _items[ax]; _items[ax] = _items[bx]; _items[bx] = asave; } +#endif /*FLTK_ABI_VERSION*/ void clear(); void add(Fl_Tree_Item *val); void insert(int pos, Fl_Tree_Item *new_item); -- cgit v1.2.3