"Fossies" - the Fresh Open Source Software Archive

Member "fltk-1.3.3/documentation/html/Fl__Tree__Item__Array_8H_source.html" (3 Nov 2014, 21026 Bytes) of package /linux/misc/fltk-1.3.3-docs-html.tar.gz:


Caution: In this restricted "Fossies" environment the current HTML page may not be correctly presentated and may have some non-functional links. Alternatively you can here view or download the uninterpreted raw source code. A member file download can also be achieved by clicking within a package contents listing on the according byte size field.

FLTK 1.3.3
Fl_Tree_Item_Array.H
Go to the documentation of this file.
1 //
2 // "$Id: Fl_Tree_Item_Array.H 10271 2014-09-04 18:56:52Z greg.ercolano $"
3 //
4 
5 #ifndef _FL_TREE_ITEM_ARRAY_H
6 #define _FL_TREE_ITEM_ARRAY_H
7 
8 #include <FL/Fl.H>
9 #include "Fl_Export.H"
10 
11 class FL_EXPORT Fl_Tree_Item; // forward decl must *precede* first doxygen comment block
12  // or doxygen will not document our class..
13 
15 // FL/Fl_Tree_Item_Array.H
17 //
18 // Fl_Tree -- This file is part of the Fl_Tree widget for FLTK
19 // Copyright (C) 2009-2010 by Greg Ercolano.
20 //
21 // This library is free software. Distribution and use rights are outlined in
22 // the file "COPYING" which should have been included with this file. If this
23 // file is missing or damaged, see the license at:
24 //
25 // http://www.fltk.org/COPYING.php
26 //
27 // Please report all bugs and problems on the following page:
28 //
29 // http://www.fltk.org/str.php
30 //
31 
36 
46 
47 class FL_EXPORT Fl_Tree_Item_Array {
48  Fl_Tree_Item **_items; // items array
49  int _total; // #items in array
50  int _size; // #items *allocated* for array
51  int _chunksize; // #items to enlarge mem allocation
52 #if FLTK_ABI_VERSION >= 10303
53  enum {
54  MANAGE_ITEM = 1,
55  };
56  char _flags; // flags to control behavior
57 #endif
58  void enlarge(int count);
59 public:
60  Fl_Tree_Item_Array(int new_chunksize = 10); // CTOR
61  ~Fl_Tree_Item_Array(); // DTOR
62  Fl_Tree_Item_Array(const Fl_Tree_Item_Array *o); // COPY CTOR
65  return(_items[i]);
66  }
68  const Fl_Tree_Item *operator[](int i) const {
69  return(_items[i]);
70  }
72  int total() const {
73  return(_total);
74  }
76 #if FLTK_ABI_VERSION >= 10301
77  // NEW -- code moved to .cxx
78  void swap(int ax, int bx);
79 #else /*FLTK_ABI_VERSION*/
80  // OLD
81  void swap(int ax, int bx) {
82  Fl_Tree_Item *asave = _items[ax];
83  _items[ax] = _items[bx];
84  _items[bx] = asave;
85  }
86 #endif /*FLTK_ABI_VERSION*/
87  int move(int to, int from);
88  int deparent(int pos);
89  int reparent(Fl_Tree_Item *item, Fl_Tree_Item *newparent, int pos);
90  void clear();
91  void add(Fl_Tree_Item *val);
92  void insert(int pos, Fl_Tree_Item *new_item);
93  void replace(int pos, Fl_Tree_Item *new_item);
94  void remove(int index);
95  int remove(Fl_Tree_Item *item);
96 #if FLTK_ABI_VERSION >= 10303
97  void manage_item_destroy(int val) {
101  if ( val ) _flags |= MANAGE_ITEM; else _flags &= ~MANAGE_ITEM;
102  }
103  int manage_item_destroy() const {
104  return _flags & MANAGE_ITEM ? 1 : 0;
105  }
106 #endif
107 };
108 
109 #endif /*_FL_TREE_ITEM_ARRAY_H*/
110 
111 //
112 // End of "$Id: Fl_Tree_Item_Array.H 10271 2014-09-04 18:56:52Z greg.ercolano $".
113 //
Fl_Tree_Item * operator[](int i)
Return the item and index i.
Definition: Fl_Tree_Item_Array.H:64
Fl static class.
void swap(int ax, int bx)
Swap the two items at index positions ax and bx.
Definition: Fl_Tree_Item_Array.H:81
const Fl_Tree_Item * operator[](int i) const
Const version of operator[](int i)
Definition: Fl_Tree_Item_Array.H:68
Tree widget item.
Definition: Fl_Tree_Item.H:67
int total() const
Return the total items in the array, or 0 if empty.
Definition: Fl_Tree_Item_Array.H:72
Manages an array of Fl_Tree_Item pointers.
Definition: Fl_Tree_Item_Array.H:47