author | Mathieu Lacage <mathieu.lacage@inria.fr> |
Wed, 10 Aug 2011 19:28:39 +0200 | |
changeset 7418 | d28419a2b1c0 |
parent 7234 | 0572de06ae29 |
child 7420 | ca9c09839724 |
permissions | -rw-r--r-- |
5992
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
2 |
/* |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
3 |
* This program is free software; you can redistribute it and/or modify |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
4 |
* it under the terms of the GNU General Public License version 2 as |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
5 |
* published by the Free Software Foundation; |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
6 |
* |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
7 |
* This program is distributed in the hope that it will be useful, |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
8 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
9 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
10 |
* GNU General Public License for more details. |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
11 |
* |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
12 |
* You should have received a copy of the GNU General Public License |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
13 |
* along with this program; if not, write to the Free Software |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
14 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
15 |
* |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
16 |
* Authors: Faker Moatamri <faker.moatamri@sophia.inria.fr> |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
17 |
* Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
18 |
*/ |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
19 |
|
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
20 |
#include "attribute-iterator.h" |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
21 |
#include <gtk/gtk.h> |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
22 |
|
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
23 |
namespace ns3 |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
24 |
{ |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
25 |
|
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
26 |
enum |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
27 |
{ |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
28 |
COL_NODE = 0, COL_LAST |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
29 |
}; |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
30 |
|
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
31 |
struct ModelNode |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
32 |
{ |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
33 |
enum |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
34 |
{ |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
35 |
// store object + attribute name |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
36 |
NODE_ATTRIBUTE, |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
37 |
// store object + attribute name |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
38 |
NODE_POINTER, |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
39 |
// store object + attribute name |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
40 |
NODE_VECTOR, |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
41 |
// store index + value (object) |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
42 |
NODE_VECTOR_ITEM, |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
43 |
// store object |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
44 |
NODE_OBJECT |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
45 |
} type; |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
46 |
std::string name; |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
47 |
Ptr<Object> object; |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
48 |
uint32_t index; |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
49 |
}; |
7234
0572de06ae29
Make some modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents:
6941
diff
changeset
|
50 |
/** |
0572de06ae29
Make some modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents:
6941
diff
changeset
|
51 |
* \ingroup configstore |
0572de06ae29
Make some modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents:
6941
diff
changeset
|
52 |
* |
0572de06ae29
Make some modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents:
6941
diff
changeset
|
53 |
*/ |
5992
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
54 |
class ModelCreator : public AttributeIterator |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
55 |
{ |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
56 |
public: |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
57 |
ModelCreator (); |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
58 |
|
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
59 |
void Build (GtkTreeStore *treestore); |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
60 |
private: |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
61 |
virtual void DoVisitAttribute (Ptr<Object> object, std::string name); |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
62 |
virtual void DoStartVisitObject (Ptr<Object> object); |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
63 |
virtual void DoEndVisitObject (void); |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
64 |
virtual void DoStartVisitPointerAttribute (Ptr<Object> object, std::string name, Ptr<Object> value); |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
65 |
virtual void DoEndVisitPointerAttribute (void); |
7418
d28419a2b1c0
try to fix gtk-enabled build blindly.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7234
diff
changeset
|
66 |
virtual void DoStartVisitArrayAttribute (Ptr<Object> object, std::string name, |
d28419a2b1c0
try to fix gtk-enabled build blindly.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7234
diff
changeset
|
67 |
const ObjectPtrContainerValue &vector); |
5992
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
68 |
virtual void DoEndVisitArrayAttribute (void); |
7418
d28419a2b1c0
try to fix gtk-enabled build blindly.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7234
diff
changeset
|
69 |
virtual void DoStartVisitArrayItem (const ObjectPtrContainerValue &vector, |
5992
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
70 |
uint32_t index, Ptr<Object> item); |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
71 |
virtual void DoEndVisitArrayItem (void); |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
72 |
void Add (ModelNode *node); |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
73 |
void Remove (void); |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
74 |
|
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
75 |
GtkTreeStore *m_treestore; |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
76 |
std::vector<GtkTreeIter *> m_iters; |
73ea01eb5674
Bug 184: add ConfigureDefaults to GtkConfigStore, refactor the code and coding style, add comments
Faker Moatamri <faker.moatamri@sophia.inria.fr>
parents:
diff
changeset
|
77 |
}; |
5995
017e7a1cfa7c
fix build, remove debugging code from tap example
Craig Dowell <craigdo@ee.washington.edu>
parents:
5992
diff
changeset
|
78 |
} |