A Discrete-Event Network Simulator
API
display-functions.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License version 2 as
5  * published by the Free Software Foundation;
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software
14  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15  *
16  * Authors: Faker Moatamri <faker.moatamri@sophia.inria.fr>
17  * Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
18  */
19 #include "display-functions.h"
20 #include "raw-text-config.h"
21 #include "ns3/config.h"
22 #include "ns3/string.h"
23 #include "ns3/pointer.h"
24 
25 namespace ns3 {
30 void
31 cell_data_function_col_1 (GtkTreeViewColumn *col, GtkCellRenderer *renderer,
32  GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data)
33 {
34  ModelNode *node;
35  gtk_tree_model_get (model, iter, COL_NODE, &node, -1);
36  if (node->type == ModelNode::NODE_ATTRIBUTE)
37  {
38  StringValue str;
39  node->object->GetAttribute (node->name, str);
40  g_object_set (renderer, "text", str.Get ().c_str (), (char*) 0);
41  g_object_set (renderer, "editable", TRUE, (char*) 0);
42  }
43  else
44  {
45  g_object_set (renderer, "text", "", (char*) 0);
46  g_object_set (renderer, "editable", FALSE, (char*) 0);
47  }
48 }
53 void
54 cell_data_function_col_0 (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model,
55  GtkTreeIter *iter, gpointer user_data)
56 {
57  ModelNode *node;
58  gtk_tree_model_get (model, iter, COL_NODE, &node, -1);
59  g_object_set (renderer, "editable", FALSE, (char*) 0);
60  switch (node->type)
61  {
63  g_object_set (renderer, "text", node->object->GetInstanceTypeId ().GetName ().c_str (), (char*) 0);
64  break;
66  g_object_set (renderer, "text", node->name.c_str (), (char*) 0);
67  break;
69  g_object_set (renderer, "text", node->name.c_str (), (char*) 0);
70  break;
72  {
73  std::stringstream oss;
74  oss << node->index;
75  g_object_set (renderer, "text", oss.str ().c_str (), (char*) 0);
76  }
77  break;
79  g_object_set (renderer, "text", node->name.c_str (), (char*) 0);
80  break;
81  }
82 }
83 
87 void
88 cell_edited_callback (GtkCellRendererText *cell, gchar *path_string,
89  gchar *new_text, gpointer user_data)
90 {
91  GtkTreeModel *model = GTK_TREE_MODEL (user_data);
92  GtkTreeIter iter;
93  gtk_tree_model_get_iter_from_string (model, &iter, path_string);
94  ModelNode *node;
95  gtk_tree_model_get (model, &iter, COL_NODE, &node, -1);
97  node->object->SetAttribute (node->name, StringValue (new_text));
98 }
99 
104 int
105 get_col_number_from_tree_view_column (GtkTreeViewColumn *col)
106 {
107  GList *cols;
108  int num;
109  g_return_val_if_fail (col != 0, -1);
110  g_return_val_if_fail (gtk_tree_view_column_get_tree_view(col) != 0, -1);
111  cols = gtk_tree_view_get_columns (GTK_TREE_VIEW (gtk_tree_view_column_get_tree_view(col)));
112  num = g_list_index (cols, (gpointer) col);
113  g_list_free (cols);
114  return num;
115 }
116 
121 gboolean
122 cell_tooltip_callback (GtkWidget *widget, gint x, gint y, gboolean keyboard_tip,
123  GtkTooltip *tooltip, gpointer user_data)
124 {
125  GtkTreeModel *model;
126  GtkTreeIter iter;
127  GtkTreeViewColumn * column;
128  if (!gtk_tree_view_get_tooltip_context (GTK_TREE_VIEW (widget), &x, &y,
129  keyboard_tip, &model, 0, &iter))
130  {
131  return FALSE;
132  }
133  if (!gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (widget), x, y, 0, &column, 0, 0))
134  {
135  return FALSE;
136  }
137  int col = get_col_number_from_tree_view_column (column);
138 
139  ModelNode *node;
140  gtk_tree_model_get (model, &iter, COL_NODE, &node, -1);
141 
142  switch (node->type)
143  {
145  if (col == 0)
146  {
147  std::string tip = "This object is of type "
148  + node->object->GetInstanceTypeId ().GetName ();
149  gtk_tooltip_set_text (tooltip, tip.c_str ());
150  return TRUE;
151  }
152  break;
154  if (col == 0)
155  {
156  PointerValue ptr;
157  node->object->GetAttribute (node->name, ptr);
158  std::string tip = "This object is of type "
159  + ptr.GetObject ()->GetInstanceTypeId ().GetName ();
160  gtk_tooltip_set_text (tooltip, tip.c_str ());
161  return TRUE;
162  }
163  break;
165  break;
167  if (col == 0)
168  {
169  std::string tip = "This object is of type "
170  + node->object->GetInstanceTypeId ().GetName ();
171  gtk_tooltip_set_text (tooltip, tip.c_str ());
172  return TRUE;
173  }
174  break;
176  {
177  uint32_t attrIndex = 0;
178  TypeId tid;
179  for (tid = node->object->GetInstanceTypeId (); tid.HasParent (); tid
180  = tid.GetParent ())
181  {
182  for (uint32_t i = 0; i < tid.GetAttributeN (); ++i)
183  {
184  if (tid.GetAttribute (i).name == node->name)
185  {
186  attrIndex = i;
187  goto out;
188  }
189  }
190  }
191 out: if (col == 0)
192  {
193  std::string tip = tid.GetAttribute (attrIndex).help;
194  gtk_tooltip_set_text (tooltip, tip.c_str ());
195  }
196  else
197  {
198  struct TypeId::AttributeInformation info = tid.GetAttribute (attrIndex);
199  Ptr<const AttributeChecker> checker = info.checker;
200  std::string tip;
201  tip = "This attribute is of type " + checker->GetValueTypeName ();
202  if (checker->HasUnderlyingTypeInformation ())
203  {
204  tip += " " + checker->GetUnderlyingTypeInformation ();
205  }
206  gtk_tooltip_set_text (tooltip, tip.c_str ());
207  }
208  return TRUE;
209  }
210  break;
211  }
212  return FALSE;
213 }
214 
219 GtkWidget *
220 create_view (GtkTreeStore *model)
221 {
222  GtkTreeViewColumn *col;
223  GtkCellRenderer *renderer;
224  GtkWidget *view;
225 
226  view = gtk_tree_view_new ();
227  g_object_set (view, "has-tooltip", TRUE, (char*) 0);
228  g_signal_connect (view, "query-tooltip", (GCallback) cell_tooltip_callback, 0);
229 
230  gtk_tree_view_set_grid_lines (GTK_TREE_VIEW (view), GTK_TREE_VIEW_GRID_LINES_BOTH);
231  gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (view), TRUE);
232 
233  col = gtk_tree_view_column_new ();
234  gtk_tree_view_column_set_title (col, "Object Attributes");
235  gtk_tree_view_append_column (GTK_TREE_VIEW (view), col);
236  renderer = gtk_cell_renderer_text_new ();
237  gtk_tree_view_column_pack_start (col, renderer, TRUE);
238  gtk_tree_view_column_set_cell_data_func (col, renderer, cell_data_function_col_0, 0, 0);
239  g_object_set (renderer, "editable", FALSE, (char*) 0);
240 
241  col = gtk_tree_view_column_new ();
242  gtk_tree_view_column_set_title (col, "Attribute Value");
243  gtk_tree_view_append_column (GTK_TREE_VIEW (view), col);
244  renderer = gtk_cell_renderer_text_new ();
245  g_signal_connect (renderer, "edited", (GCallback) cell_edited_callback, model);
246  gtk_tree_view_column_pack_start (col, renderer, TRUE);
247  gtk_tree_view_column_set_cell_data_func (col, renderer, cell_data_function_col_1, 0, 0);
248 
249  gtk_tree_view_set_model (GTK_TREE_VIEW (view), GTK_TREE_MODEL (model));
250 
251  g_object_unref (model); /* destroy model automatically with view */
252 
253  return view;
254 }
255 
263 void
264 save_clicked (GtkButton *button, gpointer user_data)
265 {
266  GtkWidget *parent_window = GTK_WIDGET (user_data);
267  GtkWidget *dialog;
268 
269  dialog = gtk_file_chooser_dialog_new ("Save File", GTK_WINDOW (parent_window), GTK_FILE_CHOOSER_ACTION_SAVE,
270  GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_SAVE,
271  GTK_RESPONSE_ACCEPT, (char *) 0);
272  gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog),
273  TRUE);
274 
275  gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), "config.txt");
276 
277  if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
278  {
279  char *filename;
280 
281  filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
282  RawTextConfigSave config;
283  config.SetFilename (filename);
284  config.Attributes ();
285  g_free (filename);
286  }
287 
288  gtk_widget_destroy (dialog);
289 }
290 
294 void
295 load_clicked (GtkButton *button, gpointer user_data)
296 {
297  GtkWidget *parent_window = GTK_WIDGET (user_data);
298  GtkWidget *dialog;
299 
300  dialog = gtk_file_chooser_dialog_new ("Open File", GTK_WINDOW (parent_window), GTK_FILE_CHOOSER_ACTION_OPEN,
301  GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN,
302  GTK_RESPONSE_ACCEPT, (char *) 0);
303 
304  if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
305  {
306  char *filename;
307 
308  filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
309  RawTextConfigLoad config;
310  config.SetFilename (filename);
311  config.Attributes ();
312  }
313 
314  gtk_widget_destroy (dialog);
315 }
316 
320 void
321 exit_clicked_callback (GtkButton *button, gpointer user_data)
322 {
323  gtk_main_quit ();
324  gtk_widget_hide (GTK_WIDGET (user_data));
325 }
326 
330 gboolean
331 delete_event_callback (GtkWidget *widget, GdkEvent *event, gpointer user_data)
332 {
333  gtk_main_quit ();
334  gtk_widget_hide (GTK_WIDGET (user_data));
335  return TRUE;
336 }
337 
341 gboolean
342 clean_model_callback (GtkTreeModel *model, GtkTreePath *path,
343  GtkTreeIter *iter, gpointer data)
344 {
345  ModelNode *node;
346  gtk_tree_model_get (GTK_TREE_MODEL (model), iter, COL_NODE, &node, -1);
347  delete node;
348  gtk_tree_store_set (GTK_TREE_STORE (model), iter, COL_NODE, (ModelNode*) 0,
349  -1);
350  return FALSE;
351 }
352 
353 /************************** display functions used by default configurator **********************/
358 void
359 cell_data_function_col_1_config_default (GtkTreeViewColumn *col, GtkCellRenderer *renderer,
360  GtkTreeModel *model, GtkTreeIter *iter,
361  gpointer user_data)
362 {
363  ModelTypeid *node;
364  gtk_tree_model_get (model, iter, COL_TYPEID, &node, -1);
365  if (node->type == ModelTypeid::NODE_ATTRIBUTE)
366  {
367  g_object_set (renderer, "text", node->defaultValue.c_str (), (char*) 0);
368  g_object_set (renderer, "editable", TRUE, (char*) 0);
369  }
370  else
371  {
372  g_object_set (renderer, "text", "", (char*) 0);
373  g_object_set (renderer, "editable", FALSE, (char*) 0);
374  }
375 }
379 void
380 cell_data_function_col_0_config_default (GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model,
381  GtkTreeIter *iter, gpointer user_data)
382 {
383  ModelTypeid *node;
384  gtk_tree_model_get (model, iter, COL_NODE, &node, -1);
385  g_object_set (renderer, "editable", FALSE, (char*) 0);
386  switch (node->type)
387  {
389  g_object_set (renderer, "text", node->tid.GetName ().c_str (), (char*) 0);
390  break;
392  g_object_set (renderer, "text", node->name.c_str (), (char*) 0);
393  break;
394  }
395 }
396 
397 
403 void
404 cell_edited_callback_config_default (GtkCellRendererText *cell, gchar *path_string,
405  gchar *new_text, gpointer user_data)
406 {
407  GtkTreeModel *model = GTK_TREE_MODEL (user_data);
408  GtkTreeIter iter;
409  gtk_tree_model_get_iter_from_string (model, &iter, path_string);
410  ModelTypeid *node;
411  gtk_tree_model_get (model, &iter, COL_NODE, &node, -1);
414  {
415  node->defaultValue = new_text;
416  }
417 }
418 
433 gboolean
434 cell_tooltip_callback_config_default (GtkWidget *widget, gint x, gint y,
435  gboolean keyboard_tip, GtkTooltip *tooltip, gpointer user_data)
436 {
437  GtkTreeModel *model;
438  GtkTreeIter iter;
439  GtkTreeViewColumn * column;
440  if (!gtk_tree_view_get_tooltip_context (GTK_TREE_VIEW (widget), &x, &y,
441  keyboard_tip, &model, 0, &iter))
442  {
443  return FALSE;
444  }
445  if (!gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (widget), x, y, 0, &column, 0, 0))
446  {
447  return FALSE;
448  }
449  int col = get_col_number_from_tree_view_column (column);
450 
451  ModelTypeid *node;
452  gtk_tree_model_get (model, &iter, COL_NODE, &node, -1);
453 
454  switch (node->type)
455  {
457  if (col == 0)
458  {
459  std::string tip = "This object is of type " + node->tid.GetName ();
460  gtk_tooltip_set_text (tooltip, tip.c_str ());
461  return TRUE;
462  }
463  break;
465  {
466  uint32_t attrIndex = node->index;
467  if (col == 0)
468  {
469  std::string tip = node->tid.GetAttribute (attrIndex).help;
470  gtk_tooltip_set_text (tooltip, tip.c_str ());
471  }
472  else
473  {
474  Ptr<const AttributeChecker> checker = node->tid.GetAttribute (attrIndex).checker;
475  std::string tip;
476  tip = "This attribute is of type " + checker->GetValueTypeName ();
477  if (checker->HasUnderlyingTypeInformation ())
478  {
479  tip += " " + checker->GetUnderlyingTypeInformation ();
480  }
481  gtk_tooltip_set_text (tooltip, tip.c_str ());
482  }
483  return TRUE;
484  }
485  break;
486  }
487  return FALSE;
488 }
489 
497 void
498 save_clicked_default (GtkButton *button, gpointer user_data)
499 {
500  GtkWidget *parent_window = GTK_WIDGET (user_data);
501  GtkWidget *dialog;
502 
503  dialog = gtk_file_chooser_dialog_new ("Save File", GTK_WINDOW (parent_window), GTK_FILE_CHOOSER_ACTION_SAVE,
504  GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_SAVE,
505  GTK_RESPONSE_ACCEPT, (char *) 0);
506  gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog),
507  TRUE);
508 
509  gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), "config.txt");
510 
511  if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
512  {
513  char *filename;
514 
515  filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
516  RawTextConfigSave config;
517  config.SetFilename (filename);
518  config.Default ();
519  g_free (filename);
520  }
521 
522  gtk_widget_destroy (dialog);
523 }
524 
531 void
532 load_clicked_default (GtkButton *button, gpointer user_data)
533 {
534  GtkWidget *parent_window = GTK_WIDGET (user_data);
535  GtkWidget *dialog;
536 
537  dialog = gtk_file_chooser_dialog_new ("Open File", GTK_WINDOW (parent_window), GTK_FILE_CHOOSER_ACTION_OPEN,
538  GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN,
539  GTK_RESPONSE_ACCEPT, (char *) 0);
540 
541  if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
542  {
543  char *filename;
544 
545  filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
546  RawTextConfigLoad config;
547  config.SetFilename (filename);
548  config.Default ();
549  }
550 
551  gtk_widget_destroy (dialog);
552 }
553 
558 GtkWidget *
559 create_view_config_default (GtkTreeStore *model)
560 {
561  GtkTreeViewColumn *col;
562  GtkCellRenderer *renderer;
563  GtkWidget *view;
564 
565  view = gtk_tree_view_new ();
566  g_object_set (view, "has-tooltip", TRUE, (char*) 0);
567  g_signal_connect (view, "query-tooltip", (GCallback) cell_tooltip_callback_config_default, 0);
568 
569  gtk_tree_view_set_grid_lines (GTK_TREE_VIEW (view), GTK_TREE_VIEW_GRID_LINES_BOTH);
570  gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (view), TRUE);
571 
572  col = gtk_tree_view_column_new ();
573  gtk_tree_view_column_set_title (col, "Object Attributes");
574  gtk_tree_view_append_column (GTK_TREE_VIEW (view), col);
575  renderer = gtk_cell_renderer_text_new ();
576  gtk_tree_view_column_pack_start (col, renderer, TRUE);
577  gtk_tree_view_column_set_cell_data_func (col, renderer, cell_data_function_col_0_config_default, 0, 0);
578  g_object_set (renderer, "editable", FALSE, (char*) 0);
579 
580  col = gtk_tree_view_column_new ();
581  gtk_tree_view_column_set_title (col, "Attribute Value");
582  gtk_tree_view_append_column (GTK_TREE_VIEW (view), col);
583  renderer = gtk_cell_renderer_text_new ();
584  g_signal_connect (renderer, "edited", (GCallback) cell_edited_callback_config_default, model);
585  gtk_tree_view_column_pack_start (col, renderer, TRUE);
586  gtk_tree_view_column_set_cell_data_func (col, renderer, cell_data_function_col_1_config_default, 0, 0);
587 
588  gtk_tree_view_set_model (GTK_TREE_VIEW (view), GTK_TREE_MODEL (model));
589 
590  g_object_unref (model); /* destroy model automatically with view */
591 
592  return view;
593 }
594 
598 gboolean
599 clean_model_callback_config_default (GtkTreeModel *model, GtkTreePath *path,
600  GtkTreeIter *iter, gpointer data)
601 {
602  ModelTypeid *node;
603  gtk_tree_model_get (GTK_TREE_MODEL (model), iter, COL_TYPEID, &node, -1);
604  delete node;
605  gtk_tree_store_set (GTK_TREE_STORE (model), iter, COL_TYPEID, (ModelTypeid*) 0, -1);
606  return FALSE;
607 }
608 
609 
610 } //end ns3 namespace
611 
std::string GetName(void) const
Get the name.
Definition: type-id.cc:969
A class to enable saving of configuration store in a raw text file.
std::string name
node name
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
bool SetDefaultFailSafe(std::string fullName, const AttributeValue &value)
Definition: config.cc:790
virtual void Attributes(void)
Load or save the attributes values.
uint32_t index
index
Hold variables of type string.
Definition: string.h:41
enum ns3::ModelTypeid::@3 type
node type
void cell_data_function_col_1(GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data)
This function includes the name of the attribute or the editable value in the second column...
virtual void SetFilename(std::string filename)
Set the file name.
Ptr< Object > GetObject(void) const
Get the Object referenced by the PointerValue.
Definition: pointer.cc:55
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
Definition: assert.h:67
int get_col_number_from_tree_view_column(GtkTreeViewColumn *col)
This function gets the column number 0 or 1 from the mouse click.
bool HasParent(void) const
Check if this TypeId has a parent.
Definition: type-id.cc:943
virtual void SetFilename(std::string filename)
Set the file name.
void cell_edited_callback(GtkCellRendererText *cell, gchar *path_string, gchar *new_text, gpointer user_data)
This is the callback called when the value of an attribute is changed.
TypeId GetParent(void) const
Get the parent of this TypeId.
Definition: type-id.cc:936
virtual bool HasUnderlyingTypeInformation(void) const =0
enum ns3::ModelNode::@1 type
node type
std::string defaultValue
TypeId default value.
std::string Get(void) const
Definition: string.cc:31
virtual std::string GetValueTypeName(void) const =0
uint8_t data[writeSize]
void cell_data_function_col_1_config_default(GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data)
This function writes data in the second column, this data is going to be editable if it is a NODE_ATT...
gboolean cell_tooltip_callback(GtkWidget *widget, gint x, gint y, gboolean keyboard_tip, GtkTooltip *tooltip, gpointer user_data)
This function displays the tooltip for an object, pointer, vector item or an attribute.
gboolean cell_tooltip_callback_config_default(GtkWidget *widget, gint x, gint y, gboolean keyboard_tip, GtkTooltip *tooltip, gpointer user_data)
This function is used to display a tooltip whenever the user puts the mouse over a type ID or an attr...
Attribute implementation.
Definition: type-id.h:76
void load_clicked(GtkButton *button, gpointer user_data)
If the user presses the button load, it will load the config file into memory.
Ptr< Object > object
the object
Ptr< const AttributeChecker > checker
Checker object.
Definition: type-id.h:90
std::string name
TypeId name.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void cell_data_function_col_0_config_default(GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data)
This function writes the attribute or typeid name in the column 0.
Hold objects of type Ptr<T>.
Definition: pointer.h:36
std::string name
Attribute name.
Definition: type-id.h:78
GtkWidget * create_view_config_default(GtkTreeStore *model)
This is the main view opening the widget, getting tooltips and drawing the tree of attributes...
std::string GetAttributeFullName(std::size_t i) const
Get the Attribute name by index.
Definition: type-id.cc:1082
virtual void Attributes(void)
Load or save the attributes values.
GtkWidget * create_view(GtkTreeStore *model)
This is the main view opening the widget, getting tooltips and drawing the tree of attributes...
A class used in the implementation of the GtkConfigStore.
virtual void Default(void)
Load or save the default values.
TypeId tid
The TypeId object and if it is an attribute, it&#39;s the TypeId object of the attribute.
void cell_edited_callback_config_default(GtkCellRendererText *cell, gchar *path_string, gchar *new_text, gpointer user_data)
This functions is called whenever there is a change in the value of an attribute If the input value i...
void cell_data_function_col_0(GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data)
This function includes the name of the object, pointer, vector or vector item in the first column...
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
Definition: object.cc:79
void load_clicked_default(GtkButton *button, gpointer user_data)
If the user presses the button load, it will load the config file into memory.
std::size_t GetAttributeN(void) const
Get the number of attributes.
Definition: type-id.cc:1069
struct TypeId::AttributeInformation GetAttribute(std::size_t i) const
Get Attribute information by index.
Definition: type-id.cc:1076
void exit_clicked_callback(GtkButton *button, gpointer user_data)
Exit the window when exit button is pressed.
gboolean clean_model_callback(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
Delete the tree model contents.
uint32_t index
stores the index of the attribute in list of attributes for a given TypeId
gboolean clean_model_callback_config_default(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
Delete the tree model contents.
void save_clicked_default(GtkButton *button, gpointer user_data)
This is the action done when the user presses on the save button.
A class used in the implementation of the GtkConfigStore.
virtual std::string GetUnderlyingTypeInformation(void) const =0
gboolean delete_event_callback(GtkWidget *widget, GdkEvent *event, gpointer user_data)
Exit the application.
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
Definition: object-base.cc:185
A class to enable loading of configuration store from a raw text file.
a unique identifier for an interface.
Definition: type-id.h:58
void GetAttribute(std::string name, AttributeValue &value) const
Get the value of an attribute, raising fatal errors if unsuccessful.
Definition: object-base.cc:223
void save_clicked(GtkButton *button, gpointer user_data)
This is the action done when the user presses on the save button.
std::string help
Attribute help string.
Definition: type-id.h:80
virtual void Default(void)
Load or save the default values.