A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
display-functions.cc
Go to the documentation of this file.
1/*
2 * SPDX-License-Identifier: GPL-2.0-only
3 *
4 * Authors: Faker Moatamri <faker.moatamri@sophia.inria.fr>
5 * Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
6 */
7
8#include "display-functions.h"
9
10#include "model-node-creator.h"
12#include "raw-text-config.h"
13
14#include "ns3/config.h"
15#include "ns3/pointer.h"
16#include "ns3/string.h"
17
18namespace ns3
19{
20/*
21 * This function includes the name of the attribute or the editable value
22 * in the second column
23 */
24void
25cell_data_function_col_1(GtkTreeViewColumn* col,
26 GtkCellRenderer* renderer,
27 GtkTreeModel* model,
28 GtkTreeIter* iter,
29 gpointer user_data)
30{
31 ModelNode* node = nullptr;
32 gtk_tree_model_get(model, iter, COL_NODE, &node, -1);
33 if (!node)
34 {
35 return;
36 }
38 {
39 StringValue str;
40 node->object->GetAttribute(node->name, str);
41 g_object_set(renderer, "text", str.Get().c_str(), nullptr);
42 g_object_set(renderer, "editable", TRUE, nullptr);
43 }
44 else
45 {
46 g_object_set(renderer, "text", "", nullptr);
47 g_object_set(renderer, "editable", FALSE, nullptr);
48 }
49}
50
51/*
52 * This function includes the name of the object, pointer, vector or vector item
53 * in the first column
54 */
55void
56cell_data_function_col_0(GtkTreeViewColumn* col,
57 GtkCellRenderer* renderer,
58 GtkTreeModel* model,
59 GtkTreeIter* iter,
60 gpointer user_data)
61{
62 ModelNode* node = nullptr;
63 gtk_tree_model_get(model, iter, COL_NODE, &node, -1);
64 g_object_set(renderer, "editable", FALSE, nullptr);
65 if (!node)
66 {
67 return;
68 }
69
70 switch (node->type)
71 {
73 g_object_set(renderer,
74 "text",
75 node->object->GetInstanceTypeId().GetName().c_str(),
76 nullptr);
77 break;
81 g_object_set(renderer, "text", node->name.c_str(), nullptr);
82 break;
84 std::stringstream oss;
85 oss << node->index;
86 g_object_set(renderer, "text", oss.str().c_str(), nullptr);
87 break;
88 }
89}
90
91/*
92 * This is the callback called when the value of an attribute is changed
93 */
94void
95cell_edited_callback(GtkCellRendererText* cell,
96 gchar* path_string,
97 gchar* new_text,
98 gpointer user_data)
99{
100 GtkTreeModel* model = GTK_TREE_MODEL(user_data);
101 GtkTreeIter iter;
102 gtk_tree_model_get_iter_from_string(model, &iter, path_string);
103 ModelNode* node = nullptr;
104 gtk_tree_model_get(model, &iter, COL_NODE, &node, -1);
105 if (!node)
106 {
107 return;
108 }
110 node->object->SetAttribute(node->name, StringValue(new_text));
111}
112
113/*
114 * This function gets the column number 0 or 1 from the mouse
115 * click
116 */
117int
119{
120 GList* cols;
121 int num;
122 g_return_val_if_fail(col != nullptr, -1);
123 g_return_val_if_fail(gtk_tree_view_column_get_tree_view(col) != nullptr, -1);
124 cols = gtk_tree_view_get_columns(GTK_TREE_VIEW(gtk_tree_view_column_get_tree_view(col)));
125 num = g_list_index(cols, (gpointer)col);
126 g_list_free(cols);
127 return num;
128}
129
130/*
131 * This function displays the tooltip for an object, pointer, vector
132 * item or an attribute
133 */
134gboolean
135cell_tooltip_callback(GtkWidget* widget,
136 gint x,
137 gint y,
138 gboolean keyboard_tip,
139 GtkTooltip* tooltip,
140 gpointer user_data)
141{
142 GtkTreeModel* model;
143 GtkTreeIter iter;
144 GtkTreeViewColumn* column;
145 if (!gtk_tree_view_get_tooltip_context(GTK_TREE_VIEW(widget),
146 &x,
147 &y,
148 keyboard_tip,
149 &model,
150 nullptr,
151 &iter))
152 {
153 return FALSE;
154 }
155 if (!gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(widget),
156 x,
157 y,
158 nullptr,
159 &column,
160 nullptr,
161 nullptr))
162 {
163 return FALSE;
164 }
165 int col = get_col_number_from_tree_view_column(column);
166
167 ModelNode* node = nullptr;
168 gtk_tree_model_get(model, &iter, COL_NODE, &node, -1);
169 if (!node)
170 {
171 return FALSE;
172 }
173
174 switch (node->type)
175 {
177 if (col == 0)
178 {
179 std::string tip =
180 "This object is of type " + node->object->GetInstanceTypeId().GetName();
181 gtk_tooltip_set_text(tooltip, tip.c_str());
182 return TRUE;
183 }
184 break;
186 if (col == 0)
187 {
188 PointerValue ptr;
189 node->object->GetAttribute(node->name, ptr);
190 std::string tip =
191 "This object is of type " + ptr.GetObject()->GetInstanceTypeId().GetName();
192 gtk_tooltip_set_text(tooltip, tip.c_str());
193 return TRUE;
194 }
195 break;
197 break;
199 if (col == 0)
200 {
201 std::string tip =
202 "This object is of type " + node->object->GetInstanceTypeId().GetName();
203 gtk_tooltip_set_text(tooltip, tip.c_str());
204 return TRUE;
205 }
206 break;
208 uint32_t attrIndex = 0;
209 TypeId tid;
210 for (tid = node->object->GetInstanceTypeId(); tid.HasParent(); tid = tid.GetParent())
211 {
212 for (uint32_t i = 0; i < tid.GetAttributeN(); ++i)
213 {
214 if (tid.GetAttribute(i).name == node->name)
215 {
216 attrIndex = i;
217 goto out;
218 }
219 }
220 }
221 out:
222 if (col == 0)
223 {
224 std::string tip = tid.GetAttribute(attrIndex).help;
225 gtk_tooltip_set_text(tooltip, tip.c_str());
226 }
227 else
228 {
229 TypeId::AttributeInformation info = tid.GetAttribute(attrIndex);
231 std::string tip;
232 tip = "This attribute is of type " + checker->GetValueTypeName();
233 if (checker->HasUnderlyingTypeInformation())
234 {
235 tip += " " + checker->GetUnderlyingTypeInformation();
236 }
237 gtk_tooltip_set_text(tooltip, tip.c_str());
238 }
239 return TRUE;
240 }
241 break;
242 }
243 return FALSE;
244}
245
246/*
247 * This is the main view opening the widget, getting tooltips and drawing the
248 * tree of attributes...
249 */
250GtkWidget*
251create_view(GtkTreeStore* model)
252{
253 GtkTreeViewColumn* col;
254 GtkCellRenderer* renderer;
255 GtkWidget* view;
256
257 view = gtk_tree_view_new();
258 g_object_set(view, "has-tooltip", TRUE, nullptr);
259 g_signal_connect(view, "query-tooltip", (GCallback)cell_tooltip_callback, 0);
260
261 gtk_tree_view_set_grid_lines(GTK_TREE_VIEW(view), GTK_TREE_VIEW_GRID_LINES_BOTH);
262 // gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (view), TRUE);
263
264 col = gtk_tree_view_column_new();
265 gtk_tree_view_column_set_title(col, "Object Attributes");
266 gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);
267 renderer = gtk_cell_renderer_text_new();
268 gtk_tree_view_column_pack_start(col, renderer, TRUE);
269 gtk_tree_view_column_set_cell_data_func(col,
270 renderer,
272 nullptr,
273 nullptr);
274 g_object_set(renderer, "editable", FALSE, nullptr);
275
276 col = gtk_tree_view_column_new();
277 gtk_tree_view_column_set_title(col, "Attribute Value");
278 gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);
279 renderer = gtk_cell_renderer_text_new();
280 g_signal_connect(renderer, "edited", (GCallback)cell_edited_callback, model);
281 gtk_tree_view_column_pack_start(col, renderer, TRUE);
282 gtk_tree_view_column_set_cell_data_func(col,
283 renderer,
285 nullptr,
286 nullptr);
287
288 gtk_tree_view_set_model(GTK_TREE_VIEW(view), GTK_TREE_MODEL(model));
289
290 g_object_unref(model); /* destroy model automatically with view */
291
292 return view;
293}
294
295/*
296 * Exit the window when exit button is pressed
297 */
298void
299exit_clicked_callback(GtkButton* button, gpointer user_data)
300{
301 gtk_main_quit();
302 gtk_widget_hide(GTK_WIDGET(user_data));
303}
304
305/*
306 * Exit the application
307 */
308gboolean
309delete_event_callback(GtkWidget* widget, GdkEvent* event, gpointer user_data)
310{
311 gtk_main_quit();
312 gtk_widget_hide(GTK_WIDGET(user_data));
313 return TRUE;
314}
315
316/*
317 * Delete the tree model contents
318 */
319gboolean
320clean_model_callback(GtkTreeModel* model, GtkTreePath* path, GtkTreeIter* iter, gpointer data)
321{
322 ModelNode* node = nullptr;
323 gtk_tree_model_get(GTK_TREE_MODEL(model), iter, COL_NODE, &node, -1);
324 if (node)
325 {
326 delete node;
327 }
328 gtk_tree_store_set(GTK_TREE_STORE(model), iter, COL_NODE, nullptr, -1);
329 return FALSE;
330}
331
332// display functions used by default configurator
333/*
334 * This function writes data in the second column, this data is going to be editable
335 * if it is a NODE_ATTRIBUTE
336 */
337void
339 GtkCellRenderer* renderer,
340 GtkTreeModel* model,
341 GtkTreeIter* iter,
342 gpointer user_data)
343{
344 ModelTypeid* node = nullptr;
345 gtk_tree_model_get(model, iter, COL_TYPEID, &node, -1);
346 if (!node)
347 {
348 return;
349 }
351 {
352 g_object_set(renderer, "text", node->defaultValue.c_str(), nullptr);
353 g_object_set(renderer, "editable", TRUE, nullptr);
354 }
355 else
356 {
357 g_object_set(renderer, "text", "", nullptr);
358 g_object_set(renderer, "editable", FALSE, nullptr);
359 }
360}
361
362/*
363 * This function writes the attribute or typeid name in the column 0
364 */
365void
367 GtkCellRenderer* renderer,
368 GtkTreeModel* model,
369 GtkTreeIter* iter,
370 gpointer user_data)
371{
372 ModelTypeid* node = nullptr;
373 gtk_tree_model_get(model, iter, COL_NODE, &node, -1);
374 g_object_set(renderer, "editable", FALSE, nullptr);
375 if (!node)
376 {
377 return;
378 }
379
380 switch (node->type)
381 {
383 g_object_set(renderer, "text", node->tid.GetName().c_str(), nullptr);
384 break;
386 g_object_set(renderer, "text", node->name.c_str(), nullptr);
387 break;
388 }
389}
390
391/*
392 * This functions is called whenever there is a change in the value of an attribute
393 * If the input value is ok, it will be updated in the default value and in the
394 * gui, otherwise, it won't be updated in both.
395 */
396void
397cell_edited_callback_config_default(GtkCellRendererText* cell,
398 gchar* path_string,
399 gchar* new_text,
400 gpointer user_data)
401{
402 GtkTreeModel* model = GTK_TREE_MODEL(user_data);
403 GtkTreeIter iter;
404 gtk_tree_model_get_iter_from_string(model, &iter, path_string);
405 ModelTypeid* node = nullptr;
406 gtk_tree_model_get(model, &iter, COL_NODE, &node, -1);
407 if (!node)
408 {
409 return;
410 }
413 StringValue(new_text)))
414 {
415 node->defaultValue = new_text;
416 }
417}
418
419/*
420 * This function is used to display a tooltip whenever the user puts the mouse
421 * over a type ID or an attribute. It will give the type and the possible values of
422 * an attribute value and the type of the object for an attribute object or a
423 * typeID object
424 *
425 * @param widget is the display object
426 * @param x is the x position
427 * @param y is the y position
428 * @param keyboard_tip
429 * @param tooltip is the tooltip information to be displayed
430 * @param user_data
431 * @return false if the tooltip is not displayed
432 */
433gboolean
435 gint x,
436 gint y,
437 gboolean keyboard_tip,
438 GtkTooltip* tooltip,
439 gpointer user_data)
440{
441 GtkTreeModel* model;
442 GtkTreeIter iter;
443 GtkTreeViewColumn* column;
444 if (!gtk_tree_view_get_tooltip_context(GTK_TREE_VIEW(widget),
445 &x,
446 &y,
447 keyboard_tip,
448 &model,
449 nullptr,
450 &iter))
451 {
452 return FALSE;
453 }
454 if (!gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(widget),
455 x,
456 y,
457 nullptr,
458 &column,
459 nullptr,
460 nullptr))
461 {
462 return FALSE;
463 }
464 int col = get_col_number_from_tree_view_column(column);
465
466 ModelTypeid* node = nullptr;
467 gtk_tree_model_get(model, &iter, COL_NODE, &node, -1);
468 if (!node)
469 {
470 return FALSE;
471 }
472
473 switch (node->type)
474 {
476 if (col == 0)
477 {
478 std::string tip = "This object is of type " + node->tid.GetName();
479 gtk_tooltip_set_text(tooltip, tip.c_str());
480 return TRUE;
481 }
482 break;
484 uint32_t attrIndex = node->index;
485 if (col == 0)
486 {
487 std::string tip = node->tid.GetAttribute(attrIndex).help;
488 gtk_tooltip_set_text(tooltip, tip.c_str());
489 }
490 else
491 {
492 Ptr<const AttributeChecker> checker = node->tid.GetAttribute(attrIndex).checker;
493 std::string tip;
494 tip = "This attribute is of type " + checker->GetValueTypeName();
495 if (checker->HasUnderlyingTypeInformation())
496 {
497 tip += " " + checker->GetUnderlyingTypeInformation();
498 }
499 gtk_tooltip_set_text(tooltip, tip.c_str());
500 }
501 return TRUE;
502 }
503 break;
504 }
505 return FALSE;
506}
507
508/*
509 * This is the action done when the user presses on the save button.
510 * It will save the config to a file.
511 *
512 * @param button (unused)
513 * @param user_data
514 */
515void
516save_clicked_default(GtkButton* button, gpointer user_data)
517{
518 GtkWindow* parent_window = GTK_WINDOW(user_data);
519
520 GtkFileChooserNative* native;
521 GtkFileChooser* chooser;
522 GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_SAVE;
523 gint res;
524
525 native = gtk_file_chooser_native_new("Save File", parent_window, action, "_Save", "_Cancel");
526 chooser = GTK_FILE_CHOOSER(native);
527
528 gtk_file_chooser_set_do_overwrite_confirmation(chooser, TRUE);
529
530 gtk_file_chooser_set_current_name(chooser, ("config-defaults.txt"));
531
532 res = gtk_native_dialog_run(GTK_NATIVE_DIALOG(native));
533 if (res == GTK_RESPONSE_ACCEPT)
534 {
535 char* filename;
536
537 filename = gtk_file_chooser_get_filename(chooser);
538 RawTextConfigSave config;
539 config.SetFilename(filename);
540 config.Default();
541 g_free(filename);
542 }
543
544 g_object_unref(native);
545}
546
547/*
548 * If the user presses the button load, it will load the config file into memory.
549 *
550 * @param button (unused)
551 * @param user_data
552 */
553void
554load_clicked_default(GtkButton* button, gpointer user_data)
555{
556 GtkWindow* parent_window = GTK_WINDOW(user_data);
557 GtkFileChooserNative* native;
558 GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_OPEN;
559 gint res;
560
561 native = gtk_file_chooser_native_new("Open File", parent_window, action, "_Open", "_Cancel");
562
563 res = gtk_native_dialog_run(GTK_NATIVE_DIALOG(native));
564 if (res == GTK_RESPONSE_ACCEPT)
565 {
566 char* filename;
567 GtkFileChooser* chooser = GTK_FILE_CHOOSER(native);
568 filename = gtk_file_chooser_get_filename(chooser);
569 RawTextConfigLoad config;
570 config.SetFilename(filename);
571 config.Default();
572 g_free(filename);
573 }
574
575 g_object_unref(native);
576}
577
578/*
579 * This is the action done when the user presses on the save button.
580 * It will save the config to a file.
581 *
582 * @param button (unused)
583 * @param user_data
584 */
585void
586save_clicked_attribute(GtkButton* button, gpointer user_data)
587{
588 GtkWindow* parent_window = GTK_WINDOW(user_data);
589
590 GtkFileChooserNative* native;
591 GtkFileChooser* chooser;
592 GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_SAVE;
593 gint res;
594
595 native = gtk_file_chooser_native_new("Save File", parent_window, action, "_Save", "_Cancel");
596 chooser = GTK_FILE_CHOOSER(native);
597
598 gtk_file_chooser_set_do_overwrite_confirmation(chooser, TRUE);
599
600 gtk_file_chooser_set_current_name(chooser, ("config-attributes.txt"));
601
602 res = gtk_native_dialog_run(GTK_NATIVE_DIALOG(native));
603 if (res == GTK_RESPONSE_ACCEPT)
604 {
605 char* filename;
606
607 filename = gtk_file_chooser_get_filename(chooser);
608 RawTextConfigSave config;
609 config.SetFilename(filename);
610 config.Attributes();
611 g_free(filename);
612 }
613
614 g_object_unref(native);
615}
616
617/*
618 * If the user presses the button load, it will load the config file into memory.
619 *
620 * @param button (unused)
621 * @param user_data
622 */
623void
624load_clicked_attribute(GtkButton* button, gpointer user_data)
625{
626 GtkWindow* parent_window = GTK_WINDOW(user_data);
627 GtkFileChooserNative* native;
628 GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_OPEN;
629 gint res;
630
631 native = gtk_file_chooser_native_new("Open File", parent_window, action, "_Open", "_Cancel");
632
633 res = gtk_native_dialog_run(GTK_NATIVE_DIALOG(native));
634 if (res == GTK_RESPONSE_ACCEPT)
635 {
636 char* filename;
637 GtkFileChooser* chooser = GTK_FILE_CHOOSER(native);
638 filename = gtk_file_chooser_get_filename(chooser);
639 RawTextConfigLoad config;
640 config.SetFilename(filename);
641 config.Attributes();
642 g_free(filename);
643 }
644
645 g_object_unref(native);
646}
647
648/*
649 * This is the main view opening the widget, getting tooltips and drawing the
650 * tree of attributes
651 */
652GtkWidget*
653create_view_config_default(GtkTreeStore* model)
654{
655 GtkTreeViewColumn* col;
656 GtkCellRenderer* renderer;
657 GtkWidget* view;
658
659 view = gtk_tree_view_new();
660 g_object_set(view, "has-tooltip", TRUE, nullptr);
661 g_signal_connect(view, "query-tooltip", (GCallback)cell_tooltip_callback_config_default, 0);
662
663 gtk_tree_view_set_grid_lines(GTK_TREE_VIEW(view), GTK_TREE_VIEW_GRID_LINES_BOTH);
664 // gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (view), TRUE);
665
666 col = gtk_tree_view_column_new();
667 gtk_tree_view_column_set_title(col, "Object Attributes");
668 gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);
669 renderer = gtk_cell_renderer_text_new();
670 gtk_tree_view_column_pack_start(col, renderer, TRUE);
671 gtk_tree_view_column_set_cell_data_func(col,
672 renderer,
674 nullptr,
675 nullptr);
676 g_object_set(renderer, "editable", FALSE, nullptr);
677
678 col = gtk_tree_view_column_new();
679 gtk_tree_view_column_set_title(col, "Attribute Value");
680 gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);
681 renderer = gtk_cell_renderer_text_new();
682 g_signal_connect(renderer, "edited", (GCallback)cell_edited_callback_config_default, model);
683 gtk_tree_view_column_pack_start(col, renderer, TRUE);
684 gtk_tree_view_column_set_cell_data_func(col,
685 renderer,
687 nullptr,
688 nullptr);
689
690 gtk_tree_view_set_model(GTK_TREE_VIEW(view), GTK_TREE_MODEL(model));
691
692 g_object_unref(model); /* destroy model automatically with view */
693
694 return view;
695}
696
697/*
698 * Delete the tree model contents
699 */
700gboolean
702 GtkTreePath* path,
703 GtkTreeIter* iter,
704 gpointer data)
705{
706 ModelTypeid* node = nullptr;
707 gtk_tree_model_get(GTK_TREE_MODEL(model), iter, COL_TYPEID, &node, -1);
708 if (node)
709 {
710 delete node;
711 }
712 gtk_tree_store_set(GTK_TREE_STORE(model), iter, COL_TYPEID, nullptr, -1);
713 return FALSE;
714}
715
716} // namespace ns3
cairo_uint64_t x
_cairo_uint_96by64_32x64_divrem:
AttributeValue implementation for Pointer.
Definition pointer.h:37
Ptr< Object > GetObject() const
Get the Object referenced by the PointerValue.
Definition pointer.cc:46
Smart pointer class similar to boost::intrusive_ptr.
Definition ptr.h:70
A class to enable loading of configuration store from a raw text file.
void SetFilename(std::string filename) override
Set the file name.
void Attributes() override
Load or save the attributes values.
void Default() override
Load or save the default values.
A class to enable saving of configuration store in a raw text file.
void Attributes() override
Load or save the attributes values.
void SetFilename(std::string filename) override
Set the file name.
void Default() override
Load or save the default values.
Hold variables of type string.
Definition string.h:45
a unique identifier for an interface.
Definition type-id.h:49
bool HasParent() const
Check if this TypeId has a parent.
Definition type-id.cc:1031
std::string GetAttributeFullName(std::size_t i) const
Get the Attribute name by index.
Definition type-id.cc:1183
std::size_t GetAttributeN() const
Get the number of attributes.
Definition type-id.cc:1168
TypeId GetParent() const
Get the parent of this TypeId.
Definition type-id.cc:1023
TypeId::AttributeInformation GetAttribute(std::size_t i) const
Get Attribute information by index.
Definition type-id.cc:1176
std::string GetName() const
Get the name.
Definition type-id.cc:1059
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition assert.h:55
bool SetDefaultFailSafe(std::string fullName, const AttributeValue &value)
Definition config.cc:896
Every class exported by the ns3 library is enclosed in the ns3 namespace.
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 clean_model_callback(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
Delete the tree model contents.
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.
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.
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.
void save_clicked_attribute(GtkButton *button, gpointer user_data)
This is the action done when the user presses on the save button for the Attributes.
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...
gboolean delete_event_callback(GtkWidget *widget, GdkEvent *event, gpointer user_data)
Exit the application.
void exit_clicked_callback(GtkButton *button, gpointer user_data)
Exit the window when exit button is pressed.
GtkWidget * create_view_config_default(GtkTreeStore *model)
This is the main view opening the widget, getting tooltips and drawing the tree of attributes.
gboolean clean_model_callback_config_default(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
Delete the tree model contents.
int get_col_number_from_tree_view_column(GtkTreeViewColumn *col)
This function gets the column number 0 or 1 from the mouse click.
GtkWidget * create_view(GtkTreeStore *model)
This is the main view opening the widget, getting tooltips and drawing the tree of attributes....
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.
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 save_clicked_default(GtkButton *button, gpointer user_data)
This is the action done when the user presses on the save button for the Default attributes.
void load_clicked_default(GtkButton *button, gpointer user_data)
If the user presses the button load, it will load the config file into memory for the Default attribu...
void load_clicked_attribute(GtkButton *button, gpointer user_data)
If the user presses the button load, it will load the config file into memory for the Attributes.
uint8_t data[writeSize]
A class used in the implementation of the GtkConfigStore.
Ptr< Object > object
the object
uint32_t index
index
std::string name
node name
enum ns3::ModelNode::@353265371332124272263363322234150343123022342154 type
node type structure
A class used in the implementation of the GtkConfigStore.
uint32_t index
stores the index of the attribute in list of attributes for a given TypeId
TypeId tid
The TypeId object and if it is an attribute, it's the TypeId object of the attribute.
enum ns3::ModelTypeid::@372067002020026241074307157075166374022350367224 type
Whether the node represents an attribute or TypeId.
std::string defaultValue
TypeId default value.
std::string name
TypeId name.
Attribute implementation.
Definition type-id.h:86
std::string name
Attribute name.
Definition type-id.h:88
Ptr< const AttributeChecker > checker
Checker object.
Definition type-id.h:100
std::string help
Attribute help string.
Definition type-id.h:90