A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
display-functions.h
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#ifndef DISPLAY_FUNCTIONS_H
8#define DISPLAY_FUNCTIONS_H
9
10#include <gtk/gtk.h>
11
12namespace ns3
13{
14/**
15 * This function includes the name of the attribute or the editable value
16 * in the second column
17 *
18 * @param col Pointer to the GtkTreeViewColumn
19 * @param renderer Pointer to the GtkCellRenderer
20 * @param model Pointer to the GtkTreeModel
21 * @param iter Pointer to the GtkTreeIter
22 * @param user_data Pointer to the data to be displayed (or modified)
23 */
24void cell_data_function_col_1(GtkTreeViewColumn* col,
25 GtkCellRenderer* renderer,
26 GtkTreeModel* model,
27 GtkTreeIter* iter,
28 gpointer user_data);
29/**
30 * This function includes the name of the object, pointer, vector or vector item
31 * in the first column
32 * @param col Pointer to the GtkTreeViewColumn
33 * @param renderer Pointer to the GtkCellRenderer
34 * @param model Pointer to the GtkTreeModel
35 * @param iter Pointer to the GtkTreeIter
36 * @param user_data Pointer to the data to be displayed (or modified)
37 */
38void cell_data_function_col_0(GtkTreeViewColumn* col,
39 GtkCellRenderer* renderer,
40 GtkTreeModel* model,
41 GtkTreeIter* iter,
42 gpointer user_data);
43/**
44 * This is the callback called when the value of an attribute is changed
45 *
46 * @param cell the changed cell
47 * @param path_string the path
48 * @param new_text the updated text in the cell
49 * @param user_data user data
50 */
51void cell_edited_callback(GtkCellRendererText* cell,
52 gchar* path_string,
53 gchar* new_text,
54 gpointer user_data);
55/**
56 * This function gets the column number 0 or 1 from the mouse
57 * click
58 * @param col the column being clicked
59 * @returns the column index
60 */
61int get_col_number_from_tree_view_column(GtkTreeViewColumn* col);
62/**
63 * This function displays the tooltip for an object, pointer, vector
64 * item or an attribute
65 *
66 * @param widget is the display object
67 * @param x is the x position
68 * @param y is the y position
69 * @param keyboard_tip
70 * @param tooltip is the tooltip information to be displayed
71 * @param user_data
72 * @return false if the tooltip is not displayed
73 */
74gboolean cell_tooltip_callback(GtkWidget* widget,
75 gint x,
76 gint y,
77 gboolean keyboard_tip,
78 GtkTooltip* tooltip,
79 gpointer user_data);
80/**
81 * This is the main view opening the widget, getting tooltips and drawing the
82 * tree of attributes...
83 * @param model the GtkTreeStore model
84 * @returns a GtkWidget on success
85 */
86GtkWidget* create_view(GtkTreeStore* model);
87/**
88 * Exit the window when exit button is pressed
89 * @param button the pressed button
90 * @param user_data
91 */
92void exit_clicked_callback(GtkButton* button, gpointer user_data);
93/**
94 * Exit the application
95 * @param widget a pointer to the widget
96 * @param event the event responsible for the application exit
97 * @param user_data user data
98 * @returns true on clean exit
99 */
100gboolean delete_event_callback(GtkWidget* widget, GdkEvent* event, gpointer user_data);
101/**
102 * Delete the tree model contents
103 * @param model the GtkTreeModel
104 * @param path the GtkTreePath
105 * @param iter a GtkTreeIter
106 * @param data user data
107 * @return true if an error occurred.
108 */
109gboolean clean_model_callback(GtkTreeModel* model,
110 GtkTreePath* path,
111 GtkTreeIter* iter,
112 gpointer data);
113
114// display functions used by default configurator
115
116/**
117 * This function writes data in the second column, this data is going to be editable
118 * if it is a NODE_ATTRIBUTE
119 *
120 * @param col Pointer to the GtkTreeViewColumn
121 * @param renderer Pointer to the GtkCellRenderer
122 * @param model Pointer to the GtkTreeModel
123 * @param iter Pointer to the GtkTreeIter
124 * @param user_data Pointer to the data to be displayed (or modified)
125 */
126void cell_data_function_col_1_config_default(GtkTreeViewColumn* col,
127 GtkCellRenderer* renderer,
128 GtkTreeModel* model,
129 GtkTreeIter* iter,
130 gpointer user_data);
131/**
132 * This function writes the attribute or typeid name in the column 0
133 * @param col Pointer to the GtkTreeViewColumn
134 * @param renderer Pointer to the GtkCellRenderer
135 * @param model Pointer to the GtkTreeModel
136 * @param iter Pointer to the GtkTreeIter
137 * @param user_data Pointer to the data to be displayed (or modified)
138 */
139void cell_data_function_col_0_config_default(GtkTreeViewColumn* col,
140 GtkCellRenderer* renderer,
141 GtkTreeModel* model,
142 GtkTreeIter* iter,
143 gpointer user_data);
144/**
145 * This is the action done when the user presses on the save button for the Default attributes.
146 * It will save the config to a file.
147 *
148 * @param button (unused)
149 * @param user_data
150 */
151void save_clicked_default(GtkButton* button, gpointer user_data);
152/**
153 * If the user presses the button load, it will load the config file into memory for the Default
154 * attributes.
155 *
156 * @param button (unused)
157 * @param user_data
158 */
159void load_clicked_default(GtkButton* button, gpointer user_data);
160/**
161 * This is the action done when the user presses on the save button for the Attributes.
162 * It will save the config to a file.
163 *
164 * @param button (unused)
165 * @param user_data
166 */
167void save_clicked_attribute(GtkButton* button, gpointer user_data);
168/**
169 * If the user presses the button load, it will load the config file into memory for the Attributes.
170 *
171 * @param button (unused)
172 * @param user_data
173 */
174void load_clicked_attribute(GtkButton* button, gpointer user_data);
175/**
176 * This functions is called whenever there is a change in the value of an attribute
177 * If the input value is ok, it will be updated in the default value and in the
178 * GUI, otherwise, it won't be updated in both.
179 *
180 * @param cell the changed cell
181 * @param path_string the path
182 * @param new_text the updated text in the cell
183 * @param user_data user data
184 */
185void cell_edited_callback_config_default(GtkCellRendererText* cell,
186 gchar* path_string,
187 gchar* new_text,
188 gpointer user_data);
189/**
190 * This function is used to display a tooltip whenever the user puts the mouse
191 * over a type ID or an attribute. It will give the type and the possible values of
192 * an attribute value and the type of the object for an attribute object or a
193 * typeID object
194 *
195 * @param widget is the display object
196 * @param x is the x position
197 * @param y is the y position
198 * @param keyboard_tip
199 * @param tooltip is the tooltip information to be displayed
200 * @param user_data
201 * @return false if the tooltip is not displayed
202 */
203gboolean cell_tooltip_callback_config_default(GtkWidget* widget,
204 gint x,
205 gint y,
206 gboolean keyboard_tip,
207 GtkTooltip* tooltip,
208 gpointer user_data);
209/**
210 * This is the main view opening the widget, getting tooltips and drawing the
211 * tree of attributes
212 * @param model the GtkTreeStore model
213 * @returns a GtkWidget on success
214 */
215GtkWidget* create_view_config_default(GtkTreeStore* model);
216/**
217 * Delete the tree model contents
218 * @param model the GtkTreeModel
219 * @param path the GtkTreePath
220 * @param iter a GtkTreeIter
221 * @param data user data
222 * @return true if an error occurred.
223 */
224gboolean clean_model_callback_config_default(GtkTreeModel* model,
225 GtkTreePath* path,
226 GtkTreeIter* iter,
227 gpointer data);
228} // namespace ns3
229
230#endif
cairo_uint64_t x
_cairo_uint_96by64_32x64_divrem:
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]