#include <libheraia.h>
Go to the source code of this file.
Functions | |
static guint | which_endianness (heraia_window_t *main_window) |
Determines which endianness is selected that is to say which radio button is active in the window. | |
static guint | which_stream_size (heraia_window_t *main_window) |
returns stream size as selected in the spin button | |
static void | interpret (doc_t *doc, DecodeFunc decode_it, decode_parameters_t *decode_parameters, GtkWidget *entry, guint length) |
Here we do interpret a something according to the decode_it function and we write down the result in a widget designated "entry". | |
static void | close_data_interpretor_window (GtkWidget *widget, gpointer data) |
"Emulates" the user click on the main window menu entry called DIMenu whose aim is to display or hide the data interpretor window | |
static void | connect_data_interpretor_signals (heraia_window_t *main_window) |
Connects data interpretor window's signals to the right functions. | |
static void | refresh_one_row (doc_t *doc, decode_generic_t *row, guint nb_cols, decode_parameters_t *decode_parameters) |
This function refreshes one row of the tab. | |
static void | refresh_one_tab (doc_t *doc, data_window_t *dw, tab_t *tab, decode_parameters_t *decode_parameters) |
This function refreshes one entire tab (row by row). | |
static void | refresh_all_tabs (doc_t *doc, data_window_t *dw, decode_parameters_t *decode_parameters) |
Refreshes all tabs. | |
static void | add_default_tabs (heraia_window_t *main_window) |
Inits data interpretor with default tabs Must be called only once at bootime. | |
void | refresh_data_interpretor_window (GtkWidget *widget, gpointer data) |
Refreshes the data interpretor window with the new values. | |
void | data_interpretor_init_interface (heraia_window_t *main_window) |
Inits the data interpretor structure and window with default values. | |
tab_t * | add_new_tab_in_data_interpretor (GtkNotebook *notebook, guint index, gchar *label, guint nb_cols,...) |
Adds a new tab in the data interpretor window. | |
void | add_new_row_to_tab (tab_t *tab, decode_generic_t *row) |
Adds a row to a particular tab. |
Definition in file data_interpretor.c.
static void add_default_tabs | ( | heraia_window_t * | main_window | ) | [static] |
Inits data interpretor with default tabs Must be called only once at bootime.
main_window | : main_structure |
Adding a tab for numbers
Adding a tab for floting numbers
Adding a tab for date and time
Adding a tab for binary based conversions
Definition at line 477 of file data_interpretor.c.
References add_new_row_to_tab(), add_new_tab_in_data_interpretor(), heraia_window_t::current_DW, decode_16bits_signed(), decode_16bits_unsigned(), decode_32bits_signed(), decode_32bits_unsigned(), decode_64bits_signed(), decode_64bits_unsigned(), decode_8bits_signed(), decode_8bits_unsigned(), decode_C_date(), decode_dos_date(), decode_double_normal(), decode_double_scientific(), decode_filetime_date(), decode_float_normal(), decode_float_scientific(), decode_HFS_date(), decode_packed_BCD(), decode_to_bits(), heraia_get_widget(), xml_t::main, data_window_t::nb_tabs, new_decode_generic_t(), data_window_t::tabs, and heraia_window_t::xmls.
Referenced by data_interpretor_init_interface().
void add_new_row_to_tab | ( | tab_t * | tab, | |
decode_generic_t * | row | |||
) |
Adds a row to a particular tab.
tab | : the tab to which we want to add the row | |
row | : the row we want to add (make sure it has been initialized) |
< the vbox to which we want to pack
< couple from which we want to pack the entry
Definition at line 435 of file data_interpretor.c.
References decode_t::entry, tab_t::nb_rows, tab_t::rows, and tab_t::vboxes.
Referenced by add_default_tabs().
tab_t* add_new_tab_in_data_interpretor | ( | GtkNotebook * | notebook, | |
guint | index, | |||
gchar * | label, | |||
guint | nb_cols, | |||
... | ||||
) |
Adds a new tab in the data interpretor window.
notebook | : the notebook to which we want to add this new tab | |
index | : index of this new tab. If you rely on this make sure it's a primary key ! | |
label | : label of the tab | |
nb_cols | : number of columns (including the first column of labels) | |
... | : nb_cols arguments that will be the labels of the columns |
< tab structure that will remember everything !
< va_list arguments passed to create a new tab with those columns
< used to fetch atguments
< used to remember the columns labels (the arguments in GtkWidgets)
< used to remember vboxes (in order to be able to pack things later
< notebook tab's child container
< used for hpaned creation
< in case that we have more than 2 arguments
< used for vbox creation
< used for label creation in the new vboxes
Definition at line 350 of file data_interpretor.c.
References tab_t::col_labels, tab_t::index, tab_t::label, tab_t::nb_cols, tab_t::nb_rows, tab_t::rows, and tab_t::vboxes.
Referenced by add_default_tabs().
static void close_data_interpretor_window | ( | GtkWidget * | widget, | |
gpointer | data | |||
) | [static] |
"Emulates" the user click on the main window menu entry called DIMenu whose aim is to display or hide the data interpretor window
widget | : the widget caller (may be NULL here) | |
data | : a gpointer to the main structure : main_window, this must NOT be NULL ! |
Definition at line 166 of file data_interpretor.c.
References heraia_get_widget(), xml_t::main, and heraia_window_t::xmls.
Referenced by connect_data_interpretor_signals().
static void connect_data_interpretor_signals | ( | heraia_window_t * | main_window | ) | [static] |
Connects data interpretor window's signals to the right functions.
main_window | : main structure |
Definition at line 284 of file data_interpretor.c.
References close_data_interpretor_window(), delete_dt_window_event(), destroy_dt_window(), heraia_get_widget(), xml_t::main, refresh_data_interpretor_window(), and heraia_window_t::xmls.
Referenced by data_interpretor_init_interface().
void data_interpretor_init_interface | ( | heraia_window_t * | main_window | ) |
Inits the data interpretor structure and window with default values.
Definition at line 320 of file data_interpretor.c.
References add_default_tabs(), connect_data_interpretor_signals(), heraia_window_t::current_DW, data_window_t::diw, heraia_get_widget(), xml_t::main, and heraia_window_t::xmls.
Referenced by load_heraia_ui().
static void interpret | ( | doc_t * | doc, | |
DecodeFunc | decode_it, | |||
decode_parameters_t * | decode_parameters, | |||
GtkWidget * | entry, | |||
guint | length | |||
) | [static] |
Here we do interpret a something according to the decode_it function and we write down the result in a widget designated "entry".
main_window | : main structure | |
decode_it | : a DecodeDateFunc which is a function to be called to decode the stream | |
decode_parameters | : structure that passes some arguments to the decoding functions | |
entry | : a GtkWidget * entry widget where we will put the result of the computation of decode_it function | |
length | : the length of the data to be decoded (guint) |
< used to test different results of function calls
< the character under the cursor
< decoded text
Definition at line 123 of file data_interpretor.c.
References decode_parameters_t::endianness, ghex_get_data(), and doc_t::hex_widget.
Referenced by refresh_one_row().
static void refresh_all_tabs | ( | doc_t * | doc, | |
data_window_t * | dw, | |||
decode_parameters_t * | decode_parameters | |||
) | [static] |
Refreshes all tabs.
dw | : current data window | |
decode_parameters | : structure that passes some arguments to the decoding functions |
Definition at line 231 of file data_interpretor.c.
References refresh_one_tab(), and data_window_t::tabs.
Referenced by refresh_data_interpretor_window().
void refresh_data_interpretor_window | ( | GtkWidget * | widget, | |
gpointer | data | |||
) |
Refreshes the data interpretor window with the new values.
widget | : the widget caller (may be NULL here) | |
data | : a gpointer to the main structure : main_window, this must NOT be NULL ! |
< data interpretor window structure
< Endianness is computed only once here
< stream size is computed only once here
Definition at line 254 of file data_interpretor.c.
References heraia_window_t::current_doc, heraia_window_t::current_DW, window_prop_t::displayed, all_window_prop_t::main_dialog, new_decode_parameters_t(), refresh_all_tabs(), which_endianness(), which_stream_size(), and heraia_window_t::win_prop.
Referenced by connect_data_interpretor_signals(), on_DIMenu_activate(), and refresh_event_handler().
static void refresh_one_row | ( | doc_t * | doc, | |
decode_generic_t * | row, | |||
guint | nb_cols, | |||
decode_parameters_t * | decode_parameters | |||
) | [static] |
This function refreshes one row of the tab.
dw | : current data window | |
row | : the row that we want to refresh | |
nb_cols | : number of columns in this particular row (this IS the same for all rows in that tab | |
decode_parameters | : structure that passes some arguments to the decoding functions |
< the couple entry / function
Definition at line 186 of file data_interpretor.c.
References decode_generic_t::data_size, decode_generic_t::decode_array, decode_t::entry, decode_generic_t::fixed_size, decode_t::func, interpret(), and decode_parameters_t::stream_size.
Referenced by refresh_one_tab().
static void refresh_one_tab | ( | doc_t * | doc, | |
data_window_t * | dw, | |||
tab_t * | tab, | |||
decode_parameters_t * | decode_parameters | |||
) | [static] |
This function refreshes one entire tab (row by row).
dw | : current data window | |
tab | : the tab to refresh | |
decode_parameters | : structure that passes some arguments to the decoding functions |
< the row we want to refresh
Definition at line 212 of file data_interpretor.c.
References tab_t::nb_cols, refresh_one_row(), and tab_t::rows.
Referenced by refresh_all_tabs().
static guint which_endianness | ( | heraia_window_t * | main_window | ) | [static] |
Determines which endianness is selected that is to say which radio button is active in the window.
main_window | : main structure |
Definition at line 49 of file data_interpretor.c.
References gtk_radio_button_get_active_from_widget(), H_DI_BIG_ENDIAN, H_DI_LITTLE_ENDIAN, H_DI_MIDDLE_ENDIAN, heraia_get_widget(), xml_t::main, and heraia_window_t::xmls.
Referenced by refresh_data_interpretor_window().
static guint which_stream_size | ( | heraia_window_t * | main_window | ) | [static] |
returns stream size as selected in the spin button
main_window | : main structure |
Definition at line 80 of file data_interpretor.c.
References heraia_get_widget(), xml_t::main, and heraia_window_t::xmls.
Referenced by refresh_data_interpretor_window().