data_interpretor.c File Reference


Detailed Description

Here one may find tools to manage the data_interpretor window.

Definition in file data_interpretor.c.

#include <libheraia.h>

Include dependency graph for data_interpretor.c:

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 void interpret_as_date (heraia_window_t *main_window, DecodeDateFunc decode_it, gchar *widget_name, guint length, guint endianness)
 Here we do interpret a date according to the decode_it function and we write down the result in a widget name named "widget_name".
static void interpret_as_number (heraia_window_t *main_window, DecodeFunc decode_it, gchar *widget_name, guint length, guint endianness)
 Here we do interpret a number according to the decode_it function and we write down the result in a widget name named "widget_name".
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.
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.


Function Documentation

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

Parameters:
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 185 of file data_interpretor.c.

References heraia_get_widget(), xml_t::main, and heraia_window_t::xmls.

Referenced by connect_data_interpretor_signals().

Here is the call graph for this function:

Here is the caller graph for this function:

static void connect_data_interpretor_signals ( heraia_window_t main_window  )  [static]

Connects data interpretor window's signals to the right functions.

Parameters:
main_window : main structure

Definition at line 237 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().

Here is the call graph for this function:

Here is the caller graph for this function:

void data_interpretor_init_interface ( heraia_window_t main_window  ) 

Inits the data interpretor structure and window with default values.

Warning:
Should be called only once at program's beginning

Definition at line 268 of file data_interpretor.c.

References connect_data_interpretor_signals(), heraia_window_t::current_DW, data_window_t::diw, heraia_get_widget(), xml_t::main, data_window_t::tab_displayed, and heraia_window_t::xmls.

Referenced by load_heraia_ui().

Here is the call graph for this function:

Here is the caller graph for this function:

static void interpret_as_date ( heraia_window_t main_window,
DecodeDateFunc  decode_it,
gchar *  widget_name,
guint  length,
guint  endianness 
) [static]

Here we do interpret a date according to the decode_it function and we write down the result in a widget name named "widget_name".

Warning:
We are assuming that main_window != NULL and main_window->xml != NULL
Parameters:
main_window : main structure
decode_it : a DecodeDateFunc which is a function to be called to decode the stream
widget_name : a gchar * containing the name of the widget where the result may go
length : the length of the data to be decoded (guint)
endianness : the endianness to be applied to the datas (as returned by function which_endianness)

< used to test different results of function calls

< the character under the cursor

< date resulting of interpretation

Definition at line 86 of file data_interpretor.c.

References heraia_window_t::current_DW, ghex_get_data(), heraia_get_widget(), xml_t::main, and heraia_window_t::xmls.

Referenced by refresh_data_interpretor_window().

Here is the call graph for this function:

Here is the caller graph for this function:

static void interpret_as_number ( heraia_window_t main_window,
DecodeFunc  decode_it,
gchar *  widget_name,
guint  length,
guint  endianness 
) [static]

Here we do interpret a number according to the decode_it function and we write down the result in a widget name named "widget_name".

Warning:
We are assuming that main_window != NULL and main_window->xml != NULL
Parameters:
main_window : main structure
decode_it : a DecodeDateFunc which is a function to be called to decode the stream
widget_name : a gchar * containing the name of the widget where the result may go
length : the length of the data to be decoded (guint)
endianness : the endianness to be applied to the datas (as returned by function which_endianness)

< used to test different results of function calls

< the character under the cursor

< We already know that it's not NULL (we hope so)

<

Todo:
we might test the result as this is user input

Definition at line 140 of file data_interpretor.c.

References heraia_window_t::current_DW, ghex_get_data(), heraia_get_widget(), xml_t::main, and heraia_window_t::xmls.

Referenced by refresh_data_interpretor_window().

Here is the call graph for this function:

Here is the caller graph for this function:

void refresh_data_interpretor_window ( GtkWidget *  widget,
gpointer  data 
)

Refreshes the data interpretor window with the new values.

Parameters:
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

Definition at line 202 of file data_interpretor.c.

References 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_filetime_date(), decode_HFS_date(), decode_packed_BCD(), decode_to_bits(), window_prop_t::displayed, interpret_as_date(), interpret_as_number(), all_window_prop_t::main_dialog, refresh_all_ud_data_interpretor(), which_endianness(), and heraia_window_t::win_prop.

Referenced by connect_data_interpretor_signals(), on_DIMenu_activate(), and refresh_event_handler().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
main_window : main structure
Returns:
Something of the following, depending on what selected the user :
  • H_DI_LITTLE_ENDIAN for little endian encoding (default answer)
  • H_DI_BIG_ENDIAN for big endian encoding
  • H_DI_MIDDLE_ENDIAN for middle endian encoding

Definition at line 45 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().

Here is the call graph for this function:

Here is the caller graph for this function:


Generated on Sat Feb 14 11:44:17 2009 for Heraia by  doxygen 1.5.6