heraia_ui.c File Reference

This file has all the functions to manage heraia's ui More...

#include <libheraia.h>

Include dependency graph for heraia_ui.c:

Go to the source code of this file.

Functions

static void set_a_propos_properties (GtkWidget *about_dialog)
 Sets name and version in the dialog box.
static gboolean load_heraia_glade_xml (heraia_window_t *main_window)
 Loads the glade xml files that describes the heraia project tries the following paths in that order :
  • /etc/heraia/heraia.glade
  • /home/[user]/.heraia/heraia.glade
  • PWD/heraia.glade.

static void heraia_ui_connect_signals (heraia_window_t *main_window)
 Connect the signals at the interface.
static void record_and_hide_about_box (heraia_window_t *main_window)
 Record position and hide about dialog box.
static void close_heraia (heraia_window_t *main_window)
 Before closing heraia we need to do few things.
void on_quit_activate (GtkWidget *widget, gpointer data)
 Quit, file menu.
void on_new_activate (GtkWidget *widget, gpointer data)
 New, file menu.
void on_preferences_activate (GtkWidget *widget, gpointer data)
 Preferences, file menu : Displays the preference window (as a modal window).
void a_propos_activate (GtkWidget *widget, gpointer data)
 Shows apropos's dialog box.
void move_and_show_dialog_box (GtkWidget *dialog_box, window_prop_t *dialog_prop)
 Move the dialog box to the wanted position, shows it and says it in the displayed prop.
void record_dialog_box_position (GtkWidget *dialog_box, window_prop_t *dialog_prop)
 Records one dialog position.
void record_all_dialog_box_positions (heraia_window_t *main_window)
 Records all the positions of the displayed windows.
void record_and_hide_dialog_box (GtkWidget *dialog_box, window_prop_t *dialog_prop)
 Record position and hide a dialog box.
static void a_propos_response (GtkWidget *widget, gint response, gpointer data)
 To close the A propos dialog box (with the "close" button).
static void a_propos_close (GtkWidget *widget, gpointer data)
 To close the A propos dialog box.
static gboolean a_propos_delete (GtkWidget *widget, GdkEvent *event, gpointer data)
 To close the A propos dialog box.
void on_delete_activate (GtkWidget *widget, gpointer data)
 Delete, edit menu.
void on_cut_activate (GtkWidget *widget, gpointer data)
 Cut, edit menu.
void on_copy_activate (GtkWidget *widget, gpointer data)
 Copy, edit menu.
void on_paste_activate (GtkWidget *widget, gpointer data)
 Paste, edit menu.
void refresh_file_labels (heraia_window_t *main_window)
 This function is refreshing the labels on the main window in order to reflect cursor position, selected positions and total selected size.
void refresh_event_handler (GtkWidget *widget, gpointer data)
 This function is here to ensure that everything will be refreshed upon a signal event.
void on_open_activate (GtkWidget *widget, gpointer data)
 This handles the menuitem "Ouvrir" to open a file.
void on_save_activate (GtkWidget *widget, gpointer data)
 Here we attemp to save the edited file.
void on_save_as_activate (GtkWidget *widget, gpointer data)
 This handle the save_as menu entry (here the filename changes).
void on_DIMenu_activate (GtkWidget *widget, gpointer data)
 This handles the menuitem "Data Interpretor" that shows or hides the data interpretor window.
gboolean delete_main_window_event (GtkWidget *widget, GdkEvent *event, gpointer data)
 When the user destroys or delete the main window.
gboolean delete_dt_window_event (GtkWidget *widget, GdkEvent *event, gpointer data)
 call back function for the data interpretor window destruction
void destroy_dt_window (GtkWidget *widget, GdkEvent *event, gpointer data)
 call back function for the data interpretor window destruction
gboolean file_notebook_tab_changed (GtkNotebook *notebook, GtkNotebookPage *page, gint tab_num, gpointer data)
 What to do when a change occurs in tabs (user selected a particular tab.
static gchar * make_absolute_path (gchar *filename)
 Returns an absolute path to the filename the string should be freed when no longer needed very UGLy !
void set_the_working_directory (GtkFileChooser *file_chooser, gchar *filename)
 Sets the working directory for the file chooser to the directory of the filename (even if filename is a relative filename such as .
GSList * select_file_to_load (heraia_window_t *main_window)
 This function does open a file selector dialog box and returns the selected filename.
gchar * select_a_file_to_save (heraia_window_t *main_window)
 This function opens a dialog box that allow one to choose a file name to the file which is about to be saved.
void update_main_window_name (heraia_window_t *main_window)
 Update main window heraia's name to reflect the current edited file.
void set_notebook_tab_name (heraia_window_t *main_window)
 Sets notebook's tab's name.
void grey_main_widgets (GladeXML *main, gboolean greyed)
 Hides or grey all widgets that needs an open file when boolean show is FALSE.
void init_heraia_interface (heraia_window_t *main_window)
 Here we might init some call backs and menu options and display the interface (main && sub-windows) This function should be called only once at main program's init time.
void connect_cursor_moved_signal (heraia_window_t *main_window, GtkWidget *hex_widget)
int load_heraia_ui (heraia_window_t *main_window)
 Loads, if possible, the glade xml file and then connects the signals and inits the following windows :
  • log window
  • data_interpretor window
  • list data types.

void add_text_to_textview (GtkTextView *textview, const char *format,...)
 adds a text to a textview
void kill_text_from_textview (GtkTextView *textview)
 Kills the text from a textview.
GtkWidget * gtk_radio_button_get_active (GSList *group)
 Try to find the active radio button widget in a group This does not take into account inconsistant states returns the first active radio button otherwise NULL.
GtkWidget * gtk_radio_button_get_active_from_widget (GtkRadioButton *radio_group_member)
 gets the active radio button from a radio group
gboolean is_cmi_checked (GtkWidget *check_menu_item)
 Tells whether a GtkCheckMenuItem is Checked or not.
gboolean is_toggle_button_activated (GladeXML *main_xml, gchar *check_button)
 returns the state of a named check button contained in the Glade XML description
GtkWidget * heraia_get_widget (GladeXML *xml, gchar *widget_name)
 This is a wrapper to the glade xml get widget.
void destroy_a_single_widget (GtkWidget *widget)
 Destroys a single widget if it exists.
static void init_one_cmi_window_state (GtkWidget *dialog_box, GtkWidget *cmi, window_prop_t *dialog_prop)
 init one cmi window based state
void init_window_states (heraia_window_t *main_window)
 Inits all windows states (positions, displayed, and so on.
void add_new_tab_in_main_window (heraia_window_t *main_window, doc_t *doc)
 Adds a new tab to the main window in file's notebook.
void show_hide_widget (GtkWidget *widget, gboolean show, window_prop_t *win_prop)
 To help plugins to deal with widgets, shows or hide a specific widget.


Detailed Description

This file has all the functions to manage heraia's ui

Definition in file heraia_ui.c.


Function Documentation

void a_propos_activate ( GtkWidget *  widget,
gpointer  data 
)

Shows apropos's dialog box.

Parameters:
widget : the widget that issued the signal
data : user data MUST be heraia_window_t *main_window main structure

Definition at line 115 of file heraia_ui.c.

References all_window_prop_t::about_box, heraia_get_widget(), xml_t::main, move_and_show_dialog_box(), set_a_propos_properties(), heraia_window_t::win_prop, and heraia_window_t::xmls.

Referenced by heraia_ui_connect_signals().

Here is the call graph for this function:

Here is the caller graph for this function:

void a_propos_close ( GtkWidget *  widget,
gpointer  data 
) [static]

To close the A propos dialog box.

Parameters:
widget : calling widget (may be NULL as we don't use this)
data : MUST be heraia_window_t *main_window main structure

Definition at line 277 of file heraia_ui.c.

References record_and_hide_about_box().

Referenced by heraia_ui_connect_signals().

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean a_propos_delete ( GtkWidget *  widget,
GdkEvent *  event,
gpointer  data 
) [static]

To close the A propos dialog box.

Parameters:
widget : calling widget (may be NULL as we don't use this)
event : event associated (may be NULL as we don't use this)
data : MUST be heraia_window_t *main_window main structure
Returns:
returns TRUE in order to allow other functions to do something with that event.

Definition at line 293 of file heraia_ui.c.

References record_and_hide_about_box().

Referenced by heraia_ui_connect_signals().

Here is the call graph for this function:

Here is the caller graph for this function:

void a_propos_response ( GtkWidget *  widget,
gint  response,
gpointer  data 
) [static]

To close the A propos dialog box (with the "close" button).

Parameters:
widget : calling widget (may be NULL as we don't use this)
response : may be whatever you want as we neither use this !
data : MUST be heraia_window_t *main_window main structure

Definition at line 265 of file heraia_ui.c.

References record_and_hide_about_box().

Referenced by heraia_ui_connect_signals().

Here is the call graph for this function:

Here is the caller graph for this function:

void add_new_tab_in_main_window ( heraia_window_t main_window,
doc_t doc 
)

Adds a new tab to the main window in file's notebook.

Parameters:
main_window : main structure
doc : the new document that will be related to the tab

< used for vbox creation

< file_notebook from heraia.glade

< tab's label

< new tab's index

Definition at line 1519 of file heraia_ui.c.

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

Referenced by load_file_to_analyse().

Here is the call graph for this function:

Here is the caller graph for this function:

void add_text_to_textview ( GtkTextView *  textview,
const char *  format,
  ... 
)

adds a text to a textview

Parameters:
textview : the textview where to add text
format : printf style format
... : a va_list arguments to fit format (as with printf)

Definition at line 1246 of file heraia_ui.c.

Referenced by print_plugin_basics(), print_plugin_extra_structure(), print_plugin_filter_structure(), print_plugin_functions(), print_plugin_info_structure(), print_plugin_interface(), print_plugin_state(), and realize_some_numerical_stat().

Here is the caller graph for this function:

static void close_heraia ( heraia_window_t main_window  )  [static]

Before closing heraia we need to do few things.

Parameters:
main_window : main_struct

Definition at line 1409 of file heraia_ui.c.

References record_all_dialog_box_positions(), and save_preferences().

Referenced by on_quit_activate().

Here is the call graph for this function:

Here is the caller graph for this function:

void connect_cursor_moved_signal ( heraia_window_t main_window,
GtkWidget *  hex_widget 
)

Definition at line 1030 of file heraia_ui.c.

References refresh_event_handler().

Referenced by heraia_hex_document_new().

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean delete_dt_window_event ( GtkWidget *  widget,
GdkEvent *  event,
gpointer  data 
)

call back function for the data interpretor window destruction

Parameters:
widget : calling widget (may be NULL as we don't use this here)
event : event associated (may be NULL as we don't use this here)
data : MUST be heraia_window_t *main_window main structure and not NULL

Definition at line 638 of file heraia_ui.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:

delete_main_window_event ( GtkWidget *  widget,
GdkEvent *  event,
gpointer  data 
)

When the user destroys or delete the main window.

Parameters:
widget : calling widget
event : event associated (may be NULL as we don't use this here)
data : MUST be heraia_window_t *main_window main structure

Definition at line 622 of file heraia_ui.c.

References on_quit_activate().

Referenced by heraia_ui_connect_signals().

Here is the call graph for this function:

Here is the caller graph for this function:

void destroy_a_single_widget ( GtkWidget *  widget  ) 

Destroys a single widget if it exists.

Parameters:
widget : the widget to destroy

Definition at line 1396 of file heraia_ui.c.

Referenced by destroy_container_widget(), dt_cancel_button_clicked(), dt_ok_button_clicked(), and ldt_remove_button_clicked().

Here is the caller graph for this function:

void destroy_dt_window ( GtkWidget *  widget,
GdkEvent *  event,
gpointer  data 
)

call back function for the data interpretor window destruction

Parameters:
widget : calling widget (may be NULL as we don't use this here)
event : event associated (may be NULL as we don't use this here)
data : MUST be heraia_window_t *main_window main structure and not NULL

Definition at line 654 of file heraia_ui.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:

gboolean file_notebook_tab_changed ( GtkNotebook *  notebook,
GtkNotebookPage *  page,
gint  tab_num,
gpointer  data 
)

What to do when a change occurs in tabs (user selected a particular tab.

Parameters:
notebook : the widget that issued this signal
page : the new current page
tab_num : index of this page
data : MUST be heraia_window_t *main_window !

Definition at line 671 of file heraia_ui.c.

References heraia_window_t::current_doc, heraia_window_t::documents, heraia_window_t::event, HERAIA_REFRESH_NOTHING, HERAIA_REFRESH_TAB_CHANGED, refresh_event_handler(), and update_main_window_name().

Referenced by heraia_ui_connect_signals().

Here is the call graph for this function:

Here is the caller graph for this function:

void grey_main_widgets ( GladeXML *  main,
gboolean  greyed 
)

Hides or grey all widgets that needs an open file when boolean show is FALSE.

Parameters:
main : main Glade XML structure
greyed : boolean (TRUE to hide an grey widgets)

Definition at line 934 of file heraia_ui.c.

References heraia_get_widget().

Referenced by init_heraia_interface(), and load_file_to_analyse().

Here is the call graph for this function:

Here is the caller graph for this function:

GtkWidget * gtk_radio_button_get_active ( GSList *  group  ) 

Try to find the active radio button widget in a group This does not take into account inconsistant states returns the first active radio button otherwise NULL.

Parameters:
group : A group of GtkRadioButtons
Returns:
returns the active widget if any (NULL if none)

Definition at line 1291 of file heraia_ui.c.

Referenced by gtk_radio_button_get_active_from_widget().

Here is the caller graph for this function:

GtkWidget * gtk_radio_button_get_active_from_widget ( GtkRadioButton *  radio_group_member  ) 

gets the active radio button from a radio group

Parameters:
radio_group_member : widget to get radio group from
Returns:
the active GtkRadioButton within the group from radio_group_member

Definition at line 1315 of file heraia_ui.c.

References gtk_radio_button_get_active().

Referenced by which_endianness().

Here is the call graph for this function:

Here is the caller graph for this function:

GtkWidget * heraia_get_widget ( GladeXML *  xml,
gchar *  widget_name 
)

This is a wrapper to the glade xml get widget.

It is intended to simplify the developpers lives if they have to choose or propose other means to do the same thing than libglade (say, for example, GtkBuilder :)

Parameters:
xml : A glade XML definition
widget_name : an existing widget name in the glade definition
Returns:
returns the widget itself if it exists in the definition file (NULL otherwise)

For debug purposes only (very verbose as this function is the main used) fprintf(stdout, "Getting Widget named %s\n", widget_name);

Definition at line 1373 of file heraia_ui.c.

Referenced by a_propos_activate(), add_data_type_name_to_treeview(), add_default_tabs(), add_entry_to_plugins_menu(), add_new_tab_in_main_window(), close_data_interpretor_window(), close_data_type_window(), connect_data_interpretor_signals(), connect_data_type_signals(), connect_list_data_types_signals(), create_treatment_container_widget(), create_ud_data_interpretor_widgets(), data_interpretor_init_interface(), delete_dt_window_event(), delete_ldt_window_event(), destroy_dt_window(), destroy_ldt_window(), dt_name_entry_leave_notify_event(), dt_size_spinbutton_value_changed(), fill_data_type_widgets(), grey_main_widgets(), heraia_ui_connect_signals(), init_plugin_name_tv(), init_window_states(), is_toggle_button_activated(), ldt_edit_button_clicked(), ldt_remove_button_clicked(), load_di_preferences(), load_mp_display_preferences_options(), load_mp_file_preferences_options(), log_window_connect_signals(), log_window_init_interface(), logw_close_clicked(), main_pref_window_connect_signals(), mw_cmi_plw_toggle(), my_log(), on_DIMenu_activate(), on_ldt_menu_activate(), on_mp_tb_display_bt_toggled(), on_mp_tb_fp_bt_toggled(), on_preferences_activate(), plugin_list_window_connect_signals(), plw_close_clicked(), plw_refresh_clicked(), pn_treeview_selection_changed_cb(), pref_window_delete(), record_all_dialog_box_positions(), record_and_hide_about_box(), refresh_file_labels(), refresh_hex_datas_entry(), save_di_preferences(), select_a_file_to_save(), select_file_to_load(), set_notebook_tab_name(), set_spinbutton_max_range(), show_data_type_window(), show_hide_log_window(), update_main_window_name(), which_endianness(), and which_stream_size().

Here is the caller graph for this function:

static void heraia_ui_connect_signals ( heraia_window_t main_window  )  [static]

init_heraia_interface ( heraia_window_t main_window  ) 

Here we might init some call backs and menu options and display the interface (main && sub-windows) This function should be called only once at main program's init time.

Parameters:
main_window : main structure

Definition at line 967 of file heraia_ui.c.

References heraia_window_t::current_doc, grey_main_widgets(), init_window_states(), xml_t::main, refresh_file_labels(), and heraia_window_t::xmls.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

void init_one_cmi_window_state ( GtkWidget *  dialog_box,
GtkWidget *  cmi,
window_prop_t dialog_prop 
) [static]

init one cmi window based state

Parameters:
dialog_box : the window or dialog box we want to init its state
cmi : corresponding check menu item
dialog_prop : corresponding window properties (should be initialized and not NULL)

Definition at line 1425 of file heraia_ui.c.

References window_prop_t::displayed, window_prop_t::height, window_prop_t::width, window_prop_t::x, and window_prop_t::y.

Referenced by init_window_states().

Here is the caller graph for this function:

init_window_states ( heraia_window_t main_window  ) 

gboolean is_cmi_checked ( GtkWidget *  check_menu_item  ) 

Tells whether a GtkCheckMenuItem is Checked or not.

Parameters:
check_menu_item : a GtkCheckMenuItem to verify
Returns:
returns TRUE if the Check Manu Item is checked, FALSE otherwise

Definition at line 1334 of file heraia_ui.c.

Referenced by on_ldt_menu_activate().

Here is the caller graph for this function:

gboolean is_toggle_button_activated ( GladeXML *  main_xml,
gchar *  check_button 
)

returns the state of a named check button contained in the Glade XML description

Parameters:
main_xml : a GladeXML definition
check_button : the name of an existing check_button within the glade definition
Returns:
TRUE if the button is activated / toggled , FALSE otherwise

Definition at line 1349 of file heraia_ui.c.

References heraia_get_widget().

Referenced by refresh_file_labels(), save_mp_display_preferences_options(), and save_mp_file_preferences_options().

Here is the call graph for this function:

Here is the caller graph for this function:

kill_text_from_textview ( GtkTextView *  textview  ) 

Kills the text from a textview.

Parameters:
textview : the textview to kill the text from

Definition at line 1270 of file heraia_ui.c.

Referenced by plw_refresh_clicked(), pn_treeview_selection_changed_cb(), and realize_some_numerical_stat().

Here is the caller graph for this function:

static gboolean load_heraia_glade_xml ( heraia_window_t main_window  )  [static]

Loads the glade xml files that describes the heraia project tries the following paths in that order :

  • /etc/heraia/heraia.glade
  • /home/[user]/.heraia/heraia.glade
  • PWD/heraia.glade.

Parameters:
main_window : main structure
Returns:
TRUE if everything went ok, FALSE otherwise

Definition at line 999 of file heraia_ui.c.

References load_glade_xml_file(), heraia_window_t::location_list, xml_t::main, 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:

int load_heraia_ui ( heraia_window_t main_window  ) 

Loads, if possible, the glade xml file and then connects the signals and inits the following windows :

  • log window
  • data_interpretor window
  • list data types.

Parameters:
main_window : main structure
Returns:
TRUE if load_heraia_glade suceeded, FALSE otherwise
Todo:
add more return values to init functions to detect any error while initializing the ui

Definition at line 1131 of file heraia_ui.c.

References data_interpretor_init_interface(), data_type_init_interface(), heraia_window_t::debug, heraia_ui_connect_signals(), list_data_types_init_interface(), load_heraia_glade_xml(), load_preference_file(), load_preferences(), log_window_init_interface(), and main_pref_window_init_interface().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static gchar * make_absolute_path ( gchar *  filename  )  [static]

Returns an absolute path to the filename the string should be freed when no longer needed very UGLy !

Todo:
do something without any system calls !!!
Parameters:
filename : relative notation filename from which to extract an absolute path
Returns:
returns a string with the absolute path which should be freed when no longer needed

Definition at line 702 of file heraia_ui.c.

Referenced by set_the_working_directory().

Here is the caller graph for this function:

void move_and_show_dialog_box ( GtkWidget *  dialog_box,
window_prop_t dialog_prop 
)

Move the dialog box to the wanted position, shows it and says it in the displayed prop.

Parameters:
dialog_box : the dialog box we want to move and show
dialog_prop : window_prop_t properties structure corresponding to the dialog box

Definition at line 136 of file heraia_ui.c.

References window_prop_t::displayed, window_prop_t::height, window_prop_t::width, window_prop_t::x, and window_prop_t::y.

Referenced by a_propos_activate(), mw_cmi_plw_toggle(), on_DIMenu_activate(), on_ldt_menu_activate(), on_preferences_activate(), show_hide_log_window(), and show_hide_widget().

Here is the caller graph for this function:

void on_copy_activate ( GtkWidget *  widget,
gpointer  data 
)

Copy, edit menu.

Warning:
Not yet implemented
Todo:
Write a usefull function here :)
Parameters:
widget : the widget that issued the signal
data : user data MUST be heraia_window_t *main_window main structure

Definition at line 340 of file heraia_ui.c.

References log_message().

Referenced by heraia_ui_connect_signals().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_cut_activate ( GtkWidget *  widget,
gpointer  data 
)

Cut, edit menu.

Warning:
Not yet implemented
Todo:
Write a usefull function here :)
Parameters:
widget : the widget that issued the signal
data : user data MUST be heraia_window_t *main_window main structure

Definition at line 325 of file heraia_ui.c.

References log_message().

Referenced by heraia_ui_connect_signals().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_delete_activate ( GtkWidget *  widget,
gpointer  data 
)

Delete, edit menu.

Warning:
Not yet implemented
Todo:
Write a usefull function here :)
Parameters:
widget : the widget that issued the signal
data : user data MUST be heraia_window_t *main_window main structure

Definition at line 310 of file heraia_ui.c.

References log_message().

Referenced by heraia_ui_connect_signals().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_DIMenu_activate ( GtkWidget *  widget,
gpointer  data 
)

This handles the menuitem "Data Interpretor" that shows or hides the data interpretor window.

Parameters:
widget : the widget that issued the signal
data : user data MUST be heraia_window_t *main_window main structure

< data_window structure for data interpretor

< data interpretor's notebook

Definition at line 571 of file heraia_ui.c.

References heraia_window_t::current_DW, all_window_prop_t::data_interpretor, window_prop_t::displayed, data_window_t::diw, heraia_get_widget(), xml_t::main, move_and_show_dialog_box(), record_and_hide_dialog_box(), refresh_data_interpretor_window(), data_window_t::tab_displayed, heraia_window_t::win_prop, and heraia_window_t::xmls.

Referenced by heraia_ui_connect_signals().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_new_activate ( GtkWidget *  widget,
gpointer  data 
)

New, file menu.

Parameters:
widget : the widget that issued the signal
data : user data MUST be heraia_window_t *main_window main structure

Definition at line 59 of file heraia_ui.c.

References log_message().

Referenced by heraia_ui_connect_signals().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_open_activate ( GtkWidget *  widget,
gpointer  data 
)

This handles the menuitem "Ouvrir" to open a file.

Warning:
This function is not thread safe (do not use in a thread)
Todo:
try to put some mutexes on main_window->event to make this thread safe some way
Parameters:
widget : the widget that issued the signal
data : user data MUST be heraia_window_t *main_window main structure

Definition at line 460 of file heraia_ui.c.

References heraia_window_t::current_doc, heraia_window_t::event, HERAIA_REFRESH_NEW_FILE, doc_t::hex_widget, load_file_to_analyse(), refresh_event_handler(), and select_file_to_load().

Referenced by heraia_ui_connect_signals().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_paste_activate ( GtkWidget *  widget,
gpointer  data 
)

Paste, edit menu.

Warning:
Not yet implemented
Todo:
Write a usefull function here :)
Parameters:
widget : the widget that issued the signal
data : user data MUST be heraia_window_t *main_window main structure

Definition at line 356 of file heraia_ui.c.

References log_message().

Referenced by heraia_ui_connect_signals().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_preferences_activate ( GtkWidget *  widget,
gpointer  data 
)

Preferences, file menu : Displays the preference window (as a modal window).

Parameters:
widget : the widget that issued the signal
data : user data MUST be heraia_window_t *main_window main structure

Definition at line 73 of file heraia_ui.c.

References heraia_get_widget(), xml_t::main, all_window_prop_t::main_pref_window, move_and_show_dialog_box(), heraia_window_t::win_prop, and heraia_window_t::xmls.

Referenced by heraia_ui_connect_signals().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_quit_activate ( GtkWidget *  widget,
gpointer  data 
)

Quit, file menu.

Parameters:
widget : the widget that issued the signal
data : user data MUST be heraia_window_t *main_window main structure

Definition at line 45 of file heraia_ui.c.

References close_heraia().

Referenced by delete_main_window_event(), and heraia_ui_connect_signals().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_save_activate ( GtkWidget *  widget,
gpointer  data 
)

Here we attemp to save the edited file.

Todo:
be more accurate on error (error type, message and filename) returns we should return something at least ...
Parameters:
widget : the widget that issued the signal
data : user data MUST be heraia_window_t *main_window main structure

Definition at line 499 of file heraia_ui.c.

References heraia_window_t::current_doc, doc_t_document_get_filename(), heraia_hex_document_save(), HERAIA_NOERR, and log_message().

Referenced by heraia_ui_connect_signals().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_save_as_activate ( GtkWidget *  widget,
gpointer  data 
)

This handle the save_as menu entry (here the filename changes).

Parameters:
widget : the widget that issued the signal
data : user data MUST be heraia_window_t *main_window main structure

< Auto malloc'ed, do not free

Definition at line 523 of file heraia_ui.c.

References heraia_window_t::current_doc, doc_t_document_get_filename(), HERAIA_CANCELLED, heraia_hex_document_save_as(), HERAIA_NOERR, log_message(), select_a_file_to_save(), set_notebook_tab_name(), and update_main_window_name().

Referenced by heraia_ui_connect_signals().

Here is the call graph for this function:

Here is the caller graph for this function:

void record_all_dialog_box_positions ( heraia_window_t main_window  ) 

Records all the positions of the displayed windows.

Parameters:
[in,out] main_window : main structure

Definition at line 180 of file heraia_ui.c.

References all_window_prop_t::about_box, heraia_window_t::current_DW, all_window_prop_t::data_interpretor, data_window_t::diw, heraia_get_widget(), all_window_prop_t::ldt, all_window_prop_t::log_box, xml_t::main, all_window_prop_t::main_dialog, all_window_prop_t::main_pref_window, all_window_prop_t::plugin_list, record_dialog_box_position(), heraia_window_t::win_prop, and heraia_window_t::xmls.

Referenced by close_heraia().

Here is the call graph for this function:

Here is the caller graph for this function:

static void record_and_hide_about_box ( heraia_window_t main_window  )  [static]

Record position and hide about dialog box.

Parameters:
[in,out] main_window : main structure

Definition at line 245 of file heraia_ui.c.

References all_window_prop_t::about_box, heraia_get_widget(), xml_t::main, record_and_hide_dialog_box(), heraia_window_t::win_prop, and heraia_window_t::xmls.

Referenced by a_propos_close(), a_propos_delete(), and a_propos_response().

Here is the call graph for this function:

Here is the caller graph for this function:

void record_and_hide_dialog_box ( GtkWidget *  dialog_box,
window_prop_t dialog_prop 
)

Record position and hide a dialog box.

Parameters:
dialog_box : the dialog box we want to record its position and then hide
dialog_prop : window_prop_t properties structure corresponding to the dialog box

Definition at line 227 of file heraia_ui.c.

References window_prop_t::displayed, and record_dialog_box_position().

Referenced by mw_cmi_plw_toggle(), on_DIMenu_activate(), on_ldt_menu_activate(), plw_close_clicked(), pref_window_delete(), record_and_hide_about_box(), show_hide_log_window(), and show_hide_widget().

Here is the call graph for this function:

Here is the caller graph for this function:

void record_dialog_box_position ( GtkWidget *  dialog_box,
window_prop_t dialog_prop 
)

Records one dialog position.

Parameters:
dialog_box : a dialog box from which we want to record the position
[in,out] dialog_prop : window_prop_t properties structure corresponding to the dialog box

Definition at line 153 of file heraia_ui.c.

References window_prop_t::displayed, window_prop_t::height, window_prop_t::width, WPT_DEFAULT_HEIGHT, WPT_DEFAULT_WIDTH, window_prop_t::x, and window_prop_t::y.

Referenced by record_all_dialog_box_positions(), and record_and_hide_dialog_box().

Here is the caller graph for this function:

void refresh_event_handler ( GtkWidget *  widget,
gpointer  data 
)

This function is here to ensure that everything will be refreshed upon a signal event.

Warning:
This function is not thread safe (do not use in a thread)
Todo:
try to put some mutexes on main_window->event to make this thread safe some way
Parameters:
widget : the widget that issued the signal
data : user data MUST be heraia_window_t *main_window main structure

Definition at line 430 of file heraia_ui.c.

References heraia_window_t::event, HERAIA_REFRESH_CURSOR_MOVE, HERAIA_REFRESH_NOTHING, refresh_all_plugins(), refresh_data_interpretor_window(), and refresh_file_labels().

Referenced by connect_cursor_moved_signal(), file_notebook_tab_changed(), and on_open_activate().

Here is the call graph for this function:

Here is the caller graph for this function:

void refresh_file_labels ( heraia_window_t main_window  ) 

This function is refreshing the labels on the main window in order to reflect cursor position, selected positions and total selected size.

Parameters:
main_window : main structure

Definition at line 371 of file heraia_ui.c.

References heraia_window_t::current_doc, ghex_file_size(), ghex_get_cursor_position(), heraia_get_widget(), doc_t::hex_widget, is_toggle_button_activated(), xml_t::main, and heraia_window_t::xmls.

Referenced by init_heraia_interface(), on_mp_thousand_bt_toggled(), and refresh_event_handler().

Here is the call graph for this function:

Here is the caller graph for this function:

gchar * select_a_file_to_save ( heraia_window_t main_window  ) 

This function opens a dialog box that allow one to choose a file name to the file which is about to be saved.

Parameters:
main_window : main structure
Returns:
returns complete filename (path and filename)

< A parent window (we use main_window)

Definition at line 820 of file heraia_ui.c.

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

Referenced by on_save_as_activate().

Here is the call graph for this function:

Here is the caller graph for this function:

GSList* select_file_to_load ( heraia_window_t main_window  ) 

This function does open a file selector dialog box and returns the selected filename.

Parameters:
main_window : main structure
Returns:
returns a list of filenames to be loaded (if any)

< A parent window (we use main_window)

< list of selected (if any) filenames to be openned

for the moment we do not want to retrieve multiples selections but this could be a valuable thing in the future

We want the file selection path to be the one of the previous openned file if any !

Definition at line 762 of file heraia_ui.c.

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

Referenced by on_open_activate().

Here is the call graph for this function:

Here is the caller graph for this function:

static void set_a_propos_properties ( GtkWidget *  about_dialog  )  [static]

Sets name and version in the dialog box.

Parameters:
about_dialog the widget that contain all the about box

Definition at line 92 of file heraia_ui.c.

References PACKAGE_NAME, and PACKAGE_VERSION.

Referenced by a_propos_activate(), and init_window_states().

Here is the caller graph for this function:

void set_notebook_tab_name ( heraia_window_t main_window  ) 

Sets notebook's tab's name.

This function should only be called when a new filename was set (open and save as functions)

Parameters:
main_window : main structure

Definition at line 893 of file heraia_ui.c.

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

Referenced by load_file_to_analyse(), and on_save_as_activate().

Here is the call graph for this function:

Here is the caller graph for this function:

void set_the_working_directory ( GtkFileChooser *  file_chooser,
gchar *  filename 
)

Sets the working directory for the file chooser to the directory of the filename (even if filename is a relative filename such as .

./docs/test_file)

Parameters:
file_chooser : An initialized GtkFileChooser
filename : a filename (one previously openned)

< directory where we want to be, at first, in the file chooser

Definition at line 742 of file heraia_ui.c.

References make_absolute_path().

Referenced by select_a_file_to_save(), and select_file_to_load().

Here is the call graph for this function:

Here is the caller graph for this function:

void show_hide_widget ( GtkWidget *  widget,
gboolean  show,
window_prop_t win_prop 
)

To help plugins to deal with widgets, shows or hide a specific widget.

Parameters:
widget : the widget to show or hide
show : what to do : TRUE to show the widget, FALSE to hide it
win_prop : window properties.

Definition at line 1550 of file heraia_ui.c.

References move_and_show_dialog_box(), and record_and_hide_dialog_box().

Referenced by run(), and statw_close_clicked().

Here is the call graph for this function:

Here is the caller graph for this function:

void update_main_window_name ( heraia_window_t main_window  ) 

Update main window heraia's name to reflect the current edited file.

Parameters:
main_window : main structure

Definition at line 869 of file heraia_ui.c.

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

Referenced by file_notebook_tab_changed(), load_file_to_analyse(), and on_save_as_activate().

Here is the call graph for this function:

Here is the caller graph for this function:


Generated on Tue Jun 30 23:18:20 2009 for Heraia by  doxygen 1.5.8