heraia/trunk/src/heraia_ui.c File Reference

#include "heraia_types.h"

Include dependency graph for heraia_ui.c:

Go to the source code of this file.

Functions

static gboolean load_heraia_glade_xml (heraia_window_t *main_window)
static void heraia_ui_connect_signals (heraia_window_t *main_window)
static void record_and_hide_about_box (heraia_window_t *main_window)
static void refresh_file_labels (heraia_window_t *main_window)
void on_quitter1_activate (GtkWidget *widget, gpointer data)
void on_nouveau1_activate (GtkWidget *widget, gpointer data)
void a_propos_activate (GtkWidget *widget, gpointer data)
window_prop_tmove_and_show_dialog_box (GtkWidget *dialog_box, window_prop_t *dialog_prop)
window_prop_trecord_and_hide_dialog_box (GtkWidget *dialog_box, window_prop_t *dialog_prop)
static void a_propos_response (GtkWidget *widget, gint response, gpointer data)
static void a_propos_close (GtkWidget *widget, gpointer data)
static gboolean a_propos_delete (GtkWidget *widget, GdkEvent *event, gpointer data)
void on_supprimer1_activate (GtkWidget *widget, gpointer data)
void on_couper1_activate (GtkWidget *widget, gpointer data)
void on_copier1_activate (GtkWidget *widget, gpointer data)
void on_coller1_activate (GtkWidget *widget, gpointer data)
void refresh_event_handler (GtkWidget *widget, gpointer data)
void on_ouvrir1_activate (GtkWidget *widget, gpointer data)
void on_save_activate (GtkWidget *widget, gpointer data)
void on_save_as_activate (GtkWidget *widget, gpointer data)
void on_DIMenu_activate (GtkWidget *widget, gpointer data)
gboolean delete_main_window_event (GtkWidget *widget, GdkEvent *event, gpointer data)
gboolean delete_dt_window_event (GtkWidget *widget, GdkEvent *event, gpointer data)
void destroy_dt_window (GtkWidget *widget, GdkEvent *event, gpointer data)
static gchar * make_absolute_path (gchar *filename)
static void set_the_working_directory (GtkFileChooser *file_chooser, gchar *filename)
gboolean select_file_to_load (heraia_window_t *main_window)
gchar * select_a_file_to_save (heraia_window_t *main_window)
void update_main_window_name (heraia_window_t *main_window)
void set_notebook_tab_name (heraia_window_t *main_window)
void init_heraia_interface (heraia_window_t *main_window)
void connect_cursor_moved_signal (heraia_window_t *main_window)
int load_heraia_ui (heraia_window_t *main_window)
void add_text_to_textview (GtkTextView *textview, const char *format,...)
void kill_text_from_textview (GtkTextView *textview)
GtkWidget * gtk_radio_button_get_active (GSList *group)
GtkWidget * gtk_radio_button_get_active_from_widget (GtkRadioButton *radio_group_member)
gboolean is_cmi_checked (GtkWidget *check_menu_item)
GtkWidget * heraia_get_widget (GladeXML *xml, gchar *widget_name)
void destroy_a_single_widget (GtkWidget *widget)


Function Documentation

void a_propos_activate ( GtkWidget *  widget,
gpointer  data 
)

Shows apropos's dialog box

Definition at line 53 of file heraia_ui.c.

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

Referenced by heraia_ui_connect_signals().

Here is the call graph for this function:

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

Definition at line 140 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:

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

Definition at line 146 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:

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

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

Definition at line 134 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:

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

void connect_cursor_moved_signal ( heraia_window_t main_window  ) 

Connects the signal that the cursor has moved to the refreshing function

Definition at line 745 of file heraia_ui.c.

References heraia_window_t::current_DW, data_window_t::current_hexwidget, and refresh_event_handler().

Referenced by heraia_hex_document_new().

Here is the call graph for this function:

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

call back functions for the data interpretor window destruction

Definition at line 400 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:

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

When the user destroys or delete the main window

Definition at line 390 of file heraia_ui.c.

Referenced by heraia_ui_connect_signals().

void destroy_a_single_widget ( GtkWidget *  widget  ) 

Destroys a single widget if it exists

Definition at line 1019 of file heraia_ui.c.

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

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

Definition at line 409 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:

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

Definition at line 951 of file heraia_ui.c.

Referenced by gtk_radio_button_get_active_from_widget().

GtkWidget* gtk_radio_button_get_active_from_widget ( GtkRadioButton *  radio_group_member  ) 

gtk_radio_button_get_active_from_widget: : widget to get radio group from

Returns:
: the active GtkRadioButton within the group from

Definition at line 975 of file heraia_ui.c.

References gtk_radio_button_get_active().

Referenced by which_endianness().

Here is the call 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 :)

Definition at line 1003 of file heraia_ui.c.

Referenced by a_propos_activate(), add_data_type_name_to_treeview(), add_entry_to_plugins_menu(), 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(), heraia_ui_connect_signals(), init_heraia_interface(), init_plugin_name_tv(), interpret_as_date(), interpret_as_number(), ldt_edit_button_clicked(), ldt_remove_button_clicked(), load_file_to_analyse(), log_window_connect_signals(), logw_close_clicked(), mw_cmi_plw_toggle(), my_log(), on_DIMenu_activate(), on_ldt_menu_activate(), plugin_list_window_connect_signals(), plw_close_clicked(), plw_refresh_clicked(), pn_treeview_selection_changed_cb(), record_and_hide_about_box(), refresh_file_labels(), refresh_hex_datas_entry(), 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(), and which_endianness().

static void heraia_ui_connect_signals ( heraia_window_t main_window  )  [static]

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

I can not record why I wrote this code. But it is very clear that nowdays it will never be used and is totally useless !!

Definition at line 641 of file heraia_ui.c.

References heraia_window_t::current_doc, heraia_window_t::current_DW, heraia_get_widget(), xml_t::main, refresh_file_labels(), heraia_window_t::win_prop, and heraia_window_t::xmls.

Referenced by main().

Here is the call graph for this function:

gboolean is_cmi_checked ( GtkWidget *  check_menu_item  ) 

Tells whether a GtkCheckMenuItem is Checked or not

Definition at line 991 of file heraia_ui.c.

Referenced by on_ldt_menu_activate().

void kill_text_from_textview ( GtkTextView *  textview  ) 

Kills the text from a textview

Definition at line 933 of file heraia_ui.c.

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

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

filename = g_strdup_printf("treatment.glade"); main_window->xmls->treatment = load_glade_xml_file(main_window->location_list, filename); g_free(filename);

Definition at line 715 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:

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

Definition at line 825 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(), and log_window_init_interface().

Referenced by main().

Here is the call 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 !

Definition at line 423 of file heraia_ui.c.

Referenced by set_the_working_directory().

window_prop_t* 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

Definition at line 77 of file heraia_ui.c.

References window_prop_t::displayed, 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(), show_hide_log_window(), and show_hide_widget().

void on_coller1_activate ( GtkWidget *  widget,
gpointer  data 
)

Paste, edit menu

Definition at line 189 of file heraia_ui.c.

References log_message().

Referenced by heraia_ui_connect_signals().

Here is the call graph for this function:

void on_copier1_activate ( GtkWidget *  widget,
gpointer  data 
)

Copy, edit menu

Definition at line 178 of file heraia_ui.c.

References log_message().

Referenced by heraia_ui_connect_signals().

Here is the call graph for this function:

void on_couper1_activate ( GtkWidget *  widget,
gpointer  data 
)

Cut, edit menu

Definition at line 168 of file heraia_ui.c.

References log_message().

Referenced by heraia_ui_connect_signals().

Here is the call graph for this function:

void on_DIMenu_activate ( GtkWidget *  widget,
gpointer  data 
)

void on_nouveau1_activate ( GtkWidget *  widget,
gpointer  data 
)

New, file menu

Definition at line 43 of file heraia_ui.c.

References log_message().

Referenced by heraia_ui_connect_signals().

Here is the call graph for this function:

void on_ouvrir1_activate ( GtkWidget *  widget,
gpointer  data 
)

This handles the menuitem "Ouvrir" to open a file

Definition at line 258 of file heraia_ui.c.

References heraia_window_t::current_DW, data_window_t::current_hexwidget, heraia_window_t::event, heraia_window_t::filename, HERAIA_REFRESH_NEW_FILE, 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:

void on_quitter1_activate ( GtkWidget *  widget,
gpointer  data 
)

Quit, file menu

Definition at line 35 of file heraia_ui.c.

Referenced by heraia_ui_connect_signals().

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)

Definition at line 276 of file heraia_ui.c.

References heraia_window_t::current_doc, heraia_hex_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:

void on_save_as_activate ( GtkWidget *  widget,
gpointer  data 
)

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

Definition at line 297 of file heraia_ui.c.

References heraia_window_t::current_doc, 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:

void on_supprimer1_activate ( GtkWidget *  widget,
gpointer  data 
)

Delete, edit menu

Definition at line 158 of file heraia_ui.c.

References log_message().

Here is the call graph for this function:

static void record_and_hide_about_box ( heraia_window_t main_window  )  [static]

Record position and hide about dialog box

Definition at line 118 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:

window_prop_t* record_and_hide_dialog_box ( GtkWidget *  dialog_box,
window_prop_t dialog_prop 
)

void refresh_event_handler ( GtkWidget *  widget,
gpointer  data 
)

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

Definition at line 234 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(), and on_ouvrir1_activate().

Here is the call graph for this function:

static void refresh_file_labels ( heraia_window_t main_window  )  [static]

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

Definition at line 202 of file heraia_ui.c.

References heraia_window_t::current_DW, data_window_t::current_hexwidget, ghex_get_cursor_position(), heraia_get_widget(), xml_t::main, and heraia_window_t::xmls.

Referenced by init_heraia_interface(), and refresh_event_handler().

Here is the call 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

Definition at line 544 of file heraia_ui.c.

References heraia_window_t::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:

gboolean select_file_to_load ( heraia_window_t main_window  ) 

This function does open a file selector dialog box and returns the selected filename. We do fill the main_window->filename parameter here !

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 481 of file heraia_ui.c.

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

Referenced by on_ouvrir1_activate().

Here is the call 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)

Definition at line 609 of file heraia_ui.c.

References heraia_window_t::current_doc, 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:

static void set_the_working_directory ( GtkFileChooser *  file_chooser,
gchar *  filename 
) [static]

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)

Definition at line 462 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:

void update_main_window_name ( heraia_window_t main_window  ) 

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

Definition at line 591 of file heraia_ui.c.

References heraia_window_t::current_doc, 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:


Generated on Mon Oct 20 21:23:08 2008 for Heraia by  doxygen 1.5.6