Definition in file heraia_ui.h.
Go to the source code of this file.
Defines | |
#define | H_DEBUG 1 |
Functions | |
void | on_quit_activate (GtkWidget *widget, gpointer data) |
Quit, file menu. | |
void | on_new_activate (GtkWidget *widget, gpointer data) |
New, file menu. | |
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_preferences_activate (GtkWidget *widget, gpointer data) |
Preferences, file menu : Displays the preference window (as a modal window). | |
void | on_delete_activate (GtkWidget *widget, gpointer data) |
Delete, edit menu. | |
void | a_propos_activate (GtkWidget *widget, gpointer data) |
Shows apropos's dialog box. | |
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 | 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 | 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 | 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. | |
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 :
| |
void | init_window_states (heraia_window_t *main_window) |
Inits all windows states (positions, displayed, and so on. | |
void | refresh_event_handler (GtkWidget *widget, gpointer data) |
This function is here to ensure that everything will be refreshed upon a signal event. | |
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 | connect_cursor_moved_signal (heraia_window_t *main_window) |
Connects the signal that the cursor has moved to the refreshing function. | |
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 | move_and_show_dialog_box (GtkWidget *dialog_box, window_prop_t *dialog_pos) |
Move the dialog box to the wanted position, shows it and says it in the displayed prop. | |
void | record_and_hide_dialog_box (GtkWidget *dialog_box, window_prop_t *dialog_pos) |
Record position and hide a dialog box. | |
GtkWidget * | heraia_get_widget (GladeXML *xml, gchar *widget_name) |
This is a wrapper to the glade xml get widget. | |
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 | |
void | destroy_a_single_widget (GtkWidget *widget) |
Destroys a single widget if it exists. | |
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. |
#define H_DEBUG 1 |
Definition at line 30 of file heraia_ui.h.
void a_propos_activate | ( | GtkWidget * | widget, | |
gpointer | data | |||
) |
Shows apropos's dialog box.
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().
void add_text_to_textview | ( | GtkTextView * | textview, | |
const char * | format, | |||
... | ||||
) |
adds a text to a textview
textview | : the textview where to add text | |
format | : printf style format | |
... | : a va_list arguments to fit format (as with printf) |
Definition at line 1160 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().
void connect_cursor_moved_signal | ( | heraia_window_t * | main_window | ) |
Connects the signal that the cursor has moved to the refreshing function.
main_window | : main structure |
Definition at line 949 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().
gboolean delete_dt_window_event | ( | GtkWidget * | widget, | |
GdkEvent * | event, | |||
gpointer | data | |||
) |
call back function for the data interpretor window destruction
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 610 of file heraia_ui.c.
References heraia_get_widget(), xml_t::main, and heraia_window_t::xmls.
Referenced by connect_data_interpretor_signals().
gboolean delete_main_window_event | ( | GtkWidget * | widget, | |
GdkEvent * | event, | |||
gpointer | data | |||
) |
When the user destroys or delete the main window.
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 594 of file heraia_ui.c.
References on_quit_activate().
Referenced by heraia_ui_connect_signals().
void destroy_a_single_widget | ( | GtkWidget * | widget | ) |
Destroys a single widget if it exists.
widget | : the widget to destroy |
Definition at line 1310 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 | |||
) |
call back function for the data interpretor window destruction
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 626 of file heraia_ui.c.
References heraia_get_widget(), xml_t::main, and heraia_window_t::xmls.
Referenced by connect_data_interpretor_signals().
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.
group | : A group of GtkRadioButtons |
Definition at line 1205 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 | ) |
gets the active radio button from a radio group
radio_group_member | : widget to get radio group from |
Definition at line 1229 of file heraia_ui.c.
References gtk_radio_button_get_active().
Referenced by which_endianness().
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 :)
xml | : A glade XML definition | |
widget_name | : an existing widget name in the glade definition |
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 1287 of file heraia_ui.c.
Referenced by a_propos_activate(), add_data_type_name_to_treeview(), add_default_tabs(), 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(), init_window_states(), is_toggle_button_activated(), ldt_edit_button_clicked(), ldt_remove_button_clicked(), load_di_preferences(), load_file_to_analyse(), load_mp_display_preferences_options(), load_mp_file_preferences_options(), log_window_connect_signals(), 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().
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.
main_window | : main structure |
Hide notebook and menus
Definition at line 878 of file heraia_ui.c.
References heraia_window_t::current_doc, heraia_get_widget(), init_window_states(), xml_t::main, refresh_file_labels(), and heraia_window_t::xmls.
Referenced by main().
void init_window_states | ( | heraia_window_t * | main_window | ) |
Inits all windows states (positions, displayed, and so on.
..)
main_window | : main structure |
Definition at line 1363 of file heraia_ui.c.
References all_window_prop_t::about_box, all_window_prop_t::data_interpretor, window_prop_t::displayed, window_prop_t::height, heraia_get_widget(), init_one_cmi_window_state(), 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, set_a_propos_properties(), window_prop_t::width, heraia_window_t::win_prop, window_prop_t::x, heraia_window_t::xmls, and window_prop_t::y.
Referenced by init_heraia_interface().
gboolean is_cmi_checked | ( | GtkWidget * | check_menu_item | ) |
Tells whether a GtkCheckMenuItem is Checked or not.
check_menu_item | : a GtkCheckMenuItem to verify |
Definition at line 1248 of file heraia_ui.c.
Referenced by on_ldt_menu_activate().
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
main_xml | : a GladeXML definition | |
check_button | : the name of an existing check_button within the glade definition |
Definition at line 1263 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().
void kill_text_from_textview | ( | GtkTextView * | textview | ) |
Kills the text from a textview.
textview | : the textview to kill the text from |
Definition at line 1184 of file heraia_ui.c.
Referenced by plw_refresh_clicked(), pn_treeview_selection_changed_cb(), and realize_some_numerical_stat().
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 :
main_window | : main structure |
Definition at line 1045 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().
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.
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().
void on_copy_activate | ( | GtkWidget * | widget, | |
gpointer | data | |||
) |
Copy, edit menu.
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().
void on_cut_activate | ( | GtkWidget * | widget, | |
gpointer | data | |||
) |
Cut, edit menu.
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().
void on_delete_activate | ( | GtkWidget * | widget, | |
gpointer | data | |||
) |
Delete, edit menu.
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().
void on_DIMenu_activate | ( | GtkWidget * | widget, | |
gpointer | data | |||
) |
This handles the menuitem "Data Interpretor" that shows or hides the data interpretor window.
widget | : the widget that issued the signal | |
data | : user data MUST be heraia_window_t *main_window main structure |
Definition at line 542 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().
void on_new_activate | ( | GtkWidget * | widget, | |
gpointer | data | |||
) |
New, file menu.
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().
void on_open_activate | ( | GtkWidget * | widget, | |
gpointer | data | |||
) |
This handles the menuitem "Ouvrir" to open a file.
widget | : the widget that issued the signal | |
data | : user data MUST be heraia_window_t *main_window main structure |
Definition at line 447 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().
void on_paste_activate | ( | GtkWidget * | widget, | |
gpointer | data | |||
) |
Paste, edit menu.
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().
void on_preferences_activate | ( | GtkWidget * | widget, | |
gpointer | data | |||
) |
Preferences, file menu : Displays the preference window (as a modal window).
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().
void on_quit_activate | ( | GtkWidget * | widget, | |
gpointer | data | |||
) |
Quit, file menu.
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().
void on_save_activate | ( | GtkWidget * | widget, | |
gpointer | data | |||
) |
Here we attemp to save the edited file.
widget | : the widget that issued the signal | |
data | : user data MUST be heraia_window_t *main_window main structure |
Definition at line 470 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().
void on_save_as_activate | ( | GtkWidget * | widget, | |
gpointer | data | |||
) |
This handle the save_as menu entry (here the filename changes).
widget | : the widget that issued the signal | |
data | : user data MUST be heraia_window_t *main_window main structure |
Definition at line 494 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().
void record_all_dialog_box_positions | ( | heraia_window_t * | main_window | ) |
Records all the positions of the displayed windows.
[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().
void record_and_hide_dialog_box | ( | GtkWidget * | dialog_box, | |
window_prop_t * | dialog_prop | |||
) |
Record position and hide a dialog box.
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().
void record_dialog_box_position | ( | GtkWidget * | dialog_box, | |
window_prop_t * | dialog_prop | |||
) |
Records one dialog position.
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().
void refresh_event_handler | ( | GtkWidget * | widget, | |
gpointer | data | |||
) |
This function is here to ensure that everything will be refreshed upon a signal event.
widget | : the widget that issued the signal | |
data | : user data MUST be heraia_window_t *main_window main structure |
Definition at line 417 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_open_activate().
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.
main_window | : main structure |
Definition at line 371 of file heraia_ui.c.
References heraia_window_t::current_DW, data_window_t::current_hexwidget, ghex_get_cursor_position(), heraia_get_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().
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.
main_window | : main structure |
Definition at line 775 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().
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 !
main_window | : main structure |
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 709 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_open_activate().
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)
main_window | : main structure |
Definition at line 844 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().
void update_main_window_name | ( | heraia_window_t * | main_window | ) |
Update main window heraia's name to reflect the current edited file.
main_window | : main structure |
Definition at line 824 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().