Heraia
0.1.8
|
Header file for menu, callbacks, utility functions and ui management. More...
Go to the source code of this file.
Macros | |
#define | H_DEBUG 1 |
Functions | |
void | on_quit_activate (GtkWidget *widget, gpointer data) |
Quit, file menu. More... | |
void | on_new_activate (GtkWidget *widget, gpointer data) |
New, file menu. More... | |
void | on_open_activate (GtkWidget *widget, gpointer data) |
This handles the menuitem "Ouvrir" to open a file. More... | |
void | on_close_activate (GtkWidget *widget, gpointer data) |
Closes an opened file. More... | |
void | on_save_activate (GtkWidget *widget, gpointer data) |
Here we attemp to save the edited file. More... | |
void | on_save_as_activate (GtkWidget *widget, gpointer data) |
This handle the save_as menu entry (here the filename changes) More... | |
void | on_preferences_activate (GtkWidget *widget, gpointer data) |
Preferences, file menu : Displays the preference window (as a modal window) More... | |
void | on_delete_activate (GtkWidget *widget, gpointer data) |
Delete, edit menu. More... | |
void | a_propos_activate (GtkWidget *widget, gpointer data) |
Shows apropos's dialog box. More... | |
void | on_undo_activate (GtkWidget *widget, gpointer data) |
Undo, edit menu. More... | |
void | on_redo_activate (GtkWidget *widget, gpointer data) |
Redo, edit menu. More... | |
void | on_cut_activate (GtkWidget *widget, gpointer data) |
Cut, edit menu. More... | |
void | on_copy_activate (GtkWidget *widget, gpointer data) |
Copy, edit menu. More... | |
void | on_paste_activate (GtkWidget *widget, gpointer data) |
Paste, edit menu. More... | |
void | on_fr_activate (GtkWidget *widget, gpointer data) |
Find and replace, Search menu. More... | |
void | on_find_activate (GtkWidget *widget, gpointer data) |
Find, Search menu. More... | |
void | on_fdft_activate (GtkWidget *widget, gpointer data) |
Find data from type, Search menu. More... | |
void | on_DIMenu_activate (GtkWidget *widget, gpointer data) |
This handles the menuitem "Data Interpretor" that shows or hides the data interpretor window. More... | |
void | on_tests_menu_activate (GtkWidget *widget, gpointer data) |
Called when tests submenu is activated. More... | |
gboolean | delete_main_window_event (GtkWidget *widget, GdkEvent *event, gpointer data) |
gboolean | delete_dt_window_event (GtkWidget *widget, GdkEvent *event, gpointer data) |
call back function for the data interpretor window destruction More... | |
void | destroy_dt_window (GtkWidget *widget, GdkEvent *event, gpointer data) |
call back function for the data interpretor window destruction More... | |
GSList * | select_file_to_load (heraia_struct_t *main_struct, gboolean multiple, gchar *message) |
This function does open a file selector dialog box and returns the selected filename. More... | |
gchar * | select_a_file_to_save (heraia_struct_t *main_struct) |
This function opens a dialog box that allow one to choose a file name to the file which is about to be saved. More... | |
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) More... | |
void | init_heraia_interface (heraia_struct_t *main_struct) |
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. More... | |
int | load_heraia_ui (heraia_struct_t *main_struct) |
Loads, if possible, the gtkbuilder xml file and then connects the signals and inits the following windows : More... | |
void | init_window_states (heraia_struct_t *main_struct) |
Inits all windows states (positions, displayed, and so on...) More... | |
void | grey_main_widgets (GtkBuilder *main, gboolean greyed) |
Hides or grey all widgets that needs an open file when boolean greyed is TRUE. More... | |
void | refresh_event_handler (GtkWidget *widget, gpointer data) |
This function is here to ensure that everything will be refreshed upon a signal event. More... | |
void | refresh_file_labels (heraia_struct_t *main_struct) |
This function is refreshing the labels on the main window in order to reflect cursor position, selected positions and total selected size. More... | |
void | connect_cursor_moved_signal (heraia_struct_t *main_struct, GtkWidget *hex_widget) |
Connects the signal that the cursor has moved to the refreshing function. More... | |
void | connect_data_changed_signal (heraia_struct_t *main_struct, GtkWidget *hex_widget) |
void | data_has_changed (GtkWidget *widget, gpointer data) |
void | record_dialog_box_position (GtkWidget *dialog_box, window_prop_t *dialog_prop) |
Records one dialog position. More... | |
void | record_all_dialog_box_positions (heraia_struct_t *main_struct) |
Records all the positions of the displayed windows. More... | |
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. More... | |
void | record_and_hide_dialog_box (GtkWidget *dialog_box, window_prop_t *dialog_pos) |
Record position and hide a dialog box. More... | |
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. More... | |
GtkWidget * | heraia_get_widget (GtkBuilder *xml, gchar *widget_name) |
This is a wrapper to the GtkBuilder xml get widget. More... | |
void | add_text_to_textview (GtkTextView *textview, const char *format,...) |
adds a text to a textview More... | |
void | kill_text_from_textview (GtkTextView *textview) |
Kills the text from a textview. More... | |
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. More... | |
GtkWidget * | gtk_radio_button_get_active_from_widget (GtkRadioButton *radio_group_member) |
gets the active radio button from a radio group More... | |
void | gtk_radio_button_set_active (GtkRadioButton *radio_button) |
Sets the radio button active. More... | |
gboolean | is_cmi_checked (GtkWidget *check_menu_item) |
Tells whether a GtkCheckMenuItem is Checked or not. More... | |
gboolean | is_toggle_button_activated (GtkBuilder *main_xml, gchar *check_button) |
returns the state of a named check button contained in the GtkBuilder XML description More... | |
void | destroy_a_single_widget (GtkWidget *widget) |
Destroys a single widget if it exists. More... | |
void | update_main_window_name (heraia_struct_t *main_struct) |
Update main window heraia's name to reflect the current edited file. More... | |
void | set_notebook_tab_name (heraia_struct_t *main_struct) |
Sets notebook's tab's name. More... | |
void | add_new_tab_in_main_window (heraia_struct_t *main_struct, doc_t *doc) |
Adds a new tab to the main window in file's notebook. More... | |
void | set_notebook_tab_label_color (heraia_struct_t *main_struct, gboolean color) |
Set the style for the label. More... | |
gint | find_tab_number_from_widget (heraia_struct_t *main_struct, gchar *notebook_name, GtkWidget *to_find) |
Searches in a notebook's tabs for a particular widget and returns the number of the corresponding tab if it exists, -1 otherwise. More... | |
GtkWidget * | find_label_from_hbox (GtkWidget *hbox) |
Tries to find the label contained in the hbox. More... | |
GtkWidget * | create_tab_close_button (heraia_struct_t *main_struct, GtkWidget *tab_label, void *signal_handler) |
Creates an hbox containning a cross button (in order to close the tab) and a label (from tab_label). More... | |
gboolean | file_notebook_tab_changed (GtkNotebook *notebook, GtkWidget *page, gint tab_num, gpointer data) |
What to do when a change occurs in tabs (user selected a particular tab) More... | |
Header file for menu, callbacks, utility functions and ui management.
Definition in file heraia_ui.h.
#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_struct_t *main_struct main structure |
Definition at line 172 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_struct_t::win_prop, and heraia_struct_t::xmls.
Referenced by heraia_ui_connect_signals().
void add_new_tab_in_main_window | ( | heraia_struct_t * | main_struct, |
doc_t * | doc | ||
) |
Adds a new tab to the main window in file's notebook.
main_struct | : main structure |
doc | : the new document that will be related to the tab |
< used for vbox creation
< file_notebook from heraia.gtkbuilder
< tab's label
<menu's label
< new tab's index
< markup text
< menu markup text
< used for hbox creation in the tabs
Definition at line 2547 of file heraia_ui.c.
References create_tab_close_button(), heraia_struct_t::current_doc, doc_t_document_get_filename(), heraia_get_widget(), doc_t::hex_widget, xml_t::main, on_close_activate(), and heraia_struct_t::xmls.
Referenced by load_file_to_analyse(), and on_new_activate().
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 2025 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_struct_t * | main_struct, |
GtkWidget * | hex_widget | ||
) |
Connects the signal that the cursor has moved to the refreshing function.
main_struct | : main structure |
hex_widget | : the hex_widget we want to connect the signal to |
Definition at line 1721 of file heraia_ui.c.
References refresh_event_handler().
Referenced by heraia_hex_document_new(), and on_new_activate().
void connect_data_changed_signal | ( | heraia_struct_t * | main_struct, |
GtkWidget * | hex_widget | ||
) |
GtkWidget* create_tab_close_button | ( | heraia_struct_t * | main_struct, |
GtkWidget * | tab_label, | ||
void * | signal_handler | ||
) |
Creates an hbox containning a cross button (in order to close the tab) and a label (from tab_label).
Creates a label an a button to add into a tab from main window's notebook
main_struct | : main structure |
tab_label | : a GtkWidget that is the label we want to add to the tab |
signal_handler | : the signal to connect to when the close button is clicked. |
< used for hbox creation in the tabs
< Closing button
Definition at line 2505 of file heraia_ui.c.
Referenced by add_gtk_tree_view_to_result_notebook(), and add_new_tab_in_main_window().
void data_has_changed | ( | GtkWidget * | widget, |
gpointer | data | ||
) |
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_struct_t *main_struct main structure and not NULL |
Definition at line 1200 of file heraia_ui.c.
References heraia_get_widget(), xml_t::main, and heraia_struct_t::xmls.
Referenced by connect_data_interpretor_signals().
gboolean delete_main_window_event | ( | GtkWidget * | widget, |
GdkEvent * | event, | ||
gpointer | data | ||
) |
Definition at line 1183 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 2207 of file heraia_ui.c.
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_struct_t *main_struct main structure and not NULL |
Definition at line 1217 of file heraia_ui.c.
References heraia_get_widget(), xml_t::main, and heraia_struct_t::xmls.
Referenced by connect_data_interpretor_signals().
gboolean file_notebook_tab_changed | ( | GtkNotebook * | notebook, |
GtkWidget * | page, | ||
gint | tab_num, | ||
gpointer | data | ||
) |
What to do when a change occurs in tabs (user selected a particular tab)
notebook | : the widget that issued this signal |
page | : the new current page |
tab_num | : index of this page |
data | : MUST be heraia_struct_t *main_struct ! |
Definition at line 1233 of file heraia_ui.c.
References heraia_struct_t::current_doc, heraia_struct_t::documents, heraia_struct_t::event, HERAIA_REFRESH_NOTHING, HERAIA_REFRESH_TAB_CHANGED, refresh_event_handler(), and update_main_window_name().
Referenced by heraia_ui_connect_signals().
GtkWidget* find_label_from_hbox | ( | GtkWidget * | hbox | ) |
Tries to find the label contained in the hbox.
hbox | : the hbox widget containing one GtkLabel |
GList *children is the list of children in the hbox widget
Definition at line 1463 of file heraia_ui.c.
Referenced by set_notebook_tab_label_color(), and set_notebook_tab_name().
gint find_tab_number_from_widget | ( | heraia_struct_t * | main_struct, |
gchar * | notebook_name, | ||
GtkWidget * | to_find | ||
) |
Searches in a notebook's tabs for a particular widget and returns the number of the corresponding tab if it exists, -1 otherwise.
main_struct | : main structure |
notebbok_name | : the name of the notebook in the structure |
to_find | : a GtkWidget that we want to find in the main notebook tabs |
GtkWidget *notebook is the notenook on the main window
GtkWidget *page are the pages on the notebook
GtkWidget *tab_label is the tab label (hbox + others)
gint nb_pages reflects the number of pages in the notebook
gboolean found is True when the widget has been found
GList *children a list of the Children from the tab label
Definition at line 745 of file heraia_ui.c.
References heraia_get_widget(), xml_t::main, and heraia_struct_t::xmls.
Referenced by on_close_activate(), and rw_on_close_activate().
void grey_main_widgets | ( | GtkBuilder * | xml, |
gboolean | greyed | ||
) |
Hides or grey all widgets that needs an open file when boolean greyed is TRUE.
Also sets the current page of the notebook to the first one.
xml | : GtkBuilder XML main structure |
greyed | : boolean (TRUE to hide an grey widgets) |
Definition at line 1601 of file heraia_ui.c.
References heraia_get_widget().
Referenced by close_a_project(), init_heraia_interface(), load_file_to_analyse(), on_close_activate(), and on_new_activate().
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 2070 of file heraia_ui.c.
Referenced by gtk_radio_button_get_active_from_widget().
GtkWidget* gtk_radio_button_get_active_from_widget | ( | GtkRadioButton * | radio_button | ) |
gets the active radio button from a radio group
radio_button | : GtkRadioButton to get radio group from |
Definition at line 2098 of file heraia_ui.c.
References gtk_radio_button_get_active().
Referenced by di_get_endianness(), and goto_dialog_ok().
void gtk_radio_button_set_active | ( | GtkRadioButton * | radio_button | ) |
Sets the radio button active.
radio_button | : The GtkRadioButton to be active within it's group |
Definition at line 2115 of file heraia_ui.c.
Referenced by di_set_endianness().
GtkWidget* heraia_get_widget | ( | GtkBuilder * | xml, |
gchar * | widget_name | ||
) |
This is a wrapper to the GtkBuilder 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 GtkBuilder XML definition |
widget_name | : an existing widget name in the GtkBuilder 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 2184 of file heraia_ui.c.
Referenced by a_propos_activate(), add_default_tabs(), add_entry_to_plugins_menu(), add_gtk_tree_view_to_result_notebook(), add_new_tab_in_main_window(), close_a_project(), close_one_document(), connect_data_interpretor_signals(), data_interpretor_init_interface(), delete_dt_window_event(), destroy_dt_window(), di_get_endianness(), di_get_selected_tab(), di_get_stream_size(), di_set_endianness(), di_set_selected_tab(), di_set_stream_size(), fdft_prev_next_bt_clicked(), fdft_window_close(), fdft_window_connect_signal(), fdft_window_init_widgets(), fdft_window_show(), find_replace_add_ghex_widget(), find_tab_number_from_widget(), find_window_close(), find_window_connect_signal(), find_window_show(), fr_window_close(), fr_window_connect_signal(), fr_window_show(), goto_dialog_canceled(), goto_dialog_connect_signal(), goto_dialog_ok(), grey_main_widgets(), heraia_ui_connect_signals(), histo_radiobutton_toggled(), init(), init_heraia_interface(), init_plugin_name_tv(), init_window_states(), is_toggle_button_activated(), load_mp_display_preferences_options(), load_mp_file_preferences_options(), load_mp_files_filenames(), load_mpwp_preferences(), log_window_connect_signals(), log_window_init_interface(), logw_close_clicked(), main_pref_window_connect_signals(), mw_cmi_plw_toggle(), mw_cmi_show_logw_toggle(), my_log(), on_close_activate(), on_DIMenu_activate(), on_goto_activate(), on_mp_tb_display_bt_toggled(), on_mp_tb_fp_bt_toggled(), on_preferences_activate(), on_projects_open_activate(), on_redo_activate(), on_undo_activate(), plugin_list_window_connect_signals(), plw_close_clicked(), plw_refresh_clicked(), pn_treeview_selection_changed_cb(), populate_stats_histos(), pref_window_delete(), realize_some_numerical_stat(), record_all_dialog_box_positions(), record_and_hide_about_box(), refresh_file_labels(), result_window_close(), result_window_connect_signal(), result_window_show(), run(), rw_on_close_activate(), rw_remove_all_tabs(), save_mp_files_filenames(), save_mpwp_preferences(), scroll_down_textview(), select_a_file_to_save(), select_file_to_load(), set_notebook_tab_label_color(), set_notebook_tab_name(), set_statw_button_state(), stat_window_connect_signals(), statw_close_clicked(), statw_export_to_csv_clicked(), statw_export_to_gnuplot_clicked(), statw_export_to_pcv_clicked(), statw_save_as_clicked(), tree_selection_changed(), and update_main_window_name().
void init_heraia_interface | ( | heraia_struct_t * | main_struct | ) |
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_struct | : main structure |
Definition at line 1650 of file heraia_ui.c.
References heraia_struct_t::current_doc, grey_main_widgets(), heraia_get_widget(), init_window_states(), xml_t::main, refresh_file_labels(), and heraia_struct_t::xmls.
Referenced by main().
void init_window_states | ( | heraia_struct_t * | main_struct | ) |
Inits all windows states (positions, displayed, and so on...)
main_struct | : main structure |
Definition at line 2359 of file heraia_ui.c.
References all_window_prop_t::about_box, heraia_struct_t::current_doc, all_window_prop_t::data_interpretor, window_prop_t::displayed, all_window_prop_t::fdft_window, all_window_prop_t::find_window, all_window_prop_t::fr_window, all_window_prop_t::goto_window, window_prop_t::height, heraia_get_widget(), init_one_cmi_window_state(), all_window_prop_t::log_box, xml_t::main, all_window_prop_t::main_dialog, all_window_prop_t::main_pref_window, on_DIMenu_activate(), all_window_prop_t::plugin_list, all_window_prop_t::result_window, set_a_propos_properties(), window_prop_t::width, heraia_struct_t::win_prop, window_prop_t::x, heraia_struct_t::xmls, and window_prop_t::y.
Referenced by init_heraia_interface(), and on_projects_open_activate().
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 2146 of file heraia_ui.c.
gboolean is_toggle_button_activated | ( | GtkBuilder * | main_xml, |
gchar * | check_button | ||
) |
returns the state of a named check button contained in the GtkBuilder XML description
main_xml | : a GtkBuilder XML definition |
check_button | : the name of an existing check_button within the GtkBuilder definition |
Definition at line 2161 of file heraia_ui.c.
References heraia_get_widget().
Referenced by heraia_hex_document_new(), on_new_activate(), 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 2049 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_struct_t * | main_struct | ) |
Loads, if possible, the gtkbuilder xml file and then connects the signals and inits the following windows :
main_struct | : main structure |
Definition at line 1869 of file heraia_ui.c.
References data_interpretor_init_interface(), heraia_struct_t::debug, fdft_window_init_interface(), find_window_init_interface(), fr_window_init_interface(), goto_dialog_init_interface(), heraia_ui_connect_signals(), load_heraia_xml(), load_preferences(), log_window_init_interface(), main_pref_window_init_interface(), heraia_struct_t::prefs, and result_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 193 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(), mw_cmi_show_logw_toggle(), on_DIMenu_activate(), on_preferences_activate(), result_window_show(), and show_hide_widget().
void on_close_activate | ( | GtkWidget * | widget, |
gpointer | data | ||
) |
Closes an opened file.
widget | : the widget that issued the signal |
data | : user data MUST be heraia_struct_t *main_struct main structure |
doc_t *closing_doc the current document to close in heraia
doc_t *document to iterate over the array of documents
GtkWidget *notebook is the notenook on the main window
GtkWidget *dialog is the dialog box
GtkWidget *parent is the parent widget for the dialog box
gint result the result from the dialog box
gboolean is_current_doc says wheter the document that we are trying to close is the current one or not
Definition at line 914 of file heraia_ui.c.
References close_one_document(), heraia_struct_t::current_doc, doc_t_document_get_filename(), heraia_struct_t::documents, find_tab_number_from_widget(), grey_main_widgets(), heraia_get_widget(), log_message(), xml_t::main, doc_t::modified, refresh_event_handler(), update_main_window_name(), and heraia_struct_t::xmls.
Referenced by add_new_tab_in_main_window(), and heraia_ui_connect_signals().
void on_copy_activate | ( | GtkWidget * | widget, |
gpointer | data | ||
) |
Copy, edit menu.
widget | : the widget that issued the signal |
data | : user data MUST be heraia_struct_t *main_struct main structure |
Definition at line 504 of file heraia_ui.c.
References heraia_struct_t::current_doc, and doc_t::hex_widget.
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_struct_t *main_struct main structure |
Definition at line 487 of file heraia_ui.c.
References heraia_struct_t::current_doc, doc_t::hex_widget, and refresh_event_handler().
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_struct_t *main_struct main structure |
Definition at line 470 of file heraia_ui.c.
References heraia_struct_t::current_doc, doc_t::hex_widget, and refresh_event_handler().
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_struct_t *main_struct main structure |
data_window_t *dw is a structure for the data interpretor
GtkNotebook *notebook is the data interpretor's notebook
Definition at line 1106 of file heraia_ui.c.
References heraia_struct_t::current_DW, all_window_prop_t::data_interpretor, 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_struct_t::win_prop, and heraia_struct_t::xmls.
Referenced by heraia_ui_connect_signals(), and init_window_states().
void on_fdft_activate | ( | GtkWidget * | widget, |
gpointer | data | ||
) |
Find data from type, Search menu.
widget | : the widget that issued the signal |
data | : user data MUST be heraia_struct_t *main_struct main structure |
Definition at line 569 of file heraia_ui.c.
References heraia_struct_t::current_doc, and fdft_window_show().
Referenced by heraia_ui_connect_signals().
void on_find_activate | ( | GtkWidget * | widget, |
gpointer | data | ||
) |
Find, Search menu.
widget | : the widget that issued the signal |
data | : user data MUST be heraia_struct_t *main_struct main structure |
Definition at line 537 of file heraia_ui.c.
References heraia_struct_t::current_doc, and find_window_show().
Referenced by heraia_ui_connect_signals().
void on_fr_activate | ( | GtkWidget * | widget, |
gpointer | data | ||
) |
Find and replace, Search menu.
widget | : the widget that issued the signal |
data | : user data MUST be heraia_struct_t *main_struct main structure |
Definition at line 553 of file heraia_ui.c.
References heraia_struct_t::current_doc, and fr_window_show().
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_struct_t *main_struct main structure |
Definition at line 77 of file heraia_ui.c.
References add_new_tab_in_main_window(), connect_cursor_moved_signal(), heraia_struct_t::current_doc, heraia_struct_t::documents, heraia_struct_t::event, grey_main_widgets(), HERAIA_REFRESH_NEW_FILE, doc_t::hex_widget, is_toggle_button_activated(), log_message(), xml_t::main, new_doc_t(), refresh_event_handler(), set_notebook_tab_label_color(), update_main_window_name(), and heraia_struct_t::xmls.
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_struct_t *main_struct main structure |
Definition at line 705 of file heraia_ui.c.
References heraia_struct_t::current_doc, heraia_struct_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().
void on_paste_activate | ( | GtkWidget * | widget, |
gpointer | data | ||
) |
Paste, edit menu.
widget | : the widget that issued the signal |
data | : user data MUST be heraia_struct_t *main_struct main structure |
Definition at line 520 of file heraia_ui.c.
References heraia_struct_t::current_doc, doc_t::hex_widget, and refresh_event_handler().
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_struct_t *main_struct main structure |
Definition at line 135 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_struct_t::win_prop, and heraia_struct_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_struct_t *main_struct main structure |
Definition at line 57 of file heraia_ui.c.
References close_heraia().
Referenced by delete_main_window_event(), and heraia_ui_connect_signals().
void on_redo_activate | ( | GtkWidget * | widget, |
gpointer | data | ||
) |
Redo, edit menu.
widget | : the widget that issued the signal |
data | : user data MUST be heraia_struct_t *main_struct main structure |
Definition at line 434 of file heraia_ui.c.
References heraia_struct_t::current_doc, heraia_get_widget(), doc_t::hex_doc, xml_t::main, doc_t::modified, set_notebook_tab_label_color(), and heraia_struct_t::xmls.
Referenced by 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_struct_t *main_struct main structure |
Definition at line 1027 of file heraia_ui.c.
References heraia_struct_t::current_doc, doc_t_document_get_filename(), heraia_hex_document_save(), HERAIA_NOERR, log_message(), doc_t::modified, and set_notebook_tab_label_color().
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_struct_t *main_struct main structure |
gchar *filename is auto malloc'ed, do not free
Definition at line 1057 of file heraia_ui.c.
References heraia_struct_t::current_doc, doc_t_document_get_filename(), HERAIA_CANCELLED, heraia_hex_document_save_as(), HERAIA_NOERR, log_message(), doc_t::modified, select_a_file_to_save(), set_notebook_tab_name(), and update_main_window_name().
Referenced by heraia_ui_connect_signals().
void on_tests_menu_activate | ( | GtkWidget * | widget, |
gpointer | data | ||
) |
Called when tests submenu is activated.
widget | : the widget that issued the signal |
data | : user data MUST be heraia_struct_t *main_struct main structure |
Definition at line 1155 of file heraia_ui.c.
References log_message(), and tests_ui().
Referenced by heraia_ui_connect_signals().
void on_undo_activate | ( | GtkWidget * | widget, |
gpointer | data | ||
) |
Undo, edit menu.
widget | : the widget that issued the signal |
data | : user data MUST be heraia_struct_t *main_struct main structure |
Definition at line 395 of file heraia_ui.c.
References heraia_struct_t::current_doc, heraia_get_widget(), doc_t::hex_doc, xml_t::main, doc_t::modified, set_notebook_tab_label_color(), and heraia_struct_t::xmls.
Referenced by heraia_ui_connect_signals().
void record_all_dialog_box_positions | ( | heraia_struct_t * | main_struct | ) |
Records all the positions of the displayed windows.
[in,out] | main_struct | : main structure |
Definition at line 250 of file heraia_ui.c.
References all_window_prop_t::about_box, heraia_struct_t::current_DW, all_window_prop_t::data_interpretor, data_window_t::diw, all_window_prop_t::find_window, all_window_prop_t::fr_window, all_window_prop_t::goto_window, heraia_get_widget(), 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(), all_window_prop_t::result_window, heraia_struct_t::win_prop, and heraia_struct_t::xmls.
Referenced by close_a_project().
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 314 of file heraia_ui.c.
References window_prop_t::displayed, and record_dialog_box_position().
Referenced by logw_close_clicked(), mw_cmi_plw_toggle(), mw_cmi_show_logw_toggle(), on_DIMenu_activate(), plw_close_clicked(), pref_window_delete(), record_and_hide_about_box(), result_window_close(), 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 223 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_struct_t *main_struct main structure |
Definition at line 676 of file heraia_ui.c.
References heraia_struct_t::event, HERAIA_REFRESH_CURSOR_MOVE, HERAIA_REFRESH_NOTHING, refresh_all_plugins(), refresh_data_interpretor_window(), and refresh_file_labels().
Referenced by close_a_project(), connect_cursor_moved_signal(), file_notebook_tab_changed(), on_close_activate(), on_cut_activate(), on_delete_activate(), on_new_activate(), on_open_activate(), and on_paste_activate().
void refresh_file_labels | ( | heraia_struct_t * | main_struct | ) |
This function is refreshing the labels on the main window in order to reflect cursor position, selected positions and total selected size.
It is also used to refresh the file label on the tab.
main_struct | : main structure |
Definition at line 588 of file heraia_ui.c.
References heraia_struct_t::current_doc, selection_t::end, ghex_file_size(), ghex_get_cursor_position(), ghex_get_selection(), heraia_get_widget(), doc_t::hex_doc, doc_t::hex_widget, is_toggle_button_activated(), xml_t::main, doc_t::modified, set_notebook_tab_label_color(), selection_t::start, and heraia_struct_t::xmls.
Referenced by init_heraia_interface(), on_mp_thousand_bt_toggled(), and refresh_event_handler().
gchar* select_a_file_to_save | ( | heraia_struct_t * | main_struct | ) |
This function opens a dialog box that allow one to choose a file name to the file which is about to be saved.
main_struct | : main structure |
GtkWidget *parent is a parent window (we use main_struct)
Definition at line 1386 of file heraia_ui.c.
References heraia_struct_t::current_doc, doc_t_document_get_filename(), heraia_get_widget(), xml_t::main, set_the_working_directory(), and heraia_struct_t::xmls.
Referenced by on_projects_save_as_activate(), and on_save_as_activate().
GSList* select_file_to_load | ( | heraia_struct_t * | main_struct, |
gboolean | multiple, | ||
gchar * | message | ||
) |
This function does open a file selector dialog box and returns the selected filename.
main_struct | : main structure |
multiple | : to say wether we want multiple selection be possible or not |
message | : the message to print in the title's dialog box |
GtkWidget *parent is a parent window (we use main_struct)
GSList *list is a list of selected (if any) filenames to be openned
We want the file selection path to be the one of the current opened file if any !
Definition at line 1333 of file heraia_ui.c.
References heraia_struct_t::current_doc, doc_t_document_get_filename(), heraia_get_widget(), xml_t::main, set_the_working_directory(), and heraia_struct_t::xmls.
Referenced by on_open_activate(), and on_projects_open_activate().
void set_notebook_tab_label_color | ( | heraia_struct_t * | main_struct, |
gboolean | color | ||
) |
Set the style for the label.
main_struct | : main structure |
color | : If color is TRUE sets the color for the file tab's label If not, then sets it to default |
< file notebook in main window
< Current page for the file notebook
< tab's label
< menu tab's label
< container that has the label and the button
< index of the current tab displayed
< markup text
< label's text
Definition at line 1550 of file heraia_ui.c.
References heraia_struct_t::current_doc, find_label_from_hbox(), heraia_get_widget(), log_message(), xml_t::main, and heraia_struct_t::xmls.
Referenced by on_new_activate(), on_redo_activate(), on_save_activate(), on_undo_activate(), and refresh_file_labels().
void set_notebook_tab_name | ( | heraia_struct_t * | main_struct | ) |
Sets notebook's tab's name.
This function should only be called when a new filename was set (open and save as functions)
main_struct | : main structure |
< file notebook in main window
< Current page for the file notebook
< container that has the label and the button
< tab's label
< corresponding tab's document
< index of the current tab displayed
< markup text
Definition at line 1506 of file heraia_ui.c.
References heraia_struct_t::current_doc, doc_t_document_get_filename(), heraia_struct_t::documents, find_label_from_hbox(), heraia_get_widget(), xml_t::main, and heraia_struct_t::xmls.
Referenced by on_save_as_activate().
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)
file_chooser | : An initialized GtkFileChooser |
filename | : a filename (one previously openned) |
gchar *dirname is the directory where we want to be, at first, in the file chooser
Definition at line 1311 of file heraia_ui.c.
References make_absolute_path().
Referenced by select_a_file_to_save(), and select_file_to_load().
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.
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 2613 of file heraia_ui.c.
References move_and_show_dialog_box(), and record_and_hide_dialog_box().
Referenced by fdft_window_close(), fdft_window_show(), find_window_close(), find_window_show(), fr_window_close(), fr_window_show(), goto_dialog_canceled(), on_goto_activate(), run(), and statw_close_clicked().
void update_main_window_name | ( | heraia_struct_t * | main_struct | ) |
Update main window heraia's name to reflect the current edited file.
main_struct | : main structure |
Definition at line 1434 of file heraia_ui.c.
References heraia_struct_t::current_doc, doc_t_document_get_filename(), heraia_get_widget(), xml_t::main, and heraia_struct_t::xmls.
Referenced by close_a_project(), file_notebook_tab_changed(), load_file_to_analyse(), on_close_activate(), on_new_activate(), and on_save_as_activate().