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)
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 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 52 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 139 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 145 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 133 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 662 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 362 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 352 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 936 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 371 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 868 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 892 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 
)

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

References heraia_window_t::current_DW, heraia_get_widget(), xml_t::main, 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 908 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 850 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 632 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 742 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 385 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 76 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 188 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 177 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 167 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 42 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 221 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 34 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 239 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 260 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(), 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 157 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 117 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 200 of file heraia_ui.c.

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

Referenced by connect_cursor_moved_signal(), and on_ouvrir1_activate().

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 506 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 443 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:

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 424 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 553 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 Sun Aug 24 19:27:40 2008 for Heraia by  doxygen 1.5.6