Heraia
0.1.8
|
Windows used to find text and find and replace text in the opened hex documents. More...
#include <libheraia.h>
Go to the source code of this file.
Functions | |
static guchar * | fr_get_search_string (heraia_struct_t *main_struct, doc_t *doc, guint *buffer_size) |
Gets the string from the document doc. More... | |
static doc_t * | create_find_or_replace_doc_t (void) |
Creates the HexDocument and the GtkHex widget with the right properties and Fills a doc_t structure with them. More... | |
static void | find_replace_add_ghex_widget (xml_t *xmls, gchar *widget_name, doc_t *entry) |
Adds the GtkHex widget to the right frame. More... | |
static void | fr_search_forward (heraia_struct_t *main_struct, doc_t *search_doc, goffset offset) |
Searches the string entered in the search document in the current one (from the currenty position + offset) in the main window. More... | |
static gboolean | delete_find_window_event (GtkWidget *widget, GdkEvent *event, gpointer data) |
Call back function for the find window destruction. More... | |
static void | destroy_find_window_event (GtkWidget *widget, GdkEvent *event, gpointer data) |
Call back function for the find window destruction. More... | |
static void | find_window_close (GtkWidget *widget, gpointer data) |
Close button has been clicked we want to hide the window. More... | |
static void | find_window_connect_signal (heraia_struct_t *main_struct) |
Signal connections for the find window. More... | |
static void | find_all_bt_clicked (GtkWidget *widget, gpointer data) |
Tries to find, in the document, what the user entered in the GtkHex entry in the find window (all positions from 0) More... | |
static void | find_next_bt_clicked (GtkWidget *widget, gpointer data) |
Tries to find, in the document, what the user entered in the GtkHex entry in the find window (forward from the current position) More... | |
static void | find_prev_bt_clicked (GtkWidget *widget, gpointer data) |
Tries to find, in the document, what the user entered in the GtkHex entry in the find window (backward from the current position) More... | |
static gboolean | delete_fr_window_event (GtkWidget *widget, GdkEvent *event, gpointer data) |
Call back function for the find and replace window destruction. More... | |
static void | destroy_fr_window_event (GtkWidget *widget, GdkEvent *event, gpointer data) |
Call back function for the find and replace window destruction. More... | |
static void | fr_window_close (GtkWidget *widget, gpointer data) |
Close button has been clicked we want to hide the window. More... | |
static void | fr_window_connect_signal (heraia_struct_t *main_struct) |
Signal connections for the find and replace window. More... | |
static void | fr_search_bt_clicked (GtkWidget *widget, gpointer data) |
Tries to find, in the document, what the user entered in the GtkHex entry in the fr window in the find hexwidget (forward from the current position) More... | |
static void | fr_replace_bt_clicked (GtkWidget *widget, gpointer data) |
static void | fr_replace_search_bt_clicked (GtkWidget *widget, gpointer data) |
Tries to replace, in the document, what the user entered in the GtkHex entry in the fr window in the find hexwidget by what the user entered in the replace entry in that same window and then goes to the next position (if any) More... | |
static goffset | fr_replace_data (heraia_struct_t *main_struct) |
Tries to replace, in the document, what the user entered in the GtkHex entry in the fr window in the find hexwidget by what the user entered in the replace entry in that same window. More... | |
static gboolean | delete_fdft_window_event (GtkWidget *widget, GdkEvent *event, gpointer data) |
Call back function for the find data from type window destruction. More... | |
static void | destroy_fdft_window_event (GtkWidget *widget, GdkEvent *event, gpointer data) |
Call back function for the find data from type window destruction. More... | |
static fdft_t * | fdft_window_init_widgets (heraia_struct_t *main_struct) |
Inits the fdft structure and adds the widgets to the window. More... | |
static void | fdft_window_close (GtkWidget *widget, gpointer data) |
Close button has been clicked we want to hide the window. More... | |
static void | fdft_window_connect_signal (heraia_struct_t *main_struct) |
Signal connections for the find data from type window. More... | |
void | find_window_show (GtkWidget *widget, gpointer data) |
Show find window. More... | |
void | find_window_init_interface (heraia_struct_t *main_struct) |
Inits all the things in the find window (signal and such) More... | |
void | fr_window_show (GtkWidget *widget, gpointer data) |
Show find and replace window. More... | |
void | fr_window_init_interface (heraia_struct_t *main_struct) |
Inits all the things in the find and replace window (signal and such) More... | |
static void | fdft_window_populate_category_cb (heraia_struct_t *main_struct) |
void | fdft_window_show (GtkWidget *widget, gpointer data) |
Show find data from type window. More... | |
static decode_t * | get_decode_struct (heraia_struct_t *main_struct, gint cat_index, gint typ_index, gint fea_index, guint *data_size) |
return the decode structure that corresponds to the indexes from category, type and feature as stated in the parameters More... | |
static void | fdft_search_direction (heraia_struct_t *main_struct, gint direction, decode_t *decode_struct, gint data_size, gchar *buffer) |
Searches the string entered in the search document in the current one (from the currenty position + offset) in the main window. More... | |
static void | fdft_prev_next_bt_clicked (GtkWidget *widget, gpointer data) |
Searches data from the selected type (if any) in the current document (if any) and returns the results in the result window. More... | |
static void | fdft_category_cb_changed (GtkWidget *widget, gpointer data) |
Fills the type ComboBox with the right values. More... | |
void | fdft_window_init_interface (heraia_struct_t *main_struct) |
Inits all the things in the find data from type window (signal and such) More... | |
Windows used to find text and find and replace text in the opened hex documents.
Header file for the find window and the find and replace window.
Definition in file find_replace_window.c.
|
static |
Creates the HexDocument and the GtkHex widget with the right properties and Fills a doc_t structure with them.
Definition at line 328 of file find_replace_window.c.
References new_doc_t().
Referenced by find_window_init_interface(), and fr_window_init_interface().
|
static |
Call back function for the find data from type 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 |
Definition at line 689 of file find_replace_window.c.
References fdft_window_close().
Referenced by fdft_window_connect_signal().
|
static |
Call back function for the find 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 |
Definition at line 90 of file find_replace_window.c.
References find_window_close().
Referenced by find_window_connect_signal().
|
static |
Call back function for the find and replace 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 |
Definition at line 433 of file find_replace_window.c.
References fr_window_close().
Referenced by fr_window_connect_signal().
|
static |
Call back function for the find data from type 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 | : user data - MUST be heraia_struct_t *main_struct main structure and not NULL |
Definition at line 703 of file find_replace_window.c.
References fdft_window_close().
Referenced by fdft_window_connect_signal().
|
static |
Call back function for the find 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 | : user data - MUST be heraia_struct_t *main_struct main structure and not NULL |
Definition at line 104 of file find_replace_window.c.
References find_window_close().
Referenced by find_window_connect_signal().
|
static |
Call back function for the find and replace 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 | : user data - MUST be heraia_struct_t *main_struct main structure and not NULL |
Definition at line 447 of file find_replace_window.c.
References fr_window_close().
Referenced by fr_window_connect_signal().
|
static |
Fills the type ComboBox with the right values.
widget | : the combobox that issued the changed signal |
data | : must be heraia_struct_t *main_struct |
< stores row structure (boxes, labels, entries and functions)
< stores description for one tab
< represents the combo boxes (category, type and feature combo boxes)
< active index of the category combo box
< used to retrieve labels from the GtkLabel widgets
< contains text from the labels
< the models from the combo box (used to delete everything in the combo boxes
Definition at line 936 of file find_replace_window.c.
References fdft_t::category_cb, tab_t::col_labels, heraia_struct_t::current_DW, heraia_struct_t::fdft, fdft_t::feature_cb, decode_generic_t::label, tab_t::nb_cols, tab_t::nb_rows, tab_t::rows, data_window_t::tabs, and fdft_t::type_cb.
Referenced by fdft_window_init_widgets().
|
static |
Searches data from the selected type (if any) in the current document (if any) and returns the results in the result window.
widget | : Calling widget (Is used to determine the direction of the search) |
data | : MUST be heraia_struct_t *main_struct main structure and not NULL |
< index for the selected category in the combo box
< index for the selected type in the combo box
< index for the selected feature in the combo box
< represents the combo boxes (category, type and feature combo boxes)
< The structure that contains the function we need
< contains what the user enterer in the search window
Definition at line 846 of file find_replace_window.c.
References fdft_t::category_cb, heraia_struct_t::current_doc, heraia_struct_t::current_DW, heraia_struct_t::fdft, fdft_search_direction(), fdft_t::feature_cb, get_decode_struct(), HERAIA_FIND_ALL, HERAIA_FIND_BACKWARD, HERAIA_FIND_FORWARD, heraia_get_widget(), log_message(), xml_t::main, fdft_t::type_cb, and heraia_struct_t::xmls.
Referenced by fdft_window_connect_signal().
|
static |
Searches the string entered in the search document in the current one (from the currenty position + offset) in the main window.
main_struct | : heraia's main structure |
dircetion | : says wether we should go forward or backward |
decode_struct | : the decoding structure |
data_size | : the size of the data to be send to the decode function |
buffer | : Buffer that contains the string to look for |
< Current doc where we want to search for the string
< All positions of the searched string
Endianness is computed only once here
stream size is computed only once here
Definition at line 780 of file find_replace_window.c.
References heraia_struct_t::current_doc, decode_t::func, ghex_find_decode(), ghex_get_cursor_position(), ghex_set_cursor_position(), HERAIA_FIND_ALL, HERAIA_FIND_BACKWARD, HERAIA_FIND_FORWARD, doc_t::hex_widget, log_message(), new_decode_parameters_t(), rw_add_one_tab_from_find_all_bt(), which_endianness(), and which_stream_size().
Referenced by fdft_prev_next_bt_clicked().
|
static |
Close button has been clicked we want to hide the window.
widget | : calling widget (may be NULL as we don't use this here) |
data | : MUST be heraia_struct_t *main_struct main structure and not NULL |
< find window
Definition at line 714 of file find_replace_window.c.
References all_window_prop_t::fdft_window, heraia_get_widget(), xml_t::main, show_hide_widget(), heraia_struct_t::win_prop, and heraia_struct_t::xmls.
Referenced by delete_fdft_window_event(), destroy_fdft_window_event(), and fdft_window_connect_signal().
|
static |
Signal connections for the find data from type window.
main_struct | : heraia's main structure |
Definition at line 904 of file find_replace_window.c.
References delete_fdft_window_event(), destroy_fdft_window_event(), fdft_prev_next_bt_clicked(), fdft_window_close(), heraia_get_widget(), xml_t::main, and heraia_struct_t::xmls.
Referenced by fdft_window_init_interface().
void fdft_window_init_interface | ( | heraia_struct_t * | main_struct | ) |
Inits all the things in the find data from type window (signal and such)
main_struct | : heraia's main structure |
Definition at line 1070 of file find_replace_window.c.
References heraia_struct_t::fdft, fdft_window_connect_signal(), fdft_window_init_widgets(), fdft_window_populate_category_cb(), xml_t::main, and heraia_struct_t::xmls.
Referenced by load_heraia_ui().
|
static |
Inits the fdft structure and adds the widgets to the window.
main_struct | : heraia's main structure |
Definition at line 1014 of file find_replace_window.c.
References fdft_t::category_cb, heraia_struct_t::fdft, fdft_category_cb_changed(), fdft_t::feature_cb, heraia_get_widget(), xml_t::main, fdft_t::type_cb, and heraia_struct_t::xmls.
Referenced by fdft_window_init_interface().
|
static |
< category's combobox
Definition at line 631 of file find_replace_window.c.
References fdft_t::category_cb, heraia_struct_t::current_DW, heraia_struct_t::fdft, tab_t::label, data_window_t::nb_tabs, and data_window_t::tabs.
Referenced by fdft_window_init_interface().
void fdft_window_show | ( | GtkWidget * | widget, |
gpointer | data | ||
) |
Show find data from type window.
widget | : the widget that issued the signal |
data | : user data MUST be heraia_struct_t *main_struct main structure |
< find data from type window
Definition at line 670 of file find_replace_window.c.
References heraia_struct_t::current_doc, all_window_prop_t::fdft_window, heraia_get_widget(), xml_t::main, show_hide_widget(), heraia_struct_t::win_prop, and heraia_struct_t::xmls.
Referenced by on_fdft_activate().
|
static |
Tries to find, in the document, what the user entered in the GtkHex entry in the find window (all positions from 0)
widget | : calling widget (may be NULL as we don't use this here) |
data | : MUST be heraia_struct_t *main_struct main structure and not NULL |
< Buffer that contains the search string
< Current doc where we want to search for the string
< All positions of the searched string
Definition at line 186 of file find_replace_window.c.
References heraia_struct_t::current_doc, heraia_struct_t::find_doc, fr_get_search_string(), ghex_find_forward(), and rw_add_one_tab_from_find_all_bt().
Referenced by find_window_connect_signal().
|
static |
Tries to find, in the document, what the user entered in the GtkHex entry in the find window (forward from the current position)
widget | : calling widget (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 135 of file find_replace_window.c.
References heraia_struct_t::find_doc, and fr_search_forward().
Referenced by find_window_connect_signal().
|
static |
Tries to find, in the document, what the user entered in the GtkHex entry in the find window (backward from the current position)
widget | : calling widget (may be NULL as we don't use this here) |
data | : MUST be heraia_struct_t *main_struct main structure and not NULL |
< Buffer that contains the search string
< Current doc where we want to search for the string
Definition at line 152 of file find_replace_window.c.
References heraia_struct_t::current_doc, heraia_struct_t::find_doc, fr_get_search_string(), ghex_find_backward(), ghex_get_cursor_position(), ghex_set_cursor_position(), and doc_t::hex_widget.
Referenced by find_window_connect_signal().
|
static |
Adds the GtkHex widget to the right frame.
xmls | : xmls structure |
widget_name | : the widget that will receive the GtkHex widget (a frame) |
entry | : the doc_t structure that contains document and gtkhex widget used as an entry field |
Definition at line 362 of file find_replace_window.c.
References heraia_get_widget(), doc_t::hex_widget, and xml_t::main.
Referenced by find_window_init_interface(), and fr_window_init_interface().
|
static |
Close button has been clicked we want to hide the window.
widget | : calling widget (may be NULL as we don't use this here) |
data | : MUST be heraia_struct_t *main_struct main structure and not NULL |
< find window
Definition at line 115 of file find_replace_window.c.
References all_window_prop_t::find_window, heraia_get_widget(), xml_t::main, show_hide_widget(), heraia_struct_t::win_prop, and heraia_struct_t::xmls.
Referenced by delete_find_window_event(), destroy_find_window_event(), and find_window_connect_signal().
|
static |
Signal connections for the find window.
main_struct | : heraia's main structure |
Definition at line 227 of file find_replace_window.c.
References delete_find_window_event(), destroy_find_window_event(), find_all_bt_clicked(), find_next_bt_clicked(), find_prev_bt_clicked(), find_window_close(), heraia_get_widget(), xml_t::main, and heraia_struct_t::xmls.
Referenced by find_window_init_interface().
void find_window_init_interface | ( | heraia_struct_t * | main_struct | ) |
Inits all the things in the find window (signal and such)
main_struct | : heraia's main structure |
Definition at line 258 of file find_replace_window.c.
References create_find_or_replace_doc_t(), heraia_struct_t::find_doc, find_replace_add_ghex_widget(), find_window_connect_signal(), xml_t::main, and heraia_struct_t::xmls.
Referenced by load_heraia_ui().
void find_window_show | ( | GtkWidget * | widget, |
gpointer | data | ||
) |
Show find window.
widget | : the widget that issued the signal |
data | : user data MUST be heraia_struct_t *main_struct main structure |
< find window
Definition at line 71 of file find_replace_window.c.
References heraia_struct_t::current_doc, all_window_prop_t::find_window, heraia_get_widget(), xml_t::main, show_hide_widget(), heraia_struct_t::win_prop, and heraia_struct_t::xmls.
Referenced by on_find_activate().
|
static |
Gets the string from the document doc.
main_struct | : main structure, needed here to compute endianness |
doc | : the document (HexDocument and HexWidget) used to defined the search string |
< size of the search string (we hope that this value is small)
< buffer for the search string
< endianness as selected in data interpretor's window
Definition at line 287 of file find_replace_window.c.
References ghex_file_size(), ghex_get_data_position(), doc_t::hex_widget, and which_endianness().
Referenced by find_all_bt_clicked(), find_prev_bt_clicked(), fr_replace_data(), and fr_search_forward().
|
static |
widget | : calling widget (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 587 of file find_replace_window.c.
References fr_replace_data().
Referenced by fr_window_connect_signal().
|
static |
Tries to replace, in the document, what the user entered in the GtkHex entry in the fr window in the find hexwidget by what the user entered in the replace entry in that same window.
main_struct | : main structure |
< Buffer that contains the search string
< Buffer that contains the replace string
< Current doc where we want to search for the string
< Size of the searched string
< Size of the replace string
< Current position in the current document !
< length of the result of that replace
Definition at line 548 of file find_replace_window.c.
References heraia_struct_t::current_doc, heraia_struct_t::fr_find_doc, fr_get_search_string(), heraia_struct_t::fr_replace_doc, ghex_compare_data(), ghex_get_cursor_position(), ghex_set_data(), and doc_t::hex_widget.
Referenced by fr_replace_bt_clicked(), and fr_replace_search_bt_clicked().
|
static |
Tries to replace, in the document, what the user entered in the GtkHex entry in the fr window in the find hexwidget by what the user entered in the replace entry in that same window and then goes to the next position (if any)
widget | : calling widget (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 526 of file find_replace_window.c.
References heraia_struct_t::fr_find_doc, fr_replace_data(), and fr_search_forward().
Referenced by fr_window_connect_signal().
|
static |
Tries to find, in the document, what the user entered in the GtkHex entry in the fr window in the find hexwidget (forward from the current position)
widget | : calling widget (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 508 of file find_replace_window.c.
References heraia_struct_t::fr_find_doc, and fr_search_forward().
Referenced by fr_window_connect_signal().
|
static |
Searches the string entered in the search document in the current one (from the currenty position + offset) in the main window.
main_struct | : heraia's main structure |
search_doc | : the document used to enter the searched string |
offset | : the offset from the current position to begin the search. |
< Buffer that contains the search string
< Current doc where we want to search for the string
Definition at line 379 of file find_replace_window.c.
References heraia_struct_t::current_doc, fr_get_search_string(), ghex_find_forward(), ghex_get_cursor_position(), ghex_set_cursor_position(), and doc_t::hex_widget.
Referenced by find_next_bt_clicked(), fr_replace_search_bt_clicked(), and fr_search_bt_clicked().
|
static |
Close button has been clicked we want to hide the window.
widget | : calling widget (may be NULL as we don't use this here) |
data | : MUST be heraia_struct_t *main_struct main structure and not NULL |
< find window
Definition at line 458 of file find_replace_window.c.
References all_window_prop_t::fr_window, heraia_get_widget(), xml_t::main, show_hide_widget(), heraia_struct_t::win_prop, and heraia_struct_t::xmls.
Referenced by delete_fr_window_event(), destroy_fr_window_event(), and fr_window_connect_signal().
|
static |
Signal connections for the find and replace window.
main_struct | : heraia's main structure |
Definition at line 475 of file find_replace_window.c.
References delete_fr_window_event(), destroy_fr_window_event(), fr_replace_bt_clicked(), fr_replace_search_bt_clicked(), fr_search_bt_clicked(), fr_window_close(), heraia_get_widget(), xml_t::main, and heraia_struct_t::xmls.
Referenced by fr_window_init_interface().
void fr_window_init_interface | ( | heraia_struct_t * | main_struct | ) |
Inits all the things in the find and replace window (signal and such)
main_struct | : heraia's main structure |
Definition at line 600 of file find_replace_window.c.
References create_find_or_replace_doc_t(), find_replace_add_ghex_widget(), heraia_struct_t::fr_find_doc, heraia_struct_t::fr_replace_doc, fr_window_connect_signal(), xml_t::main, and heraia_struct_t::xmls.
Referenced by load_heraia_ui().
void fr_window_show | ( | GtkWidget * | widget, |
gpointer | data | ||
) |
Show find and replace window.
widget | : the widget that issued the signal |
data | : user data MUST be heraia_struct_t *main_struct main structure |
< find window
Definition at line 414 of file find_replace_window.c.
References heraia_struct_t::current_doc, all_window_prop_t::fr_window, heraia_get_widget(), xml_t::main, show_hide_widget(), heraia_struct_t::win_prop, and heraia_struct_t::xmls.
Referenced by on_fr_activate().
|
static |
return the decode structure that corresponds to the indexes from category, type and feature as stated in the parameters
main_struct | : heraia's main structure | |
cat_index | : category index (tab's number in the data interpertor's window | |
typ_index | : type index (the row number in the category's tab) | |
fea_index | : feature index (column number in the row of the tab of the data interpretor's window | |
[out] | data_size | : size of the data to be filled to the decoding function |
< stores row structure (boxes, labels, entries and functions)
< stores description for one tab
Definition at line 738 of file find_replace_window.c.
References heraia_struct_t::current_DW, decode_generic_t::data_size, decode_generic_t::decode_array, tab_t::rows, and data_window_t::tabs.
Referenced by fdft_prev_next_bt_clicked().