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. | |
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. | |
static void | find_replace_add_ghex_widget (xml_t *xmls, gchar *widget_name, doc_t *entry) |
Adds the GtkHex widget to the right frame. | |
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. | |
static gboolean | delete_find_window_event (GtkWidget *widget, GdkEvent *event, gpointer data) |
Call back function for the find window destruction. | |
static void | destroy_find_window_event (GtkWidget *widget, GdkEvent *event, gpointer data) |
Call back function for the find window destruction. | |
static void | find_window_close (GtkWidget *widget, gpointer data) |
Close button has been clicked we want to hide the window. | |
static void | find_window_connect_signal (heraia_struct_t *main_struct) |
Signal connections for the find window. | |
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). | |
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). | |
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). | |
static gboolean | delete_fr_window_event (GtkWidget *widget, GdkEvent *event, gpointer data) |
Call back function for the find and replace window destruction. | |
static void | destroy_fr_window_event (GtkWidget *widget, GdkEvent *event, gpointer data) |
Call back function for the find and replace window destruction. | |
static void | fr_window_close (GtkWidget *widget, gpointer data) |
Close button has been clicked we want to hide the window. | |
static void | fr_window_connect_signal (heraia_struct_t *main_struct) |
Signal connections for the find and replace window. | |
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). | |
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). | |
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. | |
void | find_window_show (GtkWidget *widget, gpointer data) |
Show find window. | |
void | find_window_init_interface (heraia_struct_t *main_struct) |
Inits all the things in the find window (signal and such). | |
void | fr_window_show (GtkWidget *widget, gpointer data) |
Show find and replace window. | |
void | fr_window_init_interface (heraia_struct_t *main_struct) |
Inits all the things in the find and replace window (signal and such). |
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 doc_t * create_find_or_replace_doc_t | ( | void | ) | [static] |
Creates the HexDocument and the GtkHex widget with the right properties and Fills a doc_t structure with them.
Definition at line 321 of file find_replace_window.c.
References new_doc_t().
Referenced by find_window_init_interface(), and fr_window_init_interface().
static gboolean delete_find_window_event | ( | GtkWidget * | widget, | |
GdkEvent * | event, | |||
gpointer | data | |||
) | [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 83 of file find_replace_window.c.
References find_window_close().
Referenced by find_window_connect_signal().
static gboolean delete_fr_window_event | ( | GtkWidget * | widget, | |
GdkEvent * | event, | |||
gpointer | data | |||
) | [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 428 of file find_replace_window.c.
References fr_window_close().
Referenced by fr_window_connect_signal().
static void destroy_find_window_event | ( | GtkWidget * | widget, | |
GdkEvent * | event, | |||
gpointer | data | |||
) | [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 97 of file find_replace_window.c.
References find_window_close().
Referenced by find_window_connect_signal().
static void destroy_fr_window_event | ( | GtkWidget * | widget, | |
GdkEvent * | event, | |||
gpointer | data | |||
) | [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 442 of file find_replace_window.c.
References fr_window_close().
Referenced by fr_window_connect_signal().
static void find_all_bt_clicked | ( | GtkWidget * | widget, | |
gpointer | data | |||
) | [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 179 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 void find_next_bt_clicked | ( | GtkWidget * | widget, | |
gpointer | data | |||
) | [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 128 of file find_replace_window.c.
References heraia_struct_t::find_doc, and fr_search_forward().
Referenced by find_window_connect_signal().
static void find_prev_bt_clicked | ( | GtkWidget * | widget, | |
gpointer | data | |||
) | [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 145 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 void find_replace_add_ghex_widget | ( | xml_t * | xmls, | |
gchar * | widget_name, | |||
doc_t * | entry | |||
) | [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 355 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 void find_window_close | ( | GtkWidget * | widget, | |
gpointer | data | |||
) | [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 108 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 void find_window_connect_signal | ( | heraia_struct_t * | main_struct | ) | [static] |
Signal connections for the find window.
main_struct | : heraia's main structure |
Definition at line 220 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 251 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 64 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 guchar * fr_get_search_string | ( | heraia_struct_t * | main_struct, | |
doc_t * | doc, | |||
guint * | buffer_size | |||
) | [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 280 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 void fr_replace_bt_clicked | ( | GtkWidget * | widget, | |
gpointer | data | |||
) | [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 581 of file find_replace_window.c.
References fr_replace_data().
Referenced by fr_window_connect_signal().
static goffset fr_replace_data | ( | heraia_struct_t * | main_struct | ) | [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 542 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 void fr_replace_search_bt_clicked | ( | GtkWidget * | widget, | |
gpointer | data | |||
) | [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 521 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 void fr_search_bt_clicked | ( | GtkWidget * | widget, | |
gpointer | data | |||
) | [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 503 of file find_replace_window.c.
References heraia_struct_t::fr_find_doc, and fr_search_forward().
Referenced by fr_window_connect_signal().
static void fr_search_forward | ( | heraia_struct_t * | main_struct, | |
doc_t * | search_doc, | |||
goffset | offset | |||
) | [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 374 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 void fr_window_close | ( | GtkWidget * | widget, | |
gpointer | data | |||
) | [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 453 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 void fr_window_connect_signal | ( | heraia_struct_t * | main_struct | ) | [static] |
Signal connections for the find and replace window.
main_struct | : heraia's main structure |
Definition at line 470 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 594 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 409 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().