find_replace_window.c File Reference

Windows used to find text and find and replace text in the opened hex documents. More...

#include <libheraia.h>
Include dependency graph for find_replace_window.c:

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_tcreate_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).

Detailed Description

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.


Function Documentation

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.

Returns:
a newly allocated doc_t structure with HexDocument and GtkHex widget correctly configured to fit in the find and find and replace windows

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().

Here is the call graph for this function:

Here is the caller graph for this function:

static gboolean delete_find_window_event ( GtkWidget *  widget,
GdkEvent *  event,
gpointer  data 
) [static]

Call back function for the find window destruction.

Parameters:
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().

Here is the call graph for this function:

Here is the caller graph for this function:

static gboolean delete_fr_window_event ( GtkWidget *  widget,
GdkEvent *  event,
gpointer  data 
) [static]

Call back function for the find and replace window destruction.

Parameters:
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().

Here is the call graph for this function:

Here is the caller graph for this function:

static void destroy_find_window_event ( GtkWidget *  widget,
GdkEvent *  event,
gpointer  data 
) [static]

Call back function for the find window destruction.

Parameters:
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().

Here is the call graph for this function:

Here is the caller graph for this function:

static void destroy_fr_window_event ( GtkWidget *  widget,
GdkEvent *  event,
gpointer  data 
) [static]

Call back function for the find and replace window destruction.

Parameters:
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().

Here is the call graph for this function:

Here is the caller graph for this function:

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).

Parameters:
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().

Here is the call graph for this function:

Here is the caller graph for this function:

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).

Parameters:
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().

Here is the call graph for this function:

Here is the caller graph for this function:

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).

Parameters:
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().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
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().

Here is the call graph for this function:

Here is the caller graph for this function:

static void find_window_close ( GtkWidget *  widget,
gpointer  data 
) [static]

Close button has been clicked we want to hide the window.

Parameters:
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().

Here is the call graph for this function:

Here is the caller graph for this function:

static void find_window_connect_signal ( heraia_struct_t main_struct  )  [static]

Signal connections for the find window.

Parameters:
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().

Here is the call graph for this function:

Here is the caller graph for this function:

void find_window_init_interface ( heraia_struct_t main_struct  ) 

Inits all the things in the find window (signal and such).

Parameters:
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().

Here is the call graph for this function:

Here is the caller graph for this function:

void find_window_show ( GtkWidget *  widget,
gpointer  data 
)

Show find window.

Parameters:
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().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
main_struct : main structure, needed here to compute endianness
doc : the document (HexDocument and HexWidget) used to defined the search string
Returns:
a newly allocated guchar string that may be g_free'ed when no longer needed

< 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().

Here is the call graph for this function:

Here is the caller graph for this function:

static void fr_replace_bt_clicked ( GtkWidget *  widget,
gpointer  data 
) [static]
Parameters:
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().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
main_struct : main structure
Returns:
a goffset that indicates the length difference between the length of the replaced data and the length of the inserted data

< 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().

Here is the call graph for this function:

Here is the caller graph for this function:

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).

Parameters:
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().

Here is the call graph for this function:

Here is the caller graph for this function:

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).

Parameters:
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().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
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().

Here is the call graph for this function:

Here is the caller graph for this function:

static void fr_window_close ( GtkWidget *  widget,
gpointer  data 
) [static]

Close button has been clicked we want to hide the window.

Parameters:
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().

Here is the call graph for this function:

Here is the caller graph for this function:

static void fr_window_connect_signal ( heraia_struct_t main_struct  )  [static]

Signal connections for the find and replace window.

Parameters:
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().

Here is the call graph for this function:

Here is the caller graph for this function:

void fr_window_init_interface ( heraia_struct_t main_struct  ) 

Inits all the things in the find and replace window (signal and such).

Parameters:
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().

Here is the call graph for this function:

Here is the caller graph for this function:

void fr_window_show ( GtkWidget *  widget,
gpointer  data 
)

Show find and replace window.

Parameters:
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().

Here is the call graph for this function:

Here is the caller graph for this function:

Generated on Sat Oct 30 18:32:05 2010 for Heraia by  doxygen 1.6.3