45 GtkWidget *dialog = NULL;
47 if (main_struct != NULL && main_struct->
current_doc != NULL)
61 if (main_struct != NULL && main_struct->
xmls != NULL && main_struct->
xmls->
main != NULL)
102 GtkWidget *dialog = NULL;
104 if (main_struct != NULL)
120 GtkWidget *radio_button = NULL;
121 GtkWidget *radio_active = NULL;
122 const gchar *widget_name = NULL;
123 const gchar *entry_text = NULL;
125 gboolean convert_ok = FALSE;
130 if (radio_button != NULL && main_struct->
current_doc != NULL)
134 if (entry_text[0] ==
'0' && entry_text[1] ==
'x')
136 convert_ok = (sscanf(entry_text,
"%llx", (
long long unsigned int *) &offset) == 1);
140 convert_ok = (sscanf(entry_text,
"%llu", (
long long unsigned int *) &offset) == 1);
143 if (convert_ok == TRUE)
148 if (radio_active != NULL)
150 widget_name = gtk_buildable_get_name(GTK_BUILDABLE(radio_active));
154 if (widget_name != NULL)
156 if (g_ascii_strcasecmp(widget_name,
"goto_from_beginning") == 0)
160 else if (g_ascii_strcasecmp(widget_name,
"goto_from_here_fwd") == 0)
165 else if (g_ascii_strcasecmp(widget_name,
"goto_from_here_rwd") == 0)
This is the main structure.
static void goto_dialog_ok(GtkWidget *widget, gpointer data)
Ok button has been clicked we want to go to the byte number from the entry.
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.
all_window_prop_t * win_prop
Keeps window properties.
guint64 ghex_file_size(Heraia_Hex *gh)
Returns the file size of an opened Heraia_Hex document.
static void destroy_goto_dialog_event(GtkWidget *widget, GdkEvent *event, gpointer data)
Call back function for the goto dialog window destruction.
xml_t * xmls
All the xmls used in the program, loaded at running time.
static void goto_dialog_canceled(GtkWidget *widget, gpointer data)
Closing the window effectively.
static void goto_dialog_connect_signal(heraia_struct_t *main_struct)
Signal connections for the goto dialog window.
void goto_dialog_init_interface(heraia_struct_t *main_struct)
Inits all the things in the goto dialog window (signal and such)
GtkWidget * hex_widget
hexwidget corresponding to the document
GtkBuilder * main
the main interface xml description
guint64 ghex_get_cursor_position(GtkWidget *hex_widget)
Retrieves the cursor's position from the current hexwidget.
This file contains all the definitions and includes all other .h files.
void ghex_set_cursor_position(GtkWidget *hex_widget, guint64 position)
Sets the cursor at the defined position in the hexwidget.
void on_goto_activate(GtkWidget *widget, gpointer data)
Go to..., edit menu.
static gboolean delete_goto_dialog_event(GtkWidget *widget, GdkEvent *event, gpointer data)
Call back function for the goto dialog window destruction.
doc_t * current_doc
This is a pointer to the current edited document.
GtkWidget * heraia_get_widget(GtkBuilder *xml, gchar *widget_name)
This is a wrapper to the GtkBuilder xml get widget.
window_prop_t * goto_window
goto dialog window
GtkWidget * gtk_radio_button_get_active_from_widget(GtkRadioButton *radio_button)
gets the active radio button from a radio group