62 gtk_widget_set_sensitive(GTK_WIDGET(search->
forward), active);
74 gtk_widget_set_sensitive(GTK_WIDGET(search->
back), active);
91 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(search->
caseSens))) {
95 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(search->
checkAll))) {
100 gtk_entry_get_text(search->
entry));
118 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(search->
caseSens))) {
122 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(search->
checkAll))) {
127 gtk_entry_get_text(search->
entry));
160 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(search->
caseSens))) {
164 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(search->
checkAll))) {
169 gtk_entry_get_text(search->
entry));
186 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(search->
caseSens))) {
190 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(search->
checkAll))) {
195 gtk_entry_get_text(search->
entry));
206 if (event->keyval ==
GDK_KEY(Escape)) {
231 g_object_get(G_OBJECT(search->
bar),
"visible", &vis, NULL);
233 gtk_widget_hide(GTK_WIDGET(search->
bar));
235 gtk_widget_show(GTK_WIDGET(search->
bar));
236 gtk_widget_grab_focus(GTK_WIDGET(search->
entry));
250 gtk_toolbar_set_style(GTK_TOOLBAR(search->
bar),
252 gtk_toolbar_set_icon_size(GTK_TOOLBAR(search->
bar),
253 GTK_ICON_SIZE_SMALL_TOOLBAR);
257 gtk_toolbar_set_style(GTK_TOOLBAR(search->
bar),
259 gtk_toolbar_set_icon_size(GTK_TOOLBAR(search->
bar),
260 GTK_ICON_SIZE_LARGE_TOOLBAR);
264 gtk_toolbar_set_style(GTK_TOOLBAR(search->
bar),
266 gtk_toolbar_set_icon_size(GTK_TOOLBAR(search->
bar),
267 GTK_ICON_SIZE_LARGE_TOOLBAR);
271 gtk_toolbar_set_style(GTK_TOOLBAR(search->
bar),
291 if (search == NULL) {
297 search->
bar = GTK_TOOLBAR(gtk_builder_get_object(builder,
"findbar"));
298 search->
entry = GTK_ENTRY(gtk_builder_get_object(builder,
"Find"));
299 search->
back = GTK_TOOL_BUTTON(gtk_builder_get_object(builder,
301 search->
forward = GTK_TOOL_BUTTON(gtk_builder_get_object(builder,
303 search->
close = GTK_TOOL_BUTTON(gtk_builder_get_object(builder,
305 search->
checkAll = GTK_CHECK_BUTTON(gtk_builder_get_object(builder,
306 "FindHighlightAll"));
307 search->
caseSens = GTK_CHECK_BUTTON(gtk_builder_get_object(builder,
310 g_signal_connect(search->
forward,
315 g_signal_connect(search->
back,
320 g_signal_connect(search->
entry,
325 g_signal_connect(search->
entry,
330 g_signal_connect(search->
entry,
335 g_signal_connect(search->
close,
353 *search_out = search;
Compatibility functions for older GTK versions (interface)
void browser_window_search(struct browser_window *bw, void *context, search_flags_t flags, const char *string)
Starts or continues an existing search.
void browser_window_search_clear(struct browser_window *bw)
Clear up a search.
Browseing window text search interface.
@ SEARCH_FLAG_CASE_SENSITIVE
nserror
Enumeration of error codes.
@ NSERROR_NOMEM
Memory exhaustion.
nserror nsgtk_search_create(GtkBuilder *builder, struct browser_window *bw, struct gtk_search **search_out)
create text search context
static gboolean nsgtk_search_back_button_clicked(GtkWidget *widget, gpointer data)
connected to the search back button
struct gui_search_table * nsgtk_search_table
static gboolean nsgtk_search_forward_button_clicked(GtkWidget *widget, gpointer data)
connected to the search forward button
nserror nsgtk_search_restyle(struct gtk_search *search)
update search toolbar size and style
nserror nsgtk_search_toggle_visibility(struct gtk_search *search)
toggle search bar visibility
static void nsgtk_search_set_back_state(bool active, struct gtk_search *search)
activate search back button in gui.
static gboolean nsgtk_search_close_button_clicked(GtkWidget *widget, gpointer data)
connected to the search close button
static gboolean nsgtk_search_entry_key(GtkWidget *widget, GdkEventKey *event, gpointer data)
allows escape key to close search bar too
static gboolean nsgtk_search_entry_activate(GtkWidget *widget, gpointer data)
connected to the search entry [return key]
static struct gui_search_table search_table
static void nsgtk_search_set_forward_state(bool active, struct gtk_search *search)
activate search forwards button in gui.
static gboolean nsgtk_search_entry_changed(GtkWidget *widget, gpointer data)
connected to the search entry [typing]
free text page search for gtk interface
Interface to platform-specific search operations.
GtkCheckButton * checkAll
struct browser_window * bw
GtkCheckButton * caseSens
function table for page text search.
void(* back_state)(bool active, void *p)
activate search back button in gui
void(* forward_state)(bool active, void *p)
activate search forwards button in gui
Option reading and saving interface.
#define nsoption_int(OPTION)
Get the value of an integer option.