NetSurf
Functions | Variables
search.c File Reference
#include <limits.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <stdbool.h>
#include <assert.h>
#include "utils/log.h"
#include "utils/messages.h"
#include "netsurf/browser_window.h"
#include "desktop/search.h"
#include "netsurf/search.h"
#include "atari/gui.h"
#include "atari/rootwin.h"
#include "atari/misc.h"
#include "atari/toolbar.h"
#include "atari/search.h"
#include "atari/gemtk/gemtk.h"
#include "atari/res/netsurf.rsh"
Include dependency graph for search.c:

Go to the source code of this file.

Functions

static void nsatari_search_set_status (bool found, void *p)
 Change the displayed search status. More...
 
static void nsatari_search_set_hourglass (bool active, void *p)
 display hourglass while searching More...
 
static void nsatari_search_add_recent (const char *string, void *p)
 add search string to recent searches list front is at liberty how to implement the bare notification should normally store a strdup() of the string; core gives no guarantee of the integrity of the const char * More...
 
void nsatari_search_set_forward_state (bool active, void *p)
 activate search forwards button in gui More...
 
void nsatari_search_set_back_state (bool active, void *p)
 activate search back button in gui More...
 
static int apply_form (OBJECT *obj, struct s_search_form_state *s)
 
static void set_text (OBJECT *obj, short idx, char *text, int len)
 
void nsatari_search_restore_form (struct s_search_form_session *s, OBJECT *obj)
 
void nsatari_search_session_destroy (struct s_search_form_session *s)
 
static bool search_session_compare (struct s_search_form_session *s, OBJECT *obj)
 checks for search parameters changes More...
 
void nsatari_search_perform (struct s_search_form_session *s, OBJECT *obj, search_flags_t f)
 
struct s_search_form_sessionnsatari_search_session_create (OBJECT *obj, struct gui_window *gw)
 

Variables

struct gui_windowinput_window
 
static struct gui_search_table search_table
 
struct gui_search_tableatari_search_table = &search_table
 

Function Documentation

◆ apply_form()

static int apply_form ( OBJECT *  obj,
struct s_search_form_state s 
)
static

Definition at line 161 of file search.c.

References s_search_form_state::flags, SEARCH_FLAG_CASE_SENSITIVE, SEARCH_FLAG_SHOWALL, and s_search_form_state::text.

Referenced by nsatari_search_perform(), nsatari_search_session_create(), and search_session_compare().

Here is the caller graph for this function:

◆ nsatari_search_add_recent()

void nsatari_search_add_recent ( const char *  string,
void *  p 
)
static

add search string to recent searches list front is at liberty how to implement the bare notification should normally store a strdup() of the string; core gives no guarantee of the integrity of the const char *

Parameters
stringsearch pattern
pthe pointer sent to search_verify_new() / search_create_context()

Definition at line 100 of file search.c.

References NSLOG.

◆ nsatari_search_perform()

void nsatari_search_perform ( struct s_search_form_session s,
OBJECT *  obj,
search_flags_t  f 
)

Definition at line 262 of file search.c.

References apply_form(), gui_window::browser, browser_window_search(), browser_window_search_clear(), s_browser::bw, s_search_form_state::flags, s_search_form_session::g, input_window, SEARCH_FLAG_FORWARDS, search_session_compare(), and s_search_form_session::state.

Referenced by toolbar_mouse_input().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nsatari_search_restore_form()

void nsatari_search_restore_form ( struct s_search_form_session s,
OBJECT *  obj 
)

Definition at line 199 of file search.c.

References s_search_form_state::back_avail, s_search_form_state::flags, SEARCH_FLAG_CASE_SENSITIVE, SEARCH_FLAG_SHOWALL, set_text(), s_search_form_session::state, and s_search_form_state::text.

Here is the call graph for this function:

◆ nsatari_search_session_create()

struct s_search_form_session * nsatari_search_session_create ( OBJECT *  obj,
struct gui_window gw 
)

Definition at line 286 of file search.c.

References apply_form(), gui_window::browser, browser_window_search_clear(), s_browser::bw, s_search_form_session::g, and s_search_form_session::state.

Referenced by window_open_search().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nsatari_search_session_destroy()

void nsatari_search_session_destroy ( struct s_search_form_session s)

Definition at line 224 of file search.c.

References gui_window::browser, browser_window_search_clear(), s_browser::bw, s_search_form_session::g, and NSLOG.

Referenced by gui_window_destroy(), and window_close_search().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nsatari_search_set_back_state()

void nsatari_search_set_back_state ( bool  active,
void *  p 
)

activate search back button in gui

Parameters
activeactivate/inactivate
pthe pointer sent to search_verify_new() / search_create_context()

Definition at line 138 of file search.c.

References gui_window::active, s_search_form_state::back_avail, BROWSER_AREA_SEARCH, s_search_form_session::g, NSLOG, gui_window::root, s_search_form_session::state, s_gui_win_root::toolbar, gui_window::toolbar, toolbar_get_form(), window_get_grect(), and window_schedule_redraw_grect().

Here is the call graph for this function:

◆ nsatari_search_set_forward_state()

void nsatari_search_set_forward_state ( bool  active,
void *  p 
)

activate search forwards button in gui

Parameters
activeactivate/inactivate
pthe pointer sent to search_verify_new() / search_create_context()

Definition at line 111 of file search.c.

References gui_window::active, BROWSER_AREA_SEARCH, s_search_form_session::g, NSLOG, gui_window::root, s_gui_win_root::toolbar, gui_window::toolbar, toolbar_get_form(), window_get_grect(), and window_schedule_redraw_grect().

Here is the call graph for this function:

◆ nsatari_search_set_hourglass()

void nsatari_search_set_hourglass ( bool  active,
void *  p 
)
static

display hourglass while searching

Parameters
activestart/stop indicator
pthe pointer sent to search_verify_new() / search_create_context()

Definition at line 80 of file search.c.

References s_search_form_session::g, GUI_POINTER_DEFAULT, GUI_POINTER_PROGRESS, gui_window_set_pointer(), and NSLOG.

Here is the call graph for this function:

◆ nsatari_search_set_status()

void nsatari_search_set_status ( bool  found,
void *  p 
)
static

Change the displayed search status.

Parameters
foundsearch pattern matched in text
pthe pointer sent to search_verify_new() / search_create_context()

Definition at line 68 of file search.c.

References NSLOG.

◆ search_session_compare()

static bool search_session_compare ( struct s_search_form_session s,
OBJECT *  obj 
)
static

checks for search parameters changes

Definition at line 235 of file search.c.

References apply_form(), s_search_form_state::flags, SEARCH_FLAG_CASE_SENSITIVE, SEARCH_FLAG_SHOWALL, s_search_form_session::state, and s_search_form_state::text.

Referenced by nsatari_search_perform().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_text()

static void set_text ( OBJECT *  obj,
short  idx,
char *  text,
int  len 
)
static

Definition at line 182 of file search.c.

References text().

Referenced by nsatari_search_restore_form().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ atari_search_table

struct gui_search_table* atari_search_table = &search_table

Definition at line 59 of file search.c.

Referenced by main().

◆ input_window

struct gui_window* input_window
extern

Definition at line 74 of file gui.c.

Referenced by nsatari_search_perform().

◆ search_table

struct gui_search_table search_table
static
Initial value:
= {
}
static void nsatari_search_set_hourglass(bool active, void *p)
display hourglass while searching
Definition: search.c:80
void nsatari_search_set_forward_state(bool active, void *p)
activate search forwards button in gui
Definition: search.c:111
static void nsatari_search_set_status(bool found, void *p)
Change the displayed search status.
Definition: search.c:68
void nsatari_search_set_back_state(bool active, void *p)
activate search back button in gui
Definition: search.c:138
static void nsatari_search_add_recent(const char *string, void *p)
add search string to recent searches list front is at liberty how to implement the bare notification ...
Definition: search.c:100

Definition at line 51 of file search.c.