NetSurf
Macros | Typedefs | Functions
misc.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SBUF8_TO_LBUF8(sbuf, lbuf)
 
#define RECT_TO_GRECT(r, g)
 
#define BY_WINDOM_HANDLE   0x0
 
#define BY_GEM_HANDLE   0x1
 

Typedefs

typedef int(* scan_process_callback) (int pid, void *data)
 

Functions

struct gui_windowfind_guiwin_by_aes_handle (short handle)
 
bool is_process_running (const char *name)
 
void gem_set_cursor (MFORM_EX *cursor)
 
void dbg_grect (const char *str, GRECT *r)
 
void dbg_pxy (const char *str, short *pxy)
 
void dbg_rect (const char *str, int *pxy)
 
const char * file_select (const char *title, const char *name)
 Show default file selector. More...
 
long nkc_to_input_key (short nkc, long *ucs4_out)
 Convert NKC to netsurf input key code and/or to ucs4 (depends on keycode). More...
 
void die (const char *const error) __attribute__((noreturn))
 Cause an abnormal program termination. More...
 
nserror atari_warn_user (const char *warning, const char *detail)
 Warn the user of an event. More...
 

Macro Definition Documentation

◆ BY_GEM_HANDLE

#define BY_GEM_HANDLE   0x1

Definition at line 45 of file misc.h.

◆ BY_WINDOM_HANDLE

#define BY_WINDOM_HANDLE   0x0

Definition at line 44 of file misc.h.

◆ RECT_TO_GRECT

#define RECT_TO_GRECT (   r,
 
)
Value:
do { \
(g)->g_x = (r->x0 < r->x1) ? r->x0 : r->x1 ; \
(g)->g_y = (r->y0 < r->y1) ? r->y0 : r->y1 ; \
(g)->g_w = (r->x0 < r->x1) ? r->x1 - r->x0 : r->x0 - r->x1 ; \
(g)->g_h = (r->y0 < r->y1) ? r->y1 - r->y0 : r->y0 - r->y1 ; \
} while(0)

Definition at line 33 of file misc.h.

◆ SBUF8_TO_LBUF8

#define SBUF8_TO_LBUF8 (   sbuf,
  lbuf 
)
Value:
lbuf[0] = (long)sbuf[0];\
lbuf[1] = (long)sbuf[1];\
lbuf[2] = (long)sbuf[2];\
lbuf[3] = (long)sbuf[3];\
lbuf[4] = (long)sbuf[4];\
lbuf[5] = (long)sbuf[5];\
lbuf[6] = (long)sbuf[6];\
lbuf[7] = (long)sbuf[7];

Definition at line 23 of file misc.h.

Typedef Documentation

◆ scan_process_callback

typedef int(* scan_process_callback) (int pid, void *data)

Definition at line 49 of file misc.h.

Function Documentation

◆ atari_warn_user()

nserror atari_warn_user ( const char *  warning,
const char *  detail 
)

Warn the user of an event.

Parameters
[in]warningA warning looked up in the message translation table
[in]detailAdditional text to be displayed or NULL.
Returns
NSERROR_OK on success or error code if there was a faliure displaying the message to the user.

Definition at line 56 of file misc.c.

References messages_get(), and NSERROR_OK.

Referenced by atari_about_show(), atari_treeview_create(), context_popup(), gui_download_window_create(), main(), menu_new_win(), menu_open_file(), read_locales(), toolbar_home_click(), and toolbar_key_input().

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

◆ dbg_grect()

void dbg_grect ( const char *  str,
GRECT *  r 
)

Definition at line 388 of file misc.c.

◆ dbg_pxy()

void dbg_pxy ( const char *  str,
short *  pxy 
)

Definition at line 394 of file misc.c.

◆ dbg_rect()

void dbg_rect ( const char *  str,
int *  pxy 
)

Definition at line 400 of file misc.c.

◆ die()

void die ( const char *const  error)

Cause an abnormal program termination.

Note
This never returns and is intended to terminate without any cleanup.
Parameters
errorThe message to display to the user.

Cause an abnormal program termination.

Should only be used during initialisation.

Definition at line 69 of file misc.c.

◆ file_select()

const char * file_select ( const char *  title,
const char *  name 
)

Show default file selector.

Parameters
titleThe selector title.
nameDefault file name
Returns
a static char pointer or null if the user aborted the selection.

Definition at line 363 of file misc.c.

References path(), and PATH_MAX.

Referenced by handle_filesystem_select_button(), menu_open_file(), and menu_save_page().

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

◆ find_guiwin_by_aes_handle()

struct gui_window * find_guiwin_by_aes_handle ( short  handle)

Definition at line 77 of file misc.c.

References gui_window::next, gui_window::root, s_gui_win_root::win, and window_list.

◆ gem_set_cursor()

void gem_set_cursor ( MFORM_EX cursor)

Definition at line 196 of file misc.c.

References mform_ex_s::flags, MFORM_EX_FLAG_USERFORM, mform_ex_s::number, and mform_ex_s::tree.

Referenced by gui_init(), gui_window_set_pointer(), handle_event(), and on_mbutton_event().

Here is the caller graph for this function:

◆ is_process_running()

bool is_process_running ( const char *  name)

Definition at line 186 of file misc.c.

References is_process_running_callback_data::found, proc_running_callback(), and scan_process_list().

Here is the call graph for this function:

◆ nkc_to_input_key()

long nkc_to_input_key ( short  nkc,
long *  ucs4_out 
)

Convert NKC to netsurf input key code and/or to ucs4 (depends on keycode).

Parameters
[in]nkcatari normalized key code
[out]ucs4_outThe ucs4 converted keycode
Returns
The netsurf input keycode or 0 and ucs4_out updated with the NKC converted to UC4 encoding.

Definition at line 213 of file misc.c.

References atari_to_ucs4(), NS_KEY_COPY_SELECTION, NS_KEY_CR, NS_KEY_CUT_SELECTION, NS_KEY_DELETE_LEFT, NS_KEY_DELETE_RIGHT, NS_KEY_DOWN, NS_KEY_ESCAPE, NS_KEY_LEFT, NS_KEY_LINE_END, NS_KEY_LINE_START, NS_KEY_NL, NS_KEY_PAGE_DOWN, NS_KEY_PAGE_UP, NS_KEY_PASTE, NS_KEY_RIGHT, NS_KEY_SELECT_ALL, NS_KEY_SHIFT_TAB, NS_KEY_TAB, NS_KEY_TEXT_START, NS_KEY_UNDO, and NS_KEY_UP.

Referenced by on_content_keypress(), on_keybd_event(), and toolbar_key_input().

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