26#include <nsutils/time.h>
29#include <libnsfb_plot.h>
30#include <libnsfb_event.h>
61#define NSFB_TOOLBAR_DEFAULT_LAYOUT "blfsrutc"
107static void die(
const char *error)
109 fprintf(stderr,
"%s\n", error);
124 NSLOG(netsurf, INFO,
"%s %s", warning, detail);
154 int content_width, content_height;
157 NSLOG(netsurf, DEEPDEBUG,
"window scroll");
165 &content_width, &content_height);
177 if (bwidget->
pany == 0)
192 int content_width, content_height;
202 &content_width, &content_height);
214 if (bwidget->
panx == 0)
241 NSLOG(netsurf, DEEPDEBUG,
"panning %d, %d",
262 if (bwidget->
pany < 0) {
266 srcbox.x1 = srcbox.x0 +
width;
267 srcbox.y1 = srcbox.y0 +
height + bwidget->
pany;
270 dstbox.y0 = y - bwidget->
pany;
271 dstbox.x1 = dstbox.x0 +
width;
272 dstbox.y1 = dstbox.y0 +
height + bwidget->
pany;
275 nsfb_plot_copy(
nsfb, &srcbox,
nsfb, &dstbox);
281 }
else if (bwidget->
pany > 0) {
284 srcbox.y0 = y + bwidget->
pany;
285 srcbox.x1 = srcbox.x0 +
width;
286 srcbox.y1 = srcbox.y0 +
height - bwidget->
pany;
290 dstbox.x1 = dstbox.x0 +
width;
291 dstbox.y1 = dstbox.y0 +
height - bwidget->
pany;
294 nsfb_plot_copy(
nsfb, &srcbox,
nsfb, &dstbox);
302 if (bwidget->
panx < 0) {
306 srcbox.x1 = srcbox.x0 +
width + bwidget->
panx;
307 srcbox.y1 = srcbox.y0 +
height;
309 dstbox.x0 = x - bwidget->
panx;
311 dstbox.x1 = dstbox.x0 +
width + bwidget->
panx;
312 dstbox.y1 = dstbox.y0 +
height;
315 nsfb_plot_copy(
nsfb, &srcbox,
nsfb, &dstbox);
321 }
else if (bwidget->
panx > 0) {
323 srcbox.x0 = x + bwidget->
panx;
325 srcbox.x1 = srcbox.x0 +
width - bwidget->
panx;
326 srcbox.y1 = srcbox.y0 +
height;
330 dstbox.x1 = dstbox.x0 +
width - bwidget->
panx;
331 dstbox.y1 = dstbox.y0 +
height;
334 nsfb_plot_copy(
nsfb, &srcbox,
nsfb, &dstbox);
354 int caret_x, caret_y, caret_h;
358 .background_images =
true,
393 line.y1 = y - bwidget->
scrolly + caret_y + caret_h;
395 pen.stroke_type = NFSB_PLOT_OPTYPE_SOLID;
396 pen.stroke_width = 1;
397 pen.stroke_colour = 0xFF0000FF;
416 if (bwidget == NULL) {
418 "browser widget from widget %p was null", widget);
443 if (widget == NULL) {
449 free(browser_widget);
457 const char *arg0 = ctx;
459 fprintf(stderr,
"%s: %s\n", arg0, name);
462static enum nsfb_type_e
fetype = NSFB_SURFACE_COUNT;
482 static struct option long_options[] = {
486 NSLOG(netsurf, INFO,
"argc %d, argv %p", argc, argv);
505 feurl = NETSURF_HOMEPAGE;
508 while((opt = getopt_long(argc, argv,
"f:b:w:h:",
509 long_options, &option_index)) != -1) {
516 febpp = atoi(optarg);
529 "Usage: %s [-f frontend] [-b bpp] [-w width] [-h height] <url>\n",
536 feurl = argv[optind];
539 if (nsfb_type_from_name(
fename) == NSFB_SURFACE_NONE) {
540 if (strcmp(
fename,
"?") != 0) {
542 "%s: Unknown surface `%s`\n", argv[0],
fename);
544 fprintf(stderr,
"%s: Valid surface names are:\n", argv[0]);
561 static const struct {
564 } sys_colour_defaults[]= {
565 { NSOPTION_sys_colour_AccentColor, 0x00666666},
566 { NSOPTION_sys_colour_AccentColorText, 0x00ffffff},
567 { NSOPTION_sys_colour_ActiveText, 0x000000ee},
568 { NSOPTION_sys_colour_ButtonBorder, 0x00aaaaaa},
569 { NSOPTION_sys_colour_ButtonFace, 0x00dddddd},
570 { NSOPTION_sys_colour_ButtonText, 0x00000000},
571 { NSOPTION_sys_colour_Canvas, 0x00aaaaaa},
572 { NSOPTION_sys_colour_CanvasText, 0x00000000},
573 { NSOPTION_sys_colour_Field, 0x00f1f1f1},
574 { NSOPTION_sys_colour_FieldText, 0x00000000},
575 { NSOPTION_sys_colour_GrayText, 0x00777777},
576 { NSOPTION_sys_colour_Highlight, 0x00ee0000},
577 { NSOPTION_sys_colour_HighlightText, 0x00000000},
578 { NSOPTION_sys_colour_LinkText, 0x00ee0000},
579 { NSOPTION_sys_colour_Mark, 0x0000ffff},
580 { NSOPTION_sys_colour_MarkText, 0x00000000},
581 { NSOPTION_sys_colour_SelectedItem, 0x00e48435},
582 { NSOPTION_sys_colour_SelectedItemText, 0x00ffffff},
583 { NSOPTION_sys_colour_VisitedText, 0x008b1a55},
593 NSLOG(netsurf, INFO,
"Failed initialising cookie options");
599 defaults[sys_colour_defaults[idx].nsc].
value.
c = sys_colour_defaults[idx].c;
634 if ((event.type == NSFB_EVENT_CONTROL) &&
635 (event.value.controlcode == NSFB_CONTROL_QUIT))
645 NSLOG(netsurf, INFO,
"gui_quit");
663 enum { CLICK_SINGLE, CLICK_DOUBLE, CLICK_TRIPLE }
type;
667 if (cbi->
event->type != NSFB_EVENT_KEY_DOWN &&
668 cbi->
event->type != NSFB_EVENT_KEY_UP)
671 NSLOG(netsurf, DEEPDEBUG,
"browser window clicked at %d,%d",
674 switch (cbi->
event->type) {
675 case NSFB_EVENT_KEY_DOWN:
676 switch (cbi->
event->value.keycode) {
677 case NSFB_KEY_MOUSE_1:
686 case NSFB_KEY_MOUSE_3:
695 case NSFB_KEY_MOUSE_4:
703 case NSFB_KEY_MOUSE_5:
717 case NSFB_EVENT_KEY_UP:
720 nsu_getmonotonic_ms(&time_now);
722 switch (cbi->
event->value.keycode) {
723 case NSFB_KEY_MOUSE_1:
745 case NSFB_KEY_MOUSE_3:
774 if ((time_now < (last_click.time + 500)) &&
775 (cbi->
event->value.keycode != NSFB_KEY_MOUSE_4) &&
776 (cbi->
event->value.keycode != NSFB_KEY_MOUSE_5)) {
777 if (last_click.type == CLICK_SINGLE) {
780 last_click.type = CLICK_DOUBLE;
782 }
else if (last_click.type == CLICK_DOUBLE) {
785 last_click.type = CLICK_TRIPLE;
788 last_click.type = CLICK_SINGLE;
791 last_click.type = CLICK_SINGLE;
798 last_click.time = time_now;
858 NSLOG(netsurf, INFO,
"got value %d", cbi->
event->value.keycode);
860 switch (cbi->
event->type) {
861 case NSFB_EVENT_KEY_DOWN:
862 switch (cbi->
event->value.keycode) {
864 case NSFB_KEY_DELETE:
868 case NSFB_KEY_PAGEUP:
875 case NSFB_KEY_PAGEDOWN:
949 case NSFB_KEY_EQUALS:
963 case NSFB_KEY_RSHIFT:
967 case NSFB_KEY_LSHIFT:
981 if (cbi->
event->value.keycode == NSFB_KEY_z &&
990 }
else if (cbi->
event->value.keycode == NSFB_KEY_z &&
997 }
else if (cbi->
event->value.keycode == NSFB_KEY_y &&
1016 case NSFB_EVENT_KEY_UP:
1017 switch (cbi->
event->value.keycode) {
1018 case NSFB_KEY_RSHIFT:
1019 modifier &= ~FBTK_MOD_RSHIFT;
1022 case NSFB_KEY_LSHIFT:
1023 modifier &= ~FBTK_MOD_LSHIFT;
1026 case NSFB_KEY_RCTRL:
1027 modifier &= ~FBTK_MOD_RCTRL;
1030 case NSFB_KEY_LCTRL:
1031 modifier &= ~FBTK_MOD_LCTRL;
1066 if (cbi->
event->type != NSFB_EVENT_KEY_UP)
1084 if (cbi->
event->type != NSFB_EVENT_KEY_UP)
1101 if (cbi->
event->type != NSFB_EVENT_KEY_UP)
1114 if (cbi->
event->type != NSFB_EVENT_KEY_UP)
1125 if (cbi->
event->type != NSFB_EVENT_KEY_UP)
1137 if (cbi->
event->type != NSFB_EVENT_KEY_UP)
1150 switch (cbi->
type) {
1203 if (cbi->
event->type != NSFB_EVENT_KEY_UP)
1241 const char *toolbar_layout)
1249 const char *itmtype;
1251 if (toolbar_layout == NULL) {
1255 NSLOG(netsurf, INFO,
"Using toolbar layout %s", toolbar_layout);
1257 itmtype = toolbar_layout;
1260 if ((*itmtype == 0) || (*itmtype ==
'q')) {
1285 while ((itmtype >= toolbar_layout) &&
1289 NSLOG(netsurf, INFO,
"toolbar adding %c", *itmtype);
1296 (xdir == 1) ? xpos :
1310 (xdir == 1) ? xpos :
1421 itmtype = toolbar_layout + strlen(toolbar_layout);
1431 NSLOG(netsurf, INFO,
1432 "Unknown element %c in toolbar layout",
1438 if (widget != NULL) {
1442 NSLOG(netsurf, INFO,
"xpos is %d", xpos);
1466 const char *toolbar_layout)
1473 const char *itmtype;
1474 int x = 0, y = 0, w = 0, h = 0;
1480 if (toolbar_layout == NULL) {
1484 itmtype = toolbar_layout;
1486 if (*itmtype == 0) {
1499 while (itmtype >= toolbar_layout && xdir != 0) {
1577 itmtype = toolbar_layout + strlen(toolbar_layout);
1591 if (widget != NULL) {
1594 xpos += xdir * (w + padding);
1649 int statusbar_width = 0;
1652 NSLOG(netsurf, INFO,
"Normal window");
1678 statusbar_width, furniture_width,
1683 NSLOG(netsurf, INFO,
"status bar %p at %d,%d", gw->
status,
1753 int statusbar_width;
1768 0,
height - furniture_width,
1769 statusbar_width, furniture_width);
1771 statusbar_width,
height - furniture_width,
1772 width - statusbar_width - furniture_width,
1775 width - furniture_width,
height - furniture_width,
1776 furniture_width, furniture_width);
1778 width - furniture_width,
1779 toolbar_height, furniture_width,
1780 height - toolbar_height - furniture_width);
1783 width - furniture_width,
1784 height - furniture_width - toolbar_height);
1815 if (list->
next != NULL) {
2086 c_y + c_h - bwidget->
scrolly);
2203 die(
"NetSurf operation table failed registration");
2216 die(
"Options failed to initialise");
2228 fprintf(stderr,
"Message translations failed to load\n");
2234 die(
"NetSurf failed to initialise");
2241 die(
"unable to process command line.\n");
2245 die(
"Unable to initialise framebuffer");
2250 die(
"Unable to initialise the font system");
2260 NSLOG(netsurf, INFO,
"calling browser_window_create");
2282 NSLOG(netsurf, INFO,
"Font finalisation failed.");
int main(int argc, char **argv)
Normal entry point from OS.
struct gui_window * input_window
void gui_window_destroy(struct gui_window *gw)
Destroy previously created gui window.
void gui_window_set_pointer(struct gui_window *gw, gui_pointer_shape shape)
set the pointer shape
struct gui_window * window_list
bool gui_window_get_scroll(struct gui_window *w, int *sx, int *sy)
int schedule_run(void)
Process events up to current time.
nserror browser_window_history_forward(struct browser_window *bw, bool new_window)
Go forward in the history.
nserror browser_window_history_back(struct browser_window *bw, bool new_window)
Go back in the history.
Interface to browser history operations.
Browser window creation and manipulation interface.
nserror browser_window_schedule_reformat(struct browser_window *bw)
Reformat the browser window contents in a safe context.
nserror browser_window_navigate(struct browser_window *bw, struct nsurl *url, struct nsurl *referrer, enum browser_window_nav_flags flags, char *post_urlenc, struct fetch_multipart_data *post_multipart, struct hlcache_handle *parent)
Start fetching a page in a browser window.
bool browser_window_redraw(struct browser_window *bw, int x, int y, const struct rect *clip, const struct redraw_context *ctx)
Redraw an area of a window.
bool browser_window_back_available(struct browser_window *bw)
Check availability of Back action for a given browser window.
void browser_window_mouse_click(struct browser_window *bw, browser_mouse_state mouse, int x, int y)
Handle mouse clicks in a browser window.
bool browser_window_scroll_at_point(struct browser_window *bw, int x, int y, int scrx, int scry)
Send a scroll request to a browser window at a particular point.
void browser_window_destroy(struct browser_window *bw)
Close and destroy a browser window.
nserror browser_window_reload(struct browser_window *bw, bool all)
Reload the page in a browser window.
bool browser_window_forward_available(struct browser_window *bw)
Check availability of Forward action for a given browser window.
nserror browser_window_get_extents(struct browser_window *bw, bool scaled, int *width, int *height)
Get a browser window's content extents.
nserror browser_window_create(enum browser_window_create_flags flags, struct nsurl *url, struct nsurl *referrer, struct browser_window *existing, struct browser_window **bw)
Create and open a new root browser window with the given page.
void browser_window_stop(struct browser_window *bw)
Stop all fetching activity in a browser window.
nserror browser_window_set_scale(struct browser_window *bw, float scale, bool absolute)
Sets the scale of a browser window.
@ BW_CREATE_HISTORY
this will form a new history node (don't set for back/reload/etc)
@ BW_NAVIGATE_HISTORY
this will form a new history node (don't set for back/reload/etc)
void browser_window_mouse_track(struct browser_window *bw, browser_mouse_state mouse, int x, int y)
Handle non-click mouse action in a browser window.
Fetching of data from a URL (interface).
Unified cookie database public interface.
void urldb_save_cookies(const char *filename)
Save persistent cookies to file.
void urldb_load_cookies(const char *filename)
Load a cookie file into the database.
nserror
Enumeration of error codes.
@ NSERROR_BAD_PARAMETER
Bad Parameter.
fbtk_callback fbtk_set_handler(fbtk_widget_t *widget, fbtk_callback_type cbt, fbtk_callback cb, void *pw)
Set a callback handler.
int fbtk_set_mapping(fbtk_widget_t *widget, bool mapped)
Map a widget and request it is redrawn.
int fbtk_destroy_widget(fbtk_widget_t *widget)
Destroy a widget and all its descendants.
bool fbtk_get_redraw_pending(fbtk_widget_t *widget)
Determine if there are any redraws pending for a widget.
fbtk_widget_t * fbtk_create_writable_text(fbtk_widget_t *window, int x, int y, int width, int height, colour bg, colour fg, bool outline, fbtk_enter_t enter, void *pw)
Create a writable text widget.
bool fbtk_set_pos_and_size(fbtk_widget_t *widget, int x, int y, int width, int height)
Change the widget's position and size.
fbtk_widget_t * fbtk_create_vscroll(fbtk_widget_t *window, int x, int y, int width, int height, colour fg, colour bg, fbtk_callback callback, void *context)
Create a vertical scroll widget.
void * fbtk_get_userpw(fbtk_widget_t *widget)
Get the user context from a widget.
void fbtk_request_redraw(fbtk_widget_t *widget)
Indicate a widget should be redrawn.
void fbtk_enable_oskb(fbtk_widget_t *widget)
enable the on screen keyboard for input
int fbtk_get_absx(fbtk_widget_t *widget)
Get a widget's absolute horizontal screen co-ordinate.
int fbtk_get_width(fbtk_widget_t *widget)
Get a widget's width.
bool fbtk_tgrab_pointer(fbtk_widget_t *widget)
Toggle pointer grab.
fbtk_modifier_type
Key modifier status.
void fbtk_set_focus(fbtk_widget_t *widget)
Give widget input focus.
fbtk_widget_t * fbtk_create_fill(fbtk_widget_t *window, int x, int y, int width, int height, colour c)
Create a filled rectangle.
fbtk_widget_t * fbtk_create_hscroll(fbtk_widget_t *window, int x, int y, int width, int height, colour fg, colour bg, fbtk_callback callback, void *context)
Create a horizontal scroll widget.
bool fbtk_set_scroll_parameters(fbtk_widget_t *widget, int min, int max, int thumb, int page)
Set scoll widget parameters.
void fbtk_reposition_hscroll(fbtk_widget_t *scrollh, int x, int y, int width, int height)
Move and/or resize a horizontal scroll widget.
fbtk_widget_t * fbtk_create_user(fbtk_widget_t *window, int x, int y, int width, int height, void *pw)
Create a user widget.
bool fbtk_set_scroll_position(fbtk_widget_t *widget, int pos)
set scroll widget position.
void map_osk(void)
show the osk.
bool fbtk_event(fbtk_widget_t *root, nsfb_event_t *event, int timeout)
Retrive events from the framebuffer input.
fbtk_widget_t * fbtk_init(nsfb_t *fb)
Initialise widget toolkit.
fbtk_widget_t * fbtk_create_window(fbtk_widget_t *parent, int x, int y, int width, int height, colour bg)
Create a window widget.
fbtk_widget_t * fbtk_create_text_button(fbtk_widget_t *window, int x, int y, int width, int height, colour bg, colour fg, fbtk_callback click, void *pw)
Create a button with text.
fbtk_widget_t * fbtk_create_text(fbtk_widget_t *window, int x, int y, int width, int height, colour bg, colour fg, bool outline)
Create a text widget.
int fbtk_keycode_to_ucs4(int code, fbtk_modifier_type mods)
Convert a framebuffer keycode to ucs4.
fbtk_widget_t * fbtk_create_bitmap(fbtk_widget_t *window, int x, int y, int width, int height, colour c, struct fbtk_bitmap *image)
Create a bitmap widget.
bool fbtk_clip_to_widget(fbtk_widget_t *widget, bbox_t *restrict box)
clip a bounding box to a widgets area.
void fbtk_set_text(fbtk_widget_t *widget, const char *text)
Change the text of a text widget.
int fbtk_get_absy(fbtk_widget_t *widget)
Get a widget's absolute vertical screen co-ordinate.
void fbtk_set_caret(fbtk_widget_t *widget, bool set, int x, int y, int height, void(*remove_caret)(fbtk_widget_t *widget))
Set caret owner and position.
nsfb_t * fbtk_get_nsfb(fbtk_widget_t *widget)
Retrieve the framebuffer library handle from toolkit widget.
void fbtk_reposition_vscroll(fbtk_widget_t *scrollv, int x, int y, int width, int height)
Move and/or resize a vertical scroll widget.
int fbtk_redraw(fbtk_widget_t *widget)
Perform any pending widget redraws.
fbtk_widget_t * fbtk_create_button(fbtk_widget_t *window, int x, int y, int width, int height, colour c, struct fbtk_bitmap *image, fbtk_callback click, void *pw)
Create a button widget with an image.
int fbtk_get_height(fbtk_widget_t *widget)
Get a widget's height.
void fbtk_set_bitmap(fbtk_widget_t *widget, struct fbtk_bitmap *image)
Change the bitmap in a widget.
bool fbtk_get_caret(fbtk_widget_t *widget, int *x, int *y, int *height)
Get a widget caret pos, if it owns caret.
static struct directory * root
char * filepath_find(char **respathv, const char *filename)
Searches an array of resource paths for a file.
Utility routines to obtain paths to file resources.
struct gui_clipboard_table * framebuffer_clipboard_table
struct core_window_table * framebuffer_core_window_table
char ** fb_init_resource_path(const char *resource_path)
Create an array of valid paths to search for resources.
static fbtk_widget_t * create_toolbar(struct gui_window *gw, int toolbar_height, int padding, colour frame_col, const char *toolbar_layout)
Create a toolbar window and populate it with buttons.
struct gui_window * search_current_window
static int fb_osk_click(fbtk_widget_t *widget, fbtk_callback_info *cbi)
static nserror gui_window_set_scroll(struct gui_window *gw, const struct rect *rect)
Set the scroll position of a framebuffer browser window.
static bool process_cmdline(int argc, char **argv)
#define NSFB_TOOLBAR_DEFAULT_LAYOUT
static void gui_window_set_status(struct gui_window *g, const char *text)
static nserror gui_window_event(struct gui_window *gw, enum gui_window_event event)
process miscellaneous window events
void gui_resize(fbtk_widget_t *root, int width, int height)
static void framebuffer_run(void)
static void gui_window_remove_caret(struct gui_window *g)
static int fb_reload_click(fbtk_widget_t *widget, fbtk_callback_info *cbi)
static int fb_browser_window_move(fbtk_widget_t *widget, fbtk_callback_info *cbi)
static nserror gui_window_get_dimensions(struct gui_window *gw, int *width, int *height)
Find the current dimensions of a framebuffer browser window content area.
static void widget_scroll_y(struct gui_window *gw, int y, bool abs)
static void gui_window_add_to_window_list(struct gui_window *gw)
static struct gui_window * gui_window_create(struct browser_window *bw, struct gui_window *existing, gui_window_create_flags flags)
static struct gui_misc_table framebuffer_misc_table
static void fb_update_back_forward(struct gui_window *gw)
static int fb_close_click(fbtk_widget_t *widget, fbtk_callback_info *cbi)
static void create_normal_browser_window(struct gui_window *gw, int furniture_width)
static void gui_window_start_throbber(struct gui_window *g)
static int fb_url_enter(void *pw, char *text)
static int fb_browser_window_redraw(fbtk_widget_t *widget, fbtk_callback_info *cbi)
static void widget_scroll_x(struct gui_window *gw, int x, bool abs)
static int fb_rightarrow_click(fbtk_widget_t *widget, fbtk_callback_info *cbi)
static void throbber_advance(void *pw)
static nserror set_defaults(struct nsoption_s *defaults)
Set option defaults for framebuffer frontend.
static nserror gui_window_set_url(struct gui_window *g, nsurl *url)
static void gui_window_stop_throbber(struct gui_window *gw)
static bool nslog_stream_configure(FILE *fptr)
Ensures output logging stream is correctly configured.
static int fb_localhistory_btn_clik(fbtk_widget_t *widget, fbtk_callback_info *cbi)
static int fb_browser_window_click(fbtk_widget_t *widget, fbtk_callback_info *cbi)
static void gui_window_remove_from_window_list(struct gui_window *gw)
static void gui_quit(void)
static struct gui_drag gui_drag
static void gui_window_remove_caret_cb(fbtk_widget_t *widget)
static int fb_stop_click(fbtk_widget_t *widget, fbtk_callback_info *cbi)
static int fb_browser_window_strip_focus(fbtk_widget_t *widget, fbtk_callback_info *cbi)
Routine called when "stripped of focus" event occours for browser widget.
static int fb_url_move(fbtk_widget_t *widget, fbtk_callback_info *cbi)
static void die(const char *error)
Cause an abnormal program termination.
static void gui_window_place_caret(struct gui_window *g, int x, int y, int height, const struct rect *clip)
static int set_ptr_default_move(fbtk_widget_t *widget, fbtk_callback_info *cbi)
static struct gui_window_table framebuffer_window_table
static void resize_normal_browser_window(struct gui_window *gw, int furniture_width)
static int fb_scroll_callback(fbtk_widget_t *widget, fbtk_callback_info *cbi)
static const char * feurl
static void gui_window_update_extent(struct gui_window *gw)
static void resize_browser_widget(struct gui_window *gw, int x, int y, int width, int height)
static void fb_pan(fbtk_widget_t *widget, struct browser_widget_s *bwidget, struct browser_window *bw)
static void fb_queue_redraw(struct fbtk_widget_s *widget, int x0, int y0, int x1, int y1)
static void framebuffer_pick_default_fename(void *ctx, const char *name, enum nsfb_type_e type)
static nserror fb_window_invalidate_area(struct gui_window *g, const struct rect *rect)
Invalidates an area of a framebuffer browser window.
static enum nsfb_type_e fetype
static void framebuffer_surface_iterator(void *ctx, const char *name, enum nsfb_type_e type)
static nserror fb_warn_user(const char *warning, const char *detail)
Warn the user of an event.
static void create_browser_widget(struct gui_window *gw, int toolbar_height, int furniture_width)
static int fb_leftarrow_click(fbtk_widget_t *widget, fbtk_callback_info *cbi)
static const char * fename
static void fb_redraw(fbtk_widget_t *widget, struct browser_widget_s *bwidget, struct browser_window *bw)
static int fb_browser_window_destroy(fbtk_widget_t *widget, fbtk_callback_info *cbi)
static void resize_toolbar(struct gui_window *gw, int toolbar_height, int padding, const char *toolbar_layout)
Resize a toolbar.
static int fb_browser_window_input(fbtk_widget_t *widget, fbtk_callback_info *cbi)
struct nsfb_bbox_s bbox_t
nserror framebuffer_schedule(int tival, void(*callback)(void *p), void *p)
Schedule a callback.
nsfb_t * framebuffer_initialise(const char *fename, int width, int height, int bpp)
bool framebuffer_resize(nsfb_t *nsfb, int width, int height, int bpp)
const struct plotter_table fb_plotters
framebuffer plot operation table
void framebuffer_finalise(void)
bool framebuffer_set_cursor(struct fbtk_bitmap *bm)
struct gui_bitmap_table * framebuffer_bitmap_table
struct gui_fetch_table * framebuffer_fetch_table
struct gui_utf8_table * framebuffer_utf8_table
bool fb_font_finalise(void)
Finalise framebuffer font handling.
bool fb_font_init(void)
Initialise framebuffer font handling.
struct gui_layout_table * framebuffer_layout_table
nserror fb_local_history_present(fbtk_widget_t *parent, struct browser_window *bw)
make the local history window visible.
Interface to framebuffer local history manager.
char ** respaths
resource search path vector
struct fbtk_bitmap pointer_image
struct fbtk_bitmap left_arrow
struct fbtk_bitmap throbber0
struct fbtk_bitmap move_image
struct fbtk_bitmap right_arrow
struct fbtk_bitmap throbber7
struct fbtk_bitmap menu_image
struct fbtk_bitmap history_image
struct fbtk_bitmap throbber8
struct fbtk_bitmap throbber1
struct fbtk_bitmap right_arrow_g
struct fbtk_bitmap throbber6
struct fbtk_bitmap progress_image
struct fbtk_bitmap throbber4
struct fbtk_bitmap caret_image
struct fbtk_bitmap reload
struct fbtk_bitmap osk_image
struct fbtk_bitmap hand_image
struct fbtk_bitmap throbber2
struct fbtk_bitmap stop_image
struct fbtk_bitmap stop_image_g
struct fbtk_bitmap left_arrow_g
struct fbtk_bitmap throbber5
struct fbtk_bitmap throbber3
Interface to platform-specific miscellaneous browser operation table.
browser_mouse_state
Mouse state: 1 is primary mouse button.
@ BROWSER_MOUSE_PRESS_1
primary button pressed
@ BROWSER_MOUSE_CLICK_2
button 2 clicked.
@ BROWSER_MOUSE_PRESS_2
auxillary button pressed
@ BROWSER_MOUSE_TRIPLE_CLICK
button triple clicked
@ BROWSER_MOUSE_CLICK_1
button 1 clicked.
@ BROWSER_MOUSE_DOUBLE_CLICK
button double clicked
@ BROWSER_MOUSE_DRAG_1
start of button 1 drag
@ BROWSER_MOUSE_HOLDING_2
during button 2 drag
@ BROWSER_MOUSE_HOLDING_1
during button 1 drag
@ BROWSER_MOUSE_DRAG_ON
a drag operation was started and a mouse button is still pressed
@ BROWSER_MOUSE_DRAG_2
start of button 2 drag
Target independent plotting interface.
Interface to platform-specific graphical user interface window operations.
gui_window_create_flags
Window creation control flags.
gui_window_event
Window events.
@ GW_EVENT_REMOVE_CARET
Remove the caret, if present.
@ GW_EVENT_STOP_THROBBER
stop the navigation throbber.
@ GW_EVENT_UPDATE_EXTENT
Update the extent of the inside of a browser window to that of the current content.
@ GW_EVENT_START_THROBBER
start the navigation throbber.
Interface to key press operations.
bool browser_window_key_press(struct browser_window *bw, uint32_t key)
Handle key presses in a browser window.
nserror nslog_init(nslog_ensure_t *ensure, int *pargc, char **argv)
Initialise the logging system.
void nslog_finalise(void)
Shut down the logging system.
#define NSLOG(catname, level, logmsg, args...)
nserror messages_add_from_file(const char *path)
Read keys and values from messages file into the standard Messages hash.
const char * messages_get_errorcode(nserror code)
lookup of a message by errorcode from the standard Messages hash.
Localised message support (interface).
NetSurf core interface registration, construction and destruction.
void netsurf_exit(void)
Finalise NetSurf core.
nserror netsurf_init(const char *store_path)
Initialise netsurf core.
nserror netsurf_register(struct netsurf_table *table)
Register operation table.
nserror nsurl_create(const char *const url_s, nsurl **url)
Create a NetSurf URL object from a URL string.
void nsurl_unref(nsurl *url)
Drop a reference to a NetSurf URL object.
const char * nsurl_access(const nsurl *url)
Access a NetSurf URL object as a string.
struct nsurl nsurl
NetSurf URL object.
Interface to utility string handling.
struct browser_window * bw
framebuffer toolkit bitmaps
widget callback information
enum fbtk_callback_type type
Graphical user interface browser misc function table.
nserror(* schedule)(int t, void(*callback)(void *p), void *p)
Schedule a callback.
Graphical user interface window function table.
struct gui_window *(* create)(struct browser_window *bw, struct gui_window *existing, gui_window_create_flags flags)
Create and open a gui window for a browsing context.
first entry in window list
struct gui_window * prev
Previous in linked list.
struct fbtk_widget_s * toolbar
struct gui_window * next
list for cleanup
struct fbtk_widget_s * back
struct fbtk_widget_s * bottom_right
struct fbtk_widget_s * window
struct fbtk_widget_s * reload
struct fbtk_widget_s * history
struct fbtk_widget_s * close
struct fbtk_widget_s * throbber
struct fbtk_widget_s * hscroll
struct fbtk_widget_s * stop
struct fbtk_widget_s * vscroll
struct fbtk_widget_s * forward
struct s_browser * browser
struct browser_window * bw
The 'content' window that is rendered in the gui_window.
NetSurf operation function table.
struct gui_misc_table * misc
Browser table.
union nsoption_s::@149 value
bool interactive
Redraw to show interactive features.
uint32_t colour
Colour type: XBGR.
struct nsoption_s * nsoptions_default
global default option table.
static struct nsoption_s defaults[]
The table of compiled in default options.
nserror nsoption_read(const char *path, struct nsoption_s *opts)
Read choices file and set them in the passed table.
struct nsoption_s * nsoptions
global active option table.
nserror nsoption_commandline(int *pargc, char **argv, struct nsoption_s *opts)
Process commandline and set options approriately.
nserror nsoption_init(nsoption_set_default_t *set_defaults, struct nsoption_s **popts, struct nsoption_s **pdefs)
Initialise option system.
nserror nsoption_finalise(struct nsoption_s *opts, struct nsoption_s *defs)
Finalise option system.
Option reading and saving interface.
#define nsoption_charp(OPTION)
Get the value of a string option.
#define nsoption_setnull_charp(OPTION, VALUE)
set string option in default table if currently unset
#define nsoption_int(OPTION)
Get the value of an integer option.
#define nsoption_set_bool(OPTION, VALUE)
set a boolean option in the default table
#define nsoption_bool(OPTION)
Get the value of a boolean option.
Interface to a number of general purpose functionality.
#define fallthrough
switch fall through
static nserror line(const struct redraw_context *ctx, const plot_style_t *style, const struct rect *line)
Plots a line.
static nserror text(const struct redraw_context *ctx, const struct plot_font_style *fstyle, int x, int y, const char *text, size_t length)
Text plotting.
static nserror clip(const struct redraw_context *ctx, const struct rect *clip)
Sets a clip rectangle for subsequent plot operations.