NetSurf
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "utils/utils.h"
#include "utils/ring.h"
#include "utils/log.h"
#include "utils/messages.h"
#include "utils/nsurl.h"
#include "netsurf/mouse.h"
#include "netsurf/window.h"
#include "netsurf/browser_window.h"
#include "netsurf/plotters.h"
#include "monkey/output.h"
#include "monkey/browser.h"
#include "monkey/plot.h"
Go to the source code of this file.
Functions | |
nserror | monkey_warn_user (const char *warning, const char *detail) |
struct gui_window * | monkey_find_window_by_num (uint32_t win_num) |
void | monkey_kill_browser_windows (void) |
static struct gui_window * | gui_window_create (struct browser_window *bw, struct gui_window *existing, gui_window_create_flags flags) |
static void | gui_window_destroy (struct gui_window *g) |
static void | gui_window_set_title (struct gui_window *g, const char *title) |
static nserror | gui_window_get_dimensions (struct gui_window *g, int *width, int *height) |
Find the current dimensions of a monkey browser window content area. More... | |
static void | gui_window_new_content (struct gui_window *g) |
static void | gui_window_set_icon (struct gui_window *g, struct hlcache_handle *icon) |
static void | gui_window_start_throbber (struct gui_window *g) |
static void | gui_window_stop_throbber (struct gui_window *g) |
static nserror | gui_window_set_scroll (struct gui_window *gw, const struct rect *rect) |
Set the scroll position of a monkey browser window. More... | |
static nserror | monkey_window_invalidate_area (struct gui_window *gw, const struct rect *rect) |
Invalidates an area of a monkey browser window. More... | |
static void | gui_window_update_extent (struct gui_window *g) |
static void | gui_window_set_status (struct gui_window *g, const char *text) |
static void | gui_window_set_pointer (struct gui_window *g, gui_pointer_shape shape) |
static nserror | gui_window_set_url (struct gui_window *g, nsurl *url) |
static bool | gui_window_get_scroll (struct gui_window *g, int *sx, int *sy) |
static bool | gui_window_scroll_start (struct gui_window *g) |
static void | gui_window_place_caret (struct gui_window *g, int x, int y, int height, const struct rect *clip) |
static void | gui_window_remove_caret (struct gui_window *g) |
static bool | gui_window_drag_start (struct gui_window *g, gui_drag_type type, const struct rect *rect) |
static nserror | gui_window_save_link (struct gui_window *g, nsurl *url, const char *title) |
static void | gui_window_console_log (struct gui_window *g, browser_window_console_source src, const char *msg, size_t msglen, browser_window_console_flags flags) |
static void | gui_window_report_page_info (struct gui_window *g) |
static void | monkey_window_handle_new (int argc, char **argv) |
static void | monkey_window_handle_destroy (int argc, char **argv) |
static void | monkey_window_handle_go (int argc, char **argv) |
static void | monkey_window_handle_stop (int argc, char **argv) |
handle WINDOW STOP command More... | |
static void | monkey_window_handle_redraw (int argc, char **argv) |
static void | monkey_window_handle_reload (int argc, char **argv) |
static void | monkey_window_handle_exec (int argc, char **argv) |
static void | monkey_window_handle_click (int argc, char **argv) |
void | monkey_window_handle_command (int argc, char **argv) |
static nserror | gui_window_event (struct gui_window *gw, enum gui_window_event event) |
process miscellaneous window events More... | |
Variables | |
static uint32_t | win_ctr = 0 |
static struct gui_window * | gw_ring = NULL |
static struct gui_window_table | window_table |
struct gui_window_table * | monkey_window_table = &window_table |
|
static |
Definition at line 354 of file browser.c.
References BW_CS_FLAG_FOLDABLE, BW_CS_FLAG_LEVEL_DEBUG, BW_CS_FLAG_LEVEL_ERROR, BW_CS_FLAG_LEVEL_INFO, BW_CS_FLAG_LEVEL_LOG, BW_CS_FLAG_LEVEL_MASK, BW_CS_FLAG_LEVEL_WARN, BW_CS_INPUT, BW_CS_SCRIPT_CONSOLE, BW_CS_SCRIPT_ERROR, MOUT_WINDOW, moutf(), and gui_window::win_num.
|
static |
Definition at line 74 of file browser.c.
References gui_window::bw, GW_CREATE_CLONE, GW_CREATE_TAB, gw_ring, gui_window::height, MOUT_WINDOW, moutf(), RING_INSERT, gui_window::width, win_ctr, and gui_window::win_num.
|
static |
Definition at line 103 of file browser.c.
References gw_ring, MOUT_WINDOW, moutf(), RING_REMOVE, and gui_window::win_num.
|
static |
Definition at line 338 of file browser.c.
References MOUT_WINDOW, moutf(), type, and gui_window::win_num.
|
static |
process miscellaneous window events
gw | The window receiving the event. |
event | The event code. |
Definition at line 736 of file browser.c.
References gui_window_new_content(), gui_window_remove_caret(), gui_window_report_page_info(), gui_window_scroll_start(), gui_window_start_throbber(), gui_window_stop_throbber(), gui_window_update_extent(), GW_EVENT_NEW_CONTENT, GW_EVENT_PAGE_INFO_CHANGE, GW_EVENT_REMOVE_CARET, GW_EVENT_SCROLL_START, GW_EVENT_START_THROBBER, GW_EVENT_STOP_THROBBER, GW_EVENT_UPDATE_EXTENT, and NSERROR_OK.
|
static |
Find the current dimensions of a monkey browser window content area.
g | The gui window to measure content area of. |
width | receives width of window |
height | receives height of window |
Definition at line 125 of file browser.c.
References gui_window::height, height, MOUT_WINDOW, moutf(), NSERROR_OK, gui_window::width, width, and gui_window::win_num.
|
static |
Definition at line 305 of file browser.c.
References MOUT_WINDOW, moutf(), gui_window::scrollx, gui_window::scrolly, and gui_window::win_num.
|
static |
Definition at line 138 of file browser.c.
References MOUT_WINDOW, moutf(), and gui_window::win_num.
Referenced by gui_window_event().
|
static |
Definition at line 324 of file browser.c.
References height, MOUT_WINDOW, moutf(), and gui_window::win_num.
|
static |
Definition at line 332 of file browser.c.
References MOUT_WINDOW, moutf(), and gui_window::win_num.
Referenced by gui_window_event().
|
static |
Definition at line 408 of file browser.c.
References browser_window_get_page_info_state(), gui_window::bw, MOUT_WINDOW, moutf(), PAGE_STATE_INSECURE, PAGE_STATE_INTERNAL, PAGE_STATE_LOCAL, PAGE_STATE_SECURE, PAGE_STATE_SECURE_ISSUES, PAGE_STATE_SECURE_OVERRIDE, PAGE_STATE_UNKNOWN, gui_window::state, and gui_window::win_num.
Referenced by gui_window_event().
|
static |
Definition at line 346 of file browser.c.
References MOUT_WINDOW, moutf(), NSERROR_OK, nsurl_access(), gui_window::title, gui_window::url, and gui_window::win_num.
|
static |
Definition at line 315 of file browser.c.
References MOUT_WINDOW, moutf(), gui_window::scrollx, gui_window::scrolly, and gui_window::win_num.
Referenced by gui_window_event().
|
static |
Definition at line 144 of file browser.c.
References MOUT_WINDOW, moutf(), and gui_window::win_num.
|
static |
Definition at line 226 of file browser.c.
References GUI_POINTER_CARET, GUI_POINTER_CROSS, GUI_POINTER_DEFAULT, GUI_POINTER_DOWN, GUI_POINTER_HELP, GUI_POINTER_LD, GUI_POINTER_LEFT, GUI_POINTER_LU, GUI_POINTER_MENU, GUI_POINTER_MOVE, GUI_POINTER_NO_DROP, GUI_POINTER_NOT_ALLOWED, GUI_POINTER_POINT, GUI_POINTER_PROGRESS, GUI_POINTER_RD, GUI_POINTER_RIGHT, GUI_POINTER_RU, GUI_POINTER_UP, GUI_POINTER_WAIT, MOUT_WINDOW, moutf(), and gui_window::win_num.
|
static |
Set the scroll position of a monkey browser window.
Scrolls the viewport to ensure the specified rectangle of the content is shown.
gw | gui window to scroll |
rect | The rectangle to ensure is shown. |
Definition at line 173 of file browser.c.
References MOUT_WINDOW, moutf(), NSERROR_OK, gui_window::scrollx, gui_window::scrolly, gui_window::win_num, rect::x0, and rect::y0.
|
static |
Definition at line 220 of file browser.c.
References MOUT_WINDOW, moutf(), text(), and gui_window::win_num.
|
static |
Definition at line 111 of file browser.c.
References MOUT_WINDOW, moutf(), gui_window::title, and gui_window::win_num.
|
static |
Definition at line 297 of file browser.c.
References MOUT_WINDOW, moutf(), NSERROR_OK, nsurl_access(), gui_window::url, and gui_window::win_num.
|
static |
Definition at line 150 of file browser.c.
References MOUT_WINDOW, moutf(), and gui_window::win_num.
Referenced by gui_window_event().
|
static |
Definition at line 156 of file browser.c.
References MOUT_WINDOW, moutf(), and gui_window::win_num.
Referenced by gui_window_event().
|
static |
Definition at line 208 of file browser.c.
References browser_window_get_extents(), gui_window::bw, height, MOUT_WINDOW, moutf(), NSERROR_OK, width, and gui_window::win_num.
Referenced by gui_window_event().
struct gui_window * monkey_find_window_by_num | ( | uint32_t | win_num | ) |
Definition at line 51 of file browser.c.
References gw_ring, RING_ITERATE_END, RING_ITERATE_START, RING_ITERATE_STOP, and gui_window::win_num.
Referenced by monkey_window_handle_click(), monkey_window_handle_destroy(), monkey_window_handle_exec(), monkey_window_handle_go(), monkey_window_handle_redraw(), monkey_window_handle_reload(), and monkey_window_handle_stop().
void monkey_kill_browser_windows | ( | void | ) |
Definition at line 66 of file browser.c.
References browser_window_destroy(), gui_window::bw, and gw_ring.
Referenced by main().
nserror monkey_warn_user | ( | const char * | warning, |
const char * | detail | ||
) |
Definition at line 44 of file browser.c.
References MOUT_WARNING, moutf(), and NSERROR_OK.
Referenced by monkey_window_handle_go(), and monkey_window_handle_new().
|
static |
Definition at line 659 of file browser.c.
References BROWSER_MOUSE_CLICK_1, BROWSER_MOUSE_CLICK_2, BROWSER_MOUSE_DOUBLE_CLICK, BROWSER_MOUSE_TRIPLE_CLICK, browser_window_mouse_click(), gui_window::bw, monkey_find_window_by_num(), gui_window::mouse, MOUT_ERROR, and moutf().
Referenced by monkey_window_handle_command().
void monkey_window_handle_command | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 701 of file browser.c.
References monkey_window_handle_click(), monkey_window_handle_destroy(), monkey_window_handle_exec(), monkey_window_handle_go(), monkey_window_handle_new(), monkey_window_handle_redraw(), monkey_window_handle_reload(), monkey_window_handle_stop(), MOUT_ERROR, and moutf().
Referenced by main().
|
static |
Definition at line 479 of file browser.c.
References browser_window_destroy(), gui_window::bw, monkey_find_window_by_num(), MOUT_ERROR, and moutf().
Referenced by monkey_window_handle_command().
|
static |
Definition at line 621 of file browser.c.
References browser_window_exec(), gui_window::bw, monkey_find_window_by_num(), MOUT_ERROR, MOUT_WINDOW, and moutf().
Referenced by monkey_window_handle_command().
|
static |
Definition at line 494 of file browser.c.
References browser_window_navigate(), gui_window::bw, BW_NAVIGATE_HISTORY, messages_get_errorcode(), monkey_find_window_by_num(), monkey_warn_user(), MOUT_ERROR, moutf(), NSERROR_OK, nsurl_create(), nsurl_unref(), and gui_window::url.
Referenced by monkey_window_handle_command().
|
static |
Definition at line 452 of file browser.c.
References browser_window_create(), BW_CREATE_HISTORY, messages_get_errorcode(), monkey_warn_user(), NSERROR_OK, nsurl_create(), nsurl_unref(), and gui_window::url.
Referenced by monkey_window_handle_command().
|
static |
Definition at line 562 of file browser.c.
References browser_window_redraw(), gui_window::bw, clip(), gui_window::height, redraw_context::interactive, monkey_find_window_by_num(), monkey_plotters, MOUT_ERROR, MOUT_WINDOW, moutf(), NSLOG, gui_window::scrollx, gui_window::scrolly, and gui_window::width.
Referenced by monkey_window_handle_command().
|
static |
Definition at line 603 of file browser.c.
References browser_window_reload(), gui_window::bw, monkey_find_window_by_num(), MOUT_ERROR, and moutf().
Referenced by monkey_window_handle_command().
|
static |
handle WINDOW STOP command
Definition at line 543 of file browser.c.
References browser_window_stop(), gui_window::bw, monkey_find_window_by_num(), MOUT_ERROR, and moutf().
Referenced by monkey_window_handle_command().
|
static |
Invalidates an area of a monkey browser window.
gw | gui_window |
rect | area to redraw or NULL for the entire window area |
Definition at line 192 of file browser.c.
References MOUT_WINDOW, moutf(), NSERROR_OK, gui_window::win_num, rect::x0, rect::x1, rect::y0, and rect::y1.
|
static |
Definition at line 41 of file browser.c.
Referenced by gui_window_create(), gui_window_destroy(), monkey_find_window_by_num(), and monkey_kill_browser_windows().
struct gui_window_table* monkey_window_table = &window_table |
|
static |
Definition at line 39 of file browser.c.
Referenced by gui_window_create().
|
static |