99 lines
3.0 KiB
C
99 lines
3.0 KiB
C
#ifndef NETSURF_MONTAUK_BRIDGE_H
|
|
#define NETSURF_MONTAUK_BRIDGE_H
|
|
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
int mtk_netsurf_font_width(int family, int weight, unsigned flags, int size,
|
|
const char *text, size_t length);
|
|
void mtk_netsurf_font_draw(uint32_t *pixels, int width, int height,
|
|
int clip_x0, int clip_y0, int clip_x1, int clip_y1,
|
|
int x, int baseline, const char *text, size_t length,
|
|
uint32_t colour, int family, int weight, unsigned flags, int size);
|
|
|
|
enum mtk_netsurf_icon {
|
|
MTK_NETSURF_ICON_BACK,
|
|
MTK_NETSURF_ICON_FORWARD,
|
|
MTK_NETSURF_ICON_RELOAD,
|
|
MTK_NETSURF_ICON_STOP,
|
|
MTK_NETSURF_ICON_HOME,
|
|
MTK_NETSURF_ICON_CLOSE,
|
|
MTK_NETSURF_ICON_COUNT
|
|
};
|
|
|
|
void mtk_netsurf_icons_set_scale(int scale);
|
|
void mtk_netsurf_icon_draw(int icon, uint32_t *pixels, int width, int height,
|
|
int x, int y, unsigned opacity);
|
|
int mtk_netsurf_icon_size(void);
|
|
void mtk_netsurf_icons_cleanup(void);
|
|
|
|
#define MTK_NETSURF_MAX_TABS 16
|
|
#define MTK_NETSURF_MAX_BOOKMARK_ROWS 8
|
|
|
|
struct mtk_netsurf_chrome_metrics {
|
|
int chrome_h, status_h, tab_h;
|
|
int tab_x, tab_y, tab_w, tab_content_w, tab_close_w;
|
|
int add_x, add_y, add_w, add_h;
|
|
int button_y, button_size, button_gap;
|
|
int back_x, forward_x, reload_x;
|
|
int address_x, address_y, address_w, address_h;
|
|
int home_x, menu_x;
|
|
int popup_x, popup_y, popup_w, popup_item_h;
|
|
};
|
|
|
|
struct mtk_netsurf_chrome_model {
|
|
uint32_t *pixels;
|
|
int width, height, scale;
|
|
int mouse_x, mouse_y;
|
|
int tab_count, active_tab;
|
|
const char *tab_titles[MTK_NETSURF_MAX_TABS];
|
|
int can_back, can_forward, loading;
|
|
int address_focus;
|
|
uintptr_t address_input_key;
|
|
const char *address;
|
|
int menu_mode;
|
|
int bookmark_count;
|
|
const char *bookmark_titles[MTK_NETSURF_MAX_BOOKMARK_ROWS];
|
|
int find_focus;
|
|
const char *find_text;
|
|
const char *status;
|
|
int extent_height, scroll_y;
|
|
int scrollbar_hover, scrollbar_dragging;
|
|
};
|
|
|
|
void mtk_netsurf_chrome_metrics(int scale, int width, int tab_count,
|
|
struct mtk_netsurf_chrome_metrics *metrics);
|
|
void mtk_netsurf_chrome_draw(const struct mtk_netsurf_chrome_model *model);
|
|
|
|
void mtk_netsurf_address_input_focus(uintptr_t key, const char *text,
|
|
int select_all);
|
|
int mtk_netsurf_address_input_key(uintptr_t key, char *text, int capacity,
|
|
int scancode, int ascii, int pressed, int shift, int ctrl, int alt);
|
|
int mtk_netsurf_address_input_mouse(uintptr_t key, char *text, int capacity,
|
|
int x, int y, int buttons, int previous_buttons,
|
|
int field_x, int field_y, int field_w, int field_h,
|
|
int view_w, int view_h, int focused);
|
|
void mtk_netsurf_address_input_destroy(uintptr_t key);
|
|
|
|
int mtk_netsurf_page_scrollbar_mouse(int x, int y, int buttons,
|
|
int previous_buttons, int width, int height, int chrome_height,
|
|
int content_extent, int *scroll_y, int *hovered, int *dragging,
|
|
int *drag_offset);
|
|
int mtk_netsurf_page_view_width(int width);
|
|
|
|
int mtk_netsurf_https_fetch(const char *host, uint32_t ip, uint16_t port,
|
|
const char *request, size_t request_len,
|
|
char *response, size_t response_size);
|
|
|
|
int mtk_netsurf_open_file(char *path, size_t path_size);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|