summaryrefslogtreecommitdiff
path: root/desktop/gui_factory.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2019-08-20 00:16:52 +0100
committerVincent Sanders <vince@kyllikki.org>2019-08-20 00:16:52 +0100
commit4dc4d8b318c9bee25ca9b2982495b2906cc76287 (patch)
treece55d6902a33a0e00c388a65a450e05d19dd4d2c /desktop/gui_factory.c
parentc0e27bd0da9c6804c788473b891bff6c0c98af66 (diff)
downloadnetsurf-4dc4d8b318c9bee25ca9b2982495b2906cc76287.tar.gz
netsurf-4dc4d8b318c9bee25ca9b2982495b2906cc76287.tar.bz2
add miscellaneous event to browser window callback table
extend the browser window callback table with a miscallaneous event entry. This is used to replace all browser window callbacks which take no parameters. This reduces the API surface from seven separate calls to a single call with an enumeration which may be readily extended. The initial implementation in the frontends simply calls the original implementations to reduce scope for errors.
Diffstat (limited to 'desktop/gui_factory.c')
-rw-r--r--desktop/gui_factory.c46
1 files changed, 1 insertions, 45 deletions
diff --git a/desktop/gui_factory.c b/desktop/gui_factory.c
index bd8d35bc5..fdb15ef8c 100644
--- a/desktop/gui_factory.c
+++ b/desktop/gui_factory.c
@@ -55,14 +55,6 @@ static nserror gui_default_window_set_url(struct gui_window *g, struct nsurl *ur
return NSERROR_OK;
}
-static void gui_default_window_start_throbber(struct gui_window *g)
-{
-}
-
-static void gui_default_window_stop_throbber(struct gui_window *g)
-{
-}
-
static bool gui_default_window_drag_start(struct gui_window *g,
gui_drag_type type,
const struct rect *rect)
@@ -82,17 +74,6 @@ static void gui_default_window_set_icon(struct gui_window *g,
{
}
-
-static void gui_default_window_new_content(struct gui_window *g)
-{
-}
-
-
-static bool gui_default_window_scroll_start(struct gui_window *g)
-{
- return true;
-}
-
static void gui_default_window_set_pointer(struct gui_window *g,
gui_pointer_shape shape)
{
@@ -109,10 +90,6 @@ static void gui_default_window_place_caret(struct gui_window *g,
{
}
-static void gui_default_window_remove_caret(struct gui_window *g)
-{
-}
-
static void gui_default_window_create_form_select_menu(struct gui_window *g,
struct form_control *control)
{
@@ -135,9 +112,6 @@ static void gui_default_window_drag_save_selection(struct gui_window *g,
{
}
-static void gui_default_window_start_selection(struct gui_window *g)
-{
-}
static void
gui_default_console_log(struct gui_window *gw,
@@ -176,7 +150,7 @@ static nserror verify_window_register(struct gui_window_table *gwt)
if (gwt->get_dimensions == NULL) {
return NSERROR_BAD_PARAMETER;
}
- if (gwt->update_extent == NULL) {
+ if (gwt->event == NULL) {
return NSERROR_BAD_PARAMETER;
}
@@ -200,27 +174,12 @@ static nserror verify_window_register(struct gui_window_table *gwt)
if (gwt->place_caret == NULL) {
gwt->place_caret = gui_default_window_place_caret;
}
- if (gwt->remove_caret == NULL) {
- gwt->remove_caret = gui_default_window_remove_caret;
- }
- if (gwt->start_throbber == NULL) {
- gwt->start_throbber = gui_default_window_start_throbber;
- }
- if (gwt->stop_throbber == NULL) {
- gwt->stop_throbber = gui_default_window_stop_throbber;
- }
if (gwt->drag_start == NULL) {
gwt->drag_start = gui_default_window_drag_start;
}
if (gwt->save_link == NULL) {
gwt->save_link = gui_default_window_save_link;
}
- if (gwt->new_content == NULL) {
- gwt->new_content = gui_default_window_new_content;
- }
- if (gwt->scroll_start == NULL) {
- gwt->scroll_start = gui_default_window_scroll_start;
- }
if (gwt->create_form_select_menu == NULL) {
gwt->create_form_select_menu =
gui_default_window_create_form_select_menu;
@@ -234,9 +193,6 @@ static nserror verify_window_register(struct gui_window_table *gwt)
if (gwt->drag_save_selection == NULL) {
gwt->drag_save_selection = gui_default_window_drag_save_selection;
}
- if (gwt->start_selection == NULL) {
- gwt->start_selection = gui_default_window_start_selection;
- }
if (gwt->console_log == NULL) {
gwt->console_log = gui_default_console_log;
}