diff options
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/browser.c | 4 | ||||
-rw-r--r-- | desktop/gui.h | 31 | ||||
-rw-r--r-- | desktop/gui_factory.c | 7 |
3 files changed, 37 insertions, 5 deletions
diff --git a/desktop/browser.c b/desktop/browser.c index 3a286eecf..5b34dd555 100644 --- a/desktop/browser.c +++ b/desktop/browser.c @@ -300,7 +300,7 @@ void browser_window_update_extent(struct browser_window *bw) { if (bw->window != NULL) /* Front end window */ - gui_window_update_extent(bw->window); + guit->window->update_extent(bw->window); else /* Core-managed browser window */ browser_window_handle_scrollbars(bw); @@ -1912,7 +1912,7 @@ void browser_window_get_dimensions(struct browser_window *bw, *height = bw->height; } else { /* Front end window */ - gui_window_get_dimensions(bw->window, width, height, scaled); + guit->window->get_dimensions(bw->window, width, height, scaled); } } diff --git a/desktop/gui.h b/desktop/gui.h index bf922737b..02012fa8f 100644 --- a/desktop/gui.h +++ b/desktop/gui.h @@ -82,6 +82,8 @@ struct gui_window_table { /** * Force a redraw of the entire contents of a window. * + * @todo this API should be merged with update. + * * \param g gui_window to redraw */ void (*redraw)(struct gui_window *g); @@ -113,6 +115,31 @@ struct gui_window_table { */ void (*set_scroll)(struct gui_window *g, int sx, int sy); + /** + * Find the current dimensions of a browser window's content area. + * + * @todo The implementations of this are buggy and its only + * used from frames code. + * + * \param g gui_window to measure + * \param width receives width of window + * \param height receives height of window + * \param scaled whether to return scaled values + */ + void (*get_dimensions)(struct gui_window *g, int *width, int *height, bool scaled); + + /** + * Update the extent of the inside of a browser window to that of the + * current content. + * + * @todo this is used to update scroll bars does it need + * renaming? some frontends (windows) do not even implement it. + * + * \param g gui_window to update the extent of + */ + void (*update_extent)(struct gui_window *g); + + /* Optional entries */ @@ -198,9 +225,7 @@ struct gui_table { extern struct gui_table *guit; /* the gui vtable */ -void gui_window_get_dimensions(struct gui_window *g, int *width, int *height, - bool scaled); -void gui_window_update_extent(struct gui_window *g); + void gui_window_set_status(struct gui_window *g, const char *text); void gui_window_set_pointer(struct gui_window *g, gui_pointer_shape shape); void gui_window_place_caret(struct gui_window *g, int x, int y, int height, diff --git a/desktop/gui_factory.c b/desktop/gui_factory.c index a4cc1c9a9..62ec8c565 100644 --- a/desktop/gui_factory.c +++ b/desktop/gui_factory.c @@ -92,6 +92,13 @@ static nserror verify_window_register(struct gui_window_table *gwt) if (gwt->set_scroll == NULL) { return NSERROR_BAD_PARAMETER; } + if (gwt->get_dimensions == NULL) { + return NSERROR_BAD_PARAMETER; + } + if (gwt->update_extent == NULL) { + return NSERROR_BAD_PARAMETER; + } + /* fill in the optional entries with defaults */ if (gwt->set_title == NULL) { |