NetSurf
|
win32 generic core window implementation. More...
#include <assert.h>
#include <string.h>
#include <math.h>
#include <windows.h>
#include <windowsx.h>
#include "utils/log.h"
#include "utils/messages.h"
#include "utils/utf8.h"
#include "netsurf/types.h"
#include "netsurf/keypress.h"
#include "netsurf/mouse.h"
#include "windows/windbg.h"
#include "windows/corewindow.h"
#include "windows/plot.h"
Go to the source code of this file.
Functions | |
static void | update_scrollbars (struct nsw32_corewindow *nsw32_cw) |
update the scrollbar visibility and size More... | |
static LRESULT | nsw32_corewindow_paint (struct nsw32_corewindow *nsw32_cw, HWND hwnd) |
Handle paint messages. More... | |
static LRESULT | nsw32_corewindow_vscroll (struct nsw32_corewindow *nsw32_cw, HWND hwnd, WPARAM wparam) |
static LRESULT | nsw32_corewindow_hscroll (struct nsw32_corewindow *nsw32_cw, HWND hwnd, WPARAM wparam) |
static LRESULT | nsw32_corewindow_mousedown (struct nsw32_corewindow *nsw32_cw, HWND hwnd, int x, int y, browser_mouse_state button) |
static LRESULT | nsw32_corewindow_mouseup (struct nsw32_corewindow *nsw32_cw, HWND hwnd, int x, int y, browser_mouse_state button) |
static LRESULT | nsw32_corewindow_close (struct nsw32_corewindow *nsw32_cw) |
static LRESULT CALLBACK | nsw32_window_corewindow_event_callback (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) |
callback for core window win32 events More... | |
static nserror | nsw32_cw_invalidate_area (struct core_window *cw, const struct rect *rect) |
callback from core to request an invalidation of a window area. More... | |
static nserror | nsw32_cw_update_size (struct core_window *cw, int width, int height) |
Callback from the core to update the content area size. More... | |
static nserror | nsw32_cw_set_scroll (struct core_window *cw, int x, int y) |
static nserror | nsw32_cw_get_scroll (const struct core_window *cw, int *x, int *y) |
static nserror | nsw32_cw_get_window_dimensions (const struct core_window *cw, int *width, int *height) |
Callback from the core to obtain the window viewport dimensions. More... | |
static nserror | nsw32_cw_drag_status (struct core_window *cw, core_window_drag_status ds) |
nserror | nsw32_corewindow_init (HINSTANCE hInstance, HWND hWndParent, struct nsw32_corewindow *nsw32_cw) |
initialise elements of nsw32 core window. More... | |
nserror | nsw32_corewindow_fini (struct nsw32_corewindow *nsw32_cw) |
finalise elements of nsw32 core window. More... | |
nserror | nsw32_create_corewindow_class (HINSTANCE hInstance) |
Variables | |
static const char | windowclassname_corewindow [] = "nswscorewindowwindow" |
struct core_window_table | nsw32_cw_cb_table |
struct core_window_table * | win32_core_window_table = &nsw32_cw_cb_table |
win32 generic core window implementation.
Provides interface for core renderers to a win32 api client area.
This module is an object that must be encapsulated. Client users should embed a struct nsw32_corewindow at the beginning of their context for this display surface, fill in relevant data and then call nsw32_corewindow_init()
The win32 core window structure requires the callback for draw, key and mouse operations.
Definition in file corewindow.c.
|
static |
Definition at line 328 of file corewindow.c.
References nsw32_corewindow::close.
Referenced by nsw32_window_corewindow_event_callback().
nserror nsw32_corewindow_fini | ( | struct nsw32_corewindow * | nsw32_cw | ) |
finalise elements of nsw32 core window.
nsw32_cw | A nsw32 core window structure to initialise |
Definition at line 577 of file corewindow.c.
References NSERROR_OK.
Referenced by nsw32_cookies_finalise(), nsw32_global_history_finalise(), nsw32_hotlist_finalise(), and nsw32_local_history_finalise().
|
static |
Definition at line 226 of file corewindow.c.
References NSLOG.
Referenced by nsw32_window_corewindow_event_callback().
nserror nsw32_corewindow_init | ( | HINSTANCE | hInstance, |
HWND | hWndParent, | ||
struct nsw32_corewindow * | nsw32_cw | ||
) |
initialise elements of nsw32 core window.
As a pre-requisite the draw, key and mouse callbacks must be defined
hInstance | The instance to create the core window in |
hWndParent | parent window handle may be NULL for top level window. |
nsw32_cw | A nsw32 core window structure to initialise |
Definition at line 519 of file corewindow.c.
References nsw32_corewindow::content_height, nsw32_corewindow::content_width, CORE_WINDOW_DRAG_NONE, nsw32_corewindow::drag_status, nsw32_corewindow::hWnd, NSERROR_NOMEM, NSERROR_OK, NSLOG, nsw32_corewindow::title, and windowclassname_corewindow.
Referenced by nsw32_cookie_init(), nsw32_global_history_init(), nsw32_hotlist_init(), and nsw32_local_history_init().
|
static |
Definition at line 288 of file corewindow.c.
References nsw32_corewindow::mouse.
Referenced by nsw32_window_corewindow_event_callback().
|
static |
Definition at line 308 of file corewindow.c.
References nsw32_corewindow::mouse.
Referenced by nsw32_window_corewindow_event_callback().
|
static |
Handle paint messages.
Definition at line 117 of file corewindow.c.
References clip(), nsw32_corewindow::draw, and plot_hdc.
Referenced by nsw32_window_corewindow_event_callback().
|
static |
/todo win32 corewindow vertical scrolling needs us to compute scroll values and call scrollwindowex()
Definition at line 151 of file corewindow.c.
References NSLOG.
Referenced by nsw32_window_corewindow_event_callback().
nserror nsw32_create_corewindow_class | ( | HINSTANCE | hInstance | ) |
Definition at line 584 of file corewindow.c.
References NSERROR_INIT_FAILED, NSERROR_OK, nsw32_window_corewindow_event_callback(), win_perror(), and windowclassname_corewindow.
Referenced by WinMain().
|
static |
Definition at line 498 of file corewindow.c.
References nsw32_corewindow::drag_status, and NSERROR_OK.
|
static |
/todo call getscroll apropriately
Definition at line 469 of file corewindow.c.
References NSERROR_NOT_IMPLEMENTED.
|
static |
Callback from the core to obtain the window viewport dimensions.
[in] | cw | the core window object |
[out] | width | to be set to viewport width in px |
[out] | height | to be set to viewport height in px |
Definition at line 484 of file corewindow.c.
References height, nsw32_corewindow::hWnd, NSERROR_OK, and width.
|
static |
callback from core to request an invalidation of a window area.
The specified area of the window should now be considered out of date. If the area is NULL the entire window must be invalidated.
[in] | cw | The core window to invalidate. |
[in] | rect | area to redraw or NULL for the entire window area. |
Definition at line 411 of file corewindow.c.
References nsw32_corewindow::hWnd, NSERROR_OK, rect::x0, rect::x1, rect::y0, and rect::y1.
|
static |
/todo call setscroll apropriately
Definition at line 461 of file corewindow.c.
References NSERROR_OK.
|
static |
Callback from the core to update the content area size.
Definition at line 447 of file corewindow.c.
References nsw32_corewindow::content_height, nsw32_corewindow::content_width, height, NSERROR_OK, NSLOG, update_scrollbars(), and width.
|
static |
callback for core window win32 events
hwnd | The win32 window handle |
msg | The win32 message identifier |
wparam | The w win32 parameter |
lparam | The l win32 parameter |
Definition at line 343 of file corewindow.c.
References BROWSER_MOUSE_CLICK_1, BROWSER_MOUSE_CLICK_2, BROWSER_MOUSE_PRESS_1, BROWSER_MOUSE_PRESS_2, nsw32_corewindow_close(), nsw32_corewindow_hscroll(), nsw32_corewindow_mousedown(), nsw32_corewindow_mouseup(), nsw32_corewindow_paint(), nsw32_corewindow_vscroll(), and update_scrollbars().
Referenced by nsw32_create_corewindow_class().
|
static |
update the scrollbar visibility and size
Definition at line 57 of file corewindow.c.
References nsw32_corewindow::content_height, nsw32_corewindow::content_width, and nsw32_corewindow::hWnd.
Referenced by nsw32_cw_update_size(), and nsw32_window_corewindow_event_callback().
struct core_window_table nsw32_cw_cb_table |
Definition at line 506 of file corewindow.c.
struct core_window_table* win32_core_window_table = &nsw32_cw_cb_table |
Definition at line 515 of file corewindow.c.
Referenced by WinMain().
|
static |
Definition at line 51 of file corewindow.c.
Referenced by nsw32_corewindow_init(), and nsw32_create_corewindow_class().