Core window: Constify the core_window handle through the getters.

This commit is contained in:
Michael Drake 2020-02-22 16:31:24 +00:00
parent e87bc1bfda
commit 194dfad4a5
7 changed files with 19 additions and 14 deletions

View File

@ -826,7 +826,8 @@ ami_cw_invalidate_area(struct core_window *cw, const struct rect *r)
static nserror
ami_cw_get_window_dimensions(struct core_window *cw, int *width, int *height)
ami_cw_get_window_dimensions(const struct core_window *cw,
int *width, int *height)
{
struct ami_corewindow *ami_cw = (struct ami_corewindow *)cw;
@ -867,7 +868,7 @@ ami_cw_update_size(struct core_window *cw, int width, int height)
static nserror
ami_cw_get_scroll(struct core_window *cw, int *x, int *y)
ami_cw_get_scroll(const struct core_window *cw, int *x, int *y)
{
struct ami_corewindow *ami_cw = (struct ami_corewindow *)cw;
ULONG win_x0, win_y0;

View File

@ -484,7 +484,7 @@ atari_treeview_set_scroll(struct core_window *cw, int x, int y)
}
static nserror
atari_treeview_get_scroll(struct core_window *cw, int *x, int *y)
atari_treeview_get_scroll(const struct core_window *cw, int *x, int *y)
{
/* TODO */
return NSERROR_NOT_IMPLEMENTED;
@ -499,7 +499,7 @@ atari_treeview_get_scroll(struct core_window *cw, int *x, int *y)
* \param height to be set to viewport height in px, if non NULL
*/
static nserror
atari_treeview_get_window_dimensions(struct core_window *cw,
atari_treeview_get_window_dimensions(const struct core_window *cw,
int *width,
int *height)
{

View File

@ -160,7 +160,7 @@ fb_cw_set_scroll(struct core_window *cw, int x, int y)
static nserror
fb_cw_get_scroll(struct core_window *cw, int *x, int *y)
fb_cw_get_scroll(const struct core_window *cw, int *x, int *y)
{
/* struct fb_corewindow *fb_cw = (struct fb_corewindow *)cw;
@ -171,7 +171,8 @@ fb_cw_get_scroll(struct core_window *cw, int *x, int *y)
static nserror
fb_cw_get_window_dimensions(struct core_window *cw, int *width, int *height)
fb_cw_get_window_dimensions(const struct core_window *cw,
int *width, int *height)
{
struct fb_corewindow *fb_cw = (struct fb_corewindow *)cw;

View File

@ -633,7 +633,7 @@ nsgtk_cw_set_scroll(struct core_window *cw, int x, int y)
* \param r rectangle that needs scrolling.
*/
static nserror
nsgtk_cw_get_scroll(struct core_window *cw, int *x, int *y)
nsgtk_cw_get_scroll(const struct core_window *cw, int *x, int *y)
{
struct nsgtk_corewindow *nsgtk_cw = (struct nsgtk_corewindow *)cw;
GtkAdjustment *vadj;
@ -660,7 +660,8 @@ nsgtk_cw_get_scroll(struct core_window *cw, int *x, int *y)
* \param[out] height to be set to viewport height in px
*/
static nserror
nsgtk_cw_get_window_dimensions(struct core_window *cw, int *width, int *height)
nsgtk_cw_get_window_dimensions(const struct core_window *cw,
int *width, int *height)
{
struct nsgtk_corewindow *nsgtk_cw = (struct nsgtk_corewindow *)cw;
GtkAdjustment *vadj;

View File

@ -832,7 +832,7 @@ ro_cw_update_size(struct core_window *cw, int width, int height)
* Callback from the core to scroll the visible content.
*/
static nserror
ro_cw_get_scroll(struct core_window *cw, int *x, int *y)
ro_cw_get_scroll(const struct core_window *cw, int *x, int *y)
{
struct ro_corewindow *ro_cw = (struct ro_corewindow *)cw;
wimp_window_state state = {
@ -888,7 +888,8 @@ ro_cw_set_scroll(struct core_window *cw, int x, int y)
* \param[out] height to be set to viewport height in px
*/
static nserror
ro_cw_get_window_dimensions(struct core_window *cw, int *width, int *height)
ro_cw_get_window_dimensions(const struct core_window *cw,
int *width, int *height)
{
struct ro_corewindow *ro_cw = (struct ro_corewindow *)cw;
os_error *error;

View File

@ -466,7 +466,7 @@ nsw32_cw_set_scroll(struct core_window *cw, int x, int y)
static nserror
nsw32_cw_get_scroll(struct core_window *cw, int *x, int *y)
nsw32_cw_get_scroll(const struct core_window *cw, int *x, int *y)
{
/** /todo call getscroll apropriately */
return NSERROR_NOT_IMPLEMENTED;
@ -481,7 +481,8 @@ nsw32_cw_get_scroll(struct core_window *cw, int *x, int *y)
* \param[out] height to be set to viewport height in px
*/
static nserror
nsw32_cw_get_window_dimensions(struct core_window *cw, int *width, int *height)
nsw32_cw_get_window_dimensions(const struct core_window *cw,
int *width, int *height)
{
struct nsw32_corewindow *nsw32_cw = (struct nsw32_corewindow *)cw;

View File

@ -100,7 +100,7 @@ struct core_window_callback_table {
* \param[out] returns vertical scroll in px
* \return NSERROR_OK on success or appropriate error code
*/
nserror (*get_scroll)(struct core_window *cw, int *x, int *y);
nserror (*get_scroll)(const struct core_window *cw, int *x, int *y);
/**
* Get window viewport dimensions
@ -110,7 +110,7 @@ struct core_window_callback_table {
* \param[out] height to be set to viewport height in px
* \return NSERROR_OK on success or appropriate error code
*/
nserror (*get_window_dimensions)(struct core_window *cw,
nserror (*get_window_dimensions)(const struct core_window *cw,
int *width, int *height);
/**