remove scaled parameter from get_dimensions

This commit is contained in:
Vincent Sanders 2019-08-02 12:25:35 +01:00
parent 4ae27a6592
commit 552aab42e1
10 changed files with 23 additions and 63 deletions

View File

@ -1168,7 +1168,7 @@ static void scheduled_reformat(void *vbw)
int height;
nserror res;
res = guit->window->get_dimensions(bw->window, &width, &height, false);
res = guit->window->get_dimensions(bw->window, &width, &height);
if (res == NSERROR_OK) {
browser_window_reformat(bw, false, width, height);
}
@ -2652,7 +2652,7 @@ browser_window_get_dimensions(struct browser_window *bw,
res = NSERROR_OK;
} else {
/* Front end window */
res = guit->window->get_dimensions(bw->window, width, height, false);
res = guit->window->get_dimensions(bw->window, width, height);
}
return res;
}

View File

@ -2076,14 +2076,17 @@ static void ami_gui_menu_update_all(void)
* \return NSERROR_OK on sucess and width and height updated
* else error code.
*/
static nserror gui_window_get_dimensions(struct gui_window *gw,
int *restrict width, int *restrict height, bool scaled)
static nserror
gui_window_get_dimensions(struct gui_window *gw,
int *restrict width,
int *restrict height)
{
struct IBox *bbox;
nserror res;
res = ami_gui_get_space_box((Object *)gw->shared->objects[GID_BROWSER], &bbox);
if(res != NSERROR_OK) {
res = ami_gui_get_space_box((Object *)gw->shared->objects[GID_BROWSER],
&bbox);
if (res != NSERROR_OK) {
amiga_warn_user("NoMemory", "");
return res;
}
@ -2093,11 +2096,6 @@ static nserror gui_window_get_dimensions(struct gui_window *gw,
ami_gui_free_space_box(bbox);
if(scaled) {
*width /= gw->scale;
*height /= gw->scale;
}
return NSERROR_OK;
}

View File

@ -299,15 +299,11 @@ void gui_window_destroy(struct gui_window *gw)
* \param gw The gui window to measure content area of.
* \param width receives width of window
* \param height receives height of window
* \param scaled whether to return scaled values
* \return NSERROR_OK on sucess and width and height updated
* else error code.
*/
static nserror
gui_window_get_dimensions(struct gui_window *gw,
int *width,
int *height,
bool scaled)
gui_window_get_dimensions(struct gui_window *gw, int *width, int *height)
{
GRECT rect;
window_get_grect(gw->root, BROWSER_AREA_CONTENT, &rect);

View File

@ -1341,24 +1341,17 @@ struct gui_clipboard_table *beos_clipboard_table = &clipboard_table;
* \param g The gui window to measure content area of.
* \param width receives width of window
* \param height receives height of window
* \param scaled whether to return scaled values
* \return NSERROR_OK on sucess and width and height updated
* else error code.
*/
static nserror
gui_window_get_dimensions(struct gui_window *g, int *width, int *height,
bool scaled)
gui_window_get_dimensions(struct gui_window *g, int *width, int *height)
{
if (g->view &&
g->view->LockLooper()) {
*width = g->view->Bounds().Width() + 1;
*height = g->view->Bounds().Height() + 1;
g->view->UnlockLooper();
if (scaled) {
*width /= g->scale;
*height /= g->scale;
}
}
return NSERROR_OK;
}

View File

@ -1881,23 +1881,14 @@ gui_window_set_scroll(struct gui_window *gw, const struct rect *rect)
* \param gw The gui window to measure content area of.
* \param width receives width of window
* \param height receives height of window
* \param scaled whether to return scaled values
* \return NSERROR_OK on sucess and width and height updated.
*/
static nserror
gui_window_get_dimensions(struct gui_window *gw,
int *width,
int *height,
bool scaled)
gui_window_get_dimensions(struct gui_window *gw, int *width, int *height)
{
*width = fbtk_get_width(gw->browser);
*height = fbtk_get_height(gw->browser);
if (scaled) {
float scale = browser_window_get_scale(gw->bw);
*width /= scale;
*height /= scale;
}
return NSERROR_OK;
}

View File

@ -1213,14 +1213,11 @@ static void gui_window_place_caret(struct gui_window *g, int x, int y, int heigh
* \param gw The gui window to measure content area of.
* \param width receives width of window
* \param height receives height of window
* \param scaled whether to return scaled values
* \return NSERROR_OK on sucess and width and height updated
* else error code.
*/
static nserror
gui_window_get_dimensions(struct gui_window *gw,
int *width, int *height,
bool scaled)
gui_window_get_dimensions(struct gui_window *gw, int *width, int *height)
{
GtkAllocation alloc;
@ -1230,12 +1227,6 @@ gui_window_get_dimensions(struct gui_window *gw,
*width = alloc.width;
*height = alloc.height;
if (scaled) {
float scale = browser_window_get_scale(gw->bw);
*width /= scale;
*height /= scale;
}
return NSERROR_OK;
}

View File

@ -119,18 +119,18 @@ gui_window_set_title(struct gui_window *g, const char *title)
* \param g The gui window to measure content area of.
* \param width receives width of window
* \param height receives height of window
* \param scaled whether to return scaled values
* \return NSERROR_OK on sucess and width and height updated.
*/
static nserror
gui_window_get_dimensions(struct gui_window *g, int *width, int *height,
bool scaled)
gui_window_get_dimensions(struct gui_window *g, int *width, int *height)
{
moutf(MOUT_WINDOW, "GET_DIMENSIONS WIN %u WIDTH %d HEIGHT %d",
g->win_num, g->width, g->height);
*width = g->width;
*height = g->height;
moutf(MOUT_WINDOW,
"GET_DIMENSIONS WIN %u WIDTH %d HEIGHT %d",
g->win_num, *width, *height);
return NSERROR_OK;
}

View File

@ -3679,21 +3679,15 @@ gui_window_set_scroll(struct gui_window *g, const struct rect *rect)
* \param gw gui window to measure
* \param width receives width of window
* \param height receives height of window
* \param scaled whether to return scaled values
* \return NSERROR_OK and width and height updated
*/
static nserror
gui_window_get_dimensions(struct gui_window *gw,
int *width, int *height,
bool scaled)
gui_window_get_dimensions(struct gui_window *gw, int *width, int *height)
{
/* use the cached window sizes */
*width = gw->old_width / 2;
*height = gw->old_height / 2;
if (scaled) {
*width /= gw->scale;
*height /= gw->scale;
}
return NSERROR_OK;
}

View File

@ -1522,12 +1522,10 @@ static void win32_window_destroy(struct gui_window *w)
* \param gw gui_window to measure
* \param width receives width of window
* \param height receives height of window
* \param scaled whether to return scaled values
* \return NSERROR_OK and width and height updated
*/
static nserror
win32_window_get_dimensions(struct gui_window *gw,
int *width, int *height,
bool scaled)
win32_window_get_dimensions(struct gui_window *gw, int *width, int *height)
{
*width = gw->width;
*height = gw->height;

View File

@ -175,11 +175,10 @@ struct gui_window_table {
* \param gw The gui window to measure content area of.
* \param width receives width of window
* \param height receives height of window
* \param scaled whether to return scaled values
* \return NSERROR_OK on success and width and height updated
* else error code.
*/
nserror (*get_dimensions)(struct gui_window *gw, int *width, int *height, bool scaled);
nserror (*get_dimensions)(struct gui_window *gw, int *width, int *height);
/**