mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-23 04:26:50 +03:00
Remove gui_window_position_frame() definition from core and remove all implementations from front ends.
svn path=/trunk/netsurf/; revision=12711
This commit is contained in:
parent
bd94e21aed
commit
5be6bd452d
@ -3545,14 +3545,6 @@ void gui_window_scroll_visible(struct gui_window *g, int x0, int y0,
|
||||
gui_window_set_scroll(g, x0, y0);
|
||||
}
|
||||
|
||||
void gui_window_position_frame(struct gui_window *g, int x0, int y0,
|
||||
int x1, int y1)
|
||||
{
|
||||
if(!g) return;
|
||||
|
||||
ChangeWindowBox(g->shared->win,x0,y0,x1-x0,y1-y0);
|
||||
}
|
||||
|
||||
void gui_window_get_dimensions(struct gui_window *g, int *width, int *height,
|
||||
bool scaled)
|
||||
{
|
||||
|
13
atari/gui.c
13
atari/gui.c
@ -375,19 +375,6 @@ void gui_window_scroll_visible(struct gui_window *w, int x0, int y0, int x1, int
|
||||
browser_schedule_redraw_rect( w, 0, 0, x1-x0,y1-y0);
|
||||
}
|
||||
|
||||
void gui_window_position_frame(struct gui_window *gw, int x0, int y0, int x1, int y1)
|
||||
{
|
||||
TODO();
|
||||
struct browser_window * bw = gw->browser->bw;
|
||||
LGRECT pardim;
|
||||
int width = x1 - x0 + 2, height = y1 - y0 + 2;
|
||||
/* get available width/height: */
|
||||
if( gw ) {
|
||||
browser_get_rect( gw, BR_CONTENT, &pardim );
|
||||
LOG(("posframe %s: x0,y0: %d/%d, x1,y1: %d/%d, w: %d, h: %d \n",gw->browser->bw->name, x0,y0, x1,y1, width, height));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* It seems this method is called when content size got adjusted,
|
||||
so that we can adjust scroll info. We also have to call it when tab
|
||||
|
@ -591,65 +591,6 @@ void gui_window_scroll_visible(struct gui_window *g, int x0, int y0,
|
||||
gui_window_set_scroll(g, x0, y0);
|
||||
}
|
||||
|
||||
void gui_window_position_frame(struct gui_window *g, int x0, int y0, int x1, int y1)
|
||||
{
|
||||
CALLED();
|
||||
|
||||
/* g is a child frame, we need to place it relative to its parent */
|
||||
#warning XXX: BScrollView ?
|
||||
BView *view = g->view;
|
||||
BView *parent = g->bw->parent->window->view;
|
||||
assert(view);
|
||||
assert(parent);
|
||||
LOG(("%s: %d,%d %dx%d", g->bw->name, x0, y0, x1-x0+2, y1-y0+2));
|
||||
|
||||
/* if the window has not changed position or size, do not bother
|
||||
* moving/resising it.
|
||||
*/
|
||||
|
||||
if (!parent->LockLooper())
|
||||
return;
|
||||
|
||||
LOG((" current: %d,%d %dx%d",
|
||||
view->Frame().left, view->Frame().top,
|
||||
view->Frame().Width() + 1, view->Frame().Height() + 1));
|
||||
|
||||
if (view->Frame().left != x0 || view->Frame().top != y0 ||
|
||||
view->Frame().Width() + 1 != x1 - x0 + 2 ||
|
||||
view->Frame().Height() + 1 != y1 - y0 + 2) {
|
||||
LOG((" frame has moved/resized."));
|
||||
view->MoveTo(x0, y0);
|
||||
view->ResizeTo(x1 - x0 + 2 - 1, y1 - y0 + 2 - 1);
|
||||
}
|
||||
|
||||
parent->UnlockLooper();
|
||||
#warning WRITEME
|
||||
#if 0 /* GTK */
|
||||
/* g is a child frame, we need to place it relative to its parent */
|
||||
GtkWidget *w = GTK_WIDGET(g->scrolledwindow);
|
||||
GtkFixed *f = g->bw->parent->window->fixed;
|
||||
assert(w);
|
||||
assert(f);
|
||||
LOG(("%s: %d,%d %dx%d", g->bw->name, x0, y0, x1-x0+2, y1-y0+2));
|
||||
|
||||
/* if the window has not changed position or size, do not bother
|
||||
* moving/resising it.
|
||||
*/
|
||||
|
||||
LOG((" current: %d,%d %dx%d",
|
||||
w->allocation.x, w->allocation.y,
|
||||
w->allocation.width, w->allocation.height));
|
||||
|
||||
if (w->allocation.x != x0 || w->allocation.y != y0 ||
|
||||
w->allocation.width != x1 - x0 + 2 ||
|
||||
w->allocation.height != y1 - y0 + 2) {
|
||||
LOG((" frame has moved/resized."));
|
||||
gtk_fixed_move(f, w, x0, y0);
|
||||
gtk_widget_set_size_request(w, x1 - x0 + 2, y1 - y0 + 2);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void nsbeos_dispatch_event(BMessage *message)
|
||||
{
|
||||
struct gui_window *gui = NULL;
|
||||
|
@ -163,13 +163,6 @@ void gui_window_scroll_visible(struct gui_window *g, int x0, int y0,
|
||||
gui_window_set_scroll( g, x0, y0 );
|
||||
}
|
||||
|
||||
void gui_window_position_frame(struct gui_window *g, int x0, int y0,
|
||||
int x1, int y1)
|
||||
{
|
||||
const NSRect rect = cocoa_rect( x0, y0, x1, y1 );
|
||||
[[(BrowserViewController *)g view] setFrame: rect];
|
||||
}
|
||||
|
||||
void gui_window_get_dimensions(struct gui_window *g, int *width, int *height,
|
||||
bool scaled)
|
||||
{
|
||||
|
@ -87,8 +87,6 @@ bool gui_window_get_scroll(struct gui_window *g, int *sx, int *sy);
|
||||
void gui_window_set_scroll(struct gui_window *g, int sx, int sy);
|
||||
void gui_window_scroll_visible(struct gui_window *g, int x0, int y0,
|
||||
int x1, int y1);
|
||||
void gui_window_position_frame(struct gui_window *g, int x0, int y0,
|
||||
int x1, int y1);
|
||||
void gui_window_get_dimensions(struct gui_window *g, int *width, int *height,
|
||||
bool scaled);
|
||||
void gui_window_update_extent(struct gui_window *g);
|
||||
|
@ -1355,34 +1355,6 @@ gui_window_scroll_visible(struct gui_window *g, int x0, int y0,
|
||||
LOG(("%s:(%p, %d, %d, %d, %d)", __func__, g, x0, y0, x1, y1));
|
||||
}
|
||||
|
||||
void
|
||||
gui_window_position_frame(struct gui_window *g, int x0, int y0, int x1, int y1)
|
||||
{
|
||||
struct gui_window *parent;
|
||||
int px, py;
|
||||
int w, h;
|
||||
LOG(("%s: %d, %d, %d, %d", g->bw->name, x0, y0, x1, y1));
|
||||
parent = g->bw->parent->window;
|
||||
|
||||
if (parent->window == NULL)
|
||||
return; /* doesnt have an fbtk widget */
|
||||
|
||||
px = fbtk_get_absx(parent->browser) + x0;
|
||||
py = fbtk_get_absy(parent->browser) + y0;
|
||||
w = x1 - x0;
|
||||
h = y1 - y0;
|
||||
if (w > (fbtk_get_width(parent->browser) - px))
|
||||
w = fbtk_get_width(parent->browser) - px;
|
||||
|
||||
if (h > (fbtk_get_height(parent->browser) - py))
|
||||
h = fbtk_get_height(parent->browser) - py;
|
||||
|
||||
fbtk_set_pos_and_size(g->window, px, py , w , h);
|
||||
|
||||
fbtk_request_redraw(parent->browser);
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
gui_window_get_dimensions(struct gui_window *g,
|
||||
int *width,
|
||||
|
37
gtk/window.c
37
gtk/window.c
@ -690,43 +690,6 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
|
||||
}
|
||||
|
||||
|
||||
void gui_window_position_frame(struct gui_window *g, int x0, int y0, int x1, int y1)
|
||||
{
|
||||
/* g is a child frame, we need to place it relative to its parent */
|
||||
GtkWidget *w = GTK_WIDGET(g->scrolledwindow);
|
||||
GtkLayout *f = g->bw->parent->window->layout;
|
||||
int width = x1 - x0 + 2, height = y1 - y0 + 2;
|
||||
assert(w);
|
||||
assert(f);
|
||||
|
||||
if (width < 1)
|
||||
width = 1;
|
||||
if (height < 1)
|
||||
height = 1;
|
||||
|
||||
LOG(("%s: %d,%d %dx%d", g->bw->name, x0, y0, width, height));
|
||||
|
||||
/* if the window has not changed position or size, do not bother
|
||||
* moving/resising it.
|
||||
*/
|
||||
|
||||
LOG((" current: %d,%d %dx%d",
|
||||
w->allocation.x, w->allocation.y,
|
||||
w->allocation.width, w->allocation.height));
|
||||
|
||||
if (w->allocation.x != x0 || w->allocation.y != y0 ||
|
||||
w->allocation.width != width ||
|
||||
w->allocation.height != height) {
|
||||
LOG((" frame has moved/resized."));
|
||||
gtk_layout_move(f, w, x0, y0);
|
||||
gtk_widget_set_size_request(w, width, height);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void nsgtk_reflow_all_windows(void)
|
||||
{
|
||||
|
@ -305,14 +305,6 @@ gui_window_scroll_start(struct gui_window *g)
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
gui_window_position_frame(struct gui_window *g, int x0, int y0,
|
||||
int x1, int y1)
|
||||
{
|
||||
fprintf(stdout, "WINDOW POSITION_FRAME WIN %u X0 %d Y0 %d X1 %d Y1 %d\n",
|
||||
g->win_num, x0, y0, x1, y1);
|
||||
}
|
||||
|
||||
bool
|
||||
gui_window_frame_resize_start(struct gui_window *g)
|
||||
{
|
||||
|
@ -895,98 +895,6 @@ void gui_window_scroll_visible(struct gui_window *g, int x0, int y0, int x1, int
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Opens a frame at a specified position.
|
||||
*
|
||||
* \param g child gui_window to open
|
||||
* \param x0 left point to open at
|
||||
* \param y0 bottom point to open at
|
||||
* \param x1 right point to open at
|
||||
* \param y1 top point to open at
|
||||
*/
|
||||
void gui_window_position_frame(struct gui_window *g, int x0, int y0, int x1, int y1)
|
||||
{
|
||||
wimp_window_state state;
|
||||
os_error *error;
|
||||
int px0, py1;
|
||||
struct browser_window *bw;
|
||||
struct browser_window *parent;
|
||||
struct browser_window *top;
|
||||
float scale = 1.0;
|
||||
|
||||
assert(g);
|
||||
bw = g->bw;
|
||||
assert(bw);
|
||||
parent = bw->parent;
|
||||
assert(parent);
|
||||
top = browser_window_owner(bw);
|
||||
|
||||
/* store position for children */
|
||||
if (parent->browser_window_type == BROWSER_WINDOW_IFRAME) {
|
||||
assert(0);
|
||||
} else {
|
||||
bw->x0 = x0 = parent->x0 + x0;
|
||||
bw->y0 = y0 = parent->y0 + y0;
|
||||
bw->x1 = x1 = parent->x0 + x1;
|
||||
bw->y1 = y1 = parent->y0 + y1;
|
||||
}
|
||||
|
||||
/* only scale iframe locations */
|
||||
if (bw->browser_window_type == BROWSER_WINDOW_IFRAME) {
|
||||
assert(0);
|
||||
}
|
||||
|
||||
/* get the position of the top level window */
|
||||
state.w = top->window->window;
|
||||
error = xwimp_get_window_state(&state);
|
||||
if (error) {
|
||||
LOG(("xwimp_get_window_state: 0x%x: %s",
|
||||
error->errnum, error->errmess));
|
||||
warn_user("WimpError", error->errmess);
|
||||
return;
|
||||
}
|
||||
px0 = state.visible.x0 - state.xscroll;
|
||||
py1 = state.visible.y1 - state.yscroll;
|
||||
|
||||
/* get our current window state */
|
||||
state.w = g->window;
|
||||
error = xwimp_get_window_state(&state);
|
||||
if (error) {
|
||||
LOG(("xwimp_get_window_state: 0x%x: %s",
|
||||
error->errnum, error->errmess));
|
||||
warn_user("WimpError", error->errmess);
|
||||
return;
|
||||
}
|
||||
if (!g->bw->border) {
|
||||
x0 -= 1;
|
||||
y0 -= 1;
|
||||
x1 += 1;
|
||||
y1 += 1;
|
||||
}
|
||||
|
||||
x1 = x1 * 2 * scale;
|
||||
y1 = y1 * 2 * scale;
|
||||
|
||||
/* scrollbars must go inside */
|
||||
if (state.flags & wimp_WINDOW_HSCROLL) {
|
||||
y1 -= ro_get_hscroll_height(NULL);
|
||||
if (g->bw->border)
|
||||
y1 += 2;
|
||||
}
|
||||
if (state.flags & wimp_WINDOW_VSCROLL) {
|
||||
x1 -= ro_get_vscroll_width(NULL);
|
||||
if (g->bw->border)
|
||||
x1 += 2;
|
||||
}
|
||||
state.visible.x0 = px0 + x0 * 2 * scale;
|
||||
state.visible.y0 = py1 - y1;
|
||||
state.visible.x1 = px0 + x1;
|
||||
state.visible.y1 = py1 - y0 * 2 * scale;
|
||||
g->update_extent = true;
|
||||
ro_gui_window_open(PTR_WIMP_OPEN(&state));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Find the current dimensions of a browser window's content area.
|
||||
*
|
||||
|
@ -1524,16 +1524,6 @@ void gui_window_scroll_visible(struct gui_window *w, int x0, int y0,
|
||||
LOG(("scroll visible (%p, %d, %d, %d, %d)", w, x0, y0, x1, y1));
|
||||
}
|
||||
|
||||
void gui_window_position_frame(struct gui_window *w, int x0, int y0,
|
||||
int x1, int y1)
|
||||
{
|
||||
if (w == NULL)
|
||||
return;
|
||||
LOG(("position frame %s: %d, %d, %d, %d", w->bw->name,
|
||||
x0, y0, x1, y1));
|
||||
MoveWindow(w->drawingarea, x0, y0, x1-x0, y1-y0, true);
|
||||
}
|
||||
|
||||
void gui_window_get_dimensions(struct gui_window *w, int *width, int *height,
|
||||
bool scaled)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user