gui_window_2 var should be gwin for consistency

This commit is contained in:
Chris Young 2013-01-03 19:32:21 +00:00
parent 625012a869
commit dfc2fe6f97
1 changed files with 46 additions and 48 deletions

View File

@ -3745,87 +3745,85 @@ void gui_window_update_box(struct gui_window *g, const struct rect *rect)
rect->x1, rect->y1); rect->x1, rect->y1);
} }
void ami_do_redraw(struct gui_window_2 *g) void ami_do_redraw(struct gui_window_2 *gwin)
{ {
struct Region *reg = NULL; struct Region *reg = NULL;
struct Rectangle rect; struct Rectangle rect;
hlcache_handle *c; hlcache_handle *c;
ULONG hcurrent,vcurrent,xoffset,yoffset,width=800,height=600,x0=0,y0=0; ULONG hcurrent,vcurrent,xoffset,yoffset,width=800,height=600,x0=0,y0=0;
struct IBox *bbox; struct IBox *bbox;
ULONG oldh=g->oldh,oldv=g->oldv; ULONG oldh = gwin->oldh, oldv=gwin->oldv;
bool morescroll = false; bool morescroll = false;
struct RastPort *temprp; struct RastPort *temprp;
if(browser_window_redraw_ready(g->bw) == false) return; if(browser_window_redraw_ready(gwin->bw) == false) return;
GetAttr(SPACE_AreaBox, (Object *)g->objects[GID_BROWSER], (ULONG *)&bbox); GetAttr(SPACE_AreaBox, (Object *)gwin->objects[GID_BROWSER], (ULONG *)&bbox);
ami_get_hscroll_pos(g, (ULONG *)&hcurrent); ami_get_hscroll_pos(gwin, (ULONG *)&hcurrent);
ami_get_vscroll_pos(g, (ULONG *)&vcurrent); ami_get_vscroll_pos(gwin, (ULONG *)&vcurrent);
g->bw->window->scrollx = hcurrent; gwin->bw->window->scrollx = hcurrent;
g->bw->window->scrolly = vcurrent; gwin->bw->window->scrolly = vcurrent;
c = g->bw->current_content; c = gwin->bw->current_content;
width=bbox->Width; width=bbox->Width;
height=bbox->Height; height=bbox->Height;
xoffset=bbox->Left; xoffset=bbox->Left;
yoffset=bbox->Top; yoffset=bbox->Top;
if(g->bw->reformat_pending) if(gwin->bw->reformat_pending)
{ {
browser_window_reformat(g->bw,false,width,height); browser_window_reformat(gwin->bw, false, width, height);
g->bw->reformat_pending = false; gwin->bw->reformat_pending = false;
g->redraw_scroll = false; gwin->redraw_scroll = false;
} }
if(g->redraw_scroll) if(gwin->redraw_scroll)
{ {
if((abs(vcurrent-oldv) > height) || (abs(hcurrent-oldh) > width)) if((abs(vcurrent-oldv) > height) || (abs(hcurrent-oldh) > width))
g->redraw_scroll = false; gwin->redraw_scroll = false;
if(g->new_content) g->redraw_scroll = false; if(gwin->new_content) gwin->redraw_scroll = false;
//if(g->bw->scale != 1.0) g->redraw_scroll = false;
} }
if(g->redraw_scroll) if(gwin->redraw_scroll)
{ {
g->bw->window->c_h_temp = g->bw->window->c_h; gwin->bw->window->c_h_temp = gwin->bw->window->c_h;
gui_window_remove_caret(g->bw->window); gui_window_remove_caret(gwin->bw->window);
ScrollWindowRaster(g->win,hcurrent-oldh,vcurrent-oldv, ScrollWindowRaster(gwin->win, hcurrent - oldh, vcurrent - oldv,
xoffset, yoffset, xoffset + width - 1, yoffset + height - 1); xoffset, yoffset, xoffset + width - 1, yoffset + height - 1);
g->bw->window->c_h = g->bw->window->c_h_temp; gwin->bw->window->c_h = gwin->bw->window->c_h_temp;
if(vcurrent>oldv) /* Going down */ if(vcurrent>oldv) /* Going down */
{ {
ami_do_redraw_limits(g->bw->window, g->bw, ami_do_redraw_limits(gwin->bw->window, gwin->bw,
hcurrent, (height / g->bw->scale) + oldv - 1, hcurrent, (height / gwin->bw->scale) + oldv - 1,
hcurrent + (width / g->bw->scale), hcurrent + (width / gwin->bw->scale),
vcurrent + (height / g->bw->scale) + 1); vcurrent + (height / gwin->bw->scale) + 1);
} }
else if(vcurrent<oldv) /* Going up */ else if(vcurrent<oldv) /* Going up */
{ {
ami_do_redraw_limits(g->bw->window, g->bw, ami_do_redraw_limits(gwin->bw->window, gwin->bw,
hcurrent, vcurrent, hcurrent, vcurrent,
hcurrent + (width / g->bw->scale), hcurrent + (width / gwin->bw->scale),
oldv); oldv);
} }
if(hcurrent>oldh) /* Going right */ if(hcurrent>oldh) /* Going right */
{ {
ami_do_redraw_limits(g->bw->window, g->bw, ami_do_redraw_limits(gwin->bw->window, gwin->bw,
(width / g->bw->scale) + oldh , vcurrent, (width / gwin->bw->scale) + oldh , vcurrent,
hcurrent + (width / g->bw->scale), hcurrent + (width / gwin->bw->scale),
vcurrent + (height / g->bw->scale)); vcurrent + (height / gwin->bw->scale));
} }
else if(hcurrent<oldh) /* Going left */ else if(hcurrent<oldh) /* Going left */
{ {
ami_do_redraw_limits(g->bw->window, g->bw, ami_do_redraw_limits(gwin->bw->window, gwin->bw,
hcurrent, vcurrent, hcurrent, vcurrent,
oldh, vcurrent + (height / g->bw->scale)); oldh, vcurrent + (height / gwin->bw->scale));
} }
} }
else else
@ -3841,41 +3839,41 @@ void ami_do_redraw(struct gui_window_2 *g)
if(nsoption_bool(direct_render) == false) if(nsoption_bool(direct_render) == false)
{ {
ami_do_redraw_tiled(g, hcurrent, vcurrent, width, height, hcurrent, vcurrent, bbox, &ctx); ami_do_redraw_tiled(gwin, hcurrent, vcurrent, width, height, hcurrent, vcurrent, bbox, &ctx);
} }
else else
{ {
browserglob.shared_pens = &g->shared_pens; browserglob.shared_pens = &gwin->shared_pens;
temprp = browserglob.rp; temprp = browserglob.rp;
browserglob.rp = g->win->RPort; browserglob.rp = gwin->win->RPort;
clip.x0 = bbox->Left; clip.x0 = bbox->Left;
clip.y0 = bbox->Top; clip.y0 = bbox->Top;
clip.x1 = bbox->Left + bbox->Width; clip.x1 = bbox->Left + bbox->Width;
clip.y1 = bbox->Top + bbox->Height; clip.y1 = bbox->Top + bbox->Height;
SetWindowPointer(g->win, SetWindowPointer(gwin->win,
WA_BusyPointer, TRUE, WA_BusyPointer, TRUE,
WA_PointerDelay, TRUE, WA_PointerDelay, TRUE,
TAG_DONE); TAG_DONE);
if(browser_window_redraw(g->bw, clip.x0 - hcurrent, clip.y0 - vcurrent, &clip, &ctx)) if(browser_window_redraw(gwin->bw, clip.x0 - hcurrent, clip.y0 - vcurrent, &clip, &ctx))
{ {
ami_clearclipreg(&browserglob); ami_clearclipreg(&browserglob);
browserglob.rp = temprp; browserglob.rp = temprp;
} }
SetWindowPointer(g->win, TAG_DONE); SetWindowPointer(gwin->win, TAG_DONE);
} }
} }
ami_update_buttons(g); ami_update_buttons(gwin);
g->oldh = hcurrent; gwin->oldh = hcurrent;
g->oldv = vcurrent; gwin->oldv = vcurrent;
g->redraw_scroll = false; gwin->redraw_scroll = false;
g->redraw_required = false; gwin->redraw_required = false;
g->new_content = false; gwin->new_content = false;
} }
void ami_refresh_window(struct gui_window_2 *gwin) void ami_refresh_window(struct gui_window_2 *gwin)