summaryrefslogtreecommitdiff
path: root/amiga
diff options
context:
space:
mode:
Diffstat (limited to 'amiga')
-rwxr-xr-xamiga/arexx.c5
-rwxr-xr-xamiga/clipboard.c128
-rw-r--r--amiga/download.c5
-rw-r--r--amiga/drag.c5
-rwxr-xr-xamiga/gui.c102
-rwxr-xr-xamiga/gui.h1
-rwxr-xr-xamiga/gui_options.c9
-rwxr-xr-xamiga/menu.c9
-rwxr-xr-xamiga/search.c11
-rw-r--r--amiga/theme.c43
-rw-r--r--amiga/theme.h7
-rwxr-xr-xamiga/tree.c6
12 files changed, 151 insertions, 180 deletions
diff --git a/amiga/arexx.c b/amiga/arexx.c
index c3279ad3d..7048c0673 100755
--- a/amiga/arexx.c
+++ b/amiga/arexx.c
@@ -275,7 +275,8 @@ STATIC VOID rx_save(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((unu
if(!bw) return;
- ami_update_pointer(bw->window->shared->win,GUI_POINTER_WAIT);
+ ami_set_pointer(bw->window->shared, GUI_POINTER_WAIT, false);
+
if(fh = FOpen((char *)cmd->ac_ArgList[0], MODE_NEWFILE, 0))
{
if(source_data = content_get_source_data(bw->current_content, &source_size))
@@ -285,7 +286,7 @@ STATIC VOID rx_save(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((unu
SetComment((char *)cmd->ac_ArgList[0], nsurl_access(hlcache_handle_get_url(bw->current_content)));
}
- ami_update_pointer(bw->window->shared->win,GUI_POINTER_DEFAULT);
+ ami_reset_pointer(bw->window->shared);
}
STATIC VOID rx_quit(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((unused)))
diff --git a/amiga/clipboard.c b/amiga/clipboard.c
index b24c2da65..018ea2604 100755
--- a/amiga/clipboard.c
+++ b/amiga/clipboard.c
@@ -137,7 +137,7 @@ bool ami_clipboard_check_for_utf8(struct IFFHandle *iffh) {
return utf8_chunk;
}
-void gui_paste_from_clipboard(struct gui_window *g, int x, int y)
+void gui_get_clipboard(char **buffer, size_t *length)
{
/* This and the other clipboard code is heavily based on the RKRM examples */
struct ContextNode *cn;
@@ -193,7 +193,7 @@ void gui_paste_from_clipboard(struct gui_window *g, int x, int y)
rlen, &clip);
}
- browser_window_paste_text(g->shared->bw,clip,rlen,true);
+ //browser_window_paste_text(g->shared->bw,clip,rlen,true);
}
if(rlen < 0) error = rlen;
}
@@ -202,7 +202,7 @@ void gui_paste_from_clipboard(struct gui_window *g, int x, int y)
{
while((rlen = ReadChunkBytes(iffh, readbuf, 1024)) > 0)
{
- browser_window_paste_text(g->shared->bw, readbuf, rlen, true);
+ //browser_window_paste_text(g->shared->bw, readbuf, rlen, true);
}
if(rlen < 0) error = rlen;
}
@@ -210,22 +210,24 @@ void gui_paste_from_clipboard(struct gui_window *g, int x, int y)
CloseIFF(iffh);
}
-bool gui_empty_clipboard(void)
+void gui_set_clipboard(const char *buffer, size_t length,
+ nsclipboard_styles styles[], int n_styles)
{
- /* Put a half-completed FTXT on the clipboard and leave it open for more additions */
-
+ char *text;
struct CSet cset = {0};
- if(!(OpenIFF(iffh,IFFF_WRITE)))
+ if(buffer == NULL) return;
+
+ if(!(OpenIFF(iffh, IFFF_WRITE)))
{
- if(!(PushChunk(iffh,ID_FTXT,ID_FORM,IFFSIZE_UNKNOWN)))
+ if(!(PushChunk(iffh, ID_FTXT, ID_FORM, IFFSIZE_UNKNOWN)))
{
if(nsoption_bool(utf8_clipboard))
{
- if(!(PushChunk(iffh,0,ID_CSET,32)))
+ if(!(PushChunk(iffh, 0, ID_CSET, 32)))
{
cset.CodeSet = 106; // UTF-8
- WriteChunkBytes(iffh,&cset,32);
+ WriteChunkBytes(iffh, &cset, 32);
PopChunk(iffh);
}
}
@@ -233,82 +235,39 @@ bool gui_empty_clipboard(void)
else
{
PopChunk(iffh);
- return false;
}
- return true;
- }
- return false;
-}
-
-bool gui_add_to_clipboard(const char *text, size_t length, bool space,
- const plot_font_style_t *fstyle)
-{
- /* This might crash or at least not work if gui_empty_clipboard isn't called first,
- and gui_commit_clipboard after.
- These only seem to be called from desktop/textinput.c in this specific order, if they
- are added elsewhere this might need a rewrite. */
-
- char *buffer;
-
- if(text == NULL) return true;
-
- if(!(PushChunk(iffh,0,ID_CHRS,IFFSIZE_UNKNOWN))) {
- if(nsoption_bool(utf8_clipboard)) {
- WriteChunkBytes(iffh,text,length);
- } else {
- if(utf8_to_local_encoding(text, length, &buffer) == UTF8_CONVERT_OK) {
- char *p;
- p = buffer;
-
- while(*p != '\0') {
- if(*p == 0xa0) *p = 0x20;
- p++;
+ if(!(PushChunk(iffh, 0, ID_CHRS, IFFSIZE_UNKNOWN))) {
+ if(nsoption_bool(utf8_clipboard)) {
+ WriteChunkBytes(iffh, buffer, length);
+ } else {
+ if(utf8_to_local_encoding(buffer, length, &text) == UTF8_CONVERT_OK) {
+ char *p;
+
+ p = text;
+
+ while(*p != '\0') {
+ if(*p == 0xa0) *p = 0x20;
+ p++;
+ }
+ WriteChunkBytes(iffh, text, strlen(text));
+ ami_utf8_free(text);
}
- WriteChunkBytes(iffh, buffer, strlen(buffer));
- ami_utf8_free(buffer);
}
- }
- if(space) WriteChunkBytes(iffh," ",1);
- PopChunk(iffh);
- } else {
- PopChunk(iffh);
- return false;
- }
+ PopChunk(iffh);
+ } else {
+ PopChunk(iffh);
+ }
- if(!(PushChunk(iffh, 0, ID_UTF8, IFFSIZE_UNKNOWN))) {
- WriteChunkBytes(iffh, text, length);
- if(space) WriteChunkBytes(iffh, " ", 1);
- PopChunk(iffh);
- } else {
- PopChunk(iffh);
- return false;
+ if(!(PushChunk(iffh, 0, ID_UTF8, IFFSIZE_UNKNOWN))) {
+ WriteChunkBytes(iffh, buffer, length);
+ PopChunk(iffh);
+ } else {
+ PopChunk(iffh);
+ }
+ CloseIFF(iffh);
}
-
- return true;
-}
-
-bool gui_commit_clipboard(void)
-{
- if(iffh) CloseIFF(iffh);
-
- return true;
-}
-
-bool gui_copy_to_clipboard(struct selection *s)
-{
- bool success;
-
- if(s->defined == false) return false;
- if(!gui_empty_clipboard()) return false;
-
- success = selection_copy_to_clipboard(s);
-
- /* commit regardless, otherwise we leave the clipboard in an unusable state */
- gui_commit_clipboard();
-
- return success;
}
struct ami_text_selection *ami_selection_to_text(struct gui_window_2 *gwin)
@@ -361,13 +320,14 @@ void ami_drag_selection(struct selection *s)
if(ami_text_box_at_point(gwin, (ULONG *)&x, (ULONG *)&y))
{
iffh = ami_clipboard_init_internal(1);
-
+#if 0
+/* TODO: fix this */
if(gui_copy_to_clipboard(s))
{
browser_window_mouse_click(gwin->bw, BROWSER_MOUSE_PRESS_1, x, y);
browser_window_key_press(gwin->bw, KEY_PASTE);
}
-
+#endif
ami_clipboard_free_internal(iffh);
iffh = old_iffh;
}
@@ -407,11 +367,7 @@ void ami_drag_selection(struct selection *s)
bool ami_easy_clipboard(char *text)
{
- if(!gui_empty_clipboard()) return false;
- if(!gui_add_to_clipboard(text,strlen(text),false,plot_style_font))
- return false;
- if(!gui_commit_clipboard()) return false;
-
+ gui_set_clipboard(text, strlen(text), NULL, 0);
return true;
}
diff --git a/amiga/download.c b/amiga/download.c
index c0c88bb0b..c49bd8554 100644
--- a/amiga/download.c
+++ b/amiga/download.c
@@ -356,7 +356,8 @@ gui_window_save_link(struct gui_window *g, const char *url, const char *title)
{
strlcpy(fname, savereq->fr_Drawer, 1024);
AddPart(fname,savereq->fr_File,1024);
- ami_update_pointer(g->shared->win,GUI_POINTER_WAIT);
+
+ ami_set_pointer(g->shared, GUI_POINTER_WAIT, false);
if(ami_download_check_overwrite(fname, g->shared->win, 0))
{
@@ -383,7 +384,7 @@ gui_window_save_link(struct gui_window *g, const char *url, const char *title)
}
FreeVec(linkname);
}
- ami_update_pointer(g->shared->win,GUI_POINTER_DEFAULT);
+ ami_reset_pointer(g->shared);
}
}
diff --git a/amiga/drag.c b/amiga/drag.c
index e19b27393..addc4b3cf 100644
--- a/amiga/drag.c
+++ b/amiga/drag.c
@@ -142,7 +142,7 @@ void ami_drag_save(struct Window *win)
return;
}
- ami_update_pointer(win,GUI_POINTER_WAIT);
+ ami_update_pointer(win, GUI_POINTER_WAIT);
switch(drag_save)
{
@@ -189,7 +189,8 @@ void ami_drag_save(struct Window *win)
drag_save = 0;
drag_save_data = NULL;
- ami_update_pointer(win,GUI_POINTER_DEFAULT);
+
+ ami_update_pointer(win, GUI_POINTER_DEFAULT);
}
void ami_drag_icon_show(struct Window *win, const char *type)
diff --git a/amiga/gui.c b/amiga/gui.c
index e1fc19d7f..43412704a 100755
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -1435,7 +1435,7 @@ void ami_handle_msg(void)
{
ami_context_menu_mouse_trap(gwin, FALSE);
- if(!gwin->mouse_state) ami_update_pointer(gwin->win,GUI_POINTER_DEFAULT);
+ if(!gwin->mouse_state) ami_set_pointer(gwin, GUI_POINTER_DEFAULT, true);
}
break;
@@ -3599,7 +3599,7 @@ void ami_do_redraw_tiled(struct gui_window_2 *gwin,
struct rect clip;
int tile_x_scale = (int)(nsoption_int(redraw_tile_size_x) / gwin->bw->scale);
int tile_y_scale = (int)(nsoption_int(redraw_tile_size_y) / gwin->bw->scale);
-
+
browserglob.shared_pens = &gwin->shared_pens;
if(top < 0) {
@@ -3632,6 +3632,8 @@ void ami_do_redraw_tiled(struct gui_window_2 *gwin,
// printf("%ld %ld %ld %ld\n",left, top, width, height);
+ ami_set_pointer(gwin, GUI_POINTER_WAIT, false);
+
for(y = top; y < (top + height); y += tile_y_scale) {
clip.y0 = 0;
clip.y1 = nsoption_int(redraw_tile_size_y);
@@ -3667,6 +3669,8 @@ void ami_do_redraw_tiled(struct gui_window_2 *gwin,
}
}
}
+
+ ami_reset_pointer(gwin);
}
@@ -3738,87 +3742,85 @@ void gui_window_update_box(struct gui_window *g, const struct rect *rect)
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 Rectangle rect;
hlcache_handle *c;
ULONG hcurrent,vcurrent,xoffset,yoffset,width=800,height=600,x0=0,y0=0;
struct IBox *bbox;
- ULONG oldh=g->oldh,oldv=g->oldv;
+ ULONG oldh = gwin->oldh, oldv=gwin->oldv;
bool morescroll = false;
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);
- ami_get_hscroll_pos(g, (ULONG *)&hcurrent);
- ami_get_vscroll_pos(g, (ULONG *)&vcurrent);
+ GetAttr(SPACE_AreaBox, (Object *)gwin->objects[GID_BROWSER], (ULONG *)&bbox);
+ ami_get_hscroll_pos(gwin, (ULONG *)&hcurrent);
+ ami_get_vscroll_pos(gwin, (ULONG *)&vcurrent);
- g->bw->window->scrollx = hcurrent;
- g->bw->window->scrolly = vcurrent;
+ gwin->bw->window->scrollx = hcurrent;
+ gwin->bw->window->scrolly = vcurrent;
- c = g->bw->current_content;
+ c = gwin->bw->current_content;
width=bbox->Width;
height=bbox->Height;
xoffset=bbox->Left;
yoffset=bbox->Top;
- if(g->bw->reformat_pending)
+ if(gwin->bw->reformat_pending)
{
- browser_window_reformat(g->bw,false,width,height);
- g->bw->reformat_pending = false;
- g->redraw_scroll = false;
+ browser_window_reformat(gwin->bw, false, width, height);
+ gwin->bw->reformat_pending = false;
+ gwin->redraw_scroll = false;
}
- if(g->redraw_scroll)
+ if(gwin->redraw_scroll)
{
if((abs(vcurrent-oldv) > height) || (abs(hcurrent-oldh) > width))
- g->redraw_scroll = false;
-
- if(g->new_content) g->redraw_scroll = false;
+ gwin->redraw_scroll = false;
- //if(g->bw->scale != 1.0) g->redraw_scroll = false;
+ if(gwin->new_content) gwin->redraw_scroll = false;
}
- if(g->redraw_scroll)
+ if(gwin->redraw_scroll)
{
- g->bw->window->c_h_temp = g->bw->window->c_h;
- gui_window_remove_caret(g->bw->window);
+ gwin->bw->window->c_h_temp = gwin->bw->window->c_h;
+ gui_window_remove_caret(gwin->bw->window);
- ScrollWindowRaster(g->win,hcurrent-oldh,vcurrent-oldv,
- xoffset,yoffset,xoffset+width-1,yoffset+height-1);
+ ScrollWindowRaster(gwin->win, hcurrent - oldh, vcurrent - oldv,
+ 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 */
{
- ami_do_redraw_limits(g->bw->window, g->bw,
- hcurrent, (height / g->bw->scale) + oldv - 1,
- hcurrent + (width / g->bw->scale),
- vcurrent + (height / g->bw->scale) + 1);
+ ami_do_redraw_limits(gwin->bw->window, gwin->bw,
+ hcurrent, (height / gwin->bw->scale) + oldv - 1,
+ hcurrent + (width / gwin->bw->scale),
+ vcurrent + (height / gwin->bw->scale) + 1);
}
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 + (width / g->bw->scale),
+ hcurrent + (width / gwin->bw->scale),
oldv);
}
if(hcurrent>oldh) /* Going right */
{
- ami_do_redraw_limits(g->bw->window, g->bw,
- (width / g->bw->scale) + oldh , vcurrent,
- hcurrent + (width / g->bw->scale),
- vcurrent + (height / g->bw->scale));
+ ami_do_redraw_limits(gwin->bw->window, gwin->bw,
+ (width / gwin->bw->scale) + oldh , vcurrent,
+ hcurrent + (width / gwin->bw->scale),
+ vcurrent + (height / gwin->bw->scale));
}
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,
- oldh, vcurrent + (height / g->bw->scale));
+ oldh, vcurrent + (height / gwin->bw->scale));
}
}
else
@@ -3834,34 +3836,38 @@ void ami_do_redraw(struct gui_window_2 *g)
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
{
- browserglob.shared_pens = &g->shared_pens;
+ browserglob.shared_pens = &gwin->shared_pens;
temprp = browserglob.rp;
- browserglob.rp = g->win->RPort;
+ browserglob.rp = gwin->win->RPort;
clip.x0 = bbox->Left;
clip.y0 = bbox->Top;
clip.x1 = bbox->Left + bbox->Width;
clip.y1 = bbox->Top + bbox->Height;
- if(browser_window_redraw(g->bw, clip.x0 - hcurrent, clip.y0 - vcurrent, &clip, &ctx))
+ ami_set_pointer(gwin, GUI_POINTER_WAIT, false);
+
+ if(browser_window_redraw(gwin->bw, clip.x0 - hcurrent, clip.y0 - vcurrent, &clip, &ctx))
{
ami_clearclipreg(&browserglob);
browserglob.rp = temprp;
}
+
+ ami_reset_pointer(gwin);
}
}
- ami_update_buttons(g);
+ ami_update_buttons(gwin);
- g->oldh = hcurrent;
- g->oldv = vcurrent;
+ gwin->oldh = hcurrent;
+ gwin->oldv = vcurrent;
- g->redraw_scroll = false;
- g->redraw_required = false;
- g->new_content = false;
+ gwin->redraw_scroll = false;
+ gwin->redraw_required = false;
+ gwin->new_content = false;
}
void ami_refresh_window(struct gui_window_2 *gwin)
diff --git a/amiga/gui.h b/amiga/gui.h
index 1dff5d3c0..ff467977a 100755
--- a/amiga/gui.h
+++ b/amiga/gui.h
@@ -120,6 +120,7 @@ struct gui_window_2 {
struct IBox *ptr_lock;
struct AppWindow *appwin;
struct MinList shared_pens;
+ gui_pointer_shape mouse_pointer;
};
struct gui_window
diff --git a/amiga/gui_options.c b/amiga/gui_options.c
index 66e47d8ad..e54ad15a6 100755
--- a/amiga/gui_options.c
+++ b/amiga/gui_options.c
@@ -1502,10 +1502,7 @@ void ami_gui_opts_use(bool save)
bool rescan_fonts = false;
bool old_tab_always_show;
- SetWindowPointer(gow->win,
- WA_BusyPointer, TRUE,
- WA_PointerDelay, TRUE,
- TAG_DONE);
+ ami_update_pointer(gow->win, GUI_POINTER_WAIT);
GetAttr(STRINGA_TextVal,gow->objects[GID_OPTS_HOMEPAGE],(ULONG *)&data);
nsoption_set_charp(homepage_url, (char *)strdup((char *)data));
@@ -1863,9 +1860,7 @@ void ami_gui_opts_use(bool save)
ami_menu_check_toggled = true;
- SetWindowPointer(gow->win,
- WA_Pointer, NULL,
- TAG_DONE);
+ ami_update_pointer(gow->win, GUI_POINTER_DEFAULT);
}
void ami_gui_opts_close(void)
diff --git a/amiga/menu.c b/amiga/menu.c
index 58a4d5115..496400dfb 100755
--- a/amiga/menu.c
+++ b/amiga/menu.c
@@ -341,7 +341,6 @@ void ami_init_menulabs(struct gui_window_2 *gwin)
gwin->menutype[41] = NM_ITEM;
gwin->menulab[41] = ami_utf8_easy((char *)messages_get("EnableJS"));
gwin->menu_hook[41].h_Entry = (HOOKFUNC)ami_menu_item_browser_enablejs;
- gwin->menukey[41] = 'J';
gwin->menutype[42] = NM_ITEM;
gwin->menulab[42] = NM_BARLABEL;
@@ -754,9 +753,9 @@ static void ami_menu_item_project_print(struct Hook *hook, APTR window, struct I
struct gui_window_2 *gwin;
GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin);
- ami_update_pointer(gwin->win,GUI_POINTER_WAIT);
+ ami_set_pointer(gwin, GUI_POINTER_WAIT, false);
ami_print_ui(gwin->bw->current_content);
- ami_update_pointer(gwin->win,GUI_POINTER_DEFAULT);
+ ami_reset_pointer(gwin);
}
static void ami_menu_item_project_about(struct Hook *hook, APTR window, struct IntuiMessage *msg)
@@ -767,7 +766,7 @@ static void ami_menu_item_project_about(struct Hook *hook, APTR window, struct I
GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin);
- ami_update_pointer(gwin->win,GUI_POINTER_WAIT);
+ ami_set_pointer(gwin, GUI_POINTER_WAIT, false);
temp = ASPrintf("%s|%s|%s", messages_get("OK"),
messages_get("HelpCredits"),
@@ -801,7 +800,7 @@ static void ami_menu_item_project_about(struct Hook *hook, APTR window, struct I
else if(sel == 0)
browser_window_create("about:licence", NULL, 0, true, false);
- ami_update_pointer(gwin->win,GUI_POINTER_DEFAULT);
+ ami_reset_pointer(gwin);
}
static void ami_menu_item_project_quit(struct Hook *hook, APTR window, struct IntuiMessage *msg)
diff --git a/amiga/search.c b/amiga/search.c
index 6f8ebd414..1148f6d77 100755
--- a/amiga/search.c
+++ b/amiga/search.c
@@ -36,9 +36,10 @@
#include "amiga/os3support.h"
#include "amiga/search.h"
#include "amiga/object.h"
+#include "amiga/theme.h"
+
#include <proto/intuition.h>
#include <proto/exec.h>
-
#include <proto/window.h>
#include <proto/layout.h>
#include <proto/string.h>
@@ -277,10 +278,10 @@ void ami_search_set_status(bool found, void *p)
void ami_search_set_hourglass(bool active, void *p)
{
- SetWindowPointer(fwin->win,
- WA_BusyPointer,active,
- WA_PointerDelay,active,
- TAG_DONE);
+ if(active)
+ ami_update_pointer(fwin->win, GUI_POINTER_WAIT);
+ else
+ ami_update_pointer(fwin->win, GUI_POINTER_DEFAULT);
}
/**
diff --git a/amiga/theme.c b/amiga/theme.c
index fce69eda3..65d2f51e1 100644
--- a/amiga/theme.c
+++ b/amiga/theme.c
@@ -48,7 +48,6 @@ struct bitmap *throbber_nsbm = NULL;
ULONG throbber_frames,throbber_update_interval;
static Object *mouseptrobj[AMI_LASTPOINTER+1];
static struct BitMap *mouseptrbm[AMI_LASTPOINTER+1];
-static int mouseptrcurrent=0;
char *ptrs[AMI_LASTPOINTER+1] = {
"ptr_default",
@@ -174,12 +173,24 @@ void ami_get_theme_filename(char *filename, char *themestring, bool protocol)
void gui_window_set_pointer(struct gui_window *g, gui_pointer_shape shape)
{
- ami_update_pointer(g->shared->win,shape);
+ ami_set_pointer(g->shared, shape, true);
+}
+
+void ami_set_pointer(struct gui_window_2 *gwin, gui_pointer_shape shape, bool update)
+{
+ if(gwin->mouse_pointer == shape) return;
+ ami_update_pointer(gwin->win, shape);
+ if(update == true) gwin->mouse_pointer = shape;
+}
+
+/* reset the mouse pointer back to what NetSurf last set it as */
+void ami_reset_pointer(struct gui_window_2 *gwin)
+{
+ ami_update_pointer(gwin->win, gwin->mouse_pointer);
}
void ami_update_pointer(struct Window *win, gui_pointer_shape shape)
{
- if(mouseptrcurrent == shape) return;
if(drag_save_data) return;
if(nsoption_bool(use_os_pointers))
@@ -187,24 +198,24 @@ void ami_update_pointer(struct Window *win, gui_pointer_shape shape)
switch(shape)
{
case GUI_POINTER_DEFAULT:
- SetWindowPointer(win,TAG_DONE);
+ SetWindowPointer(win, TAG_DONE);
break;
case GUI_POINTER_WAIT:
SetWindowPointer(win,
- WA_BusyPointer,TRUE,
- WA_PointerDelay,TRUE,
+ WA_BusyPointer, TRUE,
+ WA_PointerDelay, TRUE,
TAG_DONE);
break;
default:
if(mouseptrobj[shape])
{
- SetWindowPointer(win,WA_Pointer,mouseptrobj[shape],TAG_DONE);
+ SetWindowPointer(win, WA_Pointer, mouseptrobj[shape], TAG_DONE);
}
else
{
- SetWindowPointer(win,TAG_DONE);
+ SetWindowPointer(win, TAG_DONE);
}
break;
}
@@ -213,34 +224,28 @@ void ami_update_pointer(struct Window *win, gui_pointer_shape shape)
{
if(mouseptrobj[shape])
{
- SetWindowPointer(win,WA_Pointer,mouseptrobj[shape],TAG_DONE);
+ SetWindowPointer(win, WA_Pointer, mouseptrobj[shape], TAG_DONE);
}
else
{
if(shape == GUI_POINTER_WAIT)
{
SetWindowPointer(win,
- WA_BusyPointer,TRUE,
- WA_PointerDelay,TRUE,
+ WA_BusyPointer, TRUE,
+ WA_PointerDelay, TRUE,
TAG_DONE);
}
else
{
- SetWindowPointer(win,TAG_DONE);
+ SetWindowPointer(win, TAG_DONE);
}
}
}
-
- mouseptrcurrent = shape;
}
void gui_window_hide_pointer(struct gui_window *g)
{
- if(mouseptrcurrent != AMI_GUI_POINTER_BLANK)
- {
- SetWindowPointer(g->shared->win,WA_Pointer,mouseptrobj[AMI_GUI_POINTER_BLANK],TAG_DONE);
- mouseptrcurrent = AMI_GUI_POINTER_BLANK;
- }
+ ami_set_pointer(g->shared, AMI_GUI_POINTER_BLANK, true);
}
void ami_init_mouse_pointers(void)
diff --git a/amiga/theme.h b/amiga/theme.h
index ba1295d61..3c3931c12 100644
--- a/amiga/theme.h
+++ b/amiga/theme.h
@@ -35,5 +35,10 @@ void ami_update_throbber(struct gui_window_2 *g,bool redraw);
void ami_init_mouse_pointers(void);
void ami_mouse_pointers_free(void);
-void ami_update_pointer(struct Window *win, gui_pointer_shape shape);
+void ami_set_pointer(struct gui_window_2 *gwin, gui_pointer_shape shape, bool update);
+void ami_reset_pointer(struct gui_window_2 *gwin);
+/* Use the following ONLY if nothing other than the Intuition window pointer is available,
+ * and ALWAYS in preference to SetWindowPointer(), as it features more pointers and uses
+ * the correct ones specified in user preferences. */
+void ami_update_pointer(struct Window *win, gui_pointer_shape shape);
#endif
diff --git a/amiga/tree.c b/amiga/tree.c
index 95a68dc20..b19cd203e 100755
--- a/amiga/tree.c
+++ b/amiga/tree.c
@@ -991,12 +991,12 @@ BOOL ami_tree_event(struct treeview_window *twin)
{
strlcpy(fname,savereq->fr_Drawer,1024);
AddPart(fname,savereq->fr_File,1024);
- ami_update_pointer(twin->win,GUI_POINTER_WAIT);
+ ami_update_pointer(twin->win, GUI_POINTER_WAIT);
if(twin->type == AMI_TREE_HISTORY)
history_global_export(fname);
else if(twin->type == AMI_TREE_HOTLIST)
hotlist_export(fname);
- ami_update_pointer(twin->win,GUI_POINTER_DEFAULT);
+ ami_update_pointer(twin->win, GUI_POINTER_DEFAULT);
}
break;
@@ -1237,9 +1237,9 @@ void ami_tree_redraw_request(int x, int y, int width, int height, void *data)
};
if(!twin->win) return;
-// if(tree_get_redraw(twin->tree) == false) return;
ami_update_pointer(twin->win, GUI_POINTER_WAIT);
+
glob = &twin->globals;
GetAttr(SPACE_AreaBox,twin->objects[GID_BROWSER],(ULONG *)&bbox);