summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2015-01-20 00:06:08 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2015-01-20 00:06:08 +0000
commitf3cf042184a6a4ff8bda7d3693e1a33bb2111023 (patch)
treed28b03851bfc36c0c7148762dbd12736192e0709
parent0c526662b33697f2ebb132b5018494ec699da27f (diff)
downloadnetsurf-f3cf042184a6a4ff8bda7d3693e1a33bb2111023.tar.gz
netsurf-f3cf042184a6a4ff8bda7d3693e1a33bb2111023.tar.bz2
RefreshSetGadgetAttrs replacement for OS3
-rw-r--r--amiga/os3support.c30
-rw-r--r--amiga/os3support.h3
2 files changed, 32 insertions, 1 deletions
diff --git a/amiga/os3support.c b/amiga/os3support.c
index f69df1508..3b42685a5 100644
--- a/amiga/os3support.c
+++ b/amiga/os3support.c
@@ -26,9 +26,13 @@
#include <inttypes.h>
#include <stdarg.h>
#include <stdio.h>
+
#include <proto/exec.h>
#include <proto/intuition.h>
#include <proto/dos.h>
+#include <proto/utility.h>
+
+#include <intuition/gadgetclass.h>
#define SUCCESS (TRUE)
#define FAILURE (FALSE)
@@ -93,6 +97,32 @@ uint32 GetAttrs(Object *obj, Tag tag1, ...)
return i;
}
+ULONG RefreshSetGadgetAttrsA(struct Gadget *g, struct Window *w, struct Requester *r, struct TagItem *tags)
+{
+ ULONG retval;
+ BOOL changedisabled = FALSE;
+ BOOL disabled;
+
+ if (w) {
+ if (FindTagItem(GA_Disabled,tags)) {
+ changedisabled = TRUE;
+ disabled = g->Flags & GFLG_DISABLED;
+ }
+ }
+ retval = SetGadgetAttrsA(g,w,r,tags);
+ if (w && (retval || (changedisabled && disabled != (g->Flags & GFLG_DISABLED)))) {
+ RefreshGList(g,w,r,1);
+ retval = 1;
+ }
+ return retval;
+}
+
+ULONG RefreshSetGadgetAttrs(struct Gadget *g, struct Window *w, struct Requester *r, Tag tag1, ...)
+{
+ return RefreshSetGadgetAttrsA(g,w,r,(struct TagItem *) &tag1);
+}
+
+
/* Utility */
struct FormatContext
{
diff --git a/amiga/os3support.h b/amiga/os3support.h
index df88cd5a5..ecb6f4a9a 100644
--- a/amiga/os3support.h
+++ b/amiga/os3support.h
@@ -147,7 +147,6 @@
#define IDoMethod DoMethod
#define IDoMethodA DoMethodA
#define IDoSuperMethodA DoSuperMethodA
-#define RefreshSetGadgetAttrs SetGadgetAttrs /*\todo This isn't quite right */
#define ShowWindow(...) (void)0
/* Utility */
@@ -225,6 +224,8 @@ struct Node *GetHead(struct List *list);
/* Intuition */
uint32 GetAttrs(Object *obj, Tag tag1, ...);
+ULONG RefreshSetGadgetAttrs(struct Gadget *g, struct Window *w, struct Requester *r, Tag tag1, ...);
+ULONG RefreshSetGadgetAttrsA(struct Gadget *g, struct Window *w, struct Requester *r, struct TagItem *tags);
/* Utility */
char *ASPrintf(const char *fmt, ...);