mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-16 09:12:44 +03:00
RefreshSetGadgetAttrs replacement for OS3
This commit is contained in:
parent
0c526662b3
commit
f3cf042184
@ -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
|
||||
{
|
||||
|
@ -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, ...);
|
||||
|
Loading…
Reference in New Issue
Block a user