mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-03-05 14:51:47 +03:00
More OS3 compilation fixes
This commit is contained in:
parent
2eb41ed77b
commit
201bc569a4
@ -54,6 +54,9 @@ void FreeSysObject(ULONG type, APTR obj)
|
||||
case ASOT_PORT:
|
||||
DeleteMsgPort(obj);
|
||||
break;
|
||||
case ASOT_IOREQUEST:
|
||||
DeleteIORequest(obj);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -98,6 +98,7 @@
|
||||
#define RAWKEY_END 0x71
|
||||
|
||||
/* Other constants */
|
||||
#define BVS_DISPLAY BVS_NONE
|
||||
#define IDCMP_EXTENDEDMOUSE 0
|
||||
#define WINDOW_BACKMOST 0
|
||||
#define DN_FULLPATH 0
|
||||
@ -143,6 +144,7 @@
|
||||
|
||||
/* Utility */
|
||||
#define SetMem memset
|
||||
#define SNPrintf snprintf
|
||||
|
||||
/* Integral type definitions */
|
||||
typedef int8_t int8;
|
||||
@ -160,6 +162,12 @@ struct TimeVal {
|
||||
uint32 Microseconds;
|
||||
};
|
||||
|
||||
/* TimeRequest */
|
||||
struct TimeRequest {
|
||||
struct IORequest Request;
|
||||
struct TimeVal Time;
|
||||
};
|
||||
|
||||
/* Compositing */
|
||||
#define COMPFLAG_IgnoreDestAlpha 0
|
||||
#define COMPFLAG_SrcAlphaOverride 0
|
||||
@ -189,7 +197,8 @@ struct TimeVal {
|
||||
|
||||
/* Object types */
|
||||
enum {
|
||||
ASOT_PORT = 1
|
||||
ASOT_PORT = 1,
|
||||
ASOT_IOREQUEST
|
||||
};
|
||||
|
||||
/* Requester types */
|
||||
|
@ -17,9 +17,11 @@
|
||||
*/
|
||||
|
||||
/** \file
|
||||
* DataTypes picture handler (implementation)
|
||||
* Plugin=>external program handler (implementation)
|
||||
*/
|
||||
|
||||
#include "amiga/os3support.h"
|
||||
|
||||
#include "amiga/filetype.h"
|
||||
#include "amiga/plugin_hack.h"
|
||||
#include "content/content_protected.h"
|
||||
@ -250,6 +252,7 @@ void amiga_plugin_hack_execute(struct hlcache_handle *c)
|
||||
|
||||
if(full_cmd)
|
||||
{
|
||||
#ifdef __amigaos4__
|
||||
LOG(("Attempting to execute %s", full_cmd));
|
||||
|
||||
in = Open("NIL:", MODE_OLDFILE);
|
||||
@ -264,5 +267,6 @@ void amiga_plugin_hack_execute(struct hlcache_handle *c)
|
||||
TAG_DONE);
|
||||
|
||||
FreeVec(full_cmd);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -16,6 +16,8 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "amiga/os3support.h"
|
||||
|
||||
#include <proto/utility.h>
|
||||
#include <proto/iffparse.h>
|
||||
#include <proto/dos.h>
|
||||
@ -53,6 +55,7 @@
|
||||
|
||||
#include "amiga/plotters.h"
|
||||
#include "amiga/gui.h"
|
||||
#include "amiga/misc.h"
|
||||
#include "amiga/print.h"
|
||||
#include "amiga/utf8.h"
|
||||
|
||||
@ -217,11 +220,11 @@ void ami_print_ui(struct hlcache_handle *c)
|
||||
char filename[30];
|
||||
int i;
|
||||
|
||||
struct ami_print_window *pw = AllocVecTags(sizeof(struct ami_print_window), AVT_ClearWithValue, 0, TAG_DONE);
|
||||
struct ami_print_window *pw = ami_misc_allocvec_clear(sizeof(struct ami_print_window), 0);
|
||||
|
||||
pw->c = c;
|
||||
|
||||
printers[0] = AllocVecTags(50, AVT_ClearWithValue, 0, TAG_DONE);
|
||||
printers[0] = ami_misc_allocvec_clear(50, 0);
|
||||
ami_print_readunit("ENV:Sys/printer.prefs", printers[0], 50, 0);
|
||||
|
||||
strcpy(filename,"ENV:Sys/printerN.prefs");
|
||||
@ -385,13 +388,18 @@ void ami_print(struct hlcache_handle *c, int copies)
|
||||
|
||||
if(ami_print_info.msgport == NULL)
|
||||
ami_print_init();
|
||||
|
||||
#ifdef __amigaos4__
|
||||
if(!(ami_print_info.PReq =
|
||||
(struct IODRPTagsReq *)AllocSysObjectTags(ASOT_IOREQUEST,
|
||||
ASOIOR_Size, sizeof(struct IODRPTagsReq),
|
||||
ASOIOR_ReplyPort, ami_print_info.msgport,
|
||||
ASO_NoTrack, FALSE,
|
||||
TAG_DONE))) return;
|
||||
#else
|
||||
if(!(ami_print_info.PReq =
|
||||
(struct IODRPTagsReq *)CreateIORequest(ami_print_info.msgport,
|
||||
sizeof(struct IODRPTagsReq)))) return;
|
||||
#endif
|
||||
|
||||
if(OpenDevice("printer.device", nsoption_int(printer_unit),
|
||||
(struct IORequest *)ami_print_info.PReq, 0))
|
||||
@ -467,7 +475,7 @@ struct MsgPort *ami_print_get_msgport(void)
|
||||
|
||||
bool ami_print_begin(struct print_settings *ps)
|
||||
{
|
||||
ami_print_info.gg = AllocVecTags(sizeof(struct gui_globals), AVT_ClearWithValue, 0, TAG_DONE);
|
||||
ami_print_info.gg = ami_misc_allocvec_clear(sizeof(struct gui_globals), 0);
|
||||
if(!ami_print_info.gg) return false;
|
||||
|
||||
ami_init_layers(ami_print_info.gg,
|
||||
|
@ -297,18 +297,22 @@ static struct MsgPort *ami_schedule_open_timer(struct MsgPort *msgport)
|
||||
ASO_NoTrack, FALSE,
|
||||
TAG_DONE);
|
||||
}
|
||||
|
||||
#ifdef __amigaos4__
|
||||
tioreq = (struct TimeRequest *)AllocSysObjectTags(ASOT_IOREQUEST,
|
||||
ASOIOR_Size,sizeof(struct TimeRequest),
|
||||
ASOIOR_ReplyPort,msgport,
|
||||
ASO_NoTrack,FALSE,
|
||||
TAG_DONE);
|
||||
#else
|
||||
tioreq = (struct TimeRequest *)CreateIORequest(msgport, sizeof(struct TimeRequest));
|
||||
#endif
|
||||
|
||||
OpenDevice("timer.device", UNIT_WAITUNTIL, (struct IORequest *)tioreq, 0);
|
||||
|
||||
TimerBase = (struct Device *)tioreq->Request.io_Device;
|
||||
#ifdef __amigaos4__
|
||||
ITimer = (struct TimerIFace *)GetInterface((struct Library *)TimerBase, "main", 1, NULL);
|
||||
|
||||
#endif
|
||||
return msgport;
|
||||
}
|
||||
|
||||
|
@ -103,7 +103,7 @@ void ami_search_open(struct gui_window *gwin)
|
||||
return;
|
||||
}
|
||||
|
||||
fwin = AllocVecTags(sizeof(struct find_window), AVT_ClearWithValue, 0, TAG_DONE);
|
||||
fwin = ami_misc_allocvec_clear(sizeof(struct find_window), 0);
|
||||
|
||||
fwin->objects[OID_MAIN] = WindowObject,
|
||||
WA_ScreenTitle, ami_gui_get_screen_title(),
|
||||
|
@ -667,7 +667,7 @@ static uint32 myStringClass_GM_HandleInput( Class *cl, Object *obj, struct gpInp
|
||||
myStringHandleListview( cl, obj );
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef __amigaos4__
|
||||
case IECLASS_MOUSEWHEEL:
|
||||
{
|
||||
struct InputEvent *ie = msg->gpi_IEvent;
|
||||
@ -686,7 +686,7 @@ static uint32 myStringClass_GM_HandleInput( Class *cl, Object *obj, struct gpInp
|
||||
retval = GMR_MEACTIVE;
|
||||
break;
|
||||
}
|
||||
|
||||
#endif
|
||||
default:
|
||||
{
|
||||
retval = IDoSuperMethodA( cl, obj, (APTR)msg );
|
||||
|
@ -33,6 +33,12 @@
|
||||
|
||||
static struct List PageList;
|
||||
|
||||
#ifdef __amigaos4__
|
||||
#define ALLOCVEC_SHARED(N) AllocVecTags((N), AVT_Type, MEMF_SHARED, TAG_DONE);
|
||||
#else
|
||||
#define ALLOCVEC_SHARED(N) AllocVec((N), MEMF_SHARED);
|
||||
#endif
|
||||
|
||||
void URLHistory_Init( void )
|
||||
{
|
||||
// Initialise page list
|
||||
@ -79,17 +85,11 @@ static bool URLHistoryFound(nsurl *url, const struct url_data *data)
|
||||
/* skip this URL if it is already in the list */
|
||||
if(URLHistory_FindPage(nsurl_access(url))) return true;
|
||||
|
||||
node = AllocVecTags(sizeof(struct Node),
|
||||
AVT_Type, MEMF_SHARED,
|
||||
//AVT_ClearWithValue, 0,
|
||||
TAG_DONE);
|
||||
node = ALLOCVEC_SHARED(sizeof(struct Node));
|
||||
|
||||
if ( node )
|
||||
{
|
||||
STRPTR urladd = (STRPTR) AllocVecTags( strlen ( nsurl_access(url) ) + 1,
|
||||
AVT_Type, MEMF_SHARED,
|
||||
//AVT_ClearWithValue, 0,
|
||||
TAG_DONE);
|
||||
STRPTR urladd = (STRPTR) ALLOCVEC_SHARED( strlen ( nsurl_access(url) ) + 1);
|
||||
|
||||
if ( urladd )
|
||||
{
|
||||
|
@ -16,6 +16,8 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "amiga/os3support.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <proto/clicktab.h>
|
||||
@ -99,6 +101,7 @@ const char *ptrs32[AMI_LASTPOINTER+1] = {
|
||||
"ptr32_blank",
|
||||
"ptr32_drag"};
|
||||
|
||||
#ifdef __amigaos4__
|
||||
/* Mapping from NetSurf to AmigaOS mouse pointers */
|
||||
int osmouseptr[AMI_LASTPOINTER+1] = {
|
||||
POINTERTYPE_NORMAL,
|
||||
@ -122,7 +125,7 @@ int osmouseptr[AMI_LASTPOINTER+1] = {
|
||||
POINTERTYPE_PROGRESS,
|
||||
POINTERTYPE_NONE,
|
||||
POINTERTYPE_DRAGANDDROP};
|
||||
|
||||
#endif
|
||||
|
||||
void ami_theme_init(void)
|
||||
{
|
||||
@ -218,13 +221,15 @@ void ami_update_pointer(struct Window *win, gui_pointer_shape shape)
|
||||
if(drag_save_data) return;
|
||||
|
||||
if(LIB_IS_AT_LEAST((struct Library *)IntuitionBase, 53, 42)) {
|
||||
#ifdef __amigaos4__
|
||||
BOOL ptr_delay = FALSE;
|
||||
if(shape == GUI_POINTER_WAIT) ptr_delay = TRUE;
|
||||
|
||||
SetWindowPointer(win,
|
||||
WA_PointerType, osmouseptr[shape],
|
||||
WA_PointerDelay, ptr_delay,
|
||||
TAG_DONE);
|
||||
TAG_DONE);
|
||||
#endif
|
||||
} else {
|
||||
if(nsoption_bool(os_mouse_pointers))
|
||||
{
|
||||
@ -408,12 +413,14 @@ void gui_window_start_throbber(struct gui_window *g)
|
||||
if(!g) return;
|
||||
if(nsoption_bool(kiosk_mode)) return;
|
||||
|
||||
#ifdef __amigaos4__
|
||||
if(g->tab_node && (g->shared->tabs > 1))
|
||||
{
|
||||
SetClickTabNodeAttrs(g->tab_node, TNA_Flagged, TRUE, TAG_DONE);
|
||||
RefreshGadgets((APTR)g->shared->objects[GID_TABS],
|
||||
g->shared->win, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
g->throbbing = true;
|
||||
if(g->shared->throbber_frame == 0) g->shared->throbber_frame = 1;
|
||||
@ -427,12 +434,14 @@ void gui_window_stop_throbber(struct gui_window *g)
|
||||
if(!g) return;
|
||||
if(nsoption_bool(kiosk_mode)) return;
|
||||
|
||||
#ifdef __amigaos4__
|
||||
if(g->tab_node && (g->shared->tabs > 1))
|
||||
{
|
||||
SetClickTabNodeAttrs(g->tab_node, TNA_Flagged, FALSE, TAG_DONE);
|
||||
RefreshGadgets((APTR)g->shared->objects[GID_TABS],
|
||||
g->shared->win, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
if(g == g->shared->gw) {
|
||||
if(ami_gui_get_space_box(g->shared->objects[GID_THROBBER], &bbox) != NSERROR_OK) {
|
||||
@ -471,7 +480,7 @@ static void ami_throbber_update(void *p)
|
||||
warn_user("NoMemory", "");
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef __amigaos4__
|
||||
BltBitMapTags(BLITA_SrcX, throbber_width * frame,
|
||||
BLITA_SrcY, 0,
|
||||
BLITA_DestX, bbox->Left,
|
||||
@ -484,7 +493,10 @@ static void ami_throbber_update(void *p)
|
||||
BLITA_DestType, BLITT_RASTPORT,
|
||||
// BLITA_UseSrcAlpha, TRUE,
|
||||
TAG_DONE);
|
||||
|
||||
#else
|
||||
BltBitMapRastPort(throbber, throbber_width * frame, 0, g->shared->win->RPort,
|
||||
bbox->Left, bbox->Top, throbber_width, throbber_height, 0xC0);
|
||||
#endif
|
||||
ami_gui_free_space_box(bbox);
|
||||
}
|
||||
|
||||
|
29
amiga/tree.c
29
amiga/tree.c
@ -42,7 +42,9 @@
|
||||
#include <gadgets/scroller.h>
|
||||
#include <reaction/reaction_macros.h>
|
||||
#include <intuition/icclass.h>
|
||||
#ifdef __amigaos4__
|
||||
#include <graphics/blitattr.h>
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
@ -62,6 +64,7 @@
|
||||
#include "amiga/gui.h"
|
||||
#include "amiga/tree.h"
|
||||
#include "amiga/file.h"
|
||||
#include "amiga/misc.h"
|
||||
#include "amiga/utf8.h"
|
||||
#include "amiga/sslcert.h"
|
||||
#include "amiga/drag.h" /* drag icon stuff */
|
||||
@ -315,7 +318,7 @@ static void ami_tree_redraw_req(void *p)
|
||||
|
||||
tree_draw(twin->tree, - tile_x, - tile_y,
|
||||
tile_x, tile_y, tile_w, tile_h, &ctx);
|
||||
|
||||
#ifdef __amigaos4__
|
||||
BltBitMapTags(BLITA_SrcType, BLITT_BITMAP,
|
||||
BLITA_Source, twin->globals.bm,
|
||||
BLITA_SrcX, 0,
|
||||
@ -327,6 +330,11 @@ static void ami_tree_redraw_req(void *p)
|
||||
BLITA_Width, tile_w,
|
||||
BLITA_Height, tile_h,
|
||||
TAG_DONE);
|
||||
#else
|
||||
BltBitMapRastPort(twin->globals.bm, 0, 0,
|
||||
twin->win->RPort, bbox->Left + tile_x - pos_x, bbox->Top + tile_y - pos_y,
|
||||
tile_w, tile_h, 0xC0);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -534,7 +542,7 @@ static void ami_tree_scroller_hook(struct Hook *hook,Object *object,struct Intui
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
#ifdef __amigaos4__
|
||||
case IDCMP_EXTENDEDMOUSE:
|
||||
if(msg->Code == IMSGCODE_INTUIWHEELDATA)
|
||||
{
|
||||
@ -543,6 +551,7 @@ static void ami_tree_scroller_hook(struct Hook *hook,Object *object,struct Intui
|
||||
ami_tree_scroll(twin, (wheel->WheelX * 20), (wheel->WheelY * 20));
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -550,9 +559,7 @@ static void ami_tree_menu(struct treeview_window *twin)
|
||||
{
|
||||
if(twin->menu) return;
|
||||
|
||||
if((twin->menu = AllocVecTags(sizeof(struct NewMenu) * AMI_TREE_MENU_ITEMS,
|
||||
AVT_ClearWithValue, 0, TAG_DONE)))
|
||||
{
|
||||
if((twin->menu = ami_misc_allocvec_clear(sizeof(struct NewMenu) * AMI_TREE_MENU_ITEMS, 0))) {
|
||||
twin->menu[0].nm_Type = NM_TITLE;
|
||||
twin->menu_name[0] = ami_utf8_easy((char *)messages_get("Tree"));
|
||||
twin->menu[0].nm_Label = twin->menu_name[0];
|
||||
@ -902,9 +909,11 @@ void ami_tree_close(struct treeview_window *twin)
|
||||
static void ami_tree_update_quals(struct treeview_window *twin)
|
||||
{
|
||||
uint32 quals = 0;
|
||||
|
||||
#ifdef __amigaos4__
|
||||
GetAttr(WINDOW_Qualifier, twin->objects[OID_MAIN], (uint32 *)&quals);
|
||||
|
||||
#else
|
||||
#warning FIXME not reading qualifiers on OS3
|
||||
#endif
|
||||
twin->key_state = 0;
|
||||
|
||||
if((quals & IEQUALIFIER_LSHIFT) || (quals & IEQUALIFIER_RSHIFT))
|
||||
@ -976,7 +985,9 @@ BOOL ami_tree_event(struct treeview_window *twin)
|
||||
if((twin->type != AMI_TREE_SSLCERT) &&
|
||||
(twin->rmbtrapped == FALSE))
|
||||
{
|
||||
#ifdef __amigaos4__
|
||||
SetWindowAttr(twin->win, WA_RMBTrap, (APTR)(BOOL)TRUE, sizeof(BOOL));
|
||||
#endif
|
||||
twin->rmbtrapped = TRUE;
|
||||
}
|
||||
}
|
||||
@ -984,7 +995,9 @@ BOOL ami_tree_event(struct treeview_window *twin)
|
||||
{
|
||||
if(twin->rmbtrapped == TRUE)
|
||||
{
|
||||
#ifdef __amigaos4__
|
||||
SetWindowAttr(twin->win, WA_RMBTrap, (APTR)(BOOL)FALSE, sizeof(BOOL));
|
||||
#endif
|
||||
twin->rmbtrapped = FALSE;
|
||||
}
|
||||
}
|
||||
@ -1455,7 +1468,7 @@ struct treeview_window *ami_tree_create(int flags,
|
||||
{
|
||||
struct treeview_window *twin;
|
||||
|
||||
twin = AllocVecTags(sizeof(struct treeview_window), AVT_ClearWithValue, 0, TAG_DONE);
|
||||
twin = ami_misc_allocvec_clear(sizeof(struct treeview_window), 0);
|
||||
|
||||
if(!twin)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user