diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2008-08-03 16:13:57 +0000 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2008-08-03 16:13:57 +0000 |
commit | a57fe0a78fc4e8398d5b0e30e057c6e146bb65f1 (patch) | |
tree | d3daf531a4d3ccd7593c2e631d28cafecaad1f1d /amiga | |
parent | 05d0e28d50e1831a3a7a327ef84ee0ae1816a765 (diff) | |
download | netsurf-a57fe0a78fc4e8398d5b0e30e057c6e146bb65f1.tar.gz netsurf-a57fe0a78fc4e8398d5b0e30e057c6e146bb65f1.tar.bz2 |
Opens and closes timer.device, and creates a new list - required for scheduling code
in schedule.c
svn path=/trunk/netsurf/; revision=4877
Diffstat (limited to 'amiga')
-rwxr-xr-x | amiga/gui.c | 48 |
1 files changed, 44 insertions, 4 deletions
diff --git a/amiga/gui.c b/amiga/gui.c index 2f52ba400..2f2cc1487 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -18,11 +18,15 @@ #include "desktop/gui.h" #include "desktop/netsurf.h" +#include "desktop/options.h" #include "utils/messages.h" #include <proto/exec.h> #include <proto/intuition.h> #include "amiga/gui.h" #include "amiga/plotters.h" +#include "amiga/schedule.h" +#include "amiga/object.h" +#include <proto/timer.h> struct browser_window *curbw; @@ -30,16 +34,38 @@ char *default_stylesheet_url; char *adblock_stylesheet_url; struct gui_window *search_current_window = NULL; +struct MsgPort *msgport; +struct timerequest *tioreq; +struct Device *TimerBase; +struct TimerIFace *ITimer; + static bool gui_start = true; void gui_init(int argc, char** argv) { - verbose_log = true; - messages_load("amiga_temp_build/messages"); - default_stylesheet_url = "file://netsurf/amiga_temp_build/default.css"; //"http://www.unsatisfactorysoftware.co.uk/newlook.css"; //path_to_url(buf); - options_read("options"); + msgport = AllocSysObjectTags(ASOT_PORT, + ASO_NoTrack,FALSE, + TAG_DONE); + + tioreq= (struct timerequest *)AllocSysObjectTags(ASOT_IOREQUEST, + ASOIOR_Size,sizeof(struct timerequest), + ASOIOR_ReplyPort,msgport, + ASO_NoTrack,FALSE, + TAG_DONE); + OpenDevice("timer.device",UNIT_VBLANK,(struct IORequest *)tioreq,0); + + TimerBase = (struct Device *)tioreq->tr_node.io_Device; + ITimer = (struct TimerIFace *)GetInterface((struct Library *)TimerBase,"main",1,NULL); + + verbose_log = true; + messages_load("resources/messages"); // check locale language and read appropriate file + default_stylesheet_url = "file://netsurf/resources/default.css"; //"http://www.unsatisfactorysoftware.co.uk/newlook.css"; //path_to_url(buf); + options_read("resources/options"); plot=amiplot; + + schedule_list = NewObjList(); + } void gui_init2(int argc, char** argv) @@ -104,6 +130,16 @@ void gui_poll(bool active) void gui_quit(void) { + if(ITimer) + { + DropInterface((struct Interface *)ITimer); + } + + CloseDevice((struct IORequest *) tioreq); + FreeSysObject(ASOT_IOREQUEST,tioreq); + FreeSysObject(ASOT_PORT,msgport); + + FreeObjList(schedule_list); } struct gui_window *gui_create_browser_window(struct browser_window *bw, @@ -127,6 +163,10 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw, WA_Height, 600, WA_IDCMP, IDCMP_CLOSEWINDOW, WA_Title, "NetSurf", + WA_AutoAdjust, TRUE, + WA_SizeGadget, TRUE, + WA_SizeBRight, TRUE, + WA_SizeBBottom, TRUE, TAG_DONE); curwin=gwin; //test |