summaryrefslogtreecommitdiff
path: root/atari/gui.c
diff options
context:
space:
mode:
Diffstat (limited to 'atari/gui.c')
-rwxr-xr-xatari/gui.c47
1 files changed, 22 insertions, 25 deletions
diff --git a/atari/gui.c b/atari/gui.c
index fdcb75275..c2158e05e 100755
--- a/atari/gui.c
+++ b/atari/gui.c
@@ -73,8 +73,7 @@
#include "atari/plot/plot.h"
#include "atari/clipboard.h"
#include "atari/osspec.h"
-#include "atari/search.h"
-#include "atari/deskmenu.h"
+#include "atari/search.h"
#include "cflib.h"
#define TODO() (0)/*printf("%s Unimplemented!\n", __FUNCTION__)*/
@@ -83,8 +82,9 @@ char *tmp_clipboard;
struct gui_window *input_window = NULL;
struct gui_window *window_list = NULL;
void * h_gem_rsrc;
-//OBJECT **rsc_trindex;
-//short rsc_ntree;
+OBJECT * h_gem_menu;
+OBJECT **rsc_trindex;
+short rsc_ntree;
long next_poll;
bool rendering = false;
@@ -789,8 +789,6 @@ void gui_quit(void)
struct gui_window * gw = window_list;
struct gui_window * tmp = window_list;
-
- unbind_global_events();
while( gw ) {
tmp = gw->next;
@@ -804,8 +802,10 @@ void gui_quit(void)
urldb_save_cookies(nsoption_charp(cookie_file));
urldb_save(nsoption_charp(url_file));
-
- deskmenu_destroy();
+
+ RsrcXtype( 0, rsc_trindex, rsc_ntree);
+ unbind_global_events();
+ MenuBar( h_gem_menu , 0 );
if( h_gem_rsrc != NULL ) {
RsrcXfree(h_gem_rsrc );
}
@@ -885,8 +885,7 @@ process_cmdline(int argc, char** argv)
return true;
}
-static inline void create_cursor(int flags, short mode, void * form,
- MFORM_EX * m)
+static inline void create_cursor(int flags, short mode, void * form, MFORM_EX * m)
{
m->flags = flags;
m->number = mode;
@@ -929,18 +928,16 @@ static void gui_init(int argc, char** argv)
OBJECT * cursors;
atari_find_resource(buf, "netsurf.rsc", "./res/netsurf.rsc");
- LOG(("%s ", (char*)&buf));
- if (rsrc_load(buf)==0) {
- die("Uable to open GEM Resource file!");
- }
- //h_gem_rsrc = RsrcXload( (char*) &buf );
+ LOG(("%s ", (char*)&buf));
+ h_gem_rsrc = RsrcXload( (char*) &buf );
- //if( !h_gem_rsrc )
- // die("Uable to open GEM Resource file!");
- //rsc_trindex = RsrcGhdr(h_gem_rsrc)->trindex;
- //rsc_ntree = RsrcGhdr(h_gem_rsrc)->ntree;
+ if( !h_gem_rsrc )
+ die("Uable to open GEM Resource file!");
+ rsc_trindex = RsrcGhdr(h_gem_rsrc)->trindex;
+ rsc_ntree = RsrcGhdr(h_gem_rsrc)->ntree;
- //RsrcXtype( RSRC_XTYPE, rsc_trindex, rsc_ntree);
+ RsrcGaddr( h_gem_rsrc, R_TREE, MAINMENU , &h_gem_menu );
+ RsrcXtype( RSRC_XTYPE, rsc_trindex, rsc_ntree);
create_cursor(0, POINT_HAND, NULL, &gem_cursors.hand );
create_cursor(0, TEXT_CRSR, NULL, &gem_cursors.ibeam );
@@ -984,19 +981,19 @@ static void gui_init(int argc, char** argv)
die("unable to process command line.\n");
nkc_init();
- plot_init(nsoption_charp(atari_font_driver));
- tree_set_icon_dir( nsoption_charp(tree_icons_path) );
+ plot_init(nsoption_charp(atari_font_driver));
}
static char *theapp = (char*)"NetSurf";
static void gui_init2(int argc, char** argv)
{
- deskmenu_init();
+ MenuBar( h_gem_menu , 1 );
+ bind_global_events();
menu_register( -1, theapp);
if (sys_type() & (SYS_MAGIC|SYS_NAES|SYS_XAAES)) {
menu_register( _AESapid, (char*)" NetSurf ");
- }
- bind_global_events();
+ }
+ tree_set_icon_dir( nsoption_charp(tree_icons_path) );
global_history_init();
hotlist_init();
toolbar_init();