NetSurf
gui.c
Go to the documentation of this file.
1/*
2 * Copyright 2010 <ole@monochrom.net>
3 *
4 * This file is part of NetSurf, http://www.netsurf-browser.org/
5 *
6 * NetSurf is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * NetSurf is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19/**
20 * \file
21 *
22 * Provides all the mandatory functions prefixed with gui_ for atari
23 */
24
25#include <sys/types.h>
26#include <sys/stat.h>
27#include <unistd.h>
28
29#include "utils/log.h"
30#include "utils/messages.h"
31#include "utils/corestrings.h"
32#include "utils/nsoption.h"
34#include "netsurf/layout.h"
35#include "netsurf/window.h"
36#include "netsurf/clipboard.h"
37#include "netsurf/fetch.h"
38#include "netsurf/misc.h"
39#include "netsurf/netsurf.h"
40#include "netsurf/content.h"
41#include "netsurf/cookie_db.h"
42#include "netsurf/url_db.h"
43#include "netsurf/plotters.h"
45
46#include "atari/gemtk/gemtk.h"
47#include "atari/gui.h"
48#include "atari/misc.h"
49#include "atari/findfile.h"
50#include "atari/schedule.h"
51#include "atari/rootwin.h"
52#include "atari/statusbar.h"
53#include "atari/toolbar.h"
54#include "atari/hotlist.h"
55#include "atari/cookies.h"
56#include "atari/history.h"
57#include "atari/encoding.h"
58#include "atari/res/netsurf.rsh"
59#include "atari/plot/plot.h"
60#include "atari/clipboard.h"
61#include "atari/osspec.h"
62#include "atari/search.h"
63#include "atari/deskmenu.h"
64#include "atari/download.h"
65#include "atari/file.h"
66#include "atari/filetype.h"
67#include "atari/bitmap.h"
68#include "atari/font.h"
69#include "cflib.h"
70
71static bool atari_quit = false;
72
73struct gui_window *input_window = NULL;
74struct gui_window *window_list = NULL;
77bool rendering = false;
79
80/* Comandline / Options: */
85
86/* Defaults to option_homepage_url, commandline options overwrites that value */
88
89/* path to choices file: */
91
92EVMULT_IN aes_event_in = {
93 .emi_flags = MU_MESAG | MU_TIMER | MU_KEYBD | MU_BUTTON | MU_M1,
94 .emi_bclicks = 258,
95 .emi_bmask = 3,
96 .emi_bstate = 0,
97 .emi_m1leave = MO_ENTER,
98 .emi_m1 = {0,0,0,0},
99 .emi_m2leave = 0,
100 .emi_m2 = {0,0,0,0},
101 .emi_tlow = 0,
102 .emi_thigh = 0
103};
104EVMULT_OUT aes_event_out;
105short aes_msg_out[8];
106
107bool gui_window_get_scroll(struct gui_window *w, int *sx, int *sy);
108static nserror gui_window_set_url(struct gui_window *w, nsurl *url);
109
110/**
111 * Core atari event processing.
112 */
113static void atari_poll(void)
114{
115
116 struct gui_window *tmp;
117 short mx, my, dummy;
118
119 aes_event_in.emi_tlow = schedule_run();
120
121 if(rendering){
122 aes_event_in.emi_tlow = nsoption_int(atari_gui_poll_timeout);
123 }
124
125 if(aes_event_in.emi_tlow < 0) {
126 aes_event_in.emi_tlow = 10000;
127 printf("long poll!\n");
128 }
129
132 }
133
134
135 graf_mkstate(&mx, &my, &dummy, &dummy);
136 aes_event_in.emi_m1.g_x = mx;
137 aes_event_in.emi_m1.g_y = my;
138 evnt_multi_fast(&aes_event_in, aes_msg_out, &aes_event_out);
139 if(gemtk_wm_dispatch_event(&aes_event_in, &aes_event_out, aes_msg_out) == 0) {
140 if( (aes_event_out.emo_events & MU_MESAG) != 0 ) {
141 NSLOG(netsurf, INFO, "WM: %d\n", aes_msg_out[0]);
142 switch(aes_msg_out[0]) {
143
144 case MN_SELECTED:
145 NSLOG(netsurf, INFO, "Menu Item: %d\n", aes_msg_out[4]);
147 break;
148
149 case AP_TERM:
150 atari_quit = true;
151 break;
152 default:
153 break;
154 }
155 }
156 if((aes_event_out.emo_events & MU_KEYBD) != 0) {
157 uint16_t nkc = gem_to_norm( (short)aes_event_out.emo_kmeta,
158 (short)aes_event_out.emo_kreturn);
160 aes_event_out.emo_kmeta, nkc);
161 }
162 }
163
164 tmp = window_list;
165 while(tmp){
166 if(tmp->root->redraw_slots.areas_used > 0){
168 }
169 tmp = tmp->next;
170 }
171
172 /** @todo implement generic treeview redraw function. */
173 /** @todo rename hl to atari_hotlist or create getter for it... */
174
176}
177
178/**
179 * Create and open a gui window for a browsing context.
180 *
181 * \param bw bw to create gui_window for
182 * \param existing an existing gui_window, may be NULL
183 * \param flags flags for gui window creation
184 * \return gui window, or NULL on error
185 *
186 * If GW_CREATE_CLONE flag is set existing is non-NULL.
187 *
188 * The created gui_window must include a reference to the browser
189 * window passed in the bw param.
190 */
191static struct gui_window *
193 struct gui_window *existing,
195{
196 struct gui_window *gw=NULL;
197 NSLOG(netsurf, INFO, "gw: %p, BW: %p, existing %p, flags: %d\n", gw, bw,
198 existing, (int)flags);
199
200 gw = calloc(1, sizeof(struct gui_window));
201 if (gw == NULL)
202 return NULL;
203
204 NSLOG(netsurf, INFO, "new window: %p, bw: %p\n", gw, bw);
207 if (gw->root->win) {
208 GRECT pos = {
211 };
212 gui_window_set_url(gw, corestring_nsurl_about_blank);
215 window_open(gw->root, gw, pos);
216 }
217
218 /* add the window to the window list: */
219 if( window_list == NULL ) {
220 window_list = gw;
221 gw->next = NULL;
222 gw->prev = NULL;
223 } else {
224 struct gui_window * tmp = window_list;
225 while( tmp->next != NULL ) {
226 tmp = tmp->next;
227 }
228 tmp->next = gw;
229 gw->prev = tmp;
230 gw->next = NULL;
231 }
232
233 /* Loose focus: */
234 window_set_focus(gw->root, WIDGET_NONE, NULL );
235
236 /* trigger on-focus event (select all text): */
237 window_set_focus(gw->root, URL_WIDGET, NULL);
238
239 /* delete selection: */
240 toolbar_key_input(gw->root->toolbar, NK_DEL);
241
242 return( gw );
243
244}
245
246/**
247 * Destroy previously created gui window
248 *
249 * \param gw The gui window to destroy.
250 */
252{
253 if (gw == NULL)
254 return;
255
256 NSLOG(netsurf, INFO, "%s\n", __FUNCTION__);
257
258 if (input_window == gw) {
260 }
261
263 free(gw->browser);
264 free(gw->status);
265 free(gw->title);
266 free(gw->url);
267
268 /* unlink the window: */
269 if(gw->prev != NULL ) {
270 gw->prev->next = gw->next;
271 } else {
272 window_list = gw->next;
273 }
274 if( gw->next != NULL ) {
275 gw->next->prev = gw->prev;
276 }
277
279
280 free(gw);
281 gw = NULL;
282
283 if(input_window == NULL) {
284 gw = window_list;
285 while( gw != NULL ) {
286 if(gw->root) {
288 break;
289 }
290 gw = gw->next;
291 }
292 }
293}
294
295/**
296 * Find the current dimensions of a atari browser window content area.
297 *
298 * \param gw The gui window to measure content area of.
299 * \param width receives width of window
300 * \param height receives height of window
301 * \return NSERROR_OK on sucess and width and height updated
302 * else error code.
303 */
304static nserror
306{
307 GRECT rect;
309 *width = rect.g_w;
310 *height = rect.g_h;
311
312 return NSERROR_OK;
313}
314
315/**
316 * Set the title of a window.
317 *
318 * \param gw window to update
319 * \param title new window title
320 */
321static void gui_window_set_title(struct gui_window *gw, const char *title)
322{
323 if (gw == NULL)
324 return;
325
326 if (gw->root) {
327
328 int l;
329 char * conv;
330 l = strlen(title)+1;
331 if (utf8_to_local_encoding(title, l-1, &conv) == NSERROR_OK ) {
332 l = MIN((uint32_t)atari_sysinfo.aes_max_win_title_len, strlen(conv));
333 if(gw->title == NULL)
334 gw->title = malloc(l);
335 else
336 gw->title = realloc(gw->title, l);
337
338 strncpy(gw->title, conv, l);
339 free( conv );
340 } else {
341 l = MIN((size_t)atari_sysinfo.aes_max_win_title_len, strlen(title));
342 if(gw->title == NULL)
343 gw->title = malloc(l);
344 else
345 gw->title = realloc(gw->title, l);
346 strncpy(gw->title, title, l);
347 }
348 gw->title[l] = 0;
349 if(input_window == gw)
350 window_set_title(gw->root, gw->title);
351 }
352}
353
354/* exported interface documented in atari/gui.h */
355void atari_window_set_status(struct gui_window *w, const char *text)
356{
357 int l;
358 if (w == NULL || text == NULL)
359 return;
360
361 assert(w->root);
362
363 l = strlen(text)+1;
364 if(w->status == NULL)
365 w->status = malloc(l);
366 else
367 w->status = realloc(w->status, l);
368
369 strncpy(w->status, text, l);
370 w->status[l] = 0;
371
372 if(input_window == w)
373 window_set_stauts(w->root, (char*)text);
374}
375
376
377/**
378 * Invalidates an area of an atari browser window
379 *
380 * \param gw gui_window
381 * \param rect area to redraw or NULL for the entire window area
382 * \return NSERROR_OK on success or appropriate error code
383 */
384static nserror
386 const struct rect *rect)
387{
388 GRECT area;
389
390 if (gw == NULL) {
392 }
393
395
396 if (rect != NULL) {
397 struct gemtk_wm_scroll_info_s *slid;
398
399 slid = gemtk_wm_get_scroll_info(gw->root->win);
400
401 area.g_x += rect->x0 - (slid->x_pos * slid->x_unit_px);
402 area.g_y += rect->y0 - (slid->y_pos * slid->y_unit_px);
403 area.g_w = rect->x1 - rect->x0;
404 area.g_h = rect->y1 - rect->y0;
405 }
406
407 //dbg_grect("update box", &area);
409
410 return NSERROR_OK;
411}
412
413bool gui_window_get_scroll(struct gui_window *w, int *sx, int *sy)
414{
415 if (w == NULL)
416 return false;
417
418 window_get_scroll(w->root, sx, sy);
419
420 return( true );
421}
422
423/**
424 * Set the scroll position of a atari browser window.
425 *
426 * Scrolls the viewport to ensure the specified rectangle of the
427 * content is shown. The atari implementation scrolls the contents so
428 * the specified point in the content is at the top of the viewport.
429 *
430 * \param gw gui window to scroll
431 * \param rect The rectangle to ensure is shown.
432 * \return NSERROR_OK on success or apropriate error code.
433 */
434static nserror
435gui_window_set_scroll(struct gui_window *gw, const struct rect *rect)
436{
437 if ((gw == NULL) ||
438 (gw->browser->bw == NULL) ||
441 }
442
443 NSLOG(netsurf, INFO, "scroll (gui_window: %p) %d, %d\n", gw, rect->x0,
444 rect->y0);
446
447 return NSERROR_OK;
448}
449
450/**
451 * Update the extent of the inside of a browser window to that of the
452 * current content.
453 *
454 * It seems this method is called when content size got adjusted, so
455 * that we can adjust scroll info. We also have to call it when tab
456 * change occurs.
457 *
458 * \param gw gui_window to update the extent of
459 */
461{
462
464 /** @todo store content size. */
465 if(window_get_active_gui_window(gw->root) == gw) {
466 int width, height;
467 GRECT area;
473 }
474 }
475}
476
477
478/**
479 * set the pointer shape
480 */
482{
483 if (gw == NULL)
484 return;
485
486 switch (shape) {
487 case GUI_POINTER_POINT: /* link */
488 gw->cursor = &gem_cursors.hand;
489 break;
490
491 case GUI_POINTER_MENU:
492 gw->cursor = &gem_cursors.menu;
493 break;
494
495 case GUI_POINTER_CARET: /* input */
496 gw->cursor = &gem_cursors.ibeam;
497 break;
498
500 gw->cursor = &gem_cursors.cross;
501 break;
502
503 case GUI_POINTER_MOVE:
505 break;
506
508 case GUI_POINTER_LEFT:
510 break;
511
512 case GUI_POINTER_UP:
513 case GUI_POINTER_DOWN:
515 break;
516
517 case GUI_POINTER_RU:
518 case GUI_POINTER_LD:
520 break;
521
522 case GUI_POINTER_RD:
523 case GUI_POINTER_LU:
525 break;
526
527 case GUI_POINTER_WAIT:
528 gw->cursor = &gem_cursors.wait;
529 break;
530
533 break;
534
537 break;
538
540 gw->cursor = &gem_cursors.deny;
541 break;
542
543 case GUI_POINTER_HELP:
544 gw->cursor = &gem_cursors.help;
545 break;
546
547 default:
548 gw->cursor = &gem_cursors.arrow;
549 break;
550 }
551
552 if (input_window == gw) {
554 }
555}
556
557
559{
560 int l;
561
562 if (w == NULL)
563 return NSERROR_OK;
564
565 l = strlen(nsurl_access(url))+1;
566
567 if (w->url == NULL) {
568 w->url = malloc(l);
569 } else {
570 w->url = realloc(w->url, l);
571 }
572 strncpy(w->url, nsurl_access(url), l);
573 w->url[l] = 0;
576 }
577
578 return NSERROR_OK;
579}
580
582{
583 if (gw == NULL) {
584 return(NULL);
585 }
586 return(gw->url);
587}
588
590{
591 if (gw == NULL) {
592 return(NULL);
593 }
594 return(gw->title);
595}
596
597static void throbber_advance( void * data )
598{
599
600 struct gui_window * gw = (struct gui_window *)data;
601
602 if (gw->root == NULL)
603 return;
604 if (gw->root->toolbar == NULL)
605 return;
606
607 if (gw->root->toolbar->throbber.running == false)
608 return;
609
612}
613
615{
616 if (w == NULL)
617 return;
618
621 rendering = true;
622}
623
625{
626 if (w == NULL)
627 return;
628 if (w->root->toolbar->throbber.running == false)
629 return;
630
632
634
635 rendering = false;
636}
637
638/**
639 * Place caret in window
640 */
641static void
642gui_window_place_caret(struct gui_window *w, int x, int y, int height,
643 const struct rect *clip)
644{
645 window_place_caret(w->root, 1, x, y, height, NULL);
647 return;
648}
649
650
651/**
652 * clear window caret
653 */
654static void
656{
657 if (w == NULL)
658 return;
659
660 if ((w->root->caret.state & CARET_STATE_ENABLED) != 0) {
661 //printf("gw hide caret\n");
662 window_place_caret(w->root, 0, -1, -1, -1, NULL);
663 w->root->caret.state &= ~CARET_STATE_ENABLED;
664 }
665 return;
666}
667
668/**
669 * Set a favicon for a gui window.
670 *
671 * \param g window to update.
672 * \param icon handle to object to use as icon.
673 */
674static void
676{
677 struct bitmap *bmp_icon;
678
679 bmp_icon = (icon != NULL) ? content_get_bitmap(icon) : NULL;
680 g->icon = bmp_icon;
681 if(input_window == g) {
682 window_set_icon(g->root, bmp_icon);
683 }
684}
685
686static void gui_window_new_content(struct gui_window *w)
687{
688 struct gemtk_wm_scroll_info_s *slid = gemtk_wm_get_scroll_info(w->root->win);
689 slid->x_pos = 0;
690 slid->y_pos = 0;
691 gemtk_wm_update_slider(w->root->win, GEMTK_WM_VH_SLIDER);
693}
694
695
696/**
697 * Core asks front end for clipboard contents.
698 *
699 * \param buffer UTF-8 text, allocated by front end, ownership yeilded to core
700 * \param length Byte length of UTF-8 text in buffer
701 */
702static void gui_get_clipboard(char **buffer, size_t *length)
703{
704 char *clip;
705
706 *length = 0;
707 *buffer = 0;
708
710
711 if(clip == NULL) {
712 return;
713 } else {
714
715 // clipboard is in atari encoding, convert it to utf8:
716
717 size_t clip_len;
718 char *utf8 = NULL;
719
720 clip_len = strlen(clip);
721 if (clip_len > 0) {
722 nserror ret;
723 ret = utf8_to_local_encoding(clip, clip_len, &utf8);
724 if (ret == NSERROR_OK && utf8 != NULL) {
725 *buffer = utf8;
726 *length = strlen(utf8);
727 } else {
728 assert(ret == NSERROR_OK && utf8 != NULL);
729 }
730 }
731
732 free(clip);
733 }
734}
735
736/**
737 * Core tells front end to put given text in clipboard
738 *
739 * \param buffer UTF-8 text, owned by core
740 * \param length Byte length of UTF-8 text in buffer
741 * \param styles Array of styles given to text runs, owned by core, or NULL
742 * \param n_styles Number of text run styles in array
743 */
744static void gui_set_clipboard(const char *buffer, size_t length,
745 nsclipboard_styles styles[], int n_styles)
746{
747 if (length > 0 && buffer != NULL) {
748
749 // convert utf8 input to atari encoding:
750
751 nserror ret;
752 char *clip = NULL;
753
754 ret = utf8_to_local_encoding(buffer,length, &clip);
755 if (ret == NSERROR_OK) {
757 } else {
758 assert(ret == NSERROR_OK);
759 }
760 free(clip);
761 }
762}
763
765{
766 NSLOG(netsurf, INFO, "Setting input window from: %p to %p\n",
767 input_window, gw);
768 input_window = gw;
769}
770
772{
773 return(input_window);
774}
775
776static void gui_quit(void)
777{
778 NSLOG(netsurf, INFO, "quitting");
779
780 struct gui_window *gw = window_list;
781 struct gui_window *tmp = window_list;
782
783 /* Destroy all remaining browser windows: */
784 while (gw) {
785 tmp = gw->next;
787 gw = tmp;
788 }
789
790 /* destroy the treeview windows: */
794
795 /* shutdown the toolbar framework: */
796 toolbar_exit();
797
798 /* save persistent informations: */
800 urldb_save(nsoption_charp(url_file));
801
803 gemtk_wm_exit();
804
805 rsrc_free();
806
807 NSLOG(netsurf, INFO, "Shutting down plotter");
809 NSLOG(netsurf, INFO, "done");
810}
811
812/**
813 * Process commandline parameters.
814 */
815static bool
816process_cmdline(int argc, char** argv)
817{
818 int opt;
819 bool set_default_dimensions = true;
820
821 NSLOG(netsurf, INFO, "argc %d, argv %p", argc, argv);
822
823 if ((nsoption_int(window_width) != 0) && (nsoption_int(window_height) != 0)) {
824
825 option_window_width = nsoption_int(window_width);
826 option_window_height = nsoption_int(window_height);
827 option_window_x = nsoption_int(window_x);
828 option_window_y = nsoption_int(window_y);
829
832 set_default_dimensions = false;
833 }
834 }
835
836 if (set_default_dimensions) {
837 if( sys_type() == SYS_TOS ) {
838 /* on single tasking OS, start as fulled window: */
843 } else {
846 option_window_x = 10;
847 option_window_y = 30;
848 }
849 }
850
851 if (nsoption_charp(homepage_url) != NULL)
852 option_homepage_url = nsoption_charp(homepage_url);
853 else
854 option_homepage_url = NETSURF_HOMEPAGE;
855
856 while((opt = getopt(argc, argv, "w:h:")) != -1) {
857 switch (opt) {
858 case 'w':
859 option_window_width = atoi(optarg);
860 break;
861
862 case 'h':
863 option_window_height = atoi(optarg);
864 break;
865
866 default:
867 fprintf(stderr,
868 "Usage: %s [w,h,v] url\n",
869 argv[0]);
870 return false;
871 }
872 }
873
874 if (optind < argc) {
875 option_homepage_url = argv[optind];
876 }
877 return true;
878}
879
880static inline void create_cursor(int flags, short mode, void * form,
881 MFORM_EX * m)
882{
883 m->flags = flags;
884 m->number = mode;
885 if( flags & MFORM_EX_FLAG_USERFORM ) {
886 m->number = mode;
887 m->tree = (OBJECT*)form;
888 }
889}
890
891static nsurl *gui_get_resource_url(const char *path)
892{
893 char buf[PATH_MAX];
894 nsurl *url = NULL;
895
896 atari_find_resource((char*)&buf, path, path);
897
899
900 return url;
901}
902
903/**
904 * Set option defaults for atari frontend
905 *
906 * @param defaults The option table to update.
907 * @return error status.
908 */
910{
911 /* Set defaults for absent option strings */
912 nsoption_setnull_charp(cookie_file, strdup("cookies"));
913 if (nsoption_charp(cookie_file) == NULL) {
914 NSLOG(netsurf, INFO, "Failed initialising string options");
916 }
917 return NSERROR_OK;
918}
919
920static char *theapp = (char*)"NetSurf";
921
922/**
923 * Initialise atari gui.
924 */
925static void gui_init(int argc, char** argv)
926{
927 char buf[PATH_MAX];
928 OBJECT * cursors;
929
930 atari_find_resource(buf, "netsurf.rsc", "./res/netsurf.rsc");
931 NSLOG(netsurf, INFO, "Using RSC file: %s ", (char *)&buf);
932 if (rsrc_load(buf)==0) {
933
934 char msg[1024];
935
936 snprintf(msg, 1024, "Unable to open GEM Resource file (%s)!", buf);
937 die(msg);
938 }
939
940 wind_get_grect(0, WF_WORKXYWH, &desk_area);
941
942 create_cursor(0, POINT_HAND, NULL, &gem_cursors.hand );
943 create_cursor(0, TEXT_CRSR, NULL, &gem_cursors.ibeam );
944 create_cursor(0, THIN_CROSS, NULL, &gem_cursors.cross);
945 create_cursor(0, BUSY_BEE, NULL, &gem_cursors.wait);
946 create_cursor(0, ARROW, NULL, &gem_cursors.arrow);
947 create_cursor(0, OUTLN_CROSS, NULL, &gem_cursors.sizeall);
948 create_cursor(0, OUTLN_CROSS, NULL, &gem_cursors.sizenesw);
949 create_cursor(0, OUTLN_CROSS, NULL, &gem_cursors.sizenwse);
950 cursors = gemtk_obj_get_tree(CURSOR);
951 create_cursor(MFORM_EX_FLAG_USERFORM, CURSOR_APPSTART,
952 cursors, &gem_cursors.appstarting);
955 cursors, &gem_cursors.sizewe);
957 cursors, &gem_cursors.sizens);
959 cursors, &gem_cursors.nodrop);
961 cursors, &gem_cursors.deny);
963 cursors, &gem_cursors.menu);
965 cursors, &gem_cursors.help);
966
967 NSLOG(netsurf, INFO, "Enabling core select menu");
968 nsoption_set_bool(core_select_menu, true);
969
970 NSLOG(netsurf, INFO, "Loading url.db from: %s", nsoption_charp(url_file));
971 if( strlen(nsoption_charp(url_file)) ) {
972 urldb_load(nsoption_charp(url_file));
973 }
974
975 NSLOG(netsurf, INFO, "Loading cookies from: %s",
976 nsoption_charp(cookie_file));
977 if( strlen(nsoption_charp(cookie_file)) ) {
979 }
980
981 if (process_cmdline(argc,argv) != true)
982 die("unable to process command line.\n");
983
984 NSLOG(netsurf, INFO, "Initializing NKC...");
985 nkc_init();
986
987 NSLOG(netsurf, INFO, "Initializing plotters...");
988 struct redraw_context ctx = {
989 .interactive = true,
990 .background_images = true,
991 .plot = &atari_plotters
992 };
993 plot_init(&ctx, nsoption_charp(atari_font_driver));
994
995 aes_event_in.emi_m1leave = MO_LEAVE;
996 aes_event_in.emi_m1.g_w = 1;
997 aes_event_in.emi_m1.g_h = 1;
998 //next_poll = clock() + (CLOCKS_PER_SEC>>3);
999
1000 deskmenu_init();
1001 menu_register( -1, theapp);
1002 if (sys_type() & (SYS_MAGIC|SYS_NAES|SYS_XAAES)) {
1003 menu_register( _AESapid, (char*)" NetSurf ");
1004 }
1005 gemtk_wm_init();
1006
1007 /* Initialize the specific treeview windows: */
1011
1012 /* Initialize the toolbar framework: */
1013 toolbar_init();
1014}
1015
1016
1017/**
1018 * process miscellaneous window events
1019 *
1020 * \param gw The window receiving the event.
1021 * \param event The event code.
1022 * \return NSERROR_OK when processed ok
1023 */
1024static nserror
1026{
1027 switch (event) {
1030 break;
1031
1034 break;
1035
1038 break;
1039
1042 break;
1043
1046 break;
1047
1048 default:
1049 break;
1050 }
1051 return NSERROR_OK;
1052}
1053
1054
1057 .destroy = gui_window_destroy,
1058 .invalidate = atari_window_invalidate_area,
1059 .get_scroll = gui_window_get_scroll,
1060 .set_scroll = gui_window_set_scroll,
1061 .get_dimensions = gui_window_get_dimensions,
1062 .event = gui_window_event,
1063
1064 .set_title = gui_window_set_title,
1065 .set_url = gui_window_set_url,
1066 .set_icon = gui_window_set_icon,
1067 .set_status = atari_window_set_status,
1068 .set_pointer = gui_window_set_pointer,
1069 .place_caret = gui_window_place_caret,
1070};
1071
1074 .set = gui_set_clipboard,
1075};
1076
1079
1080 .get_resource_url = gui_get_resource_url,
1081};
1082
1085
1086 .quit = gui_quit,
1087};
1088
1089/* #define WITH_DBG_LOGFILE 1 */
1090/**
1091 * Entry point from OS.
1092 *
1093 * /param argc The number of arguments in the string vector.
1094 * /param argv The argument string vector.
1095 * /return The return code to the OS
1096 */
1097int main(int argc, char** argv)
1098{
1099 char messages[PATH_MAX];
1100 char store[PATH_MAX];
1101 const char *addr;
1102 char * file_url = NULL;
1103 struct stat stat_buf;
1104 nsurl *url;
1105 nserror ret;
1106
1107 struct netsurf_table atari_table = {
1109 .window = &atari_window_table,
1110 .clipboard = &atari_clipboard_table,
1111 .download = atari_download_table,
1112 .fetch = &atari_fetch_table,
1113 .file = atari_file_table,
1114 .utf8 = atari_utf8_table,
1115 .search = atari_search_table,
1116 .llcache = filesystem_llcache_table,
1117 .bitmap = atari_bitmap_table,
1118 .layout = atari_layout_table
1119 };
1120
1121 ret = netsurf_register(&atari_table);
1122 if (ret != NSERROR_OK) {
1123 die("NetSurf operation table failed registration");
1124 }
1125
1126 /** @todo logging file descriptor update belongs in a nslog_init callback */
1127 setbuf(stderr, NULL);
1128 setbuf(stdout, NULL);
1129#ifdef WITH_DBG_LOGFILE
1130 freopen("stdout.log", "a+", stdout);
1131 freopen("stderr.log", "a+", stderr);
1132#endif
1133
1134 graf_mouse(BUSY_BEE, NULL);
1135
1136 init_app(NULL);
1137
1138 init_os_info();
1139
1140 atari_find_resource((char*)&messages, "messages", "res/messages");
1141 atari_find_resource((char*)&options, "Choices", "Choices");
1142 atari_find_resource((char*)&store, "cache", "res/cache");
1143
1144 /* initialise logging - not fatal if it fails but not much we can
1145 * do about it
1146 */
1147 nslog_init(NULL, &argc, argv);
1148
1149 /* user options setup */
1151 if (ret != NSERROR_OK) {
1152 die("Options failed to initialise");
1153 }
1154 nsoption_read(options, NULL);
1155 nsoption_commandline(&argc, argv, NULL);
1156
1157 ret = messages_add_from_file(messages);
1158
1159 /* common initialisation */
1160 NSLOG(netsurf, INFO, "Initialising core...");
1161 ret = netsurf_init(store);
1162 if (ret != NSERROR_OK) {
1163 die("NetSurf failed to initialise");
1164 }
1165
1166 NSLOG(netsurf, INFO, "Initializing GUI...");
1167 gui_init(argc, argv);
1168
1169 graf_mouse( ARROW , NULL);
1170
1171 NSLOG(netsurf, INFO, "Creating initial browser window...");
1172 addr = option_homepage_url;
1173 if (strncmp(addr, "file://", 7) && strncmp(addr, "http://", 7)) {
1174 if (stat(addr, &stat_buf) == 0) {
1175 file_url = local_file_to_url(addr);
1176 addr = file_url;
1177 }
1178 }
1179
1180 /* create an initial browser window */
1181 ret = nsurl_create(addr, &url);
1182 if (ret == NSERROR_OK) {
1184 url,
1185 NULL,
1186 NULL,
1187 NULL);
1188 nsurl_unref(url);
1189 }
1190 if (ret != NSERROR_OK) {
1192 } else {
1193 NSLOG(netsurf, INFO, "Entering Atari event mainloop...");
1194 while (!atari_quit) {
1195 atari_poll();
1196 }
1197 }
1198
1199 netsurf_exit();
1200
1201 free(file_url);
1202
1203#ifdef WITH_DBG_LOGFILE
1204 fclose(stdout);
1205 fclose(stderr);
1206#endif
1207 NSLOG(netsurf, INFO, "exit_gem");
1208
1209 /* finalise logging */
1211
1212 exit_gem();
1213
1214 return 0;
1215}
const char * fetch_filetype(const char *unix_path)
Determine the MIME type of a local file.
Definition: filetype.c:58
int main(int argc, char **argv)
Normal entry point from OS.
Definition: gui.c:6528
int scrap_txt_write(char *str)
Definition: clipboard.c:50
char * scrap_txt_read(void)
Definition: clipboard.c:62
void atari_cookie_manager_init(void)
Definition: cookies.c:132
void atari_cookie_manager_destroy(void)
Definition: cookies.c:199
char * local_file_to_url(const char *filename)
Definition: findfile.c:29
char * atari_find_resource(char *buf, const char *filename, const char *def)
Definition: findfile.c:80
EVMULT_OUT aes_event_out
Definition: gui.c:104
static void gui_set_clipboard(const char *buffer, size_t length, nsclipboard_styles styles[], int n_styles)
Core tells front end to put given text in clipboard.
Definition: gui.c:744
static nserror gui_window_set_scroll(struct gui_window *gw, const struct rect *rect)
Set the scroll position of a atari browser window.
Definition: gui.c:435
static bool process_cmdline(int argc, char **argv)
Process commandline parameters.
Definition: gui.c:816
static nsurl * gui_get_resource_url(const char *path)
Definition: gui.c:891
static nserror gui_window_event(struct gui_window *gw, enum gui_window_event event)
process miscellaneous window events
Definition: gui.c:1025
int option_window_height
Definition: gui.c:82
long next_poll
Definition: gui.c:76
static nserror gui_window_get_dimensions(struct gui_window *gw, int *width, int *height)
Find the current dimensions of a atari browser window content area.
Definition: gui.c:305
static void create_cursor(int flags, short mode, void *form, MFORM_EX *m)
Definition: gui.c:880
struct gui_window * gui_get_input_window(void)
Definition: gui.c:771
static void gui_init(int argc, char **argv)
Initialise atari gui.
Definition: gui.c:925
const char * option_homepage_url
Definition: gui.c:87
int option_window_width
Definition: gui.c:81
static struct gui_fetch_table atari_fetch_table
Definition: gui.c:1077
static void throbber_advance(void *data)
Definition: gui.c:597
static void gui_get_clipboard(char **buffer, size_t *length)
Core asks front end for clipboard contents.
Definition: gui.c:702
void * h_gem_rsrc
Definition: gui.c:75
static struct gui_window * gui_window_create(struct browser_window *bw, struct gui_window *existing, gui_window_create_flags flags)
Create and open a gui window for a browsing context.
Definition: gui.c:192
GRECT desk_area
Definition: gui.c:78
static struct gui_misc_table atari_misc_table
Definition: gui.c:1083
EVMULT_IN aes_event_in
Definition: gui.c:92
static nserror gui_window_set_url(struct gui_window *w, nsurl *url)
Definition: gui.c:558
char options[PATH_MAX]
Definition: gui.c:90
static bool atari_quit
Definition: gui.c:71
static nserror set_defaults(struct nsoption_s *defaults)
Set option defaults for atari frontend.
Definition: gui.c:909
static void gui_window_remove_caret(struct gui_window *w)
clear window caret
Definition: gui.c:655
struct gui_window * input_window
Definition: gui.c:73
static void gui_quit(void)
Definition: gui.c:776
void gui_window_destroy(struct gui_window *gw)
Destroy previously created gui window.
Definition: gui.c:251
static void gui_window_new_content(struct gui_window *w)
Definition: gui.c:686
static void atari_poll(void)
Core atari event processing.
Definition: gui.c:113
static nserror atari_window_invalidate_area(struct gui_window *gw, const struct rect *rect)
Invalidates an area of an atari browser window.
Definition: gui.c:385
void gui_window_set_pointer(struct gui_window *gw, gui_pointer_shape shape)
set the pointer shape
Definition: gui.c:481
static void gui_window_start_throbber(struct gui_window *w)
Definition: gui.c:614
int option_window_x
Definition: gui.c:83
static struct gui_clipboard_table atari_clipboard_table
Definition: gui.c:1072
char * gui_window_get_url(struct gui_window *gw)
Definition: gui.c:581
void gui_set_input_gui_window(struct gui_window *gw)
Definition: gui.c:764
void atari_window_set_status(struct gui_window *w, const char *text)
Set the status bar of a browser window.
Definition: gui.c:355
static void gui_window_set_icon(struct gui_window *g, struct hlcache_handle *icon)
Set a favicon for a gui window.
Definition: gui.c:675
static void gui_window_set_title(struct gui_window *gw, const char *title)
Set the title of a window.
Definition: gui.c:321
struct gui_window * window_list
Definition: gui.c:74
static char * theapp
Definition: gui.c:920
static void gui_window_update_extent(struct gui_window *gw)
Update the extent of the inside of a browser window to that of the current content.
Definition: gui.c:460
bool gui_window_get_scroll(struct gui_window *w, int *sx, int *sy)
Definition: gui.c:413
static struct gui_window_table atari_window_table
Definition: gui.c:1055
short aes_msg_out[8]
Definition: gui.c:105
static void gui_window_stop_throbber(struct gui_window *w)
Definition: gui.c:624
static void gui_window_place_caret(struct gui_window *w, int x, int y, int height, const struct rect *clip)
Place caret in window.
Definition: gui.c:642
int option_window_y
Definition: gui.c:84
char * gui_window_get_title(struct gui_window *gw)
Definition: gui.c:589
bool rendering
Definition: gui.c:77
@ URL_WIDGET
Definition: gui.h:82
@ WIDGET_NONE
Definition: gui.h:81
#define CARET_STATE_ENABLED
Definition: gui.h:35
#define MFORM_EX_FLAG_USERFORM
Definition: gui.h:51
struct s_gem_cursors gem_cursors
#define PATH_MAX
Definition: gui.h:31
void atari_global_history_init(void)
Definition: history.c:110
void atari_global_history_destroy(void)
Definition: history.c:169
void gem_set_cursor(MFORM_EX *cursor)
Definition: misc.c:196
nserror atari_warn_user(const char *warning, const char *detail)
Warn the user of an event.
Definition: misc.c:56
const struct plotter_table atari_plotters
atari plottr operation table
Definition: plot.c:2507
int plot_finalise(void)
Definition: plot.c:1748
int plot_init(const struct redraw_context *ctx, char *fdrvrname)
Init screen and font driver objects.
Definition: plot.c:1612
int schedule_run(void)
Process events up to current time.
Definition: schedule.c:137
nserror atari_schedule(int ival, void(*callback)(void *p), void *p)
Schedule a callback.
Definition: schedule.c:103
void toolbar_init(void)
Definition: toolbar.c:236
void toolbar_set_url(struct s_toolbar *tb, const char *text)
Definition: toolbar.c:584
void toolbar_set_throbber_state(struct s_toolbar *tb, bool active)
Definition: toolbar.c:600
void toolbar_throbber_progress(struct s_toolbar *tb)
Definition: toolbar.c:649
bool toolbar_key_input(struct s_toolbar *tb, short nkc)
Definition: toolbar.c:677
void toolbar_exit(void)
Definition: toolbar.c:261
Low-level source data cache backing store interface.
struct gui_llcache_table * filesystem_llcache_table
Browser window creation and manipulation interface.
bool browser_window_has_content(struct browser_window *bw)
Find out if a browser window is currently showing a content.
void browser_window_destroy(struct browser_window *bw)
Close and destroy a browser window.
nserror browser_window_get_extents(struct browser_window *bw, bool scaled, int *width, int *height)
Get a browser window's content extents.
nserror browser_window_create(enum browser_window_create_flags flags, struct nsurl *url, struct nsurl *referrer, struct browser_window *existing, struct browser_window **bw)
Create and open a new root browser window with the given page.
@ BW_CREATE_HISTORY
this will form a new history node (don't set for back/reload/etc)
static os_mode mode
The current sprite mode.
Definition: buffer.c:72
static osspriteop_area * buffer
The buffer characteristics.
Definition: buffer.c:55
Unified cookie database public interface.
void urldb_save_cookies(const char *filename)
Save persistent cookies to file.
Definition: urldb.c:4448
void urldb_load_cookies(const char *filename)
Load a cookie file into the database.
Definition: urldb.c:4281
Useful interned string pointers (interface).
int deskmenu_dispatch_keypress(unsigned short kcode, unsigned short kstate, unsigned short nkc)
Handle an keypress (check for accelerator)
Definition: deskmenu.c:769
void deskmenu_destroy(void)
Uninstall the desktop menu.
Definition: deskmenu.c:707
void deskmenu_init(void)
Setup & display an desktop menu.
Definition: deskmenu.c:676
int deskmenu_dispatch_item(short title, short item)
Handle an menu item event.
Definition: deskmenu.c:734
struct gui_utf8_table * atari_utf8_table
Definition: encoding.c:81
nserror
Enumeration of error codes.
Definition: errors.h:29
@ NSERROR_BAD_PARAMETER
Bad Parameter.
Definition: errors.h:48
@ NSERROR_OK
No error.
Definition: errors.h:30
nserror utf8_to_local_encoding(const char *string, size_t len, char **result)
Definition: utf8.c:89
struct gui_bitmap_table * atari_bitmap_table
Definition: bitmap.c:391
Atari bitmap handling implementation.
struct gui_download_table * atari_download_table
Definition: download.c:453
struct gui_file_table * atari_file_table
Definition: file.c:296
struct gui_layout_table * atari_layout_table
Definition: font.c:156
void atari_hotlist_destroy(void)
Definition: hotlist.c:265
void atari_hotlist_init(void)
Definition: hotlist.c:192
struct gui_search_table * atari_search_table
Definition: search.c:59
void nsatari_search_session_destroy(struct s_search_form_session *s)
Definition: search.c:224
void atari_treeview_flush_redraws(void)
Process all redraw request of all open Treeview windows.
Definition: treeview.c:824
static nserror store(nsurl *url, enum backing_store_flags bsflags, uint8_t *data, const size_t datalen)
Place an object in the backing store.
Interface to platform-specific clipboard operations.
Public content interface.
struct bitmap * content_get_bitmap(struct hlcache_handle *h)
Retrieve the bitmap contained in an image content.
Definition: content.c:1264
Interface to platform-specific fetcher operations.
Interface to platform-specific layout operation table.
Interface to platform-specific miscellaneous browser operation table.
@ BROWSER_POINTER_DEFAULT
Definition: mouse.h:113
gui_pointer_shape
Definition: mouse.h:89
@ GUI_POINTER_WAIT
Definition: mouse.h:104
@ GUI_POINTER_RIGHT
Definition: mouse.h:97
@ GUI_POINTER_MOVE
Definition: mouse.h:103
@ GUI_POINTER_CARET
Definition: mouse.h:92
@ GUI_POINTER_PROGRESS
Definition: mouse.h:108
@ GUI_POINTER_RD
Definition: mouse.h:101
@ GUI_POINTER_LD
Definition: mouse.h:99
@ GUI_POINTER_NO_DROP
Definition: mouse.h:106
@ GUI_POINTER_DOWN
Definition: mouse.h:95
@ GUI_POINTER_UP
Definition: mouse.h:94
@ GUI_POINTER_RU
Definition: mouse.h:98
@ GUI_POINTER_HELP
Definition: mouse.h:105
@ GUI_POINTER_MENU
Definition: mouse.h:93
@ GUI_POINTER_POINT
Definition: mouse.h:91
@ GUI_POINTER_LEFT
Definition: mouse.h:96
@ GUI_POINTER_NOT_ALLOWED
Definition: mouse.h:107
@ GUI_POINTER_LU
Definition: mouse.h:100
@ GUI_POINTER_CROSS
Definition: mouse.h:102
Target independent plotting interface.
Interface to platform-specific graphical user interface window operations.
gui_window_create_flags
Window creation control flags.
Definition: window.h:66
gui_window_event
Window events.
Definition: window.h:80
@ GW_EVENT_REMOVE_CARET
Remove the caret, if present.
Definition: window.h:98
@ GW_EVENT_NEW_CONTENT
Called when the gui_window has new content.
Definition: window.h:118
@ GW_EVENT_STOP_THROBBER
stop the navigation throbber.
Definition: window.h:108
@ GW_EVENT_UPDATE_EXTENT
Update the extent of the inside of a browser window to that of the current content.
Definition: window.h:93
@ GW_EVENT_START_THROBBER
start the navigation throbber.
Definition: window.h:103
nserror nslog_init(nslog_ensure_t *ensure, int *pargc, char **argv)
Initialise the logging system.
Definition: log.c:190
void nslog_finalise(void)
Shut down the logging system.
Definition: log.c:299
#define NSLOG(catname, level, logmsg, args...)
Definition: log.h:116
nserror messages_add_from_file(const char *path)
Read keys and values from messages file into the standard Messages hash.
Definition: messages.c:177
const char * messages_get_errorcode(nserror code)
lookup of a message by errorcode from the standard Messages hash.
Definition: messages.c:248
Localised message support (interface).
NetSurf core interface registration, construction and destruction.
void netsurf_exit(void)
Finalise NetSurf core.
Definition: netsurf.c:232
nserror netsurf_init(const char *store_path)
Initialise netsurf core.
Definition: netsurf.c:107
nserror netsurf_register(struct netsurf_table *table)
Register operation table.
Definition: gui_factory.c:707
nserror nsurl_create(const char *const url_s, nsurl **url)
Create a NetSurf URL object from a URL string.
void nsurl_unref(nsurl *url)
Drop a reference to a NetSurf URL object.
const char * nsurl_access(const nsurl *url)
Access a NetSurf URL object as a string.
struct nsurl nsurl
NetSurf URL object.
Definition: nsurl.h:31
#define MIN(a, b)
Definition: os3support.h:51
void init_os_info(void)
Definition: osspec.c:40
NS_ATARI_SYSINFO atari_sysinfo
Definition: osspec.c:38
int width
Definition: gui.c:159
void die(const char *const error)
Display an error and exit.
Definition: gui.c:2118
int height
Definition: gui.c:160
void window_get_scroll(ROOTWIN *rootwin, int *x, int *y)
Definition: rootwin.c:591
void window_update_back_forward(struct s_gui_win_root *rootwin)
Definition: rootwin.c:433
void window_set_icon(ROOTWIN *rootwin, struct bitmap *bmp)
Definition: rootwin.c:553
struct gui_window * window_get_active_gui_window(ROOTWIN *rootwin)
Definition: rootwin.c:586
void window_set_focus(struct s_gui_win_root *rootwin, enum focus_element_type type, void *element)
Definition: rootwin.c:498
void window_schedule_redraw_grect(ROOTWIN *rootwin, GRECT *area)
Definition: rootwin.c:807
void window_scroll_by(ROOTWIN *root, int sx, int sy)
Definition: rootwin.c:459
void window_unref_gui_window(ROOTWIN *rootwin, struct gui_window *gw)
Definition: rootwin.c:312
void window_set_title(struct s_gui_win_root *rootwin, char *title)
Definition: rootwin.c:454
void window_set_content_size(ROOTWIN *rootwin, int width, int height)
Set the dimensions of the scrollable content.
Definition: rootwin.c:481
int window_create(struct gui_window *gw, struct browser_window *bw, struct gui_window *existing, unsigned long inflags)
Definition: rootwin.c:225
void window_get_grect(ROOTWIN *rootwin, enum browser_area_e which, GRECT *d)
Definition: rootwin.c:601
void window_place_caret(ROOTWIN *rootwin, short mode, int content_x, int content_y, int h, GRECT *work)
Definition: rootwin.c:875
void window_open(ROOTWIN *rootwin, struct gui_window *gw, GRECT pos)
show the window at specified position and make gw the active tab.
Definition: rootwin.c:375
void window_set_stauts(struct s_gui_win_root *rootwin, char *text)
Definition: rootwin.c:439
void window_process_redraws(ROOTWIN *rootwin)
Definition: rootwin.c:1015
#define WIDGET_STATUSBAR
Definition: rootwin.h:27
@ BROWSER_AREA_CONTENT
Definition: rootwin.h:34
#define WIDGET_TOOLBAR
Definition: rootwin.h:28
#define WIDGET_RESIZE
Definition: rootwin.h:30
#define WIDGET_SCROLL
Definition: rootwin.h:29
short aes_max_win_title_len
Definition: osspec.h:35
RISC OS wimp toolkit bitmap.
Definition: bitmap.c:68
Browser window data.
HTML form.
function table for clipboard operations.
Definition: clipboard.h:42
void(* get)(char **buffer, size_t *length)
Core asks front end for clipboard contents.
Definition: clipboard.h:49
function table for fetcher operations.
Definition: fetch.h:33
const char *(* filetype)(const char *unix_path)
Determine the MIME type of a local file.
Definition: fetch.h:45
Graphical user interface browser misc function table.
Definition: misc.h:39
nserror(* schedule)(int t, void(*callback)(void *p), void *p)
Schedule a callback.
Definition: misc.h:58
Graphical user interface window function table.
Definition: window.h:137
struct gui_window *(* create)(struct browser_window *bw, struct gui_window *existing, gui_window_create_flags flags)
Create and open a gui window for a browsing context.
Definition: window.h:164
first entry in window list
Definition: gui.c:296
struct gui_window * prev
Previous in linked list.
Definition: gui.h:159
MFORM_EX * cursor
Definition: gui.h:150
struct gui_window * next
list for cleanup
Definition: gui.h:159
char * url
Definition: gui.h:154
struct s_search_form_session * search
Definition: gui.h:158
char * status
Definition: gui.h:152
struct bitmap * icon
Definition: gui.h:156
struct s_gui_win_root * root
Definition: gui.h:148
char * title
Definition: gui.h:153
struct s_browser * browser
Definition: gui.h:149
struct browser_window * bw
The 'content' window that is rendered in the gui_window.
Definition: gui.c:314
High-level cache handle.
Definition: hlcache.c:66
Definition: gui.h:54
OBJECT * tree
Definition: gui.h:57
unsigned char flags
Definition: gui.h:55
int number
Definition: gui.h:56
NetSurf operation function table.
Definition: gui_table.h:48
struct gui_misc_table * misc
Browser table.
Definition: gui_table.h:57
Rectangle coordinates.
Definition: types.h:40
int x0
Definition: types.h:41
int y0
Top left.
Definition: types.h:41
int x1
Definition: types.h:42
int y1
Bottom right.
Definition: types.h:42
Redraw context.
Definition: plotters.h:51
bool interactive
Redraw to show interactive features.
Definition: plotters.h:59
struct browser_window * bw
Definition: gui.h:137
unsigned short state
Definition: gui.h:41
MFORM_EX sizens
Definition: gui.h:68
MFORM_EX help
Definition: gui.h:75
MFORM_EX menu
Definition: gui.h:76
MFORM_EX wait
Definition: gui.h:71
MFORM_EX hand
Definition: gui.h:63
MFORM_EX cross
Definition: gui.h:65
MFORM_EX ibeam
Definition: gui.h:64
MFORM_EX arrow
Definition: gui.h:77
MFORM_EX sizewe
Definition: gui.h:67
MFORM_EX appstarting
Definition: gui.h:72
MFORM_EX nodrop
Definition: gui.h:73
MFORM_EX sizeall
Definition: gui.h:66
MFORM_EX deny
Definition: gui.h:74
MFORM_EX sizenwse
Definition: gui.h:70
MFORM_EX sizenesw
Definition: gui.h:69
CMP_TOOLBAR toolbar
Definition: gui.h:122
GUIWIN * win
Definition: gui.h:121
struct s_redrw_slots redraw_slots
Definition: gui.h:128
struct s_caret caret
Definition: gui.h:129
struct gui_window * active_gui_window
Definition: gui.h:127
short volatile areas_used
Definition: redrawslots.h:41
struct s_throbber_widget throbber
Definition: toolbar.h:46
struct rect rect
Rectangle coordinates.
Unified URL information database public interface.
nserror urldb_save(const char *filename)
Export the current database to file.
Definition: urldb.c:3094
nserror urldb_load(const char *filename)
Import an URL database from file, replacing any existing database.
Definition: urldb.c:2876
nserror netsurf_path_to_nsurl(const char *path, struct nsurl **url)
Create a nsurl from a path.
Definition: file.c:307
struct nsoption_s * nsoptions_default
global default option table.
Definition: nsoption.c:46
static struct nsoption_s defaults[]
The table of compiled in default options.
Definition: nsoption.c:64
nserror nsoption_read(const char *path, struct nsoption_s *opts)
Read choices file and set them in the passed table.
Definition: nsoption.c:717
struct nsoption_s * nsoptions
global active option table.
Definition: nsoption.c:45
nserror nsoption_commandline(int *pargc, char **argv, struct nsoption_s *opts)
Process commandline and set options approriately.
Definition: nsoption.c:824
nserror nsoption_init(nsoption_set_default_t *set_defaults, struct nsoption_s **popts, struct nsoption_s **pdefs)
Initialise option system.
Definition: nsoption.c:629
Option reading and saving interface.
#define nsoption_charp(OPTION)
Get the value of a string option.
Definition: nsoption.h:297
#define nsoption_setnull_charp(OPTION, VALUE)
set string option in default table if currently unset
Definition: nsoption.h:342
#define nsoption_int(OPTION)
Get the value of an integer option.
Definition: nsoption.h:279
#define nsoption_set_bool(OPTION, VALUE)
set a boolean option in the default table
Definition: nsoption.h:310
static nserror path(const struct redraw_context *ctx, const plot_style_t *pstyle, const float *p, unsigned int n, const float transform[6])
Plots a path.
Definition: plot.c:821
static nserror text(const struct redraw_context *ctx, const struct plot_font_style *fstyle, int x, int y, const char *text, size_t length)
Text plotting.
Definition: plot.c:978
static nserror clip(const struct redraw_context *ctx, const struct rect *clip)
Sets a clip rectangle for subsequent plot operations.
Definition: plot.c:357