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 "atari/treeview.h"
70#include "cflib.h"
71
72static bool atari_quit = false;
73
74struct gui_window *input_window = NULL;
75struct gui_window *window_list = NULL;
78bool rendering = false;
80
81/* Comandline / Options: */
86
87/* Defaults to option_homepage_url, commandline options overwrites that value */
89
90/* path to choices file: */
92
93EVMULT_IN aes_event_in = {
94 .emi_flags = MU_MESAG | MU_TIMER | MU_KEYBD | MU_BUTTON | MU_M1,
95 .emi_bclicks = 258,
96 .emi_bmask = 3,
97 .emi_bstate = 0,
98 .emi_m1leave = MO_ENTER,
99 .emi_m1 = {0,0,0,0},
100 .emi_m2leave = 0,
101 .emi_m2 = {0,0,0,0},
102 .emi_tlow = 0,
103 .emi_thigh = 0
104};
105EVMULT_OUT aes_event_out;
106short aes_msg_out[8];
107
108bool gui_window_get_scroll(struct gui_window *w, int *sx, int *sy);
109static nserror gui_window_set_url(struct gui_window *w, nsurl *url);
110
111/**
112 * Core atari event processing.
113 */
114static void atari_poll(void)
115{
116
117 struct gui_window *tmp;
118 short mx, my, dummy;
119
120 aes_event_in.emi_tlow = schedule_run();
121
122 if(rendering){
123 aes_event_in.emi_tlow = nsoption_int(atari_gui_poll_timeout);
124 }
125
126 if(aes_event_in.emi_tlow < 0) {
127 aes_event_in.emi_tlow = 10000;
128 printf("long poll!\n");
129 }
130
133 }
134
135
136 graf_mkstate(&mx, &my, &dummy, &dummy);
137 aes_event_in.emi_m1.g_x = mx;
138 aes_event_in.emi_m1.g_y = my;
139 evnt_multi_fast(&aes_event_in, aes_msg_out, &aes_event_out);
140 if(gemtk_wm_dispatch_event(&aes_event_in, &aes_event_out, aes_msg_out) == 0) {
141 if( (aes_event_out.emo_events & MU_MESAG) != 0 ) {
142 NSLOG(netsurf, INFO, "WM: %d\n", aes_msg_out[0]);
143 switch(aes_msg_out[0]) {
144
145 case MN_SELECTED:
146 NSLOG(netsurf, INFO, "Menu Item: %d\n", aes_msg_out[4]);
148 break;
149
150 case AP_TERM:
151 atari_quit = true;
152 break;
153 default:
154 break;
155 }
156 }
157 if((aes_event_out.emo_events & MU_KEYBD) != 0) {
158 uint16_t nkc = gem_to_norm( (short)aes_event_out.emo_kmeta,
159 (short)aes_event_out.emo_kreturn);
161 aes_event_out.emo_kmeta, nkc);
162 }
163 }
164
165 tmp = window_list;
166 while(tmp){
167 if(tmp->root->redraw_slots.areas_used > 0){
169 }
170 tmp = tmp->next;
171 }
172
173 /** @todo implement generic treeview redraw function. */
174 /** @todo rename hl to atari_hotlist or create getter for it... */
175
177}
178
179/**
180 * Create and open a gui window for a browsing context.
181 *
182 * \param bw bw to create gui_window for
183 * \param existing an existing gui_window, may be NULL
184 * \param flags flags for gui window creation
185 * \return gui window, or NULL on error
186 *
187 * If GW_CREATE_CLONE flag is set existing is non-NULL.
188 *
189 * The created gui_window must include a reference to the browser
190 * window passed in the bw param.
191 */
192static struct gui_window *
194 struct gui_window *existing,
196{
197 struct gui_window *gw=NULL;
198 NSLOG(netsurf, INFO, "gw: %p, BW: %p, existing %p, flags: %d\n", gw, bw,
199 existing, (int)flags);
200
201 gw = calloc(1, sizeof(struct gui_window));
202 if (gw == NULL)
203 return NULL;
204
205 NSLOG(netsurf, INFO, "new window: %p, bw: %p\n", gw, bw);
208 if (gw->root->win) {
209 GRECT pos = {
212 };
213 gui_window_set_url(gw, corestring_nsurl_about_blank);
216 window_open(gw->root, gw, pos);
217 }
218
219 /* add the window to the window list: */
220 if( window_list == NULL ) {
221 window_list = gw;
222 gw->next = NULL;
223 gw->prev = NULL;
224 } else {
225 struct gui_window * tmp = window_list;
226 while( tmp->next != NULL ) {
227 tmp = tmp->next;
228 }
229 tmp->next = gw;
230 gw->prev = tmp;
231 gw->next = NULL;
232 }
233
234 /* Loose focus: */
235 window_set_focus(gw->root, WIDGET_NONE, NULL );
236
237 /* trigger on-focus event (select all text): */
238 window_set_focus(gw->root, URL_WIDGET, NULL);
239
240 /* delete selection: */
241 toolbar_key_input(gw->root->toolbar, NK_DEL);
242
243 return( gw );
244
245}
246
247/**
248 * Destroy previously created gui window
249 *
250 * \param gw The gui window to destroy.
251 */
253{
254 if (gw == NULL)
255 return;
256
257 NSLOG(netsurf, INFO, "%s\n", __FUNCTION__);
258
259 if (input_window == gw) {
261 }
262
264 free(gw->browser);
265 free(gw->status);
266 free(gw->title);
267 free(gw->url);
268
269 /* unlink the window: */
270 if(gw->prev != NULL ) {
271 gw->prev->next = gw->next;
272 } else {
273 window_list = gw->next;
274 }
275 if( gw->next != NULL ) {
276 gw->next->prev = gw->prev;
277 }
278
280
281 free(gw);
282 gw = NULL;
283
284 if(input_window == NULL) {
285 gw = window_list;
286 while( gw != NULL ) {
287 if(gw->root) {
289 break;
290 }
291 gw = gw->next;
292 }
293 }
294}
295
296/**
297 * Find the current dimensions of a atari browser window content area.
298 *
299 * \param gw The gui window to measure content area of.
300 * \param width receives width of window
301 * \param height receives height of window
302 * \return NSERROR_OK on sucess and width and height updated
303 * else error code.
304 */
305static nserror
307{
308 GRECT rect;
310 *width = rect.g_w;
311 *height = rect.g_h;
312
313 return NSERROR_OK;
314}
315
316/**
317 * Set the title of a window.
318 *
319 * \param gw window to update
320 * \param title new window title
321 */
322static void gui_window_set_title(struct gui_window *gw, const char *title)
323{
324 if (gw == NULL)
325 return;
326
327 if (gw->root) {
328
329 int l;
330 char * conv;
331 l = strlen(title)+1;
332 if (utf8_to_local_encoding(title, l-1, &conv) == NSERROR_OK ) {
333 l = MIN((uint32_t)atari_sysinfo.aes_max_win_title_len, strlen(conv));
334 if(gw->title == NULL)
335 gw->title = malloc(l);
336 else
337 gw->title = realloc(gw->title, l);
338
339 strncpy(gw->title, conv, l);
340 free( conv );
341 } else {
342 l = MIN((size_t)atari_sysinfo.aes_max_win_title_len, strlen(title));
343 if(gw->title == NULL)
344 gw->title = malloc(l);
345 else
346 gw->title = realloc(gw->title, l);
347 strncpy(gw->title, title, l);
348 }
349 gw->title[l] = 0;
350 if(input_window == gw)
351 window_set_title(gw->root, gw->title);
352 }
353}
354
355/* exported interface documented in atari/gui.h */
356void atari_window_set_status(struct gui_window *w, const char *text)
357{
358 int l;
359 if (w == NULL || text == NULL)
360 return;
361
362 assert(w->root);
363
364 l = strlen(text)+1;
365 if(w->status == NULL)
366 w->status = malloc(l);
367 else
368 w->status = realloc(w->status, l);
369
370 strncpy(w->status, text, l);
371 w->status[l] = 0;
372
373 if(input_window == w)
374 window_set_stauts(w->root, (char*)text);
375}
376
377
378/**
379 * Invalidates an area of an atari browser window
380 *
381 * \param gw gui_window
382 * \param rect area to redraw or NULL for the entire window area
383 * \return NSERROR_OK on success or appropriate error code
384 */
385static nserror
387 const struct rect *rect)
388{
389 GRECT area;
390
391 if (gw == NULL) {
393 }
394
396
397 if (rect != NULL) {
398 struct gemtk_wm_scroll_info_s *slid;
399
400 slid = gemtk_wm_get_scroll_info(gw->root->win);
401
402 area.g_x += rect->x0 - (slid->x_pos * slid->x_unit_px);
403 area.g_y += rect->y0 - (slid->y_pos * slid->y_unit_px);
404 area.g_w = rect->x1 - rect->x0;
405 area.g_h = rect->y1 - rect->y0;
406 }
407
408 //dbg_grect("update box", &area);
410
411 return NSERROR_OK;
412}
413
414bool gui_window_get_scroll(struct gui_window *w, int *sx, int *sy)
415{
416 if (w == NULL)
417 return false;
418
419 window_get_scroll(w->root, sx, sy);
420
421 return( true );
422}
423
424/**
425 * Set the scroll position of a atari browser window.
426 *
427 * Scrolls the viewport to ensure the specified rectangle of the
428 * content is shown. The atari implementation scrolls the contents so
429 * the specified point in the content is at the top of the viewport.
430 *
431 * \param gw gui window to scroll
432 * \param rect The rectangle to ensure is shown.
433 * \return NSERROR_OK on success or apropriate error code.
434 */
435static nserror
436gui_window_set_scroll(struct gui_window *gw, const struct rect *rect)
437{
438 if ((gw == NULL) ||
439 (gw->browser->bw == NULL) ||
442 }
443
444 NSLOG(netsurf, INFO, "scroll (gui_window: %p) %d, %d\n", gw, rect->x0,
445 rect->y0);
447
448 return NSERROR_OK;
449}
450
451/**
452 * Update the extent of the inside of a browser window to that of the
453 * current content.
454 *
455 * It seems this method is called when content size got adjusted, so
456 * that we can adjust scroll info. We also have to call it when tab
457 * change occurs.
458 *
459 * \param gw gui_window to update the extent of
460 */
462{
463
465 /** @todo store content size. */
466 if(window_get_active_gui_window(gw->root) == gw) {
467 int width, height;
468 GRECT area;
474 }
475 }
476}
477
478
479/**
480 * set the pointer shape
481 */
483{
484 if (gw == NULL)
485 return;
486
487 switch (shape) {
488 case GUI_POINTER_POINT: /* link */
489 gw->cursor = &gem_cursors.hand;
490 break;
491
492 case GUI_POINTER_MENU:
493 gw->cursor = &gem_cursors.menu;
494 break;
495
496 case GUI_POINTER_CARET: /* input */
497 gw->cursor = &gem_cursors.ibeam;
498 break;
499
501 gw->cursor = &gem_cursors.cross;
502 break;
503
504 case GUI_POINTER_MOVE:
506 break;
507
509 case GUI_POINTER_LEFT:
511 break;
512
513 case GUI_POINTER_UP:
514 case GUI_POINTER_DOWN:
516 break;
517
518 case GUI_POINTER_RU:
519 case GUI_POINTER_LD:
521 break;
522
523 case GUI_POINTER_RD:
524 case GUI_POINTER_LU:
526 break;
527
528 case GUI_POINTER_WAIT:
529 gw->cursor = &gem_cursors.wait;
530 break;
531
534 break;
535
538 break;
539
541 gw->cursor = &gem_cursors.deny;
542 break;
543
544 case GUI_POINTER_HELP:
545 gw->cursor = &gem_cursors.help;
546 break;
547
548 default:
549 gw->cursor = &gem_cursors.arrow;
550 break;
551 }
552
553 if (input_window == gw) {
555 }
556}
557
558
560{
561 int l;
562
563 if (w == NULL)
564 return NSERROR_OK;
565
566 l = strlen(nsurl_access(url))+1;
567
568 if (w->url == NULL) {
569 w->url = malloc(l);
570 } else {
571 w->url = realloc(w->url, l);
572 }
573 strncpy(w->url, nsurl_access(url), l);
574 w->url[l] = 0;
577 }
578
579 return NSERROR_OK;
580}
581
583{
584 if (gw == NULL) {
585 return(NULL);
586 }
587 return(gw->url);
588}
589
591{
592 if (gw == NULL) {
593 return(NULL);
594 }
595 return(gw->title);
596}
597
598static void throbber_advance( void * data )
599{
600
601 struct gui_window * gw = (struct gui_window *)data;
602
603 if (gw->root == NULL)
604 return;
605 if (gw->root->toolbar == NULL)
606 return;
607
608 if (gw->root->toolbar->throbber.running == false)
609 return;
610
613}
614
616{
617 if (w == NULL)
618 return;
619
622 rendering = true;
623}
624
626{
627 if (w == NULL)
628 return;
629 if (w->root->toolbar->throbber.running == false)
630 return;
631
633
635
636 rendering = false;
637}
638
639/**
640 * Place caret in window
641 */
642static void
643gui_window_place_caret(struct gui_window *w, int x, int y, int height,
644 const struct rect *clip)
645{
646 window_place_caret(w->root, 1, x, y, height, NULL);
648 return;
649}
650
651
652/**
653 * clear window caret
654 */
655static void
657{
658 if (w == NULL)
659 return;
660
661 if ((w->root->caret.state & CARET_STATE_ENABLED) != 0) {
662 //printf("gw hide caret\n");
663 window_place_caret(w->root, 0, -1, -1, -1, NULL);
664 w->root->caret.state &= ~CARET_STATE_ENABLED;
665 }
666 return;
667}
668
669/**
670 * Set a favicon for a gui window.
671 *
672 * \param g window to update.
673 * \param icon handle to object to use as icon.
674 */
675static void
677{
678 struct bitmap *bmp_icon;
679
680 bmp_icon = (icon != NULL) ? content_get_bitmap(icon) : NULL;
681 g->icon = bmp_icon;
682 if(input_window == g) {
683 window_set_icon(g->root, bmp_icon);
684 }
685}
686
687static void gui_window_new_content(struct gui_window *w)
688{
689 struct gemtk_wm_scroll_info_s *slid = gemtk_wm_get_scroll_info(w->root->win);
690 slid->x_pos = 0;
691 slid->y_pos = 0;
692 gemtk_wm_update_slider(w->root->win, GEMTK_WM_VH_SLIDER);
694}
695
696
697/**
698 * Core asks front end for clipboard contents.
699 *
700 * \param buffer UTF-8 text, allocated by front end, ownership yeilded to core
701 * \param length Byte length of UTF-8 text in buffer
702 */
703static void gui_get_clipboard(char **buffer, size_t *length)
704{
705 char *clip;
706
707 *length = 0;
708 *buffer = 0;
709
711
712 if(clip == NULL) {
713 return;
714 } else {
715
716 // clipboard is in atari encoding, convert it to utf8:
717
718 size_t clip_len;
719 char *utf8 = NULL;
720
721 clip_len = strlen(clip);
722 if (clip_len > 0) {
723 nserror ret;
724 ret = utf8_to_local_encoding(clip, clip_len, &utf8);
725 if (ret == NSERROR_OK && utf8 != NULL) {
726 *buffer = utf8;
727 *length = strlen(utf8);
728 } else {
729 assert(ret == NSERROR_OK && utf8 != NULL);
730 }
731 }
732
733 free(clip);
734 }
735}
736
737/**
738 * Core tells front end to put given text in clipboard
739 *
740 * \param buffer UTF-8 text, owned by core
741 * \param length Byte length of UTF-8 text in buffer
742 * \param styles Array of styles given to text runs, owned by core, or NULL
743 * \param n_styles Number of text run styles in array
744 */
745static void gui_set_clipboard(const char *buffer, size_t length,
746 nsclipboard_styles styles[], int n_styles)
747{
748 if (length > 0 && buffer != NULL) {
749
750 // convert utf8 input to atari encoding:
751
752 nserror ret;
753 char *clip = NULL;
754
755 ret = utf8_to_local_encoding(buffer,length, &clip);
756 if (ret == NSERROR_OK) {
758 } else {
759 assert(ret == NSERROR_OK);
760 }
761 free(clip);
762 }
763}
764
766{
767 NSLOG(netsurf, INFO, "Setting input window from: %p to %p\n",
768 input_window, gw);
769 input_window = gw;
770}
771
773{
774 return(input_window);
775}
776
777static void gui_quit(void)
778{
779 NSLOG(netsurf, INFO, "quitting");
780
781 struct gui_window *gw = window_list;
782 struct gui_window *tmp = window_list;
783
784 /* Destroy all remaining browser windows: */
785 while (gw) {
786 tmp = gw->next;
788 gw = tmp;
789 }
790
791 /* destroy the treeview windows: */
795
796 /* shutdown the toolbar framework: */
797 toolbar_exit();
798
799 /* save persistent informations: */
801 urldb_save(nsoption_charp(url_file));
802
804 gemtk_wm_exit();
805
806 rsrc_free();
807
808 NSLOG(netsurf, INFO, "Shutting down plotter");
810 NSLOG(netsurf, INFO, "done");
811}
812
813/**
814 * Process commandline parameters.
815 */
816static bool
817process_cmdline(int argc, char** argv)
818{
819 int opt;
820 bool set_default_dimensions = true;
821
822 NSLOG(netsurf, INFO, "argc %d, argv %p", argc, argv);
823
824 if ((nsoption_int(window_width) != 0) && (nsoption_int(window_height) != 0)) {
825
826 option_window_width = nsoption_int(window_width);
827 option_window_height = nsoption_int(window_height);
828 option_window_x = nsoption_int(window_x);
829 option_window_y = nsoption_int(window_y);
830
833 set_default_dimensions = false;
834 }
835 }
836
837 if (set_default_dimensions) {
838 if( sys_type() == SYS_TOS ) {
839 /* on single tasking OS, start as fulled window: */
844 } else {
847 option_window_x = 10;
848 option_window_y = 30;
849 }
850 }
851
852 if (nsoption_charp(homepage_url) != NULL)
853 option_homepage_url = nsoption_charp(homepage_url);
854 else
855 option_homepage_url = NETSURF_HOMEPAGE;
856
857 while((opt = getopt(argc, argv, "w:h:")) != -1) {
858 switch (opt) {
859 case 'w':
860 option_window_width = atoi(optarg);
861 break;
862
863 case 'h':
864 option_window_height = atoi(optarg);
865 break;
866
867 default:
868 fprintf(stderr,
869 "Usage: %s [w,h,v] url\n",
870 argv[0]);
871 return false;
872 }
873 }
874
875 if (optind < argc) {
876 option_homepage_url = argv[optind];
877 }
878 return true;
879}
880
881static inline void create_cursor(int flags, short mode, void * form,
882 MFORM_EX * m)
883{
884 m->flags = flags;
885 m->number = mode;
886 if( flags & MFORM_EX_FLAG_USERFORM ) {
887 m->number = mode;
888 m->tree = (OBJECT*)form;
889 }
890}
891
892static nsurl *gui_get_resource_url(const char *path)
893{
894 char buf[PATH_MAX];
895 nsurl *url = NULL;
896
897 atari_find_resource((char*)&buf, path, path);
898
900
901 return url;
902}
903
904/**
905 * Set option defaults for atari frontend
906 *
907 * @param defaults The option table to update.
908 * @return error status.
909 */
911{
912 /* Set defaults for absent option strings */
913 nsoption_setnull_charp(cookie_file, strdup("cookies"));
914 if (nsoption_charp(cookie_file) == NULL) {
915 NSLOG(netsurf, INFO, "Failed initialising string options");
917 }
918 return NSERROR_OK;
919}
920
921static char *theapp = (char*)"NetSurf";
922
923/**
924 * Initialise atari gui.
925 */
926static void gui_init(int argc, char** argv)
927{
928 char buf[PATH_MAX];
929 OBJECT * cursors;
930
931 atari_find_resource(buf, "netsurf.rsc", "./res/netsurf.rsc");
932 NSLOG(netsurf, INFO, "Using RSC file: %s ", (char *)&buf);
933 if (rsrc_load(buf)==0) {
934
935 char msg[1024];
936
937 snprintf(msg, 1024, "Unable to open GEM Resource file (%s)!", buf);
938 die(msg);
939 }
940
941 wind_get_grect(0, WF_WORKXYWH, &desk_area);
942
943 create_cursor(0, POINT_HAND, NULL, &gem_cursors.hand );
944 create_cursor(0, TEXT_CRSR, NULL, &gem_cursors.ibeam );
945 create_cursor(0, THIN_CROSS, NULL, &gem_cursors.cross);
946 create_cursor(0, BUSY_BEE, NULL, &gem_cursors.wait);
947 create_cursor(0, ARROW, NULL, &gem_cursors.arrow);
948 create_cursor(0, OUTLN_CROSS, NULL, &gem_cursors.sizeall);
949 create_cursor(0, OUTLN_CROSS, NULL, &gem_cursors.sizenesw);
950 create_cursor(0, OUTLN_CROSS, NULL, &gem_cursors.sizenwse);
951 cursors = gemtk_obj_get_tree(CURSOR);
952 create_cursor(MFORM_EX_FLAG_USERFORM, CURSOR_APPSTART,
953 cursors, &gem_cursors.appstarting);
956 cursors, &gem_cursors.sizewe);
958 cursors, &gem_cursors.sizens);
960 cursors, &gem_cursors.nodrop);
962 cursors, &gem_cursors.deny);
964 cursors, &gem_cursors.menu);
966 cursors, &gem_cursors.help);
967
968 NSLOG(netsurf, INFO, "Enabling core select menu");
969 nsoption_set_bool(core_select_menu, true);
970
971 NSLOG(netsurf, INFO, "Loading url.db from: %s", nsoption_charp(url_file));
972 if( strlen(nsoption_charp(url_file)) ) {
973 urldb_load(nsoption_charp(url_file));
974 }
975
976 NSLOG(netsurf, INFO, "Loading cookies from: %s",
977 nsoption_charp(cookie_file));
978 if( strlen(nsoption_charp(cookie_file)) ) {
980 }
981
982 if (process_cmdline(argc,argv) != true)
983 die("unable to process command line.\n");
984
985 NSLOG(netsurf, INFO, "Initializing NKC...");
986 nkc_init();
987
988 NSLOG(netsurf, INFO, "Initializing plotters...");
989 struct redraw_context ctx = {
990 .interactive = true,
991 .background_images = true,
992 .plot = &atari_plotters
993 };
994 plot_init(&ctx, nsoption_charp(atari_font_driver));
995
996 aes_event_in.emi_m1leave = MO_LEAVE;
997 aes_event_in.emi_m1.g_w = 1;
998 aes_event_in.emi_m1.g_h = 1;
999 //next_poll = clock() + (CLOCKS_PER_SEC>>3);
1000
1001 deskmenu_init();
1002 menu_register( -1, theapp);
1003 if (sys_type() & (SYS_MAGIC|SYS_NAES|SYS_XAAES)) {
1004 menu_register( _AESapid, (char*)" NetSurf ");
1005 }
1006 gemtk_wm_init();
1007
1008 /* Initialize the specific treeview windows: */
1012
1013 /* Initialize the toolbar framework: */
1014 toolbar_init();
1015}
1016
1017
1018/**
1019 * process miscellaneous window events
1020 *
1021 * \param gw The window receiving the event.
1022 * \param event The event code.
1023 * \return NSERROR_OK when processed ok
1024 */
1025static nserror
1027{
1028 switch (event) {
1031 break;
1032
1035 break;
1036
1039 break;
1040
1043 break;
1044
1047 break;
1048
1049 default:
1050 break;
1051 }
1052 return NSERROR_OK;
1053}
1054
1055
1058 .destroy = gui_window_destroy,
1059 .invalidate = atari_window_invalidate_area,
1060 .get_scroll = gui_window_get_scroll,
1061 .set_scroll = gui_window_set_scroll,
1062 .get_dimensions = gui_window_get_dimensions,
1063 .event = gui_window_event,
1064
1065 .set_title = gui_window_set_title,
1066 .set_url = gui_window_set_url,
1067 .set_icon = gui_window_set_icon,
1068 .set_status = atari_window_set_status,
1069 .set_pointer = gui_window_set_pointer,
1070 .place_caret = gui_window_place_caret,
1071};
1072
1075 .set = gui_set_clipboard,
1076};
1077
1080
1081 .get_resource_url = gui_get_resource_url,
1082};
1083
1086
1087 .quit = gui_quit,
1088};
1089
1090/* #define WITH_DBG_LOGFILE 1 */
1091/**
1092 * Entry point from OS.
1093 *
1094 * /param argc The number of arguments in the string vector.
1095 * /param argv The argument string vector.
1096 * /return The return code to the OS
1097 */
1098int main(int argc, char** argv)
1099{
1100 char messages[PATH_MAX];
1101 char store[PATH_MAX];
1102 const char *addr;
1103 char * file_url = NULL;
1104 struct stat stat_buf;
1105 nsurl *url;
1106 nserror ret;
1107
1108 struct netsurf_table atari_table = {
1110 .window = &atari_window_table,
1111 .corewindow = atari_core_window_table,
1112 .clipboard = &atari_clipboard_table,
1113 .download = atari_download_table,
1114 .fetch = &atari_fetch_table,
1115 .file = atari_file_table,
1116 .utf8 = atari_utf8_table,
1117 .search = atari_search_table,
1118 .llcache = filesystem_llcache_table,
1119 .bitmap = atari_bitmap_table,
1120 .layout = atari_layout_table
1121 };
1122
1123 ret = netsurf_register(&atari_table);
1124 if (ret != NSERROR_OK) {
1125 die("NetSurf operation table failed registration");
1126 }
1127
1128 /** @todo logging file descriptor update belongs in a nslog_init callback */
1129 setbuf(stderr, NULL);
1130 setbuf(stdout, NULL);
1131#ifdef WITH_DBG_LOGFILE
1132 freopen("stdout.log", "a+", stdout);
1133 freopen("stderr.log", "a+", stderr);
1134#endif
1135
1136 graf_mouse(BUSY_BEE, NULL);
1137
1138 init_app(NULL);
1139
1140 init_os_info();
1141
1142 atari_find_resource((char*)&messages, "messages", "res/messages");
1143 atari_find_resource((char*)&options, "Choices", "Choices");
1144 atari_find_resource((char*)&store, "cache", "res/cache");
1145
1146 /* initialise logging - not fatal if it fails but not much we can
1147 * do about it
1148 */
1149 nslog_init(NULL, &argc, argv);
1150
1151 /* user options setup */
1153 if (ret != NSERROR_OK) {
1154 die("Options failed to initialise");
1155 }
1156 nsoption_read(options, NULL);
1157 nsoption_commandline(&argc, argv, NULL);
1158
1159 ret = messages_add_from_file(messages);
1160
1161 /* common initialisation */
1162 NSLOG(netsurf, INFO, "Initialising core...");
1163 ret = netsurf_init(store);
1164 if (ret != NSERROR_OK) {
1165 die("NetSurf failed to initialise");
1166 }
1167
1168 NSLOG(netsurf, INFO, "Initializing GUI...");
1169 gui_init(argc, argv);
1170
1171 graf_mouse( ARROW , NULL);
1172
1173 NSLOG(netsurf, INFO, "Creating initial browser window...");
1174 addr = option_homepage_url;
1175 if (strncmp(addr, "file://", 7) && strncmp(addr, "http://", 7)) {
1176 if (stat(addr, &stat_buf) == 0) {
1177 file_url = local_file_to_url(addr);
1178 addr = file_url;
1179 }
1180 }
1181
1182 /* create an initial browser window */
1183 ret = nsurl_create(addr, &url);
1184 if (ret == NSERROR_OK) {
1186 url,
1187 NULL,
1188 NULL,
1189 NULL);
1190 nsurl_unref(url);
1191 }
1192 if (ret != NSERROR_OK) {
1194 } else {
1195 NSLOG(netsurf, INFO, "Entering Atari event mainloop...");
1196 while (!atari_quit) {
1197 atari_poll();
1198 }
1199 }
1200
1201 netsurf_exit();
1202
1203 free(file_url);
1204
1205#ifdef WITH_DBG_LOGFILE
1206 fclose(stdout);
1207 fclose(stderr);
1208#endif
1209 NSLOG(netsurf, INFO, "exit_gem");
1210
1211 /* finalise logging */
1213
1214 exit_gem();
1215
1216 return 0;
1217}
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:6529
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:130
void atari_cookie_manager_destroy(void)
Definition: cookies.c:197
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:105
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:745
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:436
static bool process_cmdline(int argc, char **argv)
Process commandline parameters.
Definition: gui.c:817
static nsurl * gui_get_resource_url(const char *path)
Definition: gui.c:892
static nserror gui_window_event(struct gui_window *gw, enum gui_window_event event)
process miscellaneous window events
Definition: gui.c:1026
int option_window_height
Definition: gui.c:83
long next_poll
Definition: gui.c:77
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:306
static void create_cursor(int flags, short mode, void *form, MFORM_EX *m)
Definition: gui.c:881
struct gui_window * gui_get_input_window(void)
Definition: gui.c:772
static void gui_init(int argc, char **argv)
Initialise atari gui.
Definition: gui.c:926
const char * option_homepage_url
Definition: gui.c:88
int option_window_width
Definition: gui.c:82
static struct gui_fetch_table atari_fetch_table
Definition: gui.c:1078
static void throbber_advance(void *data)
Definition: gui.c:598
static void gui_get_clipboard(char **buffer, size_t *length)
Core asks front end for clipboard contents.
Definition: gui.c:703
void * h_gem_rsrc
Definition: gui.c:76
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:193
GRECT desk_area
Definition: gui.c:79
static struct gui_misc_table atari_misc_table
Definition: gui.c:1084
EVMULT_IN aes_event_in
Definition: gui.c:93
static nserror gui_window_set_url(struct gui_window *w, nsurl *url)
Definition: gui.c:559
char options[PATH_MAX]
Definition: gui.c:91
static bool atari_quit
Definition: gui.c:72
static nserror set_defaults(struct nsoption_s *defaults)
Set option defaults for atari frontend.
Definition: gui.c:910
static void gui_window_remove_caret(struct gui_window *w)
clear window caret
Definition: gui.c:656
struct gui_window * input_window
Definition: gui.c:74
static void gui_quit(void)
Definition: gui.c:777
void gui_window_destroy(struct gui_window *gw)
Destroy previously created gui window.
Definition: gui.c:252
static void gui_window_new_content(struct gui_window *w)
Definition: gui.c:687
static void atari_poll(void)
Core atari event processing.
Definition: gui.c:114
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:386
void gui_window_set_pointer(struct gui_window *gw, gui_pointer_shape shape)
set the pointer shape
Definition: gui.c:482
static void gui_window_start_throbber(struct gui_window *w)
Definition: gui.c:615
int option_window_x
Definition: gui.c:84
static struct gui_clipboard_table atari_clipboard_table
Definition: gui.c:1073
char * gui_window_get_url(struct gui_window *gw)
Definition: gui.c:582
void gui_set_input_gui_window(struct gui_window *gw)
Definition: gui.c:765
void atari_window_set_status(struct gui_window *w, const char *text)
Set the status bar of a browser window.
Definition: gui.c:356
static void gui_window_set_icon(struct gui_window *g, struct hlcache_handle *icon)
Set a favicon for a gui window.
Definition: gui.c:676
static void gui_window_set_title(struct gui_window *gw, const char *title)
Set the title of a window.
Definition: gui.c:322
struct gui_window * window_list
Definition: gui.c:75
static char * theapp
Definition: gui.c:921
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:461
bool gui_window_get_scroll(struct gui_window *w, int *sx, int *sy)
Definition: gui.c:414
static struct gui_window_table atari_window_table
Definition: gui.c:1056
short aes_msg_out[8]
Definition: gui.c:106
static void gui_window_stop_throbber(struct gui_window *w)
Definition: gui.c:625
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:643
int option_window_y
Definition: gui.c:85
char * gui_window_get_title(struct gui_window *gw)
Definition: gui.c:590
bool rendering
Definition: gui.c:78
@ 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:109
void atari_global_history_destroy(void)
Definition: history.c:168
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:263
void atari_hotlist_init(void)
Definition: hotlist.c:190
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:825
struct core_window_table * atari_core_window_table
Definition: treeview.c:543
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:777
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:160
void die(const char *const error)
Display an error and exit.
Definition: gui.c:2119
int height
Definition: gui.c:161
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:297
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:315
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