NetSurf
con_content.c
Go to the documentation of this file.
1/*
2 * Copyright 2006 Richard Wilson <info@tinct.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#include <stdbool.h>
20
21#include "utils/nsoption.h"
22#include "utils/messages.h"
23
24#include "riscos/gui.h"
25#include "riscos/wimp.h"
26#include "riscos/wimp_event.h"
27#include "riscos/configure.h"
29#include "riscos/dialog.h"
30
31#define CONTENT_BLOCK_ADVERTISEMENTS 2
32#define CONTENT_BLOCK_POPUPS 3
33#define CONTENT_BLOCK_CSS 4
34#define CONTENT_TARGET_BLANK 7
35#define CONTENT_DEFAULT_BUTTON 8
36#define CONTENT_CANCEL_BUTTON 9
37#define CONTENT_OK_BUTTON 10
38#define CONTENT_NO_JAVASCRIPT 11
39
40static void ro_gui_options_content_default(wimp_pointer *pointer);
41static bool ro_gui_options_content_ok(wimp_w w);
42
44{
45 /* set the current values */
47 nsoption_bool(block_advertisements));
49 nsoption_bool(block_popups));
51 !nsoption_bool(author_level_css));
53 nsoption_bool(target_blank));
55 !nsoption_bool(enable_javascript));
56
57 /* initialise all functions for a newly created window */
68 ro_gui_wimp_event_set_help_prefix(w, "HelpContentConfig");
70 return true;
71
72}
73
74void ro_gui_options_content_default(wimp_pointer *pointer)
75{
76 /* set the default values */
78 false);
80 false);
82 false);
84 true);
86 false);
87}
88
90{
91 nsoption_set_bool(block_advertisements,
93
94 nsoption_set_bool(block_popups,
96 nsoption_set_bool(author_level_css,
98
99 nsoption_set_bool(target_blank,
101
102 nsoption_set_bool(enable_javascript,
104
106 return true;
107}
static bool ro_gui_options_content_ok(wimp_w w)
Definition: con_content.c:89
#define CONTENT_BLOCK_CSS
Definition: con_content.c:33
#define CONTENT_BLOCK_POPUPS
Definition: con_content.c:32
#define CONTENT_CANCEL_BUTTON
Definition: con_content.c:36
bool ro_gui_options_content_initialise(wimp_w w)
Definition: con_content.c:43
#define CONTENT_BLOCK_ADVERTISEMENTS
Definition: con_content.c:31
#define CONTENT_DEFAULT_BUTTON
Definition: con_content.c:35
#define CONTENT_NO_JAVASCRIPT
Definition: con_content.c:38
#define CONTENT_OK_BUTTON
Definition: con_content.c:37
static void ro_gui_options_content_default(wimp_pointer *pointer)
Definition: con_content.c:74
#define CONTENT_TARGET_BLANK
Definition: con_content.c:34
Automated RISC OS WIMP event handling (interface).
RISC OS option setting (interface).
void ro_gui_save_options(void)
Save the current options.
Definition: dialog.c:670
Localised message support (interface).
Option reading and saving interface.
#define nsoption_set_bool(OPTION, VALUE)
set a boolean option in the default table
Definition: nsoption.h:344
#define nsoption_bool(OPTION)
Get the value of a boolean option.
Definition: nsoption.h:304
void ro_gui_set_icon_selected_state(wimp_w w, wimp_i i, bool state)
Set the selected state of an icon.
Definition: wimp.c:444
bool ro_gui_get_icon_selected_state(wimp_w w, wimp_i i)
Gets the selected state of an icon.
Definition: wimp.c:463
General RISC OS WIMP/OS library functions (interface).
bool ro_gui_wimp_event_set_help_prefix(wimp_w w, const char *help_prefix)
Set the associated help prefix for a given window.
Definition: wimp_event.c:390
bool ro_gui_wimp_event_register_cancel(wimp_w w, wimp_i i)
Register a function to be called for the Cancel action on a window.
Definition: wimp_event.c:1403
bool ro_gui_wimp_event_memorise(wimp_w w)
Memorises the current state of any registered components in a window.
Definition: wimp_event.c:139
bool ro_gui_wimp_event_register_checkbox(wimp_w w, wimp_i i)
Register a checkbox to be automatically handled.
Definition: wimp_event.c:1349
bool ro_gui_wimp_event_register_ok(wimp_w w, wimp_i i, bool(*callback)(wimp_w w))
Register a function to be called for the OK action on a window.
Definition: wimp_event.c:1417
bool ro_gui_wimp_event_register_button(wimp_w w, wimp_i i, void(*callback)(wimp_pointer *pointer))
Register a function to be called when a particular button is pressed.
Definition: wimp_event.c:1387
Automated RISC OS WIMP event handling (interface).