NetSurf
Macros | Functions | Variables
con_fonts.c File Reference
#include <stdbool.h>
#include <stddef.h>
#include "utils/nsoption.h"
#include "utils/messages.h"
#include "netsurf/plot_style.h"
#include "riscos/gui.h"
#include "riscos/font.h"
#include "riscos/menus.h"
#include "riscos/wimp.h"
#include "riscos/wimp_event.h"
#include "riscos/configure.h"
#include "riscos/configure/configure.h"
#include "riscos/dialog.h"
Include dependency graph for con_fonts.c:

Go to the source code of this file.

Macros

#define FONT_SANS_FIELD   3
 
#define FONT_SANS_MENU   4
 
#define FONT_SERIF_FIELD   6
 
#define FONT_SERIF_MENU   7
 
#define FONT_MONOSPACE_FIELD   9
 
#define FONT_MONOSPACE_MENU   10
 
#define FONT_CURSIVE_FIELD   12
 
#define FONT_CURSIVE_MENU   13
 
#define FONT_FANTASY_FIELD   15
 
#define FONT_FANTASY_MENU   16
 
#define FONT_DEFAULT_FIELD   18
 
#define FONT_DEFAULT_MENU   19
 
#define FONT_DEFAULT_SIZE   23
 
#define FONT_DEFAULT_DEC   24
 
#define FONT_DEFAULT_INC   25
 
#define FONT_MINIMUM_SIZE   28
 
#define FONT_MINIMUM_DEC   29
 
#define FONT_MINIMUM_INC   30
 
#define FONT_DEFAULT_BUTTON   32
 
#define FONT_CANCEL_BUTTON   33
 
#define FONT_OK_BUTTON   34
 

Functions

static void ro_gui_options_fonts_default (wimp_pointer *pointer)
 
static bool ro_gui_options_fonts_ok (wimp_w w)
 
static bool ro_gui_options_fonts_init_menu (void)
 
bool ro_gui_options_fonts_initialise (wimp_w w)
 

Variables

static wimp_menu * default_menu
 
static const char * font_names [PLOT_FONT_FAMILY_COUNT]
 

Macro Definition Documentation

◆ FONT_CANCEL_BUTTON

#define FONT_CANCEL_BUTTON   33

Definition at line 55 of file con_fonts.c.

◆ FONT_CURSIVE_FIELD

#define FONT_CURSIVE_FIELD   12

Definition at line 42 of file con_fonts.c.

◆ FONT_CURSIVE_MENU

#define FONT_CURSIVE_MENU   13

Definition at line 43 of file con_fonts.c.

◆ FONT_DEFAULT_BUTTON

#define FONT_DEFAULT_BUTTON   32

Definition at line 54 of file con_fonts.c.

◆ FONT_DEFAULT_DEC

#define FONT_DEFAULT_DEC   24

Definition at line 49 of file con_fonts.c.

◆ FONT_DEFAULT_FIELD

#define FONT_DEFAULT_FIELD   18

Definition at line 46 of file con_fonts.c.

◆ FONT_DEFAULT_INC

#define FONT_DEFAULT_INC   25

Definition at line 50 of file con_fonts.c.

◆ FONT_DEFAULT_MENU

#define FONT_DEFAULT_MENU   19

Definition at line 47 of file con_fonts.c.

◆ FONT_DEFAULT_SIZE

#define FONT_DEFAULT_SIZE   23

Definition at line 48 of file con_fonts.c.

◆ FONT_FANTASY_FIELD

#define FONT_FANTASY_FIELD   15

Definition at line 44 of file con_fonts.c.

◆ FONT_FANTASY_MENU

#define FONT_FANTASY_MENU   16

Definition at line 45 of file con_fonts.c.

◆ FONT_MINIMUM_DEC

#define FONT_MINIMUM_DEC   29

Definition at line 52 of file con_fonts.c.

◆ FONT_MINIMUM_INC

#define FONT_MINIMUM_INC   30

Definition at line 53 of file con_fonts.c.

◆ FONT_MINIMUM_SIZE

#define FONT_MINIMUM_SIZE   28

Definition at line 51 of file con_fonts.c.

◆ FONT_MONOSPACE_FIELD

#define FONT_MONOSPACE_FIELD   9

Definition at line 40 of file con_fonts.c.

◆ FONT_MONOSPACE_MENU

#define FONT_MONOSPACE_MENU   10

Definition at line 41 of file con_fonts.c.

◆ FONT_OK_BUTTON

#define FONT_OK_BUTTON   34

Definition at line 56 of file con_fonts.c.

◆ FONT_SANS_FIELD

#define FONT_SANS_FIELD   3

Definition at line 36 of file con_fonts.c.

◆ FONT_SANS_MENU

#define FONT_SANS_MENU   4

Definition at line 37 of file con_fonts.c.

◆ FONT_SERIF_FIELD

#define FONT_SERIF_FIELD   6

Definition at line 38 of file con_fonts.c.

◆ FONT_SERIF_MENU

#define FONT_SERIF_MENU   7

Definition at line 39 of file con_fonts.c.

Function Documentation

◆ ro_gui_options_fonts_default()

void ro_gui_options_fonts_default ( wimp_pointer *  pointer)
static

Definition at line 119 of file con_fonts.c.

References FONT_CURSIVE_FIELD, FONT_DEFAULT_FIELD, FONT_DEFAULT_SIZE, FONT_FANTASY_FIELD, FONT_MINIMUM_SIZE, FONT_MONOSPACE_FIELD, font_names, FONT_SANS_FIELD, FONT_SERIF_FIELD, nsfont_exists(), nsfont_fallback_font(), ro_gui_set_icon_decimal(), and ro_gui_set_icon_string().

Referenced by ro_gui_options_fonts_initialise().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ro_gui_options_fonts_init_menu()

bool ro_gui_options_fonts_init_menu ( void  )
static

Definition at line 186 of file con_fonts.c.

References default_menu, font_names, messages_get(), ro_gui_menu_init_structure(), and ro_warn_user().

Referenced by ro_gui_options_fonts_initialise().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ro_gui_options_fonts_initialise()

bool ro_gui_options_fonts_initialise ( wimp_w  w)

◆ ro_gui_options_fonts_ok()

bool ro_gui_options_fonts_ok ( wimp_w  w)
static

Definition at line 140 of file con_fonts.c.

References FONT_CURSIVE_FIELD, FONT_DEFAULT_FIELD, FONT_DEFAULT_SIZE, FONT_FANTASY_FIELD, FONT_MINIMUM_SIZE, FONT_MONOSPACE_FIELD, font_names, FONT_SANS_FIELD, FONT_SERIF_FIELD, nsoption_int, nsoption_set_charp, nsoption_set_int, ro_gui_get_icon_decimal(), ro_gui_get_icon_string(), ro_gui_save_options(), and ro_gui_set_icon_decimal().

Referenced by ro_gui_options_fonts_initialise().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ default_menu

wimp_menu* default_menu
static
Todo:
The memory claimed for this menu should probably be released at some point

Definition at line 61 of file con_fonts.c.

Referenced by ro_gui_options_fonts_init_menu(), and ro_gui_options_fonts_initialise().

◆ font_names

const char* font_names[PLOT_FONT_FAMILY_COUNT]
static
Initial value:
= {
"Sans-serif",
"Serif",
"Monospace",
"Cursive",
"Fantasy"
}

Definition at line 63 of file con_fonts.c.

Referenced by ro_gui_options_fonts_default(), ro_gui_options_fonts_init_menu(), ro_gui_options_fonts_initialise(), and ro_gui_options_fonts_ok().