NetSurf
Data Structures | Macros | Functions | Variables
configure.c File Reference

RISC OS option setting (implementation). More...

#include <assert.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <oslib/os.h>
#include <oslib/osbyte.h>
#include <oslib/territory.h>
#include <oslib/wimp.h>
#include "utils/log.h"
#include "utils/messages.h"
#include "riscos/gui.h"
#include "riscos/dialog.h"
#include "riscos/configure.h"
#include "riscos/wimp.h"
#include "riscos/wimp_event.h"
#include "riscos/configure/configure.h"
Include dependency graph for configure.c:

Go to the source code of this file.

Data Structures

struct  configure_tool
 

Macros

#define CONFIGURE_ICON_PADDING_H   32
 
#define CONFIGURE_ICON_PADDING_V   32
 
#define CONFIGURE_DEFAULT_ICON_WIDTH   (68 + CONFIGURE_ICON_PADDING_H)
 
#define CONFIGURE_DEFAULT_ICON_HEIGHT   (128 + CONFIGURE_ICON_PADDING_V)
 
#define CONFIGURE_TOOL_TRANSLATED_SIZE   64
 

Functions

static bool ro_gui_configure_click (wimp_pointer *pointer)
 
static void ro_gui_configure_open_window (wimp_open *open)
 
static void ro_gui_configure_close (wimp_w w)
 
static bool ro_gui_configure_translate (void)
 Translate tool icons into the system local encoding. More...
 
static void ro_gui_configure_register (const char *window, bool(*initialise)(wimp_w w), void(*finalise)(wimp_w w))
 
void ro_gui_configure_initialise (void)
 
void ro_gui_configure_show (void)
 

Variables

static wimp_w configure_window
 
static int configure_current_encoding
 
static int configure_icons = 0
 
static struct configure_toolconfigure_tools = NULL
 
static int configure_icon_width = CONFIGURE_DEFAULT_ICON_WIDTH
 
static int configure_icon_height = CONFIGURE_DEFAULT_ICON_HEIGHT
 
static int configure_icons_per_line = 0
 
static int configure_width
 
static int configure_height
 

Detailed Description

RISC OS option setting (implementation).

Definition in file configure.c.

Macro Definition Documentation

◆ CONFIGURE_DEFAULT_ICON_HEIGHT

#define CONFIGURE_DEFAULT_ICON_HEIGHT   (128 + CONFIGURE_ICON_PADDING_V)

Definition at line 47 of file configure.c.

◆ CONFIGURE_DEFAULT_ICON_WIDTH

#define CONFIGURE_DEFAULT_ICON_WIDTH   (68 + CONFIGURE_ICON_PADDING_H)

Definition at line 46 of file configure.c.

◆ CONFIGURE_ICON_PADDING_H

#define CONFIGURE_ICON_PADDING_H   32

Definition at line 44 of file configure.c.

◆ CONFIGURE_ICON_PADDING_V

#define CONFIGURE_ICON_PADDING_V   32

Definition at line 45 of file configure.c.

◆ CONFIGURE_TOOL_TRANSLATED_SIZE

#define CONFIGURE_TOOL_TRANSLATED_SIZE   64

Definition at line 51 of file configure.c.

Function Documentation

◆ ro_gui_configure_click()

bool ro_gui_configure_click ( wimp_pointer *  pointer)
static

Definition at line 135 of file configure.c.

References configure_tools, configure_window, configure_tool::i, configure_tool::initialise, configure_tool::next, configure_tool::open, ro_gui_configure_close(), ro_gui_dialog_open_persistent(), ro_gui_dialog_open_top(), ro_gui_wimp_event_register_close_window(), and configure_tool::w.

Referenced by ro_gui_configure_initialise().

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

◆ ro_gui_configure_close()

void ro_gui_configure_close ( wimp_w  w)
static

Definition at line 163 of file configure.c.

References configure_tools, configure_tool::finalise, configure_tool::next, configure_tool::open, and configure_tool::w.

Referenced by ro_gui_configure_click().

Here is the caller graph for this function:

◆ ro_gui_configure_initialise()

void ro_gui_configure_initialise ( void  )

◆ ro_gui_configure_open_window()

void ro_gui_configure_open_window ( wimp_open *  open)
static

Definition at line 177 of file configure.c.

References configure_height, configure_icon_height, CONFIGURE_ICON_PADDING_H, CONFIGURE_ICON_PADDING_V, configure_icon_width, configure_icons, configure_icons_per_line, configure_tools, configure_width, configure_window, height, configure_tool::i, configure_tool::next, NSLOG, configure_tool::open, ro_gui_configure_translate(), ro_gui_screen_size(), ro_warn_user(), and width.

Referenced by ro_gui_configure_initialise().

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

◆ ro_gui_configure_register()

void ro_gui_configure_register ( const char *  window,
bool(*)(wimp_w w)  initialise,
void(*)(wimp_w w)  finalise 
)
static

Definition at line 274 of file configure.c.

References configure_icon_height, configure_icon_width, configure_icons, CONFIGURE_TOOL_TRANSLATED_SIZE, configure_tools, configure_window, die(), finalise(), configure_tool::finalise, configure_tool::i, initialise(), configure_tool::initialise, messages_get(), configure_tool::name, configure_tool::next, NSLOG, ro_gui_dialog_create(), ro_gui_set_icon_string(), configure_tool::translated, configure_tool::validation, and configure_tool::w.

Referenced by ro_gui_configure_initialise().

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

◆ ro_gui_configure_show()

void ro_gui_configure_show ( void  )

Definition at line 126 of file configure.c.

References configure_icon_height, configure_icon_width, configure_icons, configure_window, height, ro_gui_dialog_open_top(), and width.

Referenced by ro_gui_iconbar_menu_select().

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

◆ ro_gui_configure_translate()

bool ro_gui_configure_translate ( void  )
static

Translate tool icons into the system local encoding.

This will also recalculate the minimum required icon width.

Returns
true on success, false on memory exhaustion

Definition at line 359 of file configure.c.

References configure_current_encoding, CONFIGURE_DEFAULT_ICON_WIDTH, configure_icon_height, CONFIGURE_ICON_PADDING_H, configure_icon_width, configure_icons_per_line, configure_tools, configure_window, configure_tool::i, messages_get(), configure_tool::name, configure_tool::next, NSLOG, ro_gui_set_icon_string(), and configure_tool::translated.

Referenced by ro_gui_configure_initialise(), and ro_gui_configure_open_window().

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

Variable Documentation

◆ configure_current_encoding

int configure_current_encoding
static

Definition at line 63 of file configure.c.

Referenced by ro_gui_configure_translate().

◆ configure_height

int configure_height
static

Definition at line 70 of file configure.c.

Referenced by ro_gui_configure_open_window().

◆ configure_icon_height

int configure_icon_height = CONFIGURE_DEFAULT_ICON_HEIGHT
static

◆ configure_icon_width

int configure_icon_width = CONFIGURE_DEFAULT_ICON_WIDTH
static

◆ configure_icons

int configure_icons = 0
static

◆ configure_icons_per_line

int configure_icons_per_line = 0
static

Definition at line 68 of file configure.c.

Referenced by ro_gui_configure_open_window(), and ro_gui_configure_translate().

◆ configure_tools

struct configure_tool* configure_tools = NULL
static

◆ configure_width

int configure_width
static

Definition at line 69 of file configure.c.

Referenced by ro_gui_configure_open_window().

◆ configure_window

wimp_w configure_window
static