NetSurf
Functions | Variables
theme.c File Reference
#include "amiga/os3support.h"
#include <stdlib.h>
#include <string.h>
#include <proto/clicktab.h>
#include <proto/datatypes.h>
#include <proto/dos.h>
#include <proto/exec.h>
#include <proto/graphics.h>
#include <proto/icon.h>
#include <proto/intuition.h>
#include <gadgets/clicktab.h>
#include <gadgets/space.h>
#include <intuition/pointerclass.h>
#include <workbench/icon.h>
#include "utils/messages.h"
#include "utils/nsoption.h"
#include "utils/utils.h"
#include "desktop/searchweb.h"
#include "netsurf/mouse.h"
#include "netsurf/window.h"
#include "amiga/gui.h"
#include "amiga/drag.h"
#include "amiga/bitmap.h"
#include "amiga/plotters.h"
#include "amiga/schedule.h"
#include "amiga/theme.h"
#include "amiga/misc.h"
Include dependency graph for theme.c:

Go to the source code of this file.

Functions

void ami_theme_init (void)
 
int ami_theme_throbber_get_width (void)
 
int ami_theme_throbber_get_height (void)
 
void ami_theme_throbber_setup (void)
 
void ami_theme_throbber_free (void)
 
void ami_get_theme_filename (char *filename, const char *themestring, bool protocol)
 
void gui_window_set_pointer (struct gui_window *g, gui_pointer_shape shape)
 Change mouse pointer shape. More...
 
void ami_update_pointer (struct Window *win, gui_pointer_shape shape)
 
void ami_init_mouse_pointers (void)
 
void ami_mouse_pointers_free (void)
 
void gui_window_start_throbber (struct gui_window *g)
 
void gui_window_stop_throbber (struct gui_window *g)
 
static void ami_throbber_update (void *p)
 
void ami_throbber_redraw_schedule (int t, struct gui_window *g)
 

Variables

static struct BitMap * throbber = NULL
 
static struct bitmapthrobber_nsbm = NULL
 
static int throbber_frames = 1
 
static int throbber_update_interval
 
static Object * mouseptrobj [AMI_LASTPOINTER+1]
 
static struct BitMap * mouseptrbm [AMI_LASTPOINTER+1]
 
const char * ptrs [AMI_LASTPOINTER+1]
 
const char * ptrs32 [AMI_LASTPOINTER+1]
 

Function Documentation

◆ ami_get_theme_filename()

void ami_get_theme_filename ( char *  filename,
const char *  themestring,
bool  protocol 
)

Definition at line 198 of file theme.c.

References messages_get(), and nsoption_charp.

Referenced by ami_init_mouse_pointers(), ami_theme_throbber_setup(), and gui_window_create().

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

◆ ami_init_mouse_pointers()

void ami_init_mouse_pointers ( void  )

Definition at line 284 of file theme.c.

References ami_get_theme_filename(), AMI_LASTPOINTER, height, ICONCTRLA_GetImageDataFormat, IDFMT_BITMAPPED, IDFMT_DIRECTMAPPED, LIB_IS_AT_LEAST, mouseptrbm, mouseptrobj, NewObject(), nsoption_bool, ptrs, ptrs32, and width.

Referenced by main().

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

◆ ami_mouse_pointers_free()

void ami_mouse_pointers_free ( void  )

Definition at line 396 of file theme.c.

References AMI_LASTPOINTER, LIB_IS_AT_LEAST, and mouseptrbm.

Referenced by gui_quit().

Here is the caller graph for this function:

◆ ami_theme_init()

void ami_theme_init ( void  )

Definition at line 134 of file theme.c.

References amiga_warn_user(), messages_add_from_file(), nsoption_charp, and nsoption_set_charp.

Referenced by main().

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

◆ ami_theme_throbber_free()

void ami_theme_throbber_free ( void  )

Definition at line 191 of file theme.c.

References amiga_bitmap_destroy(), and throbber_nsbm.

Referenced by gui_quit().

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

◆ ami_theme_throbber_get_height()

int ami_theme_throbber_get_height ( void  )

Definition at line 168 of file theme.c.

References bitmap_get_height(), and throbber_nsbm.

Referenced by ami_throbber_update(), gui_window_create(), and gui_window_stop_throbber().

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

◆ ami_theme_throbber_get_width()

int ami_theme_throbber_get_width ( void  )

Definition at line 163 of file theme.c.

References bitmap_get_width(), throbber_frames, and throbber_nsbm.

Referenced by ami_throbber_update(), gui_window_create(), and gui_window_stop_throbber().

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

◆ ami_theme_throbber_setup()

void ami_theme_throbber_setup ( void  )

Definition at line 173 of file theme.c.

References ami_bitmap_from_datatype(), ami_bitmap_get_native(), ami_get_theme_filename(), ami_plot_screen_is_palettemapped(), bitmap_get_height(), bitmap_get_width(), messages_get(), throbber_frames, throbber_nsbm, and throbber_update_interval.

Referenced by ami_openscreenfirst().

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

◆ ami_throbber_redraw_schedule()

void ami_throbber_redraw_schedule ( int  t,
struct gui_window g 
)

Definition at line 517 of file theme.c.

References ami_schedule(), and ami_throbber_update().

Referenced by ami_gui_event(), ami_switch_tab(), ami_throbber_update(), gui_window_start_throbber(), gui_window_stop_throbber(), and HOOKF().

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

◆ ami_throbber_update()

static void ami_throbber_update ( void *  p)
static

Definition at line 467 of file theme.c.

References AMI_GAD_THROBBER, ami_gui2_get_object(), ami_gui_free_space_box(), ami_gui_get_gui_window_2(), ami_gui_get_space_box(), ami_gui_get_throbber_frame(), ami_gui_get_throbbing(), ami_gui_get_window(), ami_gui_set_throbber_frame(), ami_theme_throbber_get_height(), ami_theme_throbber_get_width(), ami_throbber_redraw_schedule(), amiga_warn_user(), IS_CURRENT_GW, NSERROR_OK, throbber_frames, and throbber_update_interval.

Referenced by ami_throbber_redraw_schedule().

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

◆ ami_update_pointer()

void ami_update_pointer ( struct Window *  win,
gui_pointer_shape  shape 
)
Todo:
check this shouldn't be drag_in_progress

Definition at line 221 of file theme.c.

References ami_drag_has_data(), GUI_POINTER_DEFAULT, GUI_POINTER_WAIT, LIB_IS_AT_LEAST, mouseptrobj, and nsoption_bool.

Referenced by ami_file_save(), ami_gui_opts_use(), ami_reset_pointer(), ami_search_set_hourglass(), ami_set_pointer(), and HOOKF().

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

◆ gui_window_set_pointer()

void gui_window_set_pointer ( struct gui_window g,
gui_pointer_shape  shape 
)

Change mouse pointer shape.

Definition at line 216 of file theme.c.

References ami_gui_get_gui_window_2(), and ami_set_pointer().

Referenced by nsatari_search_set_hourglass(), and ro_gui_selection_drag_claim().

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

◆ gui_window_start_throbber()

void gui_window_start_throbber ( struct gui_window g)

Definition at line 413 of file theme.c.

References AMI_GAD_TABS, ami_gui2_get_object(), ami_gui2_get_tabs(), ami_gui_get_gui_window_2(), ami_gui_get_tab_node(), ami_gui_get_throbber_frame(), ami_gui_get_window(), ami_gui_set_throbber_frame(), ami_gui_set_throbbing(), ami_throbber_redraw_schedule(), nsoption_bool, and throbber_update_interval.

Referenced by gui_window_event().

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

◆ gui_window_stop_throbber()

void gui_window_stop_throbber ( struct gui_window g)

Definition at line 432 of file theme.c.

References AMI_GAD_TABS, AMI_GAD_THROBBER, ami_gui2_get_object(), ami_gui2_get_tabs(), ami_gui_free_space_box(), ami_gui_get_gui_window_2(), ami_gui_get_space_box(), ami_gui_get_tab_node(), ami_gui_get_window(), ami_gui_set_throbbing(), ami_theme_throbber_get_height(), ami_theme_throbber_get_width(), ami_throbber_redraw_schedule(), amiga_warn_user(), IS_CURRENT_GW, NSERROR_OK, and nsoption_bool.

Referenced by gui_window_event().

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

Variable Documentation

◆ mouseptrbm

struct BitMap* mouseptrbm[AMI_LASTPOINTER+1]
static

Definition at line 60 of file theme.c.

Referenced by ami_init_mouse_pointers(), and ami_mouse_pointers_free().

◆ mouseptrobj

Object* mouseptrobj[AMI_LASTPOINTER+1]
static

Definition at line 59 of file theme.c.

Referenced by ami_init_mouse_pointers(), and ami_update_pointer().

◆ ptrs

const char* ptrs[AMI_LASTPOINTER+1]
Initial value:
= {
"ptr_default",
"ptr_point",
"ptr_caret",
"ptr_menu",
"ptr_up",
"ptr_down",
"ptr_left",
"ptr_right",
"ptr_rightup",
"ptr_leftdown",
"ptr_leftup",
"ptr_rightdown",
"ptr_cross",
"ptr_move",
"ptr_wait",
"ptr_help",
"ptr_nodrop",
"ptr_notallowed",
"ptr_progress",
"ptr_blank",
"ptr_drag"}

Definition at line 62 of file theme.c.

Referenced by ami_init_mouse_pointers().

◆ ptrs32

const char* ptrs32[AMI_LASTPOINTER+1]
Initial value:
= {
"ptr32_default",
"ptr32_point",
"ptr32_caret",
"ptr32_menu",
"ptr32_up",
"ptr32_down",
"ptr32_left",
"ptr32_right",
"ptr32_rightup",
"ptr32_leftdown",
"ptr32_leftup",
"ptr32_rightdown",
"ptr32_cross",
"ptr32_move",
"ptr32_wait",
"ptr32_help",
"ptr32_nodrop",
"ptr32_notallowed",
"ptr32_progress",
"ptr32_blank",
"ptr32_drag"}

Definition at line 85 of file theme.c.

Referenced by ami_init_mouse_pointers().

◆ throbber

struct BitMap* throbber = NULL
static

Definition at line 55 of file theme.c.

Referenced by ro_gui_throbber_create(), and set_throbber_frame().

◆ throbber_frames

int throbber_frames = 1
static

◆ throbber_nsbm

struct bitmap* throbber_nsbm = NULL
static

◆ throbber_update_interval

int throbber_update_interval
static