2003-07-30 17:06:22 +04:00
|
|
|
/*
|
|
|
|
* This file is part of NetSurf, http://netsurf.sourceforge.net/
|
|
|
|
* Licensed under the GNU General Public License,
|
|
|
|
* http://www.opensource.org/licenses/gpl-license
|
|
|
|
* Copyright 2003 Phil Mellor <monkeyson@users.sourceforge.net>
|
2004-02-13 19:09:12 +03:00
|
|
|
* Copyright 2004 James Bursa <bursa@users.sourceforge.net>
|
2003-07-30 17:06:22 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _NETSURF_RISCOS_GUI_H_
|
|
|
|
#define _NETSURF_RISCOS_GUI_H_
|
|
|
|
|
2003-09-11 01:44:11 +04:00
|
|
|
#include <stdbool.h>
|
2003-08-22 01:39:07 +04:00
|
|
|
#include "oslib/wimp.h"
|
2004-01-05 05:10:59 +03:00
|
|
|
#include "netsurf/utils/config.h"
|
2003-07-30 17:06:22 +04:00
|
|
|
#include "netsurf/desktop/browser.h"
|
2003-08-22 01:39:07 +04:00
|
|
|
#include "netsurf/desktop/netsurf.h"
|
2003-07-30 17:06:22 +04:00
|
|
|
#include "netsurf/desktop/gui.h"
|
2003-08-27 02:37:32 +04:00
|
|
|
#include "netsurf/desktop/options.h"
|
2004-05-05 02:23:44 +04:00
|
|
|
#include "netsurf/riscos/toolbar.h"
|
2003-08-22 01:39:07 +04:00
|
|
|
|
2003-08-27 02:37:32 +04:00
|
|
|
#define THEMES_DIR "<NetSurf$Dir>.Themes"
|
|
|
|
|
|
|
|
extern wimp_w dialog_info, dialog_saveas, dialog_config, dialog_config_br,
|
2004-04-13 01:46:08 +04:00
|
|
|
dialog_config_prox, dialog_config_th, dialog_zoom, dialog_pageinfo,
|
|
|
|
dialog_tooltip;
|
2003-11-15 03:26:42 +03:00
|
|
|
extern wimp_w history_window;
|
2004-02-25 18:12:58 +03:00
|
|
|
extern wimp_menu *iconbar_menu, *browser_menu, *combo_menu, *theme_menu;
|
|
|
|
extern int iconbar_menu_height;
|
2003-10-25 04:35:49 +04:00
|
|
|
extern struct form_control *current_gadget;
|
2003-08-28 23:21:27 +04:00
|
|
|
extern gui_window *window_list;
|
2003-11-08 02:51:13 +03:00
|
|
|
extern bool gui_reformat_pending;
|
2004-02-02 03:22:59 +03:00
|
|
|
extern bool gui_redraw_debug;
|
2004-02-25 18:12:58 +03:00
|
|
|
extern gui_window *current_gui;
|
|
|
|
|
|
|
|
typedef enum { GUI_BROWSER_WINDOW, GUI_DOWNLOAD_WINDOW } gui_window_type;
|
2004-03-27 21:46:08 +03:00
|
|
|
typedef enum { GUI_SAVE_SOURCE, GUI_SAVE_DRAW, GUI_SAVE_TEXT,
|
|
|
|
GUI_SAVE_COMPLETE } gui_save_type;
|
2004-02-26 03:44:42 +03:00
|
|
|
extern gui_save_type gui_current_save_type;
|
|
|
|
typedef enum { GUI_DRAG_SELECTION, GUI_DRAG_DOWNLOAD_SAVE,
|
2004-05-05 02:23:44 +04:00
|
|
|
GUI_DRAG_SAVE, GUI_DRAG_STATUS_RESIZE } gui_drag_type;
|
2004-02-26 03:44:42 +03:00
|
|
|
extern gui_drag_type gui_current_drag_type;
|
2003-07-30 17:06:22 +04:00
|
|
|
|
2003-08-28 23:21:27 +04:00
|
|
|
struct gui_window
|
2003-07-30 17:06:22 +04:00
|
|
|
{
|
|
|
|
gui_window_type type;
|
|
|
|
|
2003-11-08 02:51:13 +03:00
|
|
|
wimp_w window;
|
|
|
|
|
2003-07-30 17:06:22 +04:00
|
|
|
union {
|
|
|
|
struct {
|
2004-05-05 02:23:44 +04:00
|
|
|
struct toolbar *toolbar;
|
2003-07-30 17:06:22 +04:00
|
|
|
int toolbar_width;
|
|
|
|
struct browser_window* bw;
|
2003-09-11 01:44:11 +04:00
|
|
|
bool reformat_pending;
|
|
|
|
int old_width;
|
2003-12-12 04:33:38 +03:00
|
|
|
int old_height;
|
2003-07-30 17:06:22 +04:00
|
|
|
} browser;
|
2003-08-28 23:21:27 +04:00
|
|
|
struct {
|
|
|
|
struct content *content;
|
|
|
|
bits file_type;
|
|
|
|
char sprite_name[20];
|
|
|
|
char path[256];
|
2003-10-06 03:30:21 +04:00
|
|
|
enum {
|
|
|
|
download_COMPLETE,
|
|
|
|
download_INCOMPLETE,
|
|
|
|
download_ERROR
|
|
|
|
} download_status;
|
2003-08-28 23:21:27 +04:00
|
|
|
} download;
|
2003-07-30 17:06:22 +04:00
|
|
|
} data;
|
|
|
|
|
|
|
|
char status[256];
|
|
|
|
char title[256];
|
|
|
|
char url[256];
|
|
|
|
gui_window* next;
|
|
|
|
|
|
|
|
int throbber;
|
2003-11-20 03:16:31 +03:00
|
|
|
char throb_buf[12];
|
2003-07-30 17:06:22 +04:00
|
|
|
float throbtime;
|
|
|
|
|
|
|
|
enum { drag_NONE, drag_UNKNOWN, drag_BROWSER_TEXT_SELECTION } drag_status;
|
2004-02-25 18:12:58 +03:00
|
|
|
|
2004-05-05 02:23:44 +04:00
|
|
|
/* Options
|
|
|
|
*/
|
|
|
|
float scale;
|
|
|
|
bool option_dither_sprites;
|
|
|
|
bool option_filter_sprites;
|
|
|
|
int option_toolbar_status_width;
|
|
|
|
bool option_toolbar_show_status;
|
|
|
|
bool option_toolbar_show_buttons;
|
|
|
|
bool option_toolbar_show_address;
|
|
|
|
bool option_toolbar_show_throbber;
|
|
|
|
bool option_animate_images;
|
2003-07-30 17:06:22 +04:00
|
|
|
};
|
|
|
|
|
2003-10-01 04:26:42 +04:00
|
|
|
|
2003-08-22 01:39:07 +04:00
|
|
|
/* in gui.c */
|
|
|
|
void ro_gui_copy_selection(gui_window* g);
|
2003-09-26 20:52:53 +04:00
|
|
|
void ro_gui_open_help_page(void);
|
2003-11-08 02:51:13 +03:00
|
|
|
void ro_gui_screen_size(int *width, int *height);
|
2003-12-11 04:23:57 +03:00
|
|
|
void ro_gui_view_source(struct content *content);
|
2003-12-27 03:11:57 +03:00
|
|
|
void ro_gui_drag_box_start(wimp_pointer *pointer);
|
2003-08-22 01:39:07 +04:00
|
|
|
|
|
|
|
/* in menus.c */
|
|
|
|
void ro_gui_menus_init(void);
|
|
|
|
void ro_gui_create_menu(wimp_menu* menu, int x, int y, gui_window* g);
|
2003-12-19 03:40:28 +03:00
|
|
|
void ro_gui_popup_menu(wimp_menu *menu, wimp_w w, wimp_i i);
|
2003-08-22 01:39:07 +04:00
|
|
|
void ro_gui_menu_selection(wimp_selection* selection);
|
2004-02-26 03:44:42 +03:00
|
|
|
void ro_gui_menu_warning(wimp_message_menu_warning *warning);
|
2004-03-27 21:46:08 +03:00
|
|
|
void ro_gui_menu_prepare_save(struct content *c);
|
2004-05-05 02:23:44 +04:00
|
|
|
void ro_gui_menu_prepare_scale(void);
|
2003-08-22 01:39:07 +04:00
|
|
|
|
2003-08-27 02:37:32 +04:00
|
|
|
/* in dialog.c */
|
|
|
|
void ro_gui_dialog_init(void);
|
2003-11-15 03:26:42 +03:00
|
|
|
wimp_w ro_gui_dialog_create(const char *template_name);
|
2003-08-28 00:09:57 +04:00
|
|
|
void ro_gui_dialog_open(wimp_w w);
|
2003-08-27 02:37:32 +04:00
|
|
|
void ro_gui_dialog_click(wimp_pointer *pointer);
|
2003-12-26 21:18:17 +03:00
|
|
|
bool ro_gui_dialog_keypress(wimp_key *key);
|
2003-08-27 02:37:32 +04:00
|
|
|
void ro_gui_dialog_close(wimp_w close);
|
2003-08-28 00:09:57 +04:00
|
|
|
void ro_gui_redraw_config_th(wimp_draw* redraw);
|
|
|
|
void ro_gui_theme_menu_selection(char *theme);
|
2003-08-27 02:37:32 +04:00
|
|
|
|
2003-08-28 23:21:27 +04:00
|
|
|
/* in download.c */
|
|
|
|
void ro_gui_download_init(void);
|
2003-10-06 03:30:21 +04:00
|
|
|
void ro_download_window_close(struct gui_window *g);
|
|
|
|
struct gui_window * ro_lookup_download_window_from_w(wimp_w window);
|
|
|
|
void ro_download_window_click(struct gui_window *g, wimp_pointer *pointer);
|
2004-02-26 03:44:42 +03:00
|
|
|
void ro_download_drag_end(wimp_dragged *drag);
|
|
|
|
void ro_download_datasave_ack(wimp_message *message);
|
2003-08-28 23:21:27 +04:00
|
|
|
|
2003-10-01 03:30:36 +04:00
|
|
|
/* in mouseactions.c */
|
|
|
|
void ro_gui_mouse_action(gui_window* g);
|
|
|
|
|
2003-10-01 04:26:42 +04:00
|
|
|
/* in textselection.c */
|
|
|
|
void ro_gui_start_selection(wimp_pointer *pointer, wimp_window_state *state,
|
2004-02-26 03:44:42 +03:00
|
|
|
gui_window *g);
|
|
|
|
void ro_gui_selection_drag_end(wimp_dragged *drag);
|
2003-10-01 04:26:42 +04:00
|
|
|
|
2003-10-23 04:09:17 +04:00
|
|
|
/* in 401login.c */
|
2004-01-05 05:10:59 +03:00
|
|
|
#ifdef WITH_AUTH
|
2003-10-23 04:09:17 +04:00
|
|
|
void ro_gui_401login_init(void);
|
|
|
|
void ro_gui_401login_open(char* host, char * realm, char* fetchurl);
|
|
|
|
void ro_gui_401login_click(wimp_pointer *pointer);
|
2003-12-26 21:18:17 +03:00
|
|
|
bool ro_gui_401login_keypress(wimp_key *key);
|
2004-01-05 05:10:59 +03:00
|
|
|
#endif
|
2003-10-23 04:09:17 +04:00
|
|
|
|
2003-11-08 02:51:13 +03:00
|
|
|
/* in window.c */
|
|
|
|
void ro_gui_window_click(gui_window* g, wimp_pointer* mouse);
|
|
|
|
void ro_gui_window_open(gui_window* g, wimp_open* open);
|
|
|
|
void ro_gui_window_redraw(gui_window* g, wimp_draw* redraw);
|
|
|
|
void ro_gui_window_mouse_at(wimp_pointer* pointer);
|
|
|
|
void ro_gui_toolbar_click(gui_window* g, wimp_pointer* pointer);
|
2004-05-05 02:23:44 +04:00
|
|
|
void ro_gui_status_click(gui_window* g, wimp_pointer* pointer);
|
2003-11-08 02:51:13 +03:00
|
|
|
void ro_gui_throb(void);
|
|
|
|
gui_window* ro_lookup_gui_from_w(wimp_w window);
|
|
|
|
gui_window* ro_lookup_gui_toolbar_from_w(wimp_w window);
|
2004-05-05 02:23:44 +04:00
|
|
|
gui_window* ro_lookup_gui_status_from_w(wimp_w window);
|
2003-12-11 04:23:57 +03:00
|
|
|
gui_window *ro_gui_window_lookup(wimp_w w);
|
|
|
|
bool ro_gui_window_keypress(gui_window *g, int key, bool toolbar);
|
2003-12-21 05:27:22 +03:00
|
|
|
void ro_gui_scroll_request(wimp_scroll *scroll);
|
2004-05-05 02:23:44 +04:00
|
|
|
//#define window_x_units(x, state) (x - (state->visible.x0 - state->xscroll))
|
|
|
|
//#define window_y_units(y, state) (y - (state->visible.y1 - state->yscroll))
|
2004-02-25 18:12:58 +03:00
|
|
|
int window_x_units(int x, wimp_window_state *state);
|
|
|
|
int window_y_units(int y, wimp_window_state *state);
|
2004-05-04 02:05:40 +04:00
|
|
|
bool ro_gui_window_dataload(gui_window *g, wimp_message *message);
|
2003-11-08 02:51:13 +03:00
|
|
|
|
2003-11-15 03:26:42 +03:00
|
|
|
/* in history.c */
|
|
|
|
void ro_gui_history_init(void);
|
|
|
|
void ro_gui_history_quit(void);
|
|
|
|
void ro_gui_history_open(struct browser_window *bw,
|
2004-02-25 18:12:58 +03:00
|
|
|
struct history *history, int wx, int wy);
|
2003-11-15 03:26:42 +03:00
|
|
|
void ro_gui_history_redraw(wimp_draw *redraw);
|
|
|
|
void ro_gui_history_click(wimp_pointer *pointer);
|
2004-04-13 01:46:08 +04:00
|
|
|
void ro_gui_history_mouse_at(wimp_pointer *pointer);
|
2003-11-15 03:26:42 +03:00
|
|
|
|
2004-02-26 03:44:42 +03:00
|
|
|
/* in save.c */
|
|
|
|
void ro_gui_save_click(wimp_pointer *pointer);
|
|
|
|
void ro_gui_drag_icon(wimp_pointer *pointer);
|
|
|
|
void ro_gui_save_drag_end(wimp_dragged *drag);
|
|
|
|
void ro_gui_save_datasave_ack(wimp_message *message);
|
|
|
|
|
2004-03-11 05:19:14 +03:00
|
|
|
/* in filetype.c */
|
|
|
|
int ro_content_filetype(struct content *content);
|
|
|
|
|
2004-03-21 15:46:56 +03:00
|
|
|
/* in schedule.c */
|
|
|
|
extern bool sched_active;
|
|
|
|
extern os_t sched_time;
|
|
|
|
void schedule(int t, void (*callback)(void *p), void *p);
|
|
|
|
void schedule_remove(void (*callback)(void *p), void *p);
|
|
|
|
void schedule_run(void);
|
|
|
|
|
2003-08-27 02:37:32 +04:00
|
|
|
/* icon numbers */
|
2004-05-05 02:23:44 +04:00
|
|
|
#define ICON_TOOLBAR_BACK 0
|
|
|
|
#define ICON_TOOLBAR_FORWARD 1
|
|
|
|
#define ICON_TOOLBAR_STOP 2
|
|
|
|
#define ICON_TOOLBAR_RELOAD 3
|
|
|
|
#define ICON_TOOLBAR_HOME 4
|
|
|
|
#define ICON_TOOLBAR_HISTORY 5
|
|
|
|
#define ICON_TOOLBAR_SAVE 6
|
|
|
|
#define ICON_TOOLBAR_PRINT 7
|
|
|
|
#define ICON_TOOLBAR_BOOKMARK 8
|
|
|
|
#define ICON_TOOLBAR_SCALE 9
|
|
|
|
#define ICON_TOOLBAR_SEARCH 10
|
|
|
|
#define ICON_TOOLBAR_UP 11
|
|
|
|
#define ICON_TOOLBAR_URL 12 // Must be after highest toolbar icon
|
|
|
|
#define ICON_TOOLBAR_THROBBER 13
|
|
|
|
|
|
|
|
#define ICON_STATUS_TEXT 0
|
|
|
|
#define ICON_STATUS_RESIZE 1
|
2003-11-20 03:16:31 +03:00
|
|
|
|
2003-08-27 02:37:32 +04:00
|
|
|
#define ICON_CONFIG_SAVE 0
|
|
|
|
#define ICON_CONFIG_CANCEL 1
|
|
|
|
#define ICON_CONFIG_BROWSER 2
|
|
|
|
#define ICON_CONFIG_PROXY 3
|
|
|
|
#define ICON_CONFIG_THEME 4
|
|
|
|
|
|
|
|
#define ICON_CONFIG_BR_OK 0
|
|
|
|
#define ICON_CONFIG_BR_CANCEL 1
|
2004-04-14 03:19:44 +04:00
|
|
|
#define ICON_CONFIG_BR_FONTSIZE 3
|
2004-04-14 01:57:12 +04:00
|
|
|
#define ICON_CONFIG_BR_FONTSIZE_DEC 4
|
|
|
|
#define ICON_CONFIG_BR_FONTSIZE_INC 5
|
|
|
|
#define ICON_CONFIG_BR_MINSIZE 7
|
|
|
|
#define ICON_CONFIG_BR_MINSIZE_DEC 8
|
|
|
|
#define ICON_CONFIG_BR_MINSIZE_INC 9
|
|
|
|
#define ICON_CONFIG_BR_LANG 11
|
|
|
|
#define ICON_CONFIG_BR_LANG_PICK 12
|
|
|
|
#define ICON_CONFIG_BR_ALANG 15
|
|
|
|
#define ICON_CONFIG_BR_ALANG_PICK 16
|
2003-08-27 02:37:32 +04:00
|
|
|
|
|
|
|
#define ICON_CONFIG_PROX_OK 0
|
|
|
|
#define ICON_CONFIG_PROX_CANCEL 1
|
|
|
|
#define ICON_CONFIG_PROX_DEFAULT 2
|
|
|
|
#define ICON_CONFIG_PROX_HTTP 3
|
|
|
|
#define ICON_CONFIG_PROX_HTTPHOST 4
|
|
|
|
#define ICON_CONFIG_PROX_HTTPPORT 5
|
|
|
|
|
|
|
|
#define ICON_CONFIG_TH_OK 0
|
|
|
|
#define ICON_CONFIG_TH_CANCEL 1
|
|
|
|
#define ICON_CONFIG_TH_DEFAULT 2
|
|
|
|
#define ICON_CONFIG_TH_NAME 4
|
|
|
|
#define ICON_CONFIG_TH_PICK 5
|
|
|
|
#define ICON_CONFIG_TH_PREVIEW 7
|
|
|
|
#define ICON_CONFIG_TH_GET 8
|
|
|
|
#define ICON_CONFIG_TH_MANAGE 9
|
|
|
|
|
2003-08-28 23:21:27 +04:00
|
|
|
#define ICON_DOWNLOAD_URL 0
|
|
|
|
#define ICON_DOWNLOAD_STATUS 1
|
|
|
|
#define ICON_DOWNLOAD_ICON 2
|
|
|
|
#define ICON_DOWNLOAD_PATH 3
|
|
|
|
#define ICON_DOWNLOAD_ABORT 4
|
|
|
|
|
2003-10-23 04:09:17 +04:00
|
|
|
#define ICON_401LOGIN_LOGIN 0
|
|
|
|
#define ICON_401LOGIN_CANCEL 1
|
|
|
|
#define ICON_401LOGIN_HOST 2
|
|
|
|
#define ICON_401LOGIN_REALM 3
|
|
|
|
#define ICON_401LOGIN_USERNAME 4
|
|
|
|
#define ICON_401LOGIN_PASSWORD 5
|
|
|
|
|
2004-02-25 18:12:58 +03:00
|
|
|
#define ICON_ZOOM_VALUE 1
|
|
|
|
#define ICON_ZOOM_DEC 2
|
|
|
|
#define ICON_ZOOM_INC 3
|
|
|
|
#define ICON_ZOOM_50 5
|
|
|
|
#define ICON_ZOOM_80 6
|
|
|
|
#define ICON_ZOOM_100 7
|
|
|
|
#define ICON_ZOOM_120 8
|
|
|
|
#define ICON_ZOOM_CANCEL 9
|
|
|
|
#define ICON_ZOOM_OK 10
|
|
|
|
|
2004-02-26 03:44:42 +03:00
|
|
|
#define ICON_SAVE_ICON 0
|
|
|
|
#define ICON_SAVE_PATH 1
|
|
|
|
#define ICON_SAVE_OK 2
|
|
|
|
#define ICON_SAVE_CANCEL 3
|
|
|
|
|
2004-04-03 06:59:35 +04:00
|
|
|
#define ICON_PAGEINFO_TITLE 0
|
|
|
|
#define ICON_PAGEINFO_URL 1
|
|
|
|
#define ICON_PAGEINFO_ENC 2
|
|
|
|
#define ICON_PAGEINFO_TYPE 3
|
|
|
|
#define ICON_PAGEINFO_ICON 4
|
|
|
|
|
2003-07-30 17:06:22 +04:00
|
|
|
#endif
|