2003-06-30 16:44:03 +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-25 18:12:58 +03:00
|
|
|
* Copyright 2004 James Bursa <bursa@users.sourceforge.net>
|
|
|
|
*/
|
|
|
|
|
|
|
|
/** \file
|
|
|
|
* Interface to platform-specific gui functions.
|
2002-09-11 18:24:02 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _NETSURF_DESKTOP_GUI_H_
|
|
|
|
#define _NETSURF_DESKTOP_GUI_H_
|
|
|
|
|
2005-04-15 09:52:25 +04:00
|
|
|
typedef enum {
|
|
|
|
GUI_SAVE_SOURCE,
|
|
|
|
GUI_SAVE_DRAW,
|
|
|
|
GUI_SAVE_TEXT,
|
|
|
|
GUI_SAVE_COMPLETE,
|
|
|
|
GUI_SAVE_OBJECT_ORIG,
|
|
|
|
GUI_SAVE_OBJECT_NATIVE,
|
|
|
|
GUI_SAVE_LINK_URI,
|
|
|
|
GUI_SAVE_LINK_URL,
|
|
|
|
GUI_SAVE_LINK_TEXT,
|
|
|
|
GUI_SAVE_HOTLIST_EXPORT_HTML,
|
|
|
|
GUI_SAVE_HISTORY_EXPORT_HTML,
|
|
|
|
GUI_SAVE_TEXT_SELECTION,
|
|
|
|
GUI_SAVE_CLIPBOARD_CONTENTS
|
|
|
|
} gui_save_type;
|
|
|
|
|
2003-08-28 23:21:27 +04:00
|
|
|
struct gui_window;
|
2004-06-28 03:24:11 +04:00
|
|
|
struct gui_download_window;
|
2004-07-17 17:00:38 +04:00
|
|
|
|
2004-04-01 04:26:05 +04:00
|
|
|
typedef enum { GUI_POINTER_DEFAULT, GUI_POINTER_POINT, GUI_POINTER_CARET,
|
2006-03-19 20:49:32 +03:00
|
|
|
GUI_POINTER_MENU, GUI_POINTER_UP, GUI_POINTER_DOWN,
|
|
|
|
GUI_POINTER_LEFT, GUI_POINTER_RIGHT, GUI_POINTER_RU,
|
|
|
|
GUI_POINTER_LD, GUI_POINTER_LU, GUI_POINTER_RD,
|
|
|
|
GUI_POINTER_CROSS, GUI_POINTER_MOVE, GUI_POINTER_WAIT,
|
|
|
|
GUI_POINTER_HELP, GUI_POINTER_NO_DROP, GUI_POINTER_NOT_ALLOWED,
|
|
|
|
GUI_POINTER_PROGRESS } gui_pointer_shape;
|
2003-07-18 03:01:02 +04:00
|
|
|
|
2003-11-06 22:41:41 +03:00
|
|
|
#include <stdbool.h>
|
2006-02-23 18:06:54 +03:00
|
|
|
#include "netsurf/utils/config.h"
|
2004-04-25 03:42:32 +04:00
|
|
|
#include "netsurf/content/content.h"
|
2002-09-11 18:24:02 +04:00
|
|
|
#include "netsurf/desktop/browser.h"
|
|
|
|
|
2005-04-17 07:30:35 +04:00
|
|
|
extern struct gui_window *search_current_window;
|
|
|
|
|
2004-07-18 03:32:09 +04:00
|
|
|
void gui_init(int argc, char** argv);
|
2004-09-27 09:21:00 +04:00
|
|
|
void gui_init2(int argc, char** argv);
|
2004-07-18 03:32:09 +04:00
|
|
|
void gui_multitask(void);
|
|
|
|
void gui_poll(bool active);
|
|
|
|
void gui_quit(void);
|
|
|
|
|
2004-07-17 17:00:38 +04:00
|
|
|
struct gui_window *gui_create_browser_window(struct browser_window *bw,
|
2004-05-25 14:42:28 +04:00
|
|
|
struct browser_window *clone);
|
2004-07-17 17:00:38 +04:00
|
|
|
void gui_window_destroy(struct gui_window *g);
|
|
|
|
void gui_window_set_title(struct gui_window *g, const char *title);
|
|
|
|
void gui_window_redraw(struct gui_window *g, int x0, int y0, int x1, int y1);
|
|
|
|
void gui_window_redraw_window(struct gui_window *g);
|
|
|
|
void gui_window_update_box(struct gui_window *g,
|
|
|
|
const union content_msg_data *data);
|
2005-04-15 09:52:25 +04:00
|
|
|
bool gui_window_get_scroll(struct gui_window *g, int *sx, int *sy);
|
2004-07-17 17:00:38 +04:00
|
|
|
void gui_window_set_scroll(struct gui_window *g, int sx, int sy);
|
2006-01-25 20:28:29 +03:00
|
|
|
void gui_window_scroll_visible(struct gui_window *g, int x0, int y0,
|
|
|
|
int x1, int y1);
|
2004-07-17 17:00:38 +04:00
|
|
|
int gui_window_get_width(struct gui_window *g);
|
2005-07-02 22:17:51 +04:00
|
|
|
int gui_window_get_height(struct gui_window *g);
|
2004-07-17 17:00:38 +04:00
|
|
|
void gui_window_set_extent(struct gui_window *g, int width, int height);
|
|
|
|
void gui_window_set_status(struct gui_window *g, const char *text);
|
2006-03-10 12:09:03 +03:00
|
|
|
void gui_window_set_pointer(struct gui_window *g, gui_pointer_shape shape);
|
|
|
|
void gui_window_hide_pointer(struct gui_window *g);
|
2004-07-17 17:00:38 +04:00
|
|
|
void gui_window_set_url(struct gui_window *g, const char *url);
|
2004-07-18 03:32:09 +04:00
|
|
|
void gui_window_start_throbber(struct gui_window *g);
|
|
|
|
void gui_window_stop_throbber(struct gui_window *g);
|
|
|
|
void gui_window_place_caret(struct gui_window *g, int x, int y, int height);
|
2004-07-21 18:19:21 +04:00
|
|
|
void gui_window_remove_caret(struct gui_window *g);
|
2004-07-18 03:32:09 +04:00
|
|
|
void gui_window_new_content(struct gui_window *g);
|
2005-04-15 09:52:25 +04:00
|
|
|
bool gui_window_scroll_start(struct gui_window *g);
|
2005-07-21 03:27:28 +04:00
|
|
|
bool gui_window_box_scroll_start(struct gui_window *g,
|
|
|
|
int x0, int y0, int x1, int y1);
|
2006-07-04 23:56:37 +04:00
|
|
|
void gui_window_save_as_link(struct gui_window *g, struct content *c);
|
2002-09-11 18:24:02 +04:00
|
|
|
|
2004-06-28 03:24:11 +04:00
|
|
|
struct gui_download_window *gui_download_window_create(const char *url,
|
|
|
|
const char *mime_type, struct fetch *fetch,
|
|
|
|
unsigned int total_size);
|
|
|
|
void gui_download_window_data(struct gui_download_window *dw, const char *data,
|
|
|
|
unsigned int size);
|
|
|
|
void gui_download_window_error(struct gui_download_window *dw,
|
|
|
|
const char *error_msg);
|
|
|
|
void gui_download_window_done(struct gui_download_window *dw);
|
2003-08-28 23:21:27 +04:00
|
|
|
|
2005-04-18 15:52:26 +04:00
|
|
|
void gui_drag_save_object(gui_save_type type, struct content *c,
|
|
|
|
struct gui_window *g);
|
|
|
|
void gui_drag_save_selection(struct selection *s, struct gui_window *g);
|
2005-04-15 09:52:25 +04:00
|
|
|
void gui_start_selection(struct gui_window *g);
|
|
|
|
|
2005-04-20 16:24:41 +04:00
|
|
|
void gui_paste_from_clipboard(struct gui_window *g, int x, int y);
|
2005-07-21 03:27:28 +04:00
|
|
|
bool gui_empty_clipboard(void);
|
|
|
|
bool gui_add_to_clipboard(const char *text, size_t length, bool space);
|
|
|
|
bool gui_commit_clipboard(void);
|
2005-04-15 09:52:25 +04:00
|
|
|
bool gui_copy_to_clipboard(struct selection *s);
|
|
|
|
|
2004-07-18 03:32:09 +04:00
|
|
|
void gui_create_form_select_menu(struct browser_window *bw,
|
|
|
|
struct form_control *control);
|
2003-09-23 01:55:08 +04:00
|
|
|
|
2004-05-13 18:39:43 +04:00
|
|
|
void gui_launch_url(const char *url);
|
2004-04-02 04:41:10 +04:00
|
|
|
|
2006-02-16 02:09:55 +03:00
|
|
|
bool gui_search_term_highlighted(struct gui_window *g,
|
|
|
|
unsigned start_offset, unsigned end_offset,
|
2005-04-17 07:30:35 +04:00
|
|
|
unsigned *start_idx, unsigned *end_idx);
|
|
|
|
|
2006-02-23 18:06:54 +03:00
|
|
|
#ifdef WITH_SSL
|
|
|
|
struct ssl_cert_info;
|
|
|
|
|
|
|
|
void gui_cert_verify(struct browser_window *bw, struct content *c,
|
|
|
|
const struct ssl_cert_info *certs, unsigned long num);
|
|
|
|
#endif
|
|
|
|
|
2002-09-11 18:24:02 +04:00
|
|
|
#endif
|
2005-07-21 03:27:28 +04:00
|
|
|
|