2012-11-19 02:22:43 +04:00
|
|
|
/*
|
|
|
|
* Copyright 2010 Ole Loots <ole@monochrom.net>
|
|
|
|
*
|
|
|
|
* This file is part of NetSurf, http://www.netsurf-browser.org/
|
|
|
|
*
|
|
|
|
* NetSurf is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; version 2 of the License.
|
|
|
|
*
|
|
|
|
* NetSurf is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef NS_ATARI_BROWSER_WIN_H
|
2012-11-27 05:12:09 +04:00
|
|
|
#define NS_ATARI_BROWSER_WIN_H
|
|
|
|
|
|
|
|
#include <atari/gui.h>
|
2012-11-19 02:22:43 +04:00
|
|
|
|
|
|
|
#define GUIWIN_VISIBLE(gw) (gw->root->handle->status & WS_OPEN)
|
|
|
|
#define GEMWIN_VISIBLE(win) (win->status & WS_OPEN)
|
|
|
|
|
|
|
|
#define WIDGET_STATUSBAR 0x1
|
|
|
|
#define WIDGET_TOOLBAR 0x2
|
|
|
|
#define WIDGET_SCROLL 0x4
|
|
|
|
#define WIDGET_RESIZE 0x8
|
|
|
|
#define WIN_TOP 0x100
|
2012-12-06 03:26:00 +04:00
|
|
|
|
|
|
|
enum browser_area_e {
|
|
|
|
BROWSER_AREA_CONTENT = 1,
|
|
|
|
BROWSER_AREA_STATUSBAR,
|
|
|
|
BROWSER_AREA_TOOLBAR,
|
|
|
|
BROWSER_AREA_URL_INPUT
|
|
|
|
};
|
2012-11-19 02:22:43 +04:00
|
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* Public module functions: */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
/* Creates an normal Browser window with [toolbar], [statusbar] */
|
2012-11-27 05:12:09 +04:00
|
|
|
int window_create(struct gui_window * gw,
|
2012-11-19 02:22:43 +04:00
|
|
|
struct browser_window * bw, unsigned long flags );
|
|
|
|
/* Destroys WinDom part of gui_window */
|
2012-12-03 04:27:33 +04:00
|
|
|
int window_destroy(ROOTWIN *rootwin);
|
2012-11-19 02:22:43 +04:00
|
|
|
|
|
|
|
/* show the window */
|
2012-12-03 04:27:33 +04:00
|
|
|
void window_open(ROOTWIN *rootwin, GRECT pos);
|
2012-11-19 02:22:43 +04:00
|
|
|
|
2012-12-03 04:27:33 +04:00
|
|
|
void window_snd_redraw(ROOTWIN *rootwin, short x, short y, short w, short h );
|
2012-11-19 02:22:43 +04:00
|
|
|
/* Update Shade / Unshade state of the fwd/back buttons*/
|
2012-11-27 05:12:09 +04:00
|
|
|
void window_update_back_forward(struct s_gui_win_root * rootwin);
|
2012-11-19 02:22:43 +04:00
|
|
|
/* set root browser component: */
|
2012-12-03 04:27:33 +04:00
|
|
|
void window_attach_browser(ROOTWIN *rootwin, CMP_BROWSER b);
|
2012-11-19 02:22:43 +04:00
|
|
|
|
|
|
|
/* set focus element */
|
2012-12-03 04:27:33 +04:00
|
|
|
void window_set_focus(ROOTWIN *rootwin, enum focus_element_type type,
|
|
|
|
void * element );
|
2012-11-19 02:22:43 +04:00
|
|
|
/* Shade / Unshade the forward/back bt. of toolbar, depending on history.*/
|
2012-12-03 04:27:33 +04:00
|
|
|
bool window_widget_has_focus(ROOTWIN *rootwin, enum focus_element_type t,
|
|
|
|
void * element);
|
|
|
|
bool window_url_widget_has_focus(ROOTWIN *rootwin);
|
|
|
|
void window_set_url(ROOTWIN *rootwin, const char * text);
|
|
|
|
void window_set_stauts(ROOTWIN *rootwin, char * text);
|
|
|
|
void window_set_title(ROOTWIN *rootwin, char * text);
|
|
|
|
void window_set_content_size(ROOTWIN *rootwin, int w, int h);
|
|
|
|
void window_set_icon(ROOTWIN *rootwin, struct bitmap * bmp );
|
2012-11-27 05:12:09 +04:00
|
|
|
void window_set_active_gui_window(ROOTWIN *rootwin, struct gui_window *gw);
|
2012-12-03 04:27:33 +04:00
|
|
|
void window_scroll_by(ROOTWIN *rootwin, int x, int y);
|
2012-11-29 00:30:24 +04:00
|
|
|
void window_schedule_redraw_grect(ROOTWIN *rootwin, GRECT *area);
|
|
|
|
void window_process_redraws(ROOTWIN * rootwin);
|
2013-01-02 01:08:19 +04:00
|
|
|
void window_place_caret(ROOTWIN *rootwin, short mode, int content_x,
|
|
|
|
int content_y, int h, GRECT *work);
|
2012-11-27 05:12:09 +04:00
|
|
|
struct gui_window * window_get_active_gui_window(ROOTWIN * rootwin);
|
2012-12-03 04:27:33 +04:00
|
|
|
void window_get_scroll(ROOTWIN *rootwin, int *x, int *y);
|
2012-12-06 03:26:00 +04:00
|
|
|
void window_get_grect(ROOTWIN *rootwin, enum browser_area_e which, GRECT *d);
|
2012-11-27 05:12:09 +04:00
|
|
|
void window_redraw_favicon(struct s_gui_win_root * rootwin, GRECT *clip);
|
2012-11-30 06:20:52 +04:00
|
|
|
void window_unref_gui_window(ROOTWIN *rootwin, struct gui_window *gw);
|
|
|
|
bool window_key_input(unsigned short kcode, unsigned short kstate,
|
|
|
|
unsigned short nkc);
|
2012-11-19 02:22:43 +04:00
|
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* Public event handlers: */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
#endif
|