2012-11-27 05:12:09 +04:00
|
|
|
#ifndef NS_ATARI_TOOLBAR_H
|
2011-11-29 03:23:28 +04:00
|
|
|
#define NS_ATARI_TOOLBAR_H
|
|
|
|
|
2012-11-27 05:12:09 +04:00
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2011-11-29 03:23:28 +04:00
|
|
|
#include "desktop/textarea.h"
|
2012-11-27 05:12:09 +04:00
|
|
|
#include "desktop/browser.h"
|
2011-11-29 03:23:28 +04:00
|
|
|
|
2012-11-27 05:12:09 +04:00
|
|
|
struct s_toolbar;
|
2011-11-29 03:23:28 +04:00
|
|
|
|
2012-11-27 05:12:09 +04:00
|
|
|
enum toolbar_textarea {
|
|
|
|
URL_INPUT_TEXT_AREA = 1
|
|
|
|
};
|
2011-12-01 02:36:52 +04:00
|
|
|
|
2012-11-29 05:01:13 +04:00
|
|
|
struct s_url_widget
|
2013-01-14 04:01:22 +04:00
|
|
|
{
|
2013-01-09 04:12:30 +04:00
|
|
|
struct textarea *textarea;
|
2012-11-29 05:01:13 +04:00
|
|
|
GRECT area;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct s_throbber_widget
|
|
|
|
{
|
|
|
|
short index;
|
|
|
|
short max_index;
|
2013-01-14 04:01:22 +04:00
|
|
|
bool running;
|
2012-11-29 05:01:13 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct s_toolbar
|
|
|
|
{
|
|
|
|
struct s_gui_win_root *owner;
|
|
|
|
struct s_url_widget url;
|
|
|
|
struct s_throbber_widget throbber;
|
2013-01-23 01:28:20 +04:00
|
|
|
OBJECT *form;
|
2012-11-29 05:01:13 +04:00
|
|
|
GRECT area;
|
|
|
|
/* size & location of buttons: */
|
|
|
|
struct s_tb_button * buttons;
|
|
|
|
int btcnt;
|
|
|
|
int style;
|
2013-01-14 04:01:22 +04:00
|
|
|
bool attached;
|
|
|
|
bool reflow;
|
|
|
|
bool visible;
|
|
|
|
bool search_visible;
|
2012-11-29 05:01:13 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2012-11-27 05:12:09 +04:00
|
|
|
void toolbar_init(void);
|
|
|
|
struct s_toolbar *toolbar_create(struct s_gui_win_root *owner);
|
|
|
|
void toolbar_destroy(struct s_toolbar * tb);
|
2012-04-13 00:18:53 +04:00
|
|
|
void toolbar_exit( void );
|
2012-11-27 05:12:09 +04:00
|
|
|
bool toolbar_text_input(struct s_toolbar *tb, char *text);
|
|
|
|
bool toolbar_key_input(struct s_toolbar *tb, short nkc);
|
2013-01-11 00:07:36 +04:00
|
|
|
void toolbar_mouse_input(struct s_toolbar *tb, short obj, short mbut);
|
2012-11-27 05:12:09 +04:00
|
|
|
void toolbar_update_buttons(struct s_toolbar *tb, struct browser_window *bw,
|
|
|
|
short idx);
|
2012-11-29 05:01:13 +04:00
|
|
|
void toolbar_get_grect(struct s_toolbar *tb, short which, GRECT *g);
|
2013-01-23 01:28:20 +04:00
|
|
|
OBJECT *toolbar_get_form(struct s_toolbar *tb);
|
2013-01-11 00:07:36 +04:00
|
|
|
struct textarea *toolbar_get_textarea(struct s_toolbar *tb,
|
2012-11-27 05:12:09 +04:00
|
|
|
enum toolbar_textarea which);
|
2012-11-29 05:01:13 +04:00
|
|
|
void toolbar_set_throbber_state(struct s_toolbar *tb, bool active);
|
2012-11-30 06:20:52 +04:00
|
|
|
void toolbar_set_attached(struct s_toolbar *tb, bool attached);
|
2013-01-14 04:01:22 +04:00
|
|
|
void toolbar_set_visible(struct s_toolbar *tb, short area, bool visible);
|
|
|
|
void toolbar_set_reflow(struct s_toolbar *tb, bool do_reflow);
|
2013-01-15 04:31:35 +04:00
|
|
|
void toolbar_set_width(struct s_toolbar *tb, short w);
|
|
|
|
void toolbar_set_origin(struct s_toolbar *tb, short x, short y);
|
|
|
|
void toolbar_set_dimensions(struct s_toolbar *tb, GRECT *area);
|
|
|
|
void toolbar_set_url(struct s_toolbar *tb, const char *text);
|
2012-11-29 00:30:24 +04:00
|
|
|
void toolbar_redraw(struct s_toolbar *tb, GRECT *clip);
|
2012-11-29 05:01:13 +04:00
|
|
|
void toolbar_throbber_progress(struct s_toolbar *tb);
|
2012-11-27 05:12:09 +04:00
|
|
|
/* public events handlers: */
|
|
|
|
void toolbar_back_click(struct s_toolbar *tb);
|
|
|
|
void toolbar_reload_click(struct s_toolbar *tb);
|
|
|
|
void toolbar_forward_click(struct s_toolbar *tb);
|
|
|
|
void toolbar_home_click(struct s_toolbar *tb);
|
|
|
|
void toolbar_stop_click(struct s_toolbar *tb);
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|