summaryrefslogtreecommitdiff
path: root/atari
diff options
context:
space:
mode:
authorOle Loots <ole@monochrom.net>2013-01-22 02:33:27 +0100
committerOle Loots <ole@monochrom.net>2013-01-22 02:33:27 +0100
commit985e4ce6be424aec5e797d92c09e0ee22cde7874 (patch)
treedae78d1c0935ce636272e365e9430f2a29583af7 /atari
parent2e91d4e17eea238281451532437e7447bfd4f0bf (diff)
downloadnetsurf-985e4ce6be424aec5e797d92c09e0ee22cde7874.tar.gz
netsurf-985e4ce6be424aec5e797d92c09e0ee22cde7874.tar.bz2
Prefixed gemtk module functions.
Diffstat (limited to 'atari')
-rw-r--r--atari/ctxmenu.c4
-rw-r--r--atari/deskmenu.c6
-rwxr-xr-xatari/download.c38
-rwxr-xr-xatari/gemtk/dragdrop.c52
-rw-r--r--atari/gemtk/gemtk.h143
-rw-r--r--atari/gemtk/guiwin.c254
-rw-r--r--atari/gemtk/msgbox.c30
-rw-r--r--atari/gemtk/objc.c8
-rw-r--r--atari/gemtk/utils.c4
-rw-r--r--atari/gui.c16
-rwxr-xr-xatari/history.c12
-rwxr-xr-xatari/hotlist.c26
-rwxr-xr-xatari/login.c2
-rwxr-xr-xatari/misc.c6
-rwxr-xr-xatari/rootwin.c138
-rwxr-xr-xatari/rootwin.h2
-rw-r--r--atari/search.c8
-rw-r--r--atari/settings.c98
-rwxr-xr-xatari/statusbar.c2
-rw-r--r--atari/toolbar.c6
-rwxr-xr-xatari/treeview.c48
-rwxr-xr-xatari/treeview.h4
22 files changed, 453 insertions, 454 deletions
diff --git a/atari/ctxmenu.c b/atari/ctxmenu.c
index a82824eb3..d89060a65 100644
--- a/atari/ctxmenu.c
+++ b/atari/ctxmenu.c
@@ -128,7 +128,7 @@ void context_popup(struct gui_window * gw, short x, short y)
char cmdline[PATH_MAX];
MENU pop_menu, me_data;
- pop = get_tree( POP_CTX );
+ pop = gemtk_obj_get_tree( POP_CTX );
if (pop == NULL)
return;
ctx = get_context_info(gw, x, y);
@@ -163,7 +163,7 @@ void context_popup(struct gui_window * gw, short x, short y)
}
// point mn_tree tree to states popup:
- pop_menu.mn_tree = get_tree(POP_CTX);
+ pop_menu.mn_tree = gemtk_obj_get_tree(POP_CTX);
pop_menu.mn_menu = 0;
pop_menu.mn_item = POP_CTX_CUT_SEL;
pop_menu.mn_scroll = SCROLL_NO;
diff --git a/atari/deskmenu.c b/atari/deskmenu.c
index d4621a30f..0811b1230 100644
--- a/atari/deskmenu.c
+++ b/atari/deskmenu.c
@@ -314,7 +314,7 @@ static void __CDECL menu_savewin(short item, short title, void *data)
LOG(("%s", __FUNCTION__));
if (input_window && input_window->browser) {
GRECT rect;
- wind_get_grect(guiwin_get_handle(input_window->root->win), WF_CURRXYWH,
+ wind_get_grect(gemtk_wm_get_handle(input_window->root->win), WF_CURRXYWH,
&rect);
option_window_width = rect.g_w;
option_window_height = rect.g_h;
@@ -522,7 +522,7 @@ void deskmenu_init(void)
{
int i;
- h_gem_menu = get_tree(MAINMENU);
+ h_gem_menu = gemtk_obj_get_tree(MAINMENU);
/* Install menu: */
@@ -616,7 +616,7 @@ int deskmenu_dispatch_keypress(unsigned short kcode, unsigned short kstate,
bool done = 0;
int i = 0;
- sascii = keybd2ascii(kcode, K_LSHIFT);
+ sascii = gemtk_keybd2ascii(kcode, K_LSHIFT);
/* Iterate through the menu function table: */
while( menu_evnt_tbl[i].rid != -1 && done == false) {
diff --git a/atari/download.c b/atari/download.c
index d20fd882d..936b8a551 100755
--- a/atari/download.c
+++ b/atari/download.c
@@ -61,7 +61,7 @@ static void toolbar_redraw_cb(GUIWIN *win, uint16_t msg, GRECT *clip)
struct gui_download_window *data;
if (msg != WM_REDRAW) {
- data = guiwin_get_user_data(win);
+ data = gemtk_wm_get_user_data(win);
assert(data);
@@ -76,7 +76,7 @@ static short on_aes_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
GRECT clip;
- data = guiwin_get_user_data(win);
+ data = gemtk_wm_get_user_data(win);
if ((ev_out->emo_events & MU_MESAG) != 0) {
// handle message
@@ -133,7 +133,7 @@ static void on_redraw(struct gui_download_window *dw, GRECT *clip)
GRECT work, visible;
uint32_t p = 0;
- guiwin_get_grect(dw->guiwin, GUIWIN_AREA_TOOLBAR, &work);
+ gemtk_wm_get_grect(dw->guiwin, GEMTK_WM_AREA_TOOLBAR, &work);
tree->ob_x = work.g_x;
tree->ob_y = work.g_y;
@@ -175,7 +175,7 @@ static void on_abort_click(struct gui_download_window *dw)
{
if( dw->status == NSATARI_DOWNLOAD_COMPLETE
|| dw->status == NSATARI_DOWNLOAD_ERROR ) {
- guiwin_send_msg(dw->guiwin, WM_CLOSED, 0,0,0,0);
+ gemtk_wm_send_msg(dw->guiwin, WM_CLOSED, 0,0,0,0);
}
else if( dw->status != NSATARI_DOWNLOAD_CANCELED ){
dw->abort = true;
@@ -186,9 +186,9 @@ static void on_cbrdy_click(struct gui_download_window *dw)
{
dw->close_on_finish = !dw->close_on_finish;
if (dw->close_on_finish && dw->status == NSATARI_DOWNLOAD_COMPLETE) {
- guiwin_send_msg(dw->guiwin, WM_CLOSED, 0,0,0,0);
+ gemtk_wm_send_msg(dw->guiwin, WM_CLOSED, 0,0,0,0);
}
- guiwin_send_redraw(dw->guiwin, NULL);
+ gemtk_wm_send_redraw(dw->guiwin, NULL);
evnt_timer(250);
}
@@ -218,7 +218,7 @@ static void gui_download_window_destroy( struct gui_download_window * gdw)
if (gdw->fbuf != NULL) {
free( gdw->fbuf );
}
- guiwin_remove(gdw->guiwin);
+ gemtk_wm_remove(gdw->guiwin);
wind_close(gdw->aes_handle);
wind_delete(gdw->aes_handle);
free(gdw);
@@ -256,7 +256,7 @@ struct gui_download_window * gui_download_window_create(download_context *ctx,
const char * url;
struct gui_download_window * gdw;
int dlgres = 0;
- OBJECT * tree = get_tree(DOWNLOAD);
+ OBJECT * tree = gemtk_obj_get_tree(DOWNLOAD);
char alert[200];
@@ -314,7 +314,7 @@ struct gui_download_window * gui_download_window_create(download_context *ctx,
if( gdw->fd == NULL ){
char spare[200];
snprintf(spare, 200, "Couldn't open %s for writing!", gdw->destination);
- msg_box_show(MSG_BOX_ALERT, spare);
+ gemtk_msg_box_show(GEMTK_MSG_BOX_ALERT, spare);
gui_download_window_destroy(gdw);
return( NULL );
}
@@ -326,16 +326,16 @@ struct gui_download_window * gui_download_window_create(download_context *ctx,
gdw->aes_handle = wind_create_grect(CLOSER | NAME | MOVER, &desk_area);
wind_set_str(gdw->aes_handle, WF_NAME, "Download");
- unsigned long gwflags = GW_FLAG_DEFAULTS;
- gdw->guiwin = guiwin_add(gdw->aes_handle, gwflags, on_aes_event);
+ unsigned long gwflags = GEMTK_WM_FLAG_DEFAULTS;
+ gdw->guiwin = gemtk_wm_add(gdw->aes_handle, gwflags, on_aes_event);
if( gdw->guiwin == NULL || gdw->fd == NULL ){
die("could not create guiwin");
gui_download_window_destroy(gdw);
return( NULL );
}
- guiwin_set_user_data(gdw->guiwin, gdw);
- guiwin_set_toolbar(gdw->guiwin, tree, 0, 0);
- guiwin_set_toolbar_redraw_func(gdw->guiwin, toolbar_redraw_cb);
+ gemtk_wm_set_user_data(gdw->guiwin, gdw);
+ gemtk_wm_set_toolbar(gdw->guiwin, tree, 0, 0);
+ gemtk_wm_set_toolbar_redraw_func(gdw->guiwin, toolbar_redraw_cb);
strncpy((char*)&gdw->lbl_file, filename, MAX_SLEN_LBL_FILE-1);
LOG(("created download: %s (total size: %d)",
@@ -379,7 +379,7 @@ nserror gui_download_window_data(struct gui_download_window *dw,
dw->status = NSATARI_DOWNLOAD_CANCELED;
dw->abort = false;
download_context_abort(dw->ctx);
- guiwin_send_redraw(dw->guiwin, NULL);
+ gemtk_wm_send_redraw(dw->guiwin, NULL);
return(NSERROR_OK);
}
@@ -411,7 +411,7 @@ nserror gui_download_window_data(struct gui_download_window *dw,
(dw->size_total>0) ? human_friendly_bytesize(dw->size_total) : "?"
);
- guiwin_send_redraw(dw->guiwin, NULL);
+ gemtk_wm_send_redraw(dw->guiwin, NULL);
}
return NSERROR_OK;
}
@@ -422,7 +422,7 @@ void gui_download_window_error(struct gui_download_window *dw,
LOG(("%s", error_msg));
strncpy((char*)&dw->lbl_file, error_msg, MAX_SLEN_LBL_FILE-1);
dw->status = NSATARI_DOWNLOAD_ERROR;
- guiwin_send_redraw(dw->guiwin, NULL);
+ gemtk_wm_send_redraw(dw->guiwin, NULL);
gui_window_set_status(input_window, messages_get("Done") );
// TODO: change abort to close
}
@@ -442,7 +442,7 @@ void gui_download_window_done(struct gui_download_window *dw)
tree = dw->tree;
if (dw->close_on_finish) {
- guiwin_send_msg(dw->guiwin, WM_CLOSED, 0, 0, 0, 0);
+ gemtk_wm_send_msg(dw->guiwin, WM_CLOSED, 0, 0, 0, 0);
} else {
snprintf( (char*)&dw->lbl_percent, MAX_SLEN_LBL_PERCENT,
"%lu%s", 100, "%"
@@ -451,7 +451,7 @@ void gui_download_window_done(struct gui_download_window *dw)
human_friendly_bytesize(dw->size_downloaded),
(dw->size_total>0) ? human_friendly_bytesize(dw->size_total) : human_friendly_bytesize(dw->size_downloaded)
);
- guiwin_send_redraw(dw->guiwin, NULL);
+ gemtk_wm_send_redraw(dw->guiwin, NULL);
}
gui_window_set_status(input_window, messages_get("Done") );
}
diff --git a/atari/gemtk/dragdrop.c b/atari/gemtk/dragdrop.c
index e4ae2da4d..a4b7b82a3 100755
--- a/atari/gemtk/dragdrop.c
+++ b/atari/gemtk/dragdrop.c
@@ -50,7 +50,7 @@ static long pipesig;
* -1: Fehler beim Erzeugen der Pipe
*/
-short ddcreate(short *pipe)
+short gemtk_dd_create(short *pipe)
{
long fd = -1;
@@ -83,7 +83,7 @@ short ddcreate(short *pipe)
/* Signalhandler konfigurieren */
- ddgetsig(&pipesig);
+ gemtk_dd_getsig(&pipesig);
return((short) fd);
@@ -113,7 +113,7 @@ short ddcreate(short *pipe)
* -3: Fehler bei appl_write()
*/
-short ddmessage(short apid, short fd, short winid, short mx, short my, short kstate, short pipeid)
+short gemtk_dd_message(short apid, short fd, short winid, short mx, short my, short kstate, short pipeid)
{
char c;
short i, msg[8];
@@ -135,7 +135,7 @@ short ddmessage(short apid, short fd, short winid, short mx, short my, short kst
if (i == 0)
{
- ddclose(fd);
+ gemtk_dd_close(fd);
return(-3);
}
@@ -148,7 +148,7 @@ short ddmessage(short apid, short fd, short winid, short mx, short my, short kst
{
/* Timeout eingetreten */
- ddclose(fd);
+ gemtk_dd_close(fd);
return(-2);
}
@@ -157,13 +157,13 @@ short ddmessage(short apid, short fd, short winid, short mx, short my, short kst
if (Fread(fd, 1L, &c) != 1L)
{
- ddclose(fd);
+ gemtk_dd_close(fd);
return(-1);
}
if (c != DD_OK)
{
- ddclose(fd);
+ gemtk_dd_close(fd);
return(-1);
}
@@ -187,11 +187,11 @@ short ddmessage(short apid, short fd, short winid, short mx, short my, short kst
* -1: Fehler beim Lesen aus der Pipe
*/
-short ddrexts(short fd, char *exts)
+short gemtk_dd_rexts(short fd, char *exts)
{
if (Fread(fd, DD_EXTSIZE, exts) != DD_EXTSIZE)
{
- ddclose(fd);
+ gemtk_dd_close(fd);
return(-1);
}
@@ -204,7 +204,7 @@ short ddrexts(short fd, char *exts)
* Testet, ob der Empf„nger einen Datentyp akzeptiert
*
* Eingabeparameter:
-* fd - Filehandle (von ddcreate())
+* fd - Filehandle (von gemtk_dd_create())
* ext - Zeiger auf Datentyp (4 Bytes zB. "ARGS")
* text - Zeiger auf Datenbeschreibung (optional, zB. "DESKTOP args")
* name - Zeiger auf Datendateiname (optional, zB. "SAMPLE.TXT")
@@ -223,7 +223,7 @@ short ddrexts(short fd, char *exts)
* DD_CLIPBOARD - Drop erfolgte auf Clipboard
*/
-short ddstry(short fd, char *ext, char *text, char *name, long size)
+short gemtk_dd_stry(short fd, char *ext, char *text, char *name, long size)
{
char c;
short hdrlen, i;
@@ -264,11 +264,11 @@ short ddstry(short fd, char *ext, char *text, char *name, long size)
* Pipe schliežen (Drag&Drop beenden/abbrechen)
*/
-void ddclose(short fd)
+void gemtk_dd_close(short fd)
{
/* Signalhandler restaurieren */
- ddsetsig(pipesig);
+ gemtk_dd_setsig(pipesig);
Fclose(fd);
@@ -288,7 +288,7 @@ void ddclose(short fd)
* keine
*/
-void ddgetsig(long *oldsig)
+void gemtk_dd_getsig(long *oldsig)
{
*oldsig = (long) Psignal(SIGPIPE, (void *) SIG_IGN);
}
@@ -298,7 +298,7 @@ void ddgetsig(long *oldsig)
* Signalhandler nach D&D restaurieren
*
* Eingabeparameter:
-* oldsig - Alter Handlerwert (von ddgetsig)
+* oldsig - Alter Handlerwert (von gemtk_dd_getsig)
*
* Ausgabeparameter:
* keine
@@ -307,7 +307,7 @@ void ddgetsig(long *oldsig)
* keine
*/
-void ddsetsig(long oldsig)
+void gemtk_dd_setsig(long oldsig)
{
if (oldsig != -32L)
Psignal(SIGPIPE, (void *) oldsig);
@@ -332,7 +332,7 @@ void ddsetsig(long oldsig)
* -1 - Drag&Drop abgebrochen
*/
-short ddopen(short ddnam, char ddmsg)
+short gemtk_dd_open(short ddnam, char ddmsg)
{
long fd;
@@ -347,12 +347,12 @@ short ddopen(short ddnam, char ddmsg)
/* Signalhandler konfigurieren */
- ddgetsig(&pipesig);
+ gemtk_dd_getsig(&pipesig);
if (Fwrite((short) fd, 1L, &ddmsg) != 1L)
{
- ddclose((short) fd);
+ gemtk_dd_close((short) fd);
return(-1);
}
@@ -380,11 +380,11 @@ short ddopen(short ddnam, char ddmsg)
* -1: Fehler beim Schreiben in die Pipe
*/
-short ddsexts(short fd, char *exts)
+short gemtk_dd_sexts(short fd, char *exts)
{
if (Fwrite(fd, DD_EXTSIZE, exts) != DD_EXTSIZE)
{
- ddclose(fd);
+ gemtk_dd_close(fd);
return(-1);
}
@@ -397,7 +397,7 @@ short ddsexts(short fd, char *exts)
* N„chsten Header vom Sender holen
*
* Eingabeparameter:
-* fd - Filehandle der Pipe (von ddopen())
+* fd - Filehandle der Pipe (von gemtk_dd_open())
*
* Ausgabeparameters:
* name - Zeiger auf Buffer fr Datenbeschreibung (min. DD_NAMEMAX!)
@@ -419,7 +419,7 @@ short ddsexts(short fd, char *exts)
* les string sont limit‚ a 128 octets
*/
-short ddrtry(short fd, char *name, char *file, char *whichext, long *size)
+short gemtk_dd_rtry(short fd, char *name, char *file, char *whichext, long *size)
{
char buf[DD_NAMEMAX * 2];
short hdrlen, i, len;
@@ -490,7 +490,7 @@ short ddrtry(short fd, char *name, char *file, char *whichext, long *size)
* Sendet der Senderapplikation eine 1 Byte Antwort
*
* Eingabeparameter:
-* fd - Filehandle der Pipe (von ddopen())
+* fd - Filehandle der Pipe (von gemtk_dd_open())
* ack - Byte das gesendet werden soll (zB. DD_OK)
*
* Ausgabeparameter:
@@ -501,11 +501,11 @@ short ddrtry(short fd, char *name, char *file, char *whichext, long *size)
* -1: Fehler (die Pipe wird automatisch geschlossen!)
*/
-short ddreply(short fd, char ack)
+short gemtk_dd_reply(short fd, char ack)
{
if (Fwrite(fd, 1L, &ack) != 1L)
{
- ddclose(fd);
+ gemtk_dd_close(fd);
return(-1);
}
diff --git a/atari/gemtk/gemtk.h b/atari/gemtk/gemtk.h
index 679858af3..1fb1426f9 100644
--- a/atari/gemtk/gemtk.h
+++ b/atari/gemtk/gemtk.h
@@ -37,12 +37,12 @@ unsigned short _systype (void);
* Chech for GRECT intersection without modifiend the src rectangles
* return true when the GRECT's intersect, fals otherwise.
*/
-bool rc_intersect_ro(GRECT *a, GRECT *b);
+bool gemtk_rc_intersect_ro(GRECT *a, GRECT *b);
/*
* Convert keycode returned by evnt_multi to ascii value
*/
-int keybd2ascii( int keybd, int shift);
+int gemtk_keybd2ascii( int keybd, int shift);
/** set VDI clip area by passing an GRECT */
void gemtk_clip_grect(VdiHdl vh, GRECT *rect);
@@ -75,45 +75,44 @@ void gemtk_clip_grect(VdiHdl vh, GRECT *rect);
/* -------------------------------------------------------------------------- */
/* MultiTOS Drag & Drop */
/* -------------------------------------------------------------------------- */
-short ddcreate(short *pipe);
-short ddmessage(short apid, short fd, short winid, short mx, short my, short kstate, short pipename);
-short ddrexts(short fd, char *exts);
-short ddstry(short fd, char *ext, char *text, char *name, long size);
-void ddclose(short fd);
-void ddgetsig(long *oldsig);
-void ddsetsig(long oldsig);
-short ddopen(short ddnam, char ddmsg);
-short ddsexts(short fd, char *exts);
-short ddrtry(short fd, char *name, char *file, char *whichext, long *size);
-short ddreply(short fd, char ack);
+short gemtk_dd_create(short *pipe);
+short gemtk_dd_message(short apid, short fd, short winid, short mx, short my, short kstate, short pipename);
+short gemtk_dd_rexts(short fd, char *exts);
+short gemtk_dd_stry(short fd, char *ext, char *text, char *name, long size);
+void gemtk_dd_close(short fd);
+void gemtk_dd_getsig(long *oldsig);
+void gemtk_dd_setsig(long oldsig);
+short gemtk_dd_open(short ddnam, char ddmsg);
+short gemtk_dd_sexts(short fd, char *exts);
+short gemtk_dd_rtry(short fd, char *name, char *file, char *whichext, long *size);
+short gemtk_dd_reply(short fd, char ack);
/* -------------------------------------------------------------------------- */
/* Message Box module */
/* -------------------------------------------------------------------------- */
-#define MSG_BOX_ALERT 1
-#define MSG_BOX_CONFIRM 2
+#define GEMTK_MSG_BOX_ALERT 1
+#define GEMTK_MSG_BOX_CONFIRM 2
-short msg_box_show(short type, const char * msg);
+short gemtk_msg_box_show(short type, const char * msg);
/* -------------------------------------------------------------------------- */
/* GUIWIN Module */
/* -------------------------------------------------------------------------- */
-#define GW_FLAG_PREPROC_WM 0x01 // let guiwin API handle some events
-#define GW_FLAG_RECV_PREPROC_WM 0x02 // get notified even when pre-processed
-#define GW_FLAG_HAS_VTOOLBAR 0x04 // the attached toolbar is vertical
-#define GW_FLAG_CUSTOM_TOOLBAR 0x08 // no internal toolbar handling
-#define GW_FLAG_CUSTOM_SCROLLING 0x20 // no internal scroller handling
+#define GEMTK_WM_FLAG_PREPROC_WM 0x01 // let guiwin API handle some events
+#define GEMTK_WM_FLAG_RECV_PREPROC_WM 0x02 // get notified even when pre-processed
+#define GEMTK_WM_FLAG_HAS_VTOOLBAR 0x04 // the attached toolbar is vertical
+#define GEMTK_WM_FLAG_CUSTOM_TOOLBAR 0x08 // no internal toolbar handling
+#define GEMTK_WM_FLAG_CUSTOM_SCROLLING 0x20 // no internal scroller handling
-#define GW_FLAG_DEFAULTS (GW_FLAG_PREPROC_WM | GW_FLAG_RECV_PREPROC_WM)
+#define GEMTK_WM_FLAG_DEFAULTS \
+ (GEMTK_WM_FLAG_PREPROC_WM | GEMTK_WM_FLAG_RECV_PREPROC_WM)
-#define GW_STATUS_ICONIFIED 0x01
-#define GW_STATUS_SHADED 0x02
+#define GEMTK_WM_STATUS_ICONIFIED 0x01
+#define GEMTK_WM_STATUS_SHADED 0x02
-#define GW_CB_SELECTED (OS_SELECTED)
-
-#define GUIWIN_VSLIDER 0x01
-#define GUIWIN_HSLIDER 0x02
-#define GUIWIN_VH_SLIDER 0x03
+#define GEMTK_WM_VSLIDER 0x01
+#define GEMTK_WM_HSLIDER 0x02
+#define GEMTK_WM_VH_SLIDER 0x03
/*
Message sent to the client application when an AES object is
@@ -124,20 +123,20 @@ short msg_box_show(short type, const char * msg);
msg[5] = Number of clicks.
msg[6] = Modifier keys.
*/
-#define GUIWIN_WM_FORM 1001
+#define GEMTK_WM_WM_FORM 1001
-struct gui_window_s;
+struct gemtk_window_s;
/** list struct for managing AES windows */
-typedef struct gui_window_s GUIWIN;
+typedef struct gemtk_window_s GUIWIN;
/** GUIWIN event handler */
-typedef short (*guiwin_event_handler_f)(GUIWIN *gw,
+typedef short (*gemtk_wm_event_handler_f)(GUIWIN *gw,
EVMULT_OUT *ev_out, short msg[8]);
-typedef void (*guiwin_redraw_f)(GUIWIN *win, uint16_t msg, GRECT *clip);
+typedef void (*gemtk_wm_redraw_f)(GUIWIN *win, uint16_t msg, GRECT *clip);
-struct guiwin_scroll_info_s {
+struct gemtk_wm_scroll_info_s {
/** Definition of a content unit (horizontal) measured in pixel */
int x_unit_px;
@@ -160,9 +159,9 @@ struct guiwin_scroll_info_s {
/** Well known areas inside the window */
enum guwin_area_e {
- GUIWIN_AREA_WORK = 0,
- GUIWIN_AREA_TOOLBAR,
- GUIWIN_AREA_CONTENT
+ GEMTK_WM_AREA_WORK = 0,
+ GEMTK_WM_AREA_TOOLBAR,
+ GEMTK_WM_AREA_CONTENT
};
/* -------------------------------------------------------------------------- */
@@ -170,67 +169,67 @@ enum guwin_area_e {
/* -------------------------------------------------------------------------- */
short
-guiwin_init(void);
+gemtk_wm_init(void);
void
-guiwin_exit(void);
+gemtk_wm_exit(void);
-GUIWIN * guiwin_add(short handle, uint32_t flags,
- guiwin_event_handler_f handler);
+GUIWIN * gemtk_wm_add(short handle, uint32_t flags,
+ gemtk_wm_event_handler_f handler);
-GUIWIN * guiwin_find(short handle);
+GUIWIN * gemtk_wm_find(short handle);
-short guiwin_remove(GUIWIN *win);
+short gemtk_wm_remove(GUIWIN *win);
-GUIWIN * guiwin_validate_ptr(GUIWIN *win);
+GUIWIN * gemtk_wm_validate_ptr(GUIWIN *win);
-short guiwin_dispatch_event(EVMULT_IN *ev_in, EVMULT_OUT *ev_out, short msg[8]);
+short gemtk_wm_dispatch_event(EVMULT_IN *ev_in, EVMULT_OUT *ev_out, short msg[8]);
-void guiwin_get_grect(GUIWIN *win, enum guwin_area_e mode, GRECT *dest);
+void gemtk_wm_get_grect(GUIWIN *win, enum guwin_area_e mode, GRECT *dest);
-short guiwin_get_handle(GUIWIN *win);
+short gemtk_wm_get_handle(GUIWIN *win);
-uint32_t guiwin_get_state(GUIWIN *win);
+uint32_t gemtk_wm_get_state(GUIWIN *win);
-void guiwin_set_toolbar(GUIWIN *win, OBJECT *toolbar, short idx,
+void gemtk_wm_set_toolbar(GUIWIN *win, OBJECT *toolbar, short idx,
uint32_t flags);
-void guiwin_set_event_handler(GUIWIN *win,guiwin_event_handler_f cb);
+void gemtk_wm_set_event_handler(GUIWIN *win,gemtk_wm_event_handler_f cb);
-void guiwin_set_user_data(GUIWIN *win, void *data);
+void gemtk_wm_set_user_data(GUIWIN *win, void *data);
-void * guiwin_get_user_data(GUIWIN *win);
+void * gemtk_wm_get_user_data(GUIWIN *win);
-struct guiwin_scroll_info_s * guiwin_get_scroll_info(GUIWIN *win);
+struct gemtk_wm_scroll_info_s * gemtk_wm_get_scroll_info(GUIWIN *win);
-void guiwin_set_scroll_grid(GUIWIN * win, short x, short y);
+void gemtk_wm_set_scroll_grid(GUIWIN * win, short x, short y);
-void guiwin_set_content_units(GUIWIN * win, short x, short y);
+void gemtk_wm_set_content_units(GUIWIN * win, short x, short y);
-void guiwin_set_form(GUIWIN *win, OBJECT *tree, short index);
+void gemtk_wm_set_form(GUIWIN *win, OBJECT *tree, short index);
-void guiwin_set_toolbar_size(GUIWIN *win, uint16_t s);
+void gemtk_wm_set_toolbar_size(GUIWIN *win, uint16_t s);
-void guiwin_set_toolbar_redraw_func(GUIWIN *win, guiwin_redraw_f func);
+void gemtk_wm_set_toolbar_redraw_func(GUIWIN *win, gemtk_wm_redraw_f func);
-bool guiwin_update_slider(GUIWIN *win, short mode);
+bool gemtk_wm_update_slider(GUIWIN *win, short mode);
-void guiwin_scroll(GUIWIN *gw, short orientation, int units, bool refresh);
+void gemtk_wm_scroll(GUIWIN *gw, short orientation, int units, bool refresh);
-void guiwin_send_msg(GUIWIN *win, short msgtype, short a, short b, short c,
+void gemtk_wm_send_msg(GUIWIN *win, short msgtype, short a, short b, short c,
short d);
-void guiwin_send_redraw(GUIWIN *win, GRECT *area);
+void gemtk_wm_send_redraw(GUIWIN *win, GRECT *area);
-VdiHdl guiwin_get_vdi_handle(GUIWIN *win);
+VdiHdl gemtk_wm_get_vdi_handle(GUIWIN *win);
-bool guiwin_has_intersection(GUIWIN *win, GRECT *work);
+bool gemtk_wm_has_intersection(GUIWIN *win, GRECT *work);
-void guiwin_toolbar_redraw(GUIWIN *win, uint16_t msg, GRECT *clip);
+void gemtk_wm_toolbar_redraw(GUIWIN *win, uint16_t msg, GRECT *clip);
-void guiwin_form_redraw(GUIWIN *gw, GRECT *clip);
+void gemtk_wm_form_redraw(GUIWIN *gw, GRECT *clip);
-void guiwin_clear(GUIWIN *win);
+void gemtk_wm_clear(GUIWIN *win);
/* -------------------------------------------------------------------------- */
/* AES SCROLLER MODULE */
@@ -244,9 +243,9 @@ void guiwin_clear(GUIWIN *win);
/* AES OBJECT TREE TOOLS */
/* -------------------------------------------------------------------------- */
char gemtk_obj_set_str_safe(OBJECT * tree, short idx, char *txt);
-char *get_text(OBJECT * tree, short idx);
-GRECT * obj_screen_rect(OBJECT * tree, short obj);
-bool obj_is_inside(OBJECT * tree, short obj, GRECT *area);
-OBJECT *get_tree(int idx);
+char *gemtk_obj_get_text(OBJECT * tree, short idx);
+GRECT * gemtk_obj_screen_rect(OBJECT * tree, short obj);
+bool gemtk_obj_is_inside(OBJECT * tree, short obj, GRECT *area);
+OBJECT *gemtk_obj_get_tree(int idx);
void gemtk_obj_mouse_sprite(OBJECT *tree, int index);
#endif // GEMTK_H_INCLUDED
diff --git a/atari/gemtk/guiwin.c b/atari/gemtk/guiwin.c
index 097eb6e06..9dc3868a9 100644
--- a/atari/gemtk/guiwin.c
+++ b/atari/gemtk/guiwin.c
@@ -29,16 +29,16 @@
//#define DEBUG_PRINT(x) printf x
#define DEBUG_PRINT(x)
-struct gui_window_s {
+struct gemtk_window_s {
/** The AES handle of the window */
short handle;
/** the generic event handler function for events passed to the client */
- guiwin_event_handler_f handler_func;
+ gemtk_wm_event_handler_f handler_func;
/** The custom toolbar redraw function, if any */
- guiwin_redraw_f toolbar_redraw_func;
+ gemtk_wm_redraw_f toolbar_redraw_func;
/** window configuration */
uint32_t flags;
@@ -58,8 +58,8 @@ struct gui_window_s {
/** Describes the start of the toolbar tree (usually 0) */
short toolbar_idx;
- /** depending on the flag GW_FLAG_HAS_VTOOLBAR this defines the toolbar
- height or the toolbar width (GW_FLAG_HAS_VTOOLBAR means width).
+ /** depending on the flag GEMTK_WM_FLAG_HAS_VTOOLBAR this defines the toolbar
+ height or the toolbar width (GEMTK_WM_FLAG_HAS_VTOOLBAR means width).
*/
short toolbar_size;
@@ -76,13 +76,13 @@ struct gui_window_s {
short form_idx;
/** Scroll state */
- struct guiwin_scroll_info_s scroll_info;
+ struct gemtk_wm_scroll_info_s scroll_info;
/** Arbitary data set by the user */
void *user_data;
/** linked list items */
- struct gui_window_s *next, *prev;
+ struct gemtk_window_s *next, *prev;
};
static GUIWIN * winlist;
@@ -95,7 +95,7 @@ static void move_rect(GUIWIN * win, GRECT *rect, int dx, int dy)
long dum = 0L;
GRECT g;
- VdiHdl vh = guiwin_get_vdi_handle(win);
+ VdiHdl vh = gemtk_wm_get_vdi_handle(win);
while(!wind_update(BEG_UPDATE));
graf_mouse(M_OFF, 0L);
@@ -126,14 +126,14 @@ static short preproc_wm(GUIWIN * gw, EVMULT_OUT *ev_out, short msg[8])
GRECT g, g_ro, g2;
short retval = 1;
int val = 1, old_val;
- struct guiwin_scroll_info_s *slid;
+ struct gemtk_wm_scroll_info_s *slid;
switch(msg[0]) {
case WM_HSLID:
- guiwin_get_grect(gw, GUIWIN_AREA_CONTENT, &g);
+ gemtk_wm_get_grect(gw, GEMTK_WM_AREA_CONTENT, &g);
wind_set(gw->handle, WF_HSLIDE, msg[4], 0, 0, 0);
- slid = guiwin_get_scroll_info(gw);
+ slid = gemtk_wm_get_scroll_info(gw);
val = (float)(slid->x_units-(g.g_w/slid->x_unit_px))/1000*(float)msg[4];
if(val != slid->x_pos) {
if (val < slid->x_pos) {
@@ -141,14 +141,14 @@ static short preproc_wm(GUIWIN * gw, EVMULT_OUT *ev_out, short msg[8])
} else {
val = val-slid->x_pos;
}
- guiwin_scroll(gw, GUIWIN_HSLIDER, val, false);
+ gemtk_wm_scroll(gw, GEMTK_WM_HSLIDER, val, false);
}
break;
case WM_VSLID:
- guiwin_get_grect(gw, GUIWIN_AREA_CONTENT, &g);
+ gemtk_wm_get_grect(gw, GEMTK_WM_AREA_CONTENT, &g);
wind_set(gw->handle, WF_VSLIDE, msg[4], 0, 0, 0);
- slid = guiwin_get_scroll_info(gw);
+ slid = gemtk_wm_get_scroll_info(gw);
val = (float)(slid->y_units-(g.g_h/slid->y_unit_px))/1000*(float)msg[4];
if(val != slid->y_pos) {
if (val < slid->y_pos) {
@@ -156,62 +156,62 @@ static short preproc_wm(GUIWIN * gw, EVMULT_OUT *ev_out, short msg[8])
} else {
val = val -slid->y_pos;
}
- guiwin_scroll(gw, GUIWIN_VSLIDER, val, false);
+ gemtk_wm_scroll(gw, GEMTK_WM_VSLIDER, val, false);
}
break;
case WM_ARROWED:
- if((gw->flags & GW_FLAG_CUSTOM_SCROLLING) == 0) {
+ if((gw->flags & GEMTK_WM_FLAG_CUSTOM_SCROLLING) == 0) {
- slid = guiwin_get_scroll_info(gw);
- guiwin_get_grect(gw, GUIWIN_AREA_CONTENT, &g);
+ slid = gemtk_wm_get_scroll_info(gw);
+ gemtk_wm_get_grect(gw, GEMTK_WM_AREA_CONTENT, &g);
g_ro = g;
switch(msg[4]) {
case WA_UPPAGE:
/* scroll page up */
- guiwin_scroll(gw, GUIWIN_VSLIDER, -(g.g_h/slid->y_unit_px),
+ gemtk_wm_scroll(gw, GEMTK_WM_VSLIDER, -(g.g_h/slid->y_unit_px),
true);
break;
case WA_UPLINE:
/* scroll line up */
- guiwin_scroll(gw, GUIWIN_VSLIDER, -1, true);
+ gemtk_wm_scroll(gw, GEMTK_WM_VSLIDER, -1, true);
break;
case WA_DNPAGE:
/* scroll page down */
- guiwin_scroll(gw, GUIWIN_VSLIDER, g.g_h/slid->y_unit_px,
+ gemtk_wm_scroll(gw, GEMTK_WM_VSLIDER, g.g_h/slid->y_unit_px,
true);
break;
case WA_DNLINE:
/* scroll line down */
- guiwin_scroll(gw, GUIWIN_VSLIDER, +1, true);
+ gemtk_wm_scroll(gw, GEMTK_WM_VSLIDER, +1, true);
break;
case WA_LFPAGE:
/* scroll page left */
- guiwin_scroll(gw, GUIWIN_HSLIDER, -(g.g_w/slid->x_unit_px),
+ gemtk_wm_scroll(gw, GEMTK_WM_HSLIDER, -(g.g_w/slid->x_unit_px),
true);
break;
case WA_LFLINE:
/* scroll line left */
- guiwin_scroll(gw, GUIWIN_HSLIDER, -1,
+ gemtk_wm_scroll(gw, GEMTK_WM_HSLIDER, -1,
true);
break;
case WA_RTPAGE:
/* scroll page right */
- guiwin_scroll(gw, GUIWIN_HSLIDER, (g.g_w/slid->x_unit_px),
+ gemtk_wm_scroll(gw, GEMTK_WM_HSLIDER, (g.g_w/slid->x_unit_px),
true);
break;
case WA_RTLINE:
/* scroll line right */
- guiwin_scroll(gw, GUIWIN_HSLIDER, 1,
+ gemtk_wm_scroll(gw, GEMTK_WM_HSLIDER, 1,
true);
break;
@@ -231,8 +231,8 @@ static short preproc_wm(GUIWIN * gw, EVMULT_OUT *ev_out, short msg[8])
if (gw->form) {
- guiwin_get_grect(gw, GUIWIN_AREA_CONTENT, &g);
- slid = guiwin_get_scroll_info(gw);
+ gemtk_wm_get_grect(gw, GEMTK_WM_AREA_CONTENT, &g);
+ slid = gemtk_wm_get_scroll_info(gw);
gw->form[gw->form_idx].ob_x = g.g_x -
(slid->x_pos * slid->x_unit_px);
@@ -251,9 +251,9 @@ static short preproc_wm(GUIWIN * gw, EVMULT_OUT *ev_out, short msg[8])
g.g_h = MIN(msg[7], g2.g_h);
if(g2.g_w != g.g_w || g2.g_h != g.g_h) {
wind_set(gw->handle, WF_CURRXYWH, g.g_x, g.g_y, g.g_w, g.g_h);
- if((gw->flags & GW_FLAG_CUSTOM_SCROLLING) == 0) {
- if(guiwin_update_slider(gw, GUIWIN_VH_SLIDER)) {
- guiwin_send_redraw(gw, NULL);
+ if((gw->flags & GEMTK_WM_FLAG_CUSTOM_SCROLLING) == 0) {
+ if(gemtk_wm_update_slider(gw, GEMTK_WM_VH_SLIDER)) {
+ gemtk_wm_send_redraw(gw, NULL);
}
}
}
@@ -268,45 +268,45 @@ static short preproc_wm(GUIWIN * gw, EVMULT_OUT *ev_out, short msg[8])
wind_get_grect(gw->handle, WF_PREVXYWH, &g);
}
wind_set_grect(gw->handle, WF_CURRXYWH, &g);
- if((gw->flags & GW_FLAG_CUSTOM_SCROLLING) == 0) {
- if(guiwin_update_slider(gw, GUIWIN_VH_SLIDER)) {
- guiwin_send_redraw(gw, NULL);
+ if((gw->flags & GEMTK_WM_FLAG_CUSTOM_SCROLLING) == 0) {
+ if(gemtk_wm_update_slider(gw, GEMTK_WM_VH_SLIDER)) {
+ gemtk_wm_send_redraw(gw, NULL);
}
}
break;
case WM_ICONIFY:
wind_set(gw->handle, WF_ICONIFY, msg[4], msg[5], msg[6], msg[7]);
- gw->state |= GW_STATUS_ICONIFIED;
+ gw->state |= GEMTK_WM_STATUS_ICONIFIED;
break;
case WM_UNICONIFY:
wind_set(gw->handle, WF_UNICONIFY, msg[4], msg[5], msg[6], msg[7]);
- gw->state &= ~(GW_STATUS_ICONIFIED);
+ gw->state &= ~(GEMTK_WM_STATUS_ICONIFIED);
break;
case WM_SHADED:
- gw->state |= GW_STATUS_SHADED;
+ gw->state |= GEMTK_WM_STATUS_SHADED;
break;
case WM_UNSHADED:
- gw->state &= ~(GW_STATUS_SHADED);
+ gw->state &= ~(GEMTK_WM_STATUS_SHADED);
break;
case WM_REDRAW:
- if ((gw->flags & GW_FLAG_CUSTOM_TOOLBAR) == 0) {
+ if ((gw->flags & GEMTK_WM_FLAG_CUSTOM_TOOLBAR) == 0) {
g.g_x = msg[4];
g.g_y = msg[5];
g.g_w = msg[6];
g.g_h = msg[7];
- guiwin_toolbar_redraw(gw, WM_REDRAW, &g);
+ gemtk_wm_toolbar_redraw(gw, WM_REDRAW, &g);
}
if (gw->form != NULL) {
g.g_x = msg[4];
g.g_y = msg[5];
g.g_w = msg[6];
g.g_h = msg[7];
- guiwin_form_redraw(gw, &g);
+ gemtk_wm_form_redraw(gw, &g);
}
break;
@@ -329,12 +329,12 @@ static short preproc_mu_button(GUIWIN * gw, EVMULT_OUT *ev_out, short msg[8])
DEBUG_PRINT(("preproc_mu_button\n"));
// toolbar handling:
- if ((gw->flags & GW_FLAG_CUSTOM_TOOLBAR) == 0
+ if ((gw->flags & GEMTK_WM_FLAG_CUSTOM_TOOLBAR) == 0
&& gw->toolbar != NULL) {
GRECT tb_area;
- guiwin_get_grect(gw, GUIWIN_AREA_TOOLBAR, &tb_area);
+ gemtk_wm_get_grect(gw, GEMTK_WM_AREA_TOOLBAR, &tb_area);
if (POINT_WITHIN(ev_out->emo_mouse.p_x,
ev_out->emo_mouse.p_y, tb_area)) {
@@ -351,7 +351,7 @@ static short preproc_mu_button(GUIWIN * gw, EVMULT_OUT *ev_out, short msg[8])
DEBUG_PRINT(("Toolbar index: %d\n", obj_idx));
if (obj_idx > -1
&& (gw->toolbar[obj_idx].ob_state & OS_DISABLED)== 0
- && ((gw->flags & GW_FLAG_CUSTOM_TOOLBAR) == 0)) {
+ && ((gw->flags & GEMTK_WM_FLAG_CUSTOM_TOOLBAR) == 0)) {
uint16_t type = (gw->toolbar[obj_idx].ob_type & 0xFF);
uint16_t nextobj;
@@ -392,16 +392,16 @@ static short preproc_mu_button(GUIWIN * gw, EVMULT_OUT *ev_out, short msg[8])
if (gw->form != NULL) {
GRECT content_area;
- struct guiwin_scroll_info_s *slid;
+ struct gemtk_wm_scroll_info_s *slid;
DEBUG_PRINT(("preproc_mu_button: handling form click.\n"));
- guiwin_get_grect(gw, GUIWIN_AREA_CONTENT, &content_area);
+ gemtk_wm_get_grect(gw, GEMTK_WM_AREA_CONTENT, &content_area);
if (POINT_WITHIN(ev_out->emo_mouse.p_x,
ev_out->emo_mouse.p_y, content_area)) {
- slid = guiwin_get_scroll_info(gw);
+ slid = gemtk_wm_get_scroll_info(gw);
// adjust form position (considering window and scroll position):
gw->form[gw->form_idx].ob_x = content_area.g_x -
@@ -434,7 +434,7 @@ static short preproc_mu_button(GUIWIN * gw, EVMULT_OUT *ev_out, short msg[8])
}
short oldevents = ev_out->emo_events;
- short msg_out[8] = { GUIWIN_WM_FORM, gl_apid,
+ short msg_out[8] = { GEMTK_WM_WM_FORM, gl_apid,
0, gw->handle,
gw->form_focus_obj, ev_out->emo_mclicks,
ev_out->emo_kmeta, 0
@@ -534,14 +534,14 @@ static short preproc_mu_keybd(GUIWIN * gw, EVMULT_OUT *ev_out, short msg[8])
* Event Dispatcher function. The guiwin API doesn't own an event loop,
* so you have to inform it for every event that you want it to handle.
*/
-short guiwin_dispatch_event(EVMULT_IN *ev_in, EVMULT_OUT *ev_out, short msg[8])
+short gemtk_wm_dispatch_event(EVMULT_IN *ev_in, EVMULT_OUT *ev_out, short msg[8])
{
GUIWIN *dest;
short retval = 0;
bool handler_called = false;
if( (ev_out->emo_events & MU_MESAG) != 0 ) {
- DEBUG_PRINT(("guiwin_handle_event_multi_fast: %d (%x)\n", msg[0],
+ DEBUG_PRINT(("gemtk_wm_handle_event_multi_fast: %d (%x)\n", msg[0],
msg[0]));
switch (msg[0]) {
case WM_REDRAW:
@@ -565,12 +565,12 @@ short guiwin_dispatch_event(EVMULT_IN *ev_in, EVMULT_OUT *ev_out, short msg[8])
case AP_DRAGDROP:
case AP_TERM:
case AP_TFAIL:
- dest = guiwin_find(msg[3]);
+ dest = gemtk_wm_find(msg[3]);
if (dest) {
DEBUG_PRINT(("Found WM_ dest: %p (%d), flags: %d, cb: %p\n", dest, dest->handle, dest->flags, dest->handler_func));
- if (dest->flags&GW_FLAG_PREPROC_WM) {
+ if (dest->flags&GEMTK_WM_FLAG_PREPROC_WM) {
retval = preproc_wm(dest, ev_out, msg);
- if(((retval == 0)||(dest->flags&GW_FLAG_RECV_PREPROC_WM))) {
+ if(((retval == 0)||(dest->flags&GEMTK_WM_FLAG_RECV_PREPROC_WM))) {
retval = dest->handler_func(dest, ev_out, msg);
handler_called = true;
}
@@ -590,7 +590,7 @@ short guiwin_dispatch_event(EVMULT_IN *ev_in, EVMULT_OUT *ev_out, short msg[8])
h_aes = wind_find(ev_out->emo_mouse.p_x, ev_out->emo_mouse.p_y);
if(h_aes > 0 && (ev_out->emo_events != MU_TIMER)) {
- dest = guiwin_find(h_aes);
+ dest = gemtk_wm_find(h_aes);
if (dest == NULL || dest->handler_func == NULL)
return(0);
@@ -623,7 +623,7 @@ short guiwin_dispatch_event(EVMULT_IN *ev_in, EVMULT_OUT *ev_out, short msg[8])
/**
* Initialises the guiwin API
*/
-short guiwin_init(void)
+short gemtk_wm_init(void)
{
if(v_vdi_h == -1) {
short dummy;
@@ -634,7 +634,7 @@ short guiwin_init(void)
return(0);
}
-void guiwin_exit(void)
+void gemtk_wm_exit(void)
{
v_clsvwk(v_vdi_h);
}
@@ -647,13 +647,13 @@ void guiwin_exit(void)
* \param flags Creation flags, configures how the AES window is handled
* \param cb event handler function for that window
*/
-GUIWIN * guiwin_add(short handle, uint32_t flags, guiwin_event_handler_f cb)
+GUIWIN * gemtk_wm_add(short handle, uint32_t flags, gemtk_wm_event_handler_f cb)
{
GUIWIN *win = calloc(sizeof(GUIWIN),1);
assert(win!=NULL);
- DEBUG_PRINT(("guiwin_add: %d, %p, cb: %p\n", handle, win, cb));
+ DEBUG_PRINT(("gemtk_wm_add: %d, %p, cb: %p\n", handle, win, cb));
win->handle = handle;
win->handler_func = cb;
@@ -679,7 +679,7 @@ GUIWIN * guiwin_add(short handle, uint32_t flags, guiwin_event_handler_f cb)
/**
* Returns an GUIWIN* for AES handle, when that AES window is managed by guiwin
*/
-GUIWIN *guiwin_find(short handle)
+GUIWIN *gemtk_wm_find(short handle)
{
GUIWIN *g;
DEBUG_PRINT(("guiwin search handle: %d\n", handle));
@@ -696,13 +696,13 @@ GUIWIN *guiwin_find(short handle)
/**
* Check's if the pointer is managed by the guiwin API.
*/
-GUIWIN *guiwin_validate_ptr(GUIWIN *win)
+GUIWIN *gemtk_wm_validate_ptr(GUIWIN *win)
{
GUIWIN *g;
for( g = winlist; g != NULL; g=g->next ) {
- DEBUG_PRINT(("guiwin guiwin_validate_ptr check: %p\n", g));
+ DEBUG_PRINT(("guiwin gemtk_wm_validate_ptr check: %p\n", g));
if(g == win) {
- DEBUG_PRINT(("guiwin_validate_ptr valid: %p\n", g));
+ DEBUG_PRINT(("gemtk_wm_validate_ptr valid: %p\n", g));
return(g);
}
}
@@ -713,9 +713,9 @@ GUIWIN *guiwin_validate_ptr(GUIWIN *win)
* Remove an GUIWIN from the list of managed windows.
* Call this when the AES window is closed or deleted.
*/
-short guiwin_remove(GUIWIN *win)
+short gemtk_wm_remove(GUIWIN *win)
{
- win = guiwin_validate_ptr(win);
+ win = gemtk_wm_validate_ptr(win);
if (win == NULL)
return(-1);
@@ -738,17 +738,17 @@ short guiwin_remove(GUIWIN *win)
* \param mode Specifies the area to retrieve.
* \param dest The calculated rectangle.
*/
-void guiwin_get_grect(GUIWIN *win, enum guwin_area_e mode, GRECT *dest)
+void gemtk_wm_get_grect(GUIWIN *win, enum guwin_area_e mode, GRECT *dest)
{
assert(win != NULL);
wind_get_grect(win->handle, WF_WORKXYWH, dest);
- if (mode == GUIWIN_AREA_CONTENT) {
+ if (mode == GEMTK_WM_AREA_CONTENT) {
GRECT tb_area;
- guiwin_get_grect(win, GUIWIN_AREA_TOOLBAR, &tb_area);
- if (win->flags & GW_FLAG_HAS_VTOOLBAR) {
+ gemtk_wm_get_grect(win, GEMTK_WM_AREA_TOOLBAR, &tb_area);
+ if (win->flags & GEMTK_WM_FLAG_HAS_VTOOLBAR) {
dest->g_x += tb_area.g_w;
dest->g_w -= tb_area.g_w;
}
@@ -756,9 +756,9 @@ void guiwin_get_grect(GUIWIN *win, enum guwin_area_e mode, GRECT *dest)
dest->g_y += tb_area.g_h;
dest->g_h -= tb_area.g_h;
}
- } else if (mode == GUIWIN_AREA_TOOLBAR) {
+ } else if (mode == GEMTK_WM_AREA_TOOLBAR) {
if (win->toolbar) {
- if (win->flags & GW_FLAG_HAS_VTOOLBAR) {
+ if (win->flags & GEMTK_WM_FLAG_HAS_VTOOLBAR) {
dest->g_w = win->toolbar_size;
} else {
dest->g_h = win->toolbar_size;
@@ -773,24 +773,24 @@ void guiwin_get_grect(GUIWIN *win, enum guwin_area_e mode, GRECT *dest)
/**
-* Scroll the content area (GUIWIN_AREA_CONTENT) in the specified dimension
-* (GUIWIN_VSLIDER, GUIWIN_HSLIDER)
+* Scroll the content area (GEMTK_WM_AREA_CONTENT) in the specified dimension
+* (GEMTK_WM_VSLIDER, GEMTK_WM_HSLIDER)
* \param win The GUIWIN
-* \param orientation GUIWIN_VSLIDER or GUIWIN_HSLIDER
+* \param orientation GEMTK_WM_VSLIDER or GEMTK_WM_HSLIDER
* \param units the amout to scroll (pass negative values to scroll up)
* \param refresh Sliders will be updated when this flag is set
*/
-void guiwin_scroll(GUIWIN *win, short orientation, int units, bool refresh)
+void gemtk_wm_scroll(GUIWIN *win, short orientation, int units, bool refresh)
{
- struct guiwin_scroll_info_s *slid = guiwin_get_scroll_info(win);
+ struct gemtk_wm_scroll_info_s *slid = gemtk_wm_get_scroll_info(win);
int oldpos = 0, newpos = 0, vis_units=0, pix = 0;
int abs_pix = 0;
GRECT *redraw=NULL, g, g_ro;
- guiwin_get_grect(win, GUIWIN_AREA_CONTENT, &g);
+ gemtk_wm_get_grect(win, GEMTK_WM_AREA_CONTENT, &g);
g_ro = g;
- if (orientation == GUIWIN_VSLIDER) {
+ if (orientation == GEMTK_WM_VSLIDER) {
pix = units*slid->y_unit_px;
abs_pix = abs(pix);
oldpos = slid->y_pos;
@@ -803,7 +803,7 @@ void guiwin_scroll(GUIWIN *win, short orientation, int units, bool refresh)
if(oldpos == newpos)
return;
- if (units>=vis_units || guiwin_has_intersection(win, &g_ro)) {
+ if (units>=vis_units || gemtk_wm_has_intersection(win, &g_ro)) {
// send complete redraw
redraw = &g_ro;
} else {
@@ -839,7 +839,7 @@ void guiwin_scroll(GUIWIN *win, short orientation, int units, bool refresh)
if(oldpos == newpos)
return;
- if (units>=vis_units || guiwin_has_intersection(win, &g_ro)) {
+ if (units>=vis_units || gemtk_wm_has_intersection(win, &g_ro)) {
// send complete redraw
redraw = &g_ro;
} else {
@@ -864,36 +864,36 @@ void guiwin_scroll(GUIWIN *win, short orientation, int units, bool refresh)
}
if (refresh) {
- guiwin_update_slider(win, orientation);
+ gemtk_wm_update_slider(win, orientation);
}
if ((redraw != NULL) && (redraw->g_h > 0)) {
- guiwin_send_redraw(win, redraw);
+ gemtk_wm_send_redraw(win, redraw);
}
}
/**
* Refresh the sliders of the window.
* \param win the GUIWIN
-* \param mode bitmask, valid bits: GUIWIN_VSLIDER, GUIWIN_HSLIDER
+* \param mode bitmask, valid bits: GEMTK_WM_VSLIDER, GEMTK_WM_HSLIDER
*/
-bool guiwin_update_slider(GUIWIN *win, short mode)
+bool gemtk_wm_update_slider(GUIWIN *win, short mode)
{
GRECT viewport;
- struct guiwin_scroll_info_s * slid;
+ struct gemtk_wm_scroll_info_s * slid;
unsigned long size, pos;
int old_x, old_y;
- short handle = guiwin_get_handle(win);
- guiwin_get_grect(win, GUIWIN_AREA_CONTENT, &viewport);
- slid = guiwin_get_scroll_info(win);
+ short handle = gemtk_wm_get_handle(win);
+ gemtk_wm_get_grect(win, GEMTK_WM_AREA_CONTENT, &viewport);
+ slid = gemtk_wm_get_scroll_info(win);
old_x = slid->x_pos;
old_y = slid->y_pos;
// TODO: check if the window has sliders of that direction...?
- if((mode & GUIWIN_VSLIDER) && (slid->y_unit_px > 0)) {
+ if((mode & GEMTK_WM_VSLIDER) && (slid->y_unit_px > 0)) {
if ( slid->y_units < (long)viewport.g_h/slid->y_unit_px) {
size = 1000L;
} else
@@ -910,7 +910,7 @@ bool guiwin_update_slider(GUIWIN *win, short mode)
wind_set(handle, WF_VSLIDE, 0, 0, 0, 0);
}
}
- if((mode & GUIWIN_HSLIDER) && (slid->x_unit_px > 0)) {
+ if((mode & GEMTK_WM_HSLIDER) && (slid->x_unit_px > 0)) {
if ( slid->x_units < (long)viewport.g_w/slid->x_unit_px)
size = 1000L;
else
@@ -937,7 +937,7 @@ bool guiwin_update_slider(GUIWIN *win, short mode)
/**
* Return the AES handle for the GUIWIN.
*/
-short guiwin_get_handle(GUIWIN *win)
+short gemtk_wm_get_handle(GUIWIN *win)
{
return(win->handle);
}
@@ -945,7 +945,7 @@ short guiwin_get_handle(GUIWIN *win)
/**
* Return the VDI handle for an GUIWIN.
*/
-VdiHdl guiwin_get_vdi_handle(GUIWIN *win)
+VdiHdl gemtk_wm_get_vdi_handle(GUIWIN *win)
{
return(v_vdi_h);
}
@@ -953,7 +953,7 @@ VdiHdl guiwin_get_vdi_handle(GUIWIN *win)
/**
* Returns the state bitmask of the window
*/
-uint32_t guiwin_get_state(GUIWIN *win)
+uint32_t gemtk_wm_get_state(GUIWIN *win)
{
return(win->state);
}
@@ -962,7 +962,7 @@ uint32_t guiwin_get_state(GUIWIN *win)
/**
* Set and new event handler function.
*/
-void guiwin_set_event_handler(GUIWIN *win,guiwin_event_handler_f cb)
+void gemtk_wm_set_event_handler(GUIWIN *win,gemtk_wm_event_handler_f cb)
{
win->handler_func = cb;
}
@@ -976,13 +976,13 @@ void guiwin_set_event_handler(GUIWIN *win,guiwin_event_handler_f cb)
* \param flags optional configuration flags
*/
//TODO: document flags
-void guiwin_set_toolbar(GUIWIN *win, OBJECT *toolbar, short idx, uint32_t flags)
+void gemtk_wm_set_toolbar(GUIWIN *win, OBJECT *toolbar, short idx, uint32_t flags)
{
win->toolbar = toolbar;
win->toolbar_idx = idx;
win->toolbar_edit_obj = -1;
- if (flags & GW_FLAG_HAS_VTOOLBAR) {
- win->flags |= GW_FLAG_HAS_VTOOLBAR;
+ if (flags & GEMTK_WM_FLAG_HAS_VTOOLBAR) {
+ win->flags |= GEMTK_WM_FLAG_HAS_VTOOLBAR;
win->toolbar_size = win->toolbar[idx].ob_width;
}
else {
@@ -992,9 +992,9 @@ void guiwin_set_toolbar(GUIWIN *win, OBJECT *toolbar, short idx, uint32_t flags)
/** Update width/height of the toolbar region
* \param win the GUIWIN
-* \param s depending on the flag GW_FLAG_HAS_VTOOLBAR this is the width or the height
+* \param s depending on the flag GEMTK_WM_FLAG_HAS_VTOOLBAR this is the width or the height
*/
-void guiwin_set_toolbar_size(GUIWIN *win, uint16_t s)
+void gemtk_wm_set_toolbar_size(GUIWIN *win, uint16_t s)
{
win->toolbar_size = s;
}
@@ -1004,7 +1004,7 @@ void guiwin_set_toolbar_size(GUIWIN *win, uint16_t s)
* \param win the GUIWIN
* \param func the custom redraw function
*/
-void guiwin_set_toolbar_redraw_func(GUIWIN *win, guiwin_redraw_f func)
+void gemtk_wm_set_toolbar_redraw_func(GUIWIN *win, gemtk_wm_redraw_f func)
{
win->toolbar_redraw_func = func;
}
@@ -1012,7 +1012,7 @@ void guiwin_set_toolbar_redraw_func(GUIWIN *win, guiwin_redraw_f func)
/**
* Attach an arbitary pointer to the GUIWIN
*/
-void guiwin_set_user_data(GUIWIN *win, void *data)
+void gemtk_wm_set_user_data(GUIWIN *win, void *data)
{
win->user_data = data;
}
@@ -1020,14 +1020,14 @@ void guiwin_set_user_data(GUIWIN *win, void *data)
/**
* Retrieve the user_data pointer attached to the GUIWIN.
*/
-void *guiwin_get_user_data(GUIWIN *win)
+void *gemtk_wm_get_user_data(GUIWIN *win)
{
return(win->user_data);
}
/** Get the scroll management structure for a GUIWIN
*/
-struct guiwin_scroll_info_s *guiwin_get_scroll_info(GUIWIN *win) {
+struct gemtk_wm_scroll_info_s *gemtk_wm_get_scroll_info(GUIWIN *win) {
return(&win->scroll_info);
}
@@ -1035,9 +1035,9 @@ struct guiwin_scroll_info_s *guiwin_get_scroll_info(GUIWIN *win) {
* Get the amount of content dimensions within the window
* which is calculated by using the scroll_info attached to the GUIWIN.
*/
-void guiwin_set_scroll_grid(GUIWIN * win, short x, short y)
+void gemtk_wm_set_scroll_grid(GUIWIN * win, short x, short y)
{
- struct guiwin_scroll_info_s *slid = guiwin_get_scroll_info(win);
+ struct gemtk_wm_scroll_info_s *slid = gemtk_wm_get_scroll_info(win);
assert(slid != NULL);
@@ -1051,9 +1051,9 @@ void guiwin_set_scroll_grid(GUIWIN * win, short x, short y)
* \param x horizontal size
* \param y vertical size
*/
-void guiwin_set_content_units(GUIWIN * win, short x, short y)
+void gemtk_wm_set_content_units(GUIWIN * win, short x, short y)
{
- struct guiwin_scroll_info_s *slid = guiwin_get_scroll_info(win);
+ struct gemtk_wm_scroll_info_s *slid = gemtk_wm_get_scroll_info(win);
assert(slid != NULL);
@@ -1069,7 +1069,7 @@ void guiwin_set_content_units(GUIWIN * win, short x, short y)
* \param c the 6th parameter to appl_write
* \param d the 7th parameter to appl_write
*/
-void guiwin_send_msg(GUIWIN *win, short msg_type, short a, short b, short c,
+void gemtk_wm_send_msg(GUIWIN *win, short msg_type, short a, short b, short c,
short d)
{
short msg[8];
@@ -1086,8 +1086,8 @@ void guiwin_send_msg(GUIWIN *win, short msg_type, short a, short b, short c,
appl_write(gl_apid, 16, &msg);
}
-// TODO: rename, document and implement alternative (guiwin_exec_event)
-void guiwin_send_redraw(GUIWIN *win, GRECT *area)
+// TODO: rename, document and implement alternative (gemtk_wm_exec_event)
+void gemtk_wm_send_redraw(GUIWIN *win, GRECT *area)
{
short msg[8], retval;
GRECT work;
@@ -1107,10 +1107,10 @@ void guiwin_send_redraw(GUIWIN *win, GRECT *area)
EVMULT_OUT event_out;
if (area == NULL) {
- guiwin_get_grect(win, GUIWIN_AREA_WORK, &work);
+ gemtk_wm_get_grect(win, GEMTK_WM_AREA_WORK, &work);
if (work.g_w < 1 || work.g_h < 1) {
if (win->toolbar != NULL) {
- guiwin_get_grect(win, GUIWIN_AREA_TOOLBAR, &work);
+ gemtk_wm_get_grect(win, GEMTK_WM_AREA_TOOLBAR, &work);
if (work.g_w < 1 || work.g_h < 1) {
return;
}
@@ -1130,7 +1130,7 @@ void guiwin_send_redraw(GUIWIN *win, GRECT *area)
event_out.emo_events = MU_MESAG;
retval = preproc_wm(win, &event_out, msg);
- if (retval == 0 || (win->flags & GW_FLAG_PREPROC_WM) != 0){
+ if (retval == 0 || (win->flags & GEMTK_WM_FLAG_PREPROC_WM) != 0){
win->handler_func(win, &event_out, msg);
}
@@ -1141,7 +1141,7 @@ void guiwin_send_redraw(GUIWIN *win, GRECT *area)
/** Attach an AES FORM to the GUIWIN, similar feature like the toolbar
*/
-void guiwin_set_form(GUIWIN *win, OBJECT *tree, short index)
+void gemtk_wm_set_form(GUIWIN *win, OBJECT *tree, short index)
{
DEBUG_PRINT(("Setting form %p (%d) for window %p\n", tree, index, win));
win->form = tree;
@@ -1152,13 +1152,13 @@ void guiwin_set_form(GUIWIN *win, OBJECT *tree, short index)
/** Checks if a GUIWIN is overlapped by other windows.
*/
-bool guiwin_has_intersection(GUIWIN *win, GRECT *work)
+bool gemtk_wm_has_intersection(GUIWIN *win, GRECT *work)
{
GRECT area, mywork;
bool retval = true;
if (work == NULL) {
- guiwin_get_grect(win, GUIWIN_AREA_CONTENT, &mywork);
+ gemtk_wm_get_grect(win, GEMTK_WM_AREA_CONTENT, &mywork);
work = &mywork;
}
@@ -1178,11 +1178,11 @@ bool guiwin_has_intersection(GUIWIN *win, GRECT *work)
* \param msg specifies the AES message which initiated the redraw, or 0 when
* the function was called without AES message context.
*/
-void guiwin_toolbar_redraw(GUIWIN *gw, uint16_t msg, GRECT *clip)
+void gemtk_wm_toolbar_redraw(GUIWIN *gw, uint16_t msg, GRECT *clip)
{
GRECT tb_area, tb_area_ro, g;
- guiwin_get_grect(gw, GUIWIN_AREA_TOOLBAR, &tb_area_ro);
+ gemtk_wm_get_grect(gw, GEMTK_WM_AREA_TOOLBAR, &tb_area_ro);
if(clip == NULL) {
clip = &tb_area_ro;
@@ -1222,19 +1222,19 @@ void guiwin_toolbar_redraw(GUIWIN *gw, uint16_t msg, GRECT *clip)
/** Execute FORM redraw
*/
-void guiwin_form_redraw(GUIWIN *gw, GRECT *clip)
+void gemtk_wm_form_redraw(GUIWIN *gw, GRECT *clip)
{
GRECT area, area_ro, g;
int scroll_px_x, scroll_px_y;
- struct guiwin_scroll_info_s *slid;
+ struct gemtk_wm_scroll_info_s *slid;
//int new_x, new_y, old_x, old_y;
short edit_idx;
- DEBUG_PRINT(("guiwin_form_redraw\n"));
+ DEBUG_PRINT(("gemtk_wm_form_redraw\n"));
// calculate form coordinates, include scrolling:
- guiwin_get_grect(gw, GUIWIN_AREA_CONTENT, &area_ro);
- slid = guiwin_get_scroll_info(gw);
+ gemtk_wm_get_grect(gw, GEMTK_WM_AREA_CONTENT, &area_ro);
+ slid = gemtk_wm_get_scroll_info(gw);
// Update form position:
gw->form[gw->form_idx].ob_x = area_ro.g_x - (slid->x_pos * slid->x_unit_px);
@@ -1264,19 +1264,19 @@ void guiwin_form_redraw(GUIWIN *gw, GRECT *clip)
/** Fill the content area with white color
*/
-void guiwin_clear(GUIWIN *win)
+void gemtk_wm_clear(GUIWIN *win)
{
GRECT area, g;
short pxy[4];
VdiHdl vh;
- vh = guiwin_get_vdi_handle(win);
+ vh = gemtk_wm_get_vdi_handle(win);
- if(win->state & GW_STATUS_ICONIFIED) {
+ if(win->state & GEMTK_WM_STATUS_ICONIFIED) {
// also clear the toolbar area when iconified:
- guiwin_get_grect(win, GUIWIN_AREA_WORK, &area);
+ gemtk_wm_get_grect(win, GEMTK_WM_AREA_WORK, &area);
} else {
- guiwin_get_grect(win, GUIWIN_AREA_CONTENT, &area);
+ gemtk_wm_get_grect(win, GEMTK_WM_AREA_CONTENT, &area);
}
vsf_interior(vh, FIS_SOLID);
diff --git a/atari/gemtk/msgbox.c b/atari/gemtk/msgbox.c
index 770e0af15..150bcc7f5 100644
--- a/atari/gemtk/msgbox.c
+++ b/atari/gemtk/msgbox.c
@@ -8,9 +8,9 @@
# define min(x,y) ((x<y) ? x : y )
#endif
-short msg_box_show(short type, const char * msg)
+short gemtk_msg_box_show(short type, const char * msg)
{
- #define MSG_BOX_STR_SIZE 256
+ #define GEMTK_MSG_BOX_STR_SIZE 256
short retval=0, i=0, z=0, l=0;
char c;
int len_msg = strlen(msg);
@@ -19,13 +19,13 @@ short msg_box_show(short type, const char * msg)
const char *str_yes = "Yes";
const char *str_no = "No";
const char *str_ok = "OK";
- char msg_box_str[MSG_BOX_STR_SIZE];
+ char msg_box_str[GEMTK_MSG_BOX_STR_SIZE];
char *dst = msg_box_str;
- memset(msg_box_str, 0, MSG_BOX_STR_SIZE);
+ memset(msg_box_str, 0, GEMTK_MSG_BOX_STR_SIZE);
- strncat(msg_box_str, "[1]", MSG_BOX_STR_SIZE);
- strncat(msg_box_str, "[", MSG_BOX_STR_SIZE);
+ strncat(msg_box_str, "[1]", GEMTK_MSG_BOX_STR_SIZE);
+ strncat(msg_box_str, "[", GEMTK_MSG_BOX_STR_SIZE);
dst = msg_box_str + strlen(msg_box_str);
@@ -61,24 +61,24 @@ short msg_box_show(short type, const char * msg)
dst++;
}
}
- strncat(msg_box_str, "][", MSG_BOX_STR_SIZE);
+ strncat(msg_box_str, "][", GEMTK_MSG_BOX_STR_SIZE);
- if(type == MSG_BOX_CONFIRM){
- strncat(msg_box_str, str_yes, MSG_BOX_STR_SIZE);
- strncat(msg_box_str, "|", MSG_BOX_STR_SIZE);
- strncat(msg_box_str, str_no, MSG_BOX_STR_SIZE);
+ if(type == GEMTK_MSG_BOX_CONFIRM){
+ strncat(msg_box_str, str_yes, GEMTK_MSG_BOX_STR_SIZE);
+ strncat(msg_box_str, "|", GEMTK_MSG_BOX_STR_SIZE);
+ strncat(msg_box_str, str_no, GEMTK_MSG_BOX_STR_SIZE);
} else {
- strncat(msg_box_str, str_ok, MSG_BOX_STR_SIZE);
+ strncat(msg_box_str, str_ok, GEMTK_MSG_BOX_STR_SIZE);
}
- strncat(msg_box_str, "]", MSG_BOX_STR_SIZE);
+ strncat(msg_box_str, "]", GEMTK_MSG_BOX_STR_SIZE);
retval = form_alert(type, msg_box_str);
- if(type == MSG_BOX_CONFIRM){
+ if(type == GEMTK_MSG_BOX_CONFIRM){
if(retval != 1){
retval = 0;
}
}
return(retval);
- #undef MSG_BOX_STR_SIZE
+ #undef GEMTK_MSG_BOX_STR_SIZE
}
diff --git a/atari/gemtk/objc.c b/atari/gemtk/objc.c
index 05844388a..25586946e 100644
--- a/atari/gemtk/objc.c
+++ b/atari/gemtk/objc.c
@@ -24,7 +24,7 @@
#include <assert.h>
#include "gemtk.h"
-char *get_text(OBJECT * tree, short idx)
+char *gemtk_obj_get_text(OBJECT * tree, short idx)
{
static char p[]="";
USERBLK *user;
@@ -91,7 +91,7 @@ char gemtk_obj_set_str_safe(OBJECT * tree, short idx, char *txt)
set_string(tree, idx, spare);
}
-OBJECT *get_tree(int idx)
+OBJECT *gemtk_obj_get_tree(int idx)
{
OBJECT *tree;
@@ -101,7 +101,7 @@ OBJECT *get_tree(int idx)
return tree;
}
-bool obj_is_inside(OBJECT * tree, short obj, GRECT *area)
+bool gemtk_obj_is_inside(OBJECT * tree, short obj, GRECT *area)
{
GRECT obj_screen;
bool ret = false;
@@ -115,7 +115,7 @@ bool obj_is_inside(OBJECT * tree, short obj, GRECT *area)
return(ret);
}
-GRECT * obj_screen_rect(OBJECT * tree, short obj)
+GRECT * gemtk_obj_screen_rect(OBJECT * tree, short obj)
{
static GRECT obj_screen;
diff --git a/atari/gemtk/utils.c b/atari/gemtk/utils.c
index 1fb67c7d4..fae9d749b 100644
--- a/atari/gemtk/utils.c
+++ b/atari/gemtk/utils.c
@@ -39,7 +39,7 @@ unsigned short _systype (void)
return _systype_v;
}
-bool rc_intersect_ro(GRECT *a, GRECT *b)
+bool gemtk_rc_intersect_ro(GRECT *a, GRECT *b)
{
GRECT r1, r2;
@@ -56,7 +56,7 @@ typedef struct {
char *capslock;
} KEYTAB;
-int keybd2ascii( int keybd, int shift)
+int gemtk_keybd2ascii( int keybd, int shift)
{
KEYTAB *key;
diff --git a/atari/gui.c b/atari/gui.c
index fa56823ad..c957bafe3 100644
--- a/atari/gui.c
+++ b/atari/gui.c
@@ -164,7 +164,7 @@ void gui_poll(bool active)
aes_event_in.emi_m1.g_x = mx;
aes_event_in.emi_m1.g_y = my;
evnt_multi_fast(&aes_event_in, aes_msg_out, &aes_event_out);
- if(!guiwin_dispatch_event(&aes_event_in, &aes_event_out, aes_msg_out)) {
+ if(!gemtk_wm_dispatch_event(&aes_event_in, &aes_event_out, aes_msg_out)) {
if( (aes_event_out.emo_events & MU_MESAG) != 0 ) {
LOG(("WM: %d\n", aes_msg_out[0]));
switch(aes_msg_out[0]) {
@@ -368,12 +368,12 @@ void gui_window_redraw_window(struct gui_window *gw)
void gui_window_update_box(struct gui_window *gw, const struct rect *rect)
{
GRECT area;
- struct guiwin_scroll_info_s *slid;
+ struct gemtk_wm_scroll_info_s *slid;
if (gw == NULL)
return;
- slid = guiwin_get_scroll_info(gw->root->win);
+ slid = gemtk_wm_get_scroll_info(gw->root->win);
window_get_grect(gw->root, BROWSER_AREA_CONTENT, &area);
area.g_x += rect->x0 - (slid->x_pos * slid->x_unit_px);
@@ -642,10 +642,10 @@ gui_window_set_search_ico(hlcache_handle *ico)
void gui_window_new_content(struct gui_window *w)
{
- struct guiwin_scroll_info_s *slid = guiwin_get_scroll_info(w->root->win);
+ struct gemtk_wm_scroll_info_s *slid = gemtk_wm_get_scroll_info(w->root->win);
slid->x_pos = 0;
slid->y_pos = 0;
- guiwin_update_slider(w->root->win, GUIWIN_VH_SLIDER);
+ gemtk_wm_update_slider(w->root->win, GEMTK_WM_VH_SLIDER);
gui_window_redraw_window(w);
}
@@ -835,7 +835,7 @@ void gui_quit(void)
urldb_save(nsoption_charp(url_file));
deskmenu_destroy();
- guiwin_exit();
+ gemtk_wm_exit();
rsrc_free();
@@ -972,7 +972,7 @@ static void gui_init(int argc, char** argv)
create_cursor(0, OUTLN_CROSS, NULL, &gem_cursors.sizeall);
create_cursor(0, OUTLN_CROSS, NULL, &gem_cursors.sizenesw);
create_cursor(0, OUTLN_CROSS, NULL, &gem_cursors.sizenwse);
- cursors = get_tree(CURSOR);
+ cursors = gemtk_obj_get_tree(CURSOR);
create_cursor(MFORM_EX_FLAG_USERFORM, CURSOR_APPSTART,
cursors, &gem_cursors.appstarting);
gem_set_cursor( &gem_cursors.appstarting );
@@ -1028,7 +1028,7 @@ static void gui_init2(int argc, char** argv)
if (sys_type() & (SYS_MAGIC|SYS_NAES|SYS_XAAES)) {
menu_register( _AESapid, (char*)" NetSurf ");
}
- guiwin_init();
+ gemtk_wm_init();
global_history_init();
hotlist_init();
toolbar_init();
diff --git a/atari/history.c b/atari/history.c
index 77df2c921..6d52c4e91 100755
--- a/atari/history.c
+++ b/atari/history.c
@@ -63,18 +63,18 @@ void global_history_open( void )
pos.g_w = desk_area.g_w / 4;
pos.g_h = desk_area.g_h;
- wind_open(guiwin_get_handle(gl_history.window), pos.g_x, pos.g_y,
+ wind_open(gemtk_wm_get_handle(gl_history.window), pos.g_x, pos.g_y,
pos.g_w, pos.g_h);
gl_history.open = true;
atari_treeview_open(gl_history.tv);
} else {
- wind_set(guiwin_get_handle(gl_history.window), WF_TOP, 1, 0, 0, 0);
+ wind_set(gemtk_wm_get_handle(gl_history.window), WF_TOP, 1, 0, 0, 0);
}
}
void global_history_close( void )
{
- wind_close(guiwin_get_handle(gl_history.window));
+ wind_close(gemtk_wm_get_handle(gl_history.window));
gl_history.open = false;
atari_treeview_close(gl_history.tv);
}
@@ -111,7 +111,7 @@ bool global_history_init( void )
gl_history.open = false;
handle = wind_create(flags, 40, 40, desk_area.g_w, desk_area.g_h);
- gl_history.window = guiwin_add(handle, GW_FLAG_DEFAULTS, NULL);
+ gl_history.window = gemtk_wm_add(handle, GEMTK_WM_FLAG_DEFAULTS, NULL);
if( gl_history.window == NULL ) {
LOG(("Failed to allocate history window"));
return( false );
@@ -144,8 +144,8 @@ void global_history_destroy( void )
history_global_cleanup();
if( gl_history.open )
global_history_close();
- wind_delete(guiwin_get_handle(gl_history.window));
- guiwin_remove(gl_history.window);
+ wind_delete(gemtk_wm_get_handle(gl_history.window));
+ gemtk_wm_remove(gl_history.window);
gl_history.window = NULL;
atari_treeview_destroy(gl_history.tv);
gl_history.init = false;
diff --git a/atari/hotlist.c b/atari/hotlist.c
index ccba088a6..ede5814e7 100755
--- a/atari/hotlist.c
+++ b/atari/hotlist.c
@@ -61,7 +61,7 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
case WM_TOOLBAR:
- tv = (NSTREEVIEW) guiwin_get_user_data(win);
+ tv = (NSTREEVIEW) gemtk_wm_get_user_data(win);
switch (msg[4]) {
case TOOLBAR_HOTLIST_CREATE_FOLDER:
@@ -74,7 +74,7 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
case TOOLBAR_HOTLIST_DELETE:
hotlist_delete_selected();
- guiwin_send_redraw(tv->window, NULL);
+ gemtk_wm_send_redraw(tv->window, NULL);
break;
case TOOLBAR_HOTLIST_EDIT:
@@ -82,10 +82,10 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
break;
}
- get_tree(TOOLBAR_HOTLIST)[msg[4]].ob_state &= ~OS_SELECTED;
- guiwin_get_grect(tv->window, GUIWIN_AREA_TOOLBAR, &tb_area);
+ gemtk_obj_get_tree(TOOLBAR_HOTLIST)[msg[4]].ob_state &= ~OS_SELECTED;
+ gemtk_wm_get_grect(tv->window, GEMTK_WM_AREA_TOOLBAR, &tb_area);
evnt_timer(150);
- guiwin_send_redraw(tv->window, &tb_area);
+ gemtk_wm_send_redraw(tv->window, &tb_area);
break;
case WM_CLOSED:
@@ -117,18 +117,18 @@ void hotlist_init(void)
int flags = ATARI_TREEVIEW_WIDGETS;
short handle = -1;
GRECT desk;
- OBJECT * tree = get_tree(TOOLBAR_HOTLIST);
+ OBJECT * tree = gemtk_obj_get_tree(TOOLBAR_HOTLIST);
assert( tree );
hl.open = false;
handle = wind_create(flags, 0, 0, desk_area.g_w, desk_area.g_h);
- hl.window = guiwin_add(handle, GW_FLAG_DEFAULTS, NULL);
+ hl.window = gemtk_wm_add(handle, GEMTK_WM_FLAG_DEFAULTS, NULL);
if( hl.window == NULL ) {
LOG(("Failed to allocate Hotlist"));
return;
}
wind_set_str(handle, WF_NAME, (char*)messages_get("Hotlist"));
- guiwin_set_toolbar(hl.window, tree, 0, 0);
+ gemtk_wm_set_toolbar(hl.window, tree, 0, 0);
hl.tv = atari_treeview_create(
hotlist_get_tree_flags(),
hl.window,
@@ -169,17 +169,17 @@ void hotlist_open(void)
pos.g_w = desk_area.g_w / 4;
pos.g_h = desk_area.g_h;
- wind_open_grect(guiwin_get_handle(hl.window), &pos);
+ wind_open_grect(gemtk_wm_get_handle(hl.window), &pos);
hl.open = true;
atari_treeview_open( hl.tv );
} else {
- wind_set(guiwin_get_handle(hl.window), WF_TOP, 1, 0, 0, 0);
+ wind_set(gemtk_wm_get_handle(hl.window), WF_TOP, 1, 0, 0, 0);
}
}
void hotlist_close(void)
{
- wind_close(guiwin_get_handle(hl.window));
+ wind_close(gemtk_wm_get_handle(hl.window));
hl.open = false;
atari_treeview_close( hl.tv );
}
@@ -194,8 +194,8 @@ void hotlist_destroy(void)
hotlist_cleanup( (char*)&hl.path );
if (hl.open)
hotlist_close();
- wind_delete(guiwin_get_handle(hl.window));
- guiwin_remove(hl.window);
+ wind_delete(gemtk_wm_get_handle(hl.window));
+ gemtk_wm_remove(hl.window);
hl.window = NULL;
atari_treeview_destroy( hl.tv );
hl.init = false;
diff --git a/atari/login.c b/atari/login.c
index 0fad4cd60..461a2f985 100755
--- a/atari/login.c
+++ b/atari/login.c
@@ -54,7 +54,7 @@ bool login_form_do(nsurl * url, char * realm, char ** out)
// TODO: use auth details for predefined login data
// auth = urldb_get_auth_details(url, realm);
- tree = get_tree(LOGIN);
+ tree = gemtk_obj_get_tree(LOGIN);
assert(tree != NULL);
diff --git a/atari/misc.c b/atari/misc.c
index d5837d7bd..1b4c3eaf4 100755
--- a/atari/misc.c
+++ b/atari/misc.c
@@ -61,13 +61,13 @@ void warn_user(const char *warning, const char *detail)
snprintf(message, len, messages_get(warning), detail);
printf("%s\n", message);
- msg_box_show(MSG_BOX_ALERT, message);
+ gemtk_msg_box_show(GEMTK_MSG_BOX_ALERT, message);
}
void die(const char *error)
{
printf("%s\n", error);
- msg_box_show(MSG_BOX_ALERT, error);
+ gemtk_msg_box_show(GEMTK_MSG_BOX_ALERT, error);
exit(1);
}
@@ -123,7 +123,7 @@ struct gui_window * find_guiwin_by_aes_handle(short handle){
while(gw != NULL) {
if( gw->root->win != NULL
- && guiwin_get_handle(gw->root->win) == handle ) {
+ && gemtk_wm_get_handle(gw->root->win) == handle ) {
return(gw);
}
else
diff --git a/atari/rootwin.c b/atari/rootwin.c
index 5acd417c7..44eec330f 100755
--- a/atari/rootwin.c
+++ b/atari/rootwin.c
@@ -100,7 +100,7 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
static bool prev_url = false;
static short prev_x=0;
static short prev_y=0;
- struct rootwin_data_s * data = guiwin_get_user_data(win);
+ struct rootwin_data_s * data = gemtk_wm_get_user_data(win);
struct gui_window *tmp;
@@ -127,7 +127,7 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
tmp = window_list;
while(tmp != NULL){
if(tmp->root != data->rootwin){
- guiwin_send_msg(tmp->root->win, WM_TOPPED, 0, 0, 0, 0);
+ gemtk_wm_send_msg(tmp->root->win, WM_TOPPED, 0, 0, 0, 0);
break;
}
tmp = tmp->next;
@@ -230,7 +230,7 @@ int window_create(struct gui_window * gw,
bool tb, sb;
int flags;
struct rootwin_data_s *data;
- struct guiwin_scroll_info_s *slid;
+ struct gemtk_wm_scroll_info_s *slid;
tb = (inflags & WIDGET_TOOLBAR);
sb = (inflags & WIDGET_STATUSBAR);
@@ -261,13 +261,13 @@ int window_create(struct gui_window * gw,
free(gw->root);
return( -1 );
}
- gw->root->win = guiwin_add(gw->root->aes_handle,
- GW_FLAG_PREPROC_WM | GW_FLAG_RECV_PREPROC_WM, handle_event);
+ gw->root->win = gemtk_wm_add(gw->root->aes_handle,
+ GEMTK_WM_FLAG_PREPROC_WM | GEMTK_WM_FLAG_RECV_PREPROC_WM, handle_event);
data = malloc(sizeof(struct rootwin_data_s));
data->rootwin = gw->root;
- guiwin_set_user_data(gw->root->win, (void*)data);
- slid = guiwin_get_scroll_info(gw->root->win);
+ gemtk_wm_set_user_data(gw->root->win, (void*)data);
+ slid = gemtk_wm_get_scroll_info(gw->root->win);
slid->y_unit_px = 32;
slid->x_unit_px = 32;
@@ -275,8 +275,8 @@ int window_create(struct gui_window * gw,
if(tb) {
gw->root->toolbar = toolbar_create(gw->root);
assert(gw->root->toolbar);
- guiwin_set_toolbar(gw->root->win, get_tree(TOOLBAR), 0, 0);
- guiwin_set_toolbar_redraw_func(gw->root->win, toolbar_redraw_cb);
+ gemtk_wm_set_toolbar(gw->root->win, gemtk_obj_get_tree(TOOLBAR), 0, 0);
+ gemtk_wm_set_toolbar_redraw_func(gw->root->win, toolbar_redraw_cb);
} else {
gw->root->toolbar = NULL;
}
@@ -346,8 +346,8 @@ int window_destroy(ROOTWIN *rootwin)
LOG(("%p", rootwin));
- if (guiwin_get_user_data(rootwin->win) != NULL) {
- free(guiwin_get_user_data(rootwin->win));
+ if (gemtk_wm_get_user_data(rootwin->win) != NULL) {
+ free(gemtk_wm_get_user_data(rootwin->win));
}
// make sure we do not destroy windows which have gui_windows attached:
@@ -368,7 +368,7 @@ int window_destroy(ROOTWIN *rootwin)
if(rootwin->title)
free(rootwin->title);
- guiwin_remove(rootwin->win);
+ gemtk_wm_remove(rootwin->win);
wind_close(rootwin->aes_handle);
wind_delete(rootwin->aes_handle);
free(rootwin);
@@ -391,7 +391,7 @@ void window_open(ROOTWIN *rootwin, struct gui_window *gw, GRECT pos)
if(rootwin->statusbar != NULL) {
sb_attach(rootwin->statusbar, rootwin->active_gui_window);
}
- guiwin_get_grect(rootwin->win, GUIWIN_AREA_TOOLBAR, &g);
+ gemtk_wm_get_grect(rootwin->win, GEMTK_WM_AREA_TOOLBAR, &g);
toolbar_set_attached(rootwin->toolbar, true);
toolbar_set_dimensions(rootwin->toolbar, &g);
window_update_back_forward(rootwin);
@@ -415,14 +415,14 @@ void window_restore_active_gui_window(ROOTWIN *rootwin)
window_set_title(rootwin, gw->title);
if (gw->search != NULL) {
- nsatari_search_restore_form(gw->search, get_tree(TOOLBAR));
+ nsatari_search_restore_form(gw->search, gemtk_obj_get_tree(TOOLBAR));
window_open_search(rootwin, false);
} else {
toolbar_set_visible(rootwin->toolbar, TOOLBAR_AREA_SEARCH, false);
}
toolbar_get_grect(rootwin->toolbar, 0, &tb_area);
- guiwin_set_toolbar_size(rootwin->win, tb_area.g_h);
+ gemtk_wm_set_toolbar_size(rootwin->win, tb_area.g_h);
window_update_back_forward(rootwin);
@@ -461,7 +461,7 @@ void window_scroll_by(ROOTWIN *root, int sx, int sy)
{
int units;
GRECT content_area;
- struct guiwin_scroll_info_s *slid = guiwin_get_scroll_info(root->win);
+ struct gemtk_wm_scroll_info_s *slid = gemtk_wm_get_scroll_info(root->win);
if(sx < 0) {
sx = 0;
@@ -472,9 +472,9 @@ void window_scroll_by(ROOTWIN *root, int sx, int sy)
int xunits = sx / slid->x_unit_px;
int yunits = sy / slid->y_unit_px;
- guiwin_scroll(root->win, GUIWIN_VSLIDER, yunits - slid->y_pos, false);
- guiwin_scroll(root->win, GUIWIN_HSLIDER, xunits - slid->x_pos, false);
- guiwin_update_slider(root->win, GUIWIN_VH_SLIDER);
+ gemtk_wm_scroll(root->win, GEMTK_WM_VSLIDER, yunits - slid->y_pos, false);
+ gemtk_wm_scroll(root->win, GEMTK_WM_HSLIDER, xunits - slid->x_pos, false);
+ gemtk_wm_update_slider(root->win, GEMTK_WM_VH_SLIDER);
}
/**
@@ -484,7 +484,7 @@ void window_scroll_by(ROOTWIN *root, int sx, int sy)
void window_set_content_size(ROOTWIN *rootwin, int width, int height)
{
GRECT area;
- struct guiwin_scroll_info_s *slid = guiwin_get_scroll_info(rootwin->win);
+ struct gemtk_wm_scroll_info_s *slid = gemtk_wm_get_scroll_info(rootwin->win);
window_get_grect(rootwin, BROWSER_AREA_CONTENT, &area);
@@ -494,7 +494,7 @@ void window_set_content_size(ROOTWIN *rootwin, int width, int height)
slid->x_pos = 0;
if(slid->y_units < slid->y_pos)
slid->y_pos = 0;
- guiwin_update_slider(rootwin->win, GUIWIN_VH_SLIDER);
+ gemtk_wm_update_slider(rootwin->win, GEMTK_WM_VH_SLIDER);
}
/* set focus to an arbitary element */
@@ -556,7 +556,7 @@ void window_set_icon(ROOTWIN *rootwin, struct bitmap * bmp )
/* redraw window when it is iconyfied: */
if (rootwin->icon != NULL) {
short info, dummy;
- if (guiwin_get_state(rootwin->win) & GW_STATUS_ICONIFIED) {
+ if (gemtk_wm_get_state(rootwin->win) & GEMTK_WM_STATUS_ICONIFIED) {
window_redraw_favicon(rootwin, NULL);
}
}
@@ -590,9 +590,9 @@ struct gui_window * window_get_active_gui_window(ROOTWIN * rootwin) {
void window_get_scroll(ROOTWIN *rootwin, int *x, int *y)
{
- struct guiwin_scroll_info_s *slid;
+ struct gemtk_wm_scroll_info_s *slid;
- slid = guiwin_get_scroll_info(rootwin->win);
+ slid = gemtk_wm_get_scroll_info(rootwin->win);
*x = slid->x_pos * slid->x_unit_px;
*y = slid->y_pos * slid->y_unit_px;
@@ -607,14 +607,14 @@ void window_get_grect(ROOTWIN *rootwin, enum browser_area_e which, GRECT *d)
d->g_h = 0;
if (which == BROWSER_AREA_TOOLBAR) {
- // guiwin_get_grect(rootwin->win, GUIWIN_AREA_TOOLBAR, d);
+ // gemtk_wm_get_grect(rootwin->win, GEMTK_WM_AREA_TOOLBAR, d);
toolbar_get_grect(rootwin->toolbar, 0, d);
} else if (which == BROWSER_AREA_CONTENT) {
GRECT tb_area;
- guiwin_get_grect(rootwin->win, GUIWIN_AREA_WORK, d);
+ gemtk_wm_get_grect(rootwin->win, GEMTK_WM_AREA_WORK, d);
toolbar_get_grect(rootwin->toolbar, 0, &tb_area);
d->g_y += tb_area.g_h;
@@ -658,7 +658,7 @@ void window_open_search(ROOTWIN *rootwin, bool reformat)
gw = rootwin->active_gui_window;
bw = gw->browser->bw;
- obj = get_tree(TOOLBAR);
+ obj = gemtk_obj_get_tree(TOOLBAR);
if (init == false) {
obj[TOOLBAR_CB_SHOWALL].ob_state &= ~OS_SELECTED;
@@ -673,7 +673,7 @@ void window_open_search(ROOTWIN *rootwin, bool reformat)
toolbar_set_visible(rootwin->toolbar, TOOLBAR_AREA_SEARCH, true);
window_get_grect(rootwin, BROWSER_AREA_TOOLBAR, &area);
- guiwin_set_toolbar_size(rootwin->win, area.g_h);
+ gemtk_wm_set_toolbar_size(rootwin->win, area.g_h);
window_get_grect(rootwin, BROWSER_AREA_SEARCH, &area);
window_schedule_redraw_grect(rootwin, &area);
window_get_grect(rootwin, BROWSER_AREA_CONTENT, &area);
@@ -692,7 +692,7 @@ void window_close_search(ROOTWIN *rootwin)
gw = rootwin->active_gui_window;
bw = gw->browser->bw;
- obj = get_tree(TOOLBAR);
+ obj = gemtk_obj_get_tree(TOOLBAR);
if (gw->search != NULL) {
nsatari_search_session_destroy(gw->search);
@@ -703,7 +703,7 @@ void window_close_search(ROOTWIN *rootwin)
toolbar_set_visible(rootwin->toolbar, TOOLBAR_AREA_SEARCH, false);
window_get_grect(rootwin, BROWSER_AREA_TOOLBAR, &area);
- guiwin_set_toolbar_size(rootwin->win, area.g_h);
+ gemtk_wm_set_toolbar_size(rootwin->win, area.g_h);
window_get_grect(rootwin, BROWSER_AREA_CONTENT, &area);
browser_window_reformat(bw, false, area.g_w, area.g_h);
}
@@ -719,8 +719,8 @@ void window_redraw_favicon(ROOTWIN *rootwin, GRECT *clip)
//printf("window_redraw_favicon: root: %p, win: %p\n", rootwin, rootwin->win);
- guiwin_clear(rootwin->win);
- guiwin_get_grect(rootwin->win, GUIWIN_AREA_WORK, &work);
+ gemtk_wm_clear(rootwin->win);
+ gemtk_wm_get_grect(rootwin->win, GEMTK_WM_AREA_WORK, &work);
if (clip == NULL) {
clip = &work;
@@ -732,7 +732,7 @@ void window_redraw_favicon(ROOTWIN *rootwin, GRECT *clip)
if (rootwin->icon == NULL) {
//printf("window_redraw_favicon OBJCTREE\n");
- OBJECT * tree = get_tree(ICONIFY);
+ OBJECT * tree = gemtk_obj_get_tree(ICONIFY);
tree->ob_x = work.g_x;
tree->ob_y = work.g_y;
tree->ob_width = work.g_w;
@@ -766,7 +766,7 @@ void window_schedule_redraw_grect(ROOTWIN *rootwin, GRECT *area)
//dbg_grect("window_schedule_redraw_grect input ", area);
- guiwin_get_grect(rootwin->win, GUIWIN_AREA_WORK, &work);
+ gemtk_wm_get_grect(rootwin->win, GEMTK_WM_AREA_WORK, &work);
if(!rc_intersect(area, &work))
return;
@@ -777,7 +777,7 @@ void window_schedule_redraw_grect(ROOTWIN *rootwin, GRECT *area)
static void window_redraw_content(ROOTWIN *rootwin, GRECT *content_area,
GRECT *clip,
- struct guiwin_scroll_info_s * slid,
+ struct gemtk_wm_scroll_info_s * slid,
struct browser_window *bw)
{
@@ -834,13 +834,13 @@ void window_place_caret(ROOTWIN *rootwin, short mode, int content_x,
int content_y, int h, GRECT *work)
{
struct s_caret *caret = &rootwin->caret;
- VdiHdl vh = guiwin_get_vdi_handle(rootwin->win);
+ VdiHdl vh = gemtk_wm_get_vdi_handle(rootwin->win);
short pxy[8];
GRECT mywork, caret_pos;
MFDB screen;
int i, scroll_x, scroll_y;
uint16_t *fd_addr;
- struct guiwin_scroll_info_s *slid;
+ struct gemtk_wm_scroll_info_s *slid;
short colors[2] = {G_BLACK, G_WHITE};
bool render_required = false;
@@ -857,7 +857,7 @@ void window_place_caret(ROOTWIN *rootwin, short mode, int content_x,
window_get_grect(rootwin, BROWSER_AREA_CONTENT, &mywork);
work = &mywork;
}
- slid = guiwin_get_scroll_info(rootwin->win);
+ slid = gemtk_wm_get_scroll_info(rootwin->win);
scroll_x = slid->x_pos * slid->x_unit_px;
scroll_y = slid->y_pos * slid->y_unit_px;
@@ -965,7 +965,7 @@ void window_place_caret(ROOTWIN *rootwin, short mode, int content_x,
exit:
// disable clipping:
- vs_clip(guiwin_get_vdi_handle(rootwin->win), 0, pxy);
+ vs_clip(gemtk_wm_get_vdi_handle(rootwin->win), 0, pxy);
}
void window_process_redraws(ROOTWIN * rootwin)
@@ -975,14 +975,14 @@ void window_process_redraws(ROOTWIN * rootwin)
short scroll_x=0, scroll_y=0;
bool toolbar_rdrw_required;
bool caret_rdrw_required = false;
- struct guiwin_scroll_info_s *slid =NULL;
+ struct gemtk_wm_scroll_info_s *slid =NULL;
int caret_h = 0;
struct s_caret *caret = &rootwin->caret;
redraw_active = true;
toolbar_get_grect(rootwin->toolbar, 0, &tb_area);
- //guiwin_set_toolbar_size(rootwin->win, tb_area.g_h);
+ //gemtk_wm_set_toolbar_size(rootwin->win, tb_area.g_h);
window_get_grect(rootwin, BROWSER_AREA_CONTENT, &content_area);
//dbg_grect("content area", &content_area);
@@ -1001,8 +1001,8 @@ void window_process_redraws(ROOTWIN * rootwin)
pxy_clip[0] = tb_area.g_y;
pxy_clip[0] = pxy_clip[0] + tb_area.g_w + content_area.g_w - 1;
pxy_clip[0] = pxy_clip[1] + tb_area.g_h + content_area.g_h - 1;
- vs_clip(guiwin_get_vdi_handle(rootwin->win), 1, pxy_clip);
- //guiwin_clear(rootwin->win);
+ vs_clip(gemtk_wm_get_vdi_handle(rootwin->win), 1, pxy_clip);
+ //gemtk_wm_clear(rootwin->win);
*/
wind_get_grect(rootwin->aes_handle, WF_FIRSTXYWH, &visible_ro);
while (visible_ro.g_w > 0 && visible_ro.g_h > 0) {
@@ -1031,7 +1031,7 @@ void window_process_redraws(ROOTWIN * rootwin)
if (rc_intersect(&content_area, &rdrw_area)) {
if(slid == NULL) {
- slid = guiwin_get_scroll_info(rootwin->win);
+ slid = gemtk_wm_get_scroll_info(rootwin->win);
scroll_x = slid->x_pos * slid->x_unit_px;
scroll_y = slid->y_pos * slid->y_unit_px;
@@ -1051,7 +1051,7 @@ void window_process_redraws(ROOTWIN * rootwin)
caret_pos.g_w = caret->dimensions.g_w;
caret_pos.g_h = caret->dimensions.g_h;
- if (rc_intersect_ro(&caret_pos, &content_area)) {
+ if (gemtk_rc_intersect_ro(&caret_pos, &content_area)) {
caret_rdrw_required = true;
}
}
@@ -1063,7 +1063,7 @@ void window_process_redraws(ROOTWIN * rootwin)
// disable clipping:
- //vs_clip(guiwin_get_vdi_handle(rootwin->win), 0, pxy_clip);
+ //vs_clip(gemtk_wm_get_vdi_handle(rootwin->win), 0, pxy_clip);
if (caret_rdrw_required && ((rootwin->caret.state & CARET_STATE_ENABLED)!=0)) {
@@ -1089,7 +1089,7 @@ void window_process_redraws(ROOTWIN * rootwin)
static bool on_content_mouse_move(ROOTWIN *rootwin, GRECT *content_area)
{
int mx, my, sx, sy;
- struct guiwin_scroll_info_s *slid;
+ struct gemtk_wm_scroll_info_s *slid;
struct gui_window *gw;
struct browser_window *bw;
@@ -1097,7 +1097,7 @@ static bool on_content_mouse_move(ROOTWIN *rootwin, GRECT *content_area)
mx = aes_event_out.emo_mouse.p_x - content_area->g_x;
my = aes_event_out.emo_mouse.p_y - content_area->g_y;
- slid = guiwin_get_scroll_info(rootwin->win);
+ slid = gemtk_wm_get_scroll_info(rootwin->win);
gw = window_get_active_gui_window(rootwin);
bw = gw->browser->bw;
@@ -1114,7 +1114,7 @@ static bool on_content_mouse_click(ROOTWIN *rootwin)
GRECT cwork;
browser_mouse_state bmstate = 0;
struct gui_window *gw;
- struct guiwin_scroll_info_s *slid;
+ struct gemtk_wm_scroll_info_s *slid;
gw = window_get_active_gui_window(rootwin);
if(input_window != gw) {
@@ -1147,7 +1147,7 @@ static bool on_content_mouse_click(ROOTWIN *rootwin)
}
/* convert component coords to scrolled content coords: */
- slid = guiwin_get_scroll_info(rootwin->win);
+ slid = gemtk_wm_get_scroll_info(rootwin->win);
int sx_origin = mx;
int sy_origin = my;
@@ -1245,49 +1245,49 @@ static bool on_content_keypress(struct browser_window *bw, unsigned short nkc)
GUIWIN * w = bw->window->root->win;
window_get_grect(bw->window->root, BROWSER_AREA_CONTENT, &g);
- struct guiwin_scroll_info_s *slid = guiwin_get_scroll_info(w);
+ struct gemtk_wm_scroll_info_s *slid = gemtk_wm_get_scroll_info(w);
switch( ik ) {
case KEY_LINE_START:
- guiwin_scroll(w, GUIWIN_HSLIDER, -(g.g_w/slid->x_unit_px),
+ gemtk_wm_scroll(w, GEMTK_WM_HSLIDER, -(g.g_w/slid->x_unit_px),
false);
break;
case KEY_LINE_END:
- guiwin_scroll(w, GUIWIN_HSLIDER, (g.g_w/slid->x_unit_px),
+ gemtk_wm_scroll(w, GEMTK_WM_HSLIDER, (g.g_w/slid->x_unit_px),
false);
break;
case KEY_PAGE_UP:
- guiwin_scroll(w, GUIWIN_VSLIDER, (g.g_h/slid->y_unit_px),
+ gemtk_wm_scroll(w, GEMTK_WM_VSLIDER, (g.g_h/slid->y_unit_px),
false);
break;
case KEY_PAGE_DOWN:
- guiwin_scroll(w, GUIWIN_VSLIDER, (g.g_h/slid->y_unit_px),
+ gemtk_wm_scroll(w, GEMTK_WM_VSLIDER, (g.g_h/slid->y_unit_px),
false);
break;
case KEY_RIGHT:
- guiwin_scroll(w, GUIWIN_HSLIDER, -1, false);
+ gemtk_wm_scroll(w, GEMTK_WM_HSLIDER, -1, false);
break;
case KEY_LEFT:
- guiwin_scroll(w, GUIWIN_HSLIDER, 1, false);
+ gemtk_wm_scroll(w, GEMTK_WM_HSLIDER, 1, false);
break;
case KEY_UP:
- guiwin_scroll(w, GUIWIN_VSLIDER, -1, false);
+ gemtk_wm_scroll(w, GEMTK_WM_VSLIDER, -1, false);
break;
case KEY_DOWN:
- guiwin_scroll(w, GUIWIN_VSLIDER, 1, false);
+ gemtk_wm_scroll(w, GEMTK_WM_VSLIDER, 1, false);
break;
default:
break;
}
- guiwin_update_slider(w, GUIWIN_VSLIDER|GUIWIN_HSLIDER);
+ gemtk_wm_update_slider(w, GEMTK_WM_VSLIDER|GEMTK_WM_HSLIDER);
}
}
@@ -1332,7 +1332,7 @@ static void on_redraw(ROOTWIN *rootwin, short msg[8])
//dbg_grect("on_redraw", &clip);
- if(guiwin_get_state(rootwin->win) & GW_STATUS_ICONIFIED) {
+ if(gemtk_wm_get_state(rootwin->win) & GEMTK_WM_STATUS_ICONIFIED) {
GRECT clip = {msg[4], msg[5], msg[6], msg[7]};
window_redraw_favicon(rootwin, &clip);
} else {
@@ -1356,7 +1356,7 @@ static void on_resized(ROOTWIN *rootwin)
return;
wind_get_grect(rootwin->aes_handle, WF_CURRXYWH, &g);
- guiwin_get_grect(rootwin->win, GUIWIN_AREA_WORK, &work);
+ gemtk_wm_get_grect(rootwin->win, GEMTK_WM_AREA_WORK, &work);
if (rootwin->loc.g_w != g.g_w || rootwin->loc.g_h != g.g_h) {
@@ -1398,22 +1398,22 @@ static void on_file_dropped(ROOTWIN *rootwin, short msg[8])
if( gw == NULL )
return;
- if(guiwin_get_state(rootwin->win) & GW_STATUS_ICONIFIED)
+ if(gemtk_wm_get_state(rootwin->win) & GEMTK_WM_STATUS_ICONIFIED)
return;
- dd_hdl = ddopen( msg[7], DD_OK);
+ dd_hdl = gemtk_dd_open( msg[7], DD_OK);
if( dd_hdl<0)
return; /* pipe not open */
memset( ext, 0, 32);
strcpy( ext, "ARGS");
- dd_msg = ddsexts( dd_hdl, ext);
+ dd_msg = gemtk_dd_sexts( dd_hdl, ext);
if( dd_msg<0)
goto error;
- dd_msg = ddrtry( dd_hdl, (char*)&name[0], (char*)&file[0], (char*)&ext[0], &size);
+ dd_msg = gemtk_dd_rtry( dd_hdl, (char*)&name[0], (char*)&file[0], (char*)&ext[0], &size);
if( size+1 >= PATH_MAX )
goto error;
if( !strncmp( ext, "ARGS", 4) && dd_msg > 0) {
- ddreply(dd_hdl, DD_OK);
+ gemtk_dd_reply(dd_hdl, DD_OK);
buff = (char*)malloc(sizeof(char)*(size+1));
if (buff != NULL) {
if (Fread(dd_hdl, size, buff ) == size)
@@ -1454,7 +1454,7 @@ static void on_file_dropped(ROOTWIN *rootwin, short msg[8])
}
}
error:
- ddclose( dd_hdl);
+ gemtk_dd_close( dd_hdl);
}
static void toolbar_redraw_cb(GUIWIN *win, uint16_t msg, GRECT *clip)
@@ -1462,7 +1462,7 @@ static void toolbar_redraw_cb(GUIWIN *win, uint16_t msg, GRECT *clip)
struct rootwin_data_s * ud;
if (msg != WM_REDRAW) {
- ud = guiwin_get_user_data(win);
+ ud = gemtk_wm_get_user_data(win);
assert(ud);
diff --git a/atari/rootwin.h b/atari/rootwin.h
index 3be8ecf11..d2cd04a35 100755
--- a/atari/rootwin.h
+++ b/atari/rootwin.h
@@ -21,7 +21,7 @@
#include <atari/gui.h>
-#define GUIWIN_VISIBLE(gw) (gw->root->handle->status & WS_OPEN)
+#define GEMTK_WM_VISIBLE(gw) (gw->root->handle->status & WS_OPEN)
#define GEMWIN_VISIBLE(win) (win->status & WS_OPEN)
#define WIDGET_STATUSBAR 0x1
diff --git a/atari/search.c b/atari/search.c
index 85695481b..02462505b 100644
--- a/atari/search.c
+++ b/atari/search.c
@@ -147,7 +147,7 @@ static int apply_form(OBJECT *obj, struct s_search_form_state *s)
if( (obj[TOOLBAR_CB_SHOWALL].ob_state & OS_SELECTED) != 0 )
s->flags |= SEARCH_FLAG_SHOWALL;
- cstr = get_text(obj, TOOLBAR_TB_SRCH);
+ cstr = gemtk_obj_get_text(obj, TOOLBAR_TB_SRCH);
snprintf(s->text, 32, "%s", cstr);
return ( 0 );
@@ -222,7 +222,7 @@ static bool search_session_compare(struct s_search_form_session *s, OBJECT *obj)
}
char * cstr;
- cstr = get_text(obj, TOOLBAR_TB_SRCH);
+ cstr = gemtk_obj_get_text(obj, TOOLBAR_TB_SRCH);
if (cstr != NULL){
if (strcmp(cstr, (char*)&s->state.text) != 0) {
return (true);
@@ -257,9 +257,9 @@ void nsatari_search_perform(struct s_search_form_session *s, OBJECT *obj,
s->state.flags &= (~SEARCH_FLAG_FORWARDS);
if( browser_window_search_verify_new(s->bw, &nsatari_search_callbacks, s) ){
- LOG(("searching for: %s\n", get_text(obj, TOOLBAR_TB_SRCH)));
+ LOG(("searching for: %s\n", gemtk_obj_get_text(obj, TOOLBAR_TB_SRCH)));
browser_window_search_step(s->bw, s->state.flags,
- get_text(obj, TOOLBAR_TB_SRCH));
+ gemtk_obj_get_text(obj, TOOLBAR_TB_SRCH));
}
}
diff --git a/atari/settings.c b/atari/settings.c
index 546f56acd..d46de4713 100644
--- a/atari/settings.c
+++ b/atari/settings.c
@@ -46,16 +46,16 @@ static OBJECT * dlgtree;
#define OBJ_UNCHECK(idx) (dlgtree[idx].ob_state &= ~(OS_SELECTED));
-#define OBJ_REDRAW(idx) guiwin_send_redraw(settings_guiwin, \
- obj_screen_rect(dlgtree, idx));
+#define OBJ_REDRAW(idx) gemtk_wm_send_redraw(settings_guiwin, \
+ gemtk_obj_screen_rect(dlgtree, idx));
#define DISABLE_OBJ(idx) (dlgtree[idx].ob_state |= OS_DISABLED); \
- guiwin_send_redraw(settings_guiwin, \
- obj_screen_rect(dlgtree, idx));
+ gemtk_wm_send_redraw(settings_guiwin, \
+ gemtk_obj_screen_rect(dlgtree, idx));
#define ENABLE_OBJ(idx) (dlgtree[idx].ob_state &= ~(OS_DISABLED)); \
- guiwin_send_redraw(settings_guiwin, \
- obj_screen_rect(dlgtree, idx));
+ gemtk_wm_send_redraw(settings_guiwin, \
+ gemtk_obj_screen_rect(dlgtree, idx));
#define FORMEVENT(idx) form_event(idx, 0);
@@ -181,21 +181,21 @@ static void display_settings(void)
set_text( SETTINGS_BT_SEL_FONT_RENDERER, nsoption_charp(atari_font_driver),
LABEL_FONT_RENDERER_MAX_LEN );
SET_BIT(dlgtree[SETTINGS_CB_TRANSPARENCY].ob_state,
- GW_CB_SELECTED, nsoption_int(atari_transparency) ? 1 : 0 );
+ OS_SELECTED, nsoption_int(atari_transparency) ? 1 : 0 );
SET_BIT(dlgtree[SETTINGS_CB_ENABLE_ANIMATION].ob_state,
- GW_CB_SELECTED, nsoption_bool(animate_images) ? 1 : 0 );
+ OS_SELECTED, nsoption_bool(animate_images) ? 1 : 0 );
SET_BIT(dlgtree[SETTINGS_CB_FG_IMAGES].ob_state,
- GW_CB_SELECTED, nsoption_bool(foreground_images) ? 1 : 0 );
+ OS_SELECTED, nsoption_bool(foreground_images) ? 1 : 0 );
SET_BIT(dlgtree[SETTINGS_CB_BG_IMAGES].ob_state,
- GW_CB_SELECTED, nsoption_bool(background_images) ? 1 : 0 );
+ OS_SELECTED, nsoption_bool(background_images) ? 1 : 0 );
// TODO: enable this option?
/* SET_BIT(dlgtree[SETTINGS_CB_INCREMENTAL_REFLOW].ob_state,
- GW_CB_SELECTED, nsoption_bool(incremental_reflow) ? 1 : 0 );*/
+ OS_SELECTED, nsoption_bool(incremental_reflow) ? 1 : 0 );*/
SET_BIT(dlgtree[SETTINGS_CB_ANTI_ALIASING].ob_state,
- GW_CB_SELECTED, nsoption_int(atari_font_monochrom) ? 0 : 1 );
+ OS_SELECTED, nsoption_int(atari_font_monochrom) ? 0 : 1 );
// TODO: activate this option?
@@ -221,9 +221,9 @@ static void display_settings(void)
set_text( SETTINGS_EDIT_PROXY_PASSWORD, nsoption_charp(http_proxy_auth_pass),
INPUT_PROXY_PASSWORD_MAX_LEN );
SET_BIT(dlgtree[SETTINGS_CB_USE_PROXY].ob_state,
- GW_CB_SELECTED, nsoption_bool(http_proxy) ? 1 : 0 );
+ OS_SELECTED, nsoption_bool(http_proxy) ? 1 : 0 );
SET_BIT(dlgtree[SETTINGS_CB_PROXY_AUTH].ob_state,
- GW_CB_SELECTED, nsoption_int(http_proxy_auth) ? 1 : 0 );
+ OS_SELECTED, nsoption_int(http_proxy_auth) ? 1 : 0 );
tmp_option_max_cached_fetch_handles = nsoption_int(max_cached_fetch_handles);
snprintf( spare, 255, "%2d", nsoption_int(max_cached_fetch_handles) );
@@ -320,7 +320,7 @@ static void form_event(int index, int external)
if( external ) {
objc_offset(dlgtree, SETTINGS_BT_SEL_FONT_RENDERER, &x, &y);
// point mn_tree tree to states popup:
- pop_menu.mn_tree = get_tree(POP_FONT_RENDERER);
+ pop_menu.mn_tree = gemtk_obj_get_tree(POP_FONT_RENDERER);
pop_menu.mn_menu = 0;
pop_menu.mn_item = POP_FONT_RENDERER_INTERNAL;
pop_menu.mn_scroll = SCROLL_NO;
@@ -329,7 +329,7 @@ static void form_event(int index, int external)
// find the selected menu item and uncheck others:
for(i=pop_menu.mn_item; i<=num_font_drivers; i++) {
get_string(pop_menu.mn_tree, i, spare);
- tmp = get_text(dlgtree, SETTINGS_BT_SEL_FONT_RENDERER);
+ tmp = gemtk_obj_get_text(dlgtree, SETTINGS_BT_SEL_FONT_RENDERER);
if (strcasecmp(&spare[2], tmp)) {
menu_icheck(pop_menu.mn_tree, i, 0);
} else {
@@ -351,7 +351,7 @@ static void form_event(int index, int external)
OBJ_REDRAW(SETTINGS_BT_SEL_FONT_RENDERER);
}
}
- tmp = get_text(dlgtree, SETTINGS_BT_SEL_FONT_RENDERER);
+ tmp = gemtk_obj_get_text(dlgtree, SETTINGS_BT_SEL_FONT_RENDERER);
if (strcasecmp(tmp, "freetype") == 0) {
ENABLE_OBJ(SETTINGS_CB_ANTI_ALIASING);
} else {
@@ -363,7 +363,7 @@ static void form_event(int index, int external)
objc_offset(dlgtree, SETTINGS_BT_SEL_LOCALE, &x, &y);
// point mn_tree tree to states popup:
- pop_menu.mn_tree = get_tree(POP_LANGUAGE);
+ pop_menu.mn_tree = gemtk_obj_get_tree(POP_LANGUAGE);
pop_menu.mn_menu = 0;
pop_menu.mn_item = POP_LANGUAGE_CS;
pop_menu.mn_scroll = SCROLL_NO;
@@ -372,7 +372,7 @@ static void form_event(int index, int external)
// find the selected menu item and uncheck others:
for(i=pop_menu.mn_item; i<=num_locales; i++) {
get_string(pop_menu.mn_tree, i, spare);
- tmp = get_text(dlgtree, SETTINGS_BT_SEL_LOCALE);
+ tmp = gemtk_obj_get_text(dlgtree, SETTINGS_BT_SEL_LOCALE);
if (strcasecmp(&spare[2], tmp)) {
menu_icheck(pop_menu.mn_tree, i, 0);
} else {
@@ -586,19 +586,19 @@ static void apply_settings(void)
nsoption_set_int(http_proxy_auth, OPTION_HTTP_PROXY_AUTH_NONE);
}
nsoption_set_charp(http_proxy_auth_pass,
- get_text(dlgtree, SETTINGS_EDIT_PROXY_PASSWORD));
+ gemtk_obj_get_text(dlgtree, SETTINGS_EDIT_PROXY_PASSWORD));
nsoption_set_charp(http_proxy_auth_user,
- get_text(dlgtree, SETTINGS_EDIT_PROXY_USERNAME));
+ gemtk_obj_get_text(dlgtree, SETTINGS_EDIT_PROXY_USERNAME));
nsoption_set_charp(http_proxy_host,
- get_text(dlgtree, SETTINGS_EDIT_PROXY_HOST));
+ gemtk_obj_get_text(dlgtree, SETTINGS_EDIT_PROXY_HOST));
nsoption_set_int(http_proxy_port,
- atoi( get_text(dlgtree, SETTINGS_EDIT_PROXY_PORT) ));
+ atoi( gemtk_obj_get_text(dlgtree, SETTINGS_EDIT_PROXY_PORT) ));
nsoption_set_int(max_fetchers_per_host,
- atoi( get_text(dlgtree, SETTINGS_EDIT_MAX_FETCHERS_PER_HOST)));
+ atoi( gemtk_obj_get_text(dlgtree, SETTINGS_EDIT_MAX_FETCHERS_PER_HOST)));
nsoption_set_int(max_cached_fetch_handles,
- atoi( get_text(dlgtree, SETTINGS_EDIT_MAX_CACHED_CONNECTIONS)));
+ atoi( gemtk_obj_get_text(dlgtree, SETTINGS_EDIT_MAX_CACHED_CONNECTIONS)));
nsoption_set_int(max_fetchers,
- atoi( get_text(dlgtree, SETTINGS_EDIT_MAX_FETCHERS) ));
+ atoi( gemtk_obj_get_text(dlgtree, SETTINGS_EDIT_MAX_FETCHERS) ));
nsoption_set_bool(foreground_images,
OBJ_SELECTED( SETTINGS_CB_FG_IMAGES ));
nsoption_set_bool(background_images,
@@ -610,7 +610,7 @@ static void apply_settings(void)
/* "Rendering" tab: */
nsoption_set_charp(atari_font_driver,
- get_text(dlgtree, SETTINGS_BT_SEL_FONT_RENDERER));
+ gemtk_obj_get_text(dlgtree, SETTINGS_BT_SEL_FONT_RENDERER));
nsoption_set_bool(atari_transparency,
OBJ_SELECTED(SETTINGS_CB_TRANSPARENCY));
nsoption_set_bool(animate_images,
@@ -625,17 +625,17 @@ static void apply_settings(void)
/* "Paths" tabs: */
nsoption_set_charp(ca_bundle,
- get_text(dlgtree, SETTINGS_EDIT_CA_BUNDLE));
+ gemtk_obj_get_text(dlgtree, SETTINGS_EDIT_CA_BUNDLE));
nsoption_set_charp(ca_path,
- get_text(dlgtree, SETTINGS_EDIT_CA_CERTS_PATH));
+ gemtk_obj_get_text(dlgtree, SETTINGS_EDIT_CA_CERTS_PATH));
nsoption_set_charp(homepage_url,
- get_text(dlgtree, SETTINGS_EDIT_CA_CERTS_PATH));
+ gemtk_obj_get_text(dlgtree, SETTINGS_EDIT_CA_CERTS_PATH));
nsoption_set_charp(hotlist_file,
- get_text(dlgtree, SETTINGS_EDIT_HOTLIST_FILE));
+ gemtk_obj_get_text(dlgtree, SETTINGS_EDIT_HOTLIST_FILE));
nsoption_set_charp(atari_editor,
- get_text(dlgtree, SETTINGS_EDIT_EDITOR));
+ gemtk_obj_get_text(dlgtree, SETTINGS_EDIT_EDITOR));
nsoption_set_charp(downloads_path,
- get_text(dlgtree, SETTINGS_EDIT_DOWNLOAD_PATH));
+ gemtk_obj_get_text(dlgtree, SETTINGS_EDIT_DOWNLOAD_PATH));
/* "Cache" tab: */
nsoption_set_int(memory_cache_size,
@@ -647,15 +647,15 @@ static void apply_settings(void)
nsoption_set_bool(block_ads,
OBJ_SELECTED(SETTINGS_CB_HIDE_ADVERTISEMENT));
nsoption_set_charp(accept_language,
- get_text(dlgtree, SETTINGS_BT_SEL_LOCALE));
+ gemtk_obj_get_text(dlgtree, SETTINGS_BT_SEL_LOCALE));
nsoption_set_int(expire_url,
- atoi(get_text(dlgtree, SETTINGS_EDIT_HISTORY_AGE)));
+ atoi(gemtk_obj_get_text(dlgtree, SETTINGS_EDIT_HISTORY_AGE)));
nsoption_set_bool(send_referer,
OBJ_SELECTED(SETTINGS_CB_SEND_HTTP_REFERRER));
nsoption_set_bool(do_not_track,
OBJ_SELECTED(SETTINGS_CB_SEND_DO_NOT_TRACK));
nsoption_set_charp(homepage_url,
- get_text(dlgtree, SETTINGS_EDIT_HOMEPAGE));
+ gemtk_obj_get_text(dlgtree, SETTINGS_EDIT_HOMEPAGE));
}
static short on_aes_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
@@ -663,7 +663,7 @@ static short on_aes_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
short retval = 0;
GRECT clip, work;
static short edit_idx = 0;
- struct guiwin_scroll_info_s *slid;
+ struct gemtk_wm_scroll_info_s *slid;
if ((ev_out->emo_events & MU_MESAG) != 0) {
// handle message
@@ -678,7 +678,7 @@ static short on_aes_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
break;
case WM_SIZED:
- guiwin_update_slider(win, GUIWIN_VH_SLIDER);
+ gemtk_wm_update_slider(win, GEMTK_WM_VH_SLIDER);
break;
case WM_MOVED:
@@ -691,7 +691,7 @@ static short on_aes_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
}
break;
- case GUIWIN_WM_FORM:
+ case GEMTK_WM_WM_FORM:
form_event(msg[4], 1);
break;
@@ -714,18 +714,18 @@ void open_settings(void)
if (h_aes_win == 0) {
GRECT curr, area;
- struct guiwin_scroll_info_s *slid;
+ struct gemtk_wm_scroll_info_s *slid;
uint32_t kind = CLOSER | NAME | MOVER | VSLIDE | HSLIDE | UPARROW
| DNARROW | LFARROW | RTARROW | SIZER | FULLER;
- dlgtree = get_tree(SETTINGS);
+ dlgtree = gemtk_obj_get_tree(SETTINGS);
area.g_x = area.g_y = 0;
area.g_w = MIN(dlgtree->ob_width, desk_area.g_w);
area.g_h = MIN(dlgtree->ob_height, desk_area.g_h);
wind_calc_grect(WC_BORDER, kind, &area, &area);
h_aes_win = wind_create_grect(kind, &area);
wind_set_str(h_aes_win, WF_NAME, "Settings");
- settings_guiwin = guiwin_add(h_aes_win, GW_FLAG_DEFAULTS,
+ settings_guiwin = gemtk_wm_add(h_aes_win, GEMTK_WM_FLAG_DEFAULTS,
on_aes_event);
curr.g_w = MIN(dlgtree->ob_width, desk_area.g_w);
curr.g_h = MIN(dlgtree->ob_height, desk_area.g_h-64);
@@ -742,22 +742,22 @@ void open_settings(void)
wind_open_grect(h_aes_win, &curr);
- guiwin_set_form(settings_guiwin, dlgtree, 0);
- guiwin_set_scroll_grid(settings_guiwin, 32, 32);
- guiwin_get_grect(settings_guiwin, GUIWIN_AREA_CONTENT, &area);
+ gemtk_wm_set_form(settings_guiwin, dlgtree, 0);
+ gemtk_wm_set_scroll_grid(settings_guiwin, 32, 32);
+ gemtk_wm_get_grect(settings_guiwin, GEMTK_WM_AREA_CONTENT, &area);
- slid = guiwin_get_scroll_info(settings_guiwin);
- guiwin_set_content_units(settings_guiwin,
+ slid = gemtk_wm_get_scroll_info(settings_guiwin);
+ gemtk_wm_set_content_units(settings_guiwin,
(dlgtree->ob_width/slid->x_unit_px),
(dlgtree->ob_height/slid->y_unit_px));
- guiwin_update_slider(settings_guiwin, GUIWIN_VH_SLIDER);
+ gemtk_wm_update_slider(settings_guiwin, GEMTK_WM_VH_SLIDER);
}
}
void close_settings(void)
{
LOG((""));
- guiwin_remove(settings_guiwin);
+ gemtk_wm_remove(settings_guiwin);
settings_guiwin = NULL;
wind_close(h_aes_win);
wind_delete(h_aes_win);
diff --git a/atari/statusbar.c b/atari/statusbar.c
index d43ebc853..9f26d7bca 100755
--- a/atari/statusbar.c
+++ b/atari/statusbar.c
@@ -220,7 +220,7 @@ void sb_destroy( CMP_STATUSBAR s )
void sb_attach(CMP_STATUSBAR sb, struct gui_window * gw)
{
- sb->aes_win = guiwin_get_handle(gw->root->win);
+ sb->aes_win = gemtk_wm_get_handle(gw->root->win);
sb->attached = true;
}
diff --git a/atari/toolbar.c b/atari/toolbar.c
index 6afb66013..a4a1ed367 100644
--- a/atari/toolbar.c
+++ b/atari/toolbar.c
@@ -232,8 +232,8 @@ void toolbar_init( void )
{
static USERBLK userblk;
- aes_toolbar = get_tree(TOOLBAR);
- throbber_form = get_tree(THROBBER);
+ aes_toolbar = gemtk_obj_get_tree(TOOLBAR);
+ throbber_form = gemtk_obj_get_tree(THROBBER);
userblk.ub_code = toolbar_url_userdraw;
userblk.ub_parm = (long) aes_toolbar[TOOLBAR_AREA_URL].ob_spec.userblk;
@@ -777,7 +777,7 @@ void toolbar_mouse_input(struct s_toolbar *tb, short obj, short button)
}
else if (obj==TOOLBAR_BT_SEARCH_FWD) {
gw = tb->owner->active_gui_window;
- toolbar_tree = get_tree(TOOLBAR);
+ toolbar_tree = gemtk_obj_get_tree(TOOLBAR);
assert(gw->search);
nsatari_search_perform(gw->search, toolbar_tree, SEARCH_FLAG_FORWARDS);
}
diff --git a/atari/treeview.c b/atari/treeview.c
index e865de527..8d5520edb 100755
--- a/atari/treeview.c
+++ b/atari/treeview.c
@@ -75,7 +75,7 @@ static void __CDECL on_redraw_event(NSTREEVIEW tv, EVMULT_OUT *ev_out,
static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
{
- NSTREEVIEW tv = (NSTREEVIEW) guiwin_get_user_data(win);
+ NSTREEVIEW tv = (NSTREEVIEW) gemtk_wm_get_user_data(win);
if( (ev_out->emo_events & MU_MESAG) != 0 ) {
// handle message
@@ -142,13 +142,13 @@ static void __CDECL on_redraw_event(NSTREEVIEW tv, EVMULT_OUT *ev_out,
short msg[8])
{
GRECT work, clip;
- struct guiwin_scroll_info_s *slid;
+ struct gemtk_wm_scroll_info_s *slid;
if( tv == NULL )
return;
- guiwin_get_grect(tv->window, GUIWIN_AREA_CONTENT, &work);
- slid = guiwin_get_scroll_info(tv->window);
+ gemtk_wm_get_grect(tv->window, GEMTK_WM_AREA_CONTENT, &work);
+ slid = gemtk_wm_get_scroll_info(tv->window);
clip = work;
if ( !rc_intersect( (GRECT*)&msg[4], &clip ) ) return;
@@ -174,15 +174,15 @@ static void __CDECL on_redraw_event(NSTREEVIEW tv, EVMULT_OUT *ev_out,
static void __CDECL on_mbutton_event(NSTREEVIEW tv, EVMULT_OUT *ev_out,
short msg[8])
{
- struct guiwin_scroll_info_s *slid;
+ struct gemtk_wm_scroll_info_s *slid;
GRECT work;
short mx, my;
if(tv == NULL)
return;
- guiwin_get_grect(tv->window, GUIWIN_AREA_CONTENT, &work);
- slid = guiwin_get_scroll_info(tv->window);
+ gemtk_wm_get_grect(tv->window, GEMTK_WM_AREA_CONTENT, &work);
+ slid = gemtk_wm_get_scroll_info(tv->window);
mx = ev_out->emo_mouse.p_x;
my = ev_out->emo_mouse.p_y;
@@ -261,9 +261,9 @@ static void __CDECL on_mbutton_event(NSTREEVIEW tv, EVMULT_OUT *ev_out,
}
NSTREEVIEW atari_treeview_create(uint32_t flags, GUIWIN *win,
- guiwin_event_handler_f user_func)
+ gemtk_wm_event_handler_f user_func)
{
- struct guiwin_scroll_info_s *slid;
+ struct gemtk_wm_scroll_info_s *slid;
if( win == NULL )
return( NULL );
@@ -279,10 +279,10 @@ NSTREEVIEW atari_treeview_create(uint32_t flags, GUIWIN *win,
new->window = win;
new->user_func = user_func;
- guiwin_set_event_handler(win, handle_event);
- guiwin_set_user_data(win, (void*)new);
+ gemtk_wm_set_event_handler(win, handle_event);
+ gemtk_wm_set_user_data(win, (void*)new);
- slid = guiwin_get_scroll_info(new->window);
+ slid = gemtk_wm_get_scroll_info(new->window);
slid->y_unit_px = 16;
slid->x_unit_px = 16;
@@ -319,13 +319,13 @@ void atari_treeview_destroy( NSTREEVIEW tv )
bool atari_treeview_mevent( NSTREEVIEW tv, browser_mouse_state bms, int x, int y)
{
GRECT work;
- struct guiwin_scroll_info_s *slid;
+ struct gemtk_wm_scroll_info_s *slid;
if( tv == NULL )
return ( false );
- guiwin_get_grect(tv->window, GUIWIN_AREA_CONTENT, &work);
- slid = guiwin_get_scroll_info(tv->window);
+ gemtk_wm_get_grect(tv->window, GEMTK_WM_AREA_CONTENT, &work);
+ slid = gemtk_wm_get_scroll_info(tv->window);
int rx = (x-work.g_x)+(slid->x_pos*slid->x_unit_px);
int ry = (y-work.g_y)+(slid->y_pos*slid->y_unit_px);
@@ -347,11 +347,11 @@ void atari_treeview_redraw( NSTREEVIEW tv)
short todo[4];
GRECT work;
- short handle = guiwin_get_handle(tv->window);
- struct guiwin_scroll_info_s *slid;
+ short handle = gemtk_wm_get_handle(tv->window);
+ struct gemtk_wm_scroll_info_s *slid;
- guiwin_get_grect(tv->window, GUIWIN_AREA_CONTENT, &work);
- slid = guiwin_get_scroll_info(tv->window);
+ gemtk_wm_get_grect(tv->window, GEMTK_WM_AREA_CONTENT, &work);
+ slid = gemtk_wm_get_scroll_info(tv->window);
struct redraw_context ctx = {
.interactive = true,
@@ -468,13 +468,13 @@ void atari_treeview_resized(struct tree *tree, int width, int height, void *pw)
return;
tv->extent.x = width;
tv->extent.y = height;
- struct guiwin_scroll_info_s *slid = guiwin_get_scroll_info(tv->window);
- guiwin_get_grect(tv->window, GUIWIN_AREA_CONTENT, &area);
+ struct gemtk_wm_scroll_info_s *slid = gemtk_wm_get_scroll_info(tv->window);
+ gemtk_wm_get_grect(tv->window, GEMTK_WM_AREA_CONTENT, &area);
slid->x_units = (width/slid->x_unit_px);
slid->y_units = (height/slid->y_unit_px);
/*printf("units content: %d, units viewport: %d\n", (height/slid->y_unit_px),
(area.g_h/slid->y_unit_px));*/
- guiwin_update_slider(tv->window, GUIWIN_VH_SLIDER);
+ gemtk_wm_update_slider(tv->window, GEMTK_WM_VH_SLIDER);
}
}
@@ -498,10 +498,10 @@ static void atari_treeview_get_grect(NSTREEVIEW tv, enum treeview_area_e mode,
{
if (mode == TREEVIEW_AREA_CONTENT) {
- guiwin_get_grect(tv->window, GUIWIN_AREA_CONTENT, dest);
+ gemtk_wm_get_grect(tv->window, GEMTK_WM_AREA_CONTENT, dest);
}
else if (mode == TREEVIEW_AREA_TOOLBAR) {
- guiwin_get_grect(tv->window, GUIWIN_AREA_TOOLBAR, dest);
+ gemtk_wm_get_grect(tv->window, GEMTK_WM_AREA_TOOLBAR, dest);
}
}
diff --git a/atari/treeview.h b/atari/treeview.h
index 19b77301e..664b3a4d1 100755
--- a/atari/treeview.h
+++ b/atari/treeview.h
@@ -36,13 +36,13 @@ struct atari_treeview
POINT extent;
POINT click;
POINT startdrag;
- guiwin_event_handler_f user_func;
+ gemtk_wm_event_handler_f user_func;
};
typedef struct atari_treeview * NSTREEVIEW;
NSTREEVIEW atari_treeview_create( uint32_t flags, GUIWIN *win,
- guiwin_event_handler_f user_func);
+ gemtk_wm_event_handler_f user_func);
void atari_treeview_destroy( NSTREEVIEW tv );
void atari_treeview_open( NSTREEVIEW tv );
void atari_treeview_close( NSTREEVIEW tv );