diff options
author | Ole Loots <ole@monochrom.net> | 2011-12-15 23:04:31 +0000 |
---|---|---|
committer | Ole Loots <ole@monochrom.net> | 2011-12-15 23:04:31 +0000 |
commit | 66f53b22e21e7b8153b2065824f3c468d0065817 (patch) | |
tree | c13fcd763e072cda36ab6a0f1a17497d8ceeed40 /atari | |
parent | 3b8de08f601c516b9a7831aeaa88ea678d8d54d4 (diff) | |
download | netsurf-66f53b22e21e7b8153b2065824f3c468d0065817.tar.gz netsurf-66f53b22e21e7b8153b2065824f3c468d0065817.tar.bz2 |
added mode parameter to function find_gui_window
svn path=/trunk/netsurf/; revision=13278
Diffstat (limited to 'atari')
-rwxr-xr-x | atari/misc.c | 43 | ||||
-rwxr-xr-x | atari/misc.h | 7 |
2 files changed, 37 insertions, 13 deletions
diff --git a/atari/misc.c b/atari/misc.c index e91c167de..06ef4e406 100755 --- a/atari/misc.c +++ b/atari/misc.c @@ -99,25 +99,44 @@ bool path_add_part(char *path, int length, const char *newpart) strncat(path, newpart, length);
return true;
-}
-
-struct gui_window * find_gui_window( WINDOW * win ){
-
- struct gui_window * gw;
- gw = window_list;
+} + +/* + // TBD: make use of this function or remove it... +*/
+struct gui_window * find_gui_window( unsigned long handle, short mode ){
- if( win == NULL )
- return( NULL );
+ struct gui_window * gw;
+ gw = window_list;
+ if( handle == 0 ){
+ return( NULL ); + } + else if( mode == BY_WINDOM_HANDLE ){ + WINDOW * win = (WINDOW*) handle; while( gw != NULL) {
if( gw->root->handle == win ) {
- return( gw );
+ return( gw );
}
else
- gw = gw->next;
- }
+ gw = gw->next;
+ } + } + else if( mode == BY_GEM_HANDLE ){ + short ghandle = (short)handle; + while( gw != NULL) {
+ if( gw->root->handle != NULL + && gw->root->handle->handle == ghandle ) {
+ return( gw );
+ }
+ else
+ gw = gw->next;
+ } + }
+
return( NULL );
-}
+} +*/
struct gui_window * find_cmp_window( COMPONENT * c )
{
diff --git a/atari/misc.h b/atari/misc.h index 2117f8b50..5ec6ad8b2 100755 --- a/atari/misc.h +++ b/atari/misc.h @@ -21,6 +21,7 @@ #include "cflib.h" #include "desktop/textinput.h" +#include "atari/gui.h" #define SBUF8_TO_LBUF8(sbuf,lbuf)\
lbuf[0] = (long)sbuf[0];\
@@ -32,8 +33,12 @@ lbuf[6] = (long)sbuf[6];\
lbuf[7] = (long)sbuf[7];
+ +/* Modes for find_gui_window: */ +#define BY_WINDOM_HANDLE 0x0 +#define BY_GEM_HANDLE 0x1 -struct gui_window * find_gui_window( WINDOW * win );
+struct gui_window * find_gui_window( unsigned long, short mode );
struct gui_window * find_cmp_window( COMPONENT * c );
OBJECT *get_tree( int idx );
char *get_rsc_string( int idx );
|