Make more drag-related global variables private

This commit is contained in:
Chris Young 2016-06-01 18:48:37 +01:00
parent e1dea53d2a
commit a4ed8bf4c9
4 changed files with 12 additions and 8 deletions

View File

@ -46,7 +46,9 @@
#include "amiga/gui.h"
#include "amiga/theme.h"
static void *drag_save_data;
static int drag_save;
static struct gui_window *drag_save_gui;
static struct Window *drag_icon = NULL;
static ULONG drag_icon_width;
static ULONG drag_icon_height;
@ -277,6 +279,12 @@ BOOL ami_drag_in_progress(void)
return drag_in_progress;
}
bool ami_drag_has_data(void)
{
if(drag_save_data != NULL) return true;
else return false;
}
static void *ami_find_gwin_by_id(struct Window *win, uint32 type)
{
struct nsObject *node, *nnode;

View File

@ -26,18 +26,14 @@ struct Window;
#define AMI_DRAG_THRESHOLD 10
int drag_save;
void *drag_save_data;
struct gui_window *drag_save_gui;
void gui_drag_save_selection(struct gui_window *g, const char *selection);
void gui_drag_save_object(struct gui_window *g, struct hlcache_handle *c, gui_save_type type);
void ami_drag_save(struct Window *win);
void ami_drag_icon_show(struct Window *win, const char *type);
void ami_drag_icon_close(struct Window *win);
bool ami_drag_icon_move(void);
BOOL ami_drag_in_progress(void);
bool ami_drag_has_data(void);
void *ami_window_at_pointer(int type);

View File

@ -2169,7 +2169,7 @@ static void ami_handle_msg(void)
#endif
}
if(drag_save_data && !gwin->mouse_state)
if(ami_drag_has_data() && !gwin->mouse_state)
ami_drag_save(gwin->win);
break;

View File

@ -221,7 +221,7 @@ void ami_reset_pointer(struct gui_window_2 *gwin)
void ami_update_pointer(struct Window *win, gui_pointer_shape shape)
{
if(drag_save_data) return;
if(ami_drag_has_data()) return; /**\todo check this shouldn't be drag_in_progress */
if(LIB_IS_AT_LEAST((struct Library *)IntuitionBase, 53, 42)) {
#ifdef __amigaos4__