22#include <proto/exec.h>
24#include <proto/intuition.h>
25#include <proto/utility.h>
26#include <proto/icon.h>
28#include <graphics/blitattr.h>
29#include <workbench/icon.h>
48static void *drag_save_data;
51static struct Window *drag_icon = NULL;
52static ULONG drag_icon_width;
53static ULONG drag_icon_height;
54static BOOL drag_in_progress = FALSE;
55static bool ami_autoscroll =
false;
60 const char *filetype = NULL;
102 ami_autoscroll =
true;
109 ULONG which = WBO_NONE,
type;
110 char path[1025], dpath[1025];
116 ami_autoscroll =
true;
120 which = WhichWorkbenchObject(NULL,
scrn->MouseX,
scrn->MouseY,
122 WBOBJA_FullPath,&
path,
123 WBOBJA_FullPathSize,1024,
124 WBOBJA_DrawerPath,&dpath,
125 WBOBJA_DrawerPathSize,1024,
129 if((which == WBO_DRAWER) || ((which == WBO_ICON) && (
type > WBDRAWER)))
133 else if(which == WBO_NONE)
140 drag_save_data = NULL;
148 drag_save_data = NULL;
167 AddPart(
path,
"netsurf_text_selection",1024);
192 "Unsupported drag save operation %d", drag_save);
197 drag_save_data = NULL;
204 struct DiskObject *dobj = NULL;
206 int deftype = WBPROJECT;
208 drag_in_progress = TRUE;
220 if(!strcmp(
type,
"drawer")) deftype = WBDRAWER;
222 dobj = GetIconTags(NULL, ICONGETA_GetDefaultName,
type,
223 ICONGETA_GetDefaultType, deftype,
227 ICONCTRLA_GetWidth,&
width,
228 ICONCTRLA_GetHeight,&
height,
231 drag_icon_width =
width;
232 drag_icon_height =
height;
234 drag_icon = OpenWindowTags(NULL,
244 WA_OverrideOpaqueness, TRUE,
249 DrawIconState(drag_icon->RPort, dobj, NULL, 0, 0, IDS_NORMAL,
250 ICONDRAWA_Frameless, TRUE,
251 ICONDRAWA_Borderless, TRUE,
257 if(drag_icon == NULL)
return FALSE;
260 ChangeWindowBox(drag_icon,
scrn->MouseX - (drag_icon_width / 2),
261 scrn->MouseY - (drag_icon_height / 2),
262 drag_icon_width, drag_icon_height);
264 return ami_autoscroll;
275 if(drag_icon) CloseWindow(drag_icon);
278 drag_in_progress = FALSE;
283 return drag_in_progress;
288 if(drag_save_data != NULL)
return true;
void ami_drag_selection(struct gui_window *g)
bool ami_mime_compare(struct hlcache_handle *c, const char *type)
Compare the MIME type of an hlcache_handle to a DefIcons type.
const char * ami_mime_content_to_filetype(struct hlcache_handle *c)
struct Window * ami_gui_get_window(struct gui_window *gw)
Get window from gui_window.
struct Screen * ami_gui_get_screen(void)
Get a pointer to the screen NetSurf is running on.
static struct Screen * scrn
void ami_gui_beep(void)
Beep.
struct hlcache_handle * ami_gui_get_favicon(struct gui_window *gw)
Get favicon from gui_window.
struct browser_window * ami_gui_get_browser_window(struct gui_window *gw)
Get browser window from gui_window.
void ami_update_pointer(struct Window *win, gui_pointer_shape shape)
bool ami_drag_has_data(void)
void gui_drag_save_selection(struct gui_window *g, const char *selection)
void ami_drag_icon_show(struct Window *win, const char *type)
void ami_drag_save(struct Window *win)
bool ami_drag_icon_move(void)
void gui_drag_save_object(struct gui_window *g, struct hlcache_handle *c, gui_save_type type)
BOOL ami_drag_in_progress(void)
void ami_drag_icon_close(struct Window *win)
void ami_file_save(int type, char *fname, struct Window *win, struct hlcache_handle *object, struct hlcache_handle *favicon, struct browser_window *bw)
#define AMI_GUI_POINTER_DRAG
Public content interface.
const char * content_get_title(struct hlcache_handle *h)
Retrieve title associated with content.
Core mouse and pointer states.
@ GUI_SAVE_TEXT_SELECTION
#define NSLOG(catname, level, logmsg, args...)
Localised message support (interface).
Interface to utility string handling.
first entry in window list
Option reading and saving interface.
#define nsoption_charp(OPTION)
Get the value of a string option.
#define nsoption_bool(OPTION)
Get the value of a boolean option.
Interface to a number of general purpose functionality.
static nserror path(const struct redraw_context *ctx, const plot_style_t *pstyle, const float *p, unsigned int n, const float transform[6])
Plots a path.