fltk  1.3.5-source
About: FLTK (Fast Light Tool Kit) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X.
  Fossies Dox: fltk-1.3.5-source.tar.bz2  ("inofficial" and yet experimental doxygen-generated source code documentation)  

fl_dnd_win32.cxx
Go to the documentation of this file.
1 //
2 // "$Id$"
3 //
4 // Drag & Drop code for the Fast Light Tool Kit (FLTK).
5 //
6 // Copyright 1998-2010 by Bill Spitzak and others.
7 //
8 // This library is free software. Distribution and use rights are outlined in
9 // the file "COPYING" which should have been included with this file. If this
10 // file is missing or damaged, see the license at:
11 //
12 // http://www.fltk.org/COPYING.php
13 //
14 // Please report all bugs and problems on the following page:
15 //
16 // http://www.fltk.org/str.php
17 //
18 
19 // This file contains win32-specific code for fltk which is always linked
20 // in. Search other files for "WIN32" or filenames ending in _win32.cxx
21 // for other system-specific code.
22 
23 #include <FL/Fl.H>
24 #include <FL/x.H>
25 #include <FL/Fl_Window.H>
26 #include <FL/fl_utf8.h>
27 #include "flstring.h"
28 #include <stdio.h>
29 #include <stdlib.h>
30 #include <sys/types.h>
31 #include <objidl.h>
32 #include <time.h>
33 #if defined(__CYGWIN__)
34 #include <sys/time.h>
35 #include <unistd.h>
36 #endif
37 
38 extern char *fl_selection_buffer[2];
39 extern int fl_selection_length[2];
40 extern int fl_selection_buffer_length[2];
41 extern char fl_i_own_selection[2];
42 extern char *fl_locale2utf8(const char *s, UINT codepage = 0);
43 extern unsigned int fl_codepage;
44 
46 
47 #include <ole2.h>
48 #include <shellapi.h>
49 #include <shlobj.h>
50 
51 
55 class FLDropTarget : public IDropTarget
56 {
57  DWORD m_cRefCount;
58  DWORD lastEffect;
59  int px, py;
60 public:
61  FLDropTarget() : m_cRefCount(0) { } // initialize
62  virtual ~FLDropTarget() { }
63  HRESULT STDMETHODCALLTYPE QueryInterface( REFIID riid, LPVOID *ppvObject ) {
64  if (IID_IUnknown==riid || IID_IDropTarget==riid)
65  {
66  *ppvObject=this;
67  ((LPUNKNOWN)*ppvObject)->AddRef();
68  return S_OK;
69  }
70  *ppvObject = NULL;
71  return E_NOINTERFACE;
72  }
73  ULONG STDMETHODCALLTYPE AddRef() { return ++m_cRefCount; }
74  ULONG STDMETHODCALLTYPE Release() {
75  long nTemp;
76  nTemp = --m_cRefCount;
77  if(nTemp==0)
78  delete this;
79  return nTemp;
80  }
81  HRESULT STDMETHODCALLTYPE DragEnter( IDataObject *pDataObj, DWORD /*grfKeyState*/, POINTL pt, DWORD *pdwEffect) {
82  if( !pDataObj ) return E_INVALIDARG;
83  /* Tricky point here: Not DPI-aware applications use different units for the 'POINTL pt' argument
84  of the DragEnter, DragOver, and Drop member functions.
85  DragEnter receives the mouse coordinates in unscaled screen units,
86  whereas DragOver and Drop receive the mouse coordinates in scaled units.
87  This looks like a Windows bug because these apps are supposed to always receive
88  scaled units from the OS.
89  Therefore, we ask here for the mouse coordinates.
90  */
91  POINT mp;
92  GetCursorPos(&mp);
93  pt.x = mp.x; pt.y = mp.y;
94 
95  // set e_modifiers here from grfKeyState, set e_x and e_root_x
96  // check if FLTK handles this drag and return if it can't (i.e. BMP drag without filename)
97  POINT ppt;
98  Fl::e_x_root = ppt.x = pt.x;
99  Fl::e_y_root = ppt.y = pt.y;
100  HWND hWnd = WindowFromPoint( ppt );
101  Fl_Window *target = fl_find( hWnd );
102  if (target) {
103  Fl::e_x = Fl::e_x_root-target->x();
104  Fl::e_y = Fl::e_y_root-target->y();
105  }
106  fl_dnd_target_window = target;
107  px = pt.x; py = pt.y;
108  if (fillCurrentDragData(pDataObj)) {
109  // FLTK has no mechanism yet for the different drop effects, so we allow move and copy
110  if ( target && Fl::handle( FL_DND_ENTER, target ) )
111  *pdwEffect = DROPEFFECT_MOVE|DROPEFFECT_COPY; //|DROPEFFECT_LINK;
112  else
113  *pdwEffect = DROPEFFECT_NONE;
114  } else {
115  *pdwEffect = DROPEFFECT_NONE;
116  }
117  lastEffect = *pdwEffect;
118  return S_OK;
119  }
120  HRESULT STDMETHODCALLTYPE DragOver( DWORD /*grfKeyState*/, POINTL pt, DWORD *pdwEffect) {
121  if ( px==pt.x && py==pt.y )
122  {
123  *pdwEffect = lastEffect;
124  return S_OK;
125  }
126  if ( !fl_dnd_target_window )
127  {
128  *pdwEffect = lastEffect = DROPEFFECT_NONE;
129  return S_OK;
130  }
131  // set e_modifiers here from grfKeyState, set e_x and e_root_x
132  Fl::e_x_root = pt.x;
133  Fl::e_y_root = pt.y;
134  if (fl_dnd_target_window) {
137  }
138  if (fillCurrentDragData(0)) {
139  // Fl_Group will change DND_DRAG into DND_ENTER and DND_LEAVE if needed
141  *pdwEffect = DROPEFFECT_MOVE|DROPEFFECT_COPY; //|DROPEFFECT_LINK;
142  else
143  *pdwEffect = DROPEFFECT_NONE;
144  } else {
145  *pdwEffect = DROPEFFECT_NONE;
146  }
147  px = pt.x; py = pt.y;
148  lastEffect = *pdwEffect;
149  // show insert position if dnd'ing in the same window/process (STR #3209)
150  Fl::flush();
151  return S_OK;
152  }
153  HRESULT STDMETHODCALLTYPE DragLeave() {
155  {
159  }
160  return S_OK;
161  }
162  HRESULT STDMETHODCALLTYPE Drop( IDataObject *data, DWORD /*grfKeyState*/, POINTL pt, DWORD* /*pdwEffect*/) {
163  if ( !fl_dnd_target_window )
164  return S_OK;
167  Fl::e_x_root = pt.x;
168  Fl::e_y_root = pt.y;
169  if (target) {
170  Fl::e_x = Fl::e_x_root-target->x();
171  Fl::e_y = Fl::e_y_root-target->y();
172  }
173  // tell FLTK that the user released an object on this widget
174  if ( !Fl::handle( FL_DND_RELEASE, target ) )
175  return S_OK;
176 
177  Fl_Widget *w = target;
178  while (w->parent()) w = w->window();
179  HWND hwnd = fl_xid( (Fl_Window*)w );
180  if (fillCurrentDragData(data)) {
181  int old_event = Fl::e_number;
182  char *a, *b;
183  a = b = currDragData;
184  while (*a) { // strip the CRLF pairs
185  if (*a == '\r' && a[1] == '\n') a++;
186  else *b++ = *a++;
187  }
188  *b = 0;
190  Fl::e_length = (int) (b - currDragData);
191  Fl::belowmouse()->handle(Fl::e_number = FL_PASTE); // e_text will be invalid after this call
192  Fl::e_number = old_event;
193  SetForegroundWindow( hwnd );
195  return S_OK;
196  }
197  return S_OK;
198  }
199 private:
200 
201  static IDataObject *currDragRef;
202  static char *currDragData;
203  static int currDragSize;
204  static char currDragResult;
205 
206  static void clearCurrentDragData() {
207  currDragRef = 0;
209  currDragData = 0;
210  currDragSize = 0;
211  currDragResult = 0;
212  }
213  static char fillCurrentDragData(IDataObject *data) {
214  // shortcut through this whole procedure if there is no fresh data
215  if (!data)
216  return currDragResult;
217  // shortcut through this whole procedure if this is still the same drag event
218  // (* this is safe, because 'currDragRef' is cleared on Leave and Drop events)
219  if (data==currDragRef)
220  return currDragResult;
221 
222  // clear currDrag* for a new drag event
224 
225  currDragRef = data;
226  // fill currDrag* with UTF-8 data, if available
227  FORMATETC fmt = { 0 };
228  STGMEDIUM medium = { 0 };
229  fmt.tymed = TYMED_HGLOBAL;
230  fmt.dwAspect = DVASPECT_CONTENT;
231  fmt.lindex = -1;
232  fmt.cfFormat = CF_UNICODETEXT;
233  // if it is UNICODE text, return a UTF-8-converted copy of it
234  if ( data->GetData( &fmt, &medium )==S_OK )
235  {
236  void *stuff = GlobalLock( medium.hGlobal );
237  unsigned srclen = 0;
238  const wchar_t *wstuff = (const wchar_t *)stuff;
239  while (*wstuff++) srclen++;
240  wstuff = (const wchar_t *)stuff;
241  unsigned utf8len = fl_utf8fromwc(NULL, 0, wstuff, srclen);
242  currDragSize = utf8len;
243  currDragData = (char*)malloc(utf8len + 1);
244  fl_utf8fromwc(currDragData, currDragSize+1, wstuff, srclen+1); // include null-byte
245  GlobalUnlock( medium.hGlobal );
246  ReleaseStgMedium( &medium );
247  currDragResult = 1;
248  return currDragResult;
249  }
250  fmt.cfFormat = CF_TEXT;
251  // if it is CP1252 text, return a UTF-8-converted copy of it
252  if ( data->GetData( &fmt, &medium )==S_OK )
253  {
254  int len;
255  char *p, *q, *last;
256  unsigned u;
257  void *stuff = GlobalLock( medium.hGlobal );
258  currDragData = (char*)malloc(3 * strlen((char*)stuff) + 10);
259  p = (char*)stuff;
260  last = p + strlen(p);
261  q = currDragData;
262  while (p < last) {
263  u = fl_utf8decode(p, last, &len);
264  p += len;
265  len = fl_utf8encode(u, q);
266  q += len;
267  }
268  *q = 0;
269  currDragSize = (int) (q - currDragData);
270  currDragData = (char*)realloc(currDragData, currDragSize + 1);
271  GlobalUnlock( medium.hGlobal );
272  ReleaseStgMedium( &medium );
273  currDragResult = 1;
274  return currDragResult;
275  }
276  // else fill currDrag* with filenames, if possible
277  memset(&fmt, 0, sizeof(fmt));
278  fmt.tymed = TYMED_HGLOBAL;
279  fmt.dwAspect = DVASPECT_CONTENT;
280  fmt.lindex = -1;
281  fmt.cfFormat = CF_HDROP;
282  // if it is a pathname list, send an FL_PASTE with a \n separated list of filepaths
283  if ( data->GetData( &fmt, &medium )==S_OK )
284  {
285  HDROP hdrop = (HDROP)medium.hGlobal;
286  int i, n, nn = 0, nf = DragQueryFileW( hdrop, (UINT)-1, 0, 0 );
287  for ( i=0; i<nf; i++ ) nn += DragQueryFileW( hdrop, i, 0, 0 );
288  nn += nf;
289  xchar *dst = (xchar *)malloc(nn * sizeof(xchar));
290  xchar *bu = dst;
291  for ( i=0; i<nf; i++ ) {
292  n = DragQueryFileW( hdrop, i, (WCHAR*)dst, nn );
293  dst += n;
294  if ( i<nf-1 ) {
295  *dst++ = L'\n';
296  }
297  }
298  *dst=0;
299 
300  currDragData = (char*) malloc(nn * 5 + 1);
301 // Fl::e_length = fl_unicode2utf(bu, nn, Fl::e_text);
302  currDragSize = fl_utf8fromwc(currDragData, (nn*5+1), bu, nn);
304  free(bu);
305 
306 // Fl::belowmouse()->handle(FL_DROP);
307 // free( Fl::e_text );
308  ReleaseStgMedium( &medium );
309  currDragResult = 1;
310  return currDragResult;
311  }
312  currDragResult = 0;
313  return currDragResult;
314  }
315 } flDropTarget;
316 
317 IDropTarget *flIDropTarget = &flDropTarget;
318 
319 IDataObject *FLDropTarget::currDragRef = 0;
323 
327 class FLDropSource : public IDropSource
328 {
329  DWORD m_cRefCount;
330 public:
332  virtual ~FLDropSource() { }
333  HRESULT STDMETHODCALLTYPE QueryInterface( REFIID riid, LPVOID *ppvObject ) {
334  if (IID_IUnknown==riid || IID_IDropSource==riid)
335  {
336  *ppvObject=this;
337  ((LPUNKNOWN)*ppvObject)->AddRef();
338  return S_OK;
339  }
340  *ppvObject = NULL;
341  return E_NOINTERFACE;
342  }
343  ULONG STDMETHODCALLTYPE AddRef() { return ++m_cRefCount; }
344  ULONG STDMETHODCALLTYPE Release() {
345  long nTemp;
346  nTemp = --m_cRefCount;
347  if(nTemp==0)
348  delete this;
349  return nTemp;
350  }
351  STDMETHODIMP GiveFeedback( DWORD ) { return DRAGDROP_S_USEDEFAULTCURSORS; }
352  STDMETHODIMP QueryContinueDrag( BOOL esc, DWORD keyState ) {
353  if ( esc )
354  return DRAGDROP_S_CANCEL;
355  if ( !(keyState & (MK_LBUTTON|MK_MBUTTON|MK_RBUTTON)) )
356  return DRAGDROP_S_DROP;
357  return S_OK;
358  }
359 };
360 class FLEnum : public IEnumFORMATETC
361 {
362 public:
363  int n;
365 
366  ULONG __stdcall AddRef(void) {
367  return InterlockedIncrement(&m_lRefCount);
368  }
369 
370  ULONG __stdcall Release(void) {
371  LONG count = InterlockedDecrement(&m_lRefCount);
372  if(count == 0) {
373  delete this;
374  return 0;
375  } else {
376  return count;
377  }
378  }
379 
380 
381  HRESULT __stdcall QueryInterface(REFIID iid, void **ppvObject) {
382  if(iid == IID_IEnumFORMATETC || iid == IID_IUnknown) {
383  AddRef();
384  *ppvObject = this;
385  return S_OK;
386  } else {
387  *ppvObject = 0;
388  return E_NOINTERFACE;
389  }
390  }
391 
392  HRESULT __stdcall Next(ULONG celt, FORMATETC * rgelt, ULONG *pceltFetched) {
393  if (n > 0) return S_FALSE;
394  for (ULONG i = 0; i < celt; i++) {
395  n++;
396  rgelt->cfFormat = CF_HDROP;
397  rgelt->dwAspect = DVASPECT_CONTENT;
398  rgelt->lindex = -1;
399  rgelt->ptd = NULL;
400  rgelt->tymed = TYMED_HGLOBAL;
401  }
402  if (pceltFetched) *pceltFetched = celt;
403  return S_OK;
404  }
405 
406  HRESULT __stdcall Skip(ULONG celt) {
407  n += celt;
408  return (n == 0) ? S_OK : S_FALSE;
409  }
410 
411  HRESULT __stdcall Reset(void) {
412  n = 0;
413  return S_OK;
414  }
415 
416  HRESULT __stdcall Clone(IEnumFORMATETC **ppenum){
417  *ppenum = new FLEnum();
418  return S_OK;
419  }
420 
421  FLEnum(void) {
422  m_lRefCount = 1;
423  n = 0;
424  }
425 
426  virtual ~FLEnum(void) {
427  n = 0;
428  }
429 };
430 
431 
437 class FLDataObject : public IDataObject
438 {
439  DWORD m_cRefCount;
441 public:
442  FLDataObject() { m_cRefCount = 1; }// m_EnumF = new FLEnum();}
443  virtual ~FLDataObject() { }
444  HRESULT STDMETHODCALLTYPE QueryInterface( REFIID riid, LPVOID *ppvObject ) {
445  if (IID_IUnknown==riid || IID_IDataObject==riid)
446  {
447  *ppvObject=this;
448  ((LPUNKNOWN)*ppvObject)->AddRef();
449  return S_OK;
450  }
451  *ppvObject = NULL;
452  return E_NOINTERFACE;
453  }
454  ULONG STDMETHODCALLTYPE AddRef() { return ++m_cRefCount; }
455  ULONG STDMETHODCALLTYPE Release() {
456  long nTemp;
457  nTemp = --m_cRefCount;
458  if(nTemp==0)
459  delete this;
460  return nTemp;
461  }
462  // GetData currently allows UNICODE text through Global Memory only
463  HRESULT STDMETHODCALLTYPE GetData( FORMATETC *pformatetcIn, STGMEDIUM *pmedium ) {
464  if ((pformatetcIn->dwAspect & DVASPECT_CONTENT) &&
465  (pformatetcIn->tymed & TYMED_HGLOBAL) &&
466  (pformatetcIn->cfFormat == CF_UNICODETEXT))
467  {
468  int utf16_len = fl_utf8toUtf16(fl_selection_buffer[0], fl_selection_length[0], 0, 0);
469  HGLOBAL gh = GlobalAlloc( GHND, utf16_len * 2 + 2 );
470  char *pMem = (char*)GlobalLock( gh );
471  fl_utf8toUtf16(fl_selection_buffer[0], fl_selection_length[0], (unsigned short*)pMem, utf16_len + 1);
472 // HGLOBAL gh = GlobalAlloc( GHND| GMEM_SHARE,
473 // (fl_selection_length[0]+4) * sizeof(short)
474 // + sizeof(DROPFILES));
475 // unsigned char *pMem = (unsigned char*)GlobalLock( gh );
476 // if (!pMem) {
477 // GlobalFree(gh);
478 // return DV_E_FORMATETC;
479 // }
480 // DROPFILES *df =(DROPFILES*) pMem;
481 // int l;
482 // df->pFiles = sizeof(DROPFILES);
483 // df->pt.x = 0;
484 // df->pt.y = 0;
485 // df->fNC = FALSE;
486 // for (int i = 0; i < fl_selection_length[0]; i++) {
487 // if (fl_selection_buffer[0][i] == '\n') {
488 // fl_selection_buffer[0][i] = '\0';
489 // }
490 // }
491 //
492 // df->fWide = TRUE;
493 // l = fl_utf2unicode((unsigned char*)fl_selection_buffer[0],
494 // fl_selection_length[0], (xchar*)(((char*)pMem)
495 // + sizeof(DROPFILES)));
496 //
497 // pMem[l * sizeof(WCHAR) + sizeof(DROPFILES)] = 0;
498 // pMem[l * sizeof(WCHAR) + 1 + sizeof(DROPFILES)] = 0;
499 // pMem[l * sizeof(WCHAR) + 2 + sizeof(DROPFILES)] = 0;
500 // pMem[l * sizeof(WCHAR) + 3 + sizeof(DROPFILES)] = 0;
501  pmedium->tymed = TYMED_HGLOBAL;
502  pmedium->hGlobal = gh;
503  pmedium->pUnkForRelease = NULL;
504  GlobalUnlock( gh );
505  return S_OK;
506  }
507  return DV_E_FORMATETC;
508  }
509  HRESULT STDMETHODCALLTYPE QueryGetData( FORMATETC *pformatetc )
510  {
511  if ((pformatetc->dwAspect & DVASPECT_CONTENT) &&
512  (pformatetc->tymed & TYMED_HGLOBAL) &&
513  (pformatetc->cfFormat == CF_UNICODETEXT))
514  return S_OK;
515  return DV_E_FORMATETC;
516  }
517 // HRESULT STDMETHODCALLTYPE EnumFormatEtc( DWORD dir, IEnumFORMATETC** ppenumFormatEtc) {
518 // *ppenumFormatEtc = m_EnumF;
519 // return S_OK;
520 // }
521 
522  // all the following methods are not really needed for a DnD object
523  HRESULT STDMETHODCALLTYPE GetDataHere( FORMATETC* /*pformatetcIn*/, STGMEDIUM* /*pmedium*/) { return E_NOTIMPL; }
524  HRESULT STDMETHODCALLTYPE GetCanonicalFormatEtc( FORMATETC* /*in*/, FORMATETC* /*out*/) { return E_NOTIMPL; }
525  HRESULT STDMETHODCALLTYPE SetData( FORMATETC* /*pformatetc*/, STGMEDIUM* /*pmedium*/, BOOL /*fRelease*/) { return E_NOTIMPL; }
526  HRESULT STDMETHODCALLTYPE EnumFormatEtc( DWORD /*dir*/, IEnumFORMATETC** /*ppenumFormatEtc*/) { return E_NOTIMPL; }
527 // HRESULT STDMETHODCALLTYPE EnumFormatEtc( DWORD dir, IEnumFORMATETC** ppenumFormatEtc) {*ppenumFormatEtc = m_EnumF; return S_OK;}
528  HRESULT STDMETHODCALLTYPE DAdvise( FORMATETC* /*pformatetc*/, DWORD /*advf*/,
529  IAdviseSink* /*pAdvSink*/, DWORD* /*pdwConnection*/) { return E_NOTIMPL; }
530  HRESULT STDMETHODCALLTYPE DUnadvise( DWORD /*dwConnection*/) { return E_NOTIMPL; }
531  HRESULT STDMETHODCALLTYPE EnumDAdvise( IEnumSTATDATA** /*ppenumAdvise*/) { return E_NOTIMPL; }
532 };
533 
534 
535 int Fl::dnd()
536 {
537  DWORD dropEffect;
538  ReleaseCapture();
539 
540  FLDataObject *fdo = new FLDataObject;
541  fdo->AddRef();
542  FLDropSource *fds = new FLDropSource;
543  fds->AddRef();
544 
545  HRESULT ret = DoDragDrop( fdo, fds, DROPEFFECT_MOVE|DROPEFFECT_LINK|DROPEFFECT_COPY, &dropEffect );
546 
547  fdo->Release();
548  fds->Release();
549 
550  Fl_Widget *w = Fl::pushed();
551  if ( w )
552  {
553  int old_event = Fl::e_number;
554  w->handle(Fl::e_number = FL_RELEASE);
555  Fl::e_number = old_event;
556  Fl::pushed( 0 );
557  }
558  if ( ret==DRAGDROP_S_DROP ) return 1; // or DD_S_CANCEL
559  return 0;
560 }
561 
562 //
563 // End of "$Id$".
564 //
xchar
#define xchar
Definition: fl_utf8.h:68
Fl.H
FLDropSource::AddRef
ULONG STDMETHODCALLTYPE AddRef()
Definition: fl_dnd_win32.cxx:343
FLEnum::m_lRefCount
LONG m_lRefCount
Definition: fl_dnd_win32.cxx:364
Fl::e_y
static int e_y
Definition: Fl.H:145
FL_DND_ENTER
Definition: Enumerations.H:401
FLDropTarget::Release
ULONG STDMETHODCALLTYPE Release()
Definition: fl_dnd_win32.cxx:74
FLDropSource::GiveFeedback
STDMETHODIMP GiveFeedback(DWORD)
Definition: fl_dnd_win32.cxx:351
fl_utf8toUtf16
unsigned fl_utf8toUtf16(const char *src, unsigned srclen, unsigned short *dst, unsigned dstlen)
Definition: fl_utf.c:432
FLDropTarget::currDragRef
static IDataObject * currDragRef
Definition: fl_dnd_win32.cxx:201
FLDropTarget::DragEnter
HRESULT STDMETHODCALLTYPE DragEnter(IDataObject *pDataObj, DWORD, POINTL pt, DWORD *pdwEffect)
Definition: fl_dnd_win32.cxx:81
FLDropSource::QueryContinueDrag
STDMETHODIMP QueryContinueDrag(BOOL esc, DWORD keyState)
Definition: fl_dnd_win32.cxx:352
FL_DND_RELEASE
Definition: Enumerations.H:417
FLEnum::AddRef
ULONG __stdcall AddRef(void)
Definition: fl_dnd_win32.cxx:366
FLDropTarget::AddRef
ULONG STDMETHODCALLTYPE AddRef()
Definition: fl_dnd_win32.cxx:73
FLDropTarget::currDragResult
static char currDragResult
Definition: fl_dnd_win32.cxx:204
FLDataObject::~FLDataObject
virtual ~FLDataObject()
Definition: fl_dnd_win32.cxx:443
FLEnum::Release
ULONG __stdcall Release(void)
Definition: fl_dnd_win32.cxx:370
FLDropTarget
Definition: fl_dnd_win32.cxx:55
Fl_Widget::window
Fl_Window * window() const
Definition: Fl_Window.cxx:118
fl_selection_length
int fl_selection_length[2]
Definition: Fl_win32.cxx:598
fl_dnd_target_window
Fl_Window * fl_dnd_target_window
Definition: fl_dnd_win32.cxx:45
Fl::e_text
static char * e_text
Definition: Fl.H:154
FLDropTarget::QueryInterface
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, LPVOID *ppvObject)
Definition: fl_dnd_win32.cxx:63
FLDropTarget::DragOver
HRESULT STDMETHODCALLTYPE DragOver(DWORD, POINTL pt, DWORD *pdwEffect)
Definition: fl_dnd_win32.cxx:120
x.H
Fl::e_y_root
static int e_y_root
Definition: Fl.H:147
FLDropTarget::currDragData
static char * currDragData
Definition: fl_dnd_win32.cxx:202
free
void free()
FLDataObject::GetData
HRESULT STDMETHODCALLTYPE GetData(FORMATETC *pformatetcIn, STGMEDIUM *pmedium)
Definition: fl_dnd_win32.cxx:463
NULL
#define NULL
Definition: forms.H:34
FL_PASTE
Definition: Enumerations.H:383
fl_utf8fromwc
unsigned fl_utf8fromwc(char *dst, unsigned dstlen, const wchar_t *src, unsigned srclen)
Definition: fl_utf.c:617
Fl::e_number
static int e_number
Definition: Fl.H:143
FLDropSource::Release
ULONG STDMETHODCALLTYPE Release()
Definition: fl_dnd_win32.cxx:344
FLDropSource
Definition: fl_dnd_win32.cxx:327
FLEnum::~FLEnum
virtual ~FLEnum(void)
Definition: fl_dnd_win32.cxx:426
b
long b
Definition: jpegint.h:397
Fl::e_x_root
static int e_x_root
Definition: Fl.H:146
FLDropTarget::currDragSize
static int currDragSize
Definition: fl_dnd_win32.cxx:203
Fl::dnd
static int dnd()
Definition: fl_dnd_win32.cxx:535
FLDropTarget::DragLeave
HRESULT STDMETHODCALLTYPE DragLeave()
Definition: fl_dnd_win32.cxx:153
flIDropTarget
IDropTarget * flIDropTarget
Definition: fl_dnd_win32.cxx:317
FLDataObject
Definition: fl_dnd_win32.cxx:437
FLEnum::QueryInterface
HRESULT __stdcall QueryInterface(REFIID iid, void **ppvObject)
Definition: fl_dnd_win32.cxx:381
FLEnum
Definition: fl_dnd_win32.cxx:360
Fl::belowmouse
static Fl_Widget * belowmouse()
Definition: Fl.H:833
fl_utf8decode
unsigned fl_utf8decode(const char *p, const char *end, int *len)
Definition: fl_utf.c:137
Fl_Window.H
FLDropTarget::~FLDropTarget
virtual ~FLDropTarget()
Definition: fl_dnd_win32.cxx:62
FL_DND_LEAVE
Definition: Enumerations.H:411
FLDropSource::QueryInterface
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, LPVOID *ppvObject)
Definition: fl_dnd_win32.cxx:333
fl_locale2utf8
char * fl_locale2utf8(const char *s, UINT codepage=0)
FL_DND_DRAG
Definition: Enumerations.H:407
p
static menustate * p
Definition: Fl_Menu.cxx:606
fl_find
Fl_Window * fl_find(Window xid)
Definition: Fl.cxx:730
Fl_Widget::x
void x(int v)
Definition: Fl_Widget.H:139
fl_utf8.h
header for Unicode and UTF-8 character handling
FLDataObject::EnumDAdvise
HRESULT STDMETHODCALLTYPE EnumDAdvise(IEnumSTATDATA **)
Definition: fl_dnd_win32.cxx:531
FLDropSource::m_cRefCount
DWORD m_cRefCount
Definition: fl_dnd_win32.cxx:329
last
static idle_cb * last
Definition: Fl_add_idle.cxx:34
FLDropTarget::FLDropTarget
FLDropTarget()
Definition: fl_dnd_win32.cxx:61
FLDataObject::EnumFormatEtc
HRESULT STDMETHODCALLTYPE EnumFormatEtc(DWORD, IEnumFORMATETC **)
Definition: fl_dnd_win32.cxx:526
FLDropTarget::clearCurrentDragData
static void clearCurrentDragData()
Definition: fl_dnd_win32.cxx:206
FLEnum::FLEnum
FLEnum(void)
Definition: fl_dnd_win32.cxx:421
FLDropTarget::Drop
HRESULT STDMETHODCALLTYPE Drop(IDataObject *data, DWORD, POINTL pt, DWORD *)
Definition: fl_dnd_win32.cxx:162
FLDropSource::~FLDropSource
virtual ~FLDropSource()
Definition: fl_dnd_win32.cxx:332
FLDropSource::FLDropSource
FLDropSource()
Definition: fl_dnd_win32.cxx:331
FLEnum::Reset
HRESULT __stdcall Reset(void)
Definition: fl_dnd_win32.cxx:411
FLEnum::n
int n
Definition: fl_dnd_win32.cxx:363
Fl_Window
Definition: Fl_Window.H:57
FLDataObject::m_EnumF
FLEnum * m_EnumF
Definition: fl_dnd_win32.cxx:440
FLDataObject::QueryInterface
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, LPVOID *ppvObject)
Definition: fl_dnd_win32.cxx:444
FLDropTarget::m_cRefCount
DWORD m_cRefCount
Definition: fl_dnd_win32.cxx:57
FLDataObject::GetDataHere
HRESULT STDMETHODCALLTYPE GetDataHere(FORMATETC *, STGMEDIUM *)
Definition: fl_dnd_win32.cxx:523
Fl_Widget
Definition: Fl_Widget.H:101
FLDataObject::DAdvise
HRESULT STDMETHODCALLTYPE DAdvise(FORMATETC *, DWORD, IAdviseSink *, DWORD *)
Definition: fl_dnd_win32.cxx:528
FLEnum::Skip
HRESULT __stdcall Skip(ULONG celt)
Definition: fl_dnd_win32.cxx:406
FLDropTarget::lastEffect
DWORD lastEffect
Definition: fl_dnd_win32.cxx:58
FLDataObject::FLDataObject
FLDataObject()
Definition: fl_dnd_win32.cxx:442
Fl::pushed
static Fl_Widget * pushed()
Definition: Fl.H:837
FLDropTarget::py
int py
Definition: fl_dnd_win32.cxx:59
Fl_Widget::y
void y(int v)
Definition: Fl_Widget.H:141
FLDataObject::AddRef
ULONG STDMETHODCALLTYPE AddRef()
Definition: fl_dnd_win32.cxx:454
fl_selection_buffer
char * fl_selection_buffer[2]
Definition: Fl_win32.cxx:597
Fl_Widget::handle
virtual int handle(int event)
Definition: Fl_Widget.cxx:112
FLDataObject::SetData
HRESULT STDMETHODCALLTYPE SetData(FORMATETC *, STGMEDIUM *, BOOL)
Definition: fl_dnd_win32.cxx:525
Fl::flush
static void flush()
Definition: Fl.cxx:797
FLEnum::Next
HRESULT __stdcall Next(ULONG celt, FORMATETC *rgelt, ULONG *pceltFetched)
Definition: fl_dnd_win32.cxx:392
FLDropTarget::px
int px
Definition: fl_dnd_win32.cxx:59
FLDropTarget::fillCurrentDragData
static char fillCurrentDragData(IDataObject *data)
Definition: fl_dnd_win32.cxx:213
Fl::handle
static int handle(int, Fl_Window *)
Handle events from the window system.
Definition: Fl.cxx:1291
fl_utf8encode
int fl_utf8encode(unsigned ucs, char *buf)
Definition: fl_utf.c:309
fl_codepage
unsigned int fl_codepage
Fl::e_x
static int e_x
Definition: Fl.H:144
FLDataObject::m_cRefCount
DWORD m_cRefCount
Definition: fl_dnd_win32.cxx:439
Fl_Widget::parent
Fl_Group * parent() const
Definition: Fl_Widget.H:254
malloc
voidp malloc()
Fl::e_length
static int e_length
Definition: Fl.H:155
flstring.h
FLDataObject::GetCanonicalFormatEtc
HRESULT STDMETHODCALLTYPE GetCanonicalFormatEtc(FORMATETC *, FORMATETC *)
Definition: fl_dnd_win32.cxx:524
FLDataObject::DUnadvise
HRESULT STDMETHODCALLTYPE DUnadvise(DWORD)
Definition: fl_dnd_win32.cxx:530
Fl::w
static int w()
Definition: Fl_win32.cxx:579
FL_RELEASE
Definition: Enumerations.H:244
flDropTarget
FLDropTarget flDropTarget
FLDataObject::QueryGetData
HRESULT STDMETHODCALLTYPE QueryGetData(FORMATETC *pformatetc)
Definition: fl_dnd_win32.cxx:509
FLDataObject::Release
ULONG STDMETHODCALLTYPE Release()
Definition: fl_dnd_win32.cxx:455
fl_selection_buffer_length
int fl_selection_buffer_length[2]
Definition: Fl_win32.cxx:599
fl_xid
Window fl_xid(const Fl_Window *)
FLEnum::Clone
HRESULT __stdcall Clone(IEnumFORMATETC **ppenum)
Definition: fl_dnd_win32.cxx:416
fl_i_own_selection
char fl_i_own_selection[2]
Definition: Fl_win32.cxx:600