mirror of
https://github.com/jfdelnero/HxCFloppyEmulator.git
synced 2026-10-26 22:10:31 +00:00
build fix.
This commit is contained in:
1 parent
0a8618219c
commit
e4d2f080fe
3 files changed
+84
-76
No files matched your search
@@ -94,7 +94,10 @@ endif
|
||||
|
||||
FTDIFLOPPYEMU=usb_hxcfloppyemulator.o variablebitrate.o
|
||||
|
||||
GUI = main_gui.o msg_txt.o gui_strings.o about_gui.o batch_converter_window.o floppy_dump_window.o floppy_infos_window.o license_gui.o log.o parameters.o rawfile_loader_window.o sdhxcfecfg_window.o usbhxcfecfg_window.o cb_batch_converter_window.o cb_floppy_dump_window.o cb_floppy_infos_window.o cb_rawfile_loader_window.o cb_sdhxcfecfg_window.o cb_usbhxcfecfg_window.o cb_filesystem_generator_window.o filesystem_generator_window.o cb_edittool_window.o edittool_window.o floppy_streamer_window.o cb_floppy_streamer_window.o
|
||||
GUI = main_gui.o msg_txt.o gui_strings.o about_gui.o batch_converter_window.o floppy_dump_window.o floppy_infos_window.o license_gui.o \
|
||||
log.o parameters.o rawfile_loader_window.o sdhxcfecfg_window.o usbhxcfecfg_window.o cb_batch_converter_window.o cb_floppy_dump_window.o \
|
||||
cb_floppy_infos_window.o cb_rawfile_loader_window.o cb_sdhxcfecfg_window.o cb_usbhxcfecfg_window.o cb_filesystem_generator_window.o \
|
||||
filesystem_generator_window.o cb_edittool_window.o edittool_window.o floppy_streamer_window.o cb_floppy_streamer_window.o fl_dnd_box.o
|
||||
|
||||
MICROINTRO = microintro.o lzw.o pack.o rle.o hxcmod.o
|
||||
FLTKLIB = $(BASEDIR)/thirdpartylibs/fltk/fltk-1.x.x/lib/libfltk.a $(BASEDIR)/thirdpartylibs/fltk/fltk-1.x.x/lib/libfltk_images.a
|
||||
|
||||
@@ -1,79 +1,84 @@
|
||||
#include "fl_includes.h"
|
||||
|
||||
#include <FL/Fl_Box.H>
|
||||
#include "fl_dnd_box.cxx"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "fl_dnd_box.h"
|
||||
|
||||
class Fl_DND_Box ::
|
||||
void Fl_DND_Box::callback_deferred(void *v)
|
||||
{
|
||||
static void callback_deferred(void *v)
|
||||
{
|
||||
Fl_DND_Box *w = (Fl_DND_Box*)v;
|
||||
Fl_DND_Box *w = (Fl_DND_Box*)v;
|
||||
|
||||
w->do_callback();
|
||||
w->do_callback();
|
||||
}
|
||||
|
||||
Fl_DND_Box::Fl_DND_Box(int X, int Y, int W, int H, const char *L = 0)
|
||||
: Fl_Box(X,Y,W,H,L)
|
||||
{
|
||||
evt_txt = 0;
|
||||
evt_len = 0;
|
||||
evt = FL_NO_EVENT;
|
||||
labeltype(FL_NO_LABEL);
|
||||
box(FL_NO_BOX);
|
||||
clear_visible_focus();
|
||||
}
|
||||
|
||||
Fl_DND_Box::~Fl_DND_Box()
|
||||
{
|
||||
free(evt_txt);
|
||||
evt_txt = NULL;
|
||||
}
|
||||
|
||||
int Fl_DND_Box::event()
|
||||
{
|
||||
return evt;
|
||||
}
|
||||
|
||||
const char* Fl_DND_Box::event_text()
|
||||
{
|
||||
return evt_txt;
|
||||
}
|
||||
|
||||
int Fl_DND_Box::event_length()
|
||||
{
|
||||
return evt_len;
|
||||
}
|
||||
|
||||
int Fl_DND_Box::handle(int e)
|
||||
{
|
||||
switch(e)
|
||||
{
|
||||
case FL_DND_ENTER:
|
||||
case FL_DND_RELEASE:
|
||||
case FL_DND_LEAVE:
|
||||
case FL_DND_DRAG:
|
||||
evt = e;
|
||||
return 1;
|
||||
|
||||
case FL_PASTE:
|
||||
evt = e;
|
||||
|
||||
// make a copy of the DND payload
|
||||
evt_len = Fl::event_length();
|
||||
|
||||
free(evt_txt);
|
||||
|
||||
evt_txt = (char*)calloc( 1, evt_len+1 );
|
||||
if(evt_txt)
|
||||
strncpy(evt_txt, Fl::event_text(),evt_len);
|
||||
|
||||
// If there is a callback registered, call it.
|
||||
// The callback must access Fl::event_text() to
|
||||
// get the string or file path that was dropped.
|
||||
// Note that do_callback() is not called directly.
|
||||
// Instead it will be executed by the FLTK main-loop
|
||||
// once we have finished handling the DND event.
|
||||
// This allows caller to popup a window or change widget focus.
|
||||
if(callback() && ((when() & FL_WHEN_RELEASE) || (when() & FL_WHEN_CHANGED)))
|
||||
Fl::add_timeout(0.0, Fl_DND_Box::callback_deferred, (void*)this);
|
||||
return 1;
|
||||
}
|
||||
|
||||
Fl_DND_Box(int X, int Y, int W, int H, const char *L = 0)
|
||||
: Fl_Box(X,Y,W,H,L), evt(FL_NO_EVENT), evt_txt(0), evt_len(0);
|
||||
{
|
||||
labeltype(FL_NO_LABEL);
|
||||
box(FL_NO_BOX);
|
||||
clear_visible_focus();
|
||||
}
|
||||
|
||||
virtual ~Fl_DND_Box()
|
||||
{
|
||||
free(evt_txt);
|
||||
evt_txt = NULL;
|
||||
}
|
||||
|
||||
int event()
|
||||
{
|
||||
return evt;
|
||||
}
|
||||
|
||||
const char* event_text()
|
||||
{
|
||||
return evt_txt;
|
||||
}
|
||||
|
||||
int event_length()
|
||||
{
|
||||
return evt_len;
|
||||
}
|
||||
|
||||
int handle(int e)
|
||||
{
|
||||
switch(e)
|
||||
{
|
||||
case FL_DND_ENTER:
|
||||
case FL_DND_RELEASE:
|
||||
case FL_DND_LEAVE:
|
||||
case FL_DND_DRAG:
|
||||
evt = e;
|
||||
return 1;
|
||||
|
||||
case FL_PASTE:
|
||||
evt = e;
|
||||
|
||||
// make a copy of the DND payload
|
||||
evt_len = Fl::event_length();
|
||||
|
||||
free(evt_txt);
|
||||
|
||||
evt_txt = (char*)calloc( 1, evt_len+1 );
|
||||
if(evt_txt)
|
||||
strncpy(evt_txt, Fl::event_text(),evt_len);
|
||||
|
||||
// If there is a callback registered, call it.
|
||||
// The callback must access Fl::event_text() to
|
||||
// get the string or file path that was dropped.
|
||||
// Note that do_callback() is not called directly.
|
||||
// Instead it will be executed by the FLTK main-loop
|
||||
// once we have finished handling the DND event.
|
||||
// This allows caller to popup a window or change widget focus.
|
||||
if(callback() && ((when() & FL_WHEN_RELEASE) || (when() & FL_WHEN_CHANGED)))
|
||||
Fl::add_timeout(0.0, Fl_DND_Box::callback_deferred, (void*)this);
|
||||
return 1;
|
||||
}
|
||||
|
||||
return Fl_Box::handle(e);
|
||||
}
|
||||
};
|
||||
return Fl_Box::handle(e);
|
||||
}
|
||||
@@ -5,9 +5,9 @@ class Fl_DND_Box : public Fl_Box
|
||||
public:
|
||||
|
||||
static void callback_deferred(void *v);
|
||||
Fl_DND_Box(int X, int Y, int W, int H, const char *L = 0);
|
||||
Fl_DND_Box(int X, int Y, int W, int H, const char *L);
|
||||
|
||||
virtual ~Fl_DND_Box();
|
||||
~Fl_DND_Box();
|
||||
int event();
|
||||
const char* event_text();
|
||||
int event_length();
|
||||
|
||||
Reference in new issue
Block a user