Allow last changes to be compileable with FLTK 1.1.x. This way I found some rand()/srand() calls without stdlib.h inclusion...

This commit is contained in:
Sanel Zukan 2013-10-28 23:42:40 +00:00
parent 361d3a532a
commit 095feb98e7
4 changed files with 19 additions and 0 deletions

View File

@ -21,6 +21,7 @@
#include <sys/types.h>
#include <dirent.h>
#include <limits.h>
#include <stdlib.h>
#include <FL/Fl.H>
#include <FL/fl_draw.H>

View File

@ -153,7 +153,20 @@ void DesktopIcon::set_image(const char *name) {
}
void DesktopIcon::set_tooltip(const char *tip) {
#if (FL_MAJOR_VERSION >= 1) && (FL_MINOR_VERSION >= 3)
copy_tooltip(tip);
#else
/*
* in versions prior 1.3, copy_tooltip didn't exist and there wasn't any
* way to store tooltip without manually managing the storage
*/
if(tip) {
ttip = tip;
tooltip(ttip.c_str());
} else {
tooltip(tip);
}
#endif
}
void DesktopIcon::update_label_font_and_size(void) {

View File

@ -90,6 +90,10 @@ private:
EDELIB_NS_PREPEND(String) path, cmd;
EDELIB_NS_PREPEND(MenuButton) *imenu;
#if !((FL_MAJOR_VERSION >= 1) && (FL_MINOR_VERSION >= 3))
EDELIB_NS_PREPEND(String) ttip;
#endif
public:
DesktopIcon(const char *l, int W = DESKTOP_ICON_SIZE_W, int H = DESKTOP_ICON_SIZE_H);
~DesktopIcon();

View File

@ -24,6 +24,7 @@
#include <signal.h>
#include <time.h>
#include <stdlib.h>
#include <FL/Fl.H>
#include <edelib/Ede.h>