From 095feb98e72f4b3124ebb522cc2f1025c055a0df Mon Sep 17 00:00:00 2001 From: Sanel Zukan Date: Mon, 28 Oct 2013 23:42:40 +0000 Subject: [PATCH] Allow last changes to be compileable with FLTK 1.1.x. This way I found some rand()/srand() calls without stdlib.h inclusion... --- ede-desktop/Desktop.cpp | 1 + ede-desktop/DesktopIcon.cpp | 13 +++++++++++++ ede-desktop/DesktopIcon.h | 4 ++++ ede-desktop/ede-desktop.cpp | 1 + 4 files changed, 19 insertions(+) diff --git a/ede-desktop/Desktop.cpp b/ede-desktop/Desktop.cpp index b7b50cc..b31bb4e 100644 --- a/ede-desktop/Desktop.cpp +++ b/ede-desktop/Desktop.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include diff --git a/ede-desktop/DesktopIcon.cpp b/ede-desktop/DesktopIcon.cpp index a901001..386a606 100644 --- a/ede-desktop/DesktopIcon.cpp +++ b/ede-desktop/DesktopIcon.cpp @@ -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) { diff --git a/ede-desktop/DesktopIcon.h b/ede-desktop/DesktopIcon.h index 4883515..58eb34a 100644 --- a/ede-desktop/DesktopIcon.h +++ b/ede-desktop/DesktopIcon.h @@ -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(); diff --git a/ede-desktop/ede-desktop.cpp b/ede-desktop/ede-desktop.cpp index d183e6b..5ecaa55 100644 --- a/ede-desktop/ede-desktop.cpp +++ b/ede-desktop/ede-desktop.cpp @@ -24,6 +24,7 @@ #include #include +#include #include #include