summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2018-03-15 09:34:20 +0000
committerMatthias Melcher <fltk@matthiasm.com>2018-03-15 09:34:20 +0000
commit67f0018dca4aa6eac36a2d90d4d4c9bfdd7a21a1 (patch)
tree50971b514e7e395babbe69d4335759fc3d36b17d
parent630fc8e9839ac534ad445ddfda8f175365009439 (diff)
Removed warning for Android. Fixed "FIXME" in Fl_Tooltip. Removed tab characters.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12748 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--FL/Fl_Tooltip.H2
-rw-r--r--src/Fl_Tooltip.cxx50
-rw-r--r--src/Fl_lock.cxx27
3 files changed, 53 insertions, 26 deletions
diff --git a/FL/Fl_Tooltip.H b/FL/Fl_Tooltip.H
index a7ddaa744..984eb8694 100644
--- a/FL/Fl_Tooltip.H
+++ b/FL/Fl_Tooltip.H
@@ -34,6 +34,7 @@
*/
class FL_EXPORT Fl_Tooltip {
+ friend class Fl_TooltipBox;
public:
/** Gets the tooltip delay. The default delay is 1.0 seconds. */
static float delay() { return delay_; }
@@ -113,6 +114,7 @@ private:
static int margin_width_; //!< distance around tooltip text left+right
static int margin_height_; //!< distance around tooltip text top+bottom
static int wrap_width_; //!< maximum width of tooltip text before it word wraps
+ static const int draw_symbols_; // 1 = draw @-symbols in tooltips, 0 = no
};
#endif
diff --git a/src/Fl_Tooltip.cxx b/src/Fl_Tooltip.cxx
index 2d88182fe..e4411c8da 100644
--- a/src/Fl_Tooltip.cxx
+++ b/src/Fl_Tooltip.cxx
@@ -23,25 +23,23 @@
#include <FL/Fl_System_Driver.H>
#include <stdio.h>
-#include <string.h> // strdup()
-
-float Fl_Tooltip::delay_ = 1.0f;
-float Fl_Tooltip::hoverdelay_ = 0.2f;
-Fl_Color Fl_Tooltip::color_ = fl_color_cube(FL_NUM_RED - 1,
- FL_NUM_GREEN - 1,
- FL_NUM_BLUE - 2);
-Fl_Color Fl_Tooltip::textcolor_ = FL_BLACK;
-Fl_Font Fl_Tooltip::font_ = FL_HELVETICA;
-Fl_Fontsize Fl_Tooltip::size_ = -1;
-int Fl_Tooltip::margin_width_ = 3;
-int Fl_Tooltip::margin_height_ = 3;
-int Fl_Tooltip::wrap_width_ = 400;
+#include <string.h> // strdup()
+
+float Fl_Tooltip::delay_ = 1.0f;
+float Fl_Tooltip::hoverdelay_ = 0.2f;
+Fl_Color Fl_Tooltip::color_ = fl_color_cube(FL_NUM_RED - 1,
+ FL_NUM_GREEN - 1,
+ FL_NUM_BLUE - 2);
+Fl_Color Fl_Tooltip::textcolor_ = FL_BLACK;
+Fl_Font Fl_Tooltip::font_ = FL_HELVETICA;
+Fl_Fontsize Fl_Tooltip::size_ = -1;
+int Fl_Tooltip::margin_width_ = 3;
+int Fl_Tooltip::margin_height_ = 3;
+int Fl_Tooltip::wrap_width_ = 400;
+const int Fl_Tooltip::draw_symbols_ = 1;
static const char* tip;
-// FIXME: this should be a static class variable: Fl_Tooltip::draw_symbols_
-static const int draw_symbols_ = 1; // 1 = draw @-symbols in tooltips, 0 = no
-
/**
This widget creates a tooltip box window, with no caption.
*/
@@ -84,7 +82,7 @@ void Fl_TooltipBox::layout() {
fl_font(Fl_Tooltip::font(), Fl_Tooltip::size());
int ww = Fl_Tooltip::wrap_width();
int hh = 0;
- fl_measure(tip, ww, hh, draw_symbols_);
+ fl_measure(tip, ww, hh, Fl_Tooltip::draw_symbols_);
ww += (Fl_Tooltip::margin_width() * 2);
hh += (Fl_Tooltip::margin_height() * 2);
@@ -117,7 +115,7 @@ void Fl_TooltipBox::draw() {
int Y = Fl_Tooltip::margin_height();
int W = w() - (Fl_Tooltip::margin_width()*2);
int H = h() - (Fl_Tooltip::margin_height()*2);
- fl_draw(tip, X, Y, W, H, Fl_Align(FL_ALIGN_LEFT|FL_ALIGN_WRAP), 0, draw_symbols_);
+ fl_draw(tip, X, Y, W, H, Fl_Align(FL_ALIGN_LEFT|FL_ALIGN_WRAP), 0, Fl_Tooltip::draw_symbols_);
}
static char recent_tooltip;
@@ -156,14 +154,14 @@ static void tooltip_timeout(void*) {
// bugfix: no need to refactor
if (Fl::system_driver()->use_tooltip_timeout_condition()) condition = (Fl::grab() == NULL);
if ( condition ) {
- if (!window) window = new Fl_TooltipBox;
- // this cast bypasses the normal Fl_Window label() code:
- ((Fl_Widget*)window)->label(tip);
- window->layout();
- window->redraw();
- // printf("tooltip_timeout: Showing window %p with tooltip \"%s\"...\n",
- // window, tip ? tip : "(null)");
- window->show();
+ if (!window) window = new Fl_TooltipBox;
+ // this cast bypasses the normal Fl_Window label() code:
+ ((Fl_Widget *) window)->label(tip);
+ window->layout();
+ window->redraw();
+ // printf("tooltip_timeout: Showing window %p with tooltip \"%s\"...\n",
+ // window, tip ? tip : "(null)");
+ window->show();
}
}
}
diff --git a/src/Fl_lock.cxx b/src/Fl_lock.cxx
index 902f9fc43..85636217b 100644
--- a/src/Fl_lock.cxx
+++ b/src/Fl_lock.cxx
@@ -417,6 +417,33 @@ void unlock_ring() {}
#endif // FL_CFG_SYS_POSIX
+// TODO: can these functions be moved to the system drivers?
+#ifdef __ANDROID__
+
+static void unlock_ring()
+{
+ // TODO: implement me
+}
+
+static void lock_ring()
+{
+ // TODO: implement me
+}
+
+static void unlock_function()
+{
+ // TODO: implement me
+}
+
+static void lock_function()
+{
+ // TODO: implement me
+}
+
+#endif // __ANDROID__
+
+
+
void Fl::awake(void *v) {
Fl::system_driver()->awake(v);
}