summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES4
-rw-r--r--src/Fl_arg.cxx42
-rw-r--r--src/Fl_get_system_colors.cxx34
-rw-r--r--src/Makefile8
4 files changed, 50 insertions, 38 deletions
diff --git a/CHANGES b/CHANGES
index e5b609b9f..0419c34d1 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,9 @@
CHANGES IN FLTK 1.1.4
+ - Fl_Window::show(argc, argv) wasn't calling
+ Fl::get_system_colors() as documented (STR #119)
+ - DSO (shared library) building wasn't quite right for
+ some platforms (STR #118)
- OSX: some changes to make ProjectBuilder compiles
possible.
- OSX: FLTK would not know where a window was positioned
diff --git a/src/Fl_arg.cxx b/src/Fl_arg.cxx
index 7347dfe2d..71c027600 100644
--- a/src/Fl_arg.cxx
+++ b/src/Fl_arg.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_arg.cxx,v 1.5.2.8.2.15 2003/07/29 15:12:36 easysw Exp $"
+// "$Id: Fl_arg.cxx,v 1.5.2.8.2.16 2003/08/02 13:49:17 easysw Exp $"
//
// Optional argument initialization code for the Fast Light Tool Kit (FLTK).
//
@@ -174,38 +174,34 @@ int Fl::args(int argc, char** argv, int& i, int (*cb)(int,char**,int&)) {
return i;
}
-
// show a main window, use any parsed arguments
void Fl_Window::show(int argc, char **argv) {
- if (!argc) {show(); return;}
- if (!arg_called) {
- Fl::args(argc,argv);
+ if (argc && !arg_called) Fl::args(argc,argv);
+
+ Fl::get_system_colors();
#if !defined(WIN32) && !defined(__APPLE__)
- // Get defaults for drag-n-drop and focus...
- const char *key = 0, *val;
+ // Get defaults for drag-n-drop and focus...
+ const char *key = 0, *val;
- fl_open_display();
+ if (Fl::first_window()) key = Fl::first_window()->xclass();
+ if (!key) key = "fltk";
- if (Fl::first_window()) key = Fl::first_window()->xclass();
- if (!key) key = "fltk";
+ val = XGetDefault(fl_display, key, "dndTextOps");
+ if (val) Fl::dnd_text_ops(strcasecmp(val, "true") == 0 ||
+ strcasecmp(val, "on") == 0 ||
+ strcasecmp(val, "yes") == 0);
- val = XGetDefault(fl_display, key, "dndTextOps");
- if (val) Fl::dnd_text_ops(strcasecmp(val, "true") == 0 ||
+ val = XGetDefault(fl_display, key, "tooltips");
+ if (val) Fl_Tooltip::enable(strcasecmp(val, "true") == 0 ||
strcasecmp(val, "on") == 0 ||
strcasecmp(val, "yes") == 0);
- val = XGetDefault(fl_display, key, "tooltips");
- if (val) Fl_Tooltip::enable(strcasecmp(val, "true") == 0 ||
- strcasecmp(val, "on") == 0 ||
- strcasecmp(val, "yes") == 0);
-
- val = XGetDefault(fl_display, key, "visibleFocus");
- if (val) Fl::visible_focus(strcasecmp(val, "true") == 0 ||
- strcasecmp(val, "on") == 0 ||
- strcasecmp(val, "yes") == 0);
+ val = XGetDefault(fl_display, key, "visibleFocus");
+ if (val) Fl::visible_focus(strcasecmp(val, "true") == 0 ||
+ strcasecmp(val, "on") == 0 ||
+ strcasecmp(val, "yes") == 0);
#endif // !WIN32 && !__APPLE__
- }
// set colors first, so background_pixel is correct:
static char beenhere;
@@ -420,5 +416,5 @@ int XParseGeometry(const char* string, int* x, int* y,
#endif // ifdef WIN32
//
-// End of "$Id: Fl_arg.cxx,v 1.5.2.8.2.15 2003/07/29 15:12:36 easysw Exp $".
+// End of "$Id: Fl_arg.cxx,v 1.5.2.8.2.16 2003/08/02 13:49:17 easysw Exp $".
//
diff --git a/src/Fl_get_system_colors.cxx b/src/Fl_get_system_colors.cxx
index ebc7d6dec..844d38c0c 100644
--- a/src/Fl_get_system_colors.cxx
+++ b/src/Fl_get_system_colors.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_get_system_colors.cxx,v 1.6.2.7.2.22 2003/07/29 02:12:36 easysw Exp $"
+// "$Id: Fl_get_system_colors.cxx,v 1.6.2.7.2.23 2003/08/02 13:49:17 easysw Exp $"
//
// System color support for the Fast Light Tool Kit (FLTK).
//
@@ -39,7 +39,14 @@ extern "C" int putenv(const char*);
#endif // __APPLE__ && __MWERKS__
+static char fl_bg_set = 0;
+static char fl_bg2_set = 0;
+static char fl_fg_set = 0;
+
+
void Fl::background(uchar r, uchar g, uchar b) {
+ fl_bg_set = 1;
+
// replace the gray ramp so that FL_GRAY is this color
if (!r) r = 1; else if (r==255) r = 254;
double powr = log(r/255.0)/log((FL_GRAY-FL_GRAY_RAMP)/(FL_NUM_GRAY-1.0));
@@ -57,10 +64,15 @@ void Fl::background(uchar r, uchar g, uchar b) {
}
void Fl::foreground(uchar r, uchar g, uchar b) {
+ fl_fg_set = 1;
+
Fl::set_color(FL_FOREGROUND_COLOR,r,g,b);
}
void Fl::background2(uchar r, uchar g, uchar b) {
+ fl_fg_set = 1;
+ fl_bg2_set = 1;
+
Fl::set_color(FL_BACKGROUND2_COLOR,r,g,b);
Fl::set_color(FL_FOREGROUND_COLOR,
get_color(fl_contrast(FL_FOREGROUND_COLOR,FL_BACKGROUND2_COLOR)));
@@ -131,9 +143,9 @@ getsyscolor(int what, const char* arg, void (*func)(uchar,uchar,uchar))
}
void Fl::get_system_colors() {
- getsyscolor(COLOR_WINDOW, fl_bg2,Fl::background2);
- getsyscolor(COLOR_WINDOWTEXT, fl_fg, Fl::foreground);
- getsyscolor(COLOR_BTNFACE, fl_bg, Fl::background);
+ if (!fl_bg2_set) getsyscolor(COLOR_WINDOW, fl_bg2,Fl::background2);
+ if (!fl_fg_set) getsyscolor(COLOR_WINDOWTEXT, fl_fg, Fl::foreground);
+ if (!fl_bg_set) getsyscolor(COLOR_BTNFACE, fl_bg, Fl::background);
getsyscolor(COLOR_HIGHLIGHT, 0, set_selection_color);
}
@@ -147,9 +159,9 @@ void Fl::get_system_colors()
{
fl_open_display();
- foreground(0, 0, 0);
- background(0xd8, 0xd8, 0xd8);
- background2(0xff, 0xff, 0xff);
+ if (!fl_bg2_set) background2(0xff, 0xff, 0xff);
+ if (!fl_fg_set) foreground(0, 0, 0);
+ if (!fl_bg_set) background(0xd8, 0xd8, 0xd8);
set_selection_color(0x00, 0x00, 0x80);
}
#else
@@ -183,9 +195,9 @@ void Fl::get_system_colors()
const char* key1 = 0;
if (Fl::first_window()) key1 = Fl::first_window()->xclass();
if (!key1) key1 = "fltk";
- getsyscolor(key1, "background", fl_bg, "#c0c0c0", Fl::background);
- getsyscolor(key1, "foreground", fl_fg, "#000000", Fl::foreground);
- getsyscolor("Text","background", fl_bg2, "#ffffff", Fl::background2);
+ if (!fl_bg2_set) getsyscolor("Text","background", fl_bg2, "#ffffff", Fl::background2);
+ if (!fl_fg_set) getsyscolor(key1, "foreground", fl_fg, "#000000", Fl::foreground);
+ if (!fl_bg_set) getsyscolor(key1, "background", fl_bg, "#c0c0c0", Fl::background);
getsyscolor(key1, "selectBackground",0, "#000080", set_selection_color);
}
@@ -321,5 +333,5 @@ int Fl::reload_scheme() {
//
-// End of "$Id: Fl_get_system_colors.cxx,v 1.6.2.7.2.22 2003/07/29 02:12:36 easysw Exp $".
+// End of "$Id: Fl_get_system_colors.cxx,v 1.6.2.7.2.23 2003/08/02 13:49:17 easysw Exp $".
//
diff --git a/src/Makefile b/src/Makefile
index 51aed6f3f..7c7dd125e 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,5 +1,5 @@
#
-# "$Id: Makefile,v 1.18.2.14.2.52 2003/06/15 05:37:32 easysw Exp $"
+# "$Id: Makefile,v 1.18.2.14.2.53 2003/08/02 13:49:17 easysw Exp $"
#
# Library makefile for the Fast Light Tool Kit (FLTK).
#
@@ -308,13 +308,13 @@ $(IMGLIBNAME): $(IMGOBJECTS)
libfltk_images.so.1.1: $(IMGOBJECTS)
echo $(DSOCOMMAND) $@ ...
- $(DSOCOMMAND) $@ $(IMGOBJECTS) $(IMGLIBS)
+ $(DSOCOMMAND) $@ $(IMGOBJECTS) $(IMAGELIBS)
-$(RM) libfltk_images.so
$(LN) libfltk_images.so.1.1 libfltk_images.so
libfltk_images.sl.1.1: $(IMGOBJECTS)
echo $(DSOCOMMAND) $@ ...
- $(DSOCOMMAND) $@ $(IMGOBJECTS) $(IMGLIBS)
+ $(DSOCOMMAND) $@ $(IMGOBJECTS) $(IMAGELIBS)
-$(RM) libfltk_images.sl
$(LN) libfltk_images.sl.1.1 libfltk_images.sl
@@ -582,5 +582,5 @@ uninstall:
#
-# End of "$Id: Makefile,v 1.18.2.14.2.52 2003/06/15 05:37:32 easysw Exp $".
+# End of "$Id: Makefile,v 1.18.2.14.2.53 2003/08/02 13:49:17 easysw Exp $".
#