summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Spitzak <spitzak@gmail.com>1999-07-22 07:27:12 +0000
committerBill Spitzak <spitzak@gmail.com>1999-07-22 07:27:12 +0000
commit0bb590c832fb50a6bcf40aecbae2cad918ebee94 (patch)
treebd7153ec8d97c9f0fd51207da8e5aed9623e52ba
parentae621ef7787392b1214a4a662a9f70e7c3a74794 (diff)
Pragma added around xlib.h to shut up the IRIX compiler warnings
Fluid writes "class foo;" to the header and c file without prepending "extern" or "static". This patch also does this to "class foo bar;" which is wrong... Tabs draw very short labels. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@629 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--FL/x.H10
-rw-r--r--fluid/Fl_Function_Type.cxx10
-rw-r--r--src/Fl_Group.cxx22
-rw-r--r--src/Fl_Tabs.cxx12
-rw-r--r--src/Fl_win32.cxx12
-rw-r--r--src/fl_font.cxx6
6 files changed, 48 insertions, 24 deletions
diff --git a/FL/x.H b/FL/x.H
index 4404569b7..dfe79b7de 100644
--- a/FL/x.H
+++ b/FL/x.H
@@ -1,5 +1,5 @@
//
-// "$Id: x.H,v 1.10 1999/02/16 21:59:49 mike Exp $"
+// "$Id: x.H,v 1.10.2.1 1999/07/22 07:27:07 bill Exp $"
//
// X11 header file for the Fast Light Tool Kit (FLTK).
//
@@ -39,9 +39,15 @@
#else
+#ifdef __sgi
+#pragma set woff 3322
+#endif
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
+#ifdef __sgi
+#pragma reset woff 3322
+#endif
#include "Fl_Window.H"
FL_EXPORT void fl_open_display();
@@ -118,5 +124,5 @@ extern FL_EXPORT int fl_background_pixel; // hack into Fl_X::make_xid()
#endif
//
-// End of "$Id: x.H,v 1.10 1999/02/16 21:59:49 mike Exp $".
+// End of "$Id: x.H,v 1.10.2.1 1999/07/22 07:27:07 bill Exp $".
//
diff --git a/fluid/Fl_Function_Type.cxx b/fluid/Fl_Function_Type.cxx
index 0cb506d2d..4c21831bc 100644
--- a/fluid/Fl_Function_Type.cxx
+++ b/fluid/Fl_Function_Type.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Function_Type.cxx,v 1.15.2.5 1999/07/09 15:04:47 mike Exp $"
+// "$Id: Fl_Function_Type.cxx,v 1.15.2.6 1999/07/22 07:27:09 bill Exp $"
//
// C function type code for the Fast Light Tool Kit (FLTK).
//
@@ -450,7 +450,11 @@ void Fl_Decl_Type::write_code1() {
const char* c = name();
if (!c) return;
// handle putting #include or extern into decl:
- if ((!isalpha(*c) || !strncmp(c,"extern",6)) && *c != '~') {
+ if (!isalpha(*c) && *c != '~'
+ || !strncmp(c,"extern",6) && isspace(c[6])
+ || !strncmp(c,"class",5) && isspace(c[5])
+// || !strncmp(c,"struct",6) && isspace(c[6])
+ ) {
if (public_)
write_h("%s\n", c);
else
@@ -660,5 +664,5 @@ void Fl_Class_Type::write_code2() {
}
//
-// End of "$Id: Fl_Function_Type.cxx,v 1.15.2.5 1999/07/09 15:04:47 mike Exp $".
+// End of "$Id: Fl_Function_Type.cxx,v 1.15.2.6 1999/07/22 07:27:09 bill Exp $".
//
diff --git a/src/Fl_Group.cxx b/src/Fl_Group.cxx
index fc41157d7..80107fedf 100644
--- a/src/Fl_Group.cxx
+++ b/src/Fl_Group.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Group.cxx,v 1.8 1999/01/26 21:37:14 mike Exp $"
+// "$Id: Fl_Group.cxx,v 1.8.2.1 1999/07/22 07:27:11 bill Exp $"
//
// Group widget for the Fast Light Tool Kit (FLTK).
//
@@ -255,18 +255,22 @@ Fl_Group::Fl_Group(int X,int Y,int W,int H,const char *l)
}
void Fl_Group::clear() {
- Fl_Widget*const* a = array();
- for (int i=children(); i--;) {
- Fl_Widget* o = *a++;
- // test the parent to see if child already destructed:
- if (o->parent() == this) delete o;
- }
- if (children() > 1) free((void*)array_);
+ Fl_Widget*const* old_array = array();
+ int old_children = children();
+ // clear everything now, in case fl_fix_focus recursively calls us:
children_ = 0;
array_ = 0;
savedfocus_ = 0;
resizable_ = this;
init_sizes();
+ // okay, now it is safe to destroy the children:
+ Fl_Widget*const* a = old_array;
+ for (int i=old_children; i--;) {
+ Fl_Widget* o = *a++;
+ // test the parent to see if child already destructed:
+ if (o->parent() == this) delete o;
+ }
+ if (old_children > 1) free((void*)old_array);
}
Fl_Group::~Fl_Group() {clear();}
@@ -485,5 +489,5 @@ void Fl_Group::draw_outside_label(const Fl_Widget& w) const {
}
//
-// End of "$Id: Fl_Group.cxx,v 1.8 1999/01/26 21:37:14 mike Exp $".
+// End of "$Id: Fl_Group.cxx,v 1.8.2.1 1999/07/22 07:27:11 bill Exp $".
//
diff --git a/src/Fl_Tabs.cxx b/src/Fl_Tabs.cxx
index c483e5dd9..465f9dbd6 100644
--- a/src/Fl_Tabs.cxx
+++ b/src/Fl_Tabs.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Tabs.cxx,v 1.6.2.1 1999/07/06 16:16:38 mike Exp $"
+// "$Id: Fl_Tabs.cxx,v 1.6.2.2 1999/07/22 07:27:11 bill Exp $"
//
// Tab widget for the Fast Light Tool Kit (FLTK).
//
@@ -53,6 +53,7 @@ int Fl_Tabs::tab_positions(int* p, int* w) {
if (o->label()) {
int wt = 0; int ht = 0; o->measure_label(wt,ht);
w[i] = wt+TABSLOPE;
+ if (2*TABSLOPE > w[i]) w[i] = 2*TABSLOPE;
} else
w[i] = 2*TABSLOPE;
p[i+1] = p[i]+w[i];
@@ -174,9 +175,10 @@ Fl_Widget* Fl_Tabs::value() {
int Fl_Tabs::value(Fl_Widget *o) {
if (value_ == o) return 0;
- if (value_) value_->hide();
- if (o) o->show();
+ Fl_Widget* oldvalue = value_;
value_ = o;
+ if (o) o->show();
+ if (oldvalue) oldvalue->hide();
redraw();
do_callback();
return 1;
@@ -246,7 +248,7 @@ void Fl_Tabs::draw_tab(int x1, int x2, int W, int H, Fl_Widget* o, int what) {
fl_color(!sel && o==push_ ? FL_DARK3 : FL_LIGHT3);
fl_line(x1, y()+h()+H, x1+TABSLOPE, y()+h()-1);
}
- if (x2-x1 > 2*TABSLOPE)
+ if (W > TABSLOPE)
o->draw_label(what==LEFT ? x1+TABSLOPE : x2-W+TABSLOPE,
y()+(H<0?h()+H-3:0), W-TABSLOPE,
(H<0?-H:H)+3, FL_ALIGN_CENTER);
@@ -259,5 +261,5 @@ Fl_Tabs::Fl_Tabs(int X,int Y,int W, int H, const char *l) :
}
//
-// End of "$Id: Fl_Tabs.cxx,v 1.6.2.1 1999/07/06 16:16:38 mike Exp $".
+// End of "$Id: Fl_Tabs.cxx,v 1.6.2.2 1999/07/22 07:27:11 bill Exp $".
//
diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx
index 9b13fa008..042a7e53e 100644
--- a/src/Fl_win32.cxx
+++ b/src/Fl_win32.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_win32.cxx,v 1.33.2.12 1999/06/07 07:03:32 bill Exp $"
+// "$Id: Fl_win32.cxx,v 1.33.2.13 1999/07/22 07:27:11 bill Exp $"
//
// WIN32-specific code for the Fast Light Tool Kit (FLTK).
//
@@ -47,6 +47,10 @@
# define WM_SYNCPAINT 0x0088
#endif /* !WM_SYNCPAINT */
+#ifndef WM_MOUSELEAVE
+# define WM_MOUSE_LEAVE 0x02a3
+#endif
+
////////////////////////////////////////////////////////////////
// interface to poll/select call:
@@ -434,6 +438,10 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
case WM_RBUTTONUP: mouse_event(window, 2, 3, wParam, lParam); return 0;
case WM_MOUSEMOVE: mouse_event(window, 3, 0, wParam, lParam); return 0;
+ case WM_MOUSELEAVE:
+ Fl::handle(FL_LEAVE, window);
+ break;
+
case WM_SETFOCUS:
Fl::handle(FL_FOCUS, window);
break;
@@ -941,5 +949,5 @@ void Fl_Window::make_current() {
}
//
-// End of "$Id: Fl_win32.cxx,v 1.33.2.12 1999/06/07 07:03:32 bill Exp $".
+// End of "$Id: Fl_win32.cxx,v 1.33.2.13 1999/07/22 07:27:11 bill Exp $".
//
diff --git a/src/fl_font.cxx b/src/fl_font.cxx
index 670acc352..e5e50b045 100644
--- a/src/fl_font.cxx
+++ b/src/fl_font.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fl_font.cxx,v 1.9.2.1 1999/07/21 01:21:49 carl Exp $"
+// "$Id: fl_font.cxx,v 1.9.2.2 1999/07/22 07:27:12 bill Exp $"
//
// Font selection code for the Fast Light Tool Kit (FLTK).
//
@@ -278,8 +278,8 @@ double fl_width(uchar c) {
}
void fl_draw(const char* str, int n, int x, int y) {
- if (!fl_xfont) fl_font(0, 14); // Perhaps this should be configured somewhere?
if (font_gc != fl_gc) {
+ if (!fl_xfont) fl_font(FL_HELVETICA, 14);
font_gc = fl_gc;
XSetFont(fl_display, fl_gc, fl_xfont->fid);
}
@@ -293,5 +293,5 @@ void fl_draw(const char* str, int x, int y) {
#endif
//
-// End of "$Id: fl_font.cxx,v 1.9.2.1 1999/07/21 01:21:49 carl Exp $".
+// End of "$Id: fl_font.cxx,v 1.9.2.2 1999/07/22 07:27:12 bill Exp $".
//