Skip to content

Commit

Permalink
Pragma added around xlib.h to shut up the IRIX compiler warnings
Browse files Browse the repository at this point in the history
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
  • Loading branch information
spitzak committed Jul 22, 1999
1 parent ae621ef commit 0bb590c
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 24 deletions.
10 changes: 8 additions & 2 deletions 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).
//
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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 $".
//
10 changes: 7 additions & 3 deletions 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).
//
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 $".
//
22 changes: 13 additions & 9 deletions 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).
//
Expand Down Expand Up @@ -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();}
Expand Down Expand Up @@ -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 $".
//
12 changes: 7 additions & 5 deletions 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).
//
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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 $".
//
12 changes: 10 additions & 2 deletions 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).
//
Expand Down Expand Up @@ -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:

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 $".
//
6 changes: 3 additions & 3 deletions 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).
//
Expand Down Expand Up @@ -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);
}
Expand All @@ -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 $".
//

0 comments on commit 0bb590c

Please sign in to comment.