From 4e66f937698fd0792c17db2085d99ee5985c81ff Mon Sep 17 00:00:00 2001 From: Bill Spitzak Date: Tue, 11 May 1999 09:39:31 +0000 Subject: Missing header files and FL_EXTERNs that prevented DLL's from compiling under BCC. Fluid will output A::B::C names for nested classes. Fl_Browser::lineposition(n, BOTTOM) will align the bottom of the line rather than the top with the bottom of the browser. The connect program does wait() so that it does not leave a zombie for every one of your ppp connections. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@584 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- FL/fl_draw.H | 6 +++--- FL/forms.H | 6 +++--- fluid/Fl_Function_Type.cxx | 21 ++++++++++++++++++--- src/Fl_Browser.cxx | 9 ++++++--- src/Fl_win32.cxx | 21 +++++++++++---------- src/fl_shortcut.cxx | 5 +++-- test/connect.cxx | 7 +++++-- 7 files changed, 49 insertions(+), 26 deletions(-) diff --git a/FL/fl_draw.H b/FL/fl_draw.H index 73c2edfb1..2bf94249c 100644 --- a/FL/fl_draw.H +++ b/FL/fl_draw.H @@ -1,5 +1,5 @@ // -// "$Id: fl_draw.H,v 1.9 1999/02/18 13:12:50 mike Exp $" +// "$Id: fl_draw.H,v 1.9.2.1 1999/05/11 09:39:27 bill Exp $" // // Portable drawing function header file for the Fast Light Tool Kit (FLTK). // @@ -137,7 +137,7 @@ FL_EXPORT void fl_draw_box(Fl_Boxtype, int x, int y, int w, int h, Fl_Color); // images: FL_EXPORT void fl_draw_image(const uchar*, int,int,int,int, int delta=3, int ldelta=0); FL_EXPORT void fl_draw_image_mono(const uchar*, int,int,int,int, int delta=1, int ld=0); -FL_EXPORT typedef void (*Fl_Draw_Image_Cb)(void*,int,int,int,uchar*); +typedef void (*Fl_Draw_Image_Cb)(void*,int,int,int,uchar*); FL_EXPORT void fl_draw_image(Fl_Draw_Image_Cb, void*, int,int,int,int, int delta=3); FL_EXPORT void fl_draw_image_mono(Fl_Draw_Image_Cb, void*, int,int,int,int, int delta=1); FL_EXPORT void fl_rectf(int x, int y, int w, int h, uchar r, uchar g, uchar b); @@ -161,5 +161,5 @@ FL_EXPORT int fl_add_symbol(const char* name, void (*drawit)(Fl_Color), int scal #endif // -// End of "$Id: fl_draw.H,v 1.9 1999/02/18 13:12:50 mike Exp $". +// End of "$Id: fl_draw.H,v 1.9.2.1 1999/05/11 09:39:27 bill Exp $". // diff --git a/FL/forms.H b/FL/forms.H index ac84dc421..68ca31426 100644 --- a/FL/forms.H +++ b/FL/forms.H @@ -1,5 +1,5 @@ // -// "$Id: forms.H,v 1.7 1999/03/10 08:17:40 bill Exp $" +// "$Id: forms.H,v 1.7.2.1 1999/05/11 09:39:27 bill Exp $" // // Forms emulation header file for the Fast Light Tool Kit (FLTK). // @@ -813,7 +813,7 @@ inline void fl_set_slider_precision(Fl_Widget* o, int i) { // meaning of FL_ALIGN_INSIDE. Implementation in forms.C class Fl_FormsText : public Fl_Widget { protected: - void draw(); + FL_EXPORT void draw(); public: Fl_FormsText(Fl_Boxtype b, int x, int y, int w, int h, const char* l=0) : Fl_Widget(x,y,w,h,l) {box(b); align(FL_ALIGN_LEFT);} @@ -841,5 +841,5 @@ inline void fl_draw() {Fl::flush();} #endif /* define __FORMS_H__ */ // -// End of "$Id: forms.H,v 1.7 1999/03/10 08:17:40 bill Exp $". +// End of "$Id: forms.H,v 1.7.2.1 1999/05/11 09:39:27 bill Exp $". // diff --git a/fluid/Fl_Function_Type.cxx b/fluid/Fl_Function_Type.cxx index 8a45b941b..a811e60f5 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.2 1999/04/30 16:29:40 gustavo Exp $" +// "$Id: Fl_Function_Type.cxx,v 1.15.2.3 1999/05/11 09:39:28 bill Exp $" // // C function type code for the Fast Light Tool Kit (FLTK). // @@ -543,7 +543,22 @@ void Fl_DeclBlock_Type::write_code2() { const char* Fl_Type::class_name() const { Fl_Type* p = parent; - while (p) {if (p->is_class()) return p->name(); p = p->parent;} + while (p) { + if (p->is_class()) { + // see if we are nested in another class, we must fully-qualify name: + // this is lame but works... + const char* q = p->class_name(); + if (q) { + static char buffer[256]; + if (q != buffer) strcpy(buffer, q); + strcat(buffer, "::"); + strcat(buffer, p->name()); + return buffer; + } + return p->name(); + } + p = p->parent; + } return 0; } @@ -638,5 +653,5 @@ void Fl_Class_Type::write_code2() { } // -// End of "$Id: Fl_Function_Type.cxx,v 1.15.2.2 1999/04/30 16:29:40 gustavo Exp $". +// End of "$Id: Fl_Function_Type.cxx,v 1.15.2.3 1999/05/11 09:39:28 bill Exp $". // diff --git a/src/Fl_Browser.cxx b/src/Fl_Browser.cxx index f6b383629..4f734275f 100644 --- a/src/Fl_Browser.cxx +++ b/src/Fl_Browser.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Browser.cxx,v 1.9.2.5 1999/05/01 15:08:21 mike Exp $" +// "$Id: Fl_Browser.cxx,v 1.9.2.6 1999/05/11 09:39:29 bill Exp $" // // Browser widget for the Fast Light Tool Kit (FLTK). // @@ -394,9 +394,12 @@ void Fl_Browser::lineposition(int line, Fl_Line_Position pos) { if (line<1) line = 1; if (line>lines) line = lines; int p = 0; - for (FL_BLINE* l=first; l&& line>1; l = l->next) { + + FL_BLINE* l; + for (l=first; l && line>1; l = l->next) { line--; p += item_height(l); } + if (l && (pos == BOTTOM)) p += item_height (l); int final = p, X, Y, W, H; bbox(X, Y, W, H); @@ -485,5 +488,5 @@ int Fl_Browser::value() const { } // -// End of "$Id: Fl_Browser.cxx,v 1.9.2.5 1999/05/01 15:08:21 mike Exp $". +// End of "$Id: Fl_Browser.cxx,v 1.9.2.6 1999/05/11 09:39:29 bill Exp $". // diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx index 5ead99f60..1f098bdeb 100644 --- a/src/Fl_win32.cxx +++ b/src/Fl_win32.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_win32.cxx,v 1.33.2.9 1999/05/09 14:49:14 mike Exp $" +// "$Id: Fl_win32.cxx,v 1.33.2.10 1999/05/11 09:39:30 bill Exp $" // // WIN32-specific code for the Fast Light Tool Kit (FLTK). // @@ -132,7 +132,6 @@ double fl_wait(int timeout_flag, double time) { int have_message = 0; int timerid; - if (nfds) { // For WIN32 we need to poll for socket input FIRST, since // the event queue is not something we can select() on... @@ -148,8 +147,8 @@ double fl_wait(int timeout_flag, double time) { if (::select(0,&fdt[0],&fdt[1],&fdt[2],&t)) { // We got something - do the callback! for (int i = 0; i < nfds; i ++) { - int f = fd[i].fd; - short revents = 0; + int f = fd[i].fd; + short revents = 0; if (FD_ISSET(f,&fdt[0])) revents |= POLLIN; if (FD_ISSET(f,&fdt[1])) revents |= POLLOUT; if (FD_ISSET(f,&fdt[2])) revents |= POLLERR; @@ -166,15 +165,15 @@ double fl_wait(int timeout_flag, double time) { // First see if there is a message waiting... have_message = PeekMessage(&fl_msg, NULL, 0, 0, PM_REMOVE); if (!have_message) { - // If not then set a 1ms timer... + // If not then set a 1ms timer... timerid = SetTimer(NULL, 0, 1, NULL); - GetMessage(&fl_msg, NULL, 0, 0); - KillTimer(NULL, timerid); + GetMessage(&fl_msg, NULL, 0, 0); + KillTimer(NULL, timerid); } - } else + } else { // Wait for a message... GetMessage(&fl_msg, NULL, 0, 0); - + } have_message = 1; } else { // Perform the requested timeout... @@ -854,6 +853,8 @@ void Fl_X::set_minmax(LPMINMAXINFO minmax) //////////////////////////////////////////////////////////////// +#include // need so FL_EXPORT filename_name works + // returns pointer to the filename, or null if name ends with '/' const char *filename_name(const char *name) { const char *p,*q; @@ -939,5 +940,5 @@ void Fl_Window::make_current() { } // -// End of "$Id: Fl_win32.cxx,v 1.33.2.9 1999/05/09 14:49:14 mike Exp $". +// End of "$Id: Fl_win32.cxx,v 1.33.2.10 1999/05/11 09:39:30 bill Exp $". // diff --git a/src/fl_shortcut.cxx b/src/fl_shortcut.cxx index 7cea32430..88f3ed660 100644 --- a/src/fl_shortcut.cxx +++ b/src/fl_shortcut.cxx @@ -1,5 +1,5 @@ // -// "$Id: fl_shortcut.cxx,v 1.4 1999/01/07 19:17:43 mike Exp $" +// "$Id: fl_shortcut.cxx,v 1.4.2.1 1999/05/11 09:39:31 bill Exp $" // // Shortcut support routines for the Fast Light Tool Kit (FLTK). // @@ -41,6 +41,7 @@ #include #include +#include #include #include #ifndef WIN32 @@ -123,5 +124,5 @@ int Fl_Widget::test_shortcut() { } // -// End of "$Id: fl_shortcut.cxx,v 1.4 1999/01/07 19:17:43 mike Exp $". +// End of "$Id: fl_shortcut.cxx,v 1.4.2.1 1999/05/11 09:39:31 bill Exp $". // diff --git a/test/connect.cxx b/test/connect.cxx index 5b690e64e..81e11667d 100644 --- a/test/connect.cxx +++ b/test/connect.cxx @@ -1,5 +1,5 @@ // -// "$Id: connect.cxx,v 1.4 1999/01/07 19:17:51 mike Exp $" +// "$Id: connect.cxx,v 1.4.2.1 1999/05/11 09:39:31 bill Exp $" // // PPP example program for the Fast Light Tool Kit (FLTK). // @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -40,6 +41,7 @@ int running; // actually the pid Fl_Toggle_Button *Button; void sigchld(int) { + waitpid(running, 0, 0); running = 0; Button->value(0); } @@ -53,6 +55,7 @@ void cb(Fl_Widget *o, void *) { } else { if (!running) return; kill(running, SIGINT); + waitpid(running, 0, 0); running = 0; } } @@ -68,5 +71,5 @@ int main(int argc, char ** argv) { } // -// End of "$Id: connect.cxx,v 1.4 1999/01/07 19:17:51 mike Exp $". +// End of "$Id: connect.cxx,v 1.4.2.1 1999/05/11 09:39:31 bill Exp $". // -- cgit v1.2.3