diff options
| author | Bill Spitzak <spitzak@gmail.com> | 1999-08-05 08:01:40 +0000 |
|---|---|---|
| committer | Bill Spitzak <spitzak@gmail.com> | 1999-08-05 08:01:40 +0000 |
| commit | 16a999efd0f14f0a99fb01c4e8484ace744fd416 (patch) | |
| tree | b8fc60dab27eeb0e74bbfd075f971cb93d61334a /fluid/Fl_Widget_Type.cxx | |
| parent | 243525a9036b6221408bcf7ba234d6385d3a9c60 (diff) | |
Fixed so that a public declaration like #include "Foo" is written to the
header file in the correct order, before anything written by an later
object in the fl file. It used to write the extern callback definitions
first, this would fail if they used a type that was in the header file.
This also simplified the (still messy) code by getting rid of the
write_declare() virtual function.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@637 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'fluid/Fl_Widget_Type.cxx')
| -rw-r--r-- | fluid/Fl_Widget_Type.cxx | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/fluid/Fl_Widget_Type.cxx b/fluid/Fl_Widget_Type.cxx index 90ae6f91a..0f4dffef9 100644 --- a/fluid/Fl_Widget_Type.cxx +++ b/fluid/Fl_Widget_Type.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Widget_Type.cxx,v 1.15.2.4 1999/04/26 06:45:25 bill Exp $" +// "$Id: Fl_Widget_Type.cxx,v 1.15.2.5 1999/08/05 08:01:36 bill Exp $" // // Widget type code for the Fast Light Tool Kit (FLTK). // @@ -1222,20 +1222,16 @@ int isdeclare(const char *c) { return 0; } -void Fl_Widget_Type::write_declare() { - const char *t = subclassname(this); +void Fl_Widget_Type::write_static() { + const char* t = subclassname(this); if (!subclass()) ::write_declare("#include <FL/%s.H>", t); - if (callback() && is_name(callback())) - ::write_declare("extern void %s(%s*, %s);", callback(), t, - user_data_type() ? user_data_type() : "void*"); for (int n=0; n < NUM_EXTRA_CODE; n++) { if (extra_code(n) && isdeclare(extra_code(n))) ::write_declare("%s", extra_code(n)); } -} - -void Fl_Widget_Type::write_static() { - const char* t = subclassname(this); + if (callback() && is_name(callback())) + ::write_declare("extern void %s(%s*, %s);", callback(), t, + user_data_type() ? user_data_type() : "void*"); const char* c = array_name(this); const char* k = class_name(); if (c && !k) { @@ -1750,5 +1746,5 @@ int Fl_Widget_Type::read_fdesign(const char* name, const char* value) { } // -// End of "$Id: Fl_Widget_Type.cxx,v 1.15.2.4 1999/04/26 06:45:25 bill Exp $". +// End of "$Id: Fl_Widget_Type.cxx,v 1.15.2.5 1999/08/05 08:01:36 bill Exp $". // |
