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_Menu_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_Menu_Type.cxx')
| -rw-r--r-- | fluid/Fl_Menu_Type.cxx | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/fluid/Fl_Menu_Type.cxx b/fluid/Fl_Menu_Type.cxx index bec72e999..df2ce84e0 100644 --- a/fluid/Fl_Menu_Type.cxx +++ b/fluid/Fl_Menu_Type.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Menu_Type.cxx,v 1.16.2.2 1999/04/17 01:33:27 bill Exp $" +// "$Id: Fl_Menu_Type.cxx,v 1.16.2.3 1999/08/05 08:01:36 bill Exp $" // // Menu item code for the Fast Light Tool Kit (FLTK). // @@ -93,16 +93,6 @@ int is_name(const char *c); const char *array_name(Fl_Widget_Type *o); int isdeclare(const char *c); -void Fl_Menu_Item_Type::write_declare() { - if (callback() && is_name(callback())) - ::write_declare("extern void %s(Fl_Menu_*, %s);", callback(), - 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)); - } -} - // Search backwards to find the parent menu button and return it's name. // Also put in i the index into the button's menu item array belonging // to this menu item. @@ -123,6 +113,13 @@ const char* Fl_Menu_Item_Type::menu_name(int& i) { #include "Fluid_Image.h" void Fl_Menu_Item_Type::write_static() { + if (callback() && is_name(callback())) + ::write_declare("extern void %s(Fl_Menu_*, %s);", callback(), + 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)); + } if (callback() && !is_name(callback())) { // see if 'o' or 'v' used, to prevent unused argument warnings: int use_o = 0; @@ -442,5 +439,5 @@ void shortcut_in_cb(Shortcut_Button* i, void* v) { } // -// End of "$Id: Fl_Menu_Type.cxx,v 1.16.2.2 1999/04/17 01:33:27 bill Exp $". +// End of "$Id: Fl_Menu_Type.cxx,v 1.16.2.3 1999/08/05 08:01:36 bill Exp $". // |
