Browse Source

Remove obsolete Forms compatibility.

tags/v1.3.1000
Jonathan Moore Liles 13 years ago
parent
commit
dd451702ae
22 changed files with 7 additions and 2498 deletions
  1. +0
    -56
      FL/Fl_FormsBitmap.H
  2. +0
    -63
      FL/Fl_FormsPixmap.H
  3. +0
    -845
      FL/forms.H
  4. +2
    -16
      configure
  5. +2
    -16
      configure.in
  6. +0
    -2
      fluid/Fl_Type.cxx
  7. +0
    -3
      fluid/Fl_Type.h
  8. +0
    -113
      fluid/Fl_Widget_Type.cxx
  9. +0
    -19
      fluid/Fl_Window_Type.cxx
  10. +0
    -139
      fluid/factory.cxx
  11. +0
    -139
      fluid/file.cxx
  12. +0
    -12
      ntk-config.in
  13. +0
    -20
      ntk.list.in
  14. +3
    -114
      src/Makefile
  15. +0
    -53
      src/forms_bitmap.cxx
  16. +0
    -213
      src/forms_compatability.cxx
  17. +0
    -114
      src/forms_free.cxx
  18. +0
    -67
      src/forms_fselect.cxx
  19. +0
    -63
      src/forms_pixmap.cxx
  20. +0
    -186
      src/forms_timer.cxx
  21. +0
    -6
      test/Makefile
  22. +0
    -239
      test/forms.cxx

+ 0
- 56
FL/Fl_FormsBitmap.H View File

@@ -1,56 +0,0 @@
//
// "$Id: Fl_FormsBitmap.H 7903 2010-11-28 21:06:39Z matt $"
//
// Forms bitmap header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2010 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//

/* \file
Fl_FormsBitmap widget . */

#ifndef Fl_FormsBitmap_H
#define Fl_FormsBitmap_H

#include "Fl_Bitmap.H"

/**
Forms compatibility Bitmap Image Widget
*/
class FL_EXPORT Fl_FormsBitmap : public Fl_Widget {
Fl_Bitmap *b;
protected:
void draw();
public:
Fl_FormsBitmap(Fl_Boxtype, int, int, int, int, const char * = 0);
void set(int W, int H, const uchar *bits);
/** Sets a new bitmap. */
void bitmap(Fl_Bitmap *B) {b = B;}
/** Gets a the current associated Fl_Bitmap objects. */
Fl_Bitmap *bitmap() const {return b;}
};

#endif

//
// End of "$Id: Fl_FormsBitmap.H 7903 2010-11-28 21:06:39Z matt $".
//

+ 0
- 63
FL/Fl_FormsPixmap.H View File

@@ -1,63 +0,0 @@
//
// "$Id: Fl_FormsPixmap.H 7903 2010-11-28 21:06:39Z matt $"
//
// Forms pixmap header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2010 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//

/* \file
Fl_FormsPixmap widget . */

#ifndef Fl_FormsPixmap_H
#define Fl_FormsPixmap_H

#include "Fl_Pixmap.H"

/**
\class Fl_FormsPixmap
\brief Forms pixmap drawing routines
*/
class FL_EXPORT Fl_FormsPixmap : public Fl_Widget {
Fl_Pixmap *b;
protected:
void draw();
public:
Fl_FormsPixmap(Fl_Boxtype t, int X, int Y, int W, int H, const char *L= 0);

void set(/*const*/char * const * bits);

/**
Set the internal pixmap pointer to an existing pixmap.
\param[in] B existing pixmap
*/
void Pixmap(Fl_Pixmap *B) {b = B;}

/** Get the internal pixmap pointer. */
Fl_Pixmap *Pixmap() const {return b;}
};

#endif

//
// End of "$Id: Fl_FormsPixmap.H 7903 2010-11-28 21:06:39Z matt $".
//

+ 0
- 845
FL/forms.H View File

@@ -1,845 +0,0 @@
//
// "$Id: forms.H 8623 2011-04-24 17:09:41Z AlbrechtS $"
//
// Forms emulation header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2011 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//

#ifndef __FORMS_H__
#define __FORMS_H__

#include "Fl.H"
#include "Fl_Group.H"
#include "Fl_Window.H"
#include "fl_draw.H"

typedef Fl_Widget FL_OBJECT;
typedef Fl_Window FL_FORM;

////////////////////////////////////////////////////////////////
// Random constants & symbols defined by forms.h file:

#ifndef NULL
#define NULL 0
#endif
#ifndef FALSE
#define FALSE 0
#define TRUE 1
#endif

#define FL_ON 1
#define FL_OK 1
#define FL_VALID 1
#define FL_PREEMPT 1
#define FL_AUTO 2
#define FL_WHEN_NEEDED FL_AUTO
#define FL_OFF 0
#define FL_NONE 0
#define FL_CANCEL 0
#define FL_INVALID 0
#define FL_IGNORE -1
//#define FL_CLOSE -2 // this variable is never used in FLTK Forms. It is removed becaus it conflicts with the window FL_CLOSE event

#define FL_LCOL FL_BLACK
#define FL_COL1 FL_GRAY
#define FL_MCOL FL_LIGHT1
#define FL_LEFT_BCOL FL_LIGHT3 // 53 is better match
#define FL_TOP_BCOL FL_LIGHT2 // 51
#define FL_BOTTOM_BCOL FL_DARK2 // 40
#define FL_RIGHT_BCOL FL_DARK3 // 36
#define FL_INACTIVE FL_INACTIVE_COLOR
#define FL_INACTIVE_COL FL_INACTIVE_COLOR
#define FL_FREE_COL1 FL_FREE_COLOR
#define FL_FREE_COL2 ((Fl_Color)(FL_FREE_COLOR+1))
#define FL_FREE_COL3 ((Fl_Color)(FL_FREE_COLOR+2))
#define FL_FREE_COL4 ((Fl_Color)(FL_FREE_COLOR+3))
#define FL_FREE_COL5 ((Fl_Color)(FL_FREE_COLOR+4))
#define FL_FREE_COL6 ((Fl_Color)(FL_FREE_COLOR+5))
#define FL_FREE_COL7 ((Fl_Color)(FL_FREE_COLOR+6))
#define FL_FREE_COL8 ((Fl_Color)(FL_FREE_COLOR+7))
#define FL_FREE_COL9 ((Fl_Color)(FL_FREE_COLOR+8))
#define FL_FREE_COL10 ((Fl_Color)(FL_FREE_COLOR+9))
#define FL_FREE_COL11 ((Fl_Color)(FL_FREE_COLOR+10))
#define FL_FREE_COL12 ((Fl_Color)(FL_FREE_COLOR+11))
#define FL_FREE_COL13 ((Fl_Color)(FL_FREE_COLOR+12))
#define FL_FREE_COL14 ((Fl_Color)(FL_FREE_COLOR+13))
#define FL_FREE_COL15 ((Fl_Color)(FL_FREE_COLOR+14))
#define FL_FREE_COL16 ((Fl_Color)(FL_FREE_COLOR+15))
#define FL_TOMATO ((Fl_Color)(131))
#define FL_INDIANRED ((Fl_Color)(164))
#define FL_SLATEBLUE ((Fl_Color)(195))
#define FL_DARKGOLD ((Fl_Color)(84))
#define FL_PALEGREEN ((Fl_Color)(157))
#define FL_ORCHID ((Fl_Color)(203))
#define FL_DARKCYAN ((Fl_Color)(189))
#define FL_DARKTOMATO ((Fl_Color)(113))
#define FL_WHEAT ((Fl_Color)(174))

#define FL_ALIGN_BESIDE FL_ALIGN_INSIDE

#define FL_PUP_TOGGLE 2 // FL_MENU_TOGGLE
#define FL_PUP_INACTIVE 1 // FL_MENU_INACTIVE
#define FL_NO_FRAME FL_NO_BOX
#define FL_ROUNDED3D_UPBOX FL_ROUND_UP_BOX
#define FL_ROUNDED3D_DOWNBOX FL_ROUND_DOWN_BOX
#define FL_OVAL3D_UPBOX FL_ROUND_UP_BOX
#define FL_OVAL3D_DOWNBOX FL_ROUND_DOWN_BOX

#define FL_MBUTTON1 1
#define FL_LEFTMOUSE 1
#define FL_MBUTTON2 2
#define FL_MIDDLEMOUSE 2
#define FL_MBUTTON3 3
#define FL_RIGHTMOUSE 3
#define FL_MBUTTON4 4
#define FL_MBUTTON5 5

#define FL_INVALID_STYLE 255
#define FL_NORMAL_STYLE FL_HELVETICA
#define FL_BOLD_STYLE FL_HELVETICA_BOLD
#define FL_ITALIC_STYLE FL_HELVETICA_ITALIC
#define FL_BOLDITALIC_STYLE FL_HELVETICA_BOLD_ITALIC
#define FL_FIXED_STYLE FL_COURIER
#define FL_FIXEDBOLD_STYLE FL_COURIER_BOLD
#define FL_FIXEDITALIC_STYLE FL_COURIER_ITALIC
#define FL_FIXEDBOLDITALIC_STYLE FL_COURIER_BOLD_ITALIC
#define FL_TIMES_STYLE FL_TIMES
#define FL_TIMESBOLD_STYLE FL_TIMES_BOLD
#define FL_TIMESITALIC_STYLE FL_TIMES_ITALIC
#define FL_TIMESBOLDITALIC_STYLE FL_TIMES_BOLD_ITALIC

// hacks to change the labeltype() when passed to fl_set_object_lstyle():
#define FL_SHADOW_STYLE (FL_SHADOW_LABEL<<8)
#define FL_ENGRAVED_STYLE (FL_ENGRAVED_LABEL<<8)
#define FL_EMBOSSED_STYLE (FL_EMBOSSED_LABEL<<0)

// size values are different from XForms, match older Forms:
#define FL_TINY_SIZE 8
#define FL_SMALL_SIZE 11 // 10
//#define FL_NORMAL_SIZE 14 // 12
#define FL_MEDIUM_SIZE 18 // 14
#define FL_LARGE_SIZE 24 // 18
#define FL_HUGE_SIZE 32 // 24
#define FL_DEFAULT_SIZE FL_SMALL_SIZE
#define FL_TINY_FONT FL_TINY_SIZE
#define FL_SMALL_FONT FL_SMALL_SIZE
#define FL_NORMAL_FONT FL_NORMAL_SIZE
#define FL_MEDIUM_FONT FL_MEDIUM_SIZE
#define FL_LARGE_FONT FL_LARGE_SIZE
#define FL_HUGE_FONT FL_HUGE_SIZE
#define FL_NORMAL_FONT1 FL_SMALL_FONT
#define FL_NORMAL_FONT2 FL_NORMAL_FONT
#define FL_DEFAULT_FONT FL_SMALL_FONT

#define FL_RETURN_END_CHANGED FL_WHEN_RELEASE
#define FL_RETURN_CHANGED FL_WHEN_CHANGED
#define FL_RETURN_END FL_WHEN_RELEASE_ALWAYS
#define FL_RETURN_ALWAYS (FL_WHEN_CHANGED|FL_WHEN_NOT_CHANGED)

#define FL_BOUND_WIDTH 3

typedef int FL_Coord;
typedef int FL_COLOR;

////////////////////////////////////////////////////////////////
// fltk interaction:

#define FL_CMD_OPT void
extern FL_EXPORT void fl_initialize(int*, char*[], const char*, FL_CMD_OPT*, int);
inline void fl_finish() {}

typedef void (*FL_IO_CALLBACK) (int, void*);
inline void fl_add_io_callback(int fd, short w, FL_IO_CALLBACK cb, void* v) {
Fl::add_fd(fd,w,cb,v);}
inline void fl_remove_io_callback(int fd, short, FL_IO_CALLBACK) {
Fl::remove_fd(fd);} // removes all the callbacks!

// type of callback is different and no "id" number is returned:
inline void fl_add_timeout(long msec, void (*cb)(void*), void* v) {
Fl::add_timeout(msec*.001, cb, v);}
inline void fl_remove_timeout(int) {}

// type of callback is different!
inline void fl_set_idle_callback(void (*cb)()) {Fl::set_idle(cb);}

FL_EXPORT Fl_Widget* fl_do_forms(void);
FL_EXPORT Fl_Widget* fl_check_forms();
inline Fl_Widget* fl_do_only_forms(void) {return fl_do_forms();}
inline Fl_Widget* fl_check_only_forms(void) {return fl_check_forms();}

// because of new redraw behavior, these are no-ops:
inline void fl_freeze_object(Fl_Widget*) {}
inline void fl_unfreeze_object(Fl_Widget*) {}
inline void fl_freeze_form(Fl_Window*) {}
inline void fl_unfreeze_form(Fl_Window*) {}
inline void fl_freeze_all_forms() {}
inline void fl_unfreeze_all_forms() {}

inline void fl_set_focus_object(Fl_Window*, Fl_Widget* o) {Fl::focus(o);}
inline void fl_reset_focus_object(Fl_Widget* o) {Fl::focus(o);}
#define fl_set_object_focus fl_set_focus_object

// void fl_set_form_atclose(Fl_Window*w,int (*cb)(Fl_Window*,void*),void* v)
// void fl_set_atclose(int (*cb)(Fl_Window*,void*),void*)
// fl_set_form_atactivate/atdeactivate not implemented!

////////////////////////////////////////////////////////////////
// Fl_Widget:

inline void fl_set_object_boxtype(Fl_Widget* o, Fl_Boxtype a) {o->box(a);}
inline void fl_set_object_lsize(Fl_Widget* o,int s) {o->labelsize(s);}

/* forms lib font indexes must be byte sized - extract correct byte from style word */
inline void fl_set_object_lstyle(Fl_Widget* o,int a) {
o->labelfont((Fl_Font)(a&0xff)); o->labeltype((Fl_Labeltype)(a>>8));}
inline void fl_set_object_lcol(Fl_Widget* o, Fl_Color a) {o->labelcolor(a);}
#define fl_set_object_lcolor fl_set_object_lcol
inline void fl_set_object_lalign(Fl_Widget* o, Fl_Align a) {o->align(a);}
#define fl_set_object_align fl_set_object_lalign
inline void fl_set_object_color(Fl_Widget* o,Fl_Color a,Fl_Color b) {o->color(a,b);}
inline void fl_set_object_label(Fl_Widget* o, const char* a) {o->label(a); o->redraw();}
inline void fl_set_object_position(Fl_Widget*o,int x,int y) {o->position(x,y);}
inline void fl_set_object_size(Fl_Widget* o, int w, int h) {o->size(w,h);}
inline void fl_set_object_geometry(Fl_Widget* o,int x,int y,int w,int h) {o->resize(x,y,w,h);}

inline void fl_get_object_geometry(Fl_Widget* o,int*x,int*y,int*w,int*h) {
*x = o->x(); *y = o->y(); *w = o->w(); *h = o->h();}
inline void fl_get_object_position(Fl_Widget* o,int*x,int*y) {
*x = o->x(); *y = o->y();}

typedef void (*Forms_CB)(Fl_Widget*, long);
inline void fl_set_object_callback(Fl_Widget*o,Forms_CB c,long a) {o->callback(c,a);}
#define fl_set_call_back fl_set_object_callback
inline void fl_call_object_callback(Fl_Widget* o) {o->do_callback();}
inline void fl_trigger_object(Fl_Widget* o) {o->do_callback();}
inline void fl_set_object_return(Fl_Widget* o, int v) {
o->when((Fl_When)(v|FL_WHEN_RELEASE));}

inline void fl_redraw_object(Fl_Widget* o) {o->redraw();}
inline void fl_show_object(Fl_Widget* o) {o->show();}
inline void fl_hide_object(Fl_Widget* o) {o->hide();}
inline void fl_free_object(Fl_Widget* x) {delete x;}
inline void fl_delete_object(Fl_Widget* o) {o->parent()->remove(*o);}
inline void fl_activate_object(Fl_Widget* o) {o->activate();}
inline void fl_deactivate_object(Fl_Widget* o) {o->deactivate();}

inline void fl_add_object(Fl_Window* f, Fl_Widget* x) {f->add(x);}
inline void fl_insert_object(Fl_Widget* o, Fl_Widget* b) {b->parent()->insert(*o,b);}

inline Fl_Window* FL_ObjWin(Fl_Widget* o) {return o->window();}

////////////////////////////////////////////////////////////////
// things that appered in the demos a lot that I don't emulate, but
// I did not want to edit out of all the demos...

inline int fl_get_border_width() {return 3;}
inline void fl_set_border_width(int) {}
inline void fl_set_object_dblbuffer(Fl_Widget*, int) {}
inline void fl_set_form_dblbuffer(Fl_Window*, int) {}

////////////////////////////////////////////////////////////////
// Fl_Window:

inline void fl_free_form(Fl_Window* x) {delete x;}
inline void fl_redraw_form(Fl_Window* f) {f->redraw();}

inline Fl_Window* fl_bgn_form(Fl_Boxtype b,int w,int h) {
Fl_Window* g = new Fl_Window(w,h,0);
g->box(b);
return g;
}
FL_EXPORT void fl_end_form();
inline void fl_addto_form(Fl_Window* f) {f->begin();}
inline Fl_Group* fl_bgn_group() {return new Fl_Group(0,0,0,0,0);}
inline void fl_end_group() {Fl_Group::current()->forms_end();}
inline void fl_addto_group(Fl_Widget* o) {((Fl_Group* )o)->begin();}
#define resizebox _ddfdesign_kludge()

inline void fl_scale_form(Fl_Window* f, double x, double y) {
f->resizable(f); f->size(int(f->w()*x),int(f->h()*y));}
inline void fl_set_form_position(Fl_Window* f,int x,int y) {f->position(x,y);}
inline void fl_set_form_size(Fl_Window* f, int w, int h) {f->size(w,h);}
inline void fl_set_form_geometry(Fl_Window* f,int x,int y,int w,int h) {
f->resize(x,y,w,h);}
#define fl_set_initial_placement fl_set_form_geometry
inline void fl_adjust_form_size(Fl_Window*) {}

FL_EXPORT void fl_show_form(Fl_Window* f,int p,int b,const char* n);
enum { // "p" argument values:
FL_PLACE_FREE = 0, // make resizable
FL_PLACE_MOUSE = 1, // mouse centered on form
FL_PLACE_CENTER = 2, // center of the screen
FL_PLACE_POSITION = 4,// fixed position, resizable
FL_PLACE_SIZE = 8, // fixed size, normal fltk behavior
FL_PLACE_GEOMETRY =16,// fixed size and position
FL_PLACE_ASPECT = 32, // keep aspect ratio (ignored)
FL_PLACE_FULLSCREEN=64,// fill screen
FL_PLACE_HOTSPOT = 128,// enables hotspot
FL_PLACE_ICONIC = 256,// iconic (ignored)
FL_FREE_SIZE=(1<<14), // force resizable
FL_FIX_SIZE =(1<<15) // force off resizable
};
#define FL_PLACE_FREE_CENTER (FL_PLACE_CENTER|FL_FREE_SIZE)
#define FL_PLACE_CENTERFREE (FL_PLACE_CENTER|FL_FREE_SIZE)
enum { // "b" arguement values:
FL_NOBORDER = 0,
FL_FULLBORDER,
FL_TRANSIENT
//FL_MODAL = (1<<8) // not implemented yet in Forms
};
inline void fl_set_form_hotspot(Fl_Window* w,int x,int y) {w->hotspot(x,y);}
inline void fl_set_form_hotobject(Fl_Window* w, Fl_Widget* o) {w->hotspot(o);}
extern FL_EXPORT char fl_flip; // in forms.C
inline void fl_flip_yorigin() {fl_flip = 1;}

#define fl_prepare_form_window fl_show_form
inline void fl_show_form_window(Fl_Window*) {}

inline void fl_raise_form(Fl_Window* f) {f->show();}

inline void fl_hide_form(Fl_Window* f) {f->hide();}
inline void fl_pop_form(Fl_Window* f) {f->show();}

extern FL_EXPORT char fl_modal_next; // in forms.C
inline void fl_activate_all_forms() {}
inline void fl_deactivate_all_forms() {fl_modal_next = 1;}
inline void fl_deactivate_form(Fl_Window*w) {w->deactivate();}
inline void fl_activate_form(Fl_Window*w) {w->activate();}

inline void fl_set_form_title(Fl_Window* f, const char* s) {f->label(s);}
inline void fl_title_form(Fl_Window* f, const char* s) {f->label(s);}

typedef void (*Forms_FormCB)(Fl_Widget*);
inline void fl_set_form_callback(Fl_Window* f,Forms_FormCB c) {f->callback(c);}
#define fl_set_form_call_back fl_set_form_callback

inline void fl_init() {}
FL_EXPORT void fl_set_graphics_mode(int,int);

inline int fl_form_is_visible(Fl_Window* f) {return f->visible();}

inline int fl_mouse_button() {return Fl::event_button();}
#define fl_mousebutton fl_mouse_button

#define fl_free free
#define fl_malloc malloc
#define fl_calloc calloc
#define fl_realloc realloc

////////////////////////////////////////////////////////////////
// Drawing functions. Only usable inside an Fl_Free object?

inline void fl_drw_box(Fl_Boxtype b,int x,int y,int w,int h,Fl_Color bgc,int=3) {
fl_draw_box(b,x,y,w,h,bgc);}
inline void fl_drw_frame(Fl_Boxtype b,int x,int y,int w,int h,Fl_Color bgc,int=3) {
fl_draw_box(b,x,y,w,h,bgc);}

inline void fl_drw_text(Fl_Align align, int x, int y, int w, int h,
Fl_Color fgcolor, int size, Fl_Font style,
const char* s) {
fl_font(style,size);
fl_color(fgcolor);
fl_draw(s,x,y,w,h,align);
}

// this does not work except for CENTER...
inline void fl_drw_text_beside(Fl_Align align, int x, int y, int w, int h,
Fl_Color fgcolor, int size, Fl_Font style,
const char* s) {
fl_font(style,size);
fl_color(fgcolor);
fl_draw(s,x,y,w,h,align);
}

inline void fl_set_font_name(Fl_Font n,const char* s) {Fl::set_font(n,s);}

inline void fl_mapcolor(Fl_Color c, uchar r, uchar g, uchar b) {Fl::set_color(c,r,g,b);}

#define fl_set_clipping(x,y,w,h) fl_push_clip(x,y,w,h)
#define fl_unset_clipping() fl_pop_clip()

////////////////////////////////////////////////////////////////
// Forms classes:

inline Fl_Widget* fl_add_new(Fl_Widget* p) {return p;}
inline Fl_Widget* fl_add_new(uchar t,Fl_Widget* p) {p->type(t); return p;}

#define forms_constructor(type,name) \
inline type* name(uchar t,int x,int y,int w,int h,const char* l) { \
return (type*)(fl_add_new(t, new type(x,y,w,h,l)));}
#define forms_constructort(type,name) \
inline type* name(uchar t,int x,int y,int w,int h,const char* l) { \
return (type*)(fl_add_new(new type(t,x,y,w,h,l)));}
#define forms_constructorb(type,name) \
inline type* name(Fl_Boxtype t,int x,int y,int w,int h,const char* l) { \
return (type*)(fl_add_new(new type(t,x,y,w,h,l)));}

#include "Fl_FormsBitmap.H"
#define FL_NORMAL_BITMAP FL_NO_BOX
forms_constructorb(Fl_FormsBitmap, fl_add_bitmap)
inline void fl_set_bitmap_data(Fl_Widget* o, int w, int h, const uchar* b) {
((Fl_FormsBitmap*)o)->set(w,h,b);
}

#include "Fl_FormsPixmap.H"
#define FL_NORMAL_PIXMAP FL_NO_BOX
forms_constructorb(Fl_FormsPixmap, fl_add_pixmap)
inline void fl_set_pixmap_data(Fl_Widget* o, char*const* b) {
((Fl_FormsPixmap*)o)->set(b);
}
//inline void fl_set_pixmap_file(Fl_Widget*, const char*);
inline void fl_set_pixmap_align(Fl_Widget* o,Fl_Align a,int,int) {o->align(a);}
//inline void fl_set_pixmap_colorcloseness(int, int, int);

#include "Fl_Box.H"
forms_constructorb(Fl_Box, fl_add_box)

#include "Fl_Browser.H"
forms_constructor(Fl_Browser, fl_add_browser)

inline void fl_clear_browser(Fl_Widget* o) {
((Fl_Browser*)o)->clear();}
inline void fl_add_browser_line(Fl_Widget* o, const char* s) {
((Fl_Browser*)o)->add(s);}
inline void fl_addto_browser(Fl_Widget* o, const char* s) {
((Fl_Browser*)o)->add(s);} /* should also scroll to bottom */
//inline void fl_addto_browser_chars(Fl_Widget*, const char*)
//#define fl_append_browser fl_addto_browser_chars
inline void fl_insert_browser_line(Fl_Widget* o, int n, const char* s) {
((Fl_Browser*)o)->insert(n,s);}
inline void fl_delete_browser_line(Fl_Widget* o, int n) {
((Fl_Browser*)o)->remove(n);}
inline void fl_replace_browser_line(Fl_Widget* o, int n, const char* s) {
((Fl_Browser*)o)->replace(n,s);}
inline char* fl_get_browser_line(Fl_Widget* o, int n) {
return (char*)(((Fl_Browser*)o)->text(n));}
inline int fl_load_browser(Fl_Widget* o, const char* f) {
return ((Fl_Browser*)o)->load(f);}
inline void fl_select_browser_line(Fl_Widget* o, int n) {
((Fl_Browser*)o)->select(n,1);}
inline void fl_deselect_browser_line(Fl_Widget* o, int n) {
((Fl_Browser*)o)->select(n,0);}
inline void fl_deselect_browser(Fl_Widget* o) {
((Fl_Browser*)o)->deselect();}
inline int fl_isselected_browser_line(Fl_Widget* o, int n) {
return ((Fl_Browser*)o)->selected(n);}
inline int fl_get_browser_topline(Fl_Widget* o) {
return ((Fl_Browser*)o)->topline();}
inline int fl_get_browser(Fl_Widget* o) {
return ((Fl_Browser*)o)->value();}
inline int fl_get_browser_maxline(Fl_Widget* o) {
return ((Fl_Browser*)o)->size();}
//linline int fl_get_browser_screenlines(Fl_Widget*);
inline void fl_set_browser_topline(Fl_Widget* o, int n) {
((Fl_Browser*)o)->topline(n);}
inline void fl_set_browser_fontsize(Fl_Widget* o, int s) {
((Fl_Browser*)o)->textsize(s);}
inline void fl_set_browser_fontstyle(Fl_Widget* o, Fl_Font s) {
((Fl_Browser*)o)->textfont(s);}
inline void fl_set_browser_specialkey(Fl_Widget* o, char c) {
((Fl_Browser*)o)->format_char(c);}
//inline void fl_set_browser_vscrollbar(Fl_Widget*, int);
//inline void fl_set_browser_hscrollbar(Fl_Widget*, int);
//inline void fl_set_browser_leftslider(Fl_Widget*, int);
//#define fl_set_browser_leftscrollbar fl_set_browser_leftslider
//inline void fl_set_browser_line_selectable(Fl_Widget*, int, int);
//inline void fl_get_browser_dimension(Fl_Widget*,int*,int*,int*,int*);
//inline void fl_set_browser_dblclick_callback(Fl_Widget*,FL_CALLBACKPTR,long);
//inline void fl_set_browser_xoffset(Fl_Widget*, FL_Coord);
//inline void fl_set_browser_scrollbarsize(Fl_Widget*, int, int);
inline void fl_setdisplayed_browser_line(Fl_Widget* o, int n, int i) {
((Fl_Browser*)o)->display(n,i);}
inline int fl_isdisplayed_browser_line(Fl_Widget* o, int n) {
return ((Fl_Browser*)o)->displayed(n);}

#include "Fl_Button.H"

#define FL_NORMAL_BUTTON 0
#define FL_TOUCH_BUTTON 4
#define FL_INOUT_BUTTON 5
#define FL_RETURN_BUTTON 6
#define FL_HIDDEN_RET_BUTTON 7
#define FL_PUSH_BUTTON FL_TOGGLE_BUTTON
#define FL_MENU_BUTTON 9

FL_EXPORT Fl_Button* fl_add_button(uchar t,int x,int y,int w,int h,const char* l);
inline int fl_get_button(Fl_Widget* b) {return ((Fl_Button*)b)->value();}
inline void fl_set_button(Fl_Widget* b, int v) {((Fl_Button*)b)->value(v);}
inline int fl_get_button_numb(Fl_Widget*) {return Fl::event_button();}
inline void fl_set_button_shortcut(Fl_Widget* b, const char* s,int=0) {
((Fl_Button*)b)->shortcut(s);}
//#define fl_set_object_shortcut(b,s) fl_set_button_shortcut(b,s)

#include "Fl_Light_Button.H"
forms_constructor(Fl_Light_Button, fl_add_lightbutton)

#include "Fl_Round_Button.H"
forms_constructor(Fl_Round_Button, fl_add_roundbutton)
forms_constructor(Fl_Round_Button, fl_add_round3dbutton)

#include "Fl_Check_Button.H"
forms_constructor(Fl_Check_Button, fl_add_checkbutton)

inline Fl_Widget* fl_add_bitmapbutton(int t,int x,int y,int w,int h,const char* l) {Fl_Widget* o = fl_add_button(t,x,y,w,h,l); return o;}
inline void fl_set_bitmapbutton_data(Fl_Widget* o,int a,int b,uchar* c) {
(new Fl_Bitmap(c,a,b))->label(o);} // does not delete old Fl_Bitmap!

inline Fl_Widget* fl_add_pixmapbutton(int t,int x,int y,int w,int h,const char* l) {Fl_Widget* o = fl_add_button(t,x,y,w,h,l); return o;}
inline void fl_set_pixmapbutton_data(Fl_Widget* o, const char*const* c) {
(new Fl_Pixmap(c))->label(o);} // does not delete old Fl_Pixmap!

// Fl_Canvas object not yet implemented!

#include "Fl_Chart.H"

forms_constructor(Fl_Chart, fl_add_chart)
inline void fl_clear_chart(Fl_Widget* o) {
((Fl_Chart*)o)->clear();}
inline void fl_add_chart_value(Fl_Widget* o,double v,const char* s,uchar c){
((Fl_Chart*)o)->add(v,s,c);}
inline void fl_insert_chart_value(Fl_Widget* o, int i, double v, const char* s, uchar c) {
((Fl_Chart*)o)->insert(i,v,s,c);}
inline void fl_replace_chart_value(Fl_Widget* o, int i, double v, const char* s, uchar c) {
((Fl_Chart*)o)->replace(i,v,s,c);}
inline void fl_set_chart_bounds(Fl_Widget* o, double a, double b) {
((Fl_Chart*)o)->bounds(a,b);}
inline void fl_set_chart_maxnumb(Fl_Widget* o, int v) {
((Fl_Chart*)o)->maxsize(v);}
inline void fl_set_chart_autosize(Fl_Widget* o, int v) {
((Fl_Chart*)o)->autosize(v);}
inline void fl_set_chart_lstyle(Fl_Widget* o, Fl_Font v) {
((Fl_Chart*)o)->textfont(v);}
inline void fl_set_chart_lsize(Fl_Widget* o, int v) {
((Fl_Chart*)o)->textsize(v);}
inline void fl_set_chart_lcolor(Fl_Widget* o, Fl_Color v) {
((Fl_Chart*)o)->textcolor(v);}
#define fl_set_chart_lcol fl_set_chart_lcolor

#include "Fl_Choice.H"

#define FL_NORMAL_CHOICE 0
#define FL_NORMAL_CHOICE2 0
#define FL_DROPLIST_CHOICE 0

forms_constructor(Fl_Choice, fl_add_choice)
inline void fl_clear_choice(Fl_Widget* o) {
((Fl_Choice*)o)->clear();}
inline void fl_addto_choice(Fl_Widget* o, const char* s) {
((Fl_Choice*)o)->add(s);}
inline void fl_replace_choice(Fl_Widget* o, int i, const char* s) {
((Fl_Choice*)o)->replace(i-1,s);}
inline void fl_delete_choice(Fl_Widget* o, int i) {
((Fl_Choice*)o)->remove(i-1);}
inline void fl_set_choice(Fl_Widget* o, int i) {
((Fl_Choice*)o)->value(i-1);}
// inline void fl_set_choice_text(Fl_Widget*, const char*);
inline int fl_get_choice(Fl_Widget* o) {
return ((Fl_Choice*)o)->value()+1;}
// inline const char* fl_get_choice_item_text(Fl_Widget*, int);
// inline int fl_get_choice_maxitems(Fl_Widget*);
inline const char* fl_get_choice_text(Fl_Widget* o) {
return ((Fl_Choice*)o)->text();}
inline void fl_set_choice_fontsize(Fl_Widget* o, int x) {
((Fl_Choice*)o)->textsize(x);}
inline void fl_set_choice_fontstyle(Fl_Widget* o, Fl_Font x) {
((Fl_Choice*)o)->textfont(x);}
// inline void fl_set_choice_item_mode(Fl_Widget*, int, unsigned);
// inline void fl_set_choice_item_shortcut(Fl_Widget*, int, const char*);

#include "Fl_Clock.H"
forms_constructort(Fl_Clock, fl_add_clock)
inline void fl_get_clock(Fl_Widget* o, int* h, int* m, int* s) {
*h = ((Fl_Clock*)o)->hour();
*m = ((Fl_Clock*)o)->minute();
*s = ((Fl_Clock*)o)->second();
}

#include "Fl_Counter.H"
forms_constructor(Fl_Counter, fl_add_counter)
inline void fl_set_counter_value(Fl_Widget* o, double v) {
((Fl_Counter*)o)->value(v);}
inline void fl_set_counter_bounds(Fl_Widget* o, double a, double b) {
((Fl_Counter*)o)->bounds(a,b);}
inline void fl_set_counter_step(Fl_Widget* o, double a, double b) {
((Fl_Counter*)o)->step(a,b);}
inline void fl_set_counter_precision(Fl_Widget* o, int v) {
((Fl_Counter*)o)->precision(v);}
inline void fl_set_counter_return(Fl_Widget* o, int v) {
((Fl_Counter*)o)->when((Fl_When)(v|FL_WHEN_RELEASE));}
inline double fl_get_counter_value(Fl_Widget* o) {
return ((Fl_Counter*)o)->value();}
inline void fl_get_counter_bounds(Fl_Widget* o, float* a, float* b) {
*a = float(((Fl_Counter*)o)->minimum());
*b = float(((Fl_Counter*)o)->maximum());
}
//inline void fl_set_counter_filter(Fl_Widget*,const char* (*)(Fl_Widget*,double,int));

// Cursor stuff cannot be emulated because it uses X stuff
inline void fl_set_cursor(Fl_Window* w, Fl_Cursor c) {w->cursor(c);}
#define FL_INVISIBLE_CURSOR FL_CURSOR_NONE
#define FL_DEFAULT_CURSOR FL_CURSOR_DEFAULT

#include "Fl_Dial.H"

#define FL_DIAL_COL1 FL_GRAY
#define FL_DIAL_COL2 37

forms_constructor(Fl_Dial, fl_add_dial)
inline void fl_set_dial_value(Fl_Widget* o, double v) {
((Fl_Dial*)o)->value(v);}
inline double fl_get_dial_value(Fl_Widget* o) {
return ((Fl_Dial*)o)->value();}
inline void fl_set_dial_bounds(Fl_Widget* o, double a, double b) {
((Fl_Dial*)o)->bounds(a, b);}
inline void fl_get_dial_bounds(Fl_Widget* o, float* a, float* b) {
*a = float(((Fl_Dial*)o)->minimum());
*b = float(((Fl_Dial*)o)->maximum());
}
inline void fl_set_dial_return(Fl_Widget* o, int i) {
((Fl_Dial*)o)->when((Fl_When)(i|FL_WHEN_RELEASE));}
inline void fl_set_dial_angles(Fl_Widget* o, int a, int b) {
((Fl_Dial*)o)->angles((short)a, (short)b);}
//inline void fl_set_dial_cross(Fl_Widget* o, int);
// inline void fl_set_dial_direction(Fl_Widget* o, uchar d) {
// ((Fl_Dial*)o)->direction(d);}
inline void fl_set_dial_step(Fl_Widget* o, double v) {
((Fl_Dial*)o)->step(v);}

// Frames:

inline Fl_Widget* fl_add_frame(Fl_Boxtype i,int x,int y,int w,int h,const char* l) {
return fl_add_box(i,x-3,y-3,w+6,h+6,l);}

// labelframe nyi
inline Fl_Widget* fl_add_labelframe(Fl_Boxtype i,int x,int y,int w,int h,const char* l) {
Fl_Widget* o = fl_add_box(i,x-3,y-3,w+6,h+6,l);
o->align(FL_ALIGN_TOP_LEFT);
return o;
}

#include "Fl_Free.H"
inline Fl_Free*
fl_add_free(int t,double x,double y,double w,double h,const char* l,
FL_HANDLEPTR hdl) {
return (Fl_Free*)(fl_add_new(
new Fl_Free(t,int(x),int(y),int(w),int(h),l,hdl)));
}

#include "fl_ask.H"
#include "fl_show_colormap.H"

inline int fl_show_question(const char* c, int = 0) {return fl_choice("%s",fl_no,fl_yes,0L,c);}
FL_EXPORT void fl_show_message(const char *,const char *,const char *);
FL_EXPORT void fl_show_alert(const char *,const char *,const char *,int=0);
FL_EXPORT int fl_show_question(const char *,const char *,const char *);
inline const char *fl_show_input(const char *l,const char*d=0) {return fl_input("%s",d,l);}
FL_EXPORT /*const*/ char *fl_show_simple_input(const char *label, const char *deflt = 0);
FL_EXPORT int fl_show_choice(
const char *m1,
const char *m2,
const char *m3,
int numb,
const char *b0,
const char *b1,
const char *b2);

inline void fl_set_goodies_font(Fl_Font a, Fl_Fontsize b) {fl_message_font(a,b);}
#define fl_show_messages fl_message
inline int fl_show_choices(const char* c,int n,const char* b1,const char* b2,
const char* b3, int) {
return fl_show_choice(0,c,0,n,b1,b2,b3);
}

#include "filename.H"
#include "Fl_File_Chooser.H"
inline int do_matching(char* a, const char* b) {return fl_filename_match(a,b);}

// Forms-compatible file chooser (implementation in fselect.C):
FL_EXPORT char* fl_show_file_selector(const char* message,const char* dir,
const char* pat,const char* fname);
FL_EXPORT char* fl_get_directory();
FL_EXPORT char* fl_get_pattern();
FL_EXPORT char* fl_get_filename();

#include "Fl_Input.H"
forms_constructor(Fl_Input, fl_add_input)
inline void fl_set_input(Fl_Widget* o, const char* v) {
((Fl_Input*)o)->value(v);}
inline void fl_set_input_return(Fl_Widget* o, int x) {
((Fl_Input*)o)->when((Fl_When)(x | FL_WHEN_RELEASE));}
inline void fl_set_input_color(Fl_Widget* o, Fl_Color a, Fl_Color b) {
((Fl_Input*)o)->textcolor(a);
((Fl_Input*)o)->cursor_color(b);
}
// inline void fl_set_input_scroll(Fl_Widget*, int);
inline void fl_set_input_cursorpos(Fl_Widget* o, int x, int /*y*/) {
((Fl_Input*)o)->position(x);}
// inline void fl_set_input_selected(Fl_Widget*, int);
// inline void fl_set_input_selected_range(Fl_Widget*, int, int);
// inline void fl_set_input_maxchars(Fl_Widget*, int);
// inline void fl_set_input_format(Fl_Widget*, int, int);
// inline void fl_set_input_hscrollbar(Fl_Widget*, int);
// inline void fl_set_input_vscrollbar(Fl_Widget*, int);
// inline void fl_set_input_xoffset(Fl_Widget*, int);
// inline void fl_set_input_topline(Fl_Widget*, int);
// inline void fl_set_input_scrollbarsize(Fl_Widget*, int, int);
// inline int fl_get_input_topline(Fl_Widget*);
// inline int fl_get_input_screenlines(Fl_Widget*);
inline int fl_get_input_cursorpos(Fl_Widget* o, int*x, int*y) {
*x = ((Fl_Input*)o)->position(); *y = 0; return *x;}
// inline int fl_get_input_numberoflines(Fl_Widget*);
// inline void fl_get_input_format(Fl_Widget*, int*, int*);
inline const char* fl_get_input(Fl_Widget* o) {return ((Fl_Input*)o)->value();}

#include "Fl_Menu_Button.H"

// types are not implemented, they all act like FL_PUSH_MENU:
#define FL_TOUCH_MENU 0
#define FL_PUSH_MENU 1
#define FL_PULLDOWN_MENU 2
forms_constructor(Fl_Menu_Button, fl_add_menu)

inline void fl_clear_menu(Fl_Widget* o) {
((Fl_Menu_Button*)o)->clear();}
inline void fl_set_menu(Fl_Widget* o, const char* s) {
((Fl_Menu_Button*)o)->clear(); ((Fl_Menu_Button*)o)->add(s);}
inline void fl_addto_menu(Fl_Widget* o, const char* s) {
((Fl_Menu_Button*)o)->add(s);}
inline void fl_replace_menu_item(Fl_Widget* o, int i, const char* s) {
((Fl_Menu_Button*)o)->replace(i-1,s);}
inline void fl_delete_menu_item(Fl_Widget* o, int i) {
((Fl_Menu_Button*)o)->remove(i-1);}
inline void fl_set_menu_item_shortcut(Fl_Widget* o, int i, const char* s) {
((Fl_Menu_Button*)o)->shortcut(i-1,fl_old_shortcut(s));}
inline void fl_set_menu_item_mode(Fl_Widget* o, int i, long x) {
((Fl_Menu_Button*)o)->mode(i-1,x);}
inline void fl_show_menu_symbol(Fl_Widget*, int ) {
/* ((Fl_Menu_Button*)o)->show_menu_symbol(i); */}
// inline void fl_set_menu_popup(Fl_Widget*, int);
inline int fl_get_menu(Fl_Widget* o) {
return ((Fl_Menu_Button*)o)->value()+1;}
inline const char* fl_get_menu_item_text(Fl_Widget* o, int i) {
return ((Fl_Menu_Button*)o)->text(i);}
inline int fl_get_menu_maxitems(Fl_Widget* o) {
return ((Fl_Menu_Button*)o)->size();}
inline int fl_get_menu_item_mode(Fl_Widget* o, int i) {
return ((Fl_Menu_Button*)o)->mode(i);}
inline const char* fl_get_menu_text(Fl_Widget* o) {
return ((Fl_Menu_Button*)o)->text();}

#include "Fl_Positioner.H"
#define FL_NORMAL_POSITIONER 0
forms_constructor(Fl_Positioner, fl_add_positioner)
inline void fl_set_positioner_xvalue(Fl_Widget* o, double v) {
((Fl_Positioner*)o)->xvalue(v);}
inline double fl_get_positioner_xvalue(Fl_Widget* o) {
return ((Fl_Positioner*)o)->xvalue();}
inline void fl_set_positioner_xbounds(Fl_Widget* o, double a, double b) {
((Fl_Positioner*)o)->xbounds(a,b);}
inline void fl_get_positioner_xbounds(Fl_Widget* o, float* a, float* b) {
*a = float(((Fl_Positioner*)o)->xminimum());
*b = float(((Fl_Positioner*)o)->xmaximum());
}
inline void fl_set_positioner_yvalue(Fl_Widget* o, double v) {
((Fl_Positioner*)o)->yvalue(v);}
inline double fl_get_positioner_yvalue(Fl_Widget* o) {
return ((Fl_Positioner*)o)->yvalue();}
inline void fl_set_positioner_ybounds(Fl_Widget* o, double a, double b) {
((Fl_Positioner*)o)->ybounds(a,b);}
inline void fl_get_positioner_ybounds(Fl_Widget* o, float* a, float* b) {
*a = float(((Fl_Positioner*)o)->yminimum());
*b = float(((Fl_Positioner*)o)->ymaximum());
}
inline void fl_set_positioner_xstep(Fl_Widget* o, double v) {
((Fl_Positioner*)o)->xstep(v);}
inline void fl_set_positioner_ystep(Fl_Widget* o, double v) {
((Fl_Positioner*)o)->ystep(v);}
inline void fl_set_positioner_return(Fl_Widget* o, int v) {
((Fl_Positioner*)o)->when((Fl_When)(v|FL_WHEN_RELEASE));}

#include "Fl_Slider.H"

#define FL_HOR_BROWSER_SLIDER FL_HOR_SLIDER
#define FL_VERT_BROWSER_SLIDER FL_VERT_SLIDER

forms_constructort(Fl_Slider, fl_add_slider)
#define FL_SLIDER_COL1 FL_GRAY
inline void fl_set_slider_value(Fl_Widget* o, double v) {
((Fl_Slider*)o)->value(v);}
inline double fl_get_slider_value(Fl_Widget* o) {
return ((Fl_Slider*)o)->value();}
inline void fl_set_slider_bounds(Fl_Widget* o, double a, double b) {
((Fl_Slider*)o)->bounds(a, b);}
inline void fl_get_slider_bounds(Fl_Widget* o, float* a, float* b) {
*a = float(((Fl_Slider*)o)->minimum());
*b = float(((Fl_Slider*)o)->maximum());
}
inline void fl_set_slider_return(Fl_Widget* o, int i) {
((Fl_Slider*)o)->when((Fl_When)(i|FL_WHEN_RELEASE));}
inline void fl_set_slider_step(Fl_Widget* o, double v) {
((Fl_Slider*)o)->step(v);}
// inline void fl_set_slider_increment(Fl_Widget* o, double v, double);
inline void fl_set_slider_size(Fl_Widget* o, double v) {
((Fl_Slider*)o)->slider_size(v);}

#include "Fl_Value_Slider.H"
forms_constructor(Fl_Value_Slider, fl_add_valslider)

inline void fl_set_slider_precision(Fl_Widget* o, int i) {
((Fl_Value_Slider*)o)->precision(i);}
// filter function!

// The forms text object was the same as an Fl_Box except it inverted the
// meaning of FL_ALIGN_INSIDE. Implementation in forms.cxx
class FL_EXPORT Fl_FormsText : public Fl_Widget {
protected:
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);}
};
#define FL_NORMAL_TEXT FL_NO_BOX
forms_constructorb(Fl_FormsText, fl_add_text)

#include "Fl_Timer.H"
forms_constructort(Fl_Timer, fl_add_timer)
inline void fl_set_timer(Fl_Widget* o, double v) {((Fl_Timer*)o)->value(v);}
inline double fl_get_timer(Fl_Widget* o) {return ((Fl_Timer*)o)->value();}
inline void fl_suspend_timer(Fl_Widget* o) {((Fl_Timer*)o)->suspended(1);}
inline void fl_resume_timer(Fl_Widget* o) {((Fl_Timer*)o)->suspended(0);}
inline void fl_set_timer_countup(Fl_Widget* o,char d) {((Fl_Timer*)o)->direction(d);}
void fl_gettime(long* sec, long* usec);

// Fl_XYPlot nyi


// stuff from DDForms:

inline int fl_double_click() {return Fl::event_clicks();}
inline void fl_draw() {Fl::flush();}

#endif /* define __FORMS_H__ */

//
// End of "$Id: forms.H 8623 2011-04-24 17:09:41Z AlbrechtS $".
//

+ 2
- 16
configure View File

@@ -2497,19 +2497,16 @@ fi
esac

LINKFLTK="../lib/libntk.a"
LINKFLTKFORMS="../lib/libntk_forms.a"
LINKFLTKGL="../lib/libntk_gl.a"
LINKFLTKIMG="../lib/libntk_images.a"
GLDEMOS="gldemos"

LIBEXT=".a"
LIBNAME="../lib/libntk.a"
FLLIBNAME="../lib/libntk_forms.a"
GLLIBNAME="../lib/libntk_gl.a"
IMGLIBNAME="../lib/libntk_images.a"

LIBBASENAME="libntk.a"
FLLIBBASENAME="libntk_forms.a"
GLLIBBASENAME="libntk_gl.a"
IMGLIBBASENAME="libntk_images.a"

@@ -2617,7 +2614,6 @@ if test x$enable_shared = xyes; then
case $uname in
Darwin*)
DSONAME="libntk.$FL_API_VERSION.dylib"
FLDSONAME="libntk_forms.$FL_API_VERSION.dylib"
GLDSONAME="libntk_gl.$FL_API_VERSION.dylib"
IMGDSONAME="libntk_images.$FL_API_VERSION.dylib"
DSOCOMMAND="\$(CXX) \$(ARCHFLAGS) \$(DSOFLAGS) -dynamiclib -lc -o"
@@ -2625,7 +2621,6 @@ if test x$enable_shared = xyes; then

SunOS* | UNIX_S*)
DSONAME="libntk.so.$FL_API_VERSION"
FLDSONAME="libntk_forms.so.$FL_API_VERSION"
GLDSONAME="libntk_gl.so.$FL_API_VERSION"
IMGDSONAME="libntk_images.so.$FL_API_VERSION"
DSOCOMMAND="\$(CXX) \$(DSOFLAGS) -h \$@ \$(LDLIBS) -G $DEBUGFLAG -o"
@@ -2635,7 +2630,6 @@ if test x$enable_shared = xyes; then
;;
HP-UX*)
DSONAME="libntk.sl.$FL_API_VERSION"
FLDSONAME="libntk_forms.sl.$FL_API_VERSION"
GLDSONAME="libntk_gl.sl.$FL_API_VERSION"
IMGDSONAME="libntk_images.sl.$FL_API_VERSION"
DSOCOMMAND="ld \$(DSOFLAGS) -b -z +h \$@ $DEBUGFLAG -o"
@@ -2645,7 +2639,6 @@ if test x$enable_shared = xyes; then
;;
IRIX*)
DSONAME="libntk.so.$FL_API_VERSION"
FLDSONAME="libntk_forms.so.$FL_API_VERSION"
GLDSONAME="libntk_gl.so.$FL_API_VERSION"
IMGDSONAME="libntk_images.so.$FL_API_VERSION"
DSOCOMMAND="\$(CXX) \$(DSOFLAGS) -Wl,-soname,\$@,-set_version,sgi1.1 \$(LDLIBS) -shared $DEBUGFLAG -o"
@@ -2655,7 +2648,6 @@ if test x$enable_shared = xyes; then
;;
OSF1*)
DSONAME="libntk.so.$FL_API_VERSION"
FLDSONAME="libntk_forms.so.$FL_API_VERSION"
GLDSONAME="libntk_gl.so.$FL_API_VERSION"
IMGDSONAME="libntk_images.so.$FL_API_VERSION"
DSOCOMMAND="\$(CXX) \$(DSOFLAGS) -Wl,-soname,\$@ \$(LDLIBS) -shared $DEBUGFLAG -o"
@@ -2665,7 +2657,6 @@ if test x$enable_shared = xyes; then
;;
Linux* | *BSD*)
DSONAME="libntk.so.$FL_API_VERSION"
FLDSONAME="libntk_forms.so.$FL_API_VERSION"
GLDSONAME="libntk_gl.so.$FL_API_VERSION"
IMGDSONAME="libntk_images.so.$FL_API_VERSION"
DSOCOMMAND="\$(CXX) \$(DSOFLAGS) -Wl,-soname,\$@ \$(LDLIBS) -shared -fPIC $DEBUGFLAG -o"
@@ -2675,7 +2666,6 @@ if test x$enable_shared = xyes; then
;;
AIX*)
DSONAME="libntk_s.a"
FLDSONAME="libntk_forms_s.a"
GLDSONAME="libntk_gl_s.a"
IMGDSONAME="libntk_images_s.a"
DSOCOMMAND="\$(CXX) \$(DSOFLAGS) -Wl,-bexpall,-bM:SRE,-bnoentry -o"
@@ -2685,19 +2675,16 @@ if test x$enable_shared = xyes; then
PICFLAG=0
if test x$enable_cygwin != xyes; then
DSONAME="mgwntknox-$FL_API_VERSION.dll"
FLDSONAME="mgwntknox_forms-$FL_API_VERSION.dll"
GLDSONAME="mgwntknox_gl-$FL_API_VERSION.dll"
IMGDSONAME="mgwntknox_images-$FL_API_VERSION.dll"
CAIRODSONAME="mgwntknox_cairo-$FL_API_VERSION.dll"
else
if test x$enable_x11 = xyes; then
DSONAME="cygntk-$FL_API_VERSION.dll"
FLDSONAME="cygntk_forms-$FL_API_VERSION.dll"
GLDSONAME="cygntk_gl-$FL_API_VERSION.dll"
IMGDSONAME="cygntk_images-$FL_API_VERSION.dll"
else
DSONAME="cygntknox-$FL_API_VERSION.dll"
FLDSONAME="cygntknox_forms-$FL_API_VERSION.dll"
GLDSONAME="cygntknox_gl-$FL_API_VERSION.dll"
IMGDSONAME="cygntknox_images-$FL_API_VERSION.dll"
CAIRODSONAME="cygntknox_cairo-$FL_API_VERSION.dll"
@@ -2717,14 +2704,13 @@ if test x$enable_shared = xyes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Shared libraries may not be supported. Trying -shared option with compiler." >&5
$as_echo "$as_me: WARNING: Shared libraries may not be supported. Trying -shared option with compiler." >&2;}
DSONAME="libntk.so.$FL_API_VERSION"
FLDSONAME="libntk_forms.so.$FL_API_VERSION"
GLDSONAME="libntk_gl.so.$FL_API_VERSION"
IMGDSONAME="libntk_images.so.$FL_API_VERSION"
DSOCOMMAND="\$(CXX) \$(DSOFLAGS) -Wl,-soname,\$@ \$(LDLIBS) -shared $DEBUGFLAG -o"
;;
esac

LINKSHARED="-L../src $FLTKCAIROOPTION -lntk_images$SHAREDSUFFIX -lntk_forms$SHAREDSUFFIX -lntk$SHAREDSUFFIX"
LINKSHARED="-L../src $FLTKCAIROOPTION -lntk_images$SHAREDSUFFIX -lntk$SHAREDSUFFIX"
else
DSOCOMMAND="echo"
DSOLINK=""
@@ -2736,7 +2722,7 @@ else
PICFLAG=0
SHAREDSUFFIX=""
FLUID="fluid"
LINKSHARED="$LINKFLTKCAIRO ../lib/libntk_images.a ../lib/libntk_forms.a ../lib/libntk.a"
LINKSHARED="$LINKFLTKCAIRO ../lib/libntk_images.a ../lib/libntk.a"
fi




+ 2
- 16
configure.in View File

@@ -117,19 +117,16 @@ esac

dnl Define the libraries and link options we will need.
LINKFLTK="../lib/libntk.a"
LINKFLTKFORMS="../lib/libntk_forms.a"
LINKFLTKGL="../lib/libntk_gl.a"
LINKFLTKIMG="../lib/libntk_images.a"
GLDEMOS="gldemos"

LIBEXT=".a"
LIBNAME="../lib/libntk.a"
FLLIBNAME="../lib/libntk_forms.a"
GLLIBNAME="../lib/libntk_gl.a"
IMGLIBNAME="../lib/libntk_images.a"

LIBBASENAME="libntk.a"
FLLIBBASENAME="libntk_forms.a"
GLLIBBASENAME="libntk_gl.a"
IMGLIBBASENAME="libntk_images.a"

@@ -217,7 +214,6 @@ if test x$enable_shared = xyes; then
case $uname in
Darwin*)
DSONAME="libntk.$FL_API_VERSION.dylib"
FLDSONAME="libntk_forms.$FL_API_VERSION.dylib"
GLDSONAME="libntk_gl.$FL_API_VERSION.dylib"
IMGDSONAME="libntk_images.$FL_API_VERSION.dylib"
DSOCOMMAND="\$(CXX) \$(ARCHFLAGS) \$(DSOFLAGS) -dynamiclib -lc -o"
@@ -225,7 +221,6 @@ if test x$enable_shared = xyes; then

SunOS* | UNIX_S*)
DSONAME="libntk.so.$FL_API_VERSION"
FLDSONAME="libntk_forms.so.$FL_API_VERSION"
GLDSONAME="libntk_gl.so.$FL_API_VERSION"
IMGDSONAME="libntk_images.so.$FL_API_VERSION"
DSOCOMMAND="\$(CXX) \$(DSOFLAGS) -h \$@ \$(LDLIBS) -G $DEBUGFLAG -o"
@@ -235,7 +230,6 @@ if test x$enable_shared = xyes; then
;;
HP-UX*)
DSONAME="libntk.sl.$FL_API_VERSION"
FLDSONAME="libntk_forms.sl.$FL_API_VERSION"
GLDSONAME="libntk_gl.sl.$FL_API_VERSION"
IMGDSONAME="libntk_images.sl.$FL_API_VERSION"
DSOCOMMAND="ld \$(DSOFLAGS) -b -z +h \$@ $DEBUGFLAG -o"
@@ -245,7 +239,6 @@ if test x$enable_shared = xyes; then
;;
IRIX*)
DSONAME="libntk.so.$FL_API_VERSION"
FLDSONAME="libntk_forms.so.$FL_API_VERSION"
GLDSONAME="libntk_gl.so.$FL_API_VERSION"
IMGDSONAME="libntk_images.so.$FL_API_VERSION"
DSOCOMMAND="\$(CXX) \$(DSOFLAGS) -Wl,-soname,\$@,-set_version,sgi1.1 \$(LDLIBS) -shared $DEBUGFLAG -o"
@@ -255,7 +248,6 @@ if test x$enable_shared = xyes; then
;;
OSF1*)
DSONAME="libntk.so.$FL_API_VERSION"
FLDSONAME="libntk_forms.so.$FL_API_VERSION"
GLDSONAME="libntk_gl.so.$FL_API_VERSION"
IMGDSONAME="libntk_images.so.$FL_API_VERSION"
DSOCOMMAND="\$(CXX) \$(DSOFLAGS) -Wl,-soname,\$@ \$(LDLIBS) -shared $DEBUGFLAG -o"
@@ -265,7 +257,6 @@ if test x$enable_shared = xyes; then
;;
Linux* | *BSD*)
DSONAME="libntk.so.$FL_API_VERSION"
FLDSONAME="libntk_forms.so.$FL_API_VERSION"
GLDSONAME="libntk_gl.so.$FL_API_VERSION"
IMGDSONAME="libntk_images.so.$FL_API_VERSION"
DSOCOMMAND="\$(CXX) \$(DSOFLAGS) -Wl,-soname,\$@ \$(LDLIBS) -shared -fPIC $DEBUGFLAG -o"
@@ -275,7 +266,6 @@ if test x$enable_shared = xyes; then
;;
AIX*)
DSONAME="libntk_s.a"
FLDSONAME="libntk_forms_s.a"
GLDSONAME="libntk_gl_s.a"
IMGDSONAME="libntk_images_s.a"
DSOCOMMAND="\$(CXX) \$(DSOFLAGS) -Wl,-bexpall,-bM:SRE,-bnoentry -o"
@@ -285,19 +275,16 @@ if test x$enable_shared = xyes; then
PICFLAG=0
if test x$enable_cygwin != xyes; then
DSONAME="mgwntknox-$FL_API_VERSION.dll"
FLDSONAME="mgwntknox_forms-$FL_API_VERSION.dll"
GLDSONAME="mgwntknox_gl-$FL_API_VERSION.dll"
IMGDSONAME="mgwntknox_images-$FL_API_VERSION.dll"
CAIRODSONAME="mgwntknox_cairo-$FL_API_VERSION.dll"
else
if test x$enable_x11 = xyes; then
DSONAME="cygntk-$FL_API_VERSION.dll"
FLDSONAME="cygntk_forms-$FL_API_VERSION.dll"
GLDSONAME="cygntk_gl-$FL_API_VERSION.dll"
IMGDSONAME="cygntk_images-$FL_API_VERSION.dll"
else
DSONAME="cygntknox-$FL_API_VERSION.dll"
FLDSONAME="cygntknox_forms-$FL_API_VERSION.dll"
GLDSONAME="cygntknox_gl-$FL_API_VERSION.dll"
IMGDSONAME="cygntknox_images-$FL_API_VERSION.dll"
CAIRODSONAME="cygntknox_cairo-$FL_API_VERSION.dll"
@@ -316,14 +303,13 @@ if test x$enable_shared = xyes; then
*)
AC_MSG_WARN(Shared libraries may not be supported. Trying -shared option with compiler.)
DSONAME="libntk.so.$FL_API_VERSION"
FLDSONAME="libntk_forms.so.$FL_API_VERSION"
GLDSONAME="libntk_gl.so.$FL_API_VERSION"
IMGDSONAME="libntk_images.so.$FL_API_VERSION"
DSOCOMMAND="\$(CXX) \$(DSOFLAGS) -Wl,-soname,\$@ \$(LDLIBS) -shared $DEBUGFLAG -o"
;;
esac

LINKSHARED="-L../src $FLTKCAIROOPTION -lntk_images$SHAREDSUFFIX -lntk_forms$SHAREDSUFFIX -lntk$SHAREDSUFFIX"
LINKSHARED="-L../src $FLTKCAIROOPTION -lntk_images$SHAREDSUFFIX -lntk$SHAREDSUFFIX"
else
DSOCOMMAND="echo"
DSOLINK=""
@@ -335,7 +321,7 @@ else
PICFLAG=0
SHAREDSUFFIX=""
FLUID="fluid"
LINKSHARED="$LINKFLTKCAIRO ../lib/libntk_images.a ../lib/libntk_forms.a ../lib/libntk.a"
LINKSHARED="$LINKFLTKCAIRO ../lib/libntk_images.a ../lib/libntk.a"
fi

AC_SUBST(DSOCOMMAND)


+ 0
- 2
fluid/Fl_Type.cxx View File

@@ -904,8 +904,6 @@ void Fl_Type::read_property(const char *c) {
read_error("Unknown property \"%s\"", c);
}

int Fl_Type::read_fdesign(const char*, const char*) {return 0;}

/**
* Return 1 if the list contains a function with the given signature at the top level
*/


+ 0
- 3
fluid/Fl_Type.h View File

@@ -120,7 +120,6 @@ public:
void write();
virtual void write_properties();
virtual void read_property(const char *);
virtual int read_fdesign(const char*, const char*);

// write code, these are called in order:
virtual void write_static(); // write static stuff to .c file
@@ -392,7 +391,6 @@ public:

virtual void write_properties();
virtual void read_property(const char *);
virtual int read_fdesign(const char*, const char*);

virtual Fl_Widget *enter_live_mode(int top=0);
virtual void leave_live_mode();
@@ -583,7 +581,6 @@ public:

virtual void write_properties();
virtual void read_property(const char *);
virtual int read_fdesign(const char*, const char*);

void add_child(Fl_Type*, Fl_Type*);
void move_child(Fl_Type*, Fl_Type*);


+ 0
- 113
fluid/Fl_Widget_Type.cxx View File

@@ -2649,121 +2649,8 @@ void Fl_Widget_Type::read_property(const char *c) {
}
}

Fl_Menu_Item boxmenu1[] = {
// these extra ones are for looking up fdesign saved strings:
{"NO_FRAME", 0,0,(void *)FL_NO_BOX},
{"ROUNDED3D_UPBOX", 0,0,(void *)_FL_ROUND_UP_BOX},
{"ROUNDED3D_DOWNBOX", 0,0,(void *)_FL_ROUND_DOWN_BOX},
{"OVAL3D_UPBOX", 0,0,(void *)_FL_ROUND_UP_BOX},
{"OVAL3D_DOWNBOX", 0,0,(void *)_FL_ROUND_DOWN_BOX},
{"0", 0,0,(void *)ZERO_ENTRY},
{"1", 0,0,(void *)FL_UP_BOX},
{"2", 0,0,(void *)FL_DOWN_BOX},
{"3", 0,0,(void *)FL_FLAT_BOX},
{"4", 0,0,(void *)FL_BORDER_BOX},
{"5", 0,0,(void *)FL_SHADOW_BOX},
{"6", 0,0,(void *)FL_FRAME_BOX},
{"7", 0,0,(void *)FL_ROUNDED_BOX},
{"8", 0,0,(void *)FL_RFLAT_BOX},
{"9", 0,0,(void *)FL_RSHADOW_BOX},
{"10", 0,0,(void *)FL_UP_FRAME},
{"11", 0,0,(void *)FL_DOWN_FRAME},
{0}};

extern int fdesign_flip;
int lookup_symbol(const char *, int &, int numberok = 0);

int Fl_Widget_Type::read_fdesign(const char* propname, const char* value) {
int v;
if (!strcmp(propname,"box")) {
float x,y,w,h;
if (sscanf(value,"%f %f %f %f",&x,&y,&w,&h) == 4) {
if (fdesign_flip) {
Fl_Type *p;
for (p = parent; p && !p->is_window(); p = p->parent);
if (p && p->is_widget()) y = ((Fl_Widget_Type*)p)->o->h()-(y+h);
}
x += pasteoffset;
y += pasteoffset;
o->resize(int(x),int(y),int(w),int(h));
}
} else if (!strcmp(propname,"label")) {
label(value);
} else if (!strcmp(propname,"name")) {
this->name(value);
} else if (!strcmp(propname,"callback")) {
callback(value); user_data_type("long");
} else if (!strcmp(propname,"argument")) {
user_data(value);
} else if (!strcmp(propname,"shortcut")) {
if (value[0]) {
char buf[128]; sprintf(buf,"o->shortcut(\"%s\");",value);
extra_code(0,buf);
}
} else if (!strcmp(propname,"style")) {
if (!strncmp(value,"FL_NORMAL",9)) return 1;
if (!lookup_symbol(value,v,1)) return 0;
o->labelfont(v); o->labeltype((Fl_Labeltype)(v>>8));
} else if (!strcmp(propname,"size")) {
if (!lookup_symbol(value,v,1)) return 0;
o->labelsize(v);
} else if (!strcmp(propname,"type")) {
if (!strncmp(value,"NORMAL",6)) return 1;
if (lookup_symbol(value,v,1)) {o->type(v); return 1;}
if (!strcmp(value+strlen(value)-5,"FRAME")) goto TRY_BOXTYPE;
if (!strcmp(value+strlen(value)-3,"BOX")) goto TRY_BOXTYPE;
return 0;
} else if (!strcmp(propname,"lcol")) {
if (!lookup_symbol(value,v,1)) return 0;
o->labelcolor(v);
} else if (!strcmp(propname,"return")) {
if (!lookup_symbol(value,v,0)) return 0;
o->when(v|FL_WHEN_RELEASE);
} else if (!strcmp(propname,"alignment")) {
if (!lookup_symbol(value,v)) {
// convert old numeric values:
int v1 = atoi(value); if (v1 <= 0 && strcmp(value,"0")) return 0;
v = 0;
if (v1 >= 5) {v = FL_ALIGN_INSIDE; v1 -= 5;}
switch (v1) {
case 0: v += FL_ALIGN_TOP; break;
case 1: v += FL_ALIGN_BOTTOM; break;
case 2: v += FL_ALIGN_LEFT; break;
case 3: v += FL_ALIGN_RIGHT; break;
case 4: v += FL_ALIGN_CENTER; break;
default: return 0;
}
}
o->align(v);
} else if (!strcmp(propname,"resizebox")) {
resizable(1);
} else if (!strcmp(propname,"colors")) {
char* p = (char*)value;
while (*p != ' ') {if (!*p) return 0; p++;}
*p = 0;
int v1;
if (!lookup_symbol(value,v,1) || !lookup_symbol(p+1,v1,1)) {
*p=' '; return 0;}
o->color(v,v1);
} else if (!strcmp(propname,"resize")) {
return !strcmp(value,"FL_RESIZE_ALL");
} else if (!strcmp(propname,"gravity")) {
return !strcmp(value,"FL_NoGravity FL_NoGravity");
} else if (!strcmp(propname,"boxtype")) {
TRY_BOXTYPE:
int x = boxnumber(value);
if (!x) {x = item_number(boxmenu1, value); if (x < 0) return 0;}
if (x == ZERO_ENTRY) {
x = 0;
if (o->box() != ((Fl_Widget_Type*)factory)->o->box()) return 1; // kludge for frame
}
o->box((Fl_Boxtype)x);
} else {
return 0;
}
return 1;
}

void leave_live_mode_cb(Fl_Widget*, void*) {
live_mode_cb(0, 0);
}


+ 0
- 19
fluid/Fl_Window_Type.cxx View File

@@ -1419,25 +1419,6 @@ void Fl_Window_Type::read_property(const char *c) {
}
}

int Fl_Window_Type::read_fdesign(const char* propname, const char* value) {
int x;
o->box(FL_NO_BOX); // because fdesign always puts an Fl_Box next
if (!strcmp(propname,"Width")) {
if (sscanf(value,"%d",&x) == 1) o->size(x,o->h());
} else if (!strcmp(propname,"Height")) {
if (sscanf(value,"%d",&x) == 1) o->size(o->w(),x);
} else if (!strcmp(propname,"NumberofWidgets")) {
return 1; // we can figure out count from file
} else if (!strcmp(propname,"border")) {
if (sscanf(value,"%d",&x) == 1) ((Fl_Window*)o)->border(x);
} else if (!strcmp(propname,"title")) {
label(value);
} else {
return Fl_Widget_Type::read_fdesign(propname,value);
}
return 1;
}

///////////////////////////////////////////////////////////////////////

Fl_Widget_Class_Type Fl_Widget_Class_type;


+ 0
- 139
fluid/factory.cxx View File

@@ -1134,145 +1134,6 @@ Fl_Type *Fl_Type_make(const char *tn) {
return r;
}

////////////////////////////////////////////////////////////////

// Since I have included all the .H files, do this table here:
// This table is only used to read fdesign files:

struct symbol {const char *name; int value;};

static symbol table[] = {
{"BLACK", FL_BLACK},
{"RED", FL_RED},
{"GREEN", FL_GREEN},
{"YELLOW", FL_YELLOW},
{"BLUE", FL_BLUE},
{"MAGENTA", FL_MAGENTA},
{"CYAN", FL_CYAN},
{"WHITE", FL_WHITE},

{"LCOL", FL_BLACK},
{"COL1", FL_GRAY},
{"MCOL", FL_LIGHT1},
{"LEFT_BCOL", FL_LIGHT3},
{"TOP_BCOL", FL_LIGHT2},
{"BOTTOM_BCOL", FL_DARK2},
{"RIGHT_BCOL", FL_DARK3},
{"INACTIVE", FL_INACTIVE_COLOR},
{"INACTIVE_COL", FL_INACTIVE_COLOR},
{"FREE_COL1", FL_FREE_COLOR},
{"FREE_COL2", FL_FREE_COLOR+1},
{"FREE_COL3", FL_FREE_COLOR+2},
{"FREE_COL4", FL_FREE_COLOR+3},
{"FREE_COL5", FL_FREE_COLOR+4},
{"FREE_COL6", FL_FREE_COLOR+5},
{"FREE_COL7", FL_FREE_COLOR+6},
{"FREE_COL8", FL_FREE_COLOR+7},
{"FREE_COL9", FL_FREE_COLOR+8},
{"FREE_COL10", FL_FREE_COLOR+9},
{"FREE_COL11", FL_FREE_COLOR+10},
{"FREE_COL12", FL_FREE_COLOR+11},
{"FREE_COL13", FL_FREE_COLOR+12},
{"FREE_COL14", FL_FREE_COLOR+13},
{"FREE_COL15", FL_FREE_COLOR+14},
{"FREE_COL16", FL_FREE_COLOR+15},
{"TOMATO", 131},
{"INDIANRED", 164},
{"SLATEBLUE", 195},
{"DARKGOLD", 84},
{"PALEGREEN", 157},
{"ORCHID", 203},
{"DARKCYAN", 189},
{"DARKTOMATO", 113},
{"WHEAT", 174},
{"ALIGN_CENTER", FL_ALIGN_CENTER},
{"ALIGN_TOP", FL_ALIGN_TOP},
{"ALIGN_BOTTOM", FL_ALIGN_BOTTOM},
{"ALIGN_LEFT", FL_ALIGN_LEFT},
{"ALIGN_RIGHT", FL_ALIGN_RIGHT},
{"ALIGN_INSIDE", FL_ALIGN_INSIDE},
{"ALIGN_TOP_LEFT", FL_ALIGN_TOP | FL_ALIGN_LEFT},
{"ALIGN_TOP_RIGHT", FL_ALIGN_TOP | FL_ALIGN_RIGHT},
{"ALIGN_BOTTOM_LEFT", FL_ALIGN_BOTTOM | FL_ALIGN_LEFT},
{"ALIGN_BOTTOM_RIGHT", FL_ALIGN_BOTTOM | FL_ALIGN_RIGHT},
{"ALIGN_CENTER|FL_ALIGN_INSIDE", FL_ALIGN_CENTER|FL_ALIGN_INSIDE},
{"ALIGN_TOP|FL_ALIGN_INSIDE", FL_ALIGN_TOP|FL_ALIGN_INSIDE},
{"ALIGN_BOTTOM|FL_ALIGN_INSIDE", FL_ALIGN_BOTTOM|FL_ALIGN_INSIDE},
{"ALIGN_LEFT|FL_ALIGN_INSIDE", FL_ALIGN_LEFT|FL_ALIGN_INSIDE},
{"ALIGN_RIGHT|FL_ALIGN_INSIDE", FL_ALIGN_RIGHT|FL_ALIGN_INSIDE},
{"ALIGN_INSIDE|FL_ALIGN_INSIDE", FL_ALIGN_INSIDE|FL_ALIGN_INSIDE},
{"ALIGN_TOP_LEFT|FL_ALIGN_INSIDE", FL_ALIGN_TOP|FL_ALIGN_LEFT|FL_ALIGN_INSIDE},
{"ALIGN_TOP_RIGHT|FL_ALIGN_INSIDE", FL_ALIGN_TOP|FL_ALIGN_RIGHT|FL_ALIGN_INSIDE},
{"ALIGN_BOTTOM_LEFT|FL_ALIGN_INSIDE", FL_ALIGN_BOTTOM|FL_ALIGN_LEFT|FL_ALIGN_INSIDE},
{"ALIGN_BOTTOM_RIGHT|FL_ALIGN_INSIDE",FL_ALIGN_BOTTOM|FL_ALIGN_RIGHT|FL_ALIGN_INSIDE},

{"ALIGN_LEFT_TOP", FL_ALIGN_TOP | FL_ALIGN_LEFT},
{"ALIGN_RIGHT_TOP", FL_ALIGN_TOP | FL_ALIGN_RIGHT},
{"ALIGN_LEFT_BOTTOM", FL_ALIGN_BOTTOM | FL_ALIGN_LEFT},
{"ALIGN_RIGHT_BOTTOM", FL_ALIGN_BOTTOM | FL_ALIGN_RIGHT},
{"INVALID_STYLE", 255},
{"NORMAL_STYLE", FL_HELVETICA},
{"BOLD_STYLE", FL_HELVETICA|FL_BOLD},
{"ITALIC_STYLE", FL_HELVETICA|FL_ITALIC},
{"BOLDITALIC_STYLE", FL_HELVETICA|FL_BOLD|FL_ITALIC},
{"FIXED_STYLE", FL_COURIER},
{"FIXEDBOLD_STYLE", FL_COURIER|FL_BOLD},
{"FIXEDITALIC_STYLE", FL_COURIER|FL_ITALIC},
{"FIXEDBOLDITALIC_STYLE", FL_COURIER|FL_BOLD|FL_ITALIC},
{"TIMES_STYLE", FL_TIMES},
{"TIMESBOLD_STYLE", FL_TIMES|FL_BOLD},
{"TIMESITALIC_STYLE", FL_TIMES|FL_ITALIC},
{"TIMESBOLDITALIC_STYLE", FL_TIMES|FL_BOLD|FL_ITALIC},
{"SHADOW_STYLE", (_FL_SHADOW_LABEL<<8)},
{"ENGRAVED_STYLE", (_FL_ENGRAVED_LABEL<<8)},
{"EMBOSSED_STYLE", (_FL_EMBOSSED_LABEL<<0)},
{"TINY_SIZE", 8},
{"SMALL_SIZE", 11},
{"NORMAL_SIZE", FL_NORMAL_SIZE},
{"MEDIUM_SIZE", 18},
{"LARGE_SIZE", 24},
{"HUGE_SIZE", 32},
{"DEFAULT_SIZE", FL_NORMAL_SIZE},
{"TINY_FONT", 8},
{"SMALL_FONT", 11},
{"NORMAL_FONT", FL_NORMAL_SIZE},
{"MEDIUM_FONT", 18},
{"LARGE_FONT", 24},
{"HUGE_FONT", 32},
{"NORMAL_FONT1", 11},
{"NORMAL_FONT2", FL_NORMAL_SIZE},
{"DEFAULT_FONT", 11},
{"RETURN_END_CHANGED", 0},
{"RETURN_CHANGED", 1},
{"RETURN_END", 2},
{"RETURN_ALWAYS", 3},
{"PUSH_BUTTON", FL_TOGGLE_BUTTON},
{"RADIO_BUTTON", FL_RADIO_BUTTON},
{"HIDDEN_BUTTON", FL_HIDDEN_BUTTON},
{"SELECT_BROWSER", FL_SELECT_BROWSER},
{"HOLD_BROWSER", FL_HOLD_BROWSER},
{"MULTI_BROWSER", FL_MULTI_BROWSER},
{"SIMPLE_COUNTER", FL_SIMPLE_COUNTER},
{"LINE_DIAL", FL_LINE_DIAL},
{"FILL_DIAL", FL_FILL_DIAL},
{"VERT_SLIDER", FL_VERT_SLIDER},
{"HOR_SLIDER", FL_HOR_SLIDER},
{"VERT_FILL_SLIDER", FL_VERT_FILL_SLIDER},
{"HOR_FILL_SLIDER", FL_HOR_FILL_SLIDER},
{"VERT_NICE_SLIDER", FL_VERT_NICE_SLIDER},
{"HOR_NICE_SLIDER", FL_HOR_NICE_SLIDER},
};

#include <stdlib.h>

int lookup_symbol(const char *name, int &v, int numberok) {
if (name[0]=='F' && name[1]=='L' && name[2]=='_') name += 3;
for (int i=0; i < int(sizeof(table)/sizeof(*table)); i++)
if (!strcasecmp(name,table[i].name)) {v = table[i].value; return 1;}
if (numberok && ((v = atoi(name)) || !strcmp(name,"0"))) return 1;
return 0;
}

//
// End of "$Id: factory.cxx 8172 2011-01-03 08:28:38Z matt $".
//

+ 0
- 139
fluid/file.cxx View File

@@ -358,8 +358,6 @@ int write_file(const char *filename, int selected_only) {
////////////////////////////////////////////////////////////////
// read all the objects out of the input file:

void read_fdesign();

double read_version;

extern Fl_Type *Fl_Type_make(const char *tn);
@@ -379,12 +377,6 @@ static void read_children(Fl_Type *p, int paste) {
break;
}

// this is the first word in a .fd file:
if (!strcmp(c,"Magic:")) {
read_fdesign();
return;
}

if (!strcmp(c,"version")) {
c = read_word();
read_version = strtod(c,0);
@@ -514,137 +506,6 @@ int read_file(const char *filename, int merge) {
return close_read();
}

////////////////////////////////////////////////////////////////
// Read Forms and XForms fdesign files:

int read_fdesign_line(const char*& name, const char*& value) {

int length = 0;
int x;
// find a colon:
for (;;) {
x = getc(fin);
if (x < 0 && feof(fin)) return 0;
if (x == '\n') {length = 0; continue;} // no colon this line...
if (!isspace(x & 255)) {
buffer[length++] = x;
expand_buffer(length);
}
if (x == ':') break;
}
int valueoffset = length;
buffer[length-1] = 0;

// skip to start of value:
for (;;) {
x = getc(fin);
if ((x < 0 && feof(fin)) || x == '\n' || !isspace(x & 255)) break;
}

// read the value:
for (;;) {
if (x == '\\') {x = read_quoted(); if (x<0) continue;}
else if (x == '\n') break;
buffer[length++] = x;
expand_buffer(length);
x = getc(fin);
}
buffer[length] = 0;
name = buffer;
value = buffer+valueoffset;
return 1;
}

int fdesign_flip;
int fdesign_magic;
#include <FL/Fl_Group.H>

static const char *class_matcher[] = {
"FL_CHECKBUTTON", "Fl_Check_Button",
"FL_ROUNDBUTTON", "Fl_Round_Button",
"FL_ROUND3DBUTTON", "Fl_Round_Button",
"FL_LIGHTBUTTON", "Fl_Light_Button",
"FL_FRAME", "Fl_Box",
"FL_LABELFRAME", "Fl_Box",
"FL_TEXT", "Fl_Box",
"FL_VALSLIDER", "Fl_Value_Slider",
"FL_MENU", "Fl_Menu_Button",
"3", "FL_BITMAP",
"1", "FL_BOX",
"71","FL_BROWSER",
"11","FL_BUTTON",
"4", "FL_CHART",
"42","FL_CHOICE",
"61","FL_CLOCK",
"25","FL_COUNTER",
"22","FL_DIAL",
"101","FL_FREE",
"31","FL_INPUT",
"12","Fl_Light_Button",
"41","FL_MENU",
"23","FL_POSITIONER",
"13","Fl_Round_Button",
"21","FL_SLIDER",
"2", "FL_BOX", // was FL_TEXT
"62","FL_TIMER",
"24","Fl_Value_Slider",
0};

void read_fdesign() {
fdesign_magic = atoi(read_word());
fdesign_flip = (fdesign_magic < 13000);
Fl_Widget_Type *window = 0;
Fl_Widget_Type *group = 0;
Fl_Widget_Type *widget = 0;
if (!Fl_Type::current) {
Fl_Type *t = Fl_Type_make("Function");
t->name("create_the_forms()");
Fl_Type::current = t;
}
for (;;) {
const char *name;
const char *value;
if (!read_fdesign_line(name, value)) break;

if (!strcmp(name,"Name")) {

window = (Fl_Widget_Type*)Fl_Type_make("Fl_Window");
window->name(value);
window->label(value);
Fl_Type::current = widget = window;

} else if (!strcmp(name,"class")) {

if (!strcmp(value,"FL_BEGIN_GROUP")) {
group = widget = (Fl_Widget_Type*)Fl_Type_make("Fl_Group");
Fl_Type::current = group;
} else if (!strcmp(value,"FL_END_GROUP")) {
if (group) {
Fl_Group* g = (Fl_Group*)(group->o);
g->begin();
g->forms_end();
Fl_Group::current(0);
}
group = widget = 0;
Fl_Type::current = window;
} else {
for (int i = 0; class_matcher[i]; i += 2)
if (!strcmp(value,class_matcher[i])) {
value = class_matcher[i+1]; break;}
widget = (Fl_Widget_Type*)Fl_Type_make(value);
if (!widget) {
printf("class %s not found, using Fl_Button\n", value);
widget = (Fl_Widget_Type*)Fl_Type_make("Fl_Button");
}
}

} else if (widget) {
if (!widget->read_fdesign(name, value))
printf("Ignoring \"%s: %s\"\n", name, value);
}
}
}

//
// End of "$Id: file.cxx 7903 2010-11-28 21:06:39Z matt $".
//

+ 0
- 12
ntk-config.in View File

@@ -105,7 +105,6 @@ Options telling what we are doing:
[--use-gl] use GL
[--use-images] use extra image formats (PNG, JPEG)
[--use-glut] use glut compatibility layer
[--use-forms] use forms compatibility layer
[--use-cairo] use cairo graphics lib

Options telling what information we request:
@@ -170,9 +169,6 @@ do
--use-gl | --use-glut)
use_gl=yes
;;
--use-forms)
use_forms=yes
;;
--use-images)
use_images=yes
;;
@@ -237,10 +233,6 @@ fi
LDSTATIC="$libdir/libntk.a $LDLIBS"
LDLIBS="-lntk$SHAREDSUFFIX $LDLIBS"

if test x$use_forms = xyes; then
LDLIBS="-lntk_forms$SHAREDSUFFIX $LDLIBS"
LDSTATIC="$libdir/libntk_forms.a $LDSTATIC"
fi
if test x$use_gl = xyes; then
LDLIBS="-lntk_gl$SHAREDSUFFIX @GLLIB@ $LDLIBS"
LDSTATIC="$libdir/libntk_gl.a @GLLIB@ $LDSTATIC"
@@ -363,10 +355,6 @@ fi
if test "$echo_libs" = "yes"; then
USELIBS="$libdir/libntk.a"

if test x$use_forms = xyes; then
USELIBS="$libdir/libntk_forms.a $USELIBS"
fi

if test x$use_gl = xyes; then
USELIBS="$libdir/libntk_gl.a $USELIBS"
fi


+ 0
- 20
ntk.list.in View File

@@ -74,16 +74,6 @@ f 0555 root sys $libdir/libntk.@FL_API_VERSION@.dylib src/libntk.@FL_API_VERSION
f 0555 root sys $libdir/libntk.so.@FL_API_VERSION@ src/libntk.so.@FL_API_VERSION@ nostrip()
%system all

%system aix
f 0555 root sys $libdir/libntk_forms_s.a src/libntk_forms_s.a nostrip()
%system hpux
f 0555 root sys $libdir/libntk_forms.sl.@FL_API_VERSION@ src/libntk_forms.sl.@FL_API_VERSION@ nostrip()
%system darwin
f 0555 root sys $libdir/libntk_forms.@FL_API_VERSION@.dylib src/libntk_forms.@FL_API_VERSION@.dylib nostrip()
%system !aix !darwin !hpux
f 0555 root sys $libdir/libntk_forms.so.@FL_API_VERSION@ src/libntk_forms.so.@FL_API_VERSION@ nostrip()
%system all

%system aix
f 0555 root sys $libdir/libntk_images_s.a src/libntk_images_s.a nostrip()
%system hpux
@@ -151,7 +141,6 @@ f 0444 root sys $mandir/man3/ntk.3 documentation/src/ntk.man

# Library files
f 0444 root sys $libdir/libntk.a lib/libntk.a
f 0444 root sys $libdir/libntk_forms.a lib/libntk_forms.a
f 0444 root sys $libdir/libntk_images.a lib/libntk_images.a
%if GLLIBNAME
f 0444 root sys $libdir/libntk_gl.a lib/libntk_gl.a
@@ -178,14 +167,6 @@ l 0000 root sys $libdir/libntk.dylib libntk.@FL_API_VERSION@.dylib
l 0000 root sys $libdir/libntk.so libntk.so.@FL_API_VERSION@
%system all

%system hpux
l 0000 root sys $libdir/libntk_forms.sl libntk_forms.sl.@FL_API_VERSION@
%system darwin
l 0000 root sys $libdir/libntk_forms.dylib libntk_forms.@FL_API_VERSION@.dylib
%system !aix !darwin !hpux
l 0000 root sys $libdir/libntk_forms.so libntk_forms.so.@FL_API_VERSION@
%system all

%system hpux
l 0000 root sys $libdir/libntk_images.sl libntk_images.sl.@FL_API_VERSION@
%system darwin
@@ -355,7 +336,6 @@ l 0000 root sys $includedir/FL/fl_draw.h fl_draw.H
l 0000 root sys $includedir/FL/fl_message.h fl_message.H
l 0000 root sys $includedir/FL/fl_show_colormap.h fl_show_colormap.H
l 0000 root sys $includedir/FL/fl_show_input.h fl_show_input.H
l 0000 root sys $includedir/FL/forms.h forms.H
l 0000 root sys $includedir/FL/gl_draw.h gl_draw.H
l 0000 root sys $includedir/FL/glut.h glut.H
l 0000 root sys $includedir/FL/mac.h mac.H


+ 3
- 114
src/Makefile View File

@@ -179,14 +179,6 @@ OBJCPPFILES = \
Fl_Quartz_Printer.mm \
Fl_Native_File_Chooser_MAC.mm
FLCPPFILES = \
forms_compatability.cxx \
forms_bitmap.cxx \
forms_free.cxx \
forms_fselect.cxx \
forms_pixmap.cxx \
forms_timer.cxx

GLCPPFILES = \
Fl_Gl_Choice.cxx \
Fl_Gl_Overlay.cxx \
@@ -281,36 +273,6 @@ $(FLLIBNAME): $(FLOBJECTS)
$(LIBCOMMAND) $@ $(FLOBJECTS)
$(RANLIB) $@

libntk_forms.so.1.3: $(FLOBJECTS) libntk.so.1.3
echo $(DSOCOMMAND) $@ ...
$(DSOCOMMAND) $@ $(FLOBJECTS) -L. -lntk
$(RM) libntk_forms.so
$(LN) libntk_forms.so.1.3 libntk_forms.so

libntk_forms.sl.1.3: $(FLOBJECTS) libntk.sl.1.3
echo $(DSOCOMMAND) $@ ...
$(DSOCOMMAND) $@ $(FLOBJECTS) -L. -lntk
$(RM) libntk_forms.sl
$(LN) libntk_forms.sl.1.3 libntk_forms.sl

libntk_forms.1.3.dylib: $(FLOBJECTS) libntk.1.3.dylib
echo $(DSOCOMMAND) $@ ...
$(DSOCOMMAND) $@ \
-install_name $(libdir)/$@ \
-current_version 1.3.0 \
-compatibility_version 1.3.0 \
$(FLOBJECTS) -L. $(LDLIBS) -lntk
$(RM) libntk_forms.dylib
$(LN) libntk_forms.1.3.dylib libntk_forms.dylib

libntk_forms_s.a: $(FLOBJECTS)
echo $(DSOCOMMAND) libntk_forms_s.o ...
$(DSOCOMMAND) libntk_forms_s.o $(FLOBJECTS)
echo $(LIBCOMMAND) libntk_forms_s.a libntk_forms_s.o
$(RM) $@
$(LIBCOMMAND) libntk_forms_s.a libntk_forms_s.o
$(CHMOD) +x libntk_forms_s.a

$(GLLIBNAME): $(GLOBJECTS)
echo $(LIBCOMMAND) $@ ...
$(RM) $@
@@ -400,12 +362,6 @@ cygntknox-1.3.dll: $(LIBNAME)
$(DSOCOMMAND) $(LIBNAME) -Wl,--no-whole-archive \
-Wl,--out-implib=libntk.dll.a $(LDLIBS)

cygntknox_forms-1.3.dll: $(FLLIBNAME) cygntknox-1.3.dll
echo $(DSOCOMMAND) $(FLLIBNAME) ...
$(DSOCOMMAND) $(FLLIBNAME) -Wl,--no-whole-archive \
-Wl,--out-implib=libntk_forms.dll.a \
-L. -lntk $(LDLIBS)

cygntknox_gl-1.3.dll: $(GLLIBNAME) cygntknox-1.3.dll
echo $(DSOCOMMAND) $(GLLIBNAME) ...
$(DSOCOMMAND) $(GLLIBNAME) -Wl,--no-whole-archive \
@@ -428,12 +384,6 @@ cygntk-1.3.dll: $(LIBNAME)
$(DSOCOMMAND) $(LIBNAME) -Wl,--no-whole-archive \
-Wl,--out-implib=libntk.dll.a $(LDLIBS)

cygntk_forms-1.3.dll: $(FLLIBNAME) cygntk-1.3.dll
echo $(DSOCOMMAND) $(FLLIBNAME) ...
$(DSOCOMMAND) $(FLLIBNAME) -Wl,--no-whole-archive \
-Wl,--out-implib=libntk_forms.dll.a \
-L. -lntk $(LDLIBS)

cygntk_gl-1.3.dll: $(GLLIBNAME) cygntk-1.3.dll
echo $(DSOCOMMAND) $(GLLIBNAME) ...
$(DSOCOMMAND) $(GLLIBNAME) -Wl,--no-whole-archive \
@@ -452,12 +402,6 @@ mgwntknox-1.3.dll: $(LIBNAME)
$(DSOCOMMAND) $(LIBNAME) -Wl,--no-whole-archive \
-Wl,--out-implib=libntk.dll.a $(LDLIBS)

mgwntknox_forms-1.3.dll: $(FLLIBNAME) mgwntknox-1.3.dll
echo $(DSOCOMMAND) $(FLLIBNAME) ...
$(DSOCOMMAND) $(FLLIBNAME) -Wl,--no-whole-archive \
-Wl,--out-implib=libntk_forms.dll.a \
-L. -lntk $(LDLIBS)

mgwntknox_gl-1.3.dll: $(GLLIBNAME) mgwntknox-1.3.dll
echo $(DSOCOMMAND) $(GLLIBNAME) ...
$(DSOCOMMAND) $(GLLIBNAME) -Wl,--no-whole-archive \
@@ -480,9 +424,9 @@ clean:
-$(RM) $(DSONAME) $(FLDSONAME) $(GLDSONAME) $(IMGDSONAME) \
$(LIBNAME) $(FLLIBNAME) $(GLLIBNAME) \
$(IMGLIBNAME) \
libntk.so libntk_forms.so libntk_gl.so libntk_images.so \
libntk.sl libntk_forms.sl libntk_gl.sl libntk_images.sl \
libntk.dylib libntk_forms.dylib \
libntk.so libntk_gl.so libntk_images.so \
libntk.sl libntk_gl.sl libntk_images.sl \
libntk.dylib \
libntk_gl.dylib libntk_images.dylib \
cmap core

@@ -610,37 +554,6 @@ install: $(LIBNAME) $(DSONAME) \
$(RM) $(DESTDIR)$(libdir)/libntk.dll.a;\
$(INSTALL_LIB) libntk.dll.a $(DESTDIR)$(libdir); \
fi
if test x$(FLDSONAME) = xlibntk_forms.so.1.3; then\
$(RM) $(DESTDIR)$(libdir)/libntk_forms.so*;\
$(INSTALL_LIB) libntk_forms.so.1.3 $(DESTDIR)$(libdir); \
$(LN) libntk_forms.so.1.3 $(DESTDIR)$(libdir)/libntk_forms.so;\
fi
if test x$(FLDSONAME) = xlibntk_forms.sl.1.3; then\
$(RM) $(DESTDIR)$(libdir)/libntk_forms.sl*;\
$(INSTALL_LIB) libntk_forms.sl.1.3 $(DESTDIR)$(libdir); \
$(LN) libntk_forms.sl.1.3 $(DESTDIR)$(libdir)/libntk_forms.sl;\
fi
if test x$(FLDSONAME) = xlibntk_forms.1.3.dylib; then\
$(RM) $(DESTDIR)$(libdir)/libntk_forms.*dylib;\
$(INSTALL_LIB) libntk_forms.1.3.dylib $(DESTDIR)$(libdir); \
$(LN) libntk_forms.1.3.dylib $(DESTDIR)$(libdir)/libntk_forms.dylib;\
fi
if test x$(FLDSONAME) = xlibntk_forms_s.a; then\
$(RM) $(DESTDIR)$(libdir)/libntk_forms_s.a;\
$(INSTALL_LIB) libntk_forms_s.a $(DESTDIR)$(libdir); \
fi
if test x$(FLDSONAME) = xcygntknox_forms-1.3.dll; then\
$(RM) $(DESTDIR)$(bindir)/$(FLDSONAME);\
$(INSTALL_LIB) $(FLDSONAME) $(DESTDIR)$(bindir); \
$(RM) $(DESTDIR)$(libdir)/libntk_forms.dll.a;\
$(INSTALL_LIB) libntk_forms.dll.a $(DESTDIR)$(libdir); \
fi
if test x$(FLDSONAME) = xmgwntknox_forms-1.3.dll; then\
$(RM) $(DESTDIR)$(bindir)/$(FLDSONAME);\
$(INSTALL_LIB) $(FLDSONAME) $(DESTDIR)$(bindir); \
$(RM) $(DESTDIR)$(libdir)/libntk_forms.dll.a;\
$(INSTALL_LIB) libntk_forms.dll.a $(DESTDIR)$(libdir); \
fi
if test x$(GLDSONAME) = xlibntk_gl.so.1.3; then\
$(RM) $(DESTDIR)$(libdir)/libntk_gl.so*;\
$(INSTALL_LIB) libntk_gl.so.1.3 $(DESTDIR)$(libdir); \
@@ -733,30 +646,6 @@ uninstall:
$(RM) $(DESTDIR)$(libdir)/libntk.dll.a;\
fi
$(RM) $(DESTDIR)$(libdir)/$(FLLIBBASENAME);
if test x$(FLDSONAME) = xlibntk_forms.so.1.3; then\
$(RM) $(DESTDIR)$(libdir)/libntk_forms.so*;\
fi
if test x$(FLDSONAME) = xlibntk_forms.sl.1.3; then\
$(RM) $(DESTDIR)$(libdir)/libntk_forms.sl*;\
fi
if test x$(FLDSONAME) = xlibntk_forms.1.3.dylib; then\
$(RM) $(DESTDIR)$(libdir)/libntk_forms.*dylib;\
fi
if test x$(FLDSONAME) = xlibntk_forms_s.a; then\
$(RM) $(DESTDIR)$(libdir)/libntk_forms_s.a;\
fi
if test x$(FLDSONAME) = xcygntknox_forms-1.3.dll; then\
$(RM) $(DESTDIR)$(bindir)/$(FLDSONAME); \
$(RM) $(DESTDIR)$(libdir)/libntk_forms.dll.a;\
fi
if test x$(FLDSONAME) = xcygntk_forms-1.3.dll; then\
$(RM) $(DESTDIR)$(bindir)/$(FLDSONAME); \
$(RM) $(DESTDIR)$(libdir)/libntk_forms.dll.a;\
fi
if test x$(FLDSONAME) = xmgwntknox_forms-1.3.dll; then\
$(RM) $(DESTDIR)$(bindir)/$(FLDSONAME); \
$(RM) $(DESTDIR)$(libdir)/libntk_forms.dll.a;\
fi
if test x$(GLLIBNAME) != x; then\
$(RM) $(DESTDIR)$(libdir)/$(GLLIBBASENAME);\
fi


+ 0
- 53
src/forms_bitmap.cxx View File

@@ -1,53 +0,0 @@
//
// "$Id: forms_bitmap.cxx 7903 2010-11-28 21:06:39Z matt $"
//
// Forms compatible bitmap function for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2010 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//

#include <FL/forms.H>
/** Creates a bitmap widget from a box type, position, size and optional label specification */
Fl_FormsBitmap::Fl_FormsBitmap(
Fl_Boxtype t, int X, int Y, int W, int H, const char* l)
: Fl_Widget(X, Y, W, H, l) {
box(t);
b = 0;
color(FL_BLACK);
align(FL_ALIGN_BOTTOM);
}
/** Sets a new bitmap bits with size W,H. Deletes the previous one.*/
void Fl_FormsBitmap::set(int W, int H, const uchar *bits) {
delete b;
bitmap(new Fl_Bitmap(bits, W, H));
}

/** Draws the bitmap and its associated box. */
void Fl_FormsBitmap::draw() {
draw_box(box(), selection_color());
if (b) {fl_color(color()); b->draw(x(), y(), w(), h());}
draw_label();
}

//
// End of "$Id: forms_bitmap.cxx 7903 2010-11-28 21:06:39Z matt $".
//

+ 0
- 213
src/forms_compatability.cxx View File

@@ -1,213 +0,0 @@
//
// "$Id: forms_compatability.cxx 7903 2010-11-28 21:06:39Z matt $"
//
// Forms compatibility functions for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2010 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//

// Forms library compatibility functions.
// Many more functions are defined as inlines in forms.h!

#include <FL/forms.H>
#include <stdlib.h>

char fl_flip = 2;
void fl_end_form() {
while (Fl_Group::current()) Fl_Group::current()->forms_end();
}
void Fl_Group::forms_end() {
// set the dimensions of a group to surround contents
if (children() && !w()) {
Fl_Widget*const* a = array();
Fl_Widget* o = *a++;
int rx = o->x();
int ry = o->y();
int rw = rx+o->w();
int rh = ry+o->h();
for (int i=children_-1; i--;) {
o = *a++;
if (o->x() < rx) rx = o->x();
if (o->y() < ry) ry = o->y();
if (o->x()+o->w() > rw) rw = o->x()+o->w();
if (o->y()+o->h() > rh) rh = o->y()+o->h();
}
x(rx);
y(ry);
w(rw-rx);
h(rh-ry);
}
// flip all the children's coordinate systems:
if (fl_flip) {
Fl_Widget* o = (type()>=FL_WINDOW) ? this : window();
int Y = o->h();
Fl_Widget*const* a = array();
for (int i=children(); i--;) {
Fl_Widget* ow = *a++;
int newy = Y-ow->y()-ow->h();
ow->y(newy);
}
}
end();
}

static int initargc;
static char **initargv;

void fl_initialize(int *argc, char **argv, const char *, FL_CMD_OPT *, int) {
initargc = *argc;
initargv = new char*[*argc+1];
int i,j;
for (i=0; i<=*argc; i++) initargv[i] = argv[i];
for (i=j=1; i<*argc; ) {
if (Fl::arg(*argc,argv,i));
else argv[j++] = argv[i++];
}
argv[j] = 0;
*argc = j;
if (fl_flip==2) fl_flip = 0;
}

char fl_modal_next; // set by fl_freeze_forms()

void fl_show_form(Fl_Window *f,int place,int b,const char *n) {

f->label(n);
if (!b) f->clear_border();
if (fl_modal_next || b==FL_TRANSIENT) {f->set_modal(); fl_modal_next = 0;}

if (place & FL_PLACE_MOUSE) f->hotspot(f);

if (place & FL_PLACE_CENTER) {
int scr_x, scr_y, scr_w, scr_h;
Fl::screen_xywh(scr_x, scr_y, scr_w, scr_h);
f->position(scr_x+(scr_w-f->w())/2, scr_y+(scr_h-f->h())/2);
}

if (place & FL_PLACE_FULLSCREEN)
f->fullscreen();

if (place & (FL_PLACE_POSITION | FL_PLACE_GEOMETRY))
f->position(
(f->x() < 0) ? Fl::w()-f->w()+f->x()-1 : f->x(),
(f->y() < 0) ? Fl::h()-f->h()+f->y()-1 : f->y());

// if (place & FL_PLACE_ASPECT) {
// this is not yet implemented
// it can be done by setting size_range().

if (place == FL_PLACE_FREE || place == FL_PLACE_SIZE)
f->free_position();

if (place == FL_PLACE_FREE || place & FL_FREE_SIZE)
if (!f->resizable()) f->resizable(f);

if (initargc) {f->show(initargc,initargv); initargc = 0;}
else f->show();
}

Fl_Widget *fl_do_forms(void) {
Fl_Widget *obj;
while (!(obj = Fl::readqueue())) if (!Fl::wait()) exit(0);
return obj;
}

Fl_Widget *fl_check_forms() {
Fl::check();
return Fl::readqueue();
}

void fl_set_graphics_mode(int /*r*/,int /*d*/) {}

#ifndef FL_DOXYGEN // FIXME: suppress doxygen warning
void Fl_FormsText::draw() {
draw_box();
align(align()|FL_ALIGN_INSIDE); // questionable method of compatibility
draw_label();
}
#endif

// Create a forms button by selecting correct fltk subclass:

#include <FL/Fl_Return_Button.H>
#include <FL/Fl_Repeat_Button.H>

Fl_Button *fl_add_button(uchar t,int x,int y,int w,int h,const char *l) {
Fl_Button *b;
switch (t) {
case FL_RETURN_BUTTON:
case FL_HIDDEN_RET_BUTTON:
b = new Fl_Return_Button(x,y,w,h,l);
break;
case FL_TOUCH_BUTTON:
b = new Fl_Repeat_Button(x,y,w,h,l);
break;
default:
b = new Fl_Button(x,y,w,h,l);
}
switch (t) {
case FL_TOGGLE_BUTTON:
case FL_RADIO_BUTTON:
b->type(t);
break;
case FL_HIDDEN_BUTTON:
case FL_HIDDEN_RET_BUTTON:
b->type(FL_HIDDEN_BUTTON);
break;
case FL_INOUT_BUTTON:
b->when(FL_WHEN_CHANGED);
break;
}
return b;
}

void fl_show_message(const char *q1,const char *q2,const char *q3) {
fl_message("%s\n%s\n%s", q1?q1:"", q2?q2:"", q3?q3:"");
}

void fl_show_alert(const char *q1,const char *q2,const char *q3,int) {
fl_alert("%s\n%s\n%s", q1?q1:"", q2?q2:"", q3?q3:"");
}

int fl_show_question(const char *q1,const char *q2,const char *q3) {
return fl_choice("%s\n%s\n%s", "No", "Yes", 0L, q1?q1:"", q2?q2:"", q3?q3:"");
}

int fl_show_choice(
const char *q1,
const char *q2,
const char *q3,
int, // number of buttons, ignored
const char *b0,
const char *b1,
const char *b2) {
return fl_choice("%s\n%s\n%s", q1?q1:"", q2?q2:"", q3?q3:"", b0,b1,b2)+1;
}

char *fl_show_simple_input(const char *str1, const char *defstr) {
const char *r = fl_input("%s", defstr, str1);
return (char *)(r ? r : defstr);
}

//
// End of "$Id: forms_compatability.cxx 7903 2010-11-28 21:06:39Z matt $".
//

+ 0
- 114
src/forms_free.cxx View File

@@ -1,114 +0,0 @@
//
// "$Id: forms_free.cxx 7903 2010-11-28 21:06:39Z matt $"
//
// Forms free widget routines for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2010 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//

// Emulation of the Forms "free" widget.
// This emulation allows the free demo to run, and has allowed
// me to port several other programs, but it is in no way
// complete.

#include <FL/Fl.H>
#include <FL/Fl_Free.H>

void Fl_Free::step(void *v) {
Fl_Free *f = (Fl_Free *)v;
int old_event = Fl::e_number;
f->handle(Fl::e_number == FL_STEP);
Fl::e_number = old_event;
Fl::add_timeout(.01,step,v);
}

/**
Create a new Fl_Free widget with type, position, size, label and handler.
\param[in] t type
\param[in] X, Y, W, H position and size
\param[in] L widget label
\param[in] hdl handler function

The constructor takes both the type and the handle function. The handle
function should be declared as follows:
\code
int handle_function(Fl_Widget *w,
int event,
float event_x,
float event_y,
char key)
\endcode
This function is called from the handle() method in response to most
events, and is called by the draw() method.

The event argument contains the event type:
\code
// old event names for compatibility:
#define FL_MOUSE FL_DRAG
#define FL_DRAW 0
#define FL_STEP 9
#define FL_FREEMEM 12
#define FL_FREEZE FL_UNMAP
#define FL_THAW FL_MAP
\endcode
*/
Fl_Free::Fl_Free(uchar t,int X, int Y, int W, int H,const char *L,
FL_HANDLEPTR hdl) :
Fl_Widget(X,Y,W,H,L) {
type(t);
hfunc = hdl;
if (t == FL_SLEEPING_FREE) set_flag(INACTIVE);
if (t == FL_CONTINUOUS_FREE || t == FL_ALL_FREE)
Fl::add_timeout(.01,step,this);
}

/**
The destructor will call the handle function with the event FL_FREE_MEM.
*/
Fl_Free::~Fl_Free() {
Fl::remove_timeout(step,this);
hfunc(this,FL_FREEMEM,0,0,0);
}

void Fl_Free::draw() {hfunc(this,FL_DRAW,0,0,0);}

int Fl_Free::handle(int e) {
char key = Fl::event_key();
switch (e) {
case FL_FOCUS:
if (type()!=FL_INPUT_FREE && type()!=FL_ALL_FREE) return 0;
break;
case FL_PUSH:
case FL_DRAG:
case FL_RELEASE:
key = 4-Fl::event_button();
break;
case FL_SHORTCUT:
return 0;
}
if (hfunc(this, e, float(Fl::event_x()), float(Fl::event_y()), key)) do_callback();
return 1;
}

//
// End of "$Id: forms_free.cxx 7903 2010-11-28 21:06:39Z matt $".
//

+ 0
- 67
src/forms_fselect.cxx View File

@@ -1,67 +0,0 @@
//
// "$Id: forms_fselect.cxx 8063 2010-12-19 21:20:10Z matt $"
//
// Forms file selection routines for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2010 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//

// Emulate the Forms file chooser using the fltk file chooser.

#include <FL/forms.H>
#include "flstring.h"

static char fl_directory[FL_PATH_MAX];
static const char *fl_pattern; // assumed passed value is static
static char fl_filename[FL_PATH_MAX];

char* fl_show_file_selector(const char *message,const char *dir,
const char *pat,const char *fname) {
if (dir && dir[0]) strlcpy(fl_directory,dir,sizeof(fl_directory));
if (pat && pat[0]) fl_pattern = pat;
if (fname && fname[0]) strlcpy(fl_filename,fname,sizeof(fl_filename));
char *p = fl_directory+strlen(fl_directory);
if (p > fl_directory && *(p-1)!='/'
#ifdef WIN32
&& *(p-1)!='\\' && *(p-1)!=':'
#endif
) *p++ = '/';
strlcpy(p,fl_filename,sizeof(fl_directory) - (p - fl_directory));
const char *q = fl_file_chooser(message,fl_pattern,fl_directory);
if (!q) return 0;
strlcpy(fl_directory, q, sizeof(fl_directory));
p = (char *)fl_filename_name(fl_directory);
strlcpy(fl_filename, p, sizeof(fl_filename));
if (p > fl_directory+1) p--;
*p = 0;
return (char *)q;
}

char* fl_get_directory() {return fl_directory;}

char* fl_get_pattern() {return (char *)fl_pattern;}

char* fl_get_filename() {return fl_filename;}

//
// End of "$Id: forms_fselect.cxx 8063 2010-12-19 21:20:10Z matt $".
//

+ 0
- 63
src/forms_pixmap.cxx View File

@@ -1,63 +0,0 @@
//
// "$Id: forms_pixmap.cxx 7903 2010-11-28 21:06:39Z matt $"
//
// Forms pixmap drawing routines for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2010 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//

#include <FL/forms.H>

/**
Creates a new Fl_FormsPixmap widget using the given box type, position,
size and label string.
\param[in] t box type
\param[in] X, Y, W, H position and size
\param[in] L widget label, default is no label
*/
Fl_FormsPixmap::Fl_FormsPixmap(
Fl_Boxtype t, int X, int Y, int W, int H, const char* L)
: Fl_Widget(X, Y, W, H, L) {
box(t);
b = 0;
color(FL_BLACK);
align(FL_ALIGN_BOTTOM);
}

/**
Set/create the internal pixmap using raw data.
\param[in] bits raw data
*/
void Fl_FormsPixmap::set(char*const* bits) {
delete b;
b = new Fl_Pixmap(bits);
}

void Fl_FormsPixmap::draw() {
draw_box(box(), selection_color());
if (b) {fl_color(color()); b->draw(x(), y(), w(), h());}
draw_label();
}

//
// End of "$Id: forms_pixmap.cxx 7903 2010-11-28 21:06:39Z matt $".
//

+ 0
- 186
src/forms_timer.cxx View File

@@ -1,186 +0,0 @@
//
// "$Id: forms_timer.cxx 7903 2010-11-28 21:06:39Z matt $"
//
// Forms timer object for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2010 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//

// Emulate the Forms Timer object
// You don't want to use this if you just want a timeout, call
// Fl::add_timeout directly!

#include <FL/Fl.H>
#include <FL/Fl_Timer.H>
#include <FL/fl_draw.H>
#ifdef WIN32
# ifdef __MWERKS__
# include <time.h>
# else
# include <sys/types.h>
# include <sys/timeb.h>
# endif
#else
# include <time.h>
# include <sys/time.h>
#endif
#include <stdio.h>

#define FL_TIMER_BLINKRATE 0.2

void fl_gettime(long* sec, long* usec) {
#ifdef WIN32
# ifdef __MWERKS__
time_t localTime = time(NULL);
struct tm *now = localtime(&localTime);
*sec = now->tm_sec + 60*now->tm_min + 3600*now->tm_hour + 24*3600*now->tm_yday;
*usec = 0;
# else
struct timeb tp;
ftime(&tp);
*sec = tp.time;
*usec = tp.millitm * 1000;
# endif
#else
struct timeval tp;
struct timezone tzp;
gettimeofday(&tp, &tzp);
*sec = tp.tv_sec;
*usec = tp.tv_usec;
#endif
}

void Fl_Timer::draw() {
int tt;
Fl_Color col;
char str[32];
if (!on || delay>0.0)
col = color();
else if ((int) (delay / FL_TIMER_BLINKRATE) % 2)
col = color();
else
col = selection_color();
draw_box(box(), col);
if (type() == FL_VALUE_TIMER && delay>0.0) {
double d = direction_ ? total-delay : delay;
if (d < 60.0)
sprintf(str, "%.1f", d);
else {
tt = (int) ((d+0.05) / 60.0);
sprintf(str, "%d:%04.1f", tt, d - 60.0 * tt);
}
fl_font(labelfont(), labelsize());
fl_color(labelcolor());
fl_draw(str, x(), y(), w(), h(), FL_ALIGN_CENTER);
} else
draw_label();
}

void Fl_Timer::stepcb(void* v) {
((Fl_Timer*)v)->step();
}

void Fl_Timer::step() {
if (!on) return;
double lastdelay = delay;
long sec, usec; fl_gettime(&sec, &usec);
delay -= (double) (sec - lastsec) + (double) (usec - lastusec) / 1000000.0;
lastsec = sec; lastusec = usec;
if (lastdelay > 0.0 && delay <= 0.0) {
if (type() == FL_HIDDEN_TIMER) {
on = 0;
delay = 0;
} else {
redraw();
Fl::add_timeout(FL_TIMER_BLINKRATE, stepcb, this);
}
set_changed();
do_callback();
} else {
if (type() == FL_VALUE_TIMER) redraw();
Fl::add_timeout(FL_TIMER_BLINKRATE, stepcb, this);
}
}

int Fl_Timer::handle(int event) {
if (event == FL_RELEASE && delay <= 0) value(0.0);
return 0;
}

/**
Destroys the timer and removes the timeout.
*/
Fl_Timer::~Fl_Timer() {
Fl::remove_timeout(stepcb, this);
}

/**
Creates a new Fl_Timer widget using the given type, position,
size, and label string. The type parameter can be any of the
following symbolic constants:

\li FL_NORMAL_TIMER - The timer just does the callback and
displays the string "Timer" in the widget.
\li FL_VALUE_TIMER - The timer does the callback and displays
the current timer value in the widget.
\li FL_HIDDEN_TIMER - The timer just does the callback and
does not display anything.
*/
Fl_Timer::Fl_Timer(uchar t, int X, int Y, int W, int H, const char* l)

: Fl_Widget(X, Y, W, H, l) {
box(FL_DOWN_BOX);
selection_color(FL_RED);
delay = 0;
on = 0;
direction_ = 0;
type(t);
if (t == FL_HIDDEN_TIMER) clear_visible();
if (t == FL_VALUE_TIMER) align(FL_ALIGN_LEFT);
}
/** Sets the current timer value */
void Fl_Timer::value(double d) {
delay = total = d;
on = (d > 0.0);
fl_gettime(&(lastsec), &(lastusec));
if (type() != FL_HIDDEN_TIMER) redraw();
Fl::remove_timeout(stepcb, this);
if (on) Fl::add_timeout(FL_TIMER_BLINKRATE, stepcb, this);
}

/** Gets or sets whether the timer is suspended.*/
void Fl_Timer::suspended(char d) {
if (!d) {
if (on) return;
on = (delay > 0.0);
fl_gettime(&(lastsec), &(lastusec));
if (on) Fl::add_timeout(FL_TIMER_BLINKRATE, stepcb, this);
} else {
if (!on) return;
on = 0;
Fl::remove_timeout(stepcb, this);
}
}

//
// End of "$Id: forms_timer.cxx 7903 2010-11-28 21:06:39Z matt $".
//

+ 0
- 6
test/Makefile View File

@@ -55,7 +55,6 @@ CPPFILES =\
fast_slow.cxx \
file_chooser.cxx \
fonts.cxx \
forms.cxx \
fractals.cxx \
fullscreen.cxx \
gl_overlay.cxx \
@@ -127,7 +126,6 @@ ALL = \
fast_slow$(EXEEXT) \
file_chooser$(EXEEXT) \
fonts$(EXEEXT) \
forms$(EXEEXT) \
hello$(EXEEXT) \
help$(EXEEXT) \
iconize$(EXEEXT) \
@@ -341,10 +339,6 @@ file_chooser$(EXEEXT): file_chooser.o $(IMGLIBNAME)

fonts$(EXEEXT): fonts.o

forms$(EXEEXT): forms.o
echo Linking $@...
$(CXX) $(ARCHFLAGS) $(LDFLAGS) -o $@ forms.o $(LINKFLTKFORMS) $(LDLIBS)

hello$(EXEEXT): hello.o

help$(EXEEXT): help.o $(IMGLIBNAME)


+ 0
- 239
test/forms.cxx View File

@@ -1,239 +0,0 @@
//
// "$Id: forms.cxx 7903 2010-11-28 21:06:39Z matt $"
//
// Another forms demo for the Fast Light Tool Kit (FLTK).
//
// This is an XForms program with very few changes.
// Search for "fltk" to find all changes necessary to port to fltk.
//
// This demo show the different boxtypes. Note that some
// boxtypes are not appropriate for some objects
//
// Copyright 1998-2010 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//

#include <FL/forms.H> // changed for fltk

static int border = 1; // changed from FL_TRANSIENT for fltk
// (this is so the close box and Esc work to close the window)

typedef struct { int val; const char *name; } VN_struct;
#define VN(a) {a,#a}

// static VN_struct gmode[] =
// {
// VN(StaticGray), VN(GrayScale), VN(StaticColor),
// VN(PseudoColor), VN(TrueColor), VN(DirectColor),
// };

static VN_struct btypes[]=
{
{FL_NO_BOX,"no box"},
{FL_UP_BOX, "up box"},
{FL_DOWN_BOX,"down box"},
{FL_BORDER_BOX,"border box"},
{FL_SHADOW_BOX,"shadow box"},
{FL_FLAT_BOX,"flat box"},
{FL_FRAME_BOX,"frame box"},
{FL_EMBOSSED_BOX,"embossed box"},
{FL_ROUNDED_BOX,"rounded box"},
{FL_RFLAT_BOX,"rflat box"},
{FL_RSHADOW_BOX,"rshadow box"}, // renamed for fltk
{FL_OVAL_BOX,"oval box"},
{FL_ROUNDED3D_UPBOX,"rounded3d upbox"},
{FL_ROUNDED3D_DOWNBOX,"rounded3d downbox"},
{FL_OVAL3D_UPBOX,"oval3d upbox"},
{FL_OVAL3D_DOWNBOX,"oval3d downbox"},
{FL_PLASTIC_UP_BOX,"plastic upbox"},
{FL_PLASTIC_DOWN_BOX,"plastic downbox"},
{FL_GTK_UP_BOX,"GTK up box"},
{FL_GTK_ROUND_UP_BOX,"GTK round up box"},
/* sentinel */
{-1}
};

#include "pixmaps/srs.xbm"

/*************** Callback **********************/

FL_FORM *form;
Fl_Widget *tobj[18], *exitob, *btypeob, *modeob;

void
boxtype_cb (Fl_Widget * ob, long)
{
int i, req_bt = fl_get_choice(ob) - 1;
static int lastbt = -1;

if(lastbt != req_bt)
{
fl_freeze_form (form);
fl_redraw_form (form);
for (i = 0; i < 18; i++)
fl_set_object_boxtype (tobj[i], (Fl_Boxtype)btypes[req_bt].val);
fl_unfreeze_form (form);
lastbt = req_bt;
fl_redraw_form(form); // added for fltk
}
}

void
mode_cb (Fl_Widget *, long)
{
// static int lval = -1;
// int val = fl_get_choice (ob) -1;
// int db = 0;

// if (val == lval || val < 0)
// return;

// fl_hide_form (form);
// if (!fl_mode_capable (gmode[val].val, 0))
// {
// fl_set_choice(ob, lval);
// val = lval;
// }

// fl_set_graphics_mode (gmode[val].val, db);
// fl_show_form (form, FL_PLACE_GEOMETRY, border, "Box types");

// lval = val;
}

/*************** Creation Routines *********************/

void
create_form_form (void)
{
Fl_Widget *obj;

form = fl_bgn_form(FL_NO_BOX, 720, 520);
obj = fl_add_box(FL_UP_BOX, 0, 0, 720, 520, "");
fl_set_object_color(obj, FL_BLUE, FL_COL1);
obj = fl_add_box(FL_DOWN_BOX, 10, 90, 700, 420, "");
fl_set_object_color(obj, FL_COL1, FL_COL1);
obj = fl_add_box(FL_DOWN_BOX, 10, 10, 700, 70, "");
fl_set_object_color(obj, FL_SLATEBLUE, FL_COL1);
tobj[0] = obj = fl_add_box(FL_UP_BOX, 30, 110, 110, 110, "Box");
tobj[1] = obj = fl_add_text(FL_NORMAL_TEXT, 30, 240, 110, 30, "Text");
tobj[2] = obj = fl_add_bitmap(FL_NORMAL_BITMAP, 40, 280, 90, 80, "Bitmap");
fl_set_object_lcol(obj, FL_BLUE);
tobj[3] = obj = fl_add_chart(FL_BAR_CHART, 160, 110, 160, 110, "Chart");
tobj[4] = obj = fl_add_clock(FL_ANALOG_CLOCK, 40, 390, 90, 90, "Clock");
//fl_set_object_dblbuffer(tobj[4],1); // removed for fltk
tobj[5]=obj=fl_add_button(FL_NORMAL_BUTTON, 340, 110, 120, 30, "Button");
tobj[6]=obj=fl_add_lightbutton(FL_PUSH_BUTTON,340,150,120,30,"Lightbutton");
tobj[7]=obj=fl_add_roundbutton(FL_PUSH_BUTTON,340,190,120,30,"Roundbutton");
tobj[8]=obj=fl_add_slider(FL_VERT_SLIDER, 160, 250, 40, 230, "Slider");
tobj[9]=obj=fl_add_valslider(FL_VERT_SLIDER, 220, 250, 40, 230, "Valslider");
tobj[10]=obj=fl_add_dial (FL_LINE_DIAL, 280, 250, 100, 100, "Dial");
tobj[11]=obj=fl_add_positioner(FL_NORMAL_POSITIONER,280,380,150,100, "Positioner");
tobj[12]=obj=fl_add_counter (FL_NORMAL_COUNTER,480,110,210,30, "Counter");
tobj[13]=obj=fl_add_input (FL_NORMAL_INPUT, 520,170,170,30, "Input");
tobj[14]=obj=fl_add_menu (FL_PUSH_MENU, 400, 240, 100, 30, "Menu");
tobj[15]=obj=fl_add_choice (FL_NORMAL_CHOICE, 580, 250, 110, 30, "Choice");
tobj[16]=obj=fl_add_timer (FL_VALUE_TIMER, 580, 210, 110, 30, "Timer");
//fl_set_object_dblbuffer(tobj[16], 1); // removed for fltk
tobj[17]=obj=fl_add_browser (FL_NORMAL_BROWSER,450,300,240, 180, "Browser");
exitob=obj= fl_add_button (FL_NORMAL_BUTTON, 590, 30, 100, 30, "Exit");
btypeob=obj= fl_add_choice (FL_NORMAL_CHOICE,110,30, 130, 30, "Boxtype");
fl_set_object_callback (obj, boxtype_cb, 0);
modeob = obj=fl_add_choice(FL_NORMAL_CHOICE,370,30,130,30,"Graphics mode");
fl_set_object_callback (obj, mode_cb, 0);
fl_end_form ();
}
/*---------------------------------------*/

void
create_the_forms (void)
{
create_form_form ();
}

/*************** Main Routine ***********************/

const char *browserlines[] = {
" ", "@C1@c@l@bObjects Demo", " ",
"This demo shows you all", "objects that currently",
"exist in the Forms Library.", " ",
"You can change the boxtype", "of the different objects",
"using the buttons at the", "top of the form. Note that",
"some combinations might not", "look too good. Also realize",
"that for all object classes", "many different types are",
"available with different", "behaviour.", " ",
"With this demo you can also", "see the effect of the drawing",
"mode on the appearance of the","objects.",
0
};


int
main (int argc, char *argv[])
{
FL_COLOR c = FL_BLACK;
const char **p;
VN_struct *vn;

fl_initialize(&argc, argv, "FormDemo", 0, 0);
create_the_forms ();
fl_set_bitmap_data (tobj[2], sorceress_width, sorceress_height, sorceress_bits);
fl_add_chart_value (tobj[3], 15, "item 1", c++);
fl_add_chart_value (tobj[3], 5, "item 2", c++);
fl_add_chart_value (tobj[3], -10, "item 3", c++);
fl_add_chart_value (tobj[3], 25, "item 4", c++);
fl_set_menu (tobj[14], "item 1|item 2|item 3|item 4|item 5");
fl_addto_choice (tobj[15], "item 1");
fl_addto_choice (tobj[15], "item 2");
fl_addto_choice (tobj[15], "item 3");
fl_addto_choice (tobj[15], "item 4");
fl_addto_choice (tobj[15], "item 5");
fl_set_timer (tobj[16], 1000.0);

for ( p = browserlines; *p; p++)
fl_add_browser_line (tobj[17], *p);

for ( vn = btypes; vn->val >= 0; vn++)
fl_addto_choice(btypeob, vn->name);

// {
// int i;
// VN_struct *g = gmode, *gs = g + sizeof (gmode) / sizeof (gmode[0]);
// for (i = 1; g < gs; g++, i++)
// {
// fl_addto_choice (modeob, g->name);
// if(!fl_mode_capable(g->val, 0))
// fl_set_choice_item_mode(modeob, i, FL_PUP_GRAY);
// }
// }
// fl_set_choice (modeob, fl_vmode+1);

fl_show_form (form, FL_PLACE_MOUSE, border, "Box types");

while (fl_do_forms () != exitob)
;

return 0;
}

//
// End of "$Id: forms.cxx 7903 2010-11-28 21:06:39Z matt $".
//

Loading…
Cancel
Save