#ifndef __FLTK_C_BI__
#define __FLTK_C_BI__

'  FreeBASIC header file for the Fast Light Tool Kit C wrapper.
'  FLTK C wrapper copyright 2013 by D.J.Peters

'  C++ library Fast Light Tool Kit (FLTK)
'  Copyright 1998-2010 by Bill Spitzak and others.
' 
'  This library is free software. Distribution and use rights are outlined in
'  the file "COPYING" which should have been included with this file.  If this
'  file is missing or damaged, see the license at:
' 
'      http:' www.fltk.org/COPYING.php
' 
'  Please report all bugs and problems on the following page:
' 
'      http:' www.fltk.org/str.php
' 

#ifdef __FB_WIN32__
# ifndef FLTKSTATIC
#  libpath "lib/win32/"
# else
#  libpath "lib/win32/static/"
#  inclib "fltk"
#  inclib "fltk_forms"
#  inclib "fltk_gl"
#  inclib "fltk_jpeg"
#  inclib "fltk_png"
#  inclib "fltk_images"
#  inclib "kernel32"
#  inclib "user32"
#  inclib "gdi32"
#  inclib "opengl32"
#  inclib "comctl32"
#  inclib "comdlg32"
#  inclib "advapi32"
#  inclib "shell32"
#  inclib "ole32"
#  inclib "oleaut32"
#  inclib "uuid"
# endif
#else
# ifdef __FB_LINUX__
#  ifndef FLTKSTATIC
#   libpath "lib/linux/"
#  else
#   libpath "lib/linux/static/"
#   inclib "fltk"
#   inclib "fltk_forms"
#   inclib "fltk_gl"
#   inclib "fltk_jpeg"
#   inclib "fltk_png"
#   inclib "fltk_images"
#   inclib "GL"
#   inclib "X11"
#   inclib "Xft"
#   inclib "Xinerama"
#  endif
# else
#  error target must be Windows or Unix/Linux
# endif
#endif

#inclib "fltk-c-1-3-2"


#include once "crt/stdio.bi"
#include once "crt/string.bi"
#include once "crt/stdlib.bi"

' FLTK const's
type Fl_Align as uinteger
const as Fl_Align Fl_ALIGN_CENTER             = &H0000
const as Fl_Align Fl_ALIGN_TOP                = &H0001
const as Fl_Align Fl_ALIGN_BOTTOM             = &H0002
const as Fl_Align Fl_ALIGN_LEFT               = &H0004
const as Fl_Align Fl_ALIGN_LEFT_TOP           = &H0007 '  magic value
const as Fl_Align Fl_ALIGN_RIGHT              = &H0008
const as Fl_Align Fl_ALIGN_RIGHT_TOP          = &H000b '  magic value
const as Fl_Align Fl_ALIGN_LEFT_BOTTOM        = &H000d '  magic value
const as Fl_Align Fl_ALIGN_RIGHT_BOTTOM       = &H000e '  magic value
const as Fl_Align Fl_ALIGN_POSITION_MASK      = &H000f '  left, right, top, bottom
const as Fl_Align Fl_ALIGN_INSIDE             = &H0010
const as Fl_Align Fl_ALIGN_TEXT_OVER_IMAGE    = &H0020
const as Fl_Align Fl_ALIGN_IMAGE_OVER_TEXT    = &H0000
const as Fl_Align Fl_ALIGN_CLIP               = &H0040
const as Fl_Align Fl_ALIGN_WRAP               = &H0080
const as Fl_Align Fl_ALIGN_IMAGE_NEXT_TO_TEXT = &H0100
const as Fl_Align Fl_ALIGN_TEXT_NEXT_TO_IMAGE = &H0120
const as Fl_Align Fl_ALIGN_IMAGE_BACKDROP     = &H0200
const as Fl_Align Fl_ALIGN_TOP_LEFT           = Fl_ALIGN_TOP or Fl_ALIGN_LEFT
const as Fl_Align Fl_ALIGN_TOP_RIGHT          = Fl_ALIGN_TOP or Fl_ALIGN_RIGHT
const as Fl_Align Fl_ALIGN_BOTTOM_LEFT        = Fl_ALIGN_BOTTOM or Fl_ALIGN_LEFT
const as Fl_Align Fl_ALIGN_BOTTOM_RIGHT       = Fl_ALIGN_BOTTOM or Fl_ALIGN_RIGHT
const as Fl_Align Fl_ALIGN_IMAGE_MASK         = &H0320 '  l/r, t/b, backdrop

' Colors
type Fl_Color as uinteger
' The Fl_Color type holds an FLTK color value.
' Colors are either 8-bit indexes into a virtual colormap or 24-bit RGB color values.
' Color indices occupy the lower 8 bits of the value, while RGB colors occupy the upper 24 bits, for a byte organization of RGBI.
' Fl_Color => &Hrrggbbii
'                | | | |
'                | | | +--- index between 0 and 255
'                | | +----- blue color component (8 bit)
'                | +------- green component (8 bit)
'                +--------- red component (8 bit)
' A color can have either an index or an rgb value. Colors with rgb set and an index >0 are reserved for special use.

'  Standard colors. These are used as default colors in widgets and altered as necessary
const as Fl_Color Fl_FOREGROUND_COLOR  =  0 ' /< the default foreground color (0) used for labels and text
const as Fl_Color Fl_BACKGROUND2_COLOR =  7 ' /< the default background color for text, list, and valuator widgets
const as Fl_Color Fl_INACTIVE_COLOR    =  8 ' /< the inactive foreground color
const as Fl_Color Fl_SELECTION_COLOR   = 15 ' /< the default selection/highlight color

'  boxtypes generally limit themselves to these colors so  the whole ramp is not allocated:
const as Fl_Color Fl_GRAY0             = 32 '  'A'
const as Fl_Color Fl_DARK3             = 39 '  'H'
const as Fl_Color Fl_DARK2             = 45 '  'N'
const as Fl_Color Fl_DARK1             = 47 '  'P'
const as Fl_Color Fl_BACKGROUND_COLOR  = 49 '  'R' default background color
const as Fl_Color Fl_LIGHT1            = 50 '  'S'
const as Fl_Color Fl_LIGHT2            = 52 '  'U'
const as Fl_Color Fl_LIGHT3            = 54 '  'W'

'  FLTK provides a 5x8x5 color cube that is used with colormap visuals
const as Fl_Color Fl_BLACK             = 56
const as Fl_Color Fl_DARK_GREEN        = 60
const as Fl_Color Fl_GREEN             = 63
const as Fl_Color Fl_DARK_RED          = 72
const as Fl_Color Fl_DARK_YELLOW       = 76
const as Fl_Color Fl_RED               = 88
const as Fl_Color Fl_YELLOW            = 95
const as Fl_Color Fl_DARK_BLUE         = 136
const as Fl_Color Fl_DARK_MAGENTA      = 152
const as Fl_Color Fl_DARK_CYAN         = 140
const as Fl_Color Fl_BLUE              = 216
const as Fl_Color Fl_MAGENTA           = 248
const as Fl_Color Fl_CYAN              = 223
const as Fl_Color Fl_WHITE             = 255

#define Fl_FREE_COLOR     16
#define Fl_NUM_FREE_COLOR 16
#define Fl_GRAY_RAMP      32
#define Fl_NUM_GRAY       24
#define Fl_GRAY           Fl_BACKGROUND_COLOR
#define Fl_COLOR_CUBE     56
#define Fl_NUM_RED        5
#define Fl_NUM_GREEN      8
#define Fl_NUM_BLUE       5

' Returns the 24-bit color value closest to r, g, b.
function Fl_RGB_Color(r as ubyte,g as ubyte,b as ubyte) as Fl_Color
  dim as Fl_Color c=any
  c   = r : c shl=8
  c or= g : c shl=8
  c or= b : c shl=8

  if c=0 then c=Fl_BLACK
  return c
end function

type Fl_Font as integer
const as Fl_Font Fl_HELVETICA              =  0 ' Helvetica (or Arial) normal (0)
const as Fl_Font Fl_BOLD                   =  1 ' bold
const as Fl_Font Fl_ITALIC                 =  2 ' oblique
const as Fl_Font Fl_BOLD_ITALIC            =  3 ' bold-oblique
const as Fl_Font Fl_HELVETICA_BOLD         =  Fl_HELVETICA + Fl_BOLD
const as Fl_Font Fl_HELVETICA_ITALIC       =  Fl_HELVETICA + Fl_ITALIC
const as Fl_Font Fl_HELVETICA_BOLD_ITALIC  =  Fl_HELVETICA + Fl_BOLD_ITALIC
const as Fl_Font Fl_COURIER                =  4 ' Courier normal
const as Fl_Font Fl_COURIER_BOLD           =  Fl_COURIER + Fl_BOLD
const as Fl_Font Fl_COURIER_ITALIC         =  Fl_COURIER + Fl_ITALIC
const as Fl_Font Fl_COURIER_BOLD_ITALIC    =  Fl_COURIER + Fl_BOLD_ITALIC
const as Fl_Font Fl_TIMES                  =  8 ' Times roman
const as Fl_Font Fl_TIMES_BOLD             =  Fl_TIMES + Fl_BOLD
const as Fl_Font Fl_TIMES_ITALIC           =  Fl_TIMES + Fl_ITALIC
const as Fl_Font Fl_TIMES_BOLD_ITALIC      =  Fl_TIMES + Fl_BOLD_ITALIC
const as Fl_Font Fl_SYMBOL                 = 12 ' Standard symbol font
const as Fl_Font Fl_SCREEN                 = 13 ' Default monospaced screen font
const as Fl_Font Fl_SCREEN_BOLD            = Fl_SCREEN + Fl_BOLD ' Default monospaced bold screen font
const as Fl_Font Fl_ZAPF_DINGBATS          = 15 ' Zapf-dingbats font
const as Fl_Font Fl_FREE_FONT              = 16 ' first one to allocate

' FLTK enums
enum Fl_Beep ' See also: flBeep(v as Fl_Beep) 
  FL_BEEP_DEFAULT = 0  ' Default beep.
  FL_BEEP_MESSAGE      ' Message beep.
  FL_BEEP_ERROR        ' Error beep.
  FL_BEEP_QUESTION     ' Question beep.
  FL_BEEP_PASSWORD     ' Password beep.
  FL_BEEP_NOTIFICATION ' Notification beep.
end enum

enum FL_Boxtype
  FL_NO_BOX = 0
  FL_FLAT_BOX
  FL_UP_BOX
  FL_DOWN_BOX
  FL_UP_FRAME
  FL_DOWN_FRAME
  FL_THIN_UP_BOX
  FL_THIN_DOWN_BOX
  FL_THIN_UP_FRAME
  FL_THIN_DOWN_FRAME
  FL_ENGRAVED_BOX
  FL_EMBOSSED_BOX
  FL_ENGRAVED_FRAME
  FL_EMBOSSED_FRAME
  FL_BORDER_BOX
  _FL_SHADOW_BOX
  FL_BORDER_FRAME
  _FL_SHADOW_FRAME
  _FL_ROUNDED_BOX
  _FL_RSHADOW_BOX
  _FL_ROUNDED_FRAME
  _FL_RFLAT_BOX
  _FL_ROUND_UP_BOX
  _FL_ROUND_DOWN_BOX
  _FL_DIAMOND_UP_BOX
  _FL_DIAMOND_DOWN_BOX
  _FL_OVAL_BOX
  _FL_OSHADOW_BOX
  _FL_OVAL_FRAME
  _FL_OFLAT_BOX
  _FL_PLASTIC_UP_BOX
  _FL_PLASTIC_DOWN_BOX
  _FL_PLASTIC_UP_FRAME
  _FL_PLASTIC_DOWN_FRAME
  _FL_PLASTIC_THIN_UP_BOX
  _FL_PLASTIC_THIN_DOWN_BOX
  _FL_PLASTIC_ROUND_UP_BOX
  _FL_PLASTIC_ROUND_DOWN_BOX
  _FL_GTK_UP_BOX
  _FL_GTK_DOWN_BOX
  _FL_GTK_UP_FRAME
  _FL_GTK_DOWN_FRAME
  _FL_GTK_THIN_UP_BOX
  _FL_GTK_THIN_DOWN_BOX
  _FL_GTK_THIN_UP_FRAME
  _FL_GTK_THIN_DOWN_FRAME
  _FL_GTK_ROUND_UP_BOX
  _FL_GTK_ROUND_DOWN_BOX
  FL_FREE_BOXTYPE
end enum

enum FL_BroserType
  FL_NORMALBROWSER = 0
  FL_SELECTBROWSER
  FL_HOLDBROWSER
  FL_MULTIBROWSER
end enum

enum FL_SortOder
  FL_SORT_ASCENDING = 0 ' sort browser items in ascending alphabetic order.
  FL_SORT_DESCENDING    ' sort in descending order
end enum

enum FL_ChartType
  FL_CHART_BAR = 0
  FL_CHART_HORBAR
  FL_CHART_LINE
  FL_CHART_FILL
  FL_CHART_SPIKE
  FL_CHART_PIE
  FL_CHART_SPECIALPIE
end enum

' The following enums define the mouse cursors that are available in FLTK.
' The double-headed arrows are bitmaps provided by FLTK on X, the others are provided by system-defined cursors.
enum FL_Cursor
  FL_CURSOR_DEFAULT =   0 ' the default cursor, usually an arrow.
  FL_CURSOR_SE      =   8 ' for back compatibility.
  FL_CURSOR_S       =   9 ' for back compatibility.
  FL_CURSOR_SW      =   7 ' for back compatibility.
  FL_CURSOR_MOVE    =  27 ' 4-pointed arrow.
  FL_CURSOR_HAND    =  31 ' hand (uparrow on MSWindows).
  FL_CURSOR_ARROW   =  35 ' an arrow pointer.
  FL_CURSOR_W       =  36 ' for back compatibility.
  FL_CURSOR_HELP    =  47 ' question mark.
  FL_CURSOR_E       =  49 ' for back compatibility.
  FL_CURSOR_CROSS   =  66 ' crosshair.
  FL_CURSOR_NW      =  68 ' for back compatibility.
  FL_CURSOR_NE      =  69 ' for back compatibility.
  FL_CURSOR_N       =  70 ' for back compatibility.
  FL_CURSOR_WAIT    =  76 ' watch or hourglass.
  FL_CURSOR_INSERT  =  77 ' I-beam.
  FL_CURSOR_NS      =  78 ' up/down arrow.
  FL_CURSOR_WE      =  79 ' left/right arrow.
  FL_CURSOR_NWSE    =  80 ' diagonal arrow.
  FL_CURSOR_NESW    =  81 ' diagonal arrow.
  FL_CURSOR_NONE    = 255 ' invisible.
end enum

enum FL_ClockType
  FL_CLOCK_SQUARE = 0
  FL_CLOCK_ROUND
end enum

enum FL_ColorChooserModes
  FL_COLORCHOOSER_DEFAULT = -1
  FL_COLORCHOOSER_RGB
  FL_COLORCHOOSER_BYTE
  FL_COLORCHOOSER_HEX
  FL_COLORCHOOSER_HSV
end enum

enum Fl_CounterType
  FL_COUNTER_NORMAL = 0 ' Displays a counter with 4 arrow buttons.
  FL_COUNTER_SIMPLE     ' Displays a counter with only 2 arrow buttons.
end enum

enum FL_Damage ' Damage masks
  FL_DAMAGE_CHILD    = &H01 ' A child needs to be redrawn.
  FL_DAMAGE_EXPOSE   = &H02 ' The window was exposed.
  FL_DAMAGE_SCROLL   = &H04 ' The Fl_Scroll widget was scrolled.
  FL_DAMAGE_OVERLAY  = &H08 ' The overlay planes need to be redrawn.
  FL_DAMAGE_USER1    = &H10 ' First user-defined damage bit.
  FL_DAMAGE_USER2    = &H20 ' Second user-defined damage bit.
  FL_DAMAGE_ALL      = &H80 ' Everything needs to be redrawn.
end enum

enum FL_DialType
  FL_DIAL_NORMAL = 0 ' Draws a normal dial with a knob.
  FL_DIAL_LINE       ' Draws a dial with a line.
  FL_DIAL_FILL       ' Draws a dial with a filled arc.
end enum

enum Fl_Event
  FL_NO_EVENT                     =  0
  FL_PUSH                         =  1
  FL_RELEASE                      =  2
  FL_ENTER                        =  3
  FL_LEAVE                        =  4
  FL_DRAG                         =  5
  FL_FOCUS                        =  6
  FL_UNFOCUS                      =  7
  FL_KEYDOWN                      =  8
  FL_KEYBOARD                     =  8
  FL_KEYUP                        =  9
  FL_CLOSE                        = 10
  FL_MOVE                         = 11
  FL_SHORTCUT                     = 12
  FL_DEACTIVATE                   = 13
  FL_ACTIVATE                     = 14
  FL_HIDE                         = 15
  FL_SHOW                         = 16
  FL_PASTE                        = 17
  FL_SELECTIONCLEAR               = 18
  FL_MOUSEWHEEL                   = 19
  FL_DND_ENTER                    = 20
  FL_DND_DRAG                     = 21
  FL_DND_LEAVE                    = 22
  FL_DND_RELEASE                  = 23
  FL_SCREEN_CONFIGURATION_CHANGED = 24
  FL_FULLSCREEN                   = 25
end enum

enum FL_Event_States
'  FIXME: it would be nice to have the modifiers in the upper 8 bit so that
'         a unicode ke (24bit) can be sent as an unsigned with the modifiers.
  FL_SHIFT       = &H00010000 ' One of the shift keys is down
  FL_CAPS_LOCK   = &H00020000 ' The caps lock is on
  FL_CTRL        = &H00040000 ' One of the ctrl keys is down
  FL_ALT         = &H00080000 ' One of the alt keys is down
  FL_NUM_LOCK    = &H00100000 ' The num lock is on
  FL_META        = &H00400000 ' One of the meta/Windows keys is down
  FL_SCROLL_LOCK = &H00800000 ' The scroll lock is on
  FL_BUTTON1     = &H01000000 ' Mouse button 1 is pushed
  FL_BUTTON2     = &H02000000 ' Mouse button 2 is pushed
  FL_BUTTON3     = &H04000000 ' Mouse button 3 is pushed
  FL_BUTTONS     = &H7f000000 ' Any mouse button is pushed
  FL_KEY_MASK    = &H0000ffff ' All keys are 16 bit for now  FIXME: Unicode needs 24 bits!
end enum

#define Fl_COMMAND Fl_event_states.Fl_CTRL ' An alias for Fl_CTRL on WIN32 and X11, or Fl_META on MacOS X
#define Fl_CONTROL Fl_event_states.Fl_META ' An alias for Fl_META on WIN32 and X11, or Fl_CTRL on MacOS X
'#define Fl_BUTTON(n) (&H00800000 shl (n))  ' Mouse button n (n > 0) is pushed


enum FL_Mouse_Keyboard_Events Explicit
  '  FIXME: These codes collide with valid Unicode keys
  FL_Button      = &Hfee8 ' A mouse button; use FL_Button + n for mouse button n.
  FL_BackSpace   = &Hff08 ' The backspace key.
  FL_Tab         = &Hff09 ' The tab key.
  FL_Iso_Key     = &Hff0c ' The additional key of ISO keyboards.
  FL_Enter       = &Hff0d ' The enter key. 
  FL_Pause       = &Hff13 ' The pause key.
  FL_Scroll_Lock = &Hff14 ' The scroll lock key.
  FL_Escape      = &Hff1b ' The escape key.
  FL_Home        = &Hff50 ' The home key.
  FL_Left        = &Hff51 ' The left arrow key.
  FL_Up          = &Hff52 ' The up arrow key.
  FL_Right       = &Hff53 ' The right arrow key.
  FL_Down        = &Hff54 ' The down arrow key.
  FL_Page_Up     = &Hff55 ' The page-up key.
  FL_Page_Down   = &Hff56 ' The page-down key.
  FL_End         = &Hff57 ' The end key.
  FL_Print       = &Hff61 ' The print (or print-screen) key.
  FL_Insert      = &Hff63 ' The insert key. 
  FL_Menu        = &Hff67 ' The menu key.
  FL_Help        = &Hff68 ' The 'help' key on Mac keyboards
  FL_Num_Lock    = &Hff7f ' The num lock key.
  FL_KP          = &Hff80 ' One of the keypad numbers; use FL_KP + n for number n.
  FL_KP_Enter    = &Hff8d ' The enter key on the keypad, same as FL_KP+'\\r'.
  FL_KP_Last     = &Hffbd ' The last keypad key; use to range-check keypad.
  FL_F           = &Hffbd ' One of the function keys; use FL_F + n for function key n.
  FL_F_Last      = &Hffe0 ' The last function key; use to range-check function keys.
  FL_Shift_L     = &Hffe1 ' The lefthand shift key.
  FL_Shift_R     = &Hffe2 ' The righthand shift key.
  FL_Control_L   = &Hffe3 ' The lefthand control key.
  FL_Control_R   = &Hffe4 ' The righthand control key.
  FL_Caps_Lock   = &Hffe5 ' The caps lock key.
  FL_Meta_L      = &Hffe7 ' The left meta/Windows key.
  FL_Meta_R      = &Hffe8 ' The right meta/Windows key.
  FL_Alt_L       = &Hffe9 ' The left alt key.
  FL_Alt_R       = &Hffea ' The right alt key. 
  FL_Delete      = &Hffff ' The delete key.
end enum

enum FL_Event_Button
  FL_LEFT_MOUSE   = 1 ' The left mouse button
  FL_MIDDLE_MOUSE = 2 ' The middle mouse button
  FL_RIGHT_MOUSE  = 3 ' The right mouse button
end enum

enum FL_FileIconTypes
  FL_FILEICON_ANY = 0   ' Any kind of file
  FL_FILEICON_PLAIN     ' Only plain files
  FL_FILEICON_FIFO      ' Only named pipes
  FL_FILEICON_DEVICE    ' Only character and block devices
  FL_FILEICON_LINK      ' Only symbolic links
  FL_FILEICON_DIRECTORY ' Only directories
end enum

enum FL_DataOpcodes
  FL_DATAOPCODE_END = 0        ' End of primitive/icon
  FL_DATAOPCODE_COLOR          ' Followed by color value (2 shorts)
  FL_DATAOPCODE_LINE           ' Start of line
  FL_DATAOPCODE_CLOSEDLINE     ' Start of closed line
  FL_DATAOPCODE_POLYGON        ' Start of polygon
  FL_DATAOPCODE_OUTLINEPOLYGON ' Followed by outline color (2 shorts)
  FL_DATAOPCODE_VERTEX         ' Followed by scaled X,Y
end enum


enum Fl_FileType
  FL_FILETYPE_FILES = 0
  FL_FILETYPE_DIRECTORIES
end enum

enum Fl_FileChooserType
  FL_SINGLE    = 0 ' allows the user to select a single, existing file.
  FL_MULTI     = 1 ' allows the user to select one or more existing files.
  FL_CREATE    = 2 ' allows the user to select a single, existing file or specify a new filename.
  FL_DIRECTORY = 4 ' allows the user to select a single, existing directory.
end enum

enum FL_Labeltype
  FL_LABEL_NORMAL = 0
  FL_LABEL_NO
  FL_LABEL_SHADOW
  FL_LABEL_ENGRAVED
  FL_LABEL_EMBOSSED
  FL_LABEL_MULTI
  FL_LABEL_ICON
  FL_LABEL_IMAGE
  FL_FREE_LABELTYPE
end enum

enum Fl_InputType
  FL_INPUT_NORMAL                = 0
  FL_INPUT_FLOAT                 = 1
  FL_INPUT_INT                   = 2
  FL_INPUT_MULTILINE             = 4
  FL_INPUT_SECRET                = 5
  FL_INPUT_TYPE                  = 7
  FL_INPUT_READONLY              = 8
  FL_INPUT_NORMAL_OUTPUT         = FL_INPUT_NORMAL    or FL_INPUT_READONLY
  FL_INPUT_MULTILINE_OUTPUT      = FL_INPUT_MULTILINE or FL_INPUT_READONLY
  FL_INPUT_WRAP                  = 16
  FL_INPUT_MULTILINE_WRAP        = FL_INPUT_MULTILINE or FL_INPUT_WRAP
  FL_INPUT_MULTILINE_OUTPUT_WRAP = FL_INPUT_MULTILINE or FL_INPUT_READONLY or FL_INPUT_WRAP
end enum

enum Fl_LineStyle
  FL_SOLID      = 0      ' line style: ___________
  FL_DASH       = 1      ' line style: _ _ _ _ _ _
  FL_DOT        = 2      ' line style: . . . . . .
  FL_DASHDOT    = 3      ' line style: _ . _ . _ .
  FL_DASHDOTDOT = 4      ' line style: _ . . _ . .

  FL_CAP_FLAT   = &H0100 ' cap style: end is flat
  FL_CAP_ROUND  = &H0200 ' cap style: end is round
  FL_CAP_SQUARE = &H0300 ' cap style: end wraps end point

  FL_JOIN_MITER = &H1000 ' join style: line join extends to a point
  FL_JOIN_ROUND = &H2000 ' join style: line join is rounded
  FL_JOIN_BEVEL = &H3000 ' join style: line join is tidied
end enum

enum Fl_LinePosition 
  FL_TOP = 0
  FL_BOTTOM
  FL_MIDDLE
end enum

enum Fl_MenuButtonPopupType
  POPUP1 = 1
  POPUP2
  POPUP12
  POPUP3
  POPUP13
  POPUP23
  POPUP123
end enum

enum Fl_MenuItemFlag
  FL_MENU_INACTIVE   = &H001 ' Deactivate menu item (gray out)
  FL_MENU_TOGGLE     = &H002 ' Item is a checkbox toggle (shows checkbox for on/off state)
  FL_MENU_VALUE      = &H004 ' The on/off state for checkbox/radio buttons (if set, state is 'on')
  FL_MENU_RADIO      = &H008 ' Item is a radio button (one checkbox of many can be on)
  FL_MENU_INVISIBLE  = &H010 ' Item will not show up (shortcut will work)
  FL_SUBMENU_POINTER = &H020 ' Indicates user_data() is a pointer to another menu array
  FL_SUBMENU         = &H040 ' This item is a submenu to other items
  FL_MENU_DIVIDER    = &H080 ' Creates divider line below this item. Also ends a group of radio buttons.
  FL_MENU_HORIZONTAL = &H100 ' reserved
end enum

' Fl_Gl_Window mode (values match Glut)
enum Fl_Mode
  FL_MODE_RGB         =   0
  FL_MODE_SINGLE      =   0
  FL_MODE_INDEX       =   1
  FL_MODE_DOUBLE      =   2
  FL_MODE_ACCUM       =   4
  FL_MODE_ALPHA       =   8
  FL_MODE_DEPTH       =  16
  FL_MODE_STENCIL     =  32
  FL_MODE_RGB8        =  64
  FL_MODE_MULTISAMPLE = 128
  FL_MODE_STEREO      = 256
  FL_MODE_FAKE_SINGLE = 512 '  Fake single buffered windows using double-buffer
end enum

enum FL_Option
  FL_OPTION_ARROW_FOCUS = 0
  FL_OPTION_VISIBLE_FOCUS
  FL_OPTION_DND_TEXT
  FL_OPTION_SHOW_TOOLTIPS
  FL_OPTION_LAST
end enum

enum FL_Pack_Type
  FL_PACK_VERTICAL = 0
  FL_PACK_HORIZONTAL
end enum

enum FL_ScrollType
  FL_SCROLL_NO         = 0    ' No scrollbars.
  FL_SCROLL_HORIZONTAL        ' Only a horizontal scrollbar. 
  FL_SCROLL_VERTICAL          ' Only a vertical scrollbar.
  FL_SCROLL_BOTH
  FL_SCROLL_ALWAYS_ON
  FL_SCROLL_HORIZONTAL_ALWAYS ' Horizontal scrollbar always on, vertical always off.
  FL_SCROLL_VERTICAL_ALWAYS   ' Vertical scrollbar always on, horizontal always off.
  FL_SCROLL_BOTH_ALWAYS
end enum

enum FL_SliderType
  FL_SLIDER_VERT       = 0
  FL_SLIDER_HOR_SLIDER
  FL_SLIDER_VERT_FILL  ' Draws a filled vertical slider, useful as a progress or value meter.
  FL_SLIDER_HOR_FILL   ' Draws a filled horizontal slider, useful as a progress or value meter.
  FL_SLIDER_VERT_NICE  ' Draws a vertical slider with a nice looking control knob.
  FL_SLIDER_HOR_NICE   ' Draws a horizontal slider with a nice looking control knob.
end enum

enum FL_TableContext
  FL_CONTEXT_NONE       = &H00 ' no known context
  FL_CONTEXT_STARTPAGE  = &H01 ' before a page is redrawn
  FL_CONTEXT_ENDPAGE    = &H02 ' after a page is redrawn
  FL_CONTEXT_ROW_HEADER = &H04 ' in the row header
  FL_CONTEXT_COL_HEADER = &H08 ' in the col header
  FL_CONTEXT_CELL       = &H10 ' in one of the cells
  FL_CONTEXT_TABLE      = &H20 ' in a dead zone of table
  FL_CONTEXT_RC_RESIZE  = &H40 ' column or row being resized 
end enum

enum FL_TableRowSelectMode
  FL_SELECT_NONE
  FL_SELECT_SINGLE
  FL_SELECT_MULTI
end enum

enum Fl_Tree_Reason         ' The reason the callback was invoked.
  FL_TREE_REASON_NONE = 0   ' unknown reason
  FL_TREE_REASON_SELECTED   ' an item was selected
  FL_TREE_REASON_DESELECTED ' an item was de-selected
  FL_TREE_REASON_OPENED     ' an item was opened
  FL_TREE_REASON_CLOSED     ' an item was closed 
end enum

enum Fl_Tree_Connector       ' Defines the style of connection lines between items.
  FL_TREE_CONNECTOR_NONE = 0 ' Use no lines connecting items.
  FL_TREE_CONNECTOR_DOTTED   ' Use dotted lines connecting items (default)
  FL_TREE_CONNECTOR_SOLID    ' Use solid lines connecting items.
end enum

enum Fl_Tree_Select       ' Tree selection style.
  FL_TREE_SELECT_NONE = 0 ' Nothing selected when items are clicked.
  FL_TREE_SELECT_SINGLE   ' Single item selected when item is clicked (default)
  FL_TREE_SELECT_MULTI    ' Multiple items can be selected by clicking with SHIFT, CTRL or mouse drags.
end enum

enum Fl_Tree_Sort         ' Sort order options for items added to the tree.
  FL_TREE_SORT_NONE = 0   ' No sorting; items are added in the order defined (default).
  FL_TREE_SORT_ASCENDING  ' Add items in ascending sort order.
  FL_TREE_SORT_DESCENDING ' Add items in descending sort order. 
end enum

enum Fl_ValuatorType
  FL_VALUATOR_VERTICAL = 0 ' The valuator can work vertically
  FL_VALUATOR_HORIZONTAL   ' The valuator can work horizontally
end enum

enum FL_When 'Explicit  '  Fl_WidgetWhen():
  FL_WHEN_NEVER             = 0
  FL_WHEN_CHANGED           = 1
  FL_WHEN_NOT_CHANGED       = 2
  FL_WHEN_RELEASE           = 4
  FL_WHEN_RELEASE_ALWAYS    = FL_WHEN_RELEASE + FL_WHEN_NOT_CHANGED
  FL_WHEN_ENTER_KEY         = 8
  FL_WHEN_ENTER_KEY_ALWAYS  = FL_WHEN_ENTER_KEY + FL_WHEN_NOT_CHANGED
  FL_WHEN_ENTER_KEY_CHANGED = FL_WHEN_ENTER_KEY + FL_WHEN_NOT_CHANGED + FL_WHEN_CHANGED
end enum

enum FD_When    '  values for "when" passed to Fl_Add_fd()
  FL_READ   = 1 ' Call the callback when there is data to be read.
  FL_WRITE  = 4 ' Call the callback when data can be written without blocking.
  FL_EXCEPT = 8 ' Call the callback if an exception occurs on the file.
end enum

#define Fl_IMAGE_WITH_ALPHA &H40000000
#define Fl_RESERVED_TYPE 100

' FLTK (simple) data types
type Fl_Fontsize  as integer           ' Size of a font in pixels. This is the approximate height of a font in pixels.
type Fl_String    as zstring ptr       ' Flexible length utf8 Unicode text.
type Fl_CString   as const zstring ptr ' Flexible length utf8 Unicode read-only string.
type Fl_Shortcut  as uinteger          ' 24-bit Unicode character + 8-bit indicator for keyboard flags
type Fl_Char      as uinteger          ' 24-bit Unicode character - upper 8-bits are unuse
type Fl_intptr_t  as long
type Fl_uintptr_t as ulong
type Fl_Socket    as integer

type Style_Table_Entry
  as Fl_Color    color
  as Fl_Font     font
  as Fl_Fontsize size
  as uinteger    attr
end type


type Fl_Text_Selection
  private:
  as integer dummy
end type

type Fl_Text_Buffer
  private:
  as integer dummy
end type

type Fl_Tree_Item
  private:
  as integer dummy
end type

type Fl_File_Chooser
  private:
  as integer dummy
end type

'#define USE_CLASS_OPERATOR

#macro Fl_Extends1(_e_,_a)
type Fl_##_e_ extends Fl_##_a
  declare function _e_ as Fl_##_e_ ptr
  declare operator cast as Fl_##_a ptr
  private:
  as integer Dummy
end type
function Fl_##_e_.##_e_ as Fl_##_e_ ptr : return     @this : end function
operator Fl_##_e_.cast  as Fl_##_a  ptr : operator = @this : end operator
#endmacro

#macro Fl_Extends2(_e_,_a,_b)
type Fl_##_e_ extends Fl_##_a
  declare function _e_ as Fl_##_e_ ptr
  declare operator cast as Fl_##_a ptr
  declare operator cast as Fl_##_b ptr
  private:
  as integer Dummy
end type
function Fl_##_e_.##_e_ as Fl_##_e_ ptr : return     @this : end function
operator Fl_##_e_.cast  as Fl_##_a  ptr : operator = @this : end operator
operator Fl_##_e_.cast  as Fl_##_b  ptr : operator = @this : end operator
#endmacro

#macro Fl_Extends3(_e_,_a,_b,_c)
type Fl_##_e_ extends Fl_##_a
  declare function _e_ as Fl_##_e_ ptr
  declare operator cast as Fl_##_a ptr
  declare operator cast as Fl_##_b ptr
  declare operator cast as Fl_##_c ptr
  private:
  as integer Dummy
end type
function Fl_##_e_.##_e_ as Fl_##_e_ ptr : return     @this : end function
operator Fl_##_e_.cast  as Fl_##_a  ptr : operator = @this : end operator
operator Fl_##_e_.cast  as Fl_##_b  ptr : operator = @this : end operator
operator Fl_##_e_.cast  as Fl_##_c  ptr : operator = @this : end operator
#endmacro

#macro Fl_Extends4(_e_,_a,_b,_c,_d)
type Fl_##_e_ extends Fl_##_a
  declare function _e_ as Fl_##_e_ ptr
  declare operator cast as Fl_##_a ptr
  declare operator cast as Fl_##_b ptr
  declare operator cast as Fl_##_c ptr
  declare operator cast as Fl_##_d ptr
  private:
  as integer Dummy
end type
function Fl_##_e_.##_e_ as Fl_##_e_ ptr : return     @this : end function
operator Fl_##_e_.cast  as Fl_##_a  ptr : operator = @this : end operator
operator Fl_##_e_.cast  as Fl_##_b  ptr : operator = @this : end operator
operator Fl_##_e_.cast  as Fl_##_c  ptr : operator = @this : end operator
operator Fl_##_e_.cast  as Fl_##_d  ptr : operator = @this : end operator
#endmacro

#macro Fl_Extends5(_e_,_a,_b,_c,_d,_e)
type Fl_##_e_ extends Fl_##_a
  declare function _e_ as Fl_##_e_ ptr
  declare operator cast as Fl_##_a ptr
  declare operator cast as Fl_##_b ptr
  declare operator cast as Fl_##_c ptr
  declare operator cast as Fl_##_d ptr
  declare operator cast as Fl_##_e ptr
  private:
  as integer Dummy
end type
function Fl_##_e_.##_e_ as Fl_##_e_ ptr : return     @this : end function
operator Fl_##_e_.cast  as Fl_##_a  ptr : operator = @this : end operator
operator Fl_##_e_.cast  as Fl_##_b  ptr : operator = @this : end operator
operator Fl_##_e_.cast  as Fl_##_c  ptr : operator = @this : end operator
operator Fl_##_e_.cast  as Fl_##_d  ptr : operator = @this : end operator
operator Fl_##_e_.cast  as Fl_##_e  ptr : operator = @this : end operator
#endmacro



' FLTK image classes
type Fl_Image
  declare function AsAny as any ptr
  private:
  as integer Dummy
end type
function Fl_Image.AsAny as any ptr : return @this : end function


Fl_Extends1(Shared_Image,Image)
Fl_Extends1(Bitmap,Image)
 Fl_Extends2(XBM_Image,Bitmap,Image)
Fl_Extends1(Pixmap,Image)
 Fl_Extends2(XPM_Image,Pixmap,Image)
 Fl_Extends2(GIF_Image,Pixmap,Image)
Fl_Extends1(RGB_Image,Image)
 Fl_Extends2(BMP_Image,RGB_Image,Image)
 Fl_Extends2(PNG_Image,RGB_Image,Image)
 Fl_Extends2(JPEG_Image,RGB_Image,Image)
 Fl_Extends2(PNM_Image,RGB_Image,Image)
Fl_Extends1(Tiled_Image,Image)

' FLTK widget base class
type Fl_Widget
  declare function AsAny as any ptr
  private:
  as integer Dummy
end type
function Fl_Widget.AsAny as any ptr : return @this : end function


' FLTK extended widget classes
Fl_Extends1(Box,Widget)
 Fl_Extends2(BoxEx,Box,Widget)

Fl_Extends1(Button,Widget)
 Fl_Extends2(ButtonEx,Button,Widget)
 Fl_Extends2(Radio_Button,Button,Widget)
  Fl_Extends3(Radio_ButtonEx,Radio_Button,Button,Widget)
 Fl_Extends2(Repeat_Button,Button,Widget)
  Fl_Extends3(Repeat_ButtonEx,Repeat_Button,Button,Widget)
 Fl_Extends2(Return_Button,Button,Widget)
  Fl_Extends3(Return_ButtonEx,Return_Button,Button,Widget)
 Fl_Extends2(Toggle_Button,Button,Widget)
  Fl_Extends3(Toggle_ButtonEx,Toggle_Button,Button,Widget)
 Fl_Extends2(Light_Button,Button,Widget)
  Fl_Extends3(Light_ButtonEx,Light_Button,Button,Widget)
  Fl_Extends3(Check_Button,Light_Button,Button,Widget)
   Fl_Extends4(Check_ButtonEx,Check_Button,Light_Button,Button,Widget)
  Fl_Extends3(Radio_Light_Button,Light_Button,Button,Widget)
   Fl_Extends4(Radio_Light_ButtonEx,Radio_Light_Button,Light_Button,Button,Widget)
  Fl_Extends3(Round_Button,Light_Button,Button,Widget)
   Fl_Extends4(Round_ButtonEx,Round_Button,Light_Button,Button,Widget)
  Fl_Extends3(Radio_Round_Button,Light_Button,Button,Widget)
   Fl_Extends4(Radio_Round_ButtonEx,Radio_Round_Button,Light_Button,Button,Widget)

Fl_Extends1(Chart,Widget)
 Fl_Extends2(ChartEx,Chart,Widget)

Fl_Extends1(Clock_Output,Widget)
 Fl_Extends2(Clock_OutputEx,Clock_Output,Widget)
 Fl_Extends2(Clock,Clock_Output,Widget)
  Fl_Extends3(ClockEx,Clock,Clock_Output,Widget)
  Fl_Extends3(Round_Clock,Clock,Clock_Output,Widget)
   Fl_Extends4(Round_ClockEx,Round_Clock,Clock,Clock_Output,Widget)

Fl_Extends1(Label,Widget)

Fl_Extends1(Menu_,Widget)
 Fl_Extends2(Menu_Bar,Menu_,Widget)
  Fl_Extends3(Menu_BarEx,Menu_Bar,Menu_,Widget)
 Fl_Extends2(Menu_Button,Menu_,Widget)
  Fl_Extends3(Menu_ButtonEx,Menu_Button,Menu_,Widget)
 Fl_Extends2(Choice,Menu_,Widget)
  Fl_Extends3(ChoiceEx,Choice,Menu_,Widget)

Fl_Extends1(Input_,Widget)
 Fl_Extends2(Input,Input_,Widget)
  Fl_Extends3(InputEx,Input,Input_,Widget)
  Fl_Extends3(File_Input,Input,Input_,Widget)
   Fl_Extends4(File_InputEx,File_Input,Input,Input_,Widget)
  Fl_Extends3(Float_Input,Input,Input_,Widget)
   Fl_Extends4(Float_InputEx,Float_Input,Input,Input_,Widget)
  Fl_Extends3(Int_Input,Input,Input_,Widget)
   Fl_Extends4(Int_InputEx,Int_Input,Input,Input_,Widget)
  Fl_Extends3(Multiline_Input,Input,Input_,Widget)
   Fl_Extends4(Multiline_InputEx,Multiline_Input,Input,Input_,Widget)
  Fl_Extends3(Secret_Input,Input,Input_,Widget)
   Fl_Extends4(Secret_InputEx,Secret_Input,Input,Input_,Widget)
  Fl_Extends3(Output,Input,Input_,Widget)
   Fl_Extends4(OutputEx,Output,Input,Input_,Widget)
   Fl_Extends4(Multiline_Output,Output,Input,Input_,Widget)
   Fl_Extends5(Multiline_OutputEx,Multiline_Output,Output,Input,Input_,Widget)

Fl_Extends1(Progress,Widget)
 Fl_Extends2(ProgressEx,Progress,Widget)

Fl_Extends1(Valuator,Widget)
 Fl_Extends2(Adjuster,Valuator,Widget)
  Fl_Extends3(AdjusterEx,Adjuster,Valuator,Widget)
 Fl_Extends2(Counter,Valuator,Widget)
  Fl_Extends3(CounterEx,Counter,Valuator,Widget)
  Fl_Extends3(Simple_Counter,Counter,Valuator,Widget)
   Fl_Extends4(Simple_CounterEx,Simple_Counter,Counter,Valuator,Widget)
 Fl_Extends2(Dial,Valuator,Widget)
  Fl_Extends3(DialEx,Dial,Valuator,Widget)
  Fl_Extends3(Fill_Dial,Dial,Valuator,Widget)
   Fl_Extends4(Fill_DialEx,Fill_Dial,Dial,Valuator,Widget)
  Fl_Extends3(Line_Dial,Dial,Valuator,Widget)
   Fl_Extends4(Line_DialEx,Line_Dial,Dial,Valuator,Widget)
 Fl_Extends2(Roller,Valuator,Widget)
  Fl_Extends3(RollerEx,Roller,Valuator,Widget)
 Fl_Extends2(Slider,Valuator,Widget)
  Fl_Extends3(SliderEx,Slider,Valuator,Widget)
  Fl_Extends3(Scrollbar,Slider,Valuator,Widget)
   Fl_Extends4(ScrollbarEx,Scrollbar,Slider,Valuator,Widget)
  Fl_Extends3(Hor_Slider,Slider,Valuator,Widget)
   Fl_Extends4(Hor_SliderEx,Hor_Slider,Slider,Valuator,Widget)
  Fl_Extends3(Fill_Slider,Slider,Valuator,Widget)
   Fl_Extends4(Fill_SliderEx,Fill_Slider,Slider,Valuator,Widget)
  Fl_Extends3(Hor_Fill_Slider,Slider,Valuator,Widget)
   Fl_Extends4(Hor_Fill_SliderEx,Hor_Fill_Slider,Slider,Valuator,Widget)
  Fl_Extends3(Nice_Slider,Slider,Valuator,Widget)
   Fl_Extends4(Nice_SliderEx,Nice_Slider,Slider,Valuator,Widget)
  Fl_Extends3(Hor_Nice_Slider,Slider,Valuator,Widget)
   Fl_Extends4(Hor_Nice_SliderEx,Hor_Nice_Slider,Slider,Valuator,Widget)
  Fl_Extends3(Value_Slider,Slider,Valuator,Widget)
   Fl_Extends4(Value_SliderEx,Value_Slider,Slider,Valuator,Widget)
   Fl_Extends4(Hor_Value_Slider,Value_Slider,Slider,Valuator,Widget)
    Fl_Extends5(Hor_Value_SliderEx,Hor_Value_Slider,Value_Slider,Slider,Valuator,Widget)

 Fl_Extends2(Value_Input,Valuator,Widget)
  Fl_Extends3(Value_InputEx,Value_Input,Valuator,Widget)
 Fl_Extends2(Value_Output,Valuator,Widget)
  Fl_Extends3(Value_OutputEx,Value_Output,Valuator,Widget)

Fl_Extends1(Group,Widget)
 Fl_Extends2(GroupEx,Group,Widget)
 Fl_Extends2(Pack,Group,Widget)
  Fl_Extends3(PackEx,Pack,Group,Widget)
 Fl_Extends2(Tile,Group,Widget)
  Fl_Extends3(TileEx,Tile,Group,Widget)
 Fl_Extends2(Scroll,Group,Widget)
  Fl_Extends3(ScrollEx,Scroll,Group,Widget)


 Fl_Extends2(Browser_,Group,Widget)
  Fl_Extends3(Check_Browser,Browser_,Group,Widget)
   Fl_Extends4(Check_BrowserEx,Check_Browser,Browser_,Group,Widget)

  Fl_Extends3(Browser,Browser_,Group,Widget)
   Fl_Extends4(BrowserEx,Browser,Browser_,Group,Widget)
   Fl_Extends4(File_Browser,Browser,Browser_,Group,Widget)
    Fl_Extends5(File_BrowserEx,File_Browser,Browser,Browser_,Group,Widget)
   Fl_Extends4(Hold_Browser,Browser,Browser_,Group,Widget)
    Fl_Extends5(Hold_BrowserEx,Hold_Browser,Browser,Browser_,Group,Widget)
   Fl_Extends4(Multi_Browser,Browser,Browser_,Group,Widget)
    Fl_Extends5(Multi_BrowserEx,Multi_Browser,Browser,Browser_,Group,Widget)
   Fl_Extends4(Select_Browser,Browser,Browser_,Group,Widget)
    Fl_Extends5(Select_BrowserEx,Select_Browser,Browser,Browser_,Group,Widget)

 Fl_Extends2(Color_Chooser,Group,Widget)
  Fl_Extends3(Color_ChooserEx,Color_Chooser,Group,Widget)

 Fl_Extends2(Help_View,Group,Widget)

 Fl_Extends2(Input_Choice,Group,Widget)
  Fl_Extends3(Input_ChoiceEx,Input_Choice,Group,Widget)

 Fl_Extends2(Spinner,Group,Widget)
  Fl_Extends3(SpinnerEx,Spinner,Group,Widget)
  
 Fl_Extends2(Table,Group,Widget)
  Fl_Extends3(TableEx,Table,Group,Widget)
  Fl_Extends3(Table_Row,Table,Group,Widget)
   Fl_Extends4(Table_RowEx,Table_Row,Table,Group,Widget)

 Fl_Extends2(Tabs,Group,Widget)
  Fl_Extends3(TabsEx,Tabs,Group,Widget)

 Fl_Extends2(Text_Display,Group,Widget)
  Fl_Extends3(Text_DisplayEx,Text_Display,Group,Widget)
  Fl_Extends3(Text_Editor,Text_Display,Group,Widget)
   Fl_Extends4(Text_EditorEx,Text_Editor,Text_Display,Group,Widget)

 Fl_Extends2(Tree,Group,Widget)
  Fl_Extends3(TreeEx,Tree,Group,Widget)
 
 Fl_Extends2(Wizard,Group,Widget)

 Fl_Extends2(Window,Group,Widget)
  Fl_Extends3(WindowEx,Window,Group,Widget)
  Fl_Extends3(Single_Window,Window,Group,Widget)
   Fl_Extends4(Single_WindowEx,Single_Window,Window,Group,Widget)
   Fl_Extends4(Menu_Window,Single_Window,Window,Group,Widget)
    Fl_Extends5(Menu_WindowEx,Menu_Window,Single_Window,Window,Group,Widget)
  Fl_Extends3(Double_Window,Window,Group,Widget)
   Fl_Extends4(Double_WindowEx,Double_Window,Window,Group,Widget)
  Fl_Extends3(GL_Window,Window,Group,Widget)
   Fl_Extends4(GL_WindowEx,GL_Window,Window,Group,Widget)



type Fl_Device
  declare function AsAny as any ptr
  private:
  as integer Dummy
end type
function Fl_Device.AsAny as any ptr : return @this : end function

Fl_Extends1(Graphics_Driver,Device)
Fl_Extends1(Surface_Device,Device)
 Fl_Extends2(Paged_Device,Surface_Device,Device)
  Fl_Extends3(Printer,Paged_Device,Surface_Device,Device)

' DeclareEx() extend a Fl_class with user defined callbacks !!! cdecl !!!
' sub DrawEx cdecl (self as any ptr)
' function HandleEx cdecl (self as any ptr, event as Fl_Event)
' sub ResizeEx cdecl (self as any ptr, x as integer, y as integer, w as integer, h as integer)
#macro DeclareEx(_name_)
declare function _name_##ExNew(x as integer, y as integer, w as integer, h as integer, title as const zstring ptr=0) as _name_##Ex ptr
declare sub      _name_##ExSetDrawCB(ex as _name_##Ex ptr, cb as Fl_DrawEx)
declare sub      _name_##ExSetHandleCB(ex as _name_##Ex ptr, cb as Fl_HandleEx)
declare sub      _name_##ExSetResizeCB(ex as _name_##Ex ptr, cb as Fl_ResizeEx)
#endmacro

' DeclareWindow() extends a FLTK window class with two constructors
' new(w,h,label=0) and new2(x,y,w,h,label=0)
#macro DeclareWindow(_name_)
declare function _name_##ExNew(w as integer, h as integer, title as const zstring ptr=0) as _name_##Ex ptr
declare function _name_##ExNew2(x as integer, y as integer, w as integer, h as integer, title as const zstring ptr=0) as _name_##Ex ptr
declare sub      _name_##ExSetDrawCB(ex as _name_##Ex ptr, cb as Fl_DrawEx)
declare sub      _name_##ExSetHandleCB(ex as _name_##Ex ptr, cb as Fl_HandleEx)
declare sub      _name_##ExSetResizeCB(ex as _name_##Ex ptr, cb as Fl_ResizeEx)
#endmacro


extern "c"

' FLTK callback's !!! CDECL !!!
type Fl_Abort_Handler    as sub      (format as const zstring ptr,...)
type Fl_Args_Handler     as function (argc as integer, argv as zstring ptr ptr, byref i as integer) as integer
type Fl_Atclose_Handler  as sub      (win as Fl_Window ptr, userdata as any ptr)
type Fl_Awake_Handler    as sub      (userdata as any ptr)
type Fl_Box_Draw_F       as sub      (x as integer, y as integer, w as integer, h as integer, c as Fl_Color)
type Fl_Event_Dispatch   as function (event as Fl_Event, win as Fl_Window ptr) as integer
type Fl_Event_Handler    as function (event as Fl_Event) as integer
type Fl_FD_Handler       as sub      (fd as Fl_SOCKET, userdata as any ptr)
type Fl_Idle_Handler     as sub      (userdata as any ptr)
type Fl_Label_Draw_F     as sub      (label as const Fl_Label ptr, x as integer, y as integer, w as integer, h as integer, align as Fl_Align)
type Fl_Label_Measure_F  as sub      (label as const Fl_Label ptr, byref w as integer, byref h as integer)
type Fl_Old_Idle_Handler as sub      ()
type Fl_Timeout_Handler  as sub      (userdata as any ptr)

type Fl_DrawEx           as sub      (self as any ptr)
type Fl_DrawCellEx       as sub      (self as any ptr, context as Fl_TableContext, r as integer, c as integer, x as integer, y as integer, w as integer, h as integer)
type Fl_HandleEx         as function (self as any ptr, event as Fl_Event) as integer
type Fl_ResizeEx         as sub      (self as any ptr, x as integer, y as integer, w as integer, h as integer)

type Fl_Callback         as sub      (wgt as Fl_Widget ptr, pData as any ptr)
type Fl_Callback0        as sub      (wgt as Fl_Widget ptr)
type Fl_Callback1        as sub      (wgt as Fl_Widget ptr, lData as long)
type Fl_Callback_p as Fl_Callback ptr

type Fl_Help_F           as function (wgt as Fl_Widget ptr, uri as const zstring ptr) as const zstring ptr 

type Fl_Text_Modify_Cb    as sub     (pos as integer, nInserted as integer, nDeleted as integer, nRestyled as integer, deletedText as const zstring ptr, cbArg as any ptr)
type Fl_Text_Predelete_Cb as sub     (pos as integer, nDeleted as integer, cbArg as any ptr)

type Unfinished_Style_Cb as sub      (i as integer, p as any ptr)
type Key_Func            as function (key as integer, editor as Fl_Text_Editor ptr) as integer

type Fl_Shared_Handler   as function (name as const zstring ptr, header as ubyte ptr, headerlen as integer) as Fl_Image ptr

type Fl_Draw_Image_Cb    as sub      (pUserData as any ptr, pixelstart as integer, scanline as integer, nPixels as integer, pScanline as ubyte ptr)

type Key_Binding
  as integer key
  as integer state
  as Key_Func function
  as Key_Binding ptr next
end type

type Fl_Menu_Item
  as const zstring ptr text  ' menu item text, returned by label()
  as integer     shortcut_   ' menu item shortcut
  as Fl_Callback cb_         ' menu item callback
  as any ptr     user_data_  ' menu item user_data for the menu's callback
  as integer     flags       ' menu item flags like FL_MENU_TOGGLE, FL_MENU_RADIO
  as ubyte       labeltype_  ' how the menu item text looks like
  as Fl_Font     labelfont_  ' which font for this menu item text
  as Fl_Fontsize labelsize_  ' size of menu item text
  as Fl_Color    labelcolor_ ' menu item text color
end type

'########
'# UTF8 #
'########
' Return the number of bytes needed to encode the given UCS4 character in UTF8.
declare function Fl_utf8bytes(ucs as uinteger) as integer
' OD: returns the byte length of the first UTF-8 char sequence (returns -1 if not valid)
declare function Fl_utf8len(c as byte) as integer
' OD: returns the byte length of the first UTF-8 char sequence (returns +1 if not valid)
declare function Fl_utf8len1(c as byte) as integer
' OD: returns the number of Unicode chars in the UTF-8 string
declare function Fl_utf_nb_char(buf as const ubyte ptr, len as integer) as integer
' F2: Convert the next UTF8 char-sequence into a Unicode value (and say how many bytes were used)
declare function Fl_utf8decode(p as const zstring ptr, end as const zstring ptr, len as integer ptr) as uinteger
' F2: Encode a Unicode value into a UTF8 sequence, return the number of bytes used
declare function Fl_utf8encode(ucs as uinteger, buf as zstring ptr) as integer
' F2: Move forward to the next valid UTF8 sequence start betwen start and end
declare function Fl_utf8fwd(p as const zstring ptr, start as const zstring ptr, end as const zstring ptr) as const zstring ptr
' F2: Move backward to the previous valid UTF8 sequence start
declare function Fl_utf8back(p as const zstring ptr, start as const zstring ptr, end as const zstring ptr) as const zstring ptr
' XX: Convert a single 32-bit Unicode value into UTF16
declare function Fl_ucs_to_Utf16(ucs as const uinteger, dst as ushort ptr, dstlen as const uinteger) as uinteger
' F2: Convert a UTF8 string into UTF16
declare function Fl_utf8toUtf16(src as const zstring ptr, srclen as uinteger, dst as ushort ptr, dstlen as uinteger) as uinteger
' F2: Convert a UTF8 string into a wide character string - makes UTF16 on win32, "UCS4" elsewhere
declare function Fl_utf8towc(src as const zstring ptr, srclen as uinteger, dst as wchar_t ptr, dstlen as uinteger) as uinteger
' F2: Convert a wide character string to UTF8 - takes in UTF16 on win32, "UCS4" elsewhere
declare function Fl_utf8fromwc(dst as zstring ptr, dstlen as uinteger, src as const wchar_t ptr, srclen as uinteger) as uinteger
' F2: Convert a UTF8 string into ASCII, eliding untranslatable glyphs
declare function Fl_utf8toa (src as const zstring ptr, srclen as uinteger, dst as zstring ptr, dstlen as uinteger) as uinteger
' F2: Convert 8859-1 string to UTF8
declare function Fl_utf8froma (dst as zstring ptr, dstlen as uinteger, src as const zstring ptr, srclen as uinteger) as uinteger
' F2: Returns true if the current O/S locale is UTF8
declare function Fl_utf8locale() as integer
/' F2: Examine the first len characters of src, to determine if the input text is UTF8 or not
 NOTE: The value returned is not simply boolean - it contains information about the probable type of the src text. '/
declare function Fl_utf8test(src as const zstring ptr, len as uinteger) as integer
/' XX: return width of "raw" ucs character in columns. for internal use only '/
declare function Fl_wcwidth_(ucs as uinteger) as integer
/' XX: return width of utf-8 character string in columns.
 NOTE: this may also do C1 control character (0x80 to 0x9f) to CP1252 mapping, depending on original build options '/
declare function Fl_wcwidth(src as const zstring ptr) as integer
' OD: Return true if the character is non-spacing
declare function Fl_nonspacing(ucs as uinteger) as uinteger
' F2: Convert UTF8 to a local multi-byte encoding - mainly for win32?
declare function Fl_utf8to_mb(src as const zstring ptr, srclen as uinteger, dst as zstring ptr, dstlen as uinteger) as uinteger
' OD: Convert UTF8 to a local multi-byte encoding
declare function Fl_utf2mbcs(src as const zstring ptr) as zstring ptr
' F2: Convert a local multi-byte encoding to UTF8 - mainly for win32?
declare function Fl_utf8from_mb(dst as zstring ptr, dstlen as uinteger, src as const zstring ptr, srclen as uinteger) as uinteger
#ifdef __FB_WIN32__
' OD: Attempt to convert the UTF8 string to the current locale
declare function Fl_utf8_to_locale(s as const zstring ptr, len as integer, codepage as uinteger) as zstring ptr
' OD: Attempt to convert a string in the current locale to UTF8
declare function Fl_locale_to_utf8(s as const zstring ptr, len as integer, codepage as uinteger) as zstring ptr
#endif

' The following functions are intended to provide portable, UTF8 aware versions of standard functions
' OD: UTF8 aware strncasecmp - converts to lower case Unicode and tests
declare function Fl_utf_strncasecmp(s1 as const zstring ptr, s2 as const zstring ptr, n as integer) as integer
' OD: UTF8 aware strcasecmp - converts to Unicode and tests
declare function Fl_utf_strcasecmp(s1 as const zstring ptr, s2 as const zstring ptr) as integer
' OD: return the Unicode lower case value of ucs
declare function Fl_tolower(ucs as uinteger) as integer
' OD: return the Unicode upper case value of ucs
declare function Fl_toupper(ucs as uinteger) as integer
' OD: converts the UTF8 string to the lower case equivalent
declare function Fl_utf_tolower(str as const ubyte ptr,len as integer, buf as zstring ptr) as integer
' OD: converts the UTF8 string to the upper case equivalent
declare function Fl_utf_toupper(str as const ubyte ptr, len as integer, buf as zstring ptr) as integer

' OD: Portable UTF8 aware chmod wrapper
declare function Fl_chmod(f as const zstring ptr, mode as integer) as integer
' OD: Portable UTF8 aware access wrapper
declare function Fl_access(f as const zstring ptr, mode as integer) as integer
' OD: Portable UTF8 aware stat wrapper             !!! buffer as stat ptr
declare function Fl_stat(path as const zstring ptr, buffer as any ptr) as integer
' OD: Portable UTF8 aware getcwd wrapper
declare function Fl_getcwd( buf as zstring ptr, maxlen as integer) as zstring ptr
' OD: Portable UTF8 aware fopen wrapper
declare function Fl_fopen(f as const zstring ptr, mode as const zstring ptr) as FILE ptr
' OD: Portable UTF8 aware system wrapper
declare function Fl_system(f as const zstring ptr) as integer
' OD: Portable UTF8 aware execvp wrapper
declare function Fl_execvp(file as const zstring ptr, argv as const zstring ptr ptr) as integer
' OD: Portable UTF8 aware open wrapper
declare function Fl_open(f as const zstring ptr, o as integer) as integer
' OD: Portable UTF8 aware unlink wrapper
declare function Fl_unlink(f as const zstring ptr) as integer
' OD: Portable UTF8 aware rmdir wrapper
declare function Fl_rmdir(f as const zstring ptr) as integer
' OD: Portable UTF8 aware getenv wrapper
declare function Fl_getenv(varname as const zstring ptr) as zstring ptr
' OD: Portable UTF8 aware execvp wrapper
declare function Fl_mkdir(f as const zstring ptr, mode as integer) as integer
' OD: Portable UTF8 aware rename wrapper
declare function Fl_rename(f as const zstring ptr, t as const zstring ptr) as integer
' OD: Given a full pathname, this will create the directory path needed to hold the file named
declare sub      Fl_make_path_for_file(path as const zstring ptr)
' OD: recursively create a path in the file system
declare function Fl_make_path(path as const zstring ptr) as byte

'##################
'# common dialogs #
'##################
declare sub      flAlert(msg as const zstring ptr)
declare function flChoice(msg as const zstring ptr, btn1 as const zstring ptr, btn2 as const zstring ptr=0, btn3 as const zstring ptr=0) as integer
declare sub      flBeep(t as Fl_Beep=FL_BEEP_DEFAULT)
declare function flColorChooser(name_ as const zstring ptr, byref r as ubyte, byref g as ubyte, byref b as ubyte, cmode as FL_ColorChooserModes) as integer
declare function flColorChooser2(name_ as const zstring ptr, byref r as double, byref g as double, byref b as double, cmode as FL_ColorChooserModes) as integer
declare function flDirChooser(message as const zstring ptr, fname as const zstring ptr, relative as integer) as zstring ptr
declare function flFileChooser(message as const zstring ptr, pat as const zstring ptr, fname as const zstring ptr, relative as integer) as zstring ptr
declare sub      flFileChooserCallback(cb as sub cdecl(file as const zstring ptr))
declare sub      flFileChooserOkLabel(label as const zstring ptr)
declare function flInput(fmt as const zstring ptr, def_str as const zstring ptr) as const zstring ptr
declare sub      flMessage(txt as const zstring ptr)
declare sub      flMessageSetHotspot(enable as integer)
declare function flMessageGetHotspot() as integer
declare function flMessageIcon() as Fl_Widget ptr
declare sub      flMessageTitle(title as const zstring ptr)
declare sub      flMessageTitleDefault(title as const zstring ptr)
declare function flPassword(fmt as const zstring ptr, def_str as const zstring ptr) as const zstring ptr

'#########################
'# class Fl_File_Chooser #
'#########################
declare function Fl_File_ChooserNew(pathname as const zstring ptr, pattern as const zstring ptr, typ as Fl_FileChooserType, title as const zstring ptr) as Fl_File_Chooser ptr

declare function Fl_File_ChooserAddExtra(fc as Fl_File_Chooser ptr, wgt as Fl_Widget ptr) as Fl_Widget ptr
declare sub      Fl_File_ChooserCallback(fc as Fl_File_Chooser ptr, cb as sub cdecl(self as Fl_File_Chooser ptr, userdata as any ptr), pdata as any ptr=0)
declare function Fl_File_ChooserCount(fc as Fl_File_Chooser ptr) as integer
declare sub      Fl_File_ChooserHide(fc as Fl_File_Chooser ptr)
declare sub      Fl_File_ChooserRescan(fc as Fl_File_Chooser ptr)
declare sub      Fl_File_ChooserRescanKeepFilename(fc as Fl_File_Chooser ptr)
declare sub      Fl_File_ChooserShow(fc as Fl_File_Chooser ptr)
declare function Fl_File_ChooserShown(fc as Fl_File_Chooser ptr) as integer

declare sub      Fl_File_ChooserSetColor(fc as Fl_File_Chooser ptr, c as Fl_Color)
declare function Fl_File_ChooserGetColor(fc as Fl_File_Chooser ptr) as Fl_Color

declare sub      Fl_File_ChooserSetDirectory(fc as Fl_File_Chooser ptr, d as const zstring ptr)
declare function Fl_File_ChooserGetDirectory(fc as Fl_File_Chooser ptr) as zstring ptr

declare sub      Fl_File_ChooserSetFilter(fc as Fl_File_Chooser ptr, f as const zstring ptr)
declare function Fl_File_ChooserGetFilter(fc as Fl_File_Chooser ptr) as const zstring ptr

declare sub      Fl_File_ChooserSetFilterValue(fc as Fl_File_Chooser ptr, f as integer)
declare function Fl_File_ChooserGetFilterValue(fc as Fl_File_Chooser ptr) as integer

declare sub      Fl_File_ChooserSetIconSize(fc as Fl_File_Chooser ptr, s as ubyte)
declare function Fl_File_ChooserGetIconSize(fc as Fl_File_Chooser ptr) as ubyte

declare sub      Fl_File_ChooserSetLabel(fc as Fl_File_Chooser ptr, l as const zstring ptr)
declare function Fl_File_ChooserGetLabel(fc as Fl_File_Chooser ptr) as const zstring ptr

declare sub      Fl_File_ChooserSetOkLabel(fc as Fl_File_Chooser ptr, l as const zstring ptr)
declare function Fl_File_ChooserGetOkLabel(fc as Fl_File_Chooser ptr) as const zstring ptr

declare sub      Fl_File_ChooserSetPreview(fc as Fl_File_Chooser ptr, e as integer)
declare function Fl_File_ChooserGetPreview(fc as Fl_File_Chooser ptr) as integer

declare sub      Fl_File_ChooserSetTextColor(fc as Fl_File_Chooser ptr, c as Fl_Color)
declare function Fl_File_ChooserGetTextColor(fc as Fl_File_Chooser ptr) as Fl_Color

declare sub      Fl_File_ChooserSetTextFont(fc as Fl_File_Chooser ptr, f as Fl_Font)
declare function Fl_File_ChooserGetTextFont(fc as Fl_File_Chooser ptr) as Fl_Font

declare sub      Fl_File_ChooserSetTextSize(fc as Fl_File_Chooser ptr, s as Fl_Fontsize)
declare function Fl_File_ChooserGetTextSize(fc as Fl_File_Chooser ptr) as Fl_Fontsize

declare sub      Fl_File_ChooserSetType(fc as Fl_File_Chooser ptr, t as integer)
declare function Fl_File_ChooserGetType(fc as Fl_File_Chooser ptr) as integer

declare sub      Fl_File_ChooserSetUserData(fc as Fl_File_Chooser ptr, pdata as any ptr)
declare function Fl_File_ChooserGetUserData(fc as Fl_File_Chooser ptr) as any ptr

declare sub      Fl_File_ChooserSetValue(fc as Fl_File_Chooser ptr, filename as const zstring ptr)
declare function Fl_File_ChooserGetValue(fc as Fl_File_Chooser ptr, f as integer=1) as const zstring ptr

declare function Fl_File_ChooserVisible(fc as Fl_File_Chooser ptr) as integer
declare function Fl_File_ChooserNewButton(fc as Fl_File_Chooser ptr) as Fl_Button ptr
declare function Fl_File_ChooserPreviewButton(fc as Fl_File_Chooser ptr) as Fl_Check_Button ptr
declare function Fl_File_ChooserShowHiddenButton(fc as Fl_File_Chooser ptr) as Fl_Check_Button ptr

'################
'# FLTK Drawing #
'################
declare sub      DrawSetColor(c as Fl_Color)
declare sub      DrawSetRGBColor(r as ubyte, g as ubyte, b as ubyte)
declare function DrawGetColor() as Fl_Color

declare sub      DrawPushNoClip()
declare sub      DrawPushClip(x as integer, y as integer, w as integer, h as integer)
declare sub      DrawPopClip()
declare sub      DrawRestoreClip()

declare function DrawNotClipped(x as integer, y as integer, w as integer, h as integer) as integer
declare function DrawClipBox(         x as integer,          y as integer,          w as integer,          h as integer, _
                             byref retx as integer, byref rety as integer, byref retw as integer, byref reth as integer) as integer

declare sub      DrawSetLineStyle(style as Fl_LineStyle, w as integer=0, dashes as zstring ptr=0)
' Draw a single pixel at the given coordinates.
declare sub      DrawPoint(x as integer, y as integer)

' Draw a 1-pixel border inside this bounding box.
declare sub      DrawRect(x as integer, y as integer, w as integer, h as integer)
declare sub      DrawRectColor(x as integer, y as integer, w as integer, h as integer, c as Fl_Color)
' Color a rectangle that exactly fills the given bounding box.
declare sub      DrawRectFill        (x as integer, y as integer, w as integer, h as integer)
declare sub      DrawRectFillColor   (x as integer, y as integer, w as integer, h as integer, c as Fl_Color)
declare sub      DrawRectFillRGBColor(x as integer, y as integer, w as integer, h as integer, r as ubyte, g as ubyte, b as ubyte)

declare sub      DrawFrame (s as const zstring ptr, x as integer, y as integer, w as integer, h as integer)
declare sub      DrawFrame2(s as const zstring ptr, x as integer, y as integer, w as integer, h as integer)

declare sub      DrawBox(bt as Fl_Boxtype, x as integer, y as integer, w as integer, h as integer, c as Fl_Color)

' Draw one or two lines between the given points.
declare sub      DrawLine (x1 as integer, y1 as integer, x2 as integer, y2 as integer)
declare sub      DrawLine2(x1 as integer, y1 as integer, x2 as integer, y2 as integer, x3 as integer, y3 as integer)

' Outline a 3 or 4-sided polygon with lines.
declare sub      DrawLoop (x1 as integer, y1 as integer, x2 as integer, y2 as integer, x3 as integer, y3 as integer)
declare sub      DrawLoop2(x1 as integer, y1 as integer, x2 as integer, y2 as integer, x3 as integer, y3 as integer, x4 as integer, y4 as integer)

' Fill a 3 or 4-sided polygon. The polygon must be convex.
declare sub      DrawPolygon (x1 as integer, y1 as integer, x2 as integer, y2 as integer, x3 as integer, y3 as integer)
declare sub      DrawPolygon2(x1 as integer, y1 as integer, x2 as integer, y2 as integer, x3 as integer, y3 as integer, x4 as integer, y4 as integer)

' Draw horizontal and vertical lines. A horizontal line is drawn first, then a vertical, then a horizontal.
declare sub      DrawXYLine(x as integer, y as integer, x1 as integer)
declare sub      DrawXYLine2(x as integer, y as integer, x1 as integer, y1 as integer)
declare sub      DrawXYLine3(x as integer, y as integer, x1 as integer, y1 as integer, x2 as integer)

' Draw vertical and horizontal lines. A vertical line is drawn first, then a horizontal, then a vertical.
declare sub      DrawYXLine(x as integer, y as integer, y1 as integer)
declare sub      DrawYXLine2(x as integer, y as integer, y1 as integer, x2 as integer)
declare sub      DrawYXLine3(x as integer, y as integer, y1 as integer, x2 as integer, y2 as integer)

' DrawArc() draws a series of lines to approximate the arc.
declare sub      DrawArc(x as integer, y as integer, w as integer, h as integer, a1 as double, a2 as double)
declare sub      DrawArc2(x as double, y as double, r as double, start as double, end_ as double)

' DrawPie() draws a filled-in pie slice. 
declare sub      DrawPie(x as integer, y as integer, w as integer, h as integer, a1 as double, a2 as double)

' DrawCircle() is equivalent to DrawArc(0,360) but may be faster
declare sub      DrawCircle(x as double, y as double, r as double)

' Add a series of points on a Bezier curve to the path.
declare sub      DrawCurve(x0 as double, y0 as double, x1 as double, y1 as double, x2 as double, y2 as double, x3 as double, y3 as double)


declare sub      DrawPushMatrix()
declare sub      DrawPopMatrix()
declare sub      DrawMultMatrix(a as double, b as double, c as double, d as double, x as double, y as double)

declare sub      DrawScale(s as double)
declare sub      DrawScaleXY(sx as double, sy as double)
declare sub      DrawRotate(r as double)
declare sub      DrawTranslate(tx as double, ty as double)

declare sub      DrawBeginPoints()
declare sub      DrawEndPoints()
declare sub      DrawBeginLine()
declare sub      DrawEndLine()
declare sub      DrawBeginLoop()
declare sub      DrawEndLoop()
declare sub      DrawBeginPolygon()
declare sub      DrawEndPolygon()
declare sub      DrawBeginComplexPolygon()
declare sub      DrawEndComplexPolygon()
declare sub      DrawVertex(x as double, y as double)

declare function DrawTransformX(x as double, y as double) as double
declare function DrawTransformY(x as double, y as double) as double
declare function DrawTransformDX(x as double, y as double) as double
declare function DrawTransformDY(x as double, y as double) as double
declare sub      DrawTransformedVertex(xf as double, yf as double)

declare sub      DrawSetFont(font as Fl_Font, size as Fl_Fontsize)
declare function DrawGetFont() as Fl_Font

declare function DrawGetFontSize() as Fl_FontSize
declare function DrawGetFontHeight() as integer
declare function DrawGetFontDescent() as integer

declare function DrawGetStrWidth(txt as const zstring ptr) as integer
declare function DrawGetStrWidth2(txt as const zstring ptr, nChars as integer) as integer
declare function DrawGetCharWidth(char as uinteger) as integer

declare sub      DrawStrExtents(txt as const zstring ptr, byref dx as integer, byref dy as integer, byref w as integer, byref h as integer)
declare sub      DrawStrExtents2(txt as const zstring ptr, nChars as integer, byref dx as integer, byref dy as integer, byref w as integer, byref h as integer)
declare sub      DrawStrMeasure(txt as const zstring ptr, byref x as integer, byref y as integer, draw_symbols as integer = 1)
declare sub      DrawStr(txt as const zstring ptr, x as integer, y as integer)
declare sub      DrawStr2(txt as const zstring ptr, nChars as integer, x as integer, y as integer)
declare sub      DrawStrRightToLeft(txt as const zstring ptr, nChars as integer, x as integer, y as integer)
declare sub      DrawStrRot(angle as integer, txt as const zstring ptr, x as integer, y as integer)
declare sub      DrawStrRot2(angle as integer, txt as const zstring ptr, nChars as integer, x as integer, y as integer)
declare sub      DrawStrBox(txt as const zstring ptr, x as integer, y as integer, w as integer, h as integer, _
                            aligh as Fl_Align, img as Fl_Image ptr=0, draw_symbols as integer = 1)

declare function DrawLatin1ToLocal(txt as const zstring ptr, nChars as integer=-1) as const zstring ptr
declare function DrawLocalToLatin1(txt as const zstring ptr, nChars as integer=-1) as const zstring ptr

declare sub      DrawImage    (buf as const ubyte ptr, x as integer, y as integer, w as integer, h as integer, BytesPerPixel as integer=3, pitch as integer=0)
declare sub      DrawImageMono(buf as const ubyte ptr, x as integer, y as integer, w as integer, h as integer, BytesPerPixel as integer=1, pitch as integer=0)

declare sub      DrawImageCallback    (cb as Fl_Draw_Image_Cb, pUserData as any ptr, x as integer, y as integer, w as integer, h as integer, BytesPerPixel as integer)
declare sub      DrawImageMonoCallback(cb as Fl_Draw_Image_Cb, pUserData as any ptr, x as integer, y as integer, w as integer, h as integer, BytesPerPixel as integer)

declare function DrawReadImage(p as ubyte ptr=0, x as integer, y as integer, w as integer, h as integer, alphavalue as integer=0) as any ptr

declare function DrawPixmap(pdata as ubyte ptr const ptr, x as integer, y as integer,c as Fl_Color=FL_GRAY) as integer
declare function DrawPixmap2(cdata as const zstring ptr const ptr, x as integer, y as integer,c as Fl_Color=FL_GRAY) as integer
declare function DrawMeasurePixmap(pdata as zstring ptr const ptr, byref w as integer, byref h as integer) as integer
declare function DrawMeasurePixmap2(cdata as const zstring ptr const ptr, byref w as integer, byref h as integer) as integer

declare function DrawCanDoAlphaBlending() as integer

'##################
'# class Fl_Image #
'##################
declare function Fl_ImageNew(w as integer, h as integer, d as integer) as Fl_Image ptr
declare sub      Fl_ImageDelete(byref img as Fl_Image ptr)

declare sub      Fl_ImageUncache(img as Fl_Image ptr)
declare sub      Fl_ImageColorAverage(img as Fl_Image ptr, c as Fl_Color, i as single)
declare function Fl_ImageCopy(img as Fl_Image ptr) as Fl_Image ptr
declare function Fl_ImageCopy2(img as Fl_Image ptr, w as integer, h as integer) as Fl_Image ptr
declare function Fl_ImageCount(img as Fl_Image ptr) as integer
declare function Fl_ImageData(img as Fl_Image ptr) as const ubyte ptr const ptr
declare sub      Fl_ImageDesaturate(img as Fl_Image ptr)
declare sub      Fl_ImageDraw(img as Fl_Image ptr, x as integer=0, y as integer=0)
declare sub      Fl_ImageDraw2(img as Fl_Image ptr, x as integer, y as integer, w as integer, h as integer, cx as integer = 0, cy  as integer = 0)
declare sub      Fl_ImageDrawRectangle alias "Fl_ImageDraw2"(img as Fl_Image ptr, x as integer, y as integer, w as integer, h as integer, cx as integer = 0, cy  as integer = 0)
declare sub      Fl_ImageInactive(img as Fl_Image ptr)

declare function Fl_ImageW(img as Fl_Image ptr) as integer
declare function Fl_ImageH(img as Fl_Image ptr) as integer
declare function Fl_ImageD(img as Fl_Image ptr) as integer
declare function Fl_ImageLD(img as Fl_Image ptr) as integer

declare function Fl_ImageGetWidth alias "Fl_ImageW" (img as Fl_Image ptr) as integer
declare function Fl_ImageGetHeight alias "Fl_ImageH" (img as Fl_Image ptr) as integer
declare function Fl_ImageGetBytesPerPixel alias "Fl_ImageD" (img as Fl_Image ptr) as integer
declare function Fl_ImageGetPitch alias "Fl_ImageLD" (img as Fl_Image ptr) as integer

'##########################################
'# class Fl_Shared_Image extends Fl_Image #
'##########################################
declare sub      Fl_Register_Images()

declare function Fl_Shared_ImageGet(img_name as const zstring ptr, w as integer=0, h as integer=0) as Fl_Shared_Image ptr

declare function Fl_Shared_ImageFind(si as Fl_Shared_Image ptr, name as const zstring ptr, w as integer=0, h as integer=0) as Fl_Shared_Image ptr

declare sub      Fl_Shared_ImageAddHandler(si as Fl_Shared_Image ptr, f as Fl_Shared_Handler)
declare sub      Fl_Shared_ImageRemoveHandler(si as Fl_Shared_Image ptr, f as Fl_Shared_Handler)
declare sub      Fl_Shared_ImageColorAverage(si as Fl_Shared_Image ptr, c as Fl_Color, i as single)
declare function Fl_Shared_ImageCopy(si as Fl_Shared_Image ptr) as Fl_Image ptr
declare function Fl_Shared_ImageCopy2(si as Fl_Shared_Image ptr, w as integer, h as integer) as Fl_Image ptr
declare sub      Fl_Shared_ImageDesaturate(si as Fl_Shared_Image ptr)
declare sub      Fl_Shared_ImageDraw(si as Fl_Shared_Image ptr, x as integer, y as integer)
declare sub      Fl_Shared_ImageDraw2(si as Fl_Shared_Image ptr, x as integer, y as integer, w as integer, h as integer, cx as integer=0, cy as integer=0)
declare function Fl_Shared_ImageImages(si as Fl_Shared_Image ptr) as Fl_Shared_Image ptr ptr
declare function Fl_Shared_ImageName(si as Fl_Shared_Image ptr) as const zstring ptr
declare function Fl_Shared_ImageNumImages(si as Fl_Shared_Image ptr) as integer
declare function Fl_Shared_ImageRefcount(si as Fl_Shared_Image ptr) as integer
declare sub      Fl_Shared_ImageRelease(si as Fl_Shared_Image ptr)
declare sub      Fl_Shared_ImageReload(si as Fl_Shared_Image ptr)
declare sub      Fl_Shared_ImageUncache(si as Fl_Shared_Image ptr)

'####################################
'# class Fl_Bitmap extends Fl_Image # monocrom 1 bit per pixel
'####################################
declare function Fl_BitmapNew(bits as const ubyte ptr const ptr, w as integer, h as integer) as Fl_Bitmap ptr
declare function Fl_BitmapCopy(bm as Fl_Bitmap ptr) as Fl_Image ptr
declare function Fl_BitmapCopy2(bm as Fl_Bitmap ptr, w as integer, h as integer) as Fl_Image ptr
declare sub      Fl_BitmapDraw(bm as Fl_Bitmap ptr, x as integer, y as integer)
declare sub      Fl_BitmapDraw2(bm as Fl_Bitmap ptr, x as integer, y as integer, w as integer, h as integer, cx as integer = 0, cy  as integer = 0)
declare sub      Fl_BitmapUncache(bm as Fl_Bitmap ptr)

'########################################
'# class Fl_XBM_Image extends Fl_Bitmap # monocrom 1 bit per pixel
'########################################
declare function Fl_XBM_ImageNew(filename as const zstring ptr) as Fl_Bitmap ptr

'####################################
'# class Fl_Pixmap extends Fl_Image # palette 8bit per pixel
'####################################
declare function Fl_PixmapNew(xpm_data as const zstring ptr const ptr) as Fl_Pixmap ptr
declare sub      Fl_PixmapColorAverage(pm as Fl_Pixmap ptr, c as Fl_Color, i as single)
declare function Fl_PixmapCopy(pm as Fl_Pixmap ptr) as Fl_Image ptr
declare function Fl_PixmapCopy2(pm as Fl_Pixmap ptr, w as integer, h as integer) as Fl_Image ptr
declare sub      Fl_PixmapDesaturate(pm as Fl_Pixmap ptr)
declare sub      Fl_PixmapDraw(pm as Fl_Pixmap ptr, x as integer, y as integer)
declare sub      Fl_PixmapDraw2(pm as Fl_Pixmap ptr, x as integer, y as integer, w as integer, h as integer, cx as integer=0, cy as integer=0)
declare sub      Fl_PixmapUncache(pm as Fl_Pixmap ptr)

'########################################
'# class Fl_GIF_Image extends Fl_Pixmap # palette 8bit per pixel
'########################################
declare function Fl_GIF_ImageNew(filename as const zstring ptr) as Fl_GIF_Image ptr

'########################################
'# class Fl_XPM_Image extends Fl_Pixmap # palette 8bit per pixel
'########################################
declare function Fl_XPM_ImageNew(filename as const zstring ptr) as Fl_XPM_Image ptr

'#######################################
'# class Fl_RGB_Image extends Fl_Image # truecolor 24,32 bit per pixel
'#######################################
declare function Fl_RGB_ImageNew(bits as const any ptr, w as integer, h as integer, BytesPerPixel as integer=3, pitch as integer=0) as Fl_RGB_Image ptr
declare sub      Fl_RGB_ImageColorAverage(rgbimg as Fl_RGB_Image ptr, c as Fl_Color, i as single)
declare function Fl_RGB_ImageCopy(rgbimg as Fl_RGB_Image ptr) as Fl_Image ptr
declare function Fl_RGB_ImageCopy2(rgbimg as Fl_RGB_Image ptr, w as integer, h as integer) as Fl_Image ptr
declare sub      Fl_RGB_ImageDesaturate(rgbimg as Fl_RGB_Image ptr)
declare sub      Fl_RGB_ImageDraw(rgbimg as Fl_RGB_Image ptr, x as integer, y as integer)
' draw with border
declare sub      Fl_RGB_ImageDraw2(rgbimg as Fl_RGB_Image ptr, x as integer, y as integer, w as integer, h as integer, cx as integer=0, cy as integer=0)
declare sub      Fl_RGB_ImageUncache(rgbimg as Fl_RGB_Image ptr)

'###########################################
'# class Fl_BMP_Image extends Fl_RGB_Image #  truecolor
'###########################################
declare function Fl_BMP_ImageNew (filename as const zstring ptr) as FL_BMP_Image ptr

'###########################################
'# class Fl_PNG_Image extends Fl_RGB_Image #  truecolor
'###########################################
declare function Fl_PNG_ImageNew (filename as const zstring ptr) as FL_PNG_Image ptr

' load from memory
' If a name is given, the image is added to the list of shared images (see: Fl_Shared_Image) and will be available by that name.
declare function Fl_PNG_ImageMem(name_png as const zstring ptr=0, buffer as const any ptr, datasize as integer) as FL_PNG_Image ptr

'############################################
'# class Fl_JPEG_Image extends Fl_RGB_Image #  truecolor
'############################################
declare function Fl_JPEG_ImageNew(filename as const zstring ptr) as FL_JPEG_Image ptr

' load from memory
' If a name is given, the image is added to the list of shared images (see: Fl_Shared_Image) and will be available by that name.
declare function Fl_JPEG_ImageMem(name_jpeg as const zstring ptr=0, buffer as const any ptr) as FL_JPEG_Image ptr

'###########################################
'# class Fl_PNM_Image extends Fl_RGB_Image #  truecolor
'###########################################
declare function Fl_PNM_ImageNew (filename as const zstring ptr) as FL_PNM_Image ptr

'#########################################
'# class Fl_Tiled_Image extends Fl_Image #
'#########################################
declare function Fl_Tiled_ImageNew(img as Fl_Image ptr, w as integer=0, h as integer=0) as Fl_Tiled_Image ptr
declare sub      Fl_Tiled_ImageColorAverage(timg as Fl_Tiled_Image ptr, c as Fl_Color, i as single)
declare function Fl_Tiled_ImageCopy(timg as Fl_Tiled_Image ptr) as Fl_Image ptr
declare function Fl_Tiled_ImageCopy2(timg as Fl_Tiled_Image ptr, w as integer, h as integer) as Fl_Image ptr
declare sub      Fl_Tiled_ImageDesaturate(timg as Fl_Tiled_Image ptr)
declare sub      Fl_Tiled_ImageDraw(timg as Fl_Tiled_Image ptr, x as integer, y as integer)
declare sub      Fl_Tiled_ImageDraw2(timg as Fl_Tiled_Image ptr, x as integer, y as integer, w as integer, h as integer, cx as integer=0, cy as integer=0)
declare function Fl_Tiled_ImageImage(timg as Fl_Tiled_Image ptr) as Fl_Image ptr

'############
'# class Fl #
'############
declare sub      Fl_AddCheck(h as Fl_Timeout_Handler, pArg as any ptr = 0)
declare function Fl_HasCheck(h as Fl_Timeout_Handler, pArg as any ptr = 0) as integer

declare sub      Fl_AddHandler(h as Fl_Event_Handler)
declare sub      Fl_RemoveHandler(h as Fl_Event_Handler)

declare sub      Fl_AddIdle(h as Fl_Idle_Handler, pArg as any ptr = 0)
declare function Fl_HasIdle(h as Fl_Idle_Handler, pArg as any ptr = 0) as integer
declare sub      Fl_RemoveIdle(h as Fl_Idle_Handler, pArg as any ptr = 0)
declare sub      Fl_SetIdle(h as Fl_Old_Idle_Handler)

declare sub      Fl_AddTimeout   (t as double, h as Fl_Timeout_Handler, pArg as any ptr = 0)
declare function Fl_HasTimeout   (             h as Fl_Timeout_Handler, pArg as any ptr = 0) as integer
declare sub      Fl_RepeatTimeout(t as double, h as Fl_Timeout_Handler, pArg as any ptr = 0)
declare sub      Fl_RemoveTimeout(             h as Fl_Timeout_Handler, pArg as any ptr = 0)

declare sub      Fl_Awake(message as any ptr = 0)
declare function Fl_Awake2(h as Fl_Awake_Handler, message as any ptr = 0) as integer
declare function Fl_GetAwakeHandler_(byref h as Fl_Awake_Handler, byref pArg as any ptr) as integer

declare sub      Fl_SetAbort(h as Fl_Abort_Handler)
declare sub      Fl_SetAtclose(h as Fl_Atclose_Handler)
declare sub      Fl_DefaultAtclose(win as Fl_Window ptr, pArg as any ptr)

declare sub      Fl_Background(r as ubyte, g as ubyte, b as ubyte)
declare sub      Fl_Background2(r as ubyte, g as ubyte, b as ubyte)

declare sub      Fl_SetBelowmouse(wgt as Fl_Widget ptr)
declare function Fl_GetBelowmouse() as Fl_Widget ptr

declare function Fl_BoxDX(bt as Fl_Boxtype) as integer
declare function Fl_BoxDY(bt as Fl_Boxtype) as integer
declare function Fl_BoxDW(bt as Fl_Boxtype) as integer
declare function Fl_BoxDH(bt as Fl_Boxtype) as integer

declare function Fl_Check() as integer
declare sub      Fl_ClearWidgetPointer(wgt as const Fl_Widget ptr)
declare function Fl_Compose(byref del as integer) as integer
declare sub      Fl_ComposeReset()
declare sub      Fl_Copy(stuff as const zstring ptr, l as integer, destination as integer=0)

declare sub      Fl_SetDamage(d as integer)
declare function Fl_GetDamage() as integer

declare sub      Fl_DeleteWidget(wgt as Fl_Widget ptr)
declare sub      Fl_Display(display as const zstring ptr)

declare function Fl_Dnd() as integer
declare sub      Fl_SetDndTextOps(v as integer)
declare function Fl_GetDndTextOps() as integer

declare sub      Fl_DoWidgetDeletion()

declare function Fl_DrawBoxActive() as integer

declare function Fl_EventNumber() as integer

declare function Fl_EventButton() as integer
declare function Fl_EventButton1() as integer
declare function Fl_EventButton2() as integer
declare function Fl_EventButton3() as integer
declare function Fl_EventButtons() as integer

declare sub      Fl_SetEventClicks(i as integer)
declare function Fl_GetEventClicks() as integer

declare function Fl_EventCommand() as integer

declare sub      Fl_SetEventDispatch(d as Fl_Event_Dispatch)
declare function Fl_GetEventDispatch() as Fl_Event_Dispatch

declare function Fl_EventDX() as integer
declare function Fl_EventDY() as integer

declare function Fl_EventInsideWidget alias "Fl_EventInside" (wgt as const Fl_Widget ptr) as integer
declare function Fl_EventInside       alias "Fl_EventInside2"(x as integer, y as integer, w as integer, h as integer) as integer

declare sub      Fl_SetEventIsClick(i as integer)
declare function Fl_GetEventIsClick() as integer

declare function Fl_EventKey() as integer
declare function Fl_EventKey2(key as integer) as integer
declare function Fl_EventOriginalKey() as integer

declare function Fl_EventAlt() as integer
declare function Fl_EventCtrl() as integer
declare function Fl_EventShift() as integer
declare function Fl_EventState() as integer
declare function Fl_EventState2(i as integer) as integer

declare function Fl_EventLength() as integer

declare function Fl_EventText() as const zstring ptr

declare function Fl_EventX() as integer
declare function Fl_EventY() as integer

declare function Fl_EventXRoot() as integer
declare function Fl_EventYRoot() as integer

declare sub      Fl_SetFirstWindow(win as Fl_Window ptr)
declare function Fl_GetFirstWindow() as Fl_Window ptr
declare function Fl_NextWindow(win as const Fl_Window ptr) as Fl_Window ptr

declare sub      Fl_Flush()

declare sub      Fl_SetFocus(wgt as Fl_Widget ptr)
declare function Fl_GetFocus() as Fl_Widget ptr

declare sub      Fl_Foreground(r as ubyte, g as ubyte, b as ubyte)
declare sub      Fl_FreeColor (i as Fl_Color, overlay as integer=0)

declare function Fl_GetBoxType(bt as Fl_Boxtype) as Fl_Box_Draw_F
declare sub      Fl_GetColor(i as Fl_Color,byref r as ubyte, byref g as ubyte, byref b as ubyte)
declare function Fl_GetColor2(i as Fl_Color) as uinteger
declare function Fl_GetFont(f as Fl_Font) as const zstring ptr
declare function Fl_GetFontName(f as Fl_Font, attributes as integer ptr=0) as const zstring ptr
declare function Fl_GetFontSizes (f as Fl_Font, byref size as integer ptr) as integer
declare function Fl_GetKey(key as integer) as integer
declare sub      Fl_GetMouse (byref x as integer, byref y as integer)
declare sub      Fl_GetSystemColors()

declare sub      Fl_SetGrab(win as Fl_Window ptr)
declare function Fl_GetGrab() as Fl_Window ptr

declare function Fl_Handle(event as Fl_Event, win as Fl_Window ptr) as integer
declare function Fl_Handle_(event as Fl_Event, win as Fl_Window ptr) as integer

declare function Fl_Lock() as integer
declare sub      Fl_Unlock()

declare function Fl_Modal() as Fl_Window ptr

declare sub      Fl_SetOption(opt as Fl_Option, value as integer)
declare function Fl_GetOption(opt as Fl_Option) as integer

declare sub      Fl_OwnColormap()

declare sub      Fl_Paste(byref receiver as Fl_Widget ptr)
declare sub      Fl_Paste2(byref receiver as Fl_Widget ptr, source as integer)

declare sub      Fl_SetPushed(wgt as Fl_Widget ptr)
declare function Fl_GetPushed() as Fl_Widget ptr

declare function Fl_ReadQueue() as Fl_Widget ptr
declare function Fl_Ready() as integer

declare sub      Fl_Redraw()

declare sub      Fl_Release()
declare sub      Fl_ReleaseWidgetPointer(byref wgt as Fl_Widget ptr)

declare sub      Fl_RemoveCheck(h as Fl_Timeout_Handler, pdata as any ptr=0)
declare sub      Fl_RemoveFD(fd as integer)
declare sub      Fl_RemoveFD2(fd as integer, when as integer)

declare function Fl_SetScheme (scheme as const zstring ptr) as integer
declare function Fl_GetScheme() as const zstring ptr
declare function Fl_ReloadScheme() as integer

declare function Fl_ScreenCount() as integer
declare sub      Fl_ScreenDpi(byref w as single, byref h as single, n as integer=0)
declare sub      Fl_ScreenWorkAreaXYWH(byref x as integer, byref Y as integer, byref w as integer, byref h as integer)
declare sub      Fl_ScreenWorkAreaXYWHN(byref x as integer, byref Y as integer, byref w as integer, byref h as integer, n as integer)
declare sub      Fl_ScreenWorkAreaXYWHMXMY(byref x as integer, byref Y as integer, byref w as integer, byref h as integer, mx as integer, my as integer)
declare sub      Fl_ScreenXYWH(byref x as integer, byref Y as integer, byref w as integer, byref h as integer)
declare sub      Fl_ScreenXYWHN (byref x as integer, byref Y as integer, byref w as integer, byref h as integer, n as integer)
declare sub      Fl_ScreenXYWHMXMY(byref x as integer, byref Y as integer, byref w as integer, byref h as integer, mx as integer, my as integer)
declare sub      Fl_ScreenXYWHMXMYMWMH(byref x as integer, byref Y as integer, byref w as integer, byref h as integer, mx as integer, my as integer, mw as integer, mh as integer)

declare sub      Fl_SetScrollbarSize(size as integer)
declare function Fl_GetScrollbarSize() as integer

declare sub      Fl_Selection(byref owner as Fl_Widget ptr, t as const zstring ptr, l as integer)

declare sub      Fl_SetSelectionOwner(wgt as Fl_Widget ptr)
declare function Fl_GetSelectionOwner() as Fl_Widget ptr

declare sub      Fl_SetBoxType(bt as Fl_Boxtype, from as Fl_Boxtype)
declare sub      Fl_SetBoxType2(bt as Fl_Boxtype, f as Fl_Box_Draw_F, a as ubyte, b as ubyte, c as ubyte, d as ubyte)
declare sub      Fl_SetColor (n as Fl_Color, c as uinteger)
declare sub      Fl_SetColor2(n as Fl_Color, r as ubyte, g as ubyte, b as ubyte)
declare sub      Fl_SetFont(f as Fl_Font, n as const zstring ptr)
declare sub      Fl_SetFont2(f as Fl_Font, n as Fl_Font)
declare function Fl_SetFonts(n as const zstring ptr=0) as Fl_Font

declare sub      Fl_SetLabeltype(lt as Fl_Labeltype, df as Fl_Label_Draw_F, mf as Fl_Label_Measure_F)

declare function Fl_TestShortcut(s as Fl_Shortcut) as integer
declare function Fl_ThreadMessage() as any ptr

declare function Fl_Version() as double
declare sub      Fl_SetVisibleFocus(v as integer)
declare function Fl_GetVisibleFocus() as integer
declare function Fl_Visual(v as integer) as integer

declare function Fl_Run() as integer
declare function Fl_Wait() as integer
declare function Fl_Wait2(t as double) as double

declare sub      Fl_WatchWidgetPointer(byref wgt as Fl_Widget ptr)

declare function Fl_GetX() as integer
declare function Fl_GetY() as integer
declare function Fl_GetW() as integer
declare function Fl_GetH() as integer

'##########################################################
'# class Fl_Widget is the base class of all other objects #
'##########################################################
declare sub      Fl_WidgetActivate(wgt as Fl_Widget ptr)
declare function Fl_WidgetActive(wgt as Fl_Widget ptr) as uinteger
declare function Fl_WidgetActiveR(wgt as Fl_Widget ptr) as integer

declare sub      Fl_WidgetSetAlign(wgt as Fl_Widget ptr, align as Fl_Align)
declare function Fl_WidgetGetAlign(wgt as Fl_Widget ptr) as Fl_Align

declare sub      Fl_WidgetSetArgument(wgt as Fl_Widget ptr, v as long)
declare function Fl_WidgetGetArgument(wgt as Fl_Widget ptr) as long

declare function Fl_WidgetAsGroup(wgt as Fl_Widget ptr) as Fl_Group ptr
declare function Fl_WidgetAsWindow(wgt as Fl_Widget ptr) as Fl_Window ptr
declare function Fl_WidgetAsGL_Window(wgt as Fl_Widget ptr) as Fl_GL_Window ptr

declare sub      Fl_WidgetSetBox(wgt as Fl_Widget ptr, bt as Fl_Boxtype)
declare function Fl_WidgetGetBox(wgt as Fl_Widget ptr) as Fl_Boxtype

declare sub      Fl_WidgetSetCallback    (wgt as Fl_Widget ptr, cb as Fl_Callback)
declare sub      Fl_WidgetSetCallbackArg (wgt as Fl_Widget ptr, cb as Fl_Callback, arg as any ptr=0)
declare sub      Fl_WidgetSetCallback0   (wgt as Fl_Widget ptr, cb as Fl_Callback0)
declare sub      Fl_WidgetSetCallback1Arg(wgt as Fl_Widget ptr, cb as Fl_Callback1, arg as long=0)
declare function Fl_WidgetGetCallback    (wgt as Fl_Widget ptr) as Fl_Callback_p

declare sub      Fl_WidgetSetChanged(wgt as Fl_Widget ptr)
declare function Fl_WidgetChanged(wgt as Fl_Widget ptr) as uinteger
declare sub      Fl_WidgetClearChanged(wgt as Fl_Widget ptr)

declare sub      Fl_WidgetSetOutput(wgt as Fl_Widget ptr)
declare sub      Fl_WidgetClearOutput(wgt as Fl_Widget ptr)
declare function Fl_WidgetOutput(wgt as Fl_Widget ptr) as uinteger

declare sub      Fl_WidgetSetVisible(wgt as Fl_Widget ptr)
declare sub      Fl_WidgetClearVisible(wgt as Fl_Widget ptr)

declare sub      Fl_WidgetSetVisibleFocus(wgt as Fl_Widget ptr)
declare sub      Fl_WidgetClearVisibleFocus(wgt as Fl_Widget ptr)

declare sub      Fl_WidgetSetColor(wgt as Fl_Widget ptr, bg as Fl_Color)
declare sub      Fl_WidgetSetColorSel(wgt as Fl_Widget ptr, bg as Fl_Color, sel as Fl_Color)
declare function Fl_WidgetGetColor(wgt as Fl_Widget ptr) as Fl_Color

declare sub      Fl_WidgetSetSelectionColor(wgt as Fl_Widget ptr, c as Fl_Color)
declare function Fl_WidgetGetSelectionColor(wgt as Fl_Widget ptr) as Fl_Color

' will be removed use Set/GetSelectionColor in new apps.
declare sub      Fl_WidgetSetColor2(wgt as Fl_Widget ptr, c as Fl_Color)
declare function Fl_WidgetGetColor2(wgt as Fl_Widget ptr) as Fl_Color

declare function Fl_WidgetContains(wgt as Fl_Widget ptr, other as const Fl_Widget ptr) as integer

declare sub      Fl_WidgetCopyLabel(wgt as Fl_Widget ptr, new_label as const zstring ptr)
declare sub      Fl_WidgetCopyTooltip(wgt as Fl_Widget ptr, text as const zstring ptr)

declare sub      Fl_WidgetSetDamage(wgt as Fl_Widget ptr, c as ubyte)
declare sub      Fl_WidgetSetDamage2(wgt as Fl_Widget ptr, c as ubyte, x as integer, y as integer, w as integer, h as integer)
declare function Fl_WidgetGetDamage(wgt as Fl_Widget ptr) as ubyte

declare sub      Fl_WidgetClearDamage(wgt as Fl_Widget ptr, c as ubyte=0)

declare function Fl_WidgetDamageResize(wgt as Fl_Widget ptr, x as integer, y as integer, w as integer, h as integer) as integer

declare sub      Fl_WidgetDeactivate(wgt as Fl_Widget ptr)

declare sub      Fl_WidgetSetDeimage(wgt as Fl_Widget ptr, img as Fl_Image ptr)
declare function Fl_WidgetGetDeimage(wgt as Fl_Widget ptr) as Fl_Image ptr

declare sub      Fl_WidgetDoCallback(wgt as Fl_Widget ptr)
declare sub      Fl_WidgetDoCallback2(wgt as Fl_Widget ptr, other as Fl_Widget ptr, pArg as any ptr=0)
declare sub      Fl_WidgetDoCallback3(wgt as Fl_Widget ptr, other as Fl_Widget ptr, lArg as long)

declare sub      Fl_WidgetDraw(wgt as Fl_Widget ptr)
declare sub      Fl_WidgetDrawLabel(wgt as Fl_Widget ptr, x as integer, y as integer, w as integer, h as integer, align as Fl_Align)

declare function Fl_WidgetHandle(wgt as Fl_Widget ptr, event as Fl_Event) as integer

declare sub      Fl_WidgetHide(wgt as Fl_Widget ptr)
declare sub      Fl_WidgetShow(wgt as Fl_Widget ptr)

declare sub      Fl_WidgetSetImage(wgt as Fl_Widget ptr, img as Fl_Image ptr)
declare function Fl_WidgetGetImage(wgt as Fl_Widget ptr) as Fl_Image ptr
declare function Fl_WidgetGetImage2(wgt as Fl_Widget ptr) as const Fl_Image ptr

declare function Fl_WidgetInside(wgt as Fl_Widget ptr, other as const Fl_Widget) as integer

declare sub      Fl_WidgetSetLabel(wgt as Fl_Widget ptr, text as const zstring ptr)
declare sub      Fl_WidgetSetLabel2(wgt as Fl_Widget ptr, a as Fl_Labeltype, text as const zstring ptr)
declare function Fl_WidgetGetLabel(wgt as Fl_Widget ptr) as const zstring ptr

declare sub      Fl_WidgetSetLabelColor(wgt as Fl_Widget ptr, c as Fl_Color)
declare function Fl_WidgetGetLabelColor(wgt as Fl_Widget ptr) as Fl_Color

declare sub      Fl_WidgetSetLabelFont(wgt as Fl_Widget ptr, f as Fl_Font)
declare function Fl_WidgetGetLabelFont(wgt as Fl_Widget ptr) as Fl_Font

declare sub      Fl_WidgetSetLabelSize(wgt as Fl_Widget ptr, fz as Fl_Fontsize)
declare function Fl_WidgetGetLabelSize(wgt as Fl_Widget ptr) as Fl_Fontsize

declare sub      Fl_WidgetSetLabelType(wgt as Fl_Widget ptr, lt as Fl_Labeltype)
declare function Fl_WidgetGetLabelType(wgt as Fl_Widget ptr) as Fl_Labeltype

declare sub      Fl_WidgetMeasureLabel(wgt as Fl_Widget ptr, byref w as integer, byref h as integer)

declare sub      Fl_WidgetSetParent(wgt as Fl_Widget ptr, p as Fl_Group ptr)
declare function Fl_WidgetGetParent(wgt as Fl_Widget ptr) as Fl_Group ptr

declare sub      Fl_WidgetPosition(wgt as Fl_Widget ptr, x as integer, y as integer)
declare sub      Fl_WidgetSize(wgt as Fl_Widget ptr, w as integer, h as integer)
declare sub      Fl_WidgetResize(wgt as Fl_Widget ptr, x as integer, y as integer, w as integer, h as integer)

declare sub      Fl_WidgetRedraw(wgt as Fl_Widget ptr)
declare sub      Fl_WidgetRedrawLabel(wgt as Fl_Widget ptr)

declare function Fl_WidgetTakeFocus(wgt as Fl_Widget ptr) as integer
declare function Fl_WidgetTakesEvents(wgt as Fl_Widget ptr) as uinteger
declare function Fl_WidgetTestShortcut(wgt as Fl_Widget ptr) as integer

declare sub      Fl_WidgetSetTooltip(wgt as Fl_Widget ptr, text as const zstring ptr)
declare function Fl_WidgetGetTooltip(wgt as Fl_Widget ptr) as const zstring ptr

declare sub      Fl_WidgetSetType(wgt as Fl_Widget ptr, t as ubyte)
declare function Fl_WidgetGetType(wgt as Fl_Widget ptr) as ubyte

declare sub      Fl_WidgetSetUserData(wgt as Fl_Widget ptr, v as any ptr)
declare function Fl_WidgetGetUserData(wgt as Fl_Widget ptr) as any ptr

declare function Fl_WidgetVisible(wgt as Fl_Widget ptr) as integer
declare function Fl_WidgetVisibleR(wgt as Fl_Widget ptr) as integer

declare sub      Fl_WidgetVisibleFocus(wgt as Fl_Widget ptr, v as integer)
declare function Fl_WidgetGetVisibleFocus(wgt as Fl_Widget ptr) as integer

declare sub      Fl_WidgetSetWhen(wgt as Fl_Widget ptr, w as Fl_When)
declare function Fl_WidgetGetWhen(wgt as Fl_Widget ptr) as Fl_When

declare function Fl_WidgetWindow(wgt as Fl_Widget ptr) as Fl_Window ptr

declare function Fl_WidgetGetX(wgt as Fl_Widget ptr) as integer
declare function Fl_WidgetGetY(wgt as Fl_Widget ptr) as integer
declare function Fl_WidgetGetW(wgt as Fl_Widget ptr) as integer
declare function Fl_WidgetGetH(wgt as Fl_Widget ptr) as integer

declare sub      Fl_WidgetDefaultCallback(wgt as Fl_Widget ptr, cb as Fl_Widget ptr, pArg as any ptr)
declare function Fl_WidgetLabelShortcut(wgt as Fl_Widget ptr, t as const zstring ptr) as integer
declare function Fl_WidgetTestShortcut2(wgt as Fl_Widget ptr, t as const zstring ptr, require_alt as integer=0) as integer

'##################################
'# class Fl_Box extends Fl_Widget #
'##################################
DeclareEx(Fl_Box)
declare function Fl_BoxNew (                 x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Box ptr
declare function Fl_BoxNew2(bt as Fl_Boxtype,x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Box ptr

'#####################################
'# class Fl_Button extends Fl_Widget #
'#####################################
DeclareEx(Fl_Button)
declare function Fl_ButtonNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Button ptr
declare function Fl_ButtonClear(btn as Fl_Button ptr) as integer

declare sub      Fl_ButtonSetDownBox(btn as Fl_Button ptr, bt as Fl_Boxtype)
declare function Fl_ButtonGetDownBox(btn as Fl_Button ptr) as Fl_Boxtype

declare sub      Fl_ButtonSetDownColor(btn as Fl_Button ptr, c as Fl_Color)
declare function Fl_ButtonGetDownColor(btn as Fl_Button ptr) as Fl_Color

declare function Fl_ButtonHandle(btn as Fl_Button ptr, event as Fl_Event) as integer

declare function Fl_ButtonSet(btn as Fl_Button ptr) as integer

declare sub      Fl_ButtonSetOnly(btn as Fl_Button ptr)

declare sub      Fl_ButtonSetShortcut(btn as Fl_Button ptr, s as integer)
declare function Fl_ButtonGetShortcut(btn as Fl_Button ptr) as integer

declare function Fl_ButtonSetValue(btn as Fl_Button ptr, v as integer) as integer
declare function Fl_ButtonGetValue(btn as Fl_Button ptr) as integer

'###########################################
'# class Fl_Radio_Button extends Fl_Button #
'###########################################
DeclareEx(Fl_Radio_Button)
declare function Fl_Radio_ButtonNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Radio_Button ptr

'############################################
'# class Fl_Repeat_Button extends Fl_Button #
'############################################
DeclareEx(Fl_Repeat_Button)
declare function Fl_Repeat_ButtonNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Repeat_Button ptr
declare function Fl_Repeat_ButtonHandle(btn as Fl_Repeat_Button ptr, ev as Fl_Event) as integer
declare sub      Fl_Repeat_ButtonDeactivate(btn as Fl_Repeat_Button ptr)

'############################################
'# class Fl_Return_Button extends Fl_Button #
'############################################
DeclareEx(Fl_Return_Button)
declare function Fl_Return_ButtonNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Return_Button ptr
declare function Fl_Return_ButtonHandle(btn as Fl_Return_Button ptr, ev as Fl_Event) as integer

'############################################
'# class Fl_Toggle_Button extends Fl_Button #
'############################################
DeclareEx(Fl_Toggle_Button)
declare function Fl_Toggle_ButtonNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Toggle_Button  ptr

'###########################################
'# class Fl_Light_Button extends Fl_Button #
'###########################################
DeclareEx(Fl_Light_Button)
declare function Fl_Light_ButtonNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Light_Button  ptr
declare function Fl_Light_ButtonHandle(btn as Fl_Light_Button ptr, ev as Fl_Event) as integer

'#################################################
'# class Fl_Check_Button extends Fl_Light_Button #
'#################################################
DeclareEx(Fl_Check_Button)
declare function Fl_Check_ButtonNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Check_Button ptr

'#######################################################
'# class Fl_Radio_Light_Button extends Fl_Light_Button #
'#######################################################
DeclareEx(Fl_Radio_Light_Button)
declare function Fl_Radio_Light_ButtonNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Radio_Light_Button ptr

'#################################################
'# class Fl_Round_Button extends Fl_Light_Button #
'#################################################
DeclareEx(Fl_Round_Button)
declare function Fl_Round_ButtonNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Round_Button ptr

'#######################################################
'# class Fl_Radio_Round_Button extends Fl_Round_Button #
'#######################################################
DeclareEx(Fl_Radio_Round_Button)
declare function Fl_Radio_Round_ButtonNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Radio_Round_Button ptr

'####################################
'# class Fl_Chart extends Fl_Widget #
'####################################
DeclareEx(Fl_Chart)
declare function Fl_ChartNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Chart ptr
declare sub      Fl_ChartAdd(ch as Fl_Chart ptr, v as double, s as const zstring ptr=0, col as uinteger=0)

declare sub      Fl_ChartSetAutoSize(ch as Fl_Chart ptr, n as integer)
declare function Fl_ChartGetAutoSize(ch as Fl_Chart ptr) as integer

declare sub      Fl_ChartSetBounds(ch as Fl_Chart ptr, a as double, b as double)
declare sub      Fl_ChartGetBounds(ch as Fl_Chart ptr, byref a as double, byref b as double)

declare sub      Fl_ChartClear(ch as Fl_Chart ptr)
declare sub      Fl_ChartInsert(ch as Fl_Chart ptr, ind as integer, v as double, label as const zstring ptr=0, col as Fl_Color=0)

declare sub      Fl_ChartSetMaxSize(ch as Fl_Chart ptr, m as integer)
declare function Fl_ChartGetMaxSize(ch as Fl_Chart ptr) as integer

declare sub      Fl_ChartReplace(ch as Fl_Chart ptr, ind as integer, v as double, label as const zstring ptr=0, col as Fl_Color=0)

declare sub      Fl_ChartSetSize(ch as Fl_Chart ptr, w as integer, h as integer)
declare function Fl_ChartGetSize(ch as Fl_Chart ptr) as integer

declare sub      Fl_ChartSetTextColor(ch as Fl_Chart ptr, c as Fl_Color)
declare function Fl_ChartGetTextColor(ch as Fl_Chart ptr) as Fl_Color

declare sub      Fl_ChartSetTextFont(ch as Fl_Chart ptr, f as Fl_Font)
declare function Fl_ChartGetTextFont(ch as Fl_Chart ptr) as Fl_Font

declare sub      Fl_ChartSetTextSize(ch as Fl_Chart ptr, fz as Fl_Fontsize)
declare function Fl_ChartGetTextSize(ch as Fl_Chart ptr) as Fl_Fontsize

'###########################################
'# class Fl_Clock_Output extends Fl_Widget #
'###########################################
DeclareEx(Fl_Clock_Output)
declare function Fl_Clock_OutputNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Clock_Output ptr
declare function Fl_Clock_OutputHour    (co as Fl_Clock_Output ptr) as integer
declare function Fl_Clock_OutputMinute  (co as Fl_Clock_Output ptr) as integer
declare function Fl_Clock_OutputSecond  (co as Fl_Clock_Output ptr) as integer
declare sub      Fl_Clock_OutputValue   (co as Fl_Clock_Output ptr, h as integer, m as integer, s as integer)
declare sub      Fl_Clock_OutputSetValue(co as Fl_Clock_Output ptr, v as ulong)
declare function Fl_Clock_OutputGetValue(co as Fl_Clock_Output ptr) as ulong

'##########################################
'# class Fl_Clock extends Fl_Clock_Output #
'##########################################
DeclareEx(Fl_Clock)
declare function Fl_ClockNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Clock ptr
declare function Fl_ClockNew2(boxtype as ubyte, x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Clock ptr

'#########################################
'# class Fl_Round_Clock extends Fl_Clock #
'#########################################
DeclareEx(Fl_Round_Clock)
declare function Fl_Round_ClockNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Round_Clock ptr

'#####################################
'# class Fl_Input_ extends Fl_Widget #
'#####################################
declare function Fl_Input_Copy(ip_ as Fl_Input_ ptr, clipboard as integer) as integer
declare function Fl_Input_CopyCuts(ip_ as Fl_Input_ ptr) as integer
declare sub      Fl_Input_SetCursorColor(ip_ as Fl_Input_ ptr, c as Fl_Color)
declare function Fl_Input_GetCursorColor(ip_ as Fl_Input_ ptr) as Fl_Color
declare function Fl_Input_Cut(ip_ as Fl_Input_ ptr) as integer
declare function Fl_Input_Cut1(ip_ as Fl_Input_ ptr, n as integer) as integer
declare function Fl_Input_Cut2(ip_ as Fl_Input_ ptr, a as integer, b as integer) as integer
declare function Fl_Input_Index(ip_ as Fl_Input_ ptr, i as integer) as Fl_Char

declare sub      Fl_Input_SetInputType(ip_ as Fl_Input_ ptr, t as integer)
declare function Fl_Input_GetInputType(ip_ as Fl_Input_ ptr) as integer

declare function Fl_Input_Insert(ip_ as Fl_Input_ ptr, text as const zstring ptr, l as integer=0) as integer

declare function Fl_Input_SetMark(ip_ as Fl_Input_ ptr, m as integer) as integer
declare function Fl_Input_GetMark(ip_ as Fl_Input_ ptr) as integer

declare sub      Fl_Input_SetMaximumSize(ip_ as Fl_Input_ ptr, m as integer)
declare function Fl_Input_GetMaximumSize(ip_ as Fl_Input_ ptr) as integer

declare function Fl_Input_SetPosition(ip_ as Fl_Input_ ptr, p as integer) as integer
declare function Fl_Input_SetPosition2(ip_ as Fl_Input_ ptr, p as integer, m as integer) as integer
declare function Fl_Input_GetPosition(ip_ as Fl_Input_ ptr) as integer

declare sub      Fl_Input_SetReadonly(ip_ as Fl_Input_ ptr, b as integer)
declare function Fl_Input_GetReadonly(ip_ as Fl_Input_ ptr) as integer

declare function Fl_Input_Replace(ip_ as Fl_Input_ ptr, b as integer, e as integer, text as const zstring ptr, l as integer=0) as integer
declare sub      Fl_Input_Resize(ip_ as Fl_Input_ ptr, x as integer, y as integer, w as integer, h as integer)

declare sub      Fl_Input_SetShortcut(ip_ as Fl_Input_ ptr, s as integer)
declare function Fl_Input_GetShortcut(ip_ as Fl_Input_ ptr) as integer

declare sub      Fl_Input_SetSize(ip_ as Fl_Input_ ptr, w as integer, h as integer)
declare function Fl_Input_GetSize(ip_ as Fl_Input_ ptr) as integer
declare function Fl_Input_StaticValue(ip_ as Fl_Input_ ptr, text as const zstring ptr) as integer
declare function Fl_Input_StaticValue2(ip_ as Fl_Input_ ptr, text as const zstring ptr, l as integer) as integer

declare sub      Fl_Input_SetTabNav(ip_ as Fl_Input_ ptr, v as integer)
declare function Fl_Input_GetTabNav(ip_ as Fl_Input_ ptr) as integer

declare sub      Fl_Input_SetTextColor(ip_ as Fl_Input_ ptr, c as Fl_Color)
declare function Fl_Input_GetTextColor(ip_ as Fl_Input_ ptr) as Fl_Color

declare sub      Fl_Input_SetTextFont(ip_ as Fl_Input_ ptr, s as Fl_Font)
declare function Fl_Input_GetTextFont(ip_ as Fl_Input_ ptr) as Fl_Font

declare sub      Fl_Input_SetTextSize(ip_ as Fl_Input_ ptr, s as Fl_Fontsize)
declare function Fl_Input_GetTextSize(ip_ as Fl_Input_ ptr) as Fl_Fontsize

declare function Fl_Input_Undo(ip_ as Fl_Input_ ptr) as integer

declare function Fl_Input_SetValue(ip_ as Fl_Input_ ptr, text as const zstring ptr) as integer
declare function Fl_Input_SetValue2(ip_ as Fl_Input_ ptr, text as const zstring ptr, l as integer) as integer
declare function Fl_Input_GetValue(ip_ as Fl_Input_ ptr) as const zstring ptr

declare sub      Fl_Input_SetWrap(ip_ as Fl_Input_ ptr, b as integer)
declare function Fl_Input_GetWrap(ip_ as Fl_Input_ ptr) as integer

'####################################
'# class Fl_Input extends Fl_Input_ #
'####################################
DeclareEx(Fl_Input)
declare function Fl_InputNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Input ptr
declare function Fl_InputHandle(ip as Fl_Input ptr, event as Fl_Event) as integer

'########################################
'# class Fl_File_Input extends Fl_Input #
'########################################
DeclareEx(Fl_File_Input)
declare function Fl_File_InputNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_File_Input ptr

declare sub      Fl_File_InputSetDownBox(fip as Fl_File_Input ptr, b as Fl_Boxtype)
declare function Fl_File_InputGetDownBox(fip as Fl_File_Input ptr) as Fl_Boxtype

declare sub      Fl_File_InputSetErrorColor(fip as Fl_File_Input ptr, c as Fl_Color)
declare function Fl_File_InputGetErrorColor(fip as Fl_File_Input ptr) as Fl_Color

declare function Fl_File_InputHandle(fip as Fl_File_Input ptr, event as Fl_Event) as integer

declare function Fl_File_InputSetValue(fip as Fl_File_Input ptr, text as const zstring ptr) as integer
declare function Fl_File_InputSetValue2(fip as Fl_File_Input ptr, text as const zstring ptr, l as integer) as integer
declare function Fl_File_InputGetValue(fip as Fl_File_Input ptr) as const zstring ptr

'#########################################
'# class Fl_Float_Input extends Fl_Input #
'#########################################
DeclareEx(Fl_Float_Input)
declare function Fl_Float_InputNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Float_Input ptr

'#######################################
'# class Fl_Int_Input extends Fl_Input #
'#######################################
DeclareEx(Fl_Int_Input)
declare function Fl_Int_InputNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Int_Input ptr

'#############################################
'# class Fl_Multiline_Input extends Fl_Input #
'#############################################
DeclareEx(Fl_Multiline_Input)
declare function Fl_Multiline_InputNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Multiline_Input ptr

'####################################
'# class Fl_Output extends Fl_Input #
'####################################
DeclareEx(Fl_Output)
declare function Fl_OutputNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Output ptr

'###############################################
'# class Fl_Multiline_Output extends Fl_Output #
'###############################################
DeclareEx(Fl_Multiline_Output)
declare function Fl_Multiline_OutputNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Multiline_Output ptr

'##########################################
'# class Fl_Secret_Input extends Fl_Input #
'##########################################
DeclareEx(Fl_Secret_Input)
declare function Fl_Secret_InputNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Secret_Input ptr
declare function Fl_Secret_InputHandle(sip as Fl_Secret_Input ptr, event as Fl_Event) as integer

'######################
'# class Fl_Menu_Item #
'######################
declare sub      Fl_Menu_ItemActivate(it as Fl_Menu_Item ptr)
declare sub      Fl_Menu_ItemDeactivate(it as Fl_Menu_Item ptr)

declare function Fl_Menu_ItemActive(it as Fl_Menu_Item ptr) as integer
declare function Fl_Menu_ItemActiveVisible(it as Fl_Menu_Item ptr) as integer

declare function Fl_Menu_ItemAdd (it as Fl_Menu_Item ptr, label as const zstring ptr, shortcut as integer          , cb as Fl_Callback, userdata as any ptr=0, flag as Fl_MenuItemFlag=0) as integer
declare function Fl_Menu_ItemAdd2(it as Fl_Menu_Item ptr, label as const zstring ptr, shortcut as const zstring ptr, cb as Fl_Callback, userdata as any ptr=0, flag as Fl_MenuItemFlag=0) as integer

declare sub      Fl_Menu_ItemSetArgument(it as Fl_Menu_Item ptr, v as long)
declare function Fl_Menu_ItemGetArgument(it as Fl_Menu_Item ptr) as long

declare function Fl_Menu_ItemGetCallback_p(it as Fl_Menu_Item ptr) as Fl_Callback_p
declare sub      Fl_Menu_ItemCallback (it as Fl_Menu_Item ptr, cb as Fl_Callback)
declare sub      Fl_Menu_ItemCallback2(it as Fl_Menu_Item ptr, cb as Fl_Callback, pData as any ptr=0)
declare sub      Fl_Menu_ItemCallback0(it as Fl_Menu_Item ptr, cb as Fl_Callback0)
declare sub      Fl_Menu_ItemCallback1(it as Fl_Menu_Item ptr, cb as Fl_Callback1, lData as long=0)

declare function Fl_Menu_ItemCheckBox(it as Fl_Menu_Item ptr) as integer
declare function Fl_Menu_ItemRadio(it as Fl_Menu_Item ptr) as integer

declare sub      Fl_Menu_ItemCheck(it as Fl_Menu_Item ptr)
declare function Fl_Menu_ItemChecked(it as Fl_Menu_Item ptr) as integer
declare sub      Fl_Menu_ItemUncheck(it as Fl_Menu_Item ptr)

declare sub      Fl_Menu_ItemClear(it as Fl_Menu_Item ptr)

declare sub      Fl_Menu_ItemDoCallback(it as Fl_Menu_Item ptr, wgt as Fl_Widget ptr, pData as any ptr)
declare sub      Fl_Menu_ItemDoCallback2(it as Fl_Menu_Item ptr, wgt as Fl_Widget ptr, arg as long)
declare sub      Fl_Menu_ItemDoCallback3(it as Fl_Menu_Item ptr, wgt as Fl_Widget ptr)

declare sub      Fl_Menu_ItemDraw(it as Fl_Menu_Item ptr, x as integer, y as integer, w as integer, h as integer, m as const Fl_Menu_ ptr, t as integer=0)

declare function Fl_Menu_ItemFindShortcut(it as Fl_Menu_Item ptr, ip as integer ptr=0, require_alt as const integer=0) as const Fl_Menu_Item ptr

declare function Fl_Menu_ItemFirst(it as Fl_Menu_Item ptr) as Fl_Menu_Item ptr
declare function Fl_Menu_ItemNext(it as Fl_Menu_Item ptr, index as integer=1) as Fl_Menu_Item ptr

declare function Fl_Menu_ItemFirst2(it as Fl_Menu_Item ptr) as const Fl_Menu_Item ptr
declare function Fl_Menu_ItemNext2(it as Fl_Menu_Item ptr, index as integer=1) as const Fl_Menu_Item ptr

declare sub      Fl_Menu_ItemHide(it as Fl_Menu_Item ptr)
declare sub      Fl_Menu_ItemShow(it as Fl_Menu_Item ptr)

declare function Fl_Menu_ItemInsert(it as Fl_Menu_Item ptr, index as integer, label as const zstring ptr, shortcut as integer, cb as Fl_Callback, userdata as any ptr=0, flag as Fl_MenuItemFlag=0) as integer

declare sub      Fl_Menu_ItemSetLabel(it as Fl_Menu_Item ptr, label as const zstring ptr)
declare sub      Fl_Menu_ItemSetLabel2(it as Fl_Menu_Item ptr, lt as Fl_Labeltype, label as const zstring ptr)
declare function Fl_Menu_ItemGetLabel(it as Fl_Menu_Item ptr) as const zstring ptr

declare sub      Fl_Menu_ItemSetLabelColor(it as Fl_Menu_Item ptr, c as Fl_Color)
declare function Fl_Menu_ItemGetLabelColor(it as Fl_Menu_Item ptr) as Fl_Color

declare sub      Fl_Menu_ItemSetLabelFont(it as Fl_Menu_Item ptr,f as Fl_Font)
declare function Fl_Menu_ItemGetLabelFont(it as Fl_Menu_Item ptr) as Fl_Font

declare sub      Fl_Menu_ItemSetLabelSize(it as Fl_Menu_Item ptr, fs as Fl_Fontsize)
declare function Fl_Menu_ItemGetLabelSize(it as Fl_Menu_Item ptr) as Fl_Fontsize

declare sub      Fl_Menu_ItemSetLabelType(it as Fl_Menu_Item ptr, lt as Fl_Labeltype)
declare function Fl_Menu_ItemGetLabelType(it as Fl_Menu_Item ptr) as Fl_Labeltype

declare function Fl_Menu_ItemMeasure(it as Fl_Menu_Item ptr, h as integer ptr, m as const Fl_Menu_ ptr) as integer

declare function Fl_Menu_ItemPopup   (it as Fl_Menu_Item ptr, x as integer, y as integer, title as const zstring ptr=0, picked as const Fl_Menu_Item ptr=0, m as const Fl_Menu_ ptr=0) as const Fl_Menu_Item ptr

declare function Fl_Menu_ItemPulldown(it as Fl_Menu_Item ptr, x as integer, y as integer, w as integer, h as integer, picked as const Fl_Menu_Item ptr=0, m as const Fl_Menu_ ptr=0, title as const Fl_Menu_Item ptr=0, menubar as integer=0) as const Fl_Menu_Item ptr

declare sub      Fl_Menu_ItemSet(it as Fl_Menu_Item ptr)
declare sub      Fl_Menu_ItemSetonly(it as Fl_Menu_Item ptr)

declare sub      Fl_Menu_ItemSetShortcut(it as Fl_Menu_Item ptr, s as integer)
declare function Fl_Menu_ItemGetShortcut(it as Fl_Menu_Item ptr) as integer
declare function Fl_Menu_ItemTestShortcut(it as Fl_Menu_Item ptr) as const Fl_Menu_Item ptr

declare function Fl_Menu_ItemSize(it as Fl_Menu_Item ptr) as integer
declare function Fl_Menu_ItemSubmenu(it as Fl_Menu_Item ptr) as integer

declare sub      Fl_Menu_ItemSetUserData(it as Fl_Menu_Item ptr, userdata as any ptr)
declare function Fl_Menu_ItemGetUserData(it as Fl_Menu_Item ptr) as any ptr

declare function Fl_Menu_ItemValue(it as Fl_Menu_Item ptr) as integer
declare function Fl_Menu_ItemVisible(it as Fl_Menu_Item ptr) as integer

'####################################
'# class Fl_Menu_ extends Fl_Widget #
'####################################
declare function Fl_Menu_Add(m_ as Fl_Menu_ ptr, label as const zstring ptr, shortcut as integer, cb as Fl_Callback, userdata as any ptr=0, flag as integer=0) as integer
declare function Fl_Menu_Add2(m_ as Fl_Menu_ ptr, label as const zstring ptr, shortcut as const zstring ptr, cb as Fl_Callback, userdata as any ptr=0, flag as integer=0) as integer
declare function Fl_Menu_Add3(m_ as Fl_Menu_ ptr, label as const zstring ptr) as integer

declare sub      Fl_Menu_Clear(m_ as Fl_Menu_ ptr)

declare function Fl_Menu_ClearSubmenu(m_ as Fl_Menu_ ptr, index as integer) as integer

declare sub      Fl_Menu_Copy(m_ as Fl_Menu_ ptr, mi as const Fl_Menu_Item ptr, userdata as any ptr=0)

declare sub      Fl_Menu_SetDownBox(m_ as Fl_Menu_ ptr, bt as Fl_Boxtype)
declare function Fl_Menu_GetDownBox(m_ as Fl_Menu_ ptr) as Fl_Boxtype

declare sub      Fl_Menu_SetDownColor(m_ as Fl_Menu_ ptr, c as Fl_Color)
declare function Fl_Menu_GetDownColor(m_ as Fl_Menu_ ptr) as Fl_Color

declare function Fl_Menu_FindIndexByName(m_ as Fl_Menu_ ptr, name_ as const zstring ptr) as integer
declare function Fl_Menu_FindIndexByItem(m_ as Fl_Menu_ ptr, item as const Fl_Menu_Item ptr) as integer
declare function Fl_Menu_FindIndexByCallback(m_ as Fl_Menu_ ptr, cb as Fl_Callback) as integer

declare function Fl_Menu_FindItemByName(m_ as Fl_Menu_ ptr, name_ as const zstring ptr) as const Fl_Menu_Item ptr
declare function Fl_Menu_FindItemByCallback(m_ as Fl_Menu_ ptr, cb as Fl_Callback) as const Fl_Menu_Item ptr

declare sub      Fl_Menu_Global(m_ as Fl_Menu_ ptr)

declare function Fl_Menu_Insert (m_ as Fl_Menu_ ptr, index as integer, label as const zstring ptr, shortcut as const zstring ptr, cb as Fl_Callback, userdata as any ptr=0, flag as integer=0) as integer
declare function Fl_Menu_Insert2(m_ as Fl_Menu_ ptr, index as integer, label as const zstring ptr, shortcut as integer          , cb as Fl_Callback, userdata as any ptr=0, flag as integer=0) as integer

declare function Fl_Menu_ItemPathName(m_ as Fl_Menu_ ptr, name_ as zstring ptr, namelen as integer, item as const Fl_Menu_Item ptr =0) as integer

declare sub      Fl_Menu_SetMenu(m_ as Fl_Menu_ ptr, item as const Fl_Menu_Item ptr)
declare function Fl_Menu_GetMenu(m_ as Fl_Menu_ ptr) as const Fl_Menu_Item ptr

declare sub      Fl_Menu_SetMode(m_ as Fl_Menu_ ptr, index as integer, flag as integer)
declare function Fl_Menu_GetMode (m_ as Fl_Menu_ ptr, index as integer) as integer

declare function Fl_Menu_MValue(m_ as Fl_Menu_ ptr) as const Fl_Menu_Item ptr
declare function Fl_Menu_Picked(m_ as Fl_Menu_ ptr, item as const Fl_Menu_Item ptr) as const Fl_Menu_Item ptr
declare sub      Fl_Menu_Remove(m_ as Fl_Menu_ ptr, index as integer)
declare sub      Fl_Menu_Replace(m_ as Fl_Menu_ ptr, index as integer, label as const zstring ptr)
declare sub      Fl_Menu_Shortcut(m_ as Fl_Menu_ ptr, index as integer, shortcut as integer)

declare function Fl_Menu_GetSize(m_ as Fl_Menu_ ptr) as integer
declare sub      Fl_Menu_SetSize(m_ as Fl_Menu_ ptr, w as integer, h as integer)

declare function Fl_Menu_TestShortcut(m_ as Fl_Menu_ ptr) as const Fl_Menu_Item ptr

declare function Fl_Menu_Text(m_ as Fl_Menu_ ptr) as const zstring ptr
declare function Fl_Menu_TextByIndex(m_ as Fl_Menu_ ptr, index as integer) as const zstring ptr

declare sub      Fl_Menu_SetTextColor(m_ as Fl_Menu_ ptr, c as Fl_Color)
declare function Fl_Menu_GetTextColor(m_ as Fl_Menu_ ptr) as Fl_Color

declare sub      Fl_Menu_SetTextFont(m_ as Fl_Menu_ ptr, f as Fl_Font)
declare function Fl_Menu_GetTextFont(m_ as Fl_Menu_ ptr) as Fl_Font

declare sub      Fl_Menu_SetTextSize(m_ as Fl_Menu_ ptr, fs as Fl_Fontsize)
declare function Fl_Menu_GetTextSize(m_ as Fl_Menu_ ptr) as Fl_Fontsize

declare function Fl_Menu_Value(m_ as Fl_Menu_ ptr) as integer
declare function Fl_Menu_ValueByItem(m_ as Fl_Menu_ ptr, m as const Fl_Menu_Item ptr) as integer
declare function Fl_Menu_ValueByIndex(m_ as Fl_Menu_ ptr, index as integer) as integer

'######################################
'# class Fl_Menu_Bar extends Fl_Menu_ #
'######################################
DeclareEx(Fl_Menu_Bar)
declare function Fl_Menu_BarNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Menu_Bar ptr
declare function Fl_Menu_BarHandle(mb as Fl_Menu_Bar ptr, event as Fl_Event) as integer

'#########################################
'# class Fl_Menu_Button extends Fl_Menu_ #
'#########################################
DeclareEx(Fl_Menu_Button)
declare function Fl_Menu_ButtonNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Menu_Button ptr
declare function Fl_Menu_ButtonHandle(mb as Fl_Menu_Button ptr, event as Fl_Event) as integer
declare function Fl_Menu_ButtonPopup(mb as Fl_Menu_Button ptr) as const Fl_Menu_Item ptr

'####################################
'# class Fl_Choice extends Fl_Menu_ #
'####################################
DeclareEx(Fl_Choice)
declare function Fl_ChoiceNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Choice ptr
declare function Fl_ChoiceHandle(c as Fl_Choice ptr, event as Fl_Event) as integer
declare function Fl_ChoiceSetValue(c as Fl_Choice ptr, index as integer) as integer
declare function Fl_ChoiceSetValueByItem(c as Fl_Choice ptr, item as const Fl_Menu_Item ptr) as integer
declare function Fl_ChoiceGetValue(c as Fl_Choice ptr) as integer

'#######################################
'# class Fl_Progress extends Fl_Widget #
'#######################################
DeclareEx(Fl_Progress)
declare function Fl_ProgressNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Progress ptr

declare sub      Fl_ProgressSetMinimum(prg as Fl_Progress ptr, v as single)
declare function Fl_ProgressGetMinimum(prg as Fl_Progress ptr) as single

declare sub      Fl_ProgressSetMaximum(prg as Fl_Progress ptr, v as single)
declare function Fl_ProgressGetMaximum(prg as Fl_Progress ptr) as single

declare sub      Fl_ProgressSetValue  (prg as Fl_Progress ptr, v as single)
declare function Fl_ProgressGetValue  (prg as Fl_Progress ptr) as single

'#######################################
'# class Fl_Valuator extends Fl_Widget #
'#######################################
declare sub      Fl_ValuatorBounds(va as Fl_Valuator ptr, a as double, b as double)
declare function Fl_ValuatorClamp(va as Fl_Valuator ptr, v as double) as double
declare function Fl_ValuatorFormat(va as Fl_Valuator ptr, fmt as zstring ptr) as integer
declare function Fl_ValuatorIncrement(va as Fl_Valuator ptr, v as double, n as integer) as double
declare sub      Fl_ValuatorPrecision(va as Fl_Valuator ptr, p as integer)
declare sub      Fl_ValuatorRange(va as Fl_Valuator ptr, a as double, b as double)
declare function Fl_ValuatorRound(va as Fl_Valuator ptr, v as double) as double
declare function Fl_ValuatorStep(va as Fl_Valuator ptr) as double

declare sub      Fl_ValuatorSetMinimum(va as Fl_Valuator ptr, a as double)
declare function Fl_ValuatorGetMinimum(va as Fl_Valuator ptr) as double

declare sub      Fl_ValuatorSetMaximum(va as Fl_Valuator ptr, a as double)
declare function Fl_ValuatorGetMaximum(va as Fl_Valuator ptr) as double

declare function Fl_ValuatorSetValue(va as Fl_Valuator ptr, v as double) as integer
declare function Fl_ValuatorGetValue(va as Fl_Valuator ptr) as double

'#########################################
'# class Fl_Adjuster extends Fl_Valuator #
'#########################################
DeclareEx(Fl_Adjuster)
declare function Fl_AdjusterNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Adjuster ptr

declare sub      Fl_AdjusterSetSoft(adj as Fl_Adjuster ptr, s as integer)
declare function Fl_AdjusterGetSoft(adj as Fl_Adjuster ptr) as integer

'########################################
'# class Fl_Counter extends Fl_Valuator #
'########################################
DeclareEx(Fl_Counter)
declare function Fl_CounterNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Counter ptr
declare function Fl_CounterHandle(cnt as Fl_Counter ptr, event as Fl_Event) as integer
declare sub      Fl_CounterLargeStep(cnt as Fl_Counter ptr, a as double)
declare sub      Fl_CounterNormalStep(cnt as Fl_Counter ptr, a as double)
declare sub      Fl_CounterStep(cnt as Fl_Counter ptr, a as double, b as double)

'##############################################
'# class Fl_Simple_Counter extends Fl_Counter #
'##############################################
DeclareEx(Fl_Simple_Counter)
declare function Fl_Simple_CounterNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Simple_Counter ptr

'#####################################
'# class Fl_Dial extends Fl_Valuator #
'#####################################
DeclareEx(Fl_Dial)
declare function Fl_DialNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Dial ptr
declare function Fl_DialHandle(dial as Fl_Dial ptr, event as Fl_Event) as integer

declare sub      Fl_DialAngles(dial as Fl_Dial ptr, a1 as short, a2 as short)

declare sub      Fl_DialSetAngle1(dial as Fl_Dial ptr, a1 as short)
declare function Fl_DialGetAngle1(dial as Fl_Dial ptr) as short

declare sub      Fl_DialSetAngle2(dial as Fl_Dial ptr, a2 as short)
declare function Fl_DialGetAngle2(dial as Fl_Dial ptr) as short

'######################################
'# class Fl_Fill_Dial extends Fl_Dial #
'######################################
DeclareEx(Fl_Fill_Dial)
declare function Fl_Fill_DialNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Fill_Dial ptr

'######################################
'# class Fl_Line_Dial extends Fl_Dial #
'######################################
DeclareEx(Fl_Line_Dial)
declare function Fl_Line_DialNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Line_Dial ptr

'#######################################
'# class Fl_Roller extends Fl_Valuator #
'#######################################
DeclareEx(Fl_Roller)
declare function Fl_RollerNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Roller ptr

'#######################################
'# class Fl_Slider extends Fl_Valuator #
'#######################################
DeclareEx(Fl_Slider)
declare function Fl_SliderNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Slider ptr
declare function Fl_SliderNew2(t as ubyte, x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Slider ptr
declare sub      Fl_SliderBounds(sl as Fl_Slider ptr, a as double, b as double)
declare function Fl_SliderHandle(sl as Fl_Slider ptr, event as Fl_Event) as integer
declare function Fl_SliderScrollValue(sl as Fl_Slider ptr, p as integer, size as integer, first as integer, total as integer) as integer
declare sub      Fl_SliderSetSlider(sl as Fl_Slider ptr, c as Fl_Boxtype)
declare function Fl_SliderGetSlider(sl as Fl_Slider ptr) as Fl_Boxtype
declare sub      Fl_SliderSetSliderSize(sl as Fl_Slider ptr, v as double)
declare function Fl_SliderGetSliderSize(sl as Fl_Slider ptr) as double

'#########################################
'# class Fl_Hor_Slider extends Fl_Slider #
'#########################################
DeclareEx(Fl_Hor_Slider)
declare function Fl_Hor_SliderNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Hor_Slider ptr

'##########################################
'# class Fl_Fill_Slider extends Fl_Slider #
'##########################################
DeclareEx(Fl_Fill_Slider)
declare function Fl_Fill_SliderNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Fill_Slider ptr

'##############################################
'# class Fl_Hor_Fill_Slider extends Fl_Slider #
'##############################################
DeclareEx(Fl_Hor_Fill_Slider)
declare function Fl_Hor_Fill_SliderNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Hor_Fill_Slider ptr

'##########################################
'# class Fl_Nice_Slider extends Fl_Slider #
'##########################################
DeclareEx(Fl_Nice_Slider)
declare function Fl_Nice_SliderNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Nice_Slider ptr

'##############################################
'# class Fl_Hor_Nice_Slider extends Fl_Slider #
'##############################################
DeclareEx(Fl_Hor_Nice_Slider)
declare function Fl_Hor_Nice_SliderNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Hor_Nice_Slider ptr

'########################################
'# class Fl_Scrollbar extends Fl_Slider #
'########################################
DeclareEx(Fl_Scrollbar)
declare function Fl_ScrollbarNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Scrollbar ptr
declare function Fl_ScrollbarHandle(sb as Fl_Scrollbar ptr, event as Fl_Event) as integer
declare sub      Fl_ScrollbarSetLineSize(sb as Fl_Scrollbar ptr, lz as integer)
declare function Fl_ScrollbarGetLineSize(sb as Fl_Scrollbar ptr) as integer
declare function Fl_ScrollbarSetValue(sb as Fl_Scrollbar ptr, p as integer) as integer
declare function Fl_ScrollbarGetValue(sb as Fl_Scrollbar ptr) as integer
declare function Fl_ScrollbarValue(sb as Fl_Scrollbar ptr, p as integer, windowSize as integer, first as integer, total as integer) as integer

'###########################################
'# class Fl_Value_Slider extends Fl_Slider #
'###########################################
DeclareEx(Fl_Value_Slider)
declare function Fl_Value_SliderNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Value_Slider ptr
declare function Fl_Value_SliderHandle(sl as Fl_Value_Slider ptr, event as Fl_Event) as integer
declare sub      Fl_Value_SliderSetTextColor(sl as Fl_Value_Slider ptr, c as Fl_Color)
declare function Fl_Value_SliderGetTextColor(sl as Fl_Value_Slider ptr) as Fl_Color
declare sub      Fl_Value_SliderSetTextFont(sl as Fl_Value_Slider ptr, f as Fl_Font)
declare function Fl_Value_SliderGetTextFont(sl as Fl_Value_Slider ptr) as Fl_Font
declare sub      Fl_Value_SliderSetTextSize(sl as Fl_Value_Slider ptr, fs as Fl_Fontsize)
declare function Fl_Value_SliderGetTextSize(sl as Fl_Value_Slider ptr) as Fl_Fontsize

'#####################################################
'# class Fl_Hor_Value_Slider extends Fl_Value_Slider #
'#####################################################
DeclareEx(Fl_Hor_Value_Slider)
declare function Fl_Hor_Value_SliderNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Hor_Value_Slider ptr

'############################################
'# class Fl_Value_Input extends Fl_Valuator #
'############################################
DeclareEx(Fl_Value_Input)
declare function Fl_Value_InputNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Value_Input ptr
declare sub      Fl_Value_InputSetCursorColor(vi as Fl_Value_Input ptr, c as Fl_Color)
declare function Fl_Value_InputGetCursorColor(vi as Fl_Value_Input ptr) as Fl_Color
declare function Fl_Value_InputHandle(vi as Fl_Value_Input ptr, event as Fl_Event) as integer
declare sub      Fl_Value_InputResize(vi as Fl_Value_Input ptr, x as integer, y as integer, w as integer, h as integer)
declare sub      Fl_Value_InputSetShortcut(vi as Fl_Value_Input ptr, s as integer)
declare function Fl_Value_InputGetShortcut(vi as Fl_Value_Input ptr) as integer
declare sub      Fl_Value_InputSetSoft(vi as Fl_Value_Input ptr, s as integer)
declare function Fl_Value_InputGetSoft(vi as Fl_Value_Input ptr) as integer
declare sub      Fl_Value_InputSetTextColor(vi as Fl_Value_Input ptr, c as Fl_Color)
declare function Fl_Value_InputGetTextColor(vi as Fl_Value_Input ptr) as Fl_Color
declare sub      Fl_Value_InputSetTextFont(vi as Fl_Value_Input ptr, f as Fl_Font)
declare function Fl_Value_InputGetTextFont(vi as Fl_Value_Input ptr) as Fl_Font
declare sub      Fl_Value_InputSetTextSize(vi as Fl_Value_Input ptr, fz as Fl_Fontsize)
declare function Fl_Value_InputGetTextSize(vi as Fl_Value_Input ptr) as Fl_Fontsize

'#############################################
'# class Fl_Value_Output extends Fl_Valuator #
'#############################################
DeclareEx(Fl_Value_Output)
declare function Fl_Value_OutputNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Value_Output ptr
declare function Fl_Value_OutputHandle(vo as Fl_Value_Output ptr, event as Fl_Event) as integer
declare sub      Fl_Value_OutputResize(vo as Fl_Value_Output ptr, x as integer, y as integer, w as integer, h as integer)
declare sub      Fl_Value_OutputSetSoft(vo as Fl_Value_Output ptr, s as integer)
declare function Fl_Value_OutputGetSoft(vo as Fl_Value_Output ptr) as integer
declare sub      Fl_Value_OutputSetTextColor(vo as Fl_Value_Output ptr, c as Fl_Color)
declare function Fl_Value_OutputGetTextColor(vo as Fl_Value_Output ptr) as Fl_Color
declare sub      Fl_Value_OutputSetTextFont(vo as Fl_Value_Output ptr, f as Fl_Font)
declare function Fl_Value_OutputGetTextFont(vo as Fl_Value_Output ptr) as Fl_Font
declare sub      Fl_Value_OutputSetTextSize(vo as Fl_Value_Output ptr, fs as Fl_Fontsize)
declare function Fl_Value_OutputGetTextSize(vo as Fl_Value_Output ptr) as Fl_Fontsize

'####################################
'# class Fl_Group extends Fl_Widget #
'####################################
DeclareEx(Fl_Group)
declare function Fl_GroupNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Group ptr
declare sub      Fl_GroupAdd(grp as Fl_Group ptr, wgt as Fl_Widget ptr)

' !!! not useable ATM. we work with class pointers only not with classes by reference !!!
'declare sub      Fl_GroupAddResizable(grp as Fl_Group ptr, byref wgt as Fl_Widget)
' we must use: Fl_GroupSetResizable(grp as Fl_Group ptr, wgt as Fl_Widget ptr)

declare function Fl_GroupAsGroup(grp as Fl_Group ptr) as Fl_Group ptr

declare sub      Fl_GroupBegin(grp as Fl_Group ptr)
declare sub      Fl_GroupEnd(grp as Fl_Group ptr)

declare function Fl_GroupChild(grp as Fl_Group ptr, n as integer) as Fl_Widget ptr

declare function Fl_GroupChildren(grp as Fl_Group ptr) as integer

declare sub      Fl_GroupClear(grp as Fl_Group ptr)

declare sub      Fl_GroupSetClipChildren(grp as Fl_Group ptr, c as integer)
declare function Fl_GroupGetClipChildren(grp as Fl_Group ptr) as integer

declare function Fl_GroupFind (grp as Fl_Group ptr, wgt as const Fl_Widget) as integer

declare sub      Fl_GroupFormsEnd(grp as Fl_Group ptr)

declare function Fl_GroupHandle(grp as Fl_Group ptr, ev as Fl_Event) as integer

declare sub      Fl_GroupInitSizes(grp as Fl_Group ptr)

declare sub      Fl_GroupInsert(grp as Fl_Group ptr, byref wgt as Fl_Widget ptr, before as Fl_Widget ptr)
declare sub      Fl_GroupInsert2(grp as Fl_Group ptr, byref wgt as Fl_Widget ptr, i as integer)

declare sub      Fl_GroupRemove(grp as Fl_Group ptr, index as integer)
declare sub      Fl_GroupRemove2(grp as Fl_Group ptr, wgt as Fl_Widget ptr)

declare function Fl_GroupGetResizable(grp as Fl_Group ptr) as Fl_Widget ptr
declare sub      Fl_GroupSetResizable(grp as Fl_Group ptr, wgt as Fl_Widget ptr)

declare sub      Fl_GroupResize(grp as Fl_Group ptr, x as integer, y as integer, w as integer, h as integer)

'##################################
'# class Fl_Pack extends Fl_Group #
'##################################
DeclareEx(Fl_Pack)
declare function Fl_PackNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Pack ptr
declare sub      Fl_PackSetSpacing(pk as Fl_Pack ptr, v as integer)
declare function Fl_PackGetSpacing(pk as Fl_Pack ptr) as integer

'##################################
'# class Fl_Tile extends Fl_Group #
'##################################
declare function Fl_TileNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Tile ptr
declare function Fl_TileHandle(tile as Fl_Tile ptr, event as Fl_Event) as integer
declare sub      Fl_TilePosition(tile as Fl_Tile ptr, from_x as integer, from_y as integer, to_x as integer, to_y as integer)
declare sub      Fl_TileResize(tile as Fl_Tile ptr,x as integer, y as integer, w as integer, h as integer)

'####################################
'# class Fl_Scroll extends Fl_Group #
'####################################
DeclareEx(Fl_Scroll)
declare function Fl_ScrollNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Scroll ptr
declare sub      Fl_ScrollClear(sc as Fl_Scroll ptr)
declare function Fl_ScrollHandle(sc as Fl_Scroll ptr, event as Fl_Event) as integer
declare sub      Fl_ScrollResize(sc as Fl_Scroll ptr, x as integer, y as integer, w as integer, h as integer)
declare sub      Fl_ScrollScrollTo(sc as Fl_Scroll ptr, x as integer, y as integer)
declare sub      Fl_ScrollSetScrollbarSize(sc as Fl_Scroll ptr, newSize as integer)
declare function Fl_ScrollGetScrollbarSize(sc as Fl_Scroll ptr) as integer
declare function Fl_ScrollXPosition(sc as Fl_Scroll ptr) as integer
declare function Fl_ScrollYPosition(sc as Fl_Scroll ptr) as integer

'######################################
'# class Fl_Browser_ extends Fl_Group #
'######################################
declare function Fl_Browser_Deselect(br as Fl_Browser_ ptr, docallbacks as integer=0) as integer
declare sub      Fl_Browser_Display(br as Fl_Browser_ ptr, item as any ptr)
declare function Fl_Browser_Handle(br as Fl_Browser_ ptr, event as Fl_Event) as integer

declare sub      Fl_Browser_SetHasScrollbar(br as Fl_Browser_ ptr, mode as ubyte)
declare function Fl_Browser_GetHasSscrollbar(br as Fl_Browser_ ptr) as ubyte

declare sub      Fl_Browser_SetHPosition(br as Fl_Browser_ ptr, p as integer)
declare function Fl_Browser_GetHPosition(br as Fl_Browser_ ptr) as integer

declare sub      Fl_Browser_SetPosition(br as Fl_Browser_ ptr, p as integer)
declare function Fl_Browser_GetPosition(br as Fl_Browser_ ptr) as integer

declare sub      Fl_Browser_Resize(br as Fl_Browser_ ptr, x as integer, y as integer, w as integer, h as integer)

declare sub      Fl_Browser_ScrollbarLeft(br as Fl_Browser_ ptr)
declare sub      Fl_Browser_ScrollbarRight(br as Fl_Browser_ ptr)

declare sub      Fl_Browser_SetScrollbarSize(br as Fl_Browser_ ptr, s as integer)
declare function Fl_Browser_GetScrollbarSize(br as Fl_Browser_ ptr) as integer

declare sub      Fl_Browser_SetScrollbarWidth(br as Fl_Browser_ ptr, w as integer)
declare function Fl_Browser_GetScrollbarWidth(br as Fl_Browser_ ptr) as integer

declare function Fl_Browser_Select(br as Fl_Browser_ ptr, item as any ptr, v as integer=1, docallbacks as integer=0) as integer
declare function Fl_Browser_SelectOnly(br as Fl_Browser_ ptr, item as any ptr, docallbacks as integer=0) as integer
declare sub      Fl_Browser_Sort(br as Fl_Browser_ ptr, flags as integer=0)

declare sub      Fl_Browser_SetTextColor(br as Fl_Browser_ ptr, c as Fl_Color)
declare function Fl_Browser_GetTextColor(br as Fl_Browser_ ptr) as Fl_Color

declare sub      Fl_Browser_SetTextFont(br as Fl_Browser_ ptr, f as Fl_Font)
declare function Fl_Browser_GetTextFont(br as Fl_Browser_ ptr) as Fl_Font

declare sub      Fl_Browser_SetTextsize(br as Fl_Browser_ ptr, fs as Fl_Fontsize)
declare function Fl_Browser_GetTextsize(br as Fl_Browser_ ptr) as Fl_Fontsize

'##############################################
'# class Fl_Check_Browser extends Fl_Browser_ #
'##############################################
DeclareEx(Fl_Check_Browser)
declare function Fl_Check_BrowserNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Check_Browser ptr
declare function Fl_Check_BrowserAdd(cb as Fl_Check_Browser ptr, s as zstring ptr) as integer
declare function Fl_Check_BrowserAdd2(cb as Fl_Check_Browser ptr, s as zstring ptr, b as integer) as integer
declare sub      Fl_Check_BrowserCheckAll(cb as Fl_Check_Browser ptr)
declare sub      Fl_Check_BrowserCheckNone(cb as Fl_Check_Browser ptr)
declare sub      Fl_Check_BrowserChecked(cb as Fl_Check_Browser ptr, item as integer, b as integer)
declare sub      Fl_Check_BrowserClear(cb as Fl_Check_Browser ptr)
declare function Fl_Check_BrowserNChecked(cb as Fl_Check_Browser ptr) as integer
declare function Fl_Check_BrowserNItems(cb as Fl_Check_Browser ptr) as integer
declare function Fl_Check_BrowserRemove(cb as Fl_Check_Browser ptr, item as integer) as integer
declare sub      Fl_Check_BrowserSetChecked(cb as Fl_Check_Browser ptr, item as integer)
declare function Fl_Check_BrowserGetChecked(cb as Fl_Check_Browser ptr, item as integer) as integer
declare function Fl_Check_BrowserText(cb as Fl_Check_Browser ptr, item as integer) as zstring ptr
declare function Fl_Check_BrowserValue(cb as Fl_Check_Browser ptr) as integer

'########################################
'# class Fl_Browser extends Fl_Browser_ #
'########################################
DeclareEx(Fl_Browser)
declare function Fl_BrowserNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Browser ptr
declare sub      Fl_BrowserAdd(br as Fl_Browser ptr, newtext as const zstring ptr, pData as any ptr=0)
declare sub      Fl_BrowserBottomLine(br as Fl_Browser ptr, line_ as integer)
declare sub      Fl_BrowserClear(br as Fl_Browser ptr)

declare sub      Fl_BrowserSetColumnChar(br as Fl_Browser ptr, c as ubyte)
declare function Fl_BrowserGetColumnChar(br as Fl_Browser ptr) as ubyte

declare sub      Fl_BrowserSetColumnWidths(br as Fl_Browser ptr, arr as const integer ptr)
declare function Fl_BrowserGetColumnWidths(br as Fl_Browser ptr) as const integer ptr

declare sub      Fl_BrowserSetData(br as Fl_Browser ptr, line_ as integer, pData as any ptr)
declare function Fl_BrowserGetData(br as Fl_Browser ptr, line_ as integer) as any ptr

declare sub      Fl_BrowserDisplay(br as Fl_Browser ptr, line_ as integer, v as integer=1)
declare function Fl_BrowserDisplayed(br as Fl_Browser ptr, line_ as integer) as integer

declare sub      Fl_BrowserSetFormatChar(br as Fl_Browser ptr, c as ubyte)
declare function Fl_BrowserGetFormatChar(br as Fl_Browser ptr) as ubyte

declare sub      Fl_BrowserHide(br as Fl_Browser ptr)
declare sub      Fl_BrowserHide2(br as Fl_Browser ptr, line_ as integer)

declare sub      Fl_BrowserSetIcon(br as Fl_Browser ptr, line_ as integer, icon as Fl_Image ptr)
declare function Fl_BrowserGetIcon(br as Fl_Browser ptr, line_ as integer) as Fl_Image ptr

declare sub      Fl_BrowserInsert(br as Fl_Browser ptr, line_ as integer, newtext as const zstring ptr, pDatat as any ptr=0)
declare sub      Fl_BrowserLinePosition(br as Fl_Browser ptr, line_ as integer, p as Fl_LinePosition)
declare function Fl_BrowserLoad(br as Fl_Browser ptr, filename as const zstring ptr) as integer
declare sub      Fl_BrowserMakeVisible(br as Fl_Browser ptr, line_ as integer)
declare sub      Fl_BrowserMiddleLine(br as Fl_Browser ptr, line_ as integer)
declare sub      Fl_BrowserMove(br as Fl_Browser ptr, to_ as integer, from as integer)
declare sub      Fl_BrowserRemove(br as Fl_Browser ptr, line_ as integer)
declare sub      Fl_BrowserRemoveIcon(br as Fl_Browser ptr, line_ as integer)
declare sub      Fl_BrowserReplace(br as Fl_Browser ptr, a as integer, b as const zstring ptr)
declare function Fl_BrowserSelect(br as Fl_Browser ptr, line_ as integer, v as integer=1) as integer
declare function Fl_BrowserSelected(br as Fl_Browser ptr, line_ as integer) as integer
declare sub      Fl_BrowserShow(br as Fl_Browser ptr)
declare sub      Fl_BrowserShow2(br as Fl_Browser ptr, line_ as integer)

declare sub      Fl_BrowserSetSize(br as Fl_Browser ptr, w as integer, h as integer)
declare function Fl_BrowserGetSize(br as Fl_Browser ptr) as integer

declare sub      Fl_BrowserSwap(br as Fl_Browser ptr, a as integer, b as integer)

declare sub      Fl_BrowserSetText(br as Fl_Browser ptr, line_ as integer, newtext as const zstring ptr)
declare function Fl_BrowserGetText(br as Fl_Browser ptr, line_ as integer) as const zstring ptr

declare sub      Fl_BrowserSetTopline(br as Fl_Browser ptr, line_ as integer)
declare function Fl_BrowserGetTopline(br as Fl_Browser ptr) as integer

declare sub      Fl_BrowserSetValue(br as Fl_Browser ptr, line_ as integer)
declare function Fl_BrowserGetValue(br as Fl_Browser ptr) as integer

declare function Fl_BrowserVisible(br as Fl_Browser ptr, line_ as integer) as integer

'############################################
'# class Fl_File_Browser extends Fl_Browser #
'############################################
DeclareEx(Fl_File_Browser)
declare function Fl_File_BrowserNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_File_Browser ptr

declare sub      Fl_File_BrowserSetFiletype(f as Fl_File_Browser ptr, type_ as Fl_FileType)
declare function Fl_File_BrowserGetFiletype(f as Fl_File_Browser ptr) as Fl_FileType

declare sub      Fl_File_BrowserSetFilter(f as Fl_File_Browser ptr, pattern as const zstring ptr)
declare function Fl_File_BrowserGetFilter(f as Fl_File_Browser ptr) as const zstring ptr

declare sub      Fl_File_BrowserSetIconSize(f as Fl_File_Browser ptr, s as ubyte)
declare function Fl_File_BrowserGetIconSize(f as Fl_File_Browser ptr) as ubyte

declare function Fl_File_BrowserLoad(f as Fl_File_Browser ptr, directory as const zstring ptr) as integer
declare sub      Fl_File_BrowserSetTextSize(f as Fl_File_Browser ptr, s as Fl_Fontsize)
declare function Fl_File_BrowserGetTextSize(f as Fl_File_Browser ptr) as Fl_Fontsize

'############################################
'# class Fl_Hold_Browser extends Fl_Browser #
'############################################
DeclareEx(Fl_Hold_Browser)
declare function Fl_Hold_BrowserNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Hold_Browser ptr

'#############################################
'# class Fl_Multi_Browser extends Fl_Browser #
'#############################################
DeclareEx(Fl_Multi_Browser)
declare function Fl_Multi_BrowserNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Multi_Browser ptr

'##############################################
'# class Fl_Select_Browser extends Fl_Browser #
'##############################################
DeclareEx(Fl_Select_Browser)
declare function Fl_Select_BrowserNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Select_Browser ptr

'###########################################
'# class Fl_Color_Chooser extends Fl_Group #
'###########################################
DeclareEx(Fl_Color_Chooser)
declare function Fl_Color_ChooserNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Color_Chooser ptr
declare sub      Fl_Color_ChooserSetMode(cc as Fl_Color_Chooser ptr, newMode as FL_ColorChooserModes)
declare function Fl_Color_ChooserGetMode(cc as Fl_Color_Chooser ptr) as FL_ColorChooserModes

declare function Fl_Color_ChooserRGB(cc as Fl_Color_Chooser ptr, r as double, g as double, b as double) as integer
declare function Fl_Color_ChooserR(cc as Fl_Color_Chooser ptr) as double
declare function Fl_Color_ChooserG(cc as Fl_Color_Chooser ptr) as double
declare function Fl_Color_ChooserB(cc as Fl_Color_Chooser ptr) as double

declare function Fl_Color_ChooserHSV(cc as Fl_Color_Chooser ptr, h as double, s as double, v as double) as integer
declare function Fl_Color_ChooserHue(cc as Fl_Color_Chooser ptr) as double
declare function Fl_Color_ChooserSaturation(cc as Fl_Color_Chooser ptr) as double
declare function Fl_Color_ChooserValue(cc as Fl_Color_Chooser ptr) as double

declare sub      Fl_Color_ChooserHSV2RGB(cc as Fl_Color_Chooser ptr, h as double, s as double, v as double, byref r as double, byref g as double, byref b as double)
declare sub      Fl_Color_ChooserRGB2HSV(cc as Fl_Color_Chooser ptr, r as double, g as double, b as double, byref h as double, byref s as double, byref v as double)

'#######################################
'# class Fl_Help_View extends Fl_Group #
'#######################################
declare function Fl_Help_ViewNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Help_View ptr
declare sub      Fl_Help_ViewClearSelection(hv as Fl_Help_View ptr)
declare function Fl_Help_ViewDirectory(hv as Fl_Help_View ptr) as const zstring ptr
declare function Fl_Help_ViewFilename(hv as Fl_Help_View ptr) as const zstring ptr
declare function Fl_Help_ViewFind(hv as Fl_Help_View ptr, s as const zstring ptr, p as integer=0) as integer

declare sub      Fl_Help_ViewSetLeftLine(hv as Fl_Help_View ptr, LeftLine as integer)
declare function Fl_Help_ViewGetLeftLine(hv as Fl_Help_View ptr) as integer

declare sub      Fl_Help_ViewLink(hv as Fl_Help_View ptr, fn as Fl_Help_F)
declare function Fl_Help_ViewLoad(hv as Fl_Help_View ptr, filename as const zstring ptr) as integer
declare sub      Fl_Help_ViewResize(hv as Fl_Help_View ptr, x as integer, y as integer, w as integer, h as integer)

declare sub      Fl_Help_ViewSetScrollbarSize(hv as Fl_Help_View ptr, s as integer)
declare function Fl_Help_ViewGetScrollbarSize(hv as Fl_Help_View ptr) as integer

declare sub      Fl_Help_ViewSelectAll(hv as Fl_Help_View ptr)

declare sub      Fl_Help_ViewSetSize(hv as Fl_Help_View ptr, w as integer, h as integer)
declare function Fl_Help_ViewGetSize(hv as Fl_Help_View ptr) as integer

declare sub      Fl_Help_ViewSetTextColor(hv as Fl_Help_View ptr, c as Fl_Color)
declare function Fl_Help_ViewGetTextColor(hv as Fl_Help_View ptr) as Fl_Color

declare sub      Fl_Help_ViewSetTextFont(hv as Fl_Help_View ptr, f as Fl_Font)
declare function Fl_Help_ViewGetTextFont(hv as Fl_Help_View ptr) as Fl_Font

declare sub      Fl_Help_ViewSetTextSize(hv as Fl_Help_View ptr, s as Fl_Fontsize)
declare function Fl_Help_ViewGetTextSize(hv as Fl_Help_View ptr) as Fl_Fontsize

declare function Fl_Help_ViewTitle(hv as Fl_Help_View ptr) as const zstring ptr

declare sub      Fl_Help_ViewTopline(hv as Fl_Help_View ptr, by_name as const zstring ptr)

declare sub      Fl_Help_ViewSetTopline(hv as Fl_Help_View ptr, pixel as integer)
declare function Fl_Help_ViewGetTopline(hv as Fl_Help_View ptr) as integer

declare sub      Fl_Help_ViewSetValue(hv as Fl_Help_View ptr, v as const zstring ptr)
declare function Fl_Help_ViewGetValue(hv as Fl_Help_View ptr) as const zstring ptr

'##########################################
'# class Fl_Input_Choice extends Fl_Group #
'##########################################
DeclareEx(Fl_Input_Choice)
declare function Fl_Input_ChoiceNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Input_Choice ptr
declare sub      Fl_Input_ChoiceAdd(ic as Fl_Input_Choice ptr, s as const zstring ptr)
declare function Fl_Input_ChoiceChanged(ic as Fl_Input_Choice ptr) as integer
declare sub      Fl_Input_ChoiceClear(ic as Fl_Input_Choice ptr)
declare sub      Fl_Input_ChoiceClearChanged(ic as Fl_Input_Choice ptr)

declare sub      Fl_Input_ChoiceSetDownBox(ic as Fl_Input_Choice ptr, b as Fl_Boxtype)
declare function Fl_Input_ChoiceGetDownBox(ic as Fl_Input_Choice ptr) as Fl_Boxtype

declare function Fl_Input_ChoiceInput(ic as Fl_Input_Choice ptr) as Fl_Input ptr

declare sub      Fl_Input_ChoiceSetMenu(ic as Fl_Input_Choice ptr, m as const Fl_Menu_Item ptr)
declare function Fl_Input_ChoiceGetMenu(ic as Fl_Input_Choice ptr) as const Fl_Menu_Item ptr

declare function Fl_Input_ChoiceMenuButton(ic as Fl_Input_Choice ptr) as Fl_Menu_Button ptr

declare sub      Fl_Input_ChoiceResize(ic as Fl_Input_Choice ptr, x as integer, y as integer, w as integer, h as integer)

declare sub      Fl_Input_ChoiceSetChanged(ic as Fl_Input_Choice ptr)

declare sub      Fl_Input_ChoiceSetTextColor(ic as Fl_Input_Choice ptr, c as Fl_Color)
declare function Fl_Input_ChoiceGetTextColor(ic as Fl_Input_Choice ptr) as Fl_Color

declare sub      Fl_Input_ChoiceSetTextFont(ic as Fl_Input_Choice ptr, f as Fl_Font)
declare function Fl_Input_ChoiceGetTextFont(ic as Fl_Input_Choice ptr) as Fl_Font

declare sub      Fl_Input_ChoiceSetTextSize(ic as Fl_Input_Choice ptr, s as Fl_Fontsize)
declare function Fl_Input_ChoiceGetTextSize(ic as Fl_Input_Choice ptr) as Fl_Fontsize

declare sub      Fl_Input_ChoiceValue(ic as Fl_Input_Choice ptr, v as integer)

declare sub      Fl_Input_ChoiceSetValue(ic as Fl_Input_Choice ptr, v as const zstring ptr)
declare function Fl_Input_ChoiceGetValue(ic as Fl_Input_Choice ptr) as const zstring ptr

'#####################################
'# class Fl_Spinner extends Fl_Group #
'#####################################
declare function Fl_SpinnerNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Spinner ptr

declare sub      Fl_SpinnerSetColor(spi as Fl_Spinner ptr, c as Fl_Color)
declare function Fl_SpinnerGetColor(spi as Fl_Spinner ptr) as Fl_Color

declare sub      Fl_SpinnerSetFormat(spi as Fl_Spinner ptr, f as const zstring ptr)
declare function Fl_SpinnerGetFormat(spi as Fl_Spinner ptr) as const zstring ptr

declare function Fl_SpinnerHandle(spi as Fl_Spinner ptr, e as Fl_Event) as integer

declare sub      Fl_SpinnerSetMaximum(spi as Fl_Spinner ptr, m as double)
declare function Fl_SpinnerGetMaximum(spi as Fl_Spinner ptr) as double

declare sub      Fl_SpinnerSetMinimum(spi as Fl_Spinner ptr, m as double)
declare function Fl_SpinnerGetMinimum(spi as Fl_Spinner ptr) as double

declare sub      Fl_SpinnerRange(spi as Fl_Spinner ptr, a as double, b as double)

declare sub      Fl_SpinnerResize(spi as Fl_Spinner ptr, x as integer, y as integer, w as integer, h as integer)

declare sub      Fl_SpinnerSetStep(spi as Fl_Spinner ptr, s as double)
declare function Fl_SpinnerGetStep(spi as Fl_Spinner ptr) as double

declare sub      Fl_SpinnerSetTextColor(spi as Fl_Spinner ptr, c as Fl_Color)
declare function Fl_SpinnerGetTextColor(spi as Fl_Spinner ptr) as Fl_color

declare sub      Fl_SpinnerSetTextFont(spi as Fl_Spinner ptr, f as Fl_Font)
declare function Fl_SpinnerGetTextFont(spi as Fl_Spinner ptr) as Fl_Font

declare sub      Fl_SpinnerSetTextSize(spi as Fl_Spinner ptr, s as Fl_Fontsize)
declare function Fl_SpinnerGetTextSize(spi as Fl_Spinner ptr) as Fl_Fontsize

declare sub      Fl_SpinnerSetType(spi as Fl_Spinner ptr, v as ubyte)
declare function Fl_SpinnerGetType(spi as Fl_Spinner ptr) as ubyte

declare sub      Fl_SpinnerSetValue(spi as Fl_Spinner ptr, v as double)
declare function Fl_SpinnerGetValue(spi as Fl_Spinner ptr) as double


'###################################
'# class Fl_Table extends Fl_Group #
'###################################
declare function Fl_TableNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Table ptr
declare sub      Fl_TableAdd(t as Fl_Table ptr, wgt as Fl_Widget ptr)
declare function Fl_TableArray(t as Fl_Table ptr) as Fl_Widget ptr const ptr

declare sub      Fl_TableBegin(t as Fl_Table ptr)
declare sub      Fl_TableEnd(t as Fl_Table ptr)

declare function Fl_TableCallbackCol(t as Fl_Table ptr) as integer
declare function Fl_TableCallbackContext(t as Fl_Table ptr) as FL_TableContext
declare function Fl_TableCallbackRow(t as Fl_Table ptr) as integer

declare function Fl_TableChildren(t as Fl_Table ptr) as integer
declare function Fl_TableChild(t as Fl_Table ptr, n as integer) as Fl_Widget ptr

declare sub      Fl_TableClear(t as Fl_Table ptr)

declare sub      Fl_TableSetColHeader(t as Fl_Table ptr, flag as integer)
declare function Fl_TableGetColHeader(t as Fl_Table ptr) as integer

declare sub      Fl_TableSetColHeaderColor(t as Fl_Table ptr, c as Fl_Color)
declare function Fl_TableGetColHeaderColor(t as Fl_Table ptr) as Fl_Color

declare sub      Fl_TableSetColHeaderHeight(t as Fl_Table ptr, h as integer)
declare function Fl_TableGetColHeaderHeight(t as Fl_Table ptr) as integer

declare sub      Fl_TableSetColPosition(t as Fl_Table ptr, c as integer)
declare function Fl_TableGetColPosition(t as Fl_Table ptr) as integer

declare sub      Fl_TableSetColResize(t as Fl_Table ptr, flag as integer)
declare function Fl_TableGetColResize(t as Fl_Table ptr) as integer

declare sub      Fl_TableSetColResizeMin(t as Fl_Table ptr, m as integer)
declare function Fl_TableGetColResizeMin(t as Fl_Table ptr) as integer

declare sub      Fl_TableSetColWidth(t as Fl_Table ptr, c as integer, w as integer)
declare function Fl_TableGetColWidth(t as Fl_Table ptr, c as integer) as integer

declare sub      Fl_TableColWidthAll(t as Fl_Table ptr, w as integer)

declare sub      Fl_TableSetCols(t as Fl_Table ptr, c as integer)
declare function Fl_TableGetCols(t as Fl_Table ptr) as integer

declare sub      Fl_TableDoCallback(t as Fl_Table ptr, context as FL_TableContext, r as integer, c as integer)

declare sub      Fl_TableDraw(t as Fl_Table ptr)

declare function Fl_TableFind(t as Fl_Table ptr, wgt as const Fl_Widget ptr) as integer
declare sub      Fl_TableGetSelection(t as Fl_Table ptr, byref row_top as integer, byref col_left as integer, byref row_bot as integer, byref col_right as integer)
declare sub      Fl_TableInitSizes(t as Fl_Table ptr)
declare sub      Fl_TableInsert(t as Fl_Table ptr, wgt as Fl_Widget ptr, n as integer)
declare sub      Fl_TableInsert2(t as Fl_Table ptr, wgt as Fl_Widget ptr , w2 as Fl_Widget ptr)
declare function Fl_TableIsInteractiveResize(t as Fl_Table ptr) as integer
declare function Fl_TableIsSelected(t as Fl_Table ptr, r as integer, c as integer) as integer
declare function Fl_TableMoveCursor(t as Fl_Table ptr, r as integer, c as integer) as integer
declare sub      Fl_TableRemove(t as Fl_Table ptr, wgt as Fl_Widget ptr)
declare sub      Fl_TableResize(t as Fl_Table ptr, x as integer, y as integer, w as integer, h as integer)

declare sub      Fl_TableSetRowHeader(t as Fl_Table ptr, flag as integer)
declare function Fl_TableGetRowHeader(t as Fl_Table ptr) as integer

declare sub      Fl_TableSetRowHeaderColor(t as Fl_Table ptr, c as Fl_Color)
declare function Fl_TableGetRowHeaderColor(t as Fl_Table ptr) as Fl_Color

declare sub      Fl_TableSetRowHeaderWidth(t as Fl_Table ptr, w as integer)
declare function Fl_TableGetRowHeaderWidth(t as Fl_Table ptr) as integer

declare sub      Fl_TableSetRowHeight(t as Fl_Table ptr, r as integer, h as integer)
declare function Fl_TableGetRowHeight(t as Fl_Table ptr, r as integer) as integer

declare sub      Fl_TableRowHeightAll(t as Fl_Table ptr, h as integer)

declare sub      Fl_TableSetRowPosition(t as Fl_Table ptr, p as integer)
declare function Fl_TableGetRowPosition(t as Fl_Table ptr) as integer

declare sub      Fl_TableSetRowResize(t as Fl_Table ptr, flag as integer)
declare function Fl_TableGetRowResize(t as Fl_Table ptr) as integer

declare sub      Fl_TableSetRowResizeMin(t as Fl_Table ptr, m as integer)
declare function Fl_TableGetRowResizeMin(t as Fl_Table ptr) as integer

declare sub      Fl_TableSetRows(t as Fl_Table ptr, r as integer)
declare function Fl_TableGetRows(t as Fl_Table ptr) as integer

declare sub      Fl_TableSetSelection(t as Fl_Table ptr, row_top as integer, col_left as integer, row_bot as integer, col_right as integer)

declare sub      Fl_TableSetTableBox(t as Fl_Table ptr, bt as Fl_Boxtype)
declare function Fl_TableGetTableBox(t as Fl_Table ptr) as Fl_Boxtype

declare sub      Fl_TableSetTopRow(t as Fl_Table ptr, row as integer)
declare function Fl_TableGetTopRow(t as Fl_Table ptr) as integer

declare sub      Fl_TableVisibleCells(t as Fl_Table ptr, byref r1 as integer, byref r2 as integer, byref c1 as integer, byref c2 as integer)

declare sub      Fl_TableWhen(t as Fl_Table ptr, flags as Fl_When)

'#####################################
'# class Fl_TableEx extends Fl_Table #
'#####################################
declare function Fl_TableExNew(x as integer,y as integer,w as integer,h as integer,label as const zstring ptr=0) as Fl_TableEx ptr
declare sub      Fl_TableExSetDrawCB(tbl as Fl_TableEx ptr, cb as Fl_DrawEx)
declare sub      Fl_TableExSetDrawCellCB(tbl as Fl_TableEx ptr, cb as Fl_DrawcellEx)
declare sub      Fl_TableExSetHandleCB(tbl as Fl_TableEx ptr, cb as Fl_HandleEx)
declare sub      Fl_TableExSetResizeCB(tbl as Fl_TableEx ptr, cb as Fl_ResizeEx)

'#######################################
'# class Fl_Table_Row extends Fl_Table #
'#######################################
DeclareEx(Fl_Table_Row)
declare function Fl_Table_RowNew(x as integer,y as integer,w as integer,h as integer, label as const zstring ptr=0) as Fl_Table_Row ptr
declare sub      Fl_Table_RowClear(tr as Fl_Table_Row ptr)
declare function Fl_Table_RowRowSelected(tr as Fl_Table_Row ptr, r as integer) as integer

declare sub      Fl_Table_RowSetRows(tr as Fl_Table_Row ptr, r as integer)
declare function Fl_Table_RowGetRows(tr as Fl_Table_Row ptr) as integer

declare sub      Fl_Table_RowSelectAllRows(tr as Fl_Table_Row ptr, flag as integer=1)
declare function Fl_Table_RowSelectRow(tr as Fl_Table_Row ptr, row as integer, flag as integer=1) as integer

declare sub      Fl_Table_RowSetType(tr as Fl_Table_Row ptr, m as Fl_TableRowSelectMode)
declare function Fl_Table_RowGetType(tr as Fl_Table_Row ptr) as Fl_TableRowSelectMode

'##################################
'# class Fl_Tabs extends Fl_Group #
'##################################
DeclareEx(Fl_Tabs)
declare function Fl_TabsNew(x as integer,y as integer,w as integer,h as integer, label as const zstring ptr=0) as Fl_Tabs ptr
declare sub      Fl_TabsClientArea(tbs as Fl_Tabs ptr, byref rx as integer, byref ry as integer, byref rw as integer, byref rh as integer, tabh as integer=0)
declare function Fl_TabsHandle(tbs as Fl_Tabs ptr, event as Fl_Event) as integer
declare function Fl_TabsSetPush(tbs as Fl_Tabs ptr, wgt as Fl_Widget ptr) as integer
declare function Fl_TabsGetPush(tbs as Fl_Tabs ptr) as Fl_Widget ptr
declare function Fl_TabsSetValue(tbs as Fl_Tabs ptr, wgt as Fl_Widget ptr) as integer
declare function Fl_TabsGetValue(tbs as Fl_Tabs ptr) as Fl_Widget ptr
declare function Fl_TabsWhich(tbs as Fl_Tabs ptr, event_x as integer, event_y as integer) as Fl_Widget ptr

'###########################################################################
'# class Fl_Text_Buffer and  Fl_Text_Selection are used by Fl_Text_Display #
'###########################################################################
declare function Fl_Text_SelectionEnd(ts as Fl_Text_Selection ptr) as integer
declare function Fl_Text_SelectionIncludes(ts as Fl_Text_Selection ptr, pos as integer) as integer
declare function Fl_Text_SelectionPosition(ts as Fl_Text_Selection ptr, start as integer ptr, end as integer ptr) as integer
declare sub      Fl_Text_SelectionSetSelected(ts as Fl_Text_Selection ptr, b as integer)
declare function Fl_Text_SelectionGetSelected(ts as Fl_Text_Selection ptr) as integer
declare sub      Fl_Text_SelectionSet(ts as Fl_Text_Selection ptr,start as integer, end as integer)
declare function Fl_Text_SelectionStart(ts as Fl_Text_Selection ptr) as integer
declare sub      Fl_Text_SelectionUpdate(ts as Fl_Text_Selection ptr, pos as integer, nDeleted as integer, nInserted as integer)

declare function Fl_Text_BufferNew(requestedSize as integer=0, preferredGapSize as integer=1024) as Fl_Text_buffer ptr
declare sub      Fl_Text_BufferAddModifyCallback(tb as Fl_Text_Buffer ptr, cb as Fl_Text_Modify_Cb, cbArg as any ptr)
declare sub      Fl_Text_BufferAddPredeleteCallback(tb as Fl_Text_Buffer ptr, cbg as Fl_Text_Predelete_Cb, cbArg as any ptr)
declare function Fl_Text_BufferAddress(tb as Fl_Text_Buffer ptr, pos as integer) as zstring ptr
declare function Fl_Text_BufferAddress2(tb as Fl_Text_Buffer ptr, pos as integer) as const zstring ptr
declare sub      Fl_Text_BufferAppend(tb as Fl_Text_Buffer ptr, text as const zstring ptr)
declare function Fl_Text_BufferAppendFile(tb as Fl_Text_Buffer ptr, file as const zstring ptr, buflen as integer = 128*1024) as integer
declare function Fl_Text_BufferByteAt(tb as Fl_Text_Buffer ptr, p as integer) as byte
declare sub      Fl_Text_BufferCallModifyCallbacks(tb as Fl_Text_Buffer ptr)
declare sub      Fl_Text_BufferCallPredeleteCallbacks(tb as Fl_Text_Buffer ptr)
declare sub      Fl_Text_BufferCanUndo(tb as Fl_Text_Buffer ptr, flag as byte=1)
declare function Fl_Text_BufferCharAt(tb as Fl_Text_Buffer ptr, p as integer) as uinteger
declare sub      Fl_Text_BufferCopy(tb as Fl_Text_Buffer ptr, from as Fl_Text_Buffer ptr, fromStart as integer, fromEnd as integer, toPos as integer)
declare function Fl_Text_BufferCountDisplayedCharacters(tb as Fl_Text_Buffer ptr, lineStartPos as integer, targetPos as integer) as integer
declare function Fl_Text_BufferCountLines(tb as Fl_Text_Buffer ptr, startPos as integer, endPos as integer) as integer
declare function Fl_Text_BufferFindCharBackward(tb as Fl_Text_Buffer ptr, startPos as integer, searchChar as uinteger, foundPos as integer ptr) as integer
declare function Fl_Text_BufferFindCharForward(tb as Fl_Text_Buffer ptr, startPos as integer, searchChar as uinteger, foundPos as integer ptr) as integer

declare sub      Fl_Text_BufferSetHighlight(tb as Fl_Text_Buffer ptr, start as integer, end as integer)
declare function Fl_Text_BufferGetHighlight(tb as Fl_Text_Buffer ptr) as integer

declare function Fl_Text_BufferHighlightPosition(tb as Fl_Text_Buffer ptr, start as integer ptr, end as integer ptr) as integer
declare function Fl_Text_BufferHighlightSelection(tb as Fl_Text_Buffer ptr) as const Fl_Text_Selection ptr
declare function Fl_Text_BufferHighlightText(tb as Fl_Text_Buffer ptr) as zstring ptr
declare sub      Fl_Text_BufferInsert(tb as Fl_Text_Buffer ptr, p as integer, text as const zstring ptr)
declare function Fl_Text_BufferInsertFile(tb as Fl_Text_Buffer ptr, file as const zstring ptr, p as integer, buflen as integer = 128*1024) as integer
declare function Fl_Text_BufferLength(tb as Fl_Text_Buffer ptr) as integer
declare function Fl_Text_BufferLineEnd(tb as Fl_Text_Buffer ptr, p as integer) as integer
declare function Fl_Text_BufferLineStart(tb as Fl_Text_Buffer ptr, p as integer) as integer
declare function Fl_Text_BufferLineText(tb as Fl_Text_Buffer ptr, p as integer) as zstring ptr
declare function Fl_Text_BufferLoadFile(tb as Fl_Text_Buffer ptr, file as const zstring ptr, buflen as integer = 128*1024) as integer
declare function Fl_Text_BufferNextChar(tb as Fl_Text_Buffer ptr, ix as integer) as integer
declare function Fl_Text_BufferNextCharClipped(tb as Fl_Text_Buffer ptr, ix as integer) as integer
declare function Fl_Text_BufferOutputFile(tb as Fl_Text_Buffer ptr, file as const zstring ptr, start as integer, end as integer, buflen as integer = 128*1024) as integer
declare function Fl_Text_BufferPrevChar(tb as Fl_Text_Buffer ptr, ix as integer) as integer
declare function Fl_Text_BufferPrevCharClipped(tb as Fl_Text_Buffer ptr, ix as integer) as integer
declare function Fl_Text_BufferPrimarySelection(tb as Fl_Text_Buffer ptr) as Fl_Text_Selection ptr
declare function Fl_Text_BufferPrimarySelection2(tb as Fl_Text_Buffer ptr) as const Fl_Text_Selection ptr
declare sub      Fl_Text_BufferRemove(tb as Fl_Text_Buffer ptr, start as integer, end as integer)
declare sub      Fl_Text_BufferRemoveModifyCallback(tb as Fl_Text_Buffer ptr, cb as Fl_Text_Modify_Cb, cbArg as any ptr)
declare sub      Fl_Text_BufferRemovePredeleteCallback(tb as Fl_Text_Buffer ptr, cb as Fl_Text_Predelete_Cb, cbArg as any ptr)
declare sub      Fl_Text_BufferRemoveSecondarySelection(tb as Fl_Text_Buffer ptr)
declare sub      Fl_Text_BufferRemoveSelection(tb as Fl_Text_Buffer ptr)
declare sub      Fl_Text_BufferReplace(tb as Fl_Text_Buffer ptr, start as integer, end as integer, text as const zstring ptr)
declare sub      Fl_Text_BufferReplaceSecondarySelection(tb as Fl_Text_Buffer ptr, text as const zstring ptr)
declare sub      Fl_Text_BufferReplaceSelection(tb as Fl_Text_Buffer ptr, text as const zstring ptr)
declare function Fl_Text_BufferRewindLines(tb as Fl_Text_Buffer ptr, startPos as integer, nLines as integer) as integer
declare function Fl_Text_BufferSaveFile(tb as Fl_Text_Buffer ptr, file as const zstring ptr, buflen as integer = 128*1024) as integer
declare function Fl_Text_BufferSearchBackward(tb as Fl_Text_Buffer ptr, startPos as integer, searchString as const zstring ptr, foundPos as integer ptr, matchCase as integer=0) as integer
declare function Fl_Text_BufferSearchForward(tb as Fl_Text_Buffer ptr, startPos as integer, searchString as const zstring ptr, foundPos as integer ptr, matchCase as integer=0) as integer
declare sub      Fl_Text_BufferSecondarySelect(tb as Fl_Text_Buffer ptr, start as integer, end as integer)
declare function Fl_Text_BufferSecondarySelected(tb as Fl_Text_Buffer ptr) as integer
declare function Fl_Text_BufferSecondarySelection(tb as Fl_Text_Buffer ptr) as const Fl_Text_Selection ptr
declare function Fl_Text_BufferSecondarySelectionPosition(tb as Fl_Text_Buffer ptr, start as integer ptr, end as integer ptr) as integer
declare function Fl_Text_BufferSecondarySelectionText(tb as Fl_Text_Buffer ptr) as zstring ptr
declare sub      Fl_Text_BufferSecondaryUnselect(tb as Fl_Text_Buffer ptr)
declare sub      Fl_Text_BufferSelect(tb as Fl_Text_Buffer ptr, start as integer, end as integer)
declare function Fl_Text_BufferSelected(tb as Fl_Text_Buffer ptr) as integer
declare function Fl_Text_BufferSelectionPosition(tb as Fl_Text_Buffer ptr, start as integer ptr, end as integer ptr) as integer
declare function Fl_Text_BufferSelection_text(tb as Fl_Text_Buffer ptr) as zstring ptr
declare function Fl_Text_BufferSkipDisplayedCharacters(tb as Fl_Text_Buffer ptr, lineStartPos as integer, nChars as integer) as integer
declare function Fl_Text_BufferSkipLines(tb as Fl_Text_Buffer ptr, startPos as integer, nLines as integer) as integer

declare sub      Fl_Text_BufferSetTabDistance(tb as Fl_Text_Buffer ptr, tabDist as integer)
declare function Fl_Text_BufferGetTabDistance(tb as Fl_Text_Buffer ptr) as integer

declare sub      Fl_Text_BufferSetText(tb as Fl_Text_Buffer ptr, text as const zstring ptr)
declare function Fl_Text_BufferGetText(tb as Fl_Text_Buffer ptr) as zstring ptr

declare function Fl_Text_BufferTextRange(tb as Fl_Text_Buffer ptr, start as integer, end as integer) as zstring ptr
declare function Fl_Text_BufferUndo(tb as Fl_Text_Buffer ptr, cp as integer ptr=0) as integer
declare sub      Fl_Text_BufferUnhighlight(tb as Fl_Text_Buffer ptr)
declare sub      Fl_Text_BufferUnselect(tb as Fl_Text_Buffer ptr)
declare function Fl_Text_BufferUtf8Align(tb as Fl_Text_Buffer ptr, a as integer) as integer
declare function Fl_Text_BufferWordEnd(tb as Fl_Text_Buffer ptr, p as integer) as integer
declare function Fl_Text_BufferWordStart(tb as Fl_Text_Buffer ptr, p as integer) as integer

'##########################################
'# class Fl_Text_Display extends Fl_Group #
'##########################################
DeclareEx(Fl_Text_Display)
declare function Fl_Text_DisplayNew(x as integer,y as integer,w as integer,h as integer, label as const zstring ptr=0) as Fl_Text_Display ptr

declare sub      Fl_Text_DisplaySetBuffer(td as Fl_Text_Display ptr, buf as Fl_Text_Buffer ptr)
declare function Fl_Text_DisplayGetBuffer(td as Fl_Text_Display ptr) as Fl_Text_Buffer ptr

declare function Fl_Text_DisplayColToX(td as Fl_Text_Display ptr, col as double) as double
declare function Fl_Text_DisplayCountLines(td as Fl_Text_Display ptr, start as integer, end as integer, start_pos_is_line_start as byte) as integer

declare sub      Fl_Text_DisplaySetCursorColor(td as Fl_Text_Display ptr, c as Fl_Color)
declare function Fl_Text_DisplayGetCursorColor(td as Fl_Text_Display ptr) as Fl_Color

declare sub      Fl_Text_DisplayCursorStyle(td as Fl_Text_Display ptr, style as integer)
declare function Fl_Text_DisplayHandle(td as Fl_Text_Display ptr, event as Fl_Event) as integer
declare sub      Fl_Text_DisplayHideCursor(td as Fl_Text_Display ptr)
declare sub      Fl_Text_DisplayHighlightData(td as Fl_Text_Display ptr, stylebuf as Fl_Text_Buffer ptr, styletable as Style_Table_Entry ptr, nStyles as integer, unfinishedStyle as byte, cb as Unfinished_Style_Cb, cbArg as any ptr)
declare function Fl_Text_DisplayInSelection(td as Fl_Text_Display ptr, x as integer, y as integer) as integer
declare sub      Fl_Text_DisplayInsert(td as Fl_Text_Display ptr, text as const zstring ptr)

declare sub      Fl_Text_DisplaySetInsertPosition(td as Fl_Text_Display ptr, newPos as integer)
declare function Fl_Text_DisplayGetInsertPosition(td as Fl_Text_Display ptr) as integer

declare function Fl_Text_DisplayLineEnd(td as Fl_Text_Display ptr, startPos as integer, startPosIsLineStart as byte) as integer
declare function Fl_Text_DisplayLineStart(td as Fl_Text_Display ptr, pos as integer) as integer
declare function Fl_Text_DisplayMoveDown(td as Fl_Text_Display ptr) as integer
declare function Fl_Text_DisplayMoveLeft(td as Fl_Text_Display ptr) as integer
declare function Fl_Text_DisplayMoveRight(td as Fl_Text_Display ptr) as integer
declare function Fl_Text_DisplayMoveUp(td as Fl_Text_Display ptr) as integer
declare sub      Fl_Text_DisplayNextWord(td as Fl_Text_Display ptr)
declare sub      Fl_Text_DisplayOverStrike(td as Fl_Text_Display ptr, text as const zstring ptr)
declare function Fl_Text_DisplayPositionStyle(td as Fl_Text_Display ptr, lineStartPos as integer, lineLen as integer, lineIndex as integer) as integer
declare function Fl_Text_DisplayPositionToXY(td as Fl_Text_Display ptr, pos as integer, x as integer ptr, y as integer ptr) as integer
declare sub      Fl_Text_DisplayPreviousWord(td as Fl_Text_Display ptr)
declare sub      Fl_Text_DisplayRedisplayRange(td as Fl_Text_Display ptr, start as integer, end as integer)
declare sub      Fl_Text_DisplayResize(td as Fl_Text_Display ptr, x as integer, y as integer, w as integer, h as integer)
declare function Fl_Text_DisplayRewindLines(td as Fl_Text_Display ptr, startPos as integer, nLines as integer) as integer
declare sub      Fl_Text_DisplayScroll(td as Fl_Text_Display ptr, topLineNum as integer, horizOffset as integer)

declare sub      Fl_Text_DisplaySetScrollbarAlign(td as Fl_Text_Display ptr, a as Fl_Align)
declare function Fl_Text_DisplayGetScrollbarAlign(td as Fl_Text_Display ptr) as Fl_Align

declare sub      Fl_Text_DisplaySetScrollbarWidth(td as Fl_Text_Display ptr, w as integer)
declare function Fl_Text_DisplayGetScrollbarWidth(td as Fl_Text_Display ptr) as integer

declare sub      Fl_Text_DisplaySetShortcut(td as Fl_Text_Display ptr, s as integer)
declare function Fl_Text_DisplayGetShortcut(td as Fl_Text_Display ptr) as integer

declare sub      Fl_Text_DisplayShowCursor(td as Fl_Text_Display ptr, b as integer=1)
declare sub      Fl_Text_DisplayShowInsertPosition(td as Fl_Text_Display ptr)
declare function Fl_Text_DisplaySkipLines(td as Fl_Text_Display ptr, startPos as integer, nLines as integer, startPosIsLineStart as byte) as integer

declare sub      Fl_Text_DisplaySetTextColor(td as Fl_Text_Display ptr, c as Fl_Color)
declare function Fl_Text_DisplayGetTextColor(td as Fl_Text_Display ptr) as Fl_Color

declare sub      Fl_Text_DisplaySetTextFont(td as Fl_Text_Display ptr, f as Fl_Font)
declare function Fl_Text_DisplayGetTextFont(td as Fl_Text_Display ptr) as Fl_Font

declare sub      Fl_Text_DisplaySetTextSize(td as Fl_Text_Display ptr, s as Fl_Fontsize)
declare function Fl_Text_DisplayGetTextSize(td as Fl_Text_Display ptr) as Fl_Fontsize

declare function Fl_Text_DisplayWordEnd(td as Fl_Text_Display ptr, pos as integer) as integer
declare function Fl_Text_DisplayWordStart(td as Fl_Text_Display ptr, pos as integer) as integer
declare sub      Fl_Text_DisplayWrapMode(td as Fl_Text_Display ptr, wrap as integer, wrap_margin as integer)
declare function Fl_Text_DisplayWrappedColumn(td as Fl_Text_Display ptr, row as integer, column as integer) as integer
declare function Fl_Text_DisplayWrappedRow(td as Fl_Text_Display ptr, row as integer) as integer
declare function Fl_Text_DisplayXToCol(td as Fl_Text_Display ptr, x as double) as double

'################################################
'# class Fl_Text_Editor extends Fl_Text_Display #
'################################################
declare function Fl_Text_EditorNew(x as integer,y as integer,w as integer,h as integer, label as const zstring ptr=0) as Fl_Text_Editor ptr
declare sub      Fl_Text_EditorAddDefaultKeyBindings(te as Fl_Text_Editor ptr, list as Key_Binding ptr ptr)
declare sub      Fl_Text_EditorAddKeyBinding(te as Fl_Text_Editor ptr, key as integer, state as integer, f as Key_Func)
declare sub      Fl_Text_EditorAddKeyBinding2(te as Fl_Text_Editor ptr, key as integer, state as integer, f as Key_Func, list as Key_Binding ptr ptr)
declare function Fl_Text_EditorBoundKeyFunction(te as Fl_Text_Editor ptr, key as integer, state as integer) as Key_Func
declare function Fl_Text_EditorBoundKeyFunction2(te as Fl_Text_Editor ptr, key as integer, state as integer, list as Key_Binding ptr) as Key_Func
declare sub      Fl_Text_EditorDefaultKeyFunction(te as Fl_Text_Editor ptr, f as Key_Func)
declare function Fl_Text_EditorHandle(te as Fl_Text_Editor ptr, e as Fl_Event) as integer
declare sub      Fl_Text_EditorSetInsertMode(te as Fl_Text_Editor ptr, m as integer)
declare function Fl_Text_EditorGetInsertMode(te as Fl_Text_Editor ptr) as integer
declare sub      Fl_Text_EditorRemoveAllKeyBindings(te as Fl_Text_Editor ptr)
declare sub      Fl_Text_EditorRemoveAllKeyBindings2(te as Fl_Text_Editor ptr, list as Key_Binding ptr ptr)
declare sub      Fl_Text_EditorRemoveKeyBinding(te as Fl_Text_Editor ptr, key as integer, state as integer)
declare sub      Fl_Text_EditorRemoveKeyBinding2(te as Fl_Text_Editor ptr, key as integer, state as integer, list as Key_Binding ptr ptr)

'#########################################
'# class Fl_Tree_Item is used by Fl_Tree #
'#########################################
declare sub      Fl_Tree_ItemSetLabel(item as Fl_Tree_Item ptr, newlabel as const zstring ptr)
declare function Fl_Tree_ItemGetLabel(item as Fl_Tree_Item ptr) as const zstring ptr
declare sub      Fl_Tree_ItemSetWidget(item as Fl_Tree_Item ptr, wgt as Fl_Widget ptr)
declare function Fl_Tree_ItemGetWidget(item as Fl_Tree_Item ptr) as const Fl_widget ptr

'##################################
'# class Fl_Tree extends Fl_Group #
'##################################
DeclareEx(Fl_Tree)
declare function Fl_TreeNew(x as integer, y as integer, w as integer, h as integer, label as const zstring ptr=0) as Fl_Tree ptr
declare function Fl_TreeAdd(tr as Fl_Tree ptr, path as const zstring ptr) as Fl_Tree_Item ptr
declare function Fl_TreeAddItem(tr as Fl_Tree ptr, item as Fl_Tree_Item ptr, name as const zstring ptr) as Fl_Tree_Item ptr

declare sub      Fl_TreeSetCallbackItem(tr as Fl_Tree ptr, item as Fl_Tree_Item ptr)
declare function Fl_TreeGetCallbackItem(tr as Fl_Tree ptr) as Fl_Tree_Item ptr

declare sub      Fl_TreeSetCallbackReason(tr as Fl_Tree ptr, reason as Fl_Tree_Reason)
declare function Fl_TreeGetCallbackReason(tr as Fl_Tree ptr) as Fl_Tree_Reason

declare sub      Fl_TreeClear(tr as Fl_Tree ptr)
declare sub      Fl_TreeClearChildren(tr as Fl_Tree ptr, item as Fl_Tree_Item ptr)
declare function Fl_TreeClose(tr as Fl_Tree ptr, path as const zstring ptr, docallback as integer=1) as integer
declare function Fl_TreeCloseItem(tr as Fl_Tree ptr, item as Fl_Tree_Item ptr, docallback as integer=1) as integer
' Treeview icons
declare sub      Fl_TreeSetCloseIcon(tr as Fl_Tree ptr, img as Fl_Image ptr)
declare function Fl_TreeGetCloseIcon(tr as Fl_Tree ptr) as Fl_Image ptr

declare sub      Fl_TreeSetOpenIcon(tr as Fl_Tree ptr, img as Fl_Image ptr)
declare function Fl_TreeGetOpenIcon(tr as Fl_Tree ptr) as Fl_Image ptr

declare sub      Fl_TreeSetUserIcon(tr as Fl_Tree ptr, img as Fl_Image ptr)
declare function Fl_TreeGetUserIcon(tr as Fl_Tree ptr) as Fl_Image ptr

declare sub      Fl_TreeSetUserIconMarginLeft(tr as Fl_Tree ptr, m as integer)
declare function Fl_TreeGetUserIconMarginLeft(tr as Fl_Tree ptr) as integer

declare sub      Fl_TreeSetConnectorColor(tr as Fl_Tree ptr, c as Fl_Color)
declare function Fl_TreeGetConnectorColor(tr as Fl_Tree ptr) as Fl_Color

declare sub      Fl_TreeSetConnectorStyle(tr as Fl_Tree ptr, s as Fl_Tree_Connector)
declare function Fl_TreeGetConnectorStyle(tr as Fl_Tree ptr) as Fl_Tree_Connector

declare sub      Fl_TreeSetConnectorWidth(tr as Fl_Tree ptr, w as integer)
declare function Fl_TreeGetConnectorWidth(tr as Fl_Tree ptr) as integer

declare function Fl_TreeDeselect(tr as Fl_Tree ptr, path as const zstring ptr, docallback as integer=1) as integer
declare function Fl_TreeDeselectItem(tr as Fl_Tree ptr, item as Fl_Tree_Item ptr, docallback as integer=1) as integer
declare function Fl_TreeDeselectAll(tr as Fl_Tree ptr, item as Fl_Tree_Item ptr=0, docallback as integer=1) as integer
declare sub      Fl_TreeDisplay(tr as Fl_Tree ptr, item as Fl_Tree_Item ptr)
declare function Fl_TreeDisplayed(tr as Fl_Tree ptr, item as Fl_Tree_Item ptr) as integer
declare function Fl_TreeFindClicked(tr as Fl_Tree ptr) as const Fl_Tree_Item ptr
declare function Fl_TreeFindItem(tr as Fl_Tree ptr, path as const zstring ptr) as Fl_Tree_Item ptr
declare function Fl_TreeFindItem2(tr as Fl_Tree ptr, path as const zstring ptr) as const Fl_Tree_Item ptr
declare function Fl_TreeFirst(tr as Fl_Tree ptr) as Fl_Tree_Item ptr
declare function Fl_TreeFirstSelectedItem(tr as Fl_Tree ptr) as Fl_Tree_Item ptr
declare function Fl_TreeFirstVisible(tr as Fl_Tree ptr) as Fl_Tree_Item ptr
declare function Fl_TreeGetItemFocus(tr as Fl_Tree ptr) as Fl_Tree_Item ptr
declare function Fl_TreeHandle(tr as Fl_Tree ptr, e as Fl_Event) as integer
declare function Fl_TreeInsert(tr as Fl_Tree ptr, item as Fl_Tree_Item ptr, name as const zstring ptr, pos as integer) as Fl_Tree_Item ptr
declare function Fl_TreeInsertAbove(tr as Fl_Tree ptr, above as Fl_Tree_Item ptr, name as const zstring ptr) as Fl_Tree_Item ptr
declare function Fl_TreeIsClose(tr as Fl_Tree ptr, path as const zstring ptr) as integer
declare function Fl_TreeIsCloseItem(tr as Fl_Tree ptr, item as Fl_Tree_Item ptr) as integer
declare function Fl_TreeIsOpen(tr as Fl_Tree ptr, path as const zstring ptr) as integer
declare function Fl_TreeIsOpenItem(tr as Fl_Tree ptr, item as Fl_Tree_Item ptr) as integer
declare function Fl_TreeIsScrollbar(tr as Fl_Tree ptr, wgt as Fl_Widget ptr) as integer
declare function Fl_TreeIsSelected(tr as Fl_Tree ptr, path as const zstring ptr) as integer
declare function Fl_TreeIsSelectedItem(tr as Fl_Tree ptr, item as Fl_Tree_Item ptr) as integer
declare function Fl_TreeIsVScrollVisible(tr as Fl_Tree ptr) as integer
declare function Fl_TreeItemClicked(tr as Fl_Tree ptr) as Fl_Tree_Item ptr

declare sub      Fl_TreeSetItemLabelBGColor(tr as Fl_Tree ptr, c as Fl_Color)
declare function Fl_TreeGetItemLabelBGClor(tr as Fl_Tree ptr) as Fl_Color

declare sub      Fl_TreeSetItemLabelFGColor(tr as Fl_Tree ptr, c as Fl_Color)
declare function Fl_TreeGetItemLabelFGColor(tr as Fl_Tree ptr) as Fl_Color

declare sub      Fl_TreeSetItemLabelFont(tr as Fl_Tree ptr, f as Fl_Font)
declare function Fl_TreeGetItemLabelFont(tr as Fl_Tree ptr) as Fl_Font

declare sub      Fl_TreeSetItemLabelSize(tr as Fl_Tree ptr, s as Fl_Fontsize)
declare function Fl_TreeGetItemLabelSize(tr as Fl_Tree ptr) as Fl_Fontsize

declare function Fl_TreeItemPathName(tr as Fl_Tree ptr, pathname as zstring ptr, pathnamelen as integer, item as const Fl_Tree_Item ptr) as integer

declare sub      Fl_TreeSetLabelMarginLeft(tr as Fl_Tree ptr, m as integer)
declare function Fl_TreeGetLabelMarginLeft(tr as Fl_Tree ptr) as integer

declare function Fl_TreeLast(tr as Fl_Tree ptr) as Fl_Tree_Item ptr
declare function Fl_TreeLastVisible(tr as Fl_Tree ptr) as Fl_Tree_Item ptr

declare sub      Fl_TreeSetLineSpacing(tr as Fl_Tree ptr, ls as integer)
declare function Fl_TreeGetLineSpacing(tr as Fl_Tree ptr) as integer

declare sub      Fl_TreeSetMarginLeft(tr as Fl_Tree ptr, m as integer)
declare function Fl_TreeGetMarginLeft(tr as Fl_Tree ptr) as integer

declare sub      Fl_TreeSetMarginTop(tr as Fl_Tree ptr, m as integer)
declare function Fl_TreeGetMarginTop(tr as Fl_Tree ptr) as integer

declare function Fl_TreeNext(tr as Fl_Tree ptr, item as Fl_Tree_Item ptr=0) as Fl_Tree_Item ptr
declare function Fl_TreeNextSelectedItem(tr as Fl_Tree ptr, item as Fl_Tree_Item ptr=0) as Fl_Tree_Item ptr
declare function Fl_TreeOpen(tr as Fl_Tree ptr, path as const zstring ptr, docallback as integer=1) as integer
declare function Fl_TreeOpenItem(tr as Fl_Tree ptr, item as Fl_Tree_Item ptr, docallback as integer=1) as integer
declare sub      Fl_TreeOpenToggle(tr as Fl_Tree ptr, item as Fl_Tree_Item ptr, docallback as integer=1)

declare sub      Fl_TreeSetOpenchildMarginBottom(tr as Fl_Tree ptr, m as integer)
declare function Fl_TreeGetOpenchildMarginBottom(tr as Fl_Tree ptr) as integer

declare function Fl_TreePrev(tr as Fl_Tree ptr, item as Fl_Tree_Item ptr=0) as Fl_Tree_Item ptr
declare function Fl_TreeRemove(tr as Fl_Tree ptr, item as Fl_Tree_Item ptr) as integer
declare function Fl_TreeRoot(tr as Fl_Tree ptr) as Fl_Tree_Item ptr
declare sub      Fl_TreeRootLabel(tr as Fl_Tree ptr, newlabel as const zstring ptr)

declare sub      Fl_TreeSetScrollbarSize(tr as Fl_Tree ptr, s as integer)
declare function Fl_TreeGetScrollbarSize(tr as Fl_Tree ptr) as integer

declare function Fl_TreeSelect(tr as Fl_Tree ptr, path as const zstring ptr, docallback as integer=1) as integer
declare function Fl_TreeSelectItem(tr as Fl_Tree ptr, item as Fl_Tree_Item ptr, docallback as integer=1) as integer
declare function Fl_TreeSelectAll(tr as Fl_Tree ptr, item as Fl_Tree_Item ptr=0, docallback as integer=1) as integer
declare function Fl_TreeSelectOnly(tr as Fl_Tree ptr, selitem as Fl_Tree_Item ptr, docallback as integer=1) as integer
declare sub      Fl_TreeSelectToggle(tr as Fl_Tree ptr, item as Fl_Tree_Item ptr, docallback as integer=1)

declare sub      Fl_TreeSetSelectBox(tr as Fl_Tree ptr, bt as Fl_Boxtype)
declare function Fl_TreeGetSelectBox(tr as Fl_Tree ptr) as Fl_Boxtype

declare sub      Fl_TreeSetSelectMode(tr as Fl_Tree ptr, m as Fl_Tree_Select)
declare function Fl_TreeGetSelectMode(tr as Fl_Tree ptr) as Fl_Tree_Select

declare sub      Fl_TreeSetItemFocus(tr as Fl_Tree ptr, item as Fl_Tree_Item ptr)
declare sub      Fl_TreeShowItem(tr as Fl_Tree ptr, item as Fl_Tree_Item ptr)
declare sub      Fl_TreeShowItem2(tr as Fl_Tree ptr, item as Fl_Tree_Item ptr, yoff as integer)
declare sub      Fl_TreeShowItemBottom(tr as Fl_Tree ptr, item as Fl_Tree_Item ptr)
declare sub      Fl_TreeShowItemMiddle(tr as Fl_Tree ptr, item as Fl_Tree_Item ptr)
declare sub      Fl_TreeShowItemTop (tr as Fl_Tree ptr, item as Fl_Tree_Item ptr)
declare sub      Fl_TreeShowSelf(tr as Fl_Tree ptr)

declare sub      Fl_TreeSetShowCollapse(tr as Fl_Tree ptr, c as integer)
declare function Fl_TreeGetShowCollapse(tr as Fl_Tree ptr) as integer

declare sub      Fl_TreeSetShowRoot(tr as Fl_Tree ptr, bln as integer)
declare function Fl_TreeGetShowRoot(tr as Fl_Tree ptr) as integer

declare sub      Fl_TreeSetSortOrder(tr as Fl_Tree ptr, s as Fl_Tree_Sort)
declare function Fl_TreeGetSortorder(tr as Fl_Tree ptr) as Fl_Tree_Sort

declare sub      Fl_TreeSetVPosition(tr as Fl_Tree ptr, p as integer)
declare function Fl_TreeGetVPosition(tr as Fl_Tree ptr) as integer

'####################################
'# class Fl_Wizard extends Fl_Group #
'####################################
declare function Fl_WizardNew(x as integer,y as integer,w as integer,h as integer,label as const zstring ptr=0) as Fl_Wizard ptr
declare sub      Fl_WizardNext(wi as Fl_Wizard ptr)
declare sub      Fl_WizardPrev(wi as Fl_Wizard ptr)
declare sub      Fl_WizardSetValue(wi as Fl_Wizard ptr, wgt as Fl_Widget ptr)
declare function Fl_WizardGetValue(wi as Fl_Wizard ptr) as Fl_Widget ptr

'####################################
'# class Fl_Window extends Fl_Group #
'####################################
DeclareWindow(Fl_Window)
declare function Fl_WindowNew(w as integer,h as integer,title as const zstring ptr=0) as Fl_Window ptr
declare function Fl_WindowNew2(x as integer,y as integer,w as integer,h as integer,title as const zstring ptr=0) as Fl_Window ptr
declare sub      Fl_WindowBegin(w as Fl_Window ptr)
declare sub      Fl_WindowEnd(w as Fl_Window ptr)

declare sub      Fl_WindowSetBorder(win as Fl_Window ptr, b as integer)
declare function Fl_WindowGetBorder(win as Fl_Window ptr) as integer

declare sub      Fl_WindowClearBorder(win as Fl_Window ptr)

declare sub      Fl_WindowCopyLabel(win as Fl_Window ptr, label as const zstring ptr)

declare function Fl_WindowCurrent(win as Fl_Window ptr) as Fl_Window ptr

declare sub      Fl_WindowCursor(win as Fl_Window ptr,c as Fl_Cursor, fg as Fl_Color = Fl_BLACK, bg as Fl_Color = Fl_WHITE)

declare function Fl_WindowDecorated_h(win as Fl_Window ptr) as integer
declare function Fl_WindowDecorated_w(win as Fl_Window ptr) as integer

declare sub      Fl_WindowFreePosition(win as Fl_Window ptr)

declare sub      Fl_WindowFullscreen(win as Fl_Window ptr)
declare function Fl_WindowFullscreenActive(win as Fl_Window ptr) as integer
declare sub      Fl_WindowFullscreenOff(win as Fl_Window ptr)
declare sub      Fl_WindowFullscreenOffResize(win as Fl_Window ptr,x as integer,y as integer,w as integer,h as integer)

declare function Fl_WindowHandle(win as Fl_Window ptr, event as Fl_Event) as integer

declare sub      Fl_WindowHide(win as Fl_Window ptr)

declare sub      Fl_WindowHotspot(win as Fl_Window ptr,x as integer,y as integer,offscreen as integer=0)
declare sub      Fl_WindowHotspotWidget(win as Fl_Window ptr,wgt as const Fl_Widget,offscreen as integer=0)

declare sub      Fl_WindowSetIcon(win as Fl_Window ptr,ic as const any ptr)
declare function Fl_WindowGetIcon(win as Fl_Window ptr) as const any ptr

declare sub      Fl_WindowIconize(win as Fl_Window ptr)

declare sub      Fl_WindowSetIconLabel(win as Fl_Window ptr,il as const zstring ptr)
declare function Fl_WindowGetIconLabel(win as Fl_Window ptr) as const zstring ptr

declare sub      Fl_WindowSetLabel(win as Fl_Window ptr,wl as const zstring ptr)
declare function Fl_WindowGetLabel(win as Fl_Window ptr) as const zstring ptr

declare sub      Fl_WindowSetLabels(win as Fl_Window ptr,wl as const zstring ptr,il as const zstring ptr)

declare sub      Fl_WindowMakeCurrent(win as Fl_Window ptr)

declare sub      Fl_WindowSetMenuWindow(win as Fl_Window ptr)
declare function Fl_WindowGetMenuWindow(win as Fl_Window ptr) as integer

declare sub      Fl_WindowSetModal(win as Fl_Window ptr)
declare function Fl_WindowGetModal(win as Fl_Window ptr) as integer

declare sub      Fl_WindowSetNonModal(win as Fl_Window ptr)
declare function Fl_WindowGetNonModal(win as Fl_Window ptr) as integer

declare sub      Fl_WindowSetOverride(win as Fl_Window ptr)
declare function Fl_WindowGetOverride(win as Fl_Window ptr) as integer

declare sub      Fl_WindowResize(win as Fl_Window ptr,x as integer,y as integer,w as integer,h as integer)

declare sub      Fl_WindowShow(win as Fl_Window ptr)
declare sub      Fl_WindowShowArgs(win as Fl_Window ptr,argc as integer,argv as zstring ptr ptr)

declare function Fl_WindowShown(win as Fl_Window ptr) as integer

declare sub      Fl_WindowSizeRange(win as Fl_Window ptr, minw as integer, minh as integer, maxw as integer=0, maxh as integer=0, dw as integer=0, dh as integer=0, aspect as integer=0)

declare sub      Fl_WindowSetTooltipWindow(win as Fl_Window ptr)
declare function Fl_WindowGetTooltipWindow(win as Fl_Window ptr) as integer

declare sub      Fl_WindowSetXClass(win as Fl_Window ptr,xclass as const zstring ptr)
declare function Fl_WindowGetXClass(win as Fl_Window ptr) as const zstring ptr

declare function Fl_WindowXRoot(win as Fl_Window ptr) as integer
declare function Fl_WindowYRoot(win as Fl_Window ptr) as integer

'############################################
'# class Fl_Single_Window extends Fl_Window #
'############################################
DeclareWindow(Fl_Single_Window)
declare function Fl_Single_WindowNew(w as integer,h as integer,title as const zstring ptr=0) as Fl_Single_Window ptr
declare function Fl_Single_WindowNew2(x as integer,y as integer,w as integer,h as integer,title as const zstring ptr=0) as Fl_Single_Window ptr
declare sub      Fl_Single_WindowFlush(sngwin as Fl_Single_Window ptr)
declare sub      Fl_Single_WindowShow(sngwin as Fl_Single_Window ptr)
declare sub      Fl_Single_WindowShowArgs(sngwin as Fl_Single_Window ptr, argc as zstring ptr, argv as zstring ptr ptr)

'#################################################
'# class Fl_Menu_Window extends Fl_Single_Window #
'#################################################
DeclareWindow(Fl_Menu_Window)
declare function Fl_Menu_WindowNew(w as integer,h as integer,title as const zstring ptr=0) as Fl_Menu_Window ptr
declare function Fl_Menu_WindowNew2(x as integer,y as integer,w as integer,h as integer,title as const zstring ptr=0) as Fl_Menu_Window ptr
declare sub      Fl_Menu_WindowClearOverlay(mwin as Fl_Menu_Window ptr)
declare sub      Fl_Menu_WindowErase(mwin as Fl_Menu_Window ptr)
declare sub      Fl_Menu_WindowFlush(mwin as Fl_Menu_Window ptr)
declare sub      Fl_Menu_WindowHide(mwin as Fl_Menu_Window ptr)
declare function Fl_Menu_WindowOverlay(mwin as Fl_Menu_Window ptr) as uinteger
declare sub      Fl_Menu_WindowSetOverlay(mwin as Fl_Menu_Window ptr)
declare sub      Fl_Menu_WindowShow(mwin as Fl_Menu_Window ptr)

'############################################
'# class Fl_Double_Window extends Fl_Window #
'############################################
DeclareWindow(Fl_Double_Window)
declare function Fl_Double_WindowNew(w as integer,h as integer,title as const zstring ptr=0) as Fl_Double_Window ptr
declare function Fl_Double_WindowNew2(x as integer,y as integer,w as integer,h as integer,title as const zstring ptr=0) as Fl_Double_Window ptr
declare sub      Fl_Double_WindowFlush(dblwin as Fl_Double_Window ptr)
declare sub      Fl_Double_WindowHide(dblwin as Fl_Double_Window ptr)
declare sub      Fl_Double_WindowResize(dblwin as Fl_Double_Window ptr, x as integer,y as integer,w as integer,h as integer)
declare sub      Fl_Double_WindowShow(dblwin as Fl_Double_Window ptr)
declare sub      Fl_Double_WindowShowArgs(dblwin as Fl_Double_Window ptr, argc as zstring ptr, argv as zstring ptr ptr)

'########################################
'# class Fl_Gl_Window extends Fl_Window #
'########################################
DeclareWindow(Fl_Gl_Window)
declare function Fl_Gl_WindowNew(w as integer, h as integer, title as const zstring ptr=0) as Fl_Gl_Window ptr
declare function Fl_Gl_WindowNew2(x as integer, y as integer, w as integer, h as integer, title as const zstring ptr=0) as Fl_Gl_Window ptr
declare function Fl_Gl_WindowCanDo(glwin as Fl_Gl_Window ptr) as integer
declare function Fl_Gl_WindowCanDoOverlay(glwin as Fl_Gl_Window ptr) as integer
declare sub      Fl_Gl_WindowSetContext(glwin as Fl_Gl_Window ptr, ctx as any ptr, destroy_flag as integer=0)
declare function Fl_Gl_WindowGetContext(glwin as Fl_Gl_Window ptr) as any ptr
declare sub      Fl_Gl_WindowSetContextValid(glwin as Fl_Gl_Window ptr, v as integer)
declare function Fl_Gl_WindowGetContextValid(glwin as Fl_Gl_Window ptr) as integer
declare sub      Fl_Gl_WindowFlush(glwin as Fl_Gl_Window ptr)
declare function Fl_Gl_WindowHandle(glwin as Fl_Gl_Window ptr, ev as Fl_Event) as integer
declare sub      Fl_Gl_WindowHide(glwin as Fl_Gl_Window ptr)
declare sub      Fl_Gl_WindowHideOverlay(glwin as Fl_Gl_Window ptr)
declare sub      Fl_Gl_WindowInvalidate(glwin as Fl_Gl_Window ptr)
declare sub      Fl_Gl_WindowMakeCurrent(glwin as Fl_Gl_Window ptr)
declare sub      Fl_Gl_WindowMakeOverlayCurrent(glwin as Fl_Gl_Window ptr)
declare sub      Fl_Gl_WindowSetMode(glwin as Fl_Gl_Window ptr, m as Fl_Mode)
declare function Fl_Gl_WindowGetMode(glwin as Fl_Gl_Window ptr) as Fl_Mode
declare sub      Fl_Gl_WindowOrtho(glwin as Fl_Gl_Window ptr)
declare sub      Fl_Gl_WindowRedrawOverlay(glwin as Fl_Gl_Window ptr)
declare sub      Fl_Gl_WindowResize(glwin as Fl_Gl_Window ptr, x as integer, y as integer, w as integer, h as integer)
declare sub      Fl_Gl_WindowShowArgs(glwin as Fl_Gl_Window ptr, argc as integer, argv as zstring ptr ptr)
declare sub      Fl_Gl_WindowShow(glwin as Fl_Gl_Window ptr)
declare sub      Fl_Gl_WindowSwapBuffers(glwin as Fl_Gl_Window ptr)
declare sub      Fl_Gl_WindowSetValid(glwin as Fl_Gl_Window ptr, v as integer)
declare function Fl_Gl_WindowGetValid(glwin as Fl_Gl_Window ptr) as integer

' ############################################
' # class Fl_Printer extends Fl_Paged_Device #
' ############################################
declare function Fl_PrinterNew() as Fl_Printer ptr
declare sub      Fl_PrinterDelete(byref p as Fl_Printer ptr)

declare function Fl_PrinterGetClassName(p as Fl_Printer ptr) as const zstring ptr
declare function Fl_PrinterGetDriver(p as Fl_Printer ptr) as Fl_Graphics_Driver ptr

declare sub      Fl_PrinterSetCurrent(p as Fl_Printer ptr)

declare function Fl_PrinterStartJob(p as Fl_Printer ptr,pagecount as integer, frompage as integer ptr=0, topage as integer ptr=0) as integer
declare sub      Fl_PrinterEndJob(p as Fl_Printer ptr)

declare function Fl_PrinterStartPage(p as Fl_Printer ptr) as integer
declare function Fl_PrinterEndPage(p as Fl_Printer ptr) as integer

declare sub      Fl_PrinterGetMargins(p as Fl_Printer ptr,byref left as integer, byref top as integer, byref right as integer, byref bottom as integer)

declare sub      Fl_PrinterSetOrigin(p as Fl_Printer ptr,x as integer, y as integer)
declare sub      Fl_PrinterGetOrigin(p as Fl_Printer ptr,byref x as integer, byref y as integer)

declare sub      Fl_PrinterPrintWidget(p as Fl_Printer ptr,wgt as Fl_Widget ptr, delta_x as integer=0, delta_y as integer=0)
declare sub      Fl_PrinterPrintWindow(p as Fl_Printer ptr,win as Fl_Window ptr, x_offset as integer=0, y_offset as integer=0)
declare sub      Fl_PrinterPrintWindowPart(p as Fl_Printer ptr, win as Fl_Window ptr, x as integer, y as integer, w as integer, h as integer, delta_x as integer=0, delta_y as integer=0)

declare function Fl_PrinterGetPrintableRect(p as Fl_Printer ptr, byref w as integer, byref h as integer) as integer
declare sub      Fl_PrinterRotate(p as Fl_Printer ptr, angle as single)
declare sub      Fl_PrinterScale(p as Fl_Printer ptr, scale_x as single, scale_y as single=0.0)

declare sub      Fl_PrinterTranslate(p as Fl_Printer ptr, x as integer, y as integer)
declare sub      Fl_PrinterUntranslate(p as Fl_Printer ptr)

end extern

#endif ' __FLTK_C_BI__
