CGUI 2.1.0 update

External libraries (GTK, GSL, SDL, Allegro, OpenGL, etc) questions.
Post Reply
Dinosaur
Posts: 1478
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

CGUI 2.1.0 update

Post by Dinosaur »

Hi All

unbeknown to me there has been further development on the CGUI library.
A version 2.1.0 has been released from what appears to be additional participants in the project.

I have used FbFrog to translate the headers, but some of the new features are showing up as To Do:

It all has to do with the initial line in cgui.h

Code: Select all

CGUI_FUNC(int, InitCguiEx, (int w, int h, int colour_depth, int *errno_ptr, CGUI_METHOD(int, atexit_ptr, (CGUI_METHOD(void, f, (void))))));
It was in the .h file as two lines without a line continuation underscore, so is it simply declare Function ?
After that there are dozens of additional references to CGUI_FUNC

Code: Select all

CGUI_FUNC(void, CguiUseUTF8, (void));
CGUI_FUNC(int, CguiParseLabels, (int state));
which are all marked To Do:

Can somebody please tell me what should be placed in front of these lines to allow them to qualify for the FB calling syntax.

I am trying to update the version on FB with these changes.

Regards
Last edited by Dinosaur on May 07, 2019 17:32, edited 1 time in total.
birosys
Posts: 17
Joined: Aug 28, 2007 20:39

Re: CGUI update

Post by birosys »

Hi Dinosaur.

It is a platform specific macro declaration in cguicfg.h file.
I don't know how to properly translate that file to freebasic.

Cheers!
Dinosaur
Posts: 1478
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: CGUI update

Post by Dinosaur »

Hi All

Thanks for the response.
Interestingly, running the updated Library V2.1.0 with the V2.0.4 cgui.bi works perfectly,
but I guess no access to the new features.

Regards
TeeEmCee
Posts: 375
Joined: Jul 22, 2006 0:54
Location: Auckland

Re: CGUI update

Post by TeeEmCee »

I tried fbfrog (1.12, built from git on 2017-10-05) on cgui 2.1.0 and it worked almost flawlessly, it only got confused by a couple #define constants. Maybe your fbfrog is too old?

Results: https://hastebin.com/uliconegov.txt
Dinosaur
Posts: 1478
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: CGUI update

Post by Dinosaur »

Hi All

Thanks for testing that TeeEmCee , my version of fbfrog is 1.14 recently downloaded.

Can you tell me what folders you placed fbfrog and the cgui.h.
Did you also copy the cguicfg.h to your working folder ?

Regards

EDIT: Cgui needs Allegro-dev installed when compiling for the library and thus for making the .bi file.
Upgraded my Beaglebone Black to Allegro-4.4.3.1 but had real issues doing that on my Laptop (on which I don't do any Cgui development)
So, Fbfrog succeeded.
Dinosaur
Posts: 1478
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

CGUI 2.1.0 update

Post by Dinosaur »

Hi All

Cgui.bi update below.
Notes:
Previous conversion from cgui.h to .bi added the CGUI_ to a lot of variables.(probably manually done)
I assumed at the time that this is due to clashes with FB, so this time with FbFrog it didn't do that and I left
the variables as much as possible. Some changes were made ie: Right changed to Cgui_Right for obvious clashes.
Anything changed has the old version commented out.
If these names clash with other Graphic libraries, then it does not matter, as you can't take control of the screen without
first unloading Cgui.

HOWEVER, now anyone who has used this library and has all these CGUI_ insertions in their code,
will have to change either their version of the .bi file or change their source code.
I changed my source code so that any future upgrades will adapt easily.

The issue with CGUI_FUNC is still a puzzle, but removing the TODO's resulted in two duplication errors which I have commented out.

Code: Select all

#pragma once

#include once "crt/long.bi"
#include once "crt/stdio.bi"
#include once "crt/errno.bi"
#include once "crt/stdlib.bi"

extern "C"

#define CGUI_H

#ifdef __FB_WIN32__
    #define _CGUI_DLL __declspec(dllimport)
    #define CGUI_VAR(type, name) extern _CGUI_DLL type name
    #define CGUI_ARRAY(type, name) extern _CGUI_DLL type name[]
    #define CGUI_FUNC(type, name, args) type __cdecl name args
    #define CGUI_METHOD(type, name, args) type (*name) args
    #define CGUI_FUNCPTR(type, name, args) extern _CGUI_DLL type (*name) args
#endif

#define CGUI_BEGIN_INLINE(type, name, args) extern inline type name args
#define CGUI_PRINTF_FUNC(type, name, args, a, b) CGUI_FUNC(type, name, args) __attribute__ ((format (printf, a, b)))
#define CGUI_CONST_FUNC(type, name, args) CGUI_FUNC(type, name, args) __attribute__ ((const))

#if defined(__FB_DOS__) or defined(__FB_UNIX__)
    #define CGUI_VAR(type, name) extern type name
    #define CGUI_ARRAY(type, name) extern type name[]
    #define CGUI_FUNC(type, name, args) type name args
    #define CGUI_METHOD(type, name, args) type (*name) args
    #define CGUI_FUNCPTR(type, name, args) extern type (*name) args
#endif

#define CGUI_HAS_INLINE
#define CGUI_INLINE_PROVIDE_CODE
#define CGUI_END_OF_INLINE() ;
#define CGUI_END_OF_LOCAL_INLINE() ;
#define CGUI_INLINE(type, name, args, code) CGUI_BEGIN_INLINE(type, name, args) code CGUI_END_OF_INLINE()
#define CGUI_LOCAL_INLINE(type, name, args, code) CGUI_BEGIN_LOCAL_INLINE(type, name, args) code CGUI_END_OF_LOCAL_INLINE()
''#define cgui_va_arg_p(a, b) va_arg(*a, b)
''#define CGUI_PRINTFUNC(type, name, args, a, b) CGUI_FUNC(type, name, args)
#define CGUI_FUNC_DEPRECATED(type, name, args) CGUI_FUNC(__attribute__ ((deprecated)) type, name, args)
#define CGUI_PRINTFUNC_DEPRECATED(type, name, args, a, b) CGUI_PRINTFUNC(__attribute__ ((deprecated)) type, name, args, a, b)
#define CGUI_INLINE_DEPRECATED(type, name, args, code) CGUI_INLINE(__attribute__ ((deprecated)) type, name, args, code)

#if defined(__FB_WIN32__) or defined(__FB_UNIX__)
    #define nouse
#endif

#ifdef __FB_WIN32__
    #define inline __inline
#endif

const CGUI_VERSION_MAJOR = 2
const CGUI_VERSION_MINOR = 1
const CGUI_VERSION_PATCH = 0
#define CGUI_VERSION_STRING "2.1.0"
const CGUI_DATE = 20190110
#define CGUI_DATE_STRING "Jan 10, 2019"
const CGUI_INIT_CODE = 0
const CGUI_INIT_LOAD = 0
const CGUI_INIT_WINDOWED = 1
const CGUI_INIT_FULLSCREEN = 2
const CGUI_INIT_KEEP_CURRENT = 0
declare function InitCguiEx(byval w as long, byval h as long, byval colour_depth as long, byval errno_ptr as long ptr, byval atexit_ptr as function(byval f as sub()) as long) as long
#define InitCguiLoadMode() InitCguiEx(0, CGUI_INIT_LOAD, CGUI_INIT_CODE, @errno, cptr(function cdecl(byval as sub cdecl()) as long, atexit))
#define InitCguiFullscreenMode() InitCguiEx(0, CGUI_INIT_FULLSCREEN, CGUI_INIT_CODE, @errno, cptr(function cdecl(byval as sub cdecl()) as long, atexit))
#define InitCguiWindowedMode() InitCguiEx(0, CGUI_INIT_WINDOWED, CGUI_INIT_CODE, @errno, cptr(function cdecl(byval as sub cdecl()) as long, atexit))
#define InitCguiKeepCurrent() InitCguiEx(0, CGUI_INIT_KEEP_CURRENT, CGUI_INIT_CODE, @errno, cptr(function cdecl(byval as sub cdecl()) as long, atexit))
#define InitCgui(w, h, bpp) InitCguiEx(w, h, bpp, @errno, cptr(function cdecl(byval as sub cdecl()) as long, @atexit))

declare sub DeInitCgui()
declare sub CguiUseUTF8()
declare function CguiParseLabels(byval state as long) as long

#ifdef __FB_WIN32__
    extern import cgui_ver as long
    extern import cgui_rev as long
    extern import cgui_minor_rev as long
    extern import cgui_release_date as long
#else
    extern cgui_ver as long
    extern cgui_rev as long
    extern cgui_minor_rev as long
    extern cgui_release_date as long
#endif

const DIR_TOPLEFT = 1
const DIR_RIGHT = 2
const DIR_LEFT = 4
const DIR_DOWNLEFT = 8
const DIR_DOWN = &h10
const AUTOINDICATOR = &h007fffff

#define Cgui_TOPLEFT DIR_TOPLEFT,AUTOINDICATOR      'TopLeft'
#define Cgui_RIGHT DIR_RIGHT,AUTOINDICATOR          'Right'
#define Cgui_DOWNLEFT DIR_DOWNLEFT,AUTOINDICATOR    'DownLeft'
#define Cgui_LEFT DIR_LEFT,AUTOINDICATOR            'Left'
#define Cgui_DOWN DIR_DOWN,AUTOINDICATOR            'Down'

const ALIGNCENTRE = &h00800000
const ALIGNBOTTOM = &h01000000
const ALIGNRIGHT = &h02000000
const HORIZONTAL = &h04000000
const VERTICAL = &h08000000
const FILLSPACE = &h10000000
const EQUALWIDTH = &h20000000
const EQUALHEIGHT = &h40000000
#define ADAPTIVE 0,AUTOINDICATOR
#define FILLSCREEN 1,AUTOINDICATOR
declare function MkDialogue(byval width as long, byval height as long, byval label as const zstring ptr, byval attr as long) as long
const W_SIBLING = 1 shl 0
const W_NOMOVE = 1 shl 2
const W_FLOATING = 1 shl 3
const W_TOP = 1 shl 4
const W_BOTTOM = 1 shl 5
const W_LEFT = 1 shl 6
const W_RIGHT = 1 shl 7
const W_CENTRE_H = W_LEFT or W_RIGHT
const W_CENTRE_V = W_TOP or W_BOTTOM
const W_CENTRE = W_CENTRE_H or W_CENTRE_V

declare sub DisplayWin()
declare sub CloseWin(byval dummy as any ptr)
declare sub SetWindowPosition(byval x as long, byval y as long)
declare sub GetWinInfo(byval id as long, byval x as long ptr, byval y as long ptr, byval width as long ptr, byval height as long ptr)
declare sub DesktopImage(byval bmp as BITMAP ptr)
declare function CurrentWindow() as long
declare sub SetOperatingWindow(byval winid as long)
declare function Req(byval winheader as const zstring ptr, byval format_text as const zstring ptr) as long
declare function Request(byval title as const zstring ptr, byval options as long, byval width as long, byval format as const zstring ptr, ...) as long
declare sub RedrawScreen()
declare sub ScrMode(byval CallBack as sub())
declare function MkProgressWindow(byval wlabel as const zstring ptr, byval blabel as const zstring ptr, byval w as long) as long

#ifdef __FB_WIN32__
    extern import cgui_desktop_id as long
    extern import ID_DESKTOP alias "cgui_desktop_id" as long
#else
    extern cgui_desktop_id as long
    extern ID_DESKTOP alias "cgui_desktop_id" as long
#endif

declare function MkMenu(byval text as const zstring ptr, byval CallBack as sub(byval as any ptr), byval data as any ptr) as long
declare function MakeMenuBar() as long
declare function MkMenuBarItem(byval text as const zstring ptr, byval CallBack as sub(byval as any ptr), byval data as any ptr) as long
declare sub EndMenuBar()
declare function MkScratchMenu(byval id as long, byval CallBack as sub(byval as any ptr), byval data as any ptr) as long
declare function MkSingleMenu(byval x as long, byval y as long, byval text as const zstring ptr, byval CallBack as sub(byval as any ptr), byval data as any ptr) as long
declare function MkMenuItem(byval sub as long, byval text as const zstring ptr, byval shortcut as const zstring ptr, byval CallBack as sub(byval as any ptr), byval data as any ptr) as long
declare function MkMenuRadio(byval selvar as long ptr, byval n as long, ...) as long
declare function MkMenuCheck(byval checkvar as long ptr, byval text as const zstring ptr) as long
declare function HookMenuClose(byval CloseHook as sub(byval as any ptr), byval data as any ptr) as long
declare function MkGroove() as long
declare function AddButton(byval x as long, byval y as long, byval label as const zstring ptr, byval CallBack as sub(byval data as any ptr), byval data as any ptr) as long

type cgui_widget_sates as long
enum
    CGUI_WIDGET_STATE_NORMAL
    CGUI_WIDGET_STATE_OVER
    CGUI_WIDGET_STATE_DOWN
    CGUI_WIDGET_STATE_DOWN_BESIDE
    CGUI_WIDGET_STATE_GRIPPED
    CGUI_WIDGET_STATE_DRAGGING_OVER
end enum

declare function AddUserDefinedWidget(byval x as long, byval y as long, byval w as long, byval h as long, byval Draw as sub(byval as any ptr, byval bmp as BITMAP ptr, byval state as cgui_widget_sates), byval single_click as sub(byval as any ptr), byval data as any ptr) as long
declare function AddCheck(byval x as long, byval y as long, byval label as const zstring ptr, byval sel as long ptr) as long
const R_HORIZONTAL = 0
const R_VERTICAL = 1
declare function AddFlip(byval x as long, byval y as long, byval label as const zstring ptr, byval strs as const zstring const ptr ptr, byval sel as long ptr) as long
declare function AddDropDown(byval x as long, byval y as long, byval width as long, byval label as const zstring ptr, byval sel as long ptr, byval data as const any ptr, byval n as long, byval CallBack as sub(byval data as const any ptr, byval i as long, byval s as zstring ptr)) as long
declare function AddDropDownS(byval x as long, byval y as long, byval width as long, byval label as const zstring ptr, byval sel as long ptr, byval strs as const zstring const ptr ptr, byval n as long) as long
declare function AddDropDownD(byval x as long, byval y as long, byval width as long, byval label as const zstring ptr, byval sel as long ptr, byval listdata as const any ptr, byval Iterate as function(byval listdata as const any ptr, byval it as const any ptr, byval text as zstring ptr) as const any ptr) as long

#ifdef __FB_WIN32__
    extern import cgui_drop_down_list_row_spacing as long
#else
    extern cgui_drop_down_list_row_spacing as long
#endif

declare function MkRadioContainer(byval x as long, byval y as long, byval var as long ptr, byval direction as long) as long
declare function AddRadioButton(byval name as const zstring ptr) as long
declare sub EndRadioContainer()
declare function AddIcon(byval id as long, byval x as long, byval y as long, byval iconname as const zstring ptr, byval CallBack as sub(byval as any ptr), byval data as any ptr) as long
declare function MkCanvas(byval x as long, byval y as long, byval width as long, byval height as long, byval CallBack as sub(byval bmp as BITMAP ptr, byval x as long, byval y as long, byval data as any ptr), byval data as any ptr) as long
declare function GetRulerTabList(byval id as long, byval n as long ptr) as long ptr
declare function FlipRulerTab(byval id as long, byval x as long) as long
declare function AddTabRuler(byval x as long, byval y as long, byval width as long, byval height as long, byval dx as long, byval options as long, byval CallBack as sub(byval data as any ptr, byval x as long, byval tabs as long ptr, byval n as long), byval data as any ptr) as long
const TR_SHOWPOS = 1
declare function UpdateProgressValue(byval id as long, byval percent as long) as long
declare function AddProgressBar(byval x as long, byval y as long, byval w as long, byval h as long) as long

const SL_SCALE = 1
const SL_LABEL = 2
const SL_STYLE1 = 4
const SL_STYLE2 = 8
const SL_STYLE3 = &h20

declare function AddSlider(byval x as long, byval y as long, byval length as long, byval ctrl as long ptr, byval start as long, byval end as long, byval option as long, byval id as long) as long
declare function AddSliderFloat(byval x as long, byval y as long, byval length as long, byval ctrl as single ptr, byval start as single, byval end as single, byval ndecimals as long, byval option as long, byval id as long) as long
declare function HookSpinButtons(byval id as long, byval var as long ptr, byval delta1 as long, byval delta2 as long, byval minv as long, byval maxv as long) as long
declare function AddTag(byval x as long, byval y as long, byval tag as const zstring ptr) as long
declare function AddStatusField(byval x as long, byval y as long, byval width as long, byval FormatFunc as sub(byval data as any ptr, byval string as zstring ptr), byval data as any ptr) as long
declare function AddTextBox(byval x as long, byval y as long, byval text as const zstring ptr, byval width as long, byval nrows as long, byval option as long) as long
declare function AddTextboxHighlightSection(byval id as long, byval bgcolor as long, byval startrow as long, byval startcolumn as long, byval endrow as long, byval endcolumn as long) as long
declare function ClearTextboxHighlightSections(byval id as long) as long
declare function ClearLastTextboxHighlightSection(byval id as long) as long
declare function TextboxGetTopRow(byval id as long) as long
declare sub TextboxHighlighting(byval id as long, byval bgcolor as long, byval textcolor as long, byval line_nr as long)
declare sub TextboxScrollDownOneLine(byval id as long)
declare function TextboxGetHighlightedText(byval id as long) as const zstring ptr

const TB_FRAMERAISE = &h80000000
const TB_FRAMESINK = &h40000000
const TB_PREFORMAT = &h20000000
const TB_LINEFEED_ = &h10000000
const TB_FIXFONT = &h08000000
const TB_WHITE = &h04000000
const TB_TEXTFILE = &h02000000
const TB_FOCUS_END = &h01000000
declare function UpdateTextBoxText(byval id as long, byval s as const zstring ptr) as long
declare function AddEditBox(byval x as long, byval y as long, byval width as long, byval label as const zstring ptr, byval format as long, byval string_buffer_size as long, byval data as any ptr) as long
const TERMINATE_EDIT = 999

declare function AttachComboProperty(byval id as long, byval sel as long ptr, byval strings as const zstring const ptr ptr, byval n as long) as long
declare function CguiEditBoxSetFloatDecimals(byval id as long, byval max_nr_of_decimals as long) as long
declare sub CguiEditBoxSetSelectionMode(byval mode as long)
declare sub GetEditData(byval scan as long ptr, byval ascii as long ptr, byval offset as long ptr)
declare sub SetEditData(byval scan as long, byval ascii as long, byval offset as long)
declare function TabOnCR(byval id as long) as long
declare function CguiEditBoxSelectAll(byval id as long) as long

const FBYTE = 1
const FSHORT = 2
const FINT = 3
const FLONG = 4
const FSTRING = 5
const FPTRSTR = 6
const FPOINTS = 7
const FBPOINTS = 8
const FFLOAT = 9
const FDOUBLE = 10
const FHEX1 = 11
const FHEX2 = 12
const FHEX4 = 13
const FOCT1 = 14
const FOCT2 = 15
const FOCT3 = 16
const FOCT4 = 17
const ISO8601_DATE = 18
const FNAME = &h20
const FBLANK0 = &h40
const FUNDEF = &h6000
const B_UNDEF_VAL = &hFF
const S_UNDEF_VAL = &h8000
const I_UNDEF_VAL = cast(clong, &h80000000)
const L_UNDEF_VAL = cast(clong, &h80000000)
const P_UNDEF_VAL = &h8000
const BP_UNDEF_VAL = &h80

declare sub Refresh(byval id as long)
declare sub DeActivate(byval id as long)
declare sub Activate(byval id as long)
declare function CguiLoadImage(byval filename as const zstring ptr, byval imagename as const zstring ptr, byval transp as long, byval id as long) as long
declare function InsertPoint(byval id as long) as long

const IMAGE_BMP = 0
const IMAGE_TRANS_BMP = 1
const IMAGE_RLE_SPRITE = 2
const IMAGE_CMP_SPRITE = 3
declare function RegisterImage(byval data as any ptr, byval imagename as const zstring ptr, byval type as long, byval id as long) as long
declare function GetRegisteredImage(byval name as const zstring ptr, byval type as long ptr, byval id as long) as const any ptr
const LEFT_MOUSE = &h1
const RIGHT_MOUSE = &h2
const MID_MOUSE = &h4

declare sub SetObjectSlidable(byval id as long, byval Slider as function(byval x as long, byval y as long, byval src as any ptr, byval id as long, byval reason as long) as long, byval buttons as long, byval data as any ptr)
declare sub SetObjectDouble(byval id as long, byval DoubleCall as sub(byval as any ptr), byval data as any ptr, byval button as long)
declare sub SetObjectGrippable(byval id as long, byval Grip as function(byval src as any ptr, byval id as long, byval reason as long) as any ptr, byval flags as long, byval buttons as long, byval data as any ptr)
declare sub SetObjectDroppable(byval id as long, byval Drop as function(byval dest as any ptr, byval id as long, byval src as any ptr, byval reason as long, byval flags as long) as long, byval flags as long, byval data as any ptr)

const DD_GRIPPED = 0
const DD_UNGRIPPED = 1
const DD_SUCCESS = 2
const DD_OVER_GRIP = 3
const DD_OVER_DROP = 4
const DD_END_OVER_DROP = 5
const SL_OVER = 6
const SL_OVER_END = 7
const SL_STARTED = 8
const SL_PROGRESS = 9
const SL_STOPPED = 10

declare function ToolTipText(byval id as long, byval text as const zstring ptr) as long
declare sub CguiSetToolTipDelay(byval delay as long)
declare sub CguiSetToolTipAnimation(byval step as long, byval delay as long)
declare function SetView(byval id as long, byval flags as long) as long

const SV_HIDE_LABEL = 1
const SV_HIDE_ICON = 2
const SV_NO_TOOLTIP = 4
const SV_ONLY_BRIEF = 8
const SV_ONLY_LONG = 16
const SV_PREFERE_BRIEF = 32
const SV_PREFERE_LONG = 0

declare function RegisterDragFlag(byval flag as long) as long
declare function UnRegisterDragFlag(byval flag as long) as long
declare function SetMouseButtons(byval id as long, byval buttons as long) as long
declare sub Remove_ alias "Remove"(byval id as long)
''declare sub Remove(byval id as long)
declare sub Destroy(byval id as long)
declare function GetPressedButton(byval id as long) as long
declare sub PointerOn(byval id as long)
declare sub ModifyHeader(byval id as long, byval newtag as zstring ptr)
declare function AddHandler(byval id as long, byval Handler as sub(byval data as any ptr), byval data as any ptr) as long
declare sub Click(byval id as long)
declare function GetObjectPosition(byval id as long, byval x as long ptr, byval y as long ptr, byval wx as long ptr, byval wy as long ptr) as long
declare function GetObjectSize(byval id as long, byval w as long ptr, byval h as long ptr) as long
declare sub SetBlitLimit(byval x1 as long, byval y1 as long, byval x2 as long, byval y2 as long)

#ifdef __FB_WIN32__
    extern import cgui_use_vsync as long
#else
    extern cgui_use_vsync as long
#endif

const CT_BORDER = 1
const CT_OBJECT_TABLE = 2
declare function StartContainer(byval x as long, byval y as long, byval width as long, byval height as long, byval label as const zstring ptr, byval options as long) as long
declare sub EndContainer()
declare sub SelectContainer(byval id as long)
declare function SetSpacing(byval id as long, byval leftx as long, byval xdist as long, byval rightx as long, byval topy as long, byval ydist as long, byval boty as long) as long
declare sub SetMeasure(byval leftx as long, byval xdist as long, byval rightx as long, byval topy as long, byval ydist as long, byval boty as long)
declare sub SetDistance(byval xdist as long, byval ydist as long)
declare sub ReBuildContainer(byval id as long)
declare sub EmptyContainer(byval id as long)

const OFF = 0
''const ON = 1
const ROW_STRIKE = 1 shl 31
const ROW_UNDERLINE = 1 shl 30
const ROW_CHECK = 1 shl 29
const ROW_UNCHECK = 1 shl 28
const COL_RIGHT_ALIGN = 1 shl 27
const ROW_COLUMN_UNDERLINE = 1 shl 26

declare function AddList(byval x as long, byval y as long, byval listdata as any ptr, byval n as const long ptr, byval width as long, byval events as long, byval TextFormatter as function(byval as any ptr, byval as zstring ptr) as long, byval Action as sub(byval id as long, byval as any ptr), byval norows as long) as long
declare function SetLinkedList(byval id as long, byval NextCreater as function(byval list as any ptr, byval prev as any ptr) as any ptr) as long
declare function SetIndexedList(byval id as long, byval IndexCreater as function(byval list as any ptr, byval i as long) as any ptr) as long
declare function RefreshListRow(byval id as long, byval i as long) as long
declare function GetMarkedRows(byval listid as long, byval n as long ptr) as any ptr ptr
declare function BrowseToF(byval id as long, byval i as long) as long
declare function BrowseToL(byval id as long, byval i as long) as long
declare function BrowseTo(byval id as long, byval i as long, byval uncond as long) as long
declare function SetListColumns(byval id as long, byval RowTextCreater as function(byval rowdata as any ptr, byval s as zstring ptr, byval colnr as long) as long, byval widths as long ptr, byval n as long, byval options as long, byval labels as zstring ptr ptr, byval CallBack as sub(byval data as any ptr, byval id as long, byval i as long), byval data as any ptr) as long
declare function SetListGrippable(byval listid as long, byval Grip as function(byval srcobj as any ptr, byval reason as long, byval srclist as any ptr, byval i as long) as long, byval flags as long, byval buttons as long) as long
declare function SetListDroppable(byval listid as long, byval Drop as function(byval destobj as any ptr, byval reason as long, byval srcobj as any ptr, byval destlist as any ptr, byval i as long, byval flags as long) as long, byval flags as long) as long
declare function SetListDoubleClick(byval listid as long, byval AppDouble as sub(byval id as long, byval data as any ptr, byval i as long), byval button as long) as long
declare function HookList(byval listid as long, byval listdata as any ptr, byval n as long ptr, byval width as long, byval events as long, byval TextFormatter as function(byval as any ptr, byval as zstring ptr) as long, byval Action as sub(byval as long, byval as any ptr)) as long
declare function SetDeleteHandler(byval listid as long, byval CallBack as sub(byval rowid as long, byval object as any ptr)) as long
declare function SetInsertHandler(byval listid as long, byval CallBack as sub(byval list as any ptr, byval index as long)) as long
declare function GetListIndex(byval id as long) as long
declare function HookExit(byval id as long, byval ExitFun as sub(byval data as any ptr), byval data as any ptr) as long
declare function NotifyFocusMove(byval listid as long, byval CallBack as sub(byval id as long, byval rowobject as any ptr)) as long
const TR_HIDE_ROOT = &h00000001
declare function ListTreeView(byval listid as long, byval width as long, byval IsLeaf as function(byval rowobject as any ptr) as long, byval options as long) as long
declare function ListTreeSetNodesExpandedState(byval listid as long, byval IsExpanded as function(byval data as any ptr) as long) as long
declare function ListTreeSetNodeExpandedState(byval listid as long, byval new_expanded_state as long, byval data as any ptr) as long
declare function InstallBelowListEndCallBack(byval listid as long, byval CallBack as sub(byval id as long, byval data as any ptr), byval data as any ptr) as long
declare function CguiListBoxSetToolTip(byval listid as long, byval mode as long, byval options as long) as long
declare sub CguiListBoxRowSetBar(byval color as long, byval percentage as double)
declare function CguiListBoxRowGetClickedColumn(byval rowid as long) as long
declare sub CguiListBoxSetColumnSelection(byval listid as long, byval state as long)

#ifdef __FB_WIN32__
    extern import cgui_list_no_multiple_row_selection as long
    extern import cgui_list_show_focused_row as long
    extern import CGUI_list_font as FONT ptr
    extern import CGUI_list_row_font as FONT ptr
    extern import CGUI_list_row_f_color as long
    extern import CGUI_list_row_b_color as long
    extern import CGUI_list_vspace as long
    extern import CGUI_list_fixfont as long
    extern import cgui_list_fix_digits as long
#else
    extern cgui_list_no_multiple_row_selection as long
    extern cgui_list_show_focused_row as long
    extern CGUI_list_font as FONT ptr
    extern CGUI_list_row_font as FONT ptr
    extern CGUI_list_row_f_color as long
    extern CGUI_list_row_b_color as long
    extern CGUI_list_vspace as long
    extern CGUI_list_fixfont as long
    extern cgui_list_fix_digits as long
#endif

const LIST_COLUMNS_ADJUSTABLE = 1 shl 0
const LIST_COLUMNS_ADJUSTABLE_KEEP_BOX_WIDTH = 1 shl 1
const LIST_COLUMNS_DELIMITER = 1 shl 2

declare function MkVerticalBrowser(byval x as long, byval y as long, byval CallBack as sub(byval data as any ptr), byval data as any ptr, byval viewpos as long ptr) as long
declare function MkHorizontalBrowser(byval x as long, byval y as long, byval CallBack as sub(byval data as any ptr), byval data as any ptr, byval viewpos as long ptr) as long
declare function NotifyBrowser(byval id as long, byval step as long, byval scrolled_area_length as long) as long
declare function SetBrowserSize(byval id as long, byval view_port_length as long, byval browser_length as long) as long
declare function RegisterFileType(byval ext as const zstring ptr, byval Handler as sub(byval data as any ptr, byval path as zstring ptr), byval data as any ptr, byval aname as const zstring ptr, byval icon as const zstring ptr, byval label as const zstring ptr, byval Viewer as sub(byval privatedata as any ptr, byval viewdata as any ptr)) as long
declare function FileSelect(byval masks as const zstring ptr, byval rpath as const zstring ptr, byval flags as long, byval winheader as const zstring ptr, byval buttonlabel as const zstring ptr) as const zstring ptr
declare sub FileManager(byval winheader as const zstring ptr, byval flags as long)
declare function UnPackSelection(byval flist as zstring ptr ptr) as zstring ptr

const FS_BROWSE_DAT = 1 shl 0
const FS_DISABLE_EDIT_DAT = 1 shl 1
const FS_WARN_EXISTING_FILE = 1 shl 2
const FS_FORBID_EXISTING_FILE = 1 shl 3
const FS_REQUIRE_EXISTING_FILE = 1 shl 4
const FS_SELECT_DIR = 1 shl 5
const FS_DISABLE_CREATE_DIR = 1 shl 6
const FS_DISABLE_DELETING = 1 shl 7
const FS_DISABLE_COPYING = 1 shl 8
const FS_SHOW_MENU = 1 shl 9
const FS_NO_SETTINGS_IN_CONFIG = 1 shl 10
const FS_MULTIPLE_SELECTION = 1 shl 11
const FS_NO_DRAG_DROP = 1 shl 12
const FS_DIRECT_SELECT_BY_DOUBLE_CLICK = 1 shl 13
const FS_SAVE_AS = 1 shl 14
const FS_SHOW_DIR_TREE = 1 shl 15
const FS_SHOW_DIRS_IN_FILE_VIEW = 1 shl 16
const FS_HIDE_LOCATION = 1 shl 17
const FS_HIDE_UP_BUTTON = 1 shl 18
const FS_HIDE_UP_DIRECTORY = 1 shl 19
const FS_FILE_FILTER_IS_READ_ONLY = 1 shl 20
const FM_HIDE_FILE_VEW = 1 shl 21
const FM_DO_NOT_SHOW_MENU = 1 shl 22
const FM_NO_FLOATING = 1 shl 23
const FM_BROWSE_DAT = FS_BROWSE_DAT
const FM_DISABLE_EDIT_DAT = FS_DISABLE_EDIT_DAT
const FM_DISABLE_CREATE_DIR = FS_DISABLE_CREATE_DIR
const FM_DISABLE_DELETING = FS_DISABLE_DELETING
const FM_DISABLE_COPYING = FS_DISABLE_COPYING
const FM_NO_SETTINGS_IN_CONFIG = FS_NO_SETTINGS_IN_CONFIG
const FM_SHOW_DIRS_IN_FILE_VIEW = FS_SHOW_DIRS_IN_FILE_VIEW
const FM_HIDE_LOCATION = FS_HIDE_LOCATION
const FM_HIDE_UP_BUTTON = FS_HIDE_UP_BUTTON
const FM_HIDE_UP_DIRECTORY = FS_HIDE_UP_DIRECTORY

declare sub CguiUseIcons(byval filename as const zstring ptr)
declare function CreateTabWindow(byval x as long, byval y as long, byval width as long, byval height as long, byval status as long ptr) as long
declare function AddTab(byval id as long, byval callback as sub(byval data as any ptr, byval id as long), byval data as any ptr, byval label as const zstring ptr) as long
declare sub HookLeaveTab(byval callback as sub(byval data as any ptr), byval data as any ptr)
declare function SetFocusOn(byval id as long) as long
declare function JoinTabChain(byval id as long) as long
declare function GetCurrentFocus(byval id as long) as long
declare sub SetCguiFont(byval f as FONT ptr)
declare function GetCguiFont() as FONT ptr
declare function GetCguiFixFont() as FONT ptr
declare sub CguiSetBaseLine(byval base_line as long)
declare function Invite(byval mask as long, byval data as any ptr, byval text as zstring ptr) as long
declare function Attend(byval mask as long) as any ptr
declare sub ProcessEvents()
declare sub StopProcessEvents()
declare function GenEvent(byval Handler as sub(byval as any ptr), byval msg as any ptr, byval delay as ulong, byval objid as long) as ulong
declare sub CguiEventIterateFunction(byval Function as function(byval as any ptr) as long, byval as any ptr)
declare function KillEvent(byval id as ulong) as long
declare sub FlushGenEvents()
declare sub CguiYieldTimeslice(byval state as long)

#ifdef __FB_WIN32__
    extern import event_message_buffer_size as long
#else
    extern event_message_buffer_size as long
#endif

declare sub InstallKBHandler(byval Handler as function(byval data as any ptr, byval scan as long, byval key as long) as long, byval data as any ptr)
declare function UnInstallKBHandler(byval Handler as function(byval as any ptr, byval as long, byval as long) as long) as any ptr
declare function SetHotKey(byval id as long, byval CallBack as sub(byval as any ptr), byval data as any ptr, byval scan as long, byval ascii as long) as long
declare function IsHotKey(byval scan as long, byval ascii as long) as long
declare sub SimulateHotKeys(byval control as long, byval key as long)
declare sub UseHotKeys(byval s as zstring ptr)
declare sub AutoHotKeys(byval mode as long)

#ifdef __FB_WIN32__
    extern import cgui_colors(0 to ...) as long
#else
    extern cgui_colors(0 to 256) as long           ''extern cgui_colors(0 to ...) as long
#endif

type t_cgui_colors as long
enum
    CGUI_COLOR_DESKTOP
    CGUI_COLOR_UNSELECTED_TAB
    CGUI_COLOR_SELECTED_TAB
    CGUI_COLOR_LIGHTENED_BORDER
    CGUI_COLOR_HEAVY_LIGHTENED_BORDER
    CGUI_COLOR_SHADOWED_BORDER
    CGUI_COLOR_HEAVY_SHADOWED_BORDER
    CGUI_COLOR_CONTAINER
    CGUI_COLOR_WIDGET_BACKGROUND
    CGUI_COLOR_LABEL
    CGUI_COLOR_LABEL_FOCUS
    CGUI_COLOR_LABEL_HIDDEN_FOCUS
    CGUI_COLOR_LABEL_INACTIVE_1
    CGUI_COLOR_LABEL_INACTIVE_2
    CGUI_COLOR_BUTTON_FRAME_FOCUS
    CGUI_COLOR_TEXT_CURSOR
    CGUI_COLOR_DRAGGED_TEXT
    CGUI_COLOR_LISTBOX_TEXT
    CGUI_COLOR_LISTBOX_BACKGROUND
    CGUI_COLOR_LISTBOX_FOCUS_TEXT
    CGUI_COLOR_LISTBOX_FOCUS_BACKGROUND
    CGUI_COLOR_LISTBOX_HIDDEN_FOCUS_BACKGROUND
    CGUI_COLOR_LISTBOX_HIDDEN_FOCUS_TEXT
    CGUI_COLOR_LISTBOX_ROW_DELIMITER
    CGUI_COLOR_LISTBOX_COLUMN_DELIMITER
    CGUI_COLOR_TOOL_TIP_BACKGROUND
    CGUI_COLOR_TOOL_TIP_FRAME
    CGUI_COLOR_TOOL_TIP_TEXT
    CGUI_COLOR_TEXTBOX_TEXT
    CGUI_COLOR_TEXTBOX_BACKGROUND
    CGUI_COLOR_CONTAINER_LABEL
    CGUI_COLOR_EDITBOX_BACKGROUND_MARK
    CGUI_COLOR_EDITBOX_TEXT_MARK
    CGUI_COLOR_EDITBOX_BACKGROUND_INACTIVE
    CGUI_COLOR_EDITBOX_TEXT_INACTIVE
    CGUI_COLOR_EDITBOX_BACKGROUND
    CGUI_COLOR_EDITBOX_TEXT
    CGUI_COLOR_STATUSFIELD_BACKGROUND
    CGUI_COLOR_STATUSFIELD_TEXT
    CGUI_COLOR_PROGRESSBAR
    CGUI_COLOR_PROGRESSBAR_BACKGROUND
    CGUI_COLOR_TITLE_FOCUS_BACKGROUND
    CGUI_COLOR_TITLE_FOCUS_TEXT
    CGUI_COLOR_TITLE_UNFOCUS_BACKGROUND
    CGUI_COLOR_TITLE_UNFOCUS_TEXT
    CGUI_COLOR_TREE_VIEW_BACKGROUND
    CGUI_COLOR_TREE_CONTROL_BACKGROUND
    CGUI_COLOR_TREE_CONTROL_OUTLINE
    CGUI_COLOR_CHECKBOX_MARK_BACKGROUND
    CGUI_COLOR_BROWSEBAR_BACKGROUND
    CGUI_COLOR_BROWSEBAR_HANDLE_BACKGROUND
    CGUI_COLOR_RESIZER_HANDLE
    NR_OF_CGUI_COLORS
end enum

declare function CguiSetColor(byval color_name as long, byval r as long, byval g as long, byval b as long) as long
declare sub NameCase(byval text as zstring ptr)
declare sub Sound(byval freq as long, byval duration as long)
declare function AddClock(byval x as long, byval y as long, byval options as long) as long

const CLOCK_SHOW_SECONDS = 1
const CLOCK_SHOW_MINUTES = 2
const CLOCK_NO_DIALOGUE = 4

declare function ToUpper(byval chr as long) as long
declare function SaveDatafileObject(byval path as const zstring ptr, byval data as any ptr, byval type as long) as long
declare function CreateNewDataFile(byval path as const zstring ptr, byval fn as const zstring ptr, byval pack as long, byval pwd as const zstring ptr) as long
declare function msprintf(byval format as const zstring ptr, ...) as zstring ptr
declare sub InstallCursor(byval cursor_no as long, byval sprite as BITMAP ptr, byval x as long, byval y as long)
declare sub ShowPointer()
declare sub HidePointer()
declare sub PointerLocation(byval id as long, byval x as long ptr, byval y as long ptr)
declare function ObjectApearance(byval id as long) as BITMAP ptr
declare sub OverlayPointer(byval sprite as BITMAP ptr, byval x as long, byval y as long)
declare sub RemoveOverlayPointer()
declare sub MkTextPointer(byval f as FONT ptr, byval text as const zstring ptr)
declare sub SelectCursor(byval cursor_no as long)

const CURS_ILLEGAL = 0
const CURS_DRAGGABLE = 1
const CURS_DRAG_V = 2
const CURS_DRAG_H = 3
const CURS_CROSS = 4
const CURS_BUSY = 5
const CURS_DEFAULT = 6
declare sub CguiSetMouseInput(byval MouseInput as sub(byval x as long ptr, byval y as long ptr, byval z as long ptr, byval buttons as long ptr), byval ForcePos as sub(byval x as long, byval y as long), byval SetRange as sub(byval x as long, byval y as long, byval w as long, byval h as long))
declare sub SetMousePos(byval x as long, byval y as long)

#ifdef __FB_WIN32__
    extern import cgui_mouse_draw_in_interrupt as long
#else
    extern cgui_mouse_draw_in_interrupt as long
#endif

declare function LoadTexts(byval fn as const zstring ptr, byval section as const zstring ptr, byval nr as long ptr) as const zstring const ptr ptr
declare sub DestroyTexts()
declare sub RegisterConversionHandler(byval Handler as sub(byval as any ptr, byval as zstring ptr), byval data as any ptr, byval name as const zstring ptr)
declare sub PrintFloatingConversion(byval dest as zstring ptr, byval src as const zstring ptr)
declare function LoadCompiledTexts(byval dat as const DATAFILE ptr, byval section as const zstring ptr, byval nr as long ptr) as const zstring const ptr ptr
declare sub RegisterRefresh(byval id as long, byval AppUpd as sub(byval id as long, byval data as any ptr, byval calldata as any ptr, byval reason as long), byval data as any ptr)
declare sub ConditionalRefresh(byval calldata as any ptr, byval reason as long)
declare function GetSizeOffset(byval id as long, byval x as long ptr, byval y as long ptr) as long
declare function SetSizeOffset(byval id as long, byval x as long, byval y as long) as long
declare function MakeStretchable(byval id as long, byval Notify as sub(byval as any ptr), byval data as any ptr, byval options as long) as long
const NO_VERTICAL = 1
const NO_HORIZONTAL = 2

#ifdef __FB_WIN32__
    extern import continous_update_resize as long
#else
    extern continous_update_resize as long
#endif

const FRAMERAISE = TB_FRAMERAISE
const FRAMESINK = TB_FRAMESINK
const W_NOMODAL = W_FLOATING
const W_CHILD = 0

end extern
Regards
Post Reply